codexapp 0.1.45 → 0.1.46

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.
@@ -0,0 +1,1428 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
+ * @vue/shared v3.5.30
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function Va(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _t={},ns=[],On=()=>{},Hu=()=>!1,Qo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Wa=e=>e.startsWith("onUpdate:"),Nt=Object.assign,za=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},vh=Object.prototype.hasOwnProperty,dt=(e,t)=>vh.call(e,t),Ue=Array.isArray,rs=e=>ro(e)==="[object Map]",Vu=e=>ro(e)==="[object Set]",Ol=e=>ro(e)==="[object Date]",Ge=e=>typeof e=="function",It=e=>typeof e=="string",wn=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",Wu=e=>(pt(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),zu=Object.prototype.toString,ro=e=>zu.call(e),yh=e=>ro(e).slice(8,-1),qu=e=>ro(e)==="[object Object]",qa=e=>It(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ns=Va(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Zo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},wh=/-\w/g,en=Zo(e=>e.replace(wh,t=>t.slice(1).toUpperCase())),bh=/\B([A-Z])/g,Sr=Zo(e=>e.replace(bh,"-$1").toLowerCase()),ei=Zo(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ai=Zo(e=>e?`on${ei(e)}`:""),Rn=(e,t)=>!Object.is(e,t),Io=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Gu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ga=e=>{const t=parseFloat(e);return isNaN(t)?e:t},_h=e=>{const t=It(e)?Number(e):NaN;return isNaN(t)?e:t};let Nl;const ti=()=>Nl||(Nl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hr(e){if(Ue(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=It(r)?Ih(r):Hr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(It(e)||pt(e))return e}const kh=/;(?![^(]*\))/g,Th=/:([^]+)/,Sh=/\/\*[^]*?\*\//g;function Ih(e){const t={};return e.replace(Sh,"").split(kh).forEach(n=>{if(n){const r=n.split(Th);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ot(e){let t="";if(It(e))t=e;else if(Ue(e))for(let n=0;n<e.length;n++){const r=ot(e[n]);r&&(t+=r+" ")}else if(pt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Eh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ch=Va(Eh);function Ku(e){return!!e||e===""}function Ah(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ka(e[r],t[r]);return n}function Ka(e,t){if(e===t)return!0;let n=Ol(e),r=Ol(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=wn(e),r=wn(t),n||r)return e===t;if(n=Ue(e),r=Ue(t),n||r)return n&&r?Ah(e,t):!1;if(n=pt(e),r=pt(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||!Ka(e[i],t[i]))return!1}}return String(e)===String(t)}const Ju=e=>!!(e&&e.__v_isRef===!0),oe=e=>It(e)?e:e==null?"":Ue(e)||pt(e)&&(e.toString===zu||!Ge(e.toString))?Ju(e)?oe(e.value):JSON.stringify(e,Yu,2):String(e),Yu=(e,t)=>Ju(t)?Yu(e,t.value):rs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Ri(r,o)+" =>"]=s,n),{})}:Vu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ri(n))}:wn(t)?Ri(t):pt(t)&&!Ue(t)&&!qu(t)?String(t):t,Ri=(e,t="")=>{var n;return wn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.30
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let on;class Rh{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=on,!t&&on&&(this.index=(on.scopes||(on.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=on;try{return on=this,t()}finally{on=n}}}on(){++this._on===1&&(this.prevScope=on,on=this)}off(){this._on>0&&--this._on===0&&(on=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 Ph(){return on}let Tt;const Pi=new WeakSet;class Xu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,on&&on.active&&on.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Pi.has(this)&&(Pi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Zu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$l(this),ed(this);const t=Tt,n=gn;Tt=this,gn=!0;try{return this.fn()}finally{td(this),Tt=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Xa(t);this.deps=this.depsTail=void 0,$l(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Pi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ca(this)&&this.run()}get dirty(){return ca(this)}}let Qu=0,$s,Ds;function Zu(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=$s,$s=e}function Ja(){Qu++}function Ya(){if(--Qu>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$s;){let t=$s;for($s=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function ed(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function td(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Xa(r),xh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ca(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(nd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function nd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vs)||(e.globalVersion=Vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ca(e))))return;e.flags|=2;const t=e.dep,n=Tt,r=gn;Tt=e,gn=!0;try{ed(e);const s=e.fn(e._value);(t.version===0||Rn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tt=n,gn=r,td(e),e.flags&=-3}}function Xa(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)Xa(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const rd=[];function Yn(){rd.push(gn),gn=!1}function Xn(){const e=rd.pop();gn=e===void 0?!0:e}function $l(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tt;Tt=void 0;try{t()}finally{Tt=n}}}let Vs=0;class Mh{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 Qa{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Tt||!gn||Tt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tt)n=this.activeLink=new Mh(Tt,this),Tt.deps?(n.prevDep=Tt.depsTail,Tt.depsTail.nextDep=n,Tt.depsTail=n):Tt.deps=Tt.depsTail=n,sd(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Tt.depsTail,n.nextDep=void 0,Tt.depsTail.nextDep=n,Tt.depsTail=n,Tt.deps===n&&(Tt.deps=r)}return n}trigger(t){this.version++,Vs++,this.notify(t)}notify(t){Ja();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ya()}}}function sd(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)sd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ua=new WeakMap,Ur=Symbol(""),da=Symbol(""),Ws=Symbol("");function Vt(e,t,n){if(gn&&Tt){let r=ua.get(e);r||ua.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Qa),s.map=r,s.key=n),s.track()}}function zn(e,t,n,r,s,o){const i=ua.get(e);if(!i){Vs++;return}const a=l=>{l&&l.trigger()};if(Ja(),t==="clear")i.forEach(a);else{const l=Ue(e),d=l&&qa(n);if(l&&n==="length"){const u=Number(r);i.forEach((p,w)=>{(w==="length"||w===Ws||!wn(w)&&w>=u)&&a(p)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(Ws)),t){case"add":l?d&&a(i.get("length")):(a(i.get(Ur)),rs(e)&&a(i.get(da)));break;case"delete":l||(a(i.get(Ur)),rs(e)&&a(i.get(da)));break;case"set":rs(e)&&a(i.get(Ur));break}}Ya()}function Xr(e){const t=lt(e);return t===e?t:(Vt(t,"iterate",Ws),fn(e)?t:t.map(bn))}function ni(e){return Vt(e=lt(e),"iterate",Ws),e}function Cn(e,t){return Qn(e)?ds(Br(e)?bn(t):t):bn(t)}const Oh={__proto__:null,[Symbol.iterator](){return xi(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>Ue(t)?Xr(t):t))},entries(){return xi(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Bn(this,"every",e,t,void 0,arguments)},filter(e,t){return Bn(this,"filter",e,t,n=>n.map(r=>Cn(this,r)),arguments)},find(e,t){return Bn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Mi(this,"includes",e)},indexOf(...e){return Mi(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return Mi(this,"lastIndexOf",e)},map(e,t){return Bn(this,"map",e,t,void 0,arguments)},pop(){return Cs(this,"pop")},push(...e){return Cs(this,"push",e)},reduce(e,...t){return Dl(this,"reduce",e,t)},reduceRight(e,...t){return Dl(this,"reduceRight",e,t)},shift(){return Cs(this,"shift")},some(e,t){return Bn(this,"some",e,t,void 0,arguments)},splice(...e){return Cs(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return Cs(this,"unshift",e)},values(){return xi(this,"values",e=>Cn(this,e))}};function xi(e,t,n){const r=ni(e),s=r[t]();return r!==e&&!fn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Nh=Array.prototype;function Bn(e,t,n,r,s,o){const i=ni(e),a=i!==e&&!fn(e),l=i[t];if(l!==Nh[t]){const p=l.apply(e,o);return a?bn(p):p}let d=n;i!==e&&(a?d=function(p,w){return n.call(this,Cn(e,p),w,e)}:n.length>2&&(d=function(p,w){return n.call(this,p,w,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function Dl(e,t,n,r){const s=ni(e),o=s!==e&&!fn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,u,p){return a&&(a=!1,d=Cn(e,d)),n.call(this,d,Cn(e,u),p,e)}):n.length>3&&(i=function(d,u,p){return n.call(this,d,u,p,e)}));const l=s[t](i,...r);return a?Cn(e,l):l}function Mi(e,t,n){const r=lt(e);Vt(r,"iterate",Ws);const s=r[t](...n);return(s===-1||s===!1)&&tl(n[0])?(n[0]=lt(n[0]),r[t](...n)):s}function Cs(e,t,n=[]){Yn(),Ja();const r=lt(e)[t].apply(e,n);return Ya(),Xn(),r}const $h=Va("__proto__,__v_isRef,__isVue"),od=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(wn));function Dh(e){wn(e)||(e=String(e));const t=lt(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class id{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?qh:ud:o?cd:ld).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ue(t);if(!s){let l;if(i&&(l=Oh[n]))return l;if(n==="hasOwnProperty")return Dh}const a=Reflect.get(t,n,Gt(t)?t:r);if((wn(n)?od.has(n):$h(n))||(s||Vt(t,"get",n),o))return a;if(Gt(a)){const l=i&&qa(n)?a:a.value;return s&&pt(l)?ha(l):l}return pt(a)?s?ha(a):ri(a):a}}class ad extends id{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Ue(t)&&qa(n);if(!this._isShallow){const d=Qn(o);if(!fn(r)&&!Qn(r)&&(o=lt(o),r=lt(r)),!i&&Gt(o)&&!Gt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,Gt(t)?t:s);return t===lt(s)&&(a?Rn(r,o)&&zn(t,"set",n,r):zn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&zn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!wn(n)||!od.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",Ue(t)?"length":Ur),Reflect.ownKeys(t)}}class Lh extends id{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const jh=new ad,Uh=new Lh,Bh=new ad(!0);const fa=e=>e,go=e=>Reflect.getPrototypeOf(e);function Fh(e,t,n){return function(...r){const s=this.__v_raw,o=lt(s),i=rs(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?fa:t?ds:bn;return!t&&Vt(o,"iterate",l?da:Ur),Nt(Object.create(d),{next(){const{value:p,done:w}=d.next();return w?{value:p,done:w}:{value:a?[u(p[0]),u(p[1])]:u(p),done:w}}})}}function vo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hh(e,t){const n={get(s){const o=this.__v_raw,i=lt(o),a=lt(s);e||(Rn(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=go(i),d=t?fa:e?ds:bn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Vt(lt(s),"iterate",Ur),s.size},has(s){const o=this.__v_raw,i=lt(o),a=lt(s);return e||(Rn(s,a)&&Vt(i,"has",s),Vt(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=lt(a),d=t?fa:e?ds:bn;return!e&&Vt(l,"iterate",Ur),a.forEach((u,p)=>s.call(o,d(u),d(p),i))}};return Nt(n,e?{add:vo("add"),set:vo("set"),delete:vo("delete"),clear:vo("clear")}:{add(s){const o=lt(this),i=go(o),a=lt(s),l=!t&&!fn(s)&&!Qn(s)?a:s;return i.has.call(o,l)||Rn(s,l)&&i.has.call(o,s)||Rn(a,l)&&i.has.call(o,a)||(o.add(l),zn(o,"add",l,l)),this},set(s,o){!t&&!fn(o)&&!Qn(o)&&(o=lt(o));const i=lt(this),{has:a,get:l}=go(i);let d=a.call(i,s);d||(s=lt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?Rn(o,u)&&zn(i,"set",s,o):zn(i,"add",s,o),this},delete(s){const o=lt(this),{has:i,get:a}=go(o);let l=i.call(o,s);l||(s=lt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&zn(o,"delete",s,void 0),d},clear(){const s=lt(this),o=s.size!==0,i=s.clear();return o&&zn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Fh(s,e,t)}),n}function Za(e,t){const n=Hh(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const Vh={get:Za(!1,!1)},Wh={get:Za(!1,!0)},zh={get:Za(!0,!1)};const ld=new WeakMap,cd=new WeakMap,ud=new WeakMap,qh=new WeakMap;function Gh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Kh(e){return e.__v_skip||!Object.isExtensible(e)?0:Gh(yh(e))}function ri(e){return Qn(e)?e:el(e,!1,jh,Vh,ld)}function dd(e){return el(e,!1,Bh,Wh,cd)}function ha(e){return el(e,!0,Uh,zh,ud)}function el(e,t,n,r,s){if(!pt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Kh(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 Br(e){return Qn(e)?Br(e.__v_raw):!!(e&&e.__v_isReactive)}function Qn(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function tl(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!dt(e,"__v_skip")&&Object.isExtensible(e)&&Gu(e,"__v_skip",!0),e}const bn=e=>pt(e)?ri(e):e,ds=e=>pt(e)?ha(e):e;function Gt(e){return e?e.__v_isRef===!0:!1}function L(e){return fd(e,!1)}function Yh(e){return fd(e,!0)}function fd(e,t){return Gt(e)?e:new Xh(e,t)}class Xh{constructor(t,n){this.dep=new Qa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:bn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||fn(t)||Qn(t);t=r?t:lt(t),Rn(t,n)&&(this._rawValue=t,this._value=r?t:bn(t),this.dep.trigger())}}function ve(e){return Gt(e)?e.value:e}const Qh={get:(e,t,n)=>t==="__v_raw"?e:ve(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Gt(s)&&!Gt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function hd(e){return Br(e)?e:new Proxy(e,Qh)}class Zh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Zu(this,!0),!0}get value(){const t=this.dep.track();return nd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ep(e,t,n=!1){let r,s;return Ge(e)?r=e:(r=e.get,s=e.set),new Zh(r,s,n)}const yo={},$o=new WeakMap;let Or;function tp(e,t=!1,n=Or){if(n){let r=$o.get(n);r||$o.set(n,r=[]),r.push(e)}}function np(e,t,n=_t){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=H=>s?H:fn(H)||s===!1||s===0?qn(H,1):qn(H);let u,p,w,I,F=!1,R=!1;if(Gt(e)?(p=()=>e.value,F=fn(e)):Br(e)?(p=()=>d(e),F=!0):Ue(e)?(R=!0,F=e.some(H=>Br(H)||fn(H)),p=()=>e.map(H=>{if(Gt(H))return H.value;if(Br(H))return d(H);if(Ge(H))return l?l(H,2):H()})):Ge(e)?t?p=l?()=>l(e,2):e:p=()=>{if(w){Yn();try{w()}finally{Xn()}}const H=Or;Or=u;try{return l?l(e,3,[I]):e(I)}finally{Or=H}}:p=On,t&&s){const H=p,se=s===!0?1/0:s;p=()=>qn(H(),se)}const B=Ph(),N=()=>{u.stop(),B&&B.active&&za(B.effects,u)};if(o&&t){const H=t;t=(...se)=>{H(...se),N()}}let P=R?new Array(e.length).fill(yo):yo;const D=H=>{if(!(!(u.flags&1)||!u.dirty&&!H))if(t){const se=u.run();if(s||F||(R?se.some((ae,pe)=>Rn(ae,P[pe])):Rn(se,P))){w&&w();const ae=Or;Or=u;try{const pe=[se,P===yo?void 0:R&&P[0]===yo?[]:P,I];P=se,l?l(t,3,pe):t(...pe)}finally{Or=ae}}}else u.run()};return a&&a(D),u=new Xu(p),u.scheduler=i?()=>i(D,!1):D,I=H=>tp(H,!1,u),w=u.onStop=()=>{const H=$o.get(u);if(H){if(l)l(H,4);else for(const se of H)se();$o.delete(u)}},t?r?D(!0):P=u.run():i?i(D.bind(null,!0),!0):u.run(),N.pause=u.pause.bind(u),N.resume=u.resume.bind(u),N.stop=N,N}function qn(e,t=1/0,n){if(t<=0||!pt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gt(e))qn(e.value,t,n);else if(Ue(e))for(let r=0;r<e.length;r++)qn(e[r],t,n);else if(Vu(e)||rs(e))e.forEach(r=>{qn(r,t,n)});else if(qu(e)){for(const r in e)qn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&qn(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.30
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function so(e,t,n,r){try{return r?e(...r):e()}catch(s){si(s,t,n)}}function _n(e,t,n,r){if(Ge(e)){const s=so(e,t,n,r);return s&&Wu(s)&&s.catch(o=>{si(o,t,n)}),s}if(Ue(e)){const s=[];for(let o=0;o<e.length;o++)s.push(_n(e[o],t,n,r));return s}}function si(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||_t;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let p=0;p<u.length;p++)if(u[p](e,l,d)===!1)return}a=a.parent}if(o){Yn(),so(o,null,10,[e,l,d]),Xn();return}}rp(e,n,s,r,i)}function rp(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Qt=[];let In=-1;const ss=[];let mr=null,Zr=0;const pd=Promise.resolve();let Do=null;function qt(e){const t=Do||pd;return e?t.then(this?e.bind(this):e):t}function sp(e){let t=In+1,n=Qt.length;for(;t<n;){const r=t+n>>>1,s=Qt[r],o=zs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function nl(e){if(!(e.flags&1)){const t=zs(e),n=Qt[Qt.length-1];!n||!(e.flags&2)&&t>=zs(n)?Qt.push(e):Qt.splice(sp(t),0,e),e.flags|=1,md()}}function md(){Do||(Do=pd.then(vd))}function op(e){Ue(e)?ss.push(...e):mr&&e.id===-1?mr.splice(Zr+1,0,e):e.flags&1||(ss.push(e),e.flags|=1),md()}function Ll(e,t,n=In+1){for(;n<Qt.length;n++){const r=Qt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Qt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function gd(e){if(ss.length){const t=[...new Set(ss)].sort((n,r)=>zs(n)-zs(r));if(ss.length=0,mr){mr.push(...t);return}for(mr=t,Zr=0;Zr<mr.length;Zr++){const n=mr[Zr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}mr=null,Zr=0}}const zs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function vd(e){try{for(In=0;In<Qt.length;In++){const t=Qt[In];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),so(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;In<Qt.length;In++){const t=Qt[In];t&&(t.flags&=-2)}In=-1,Qt.length=0,gd(),Do=null,(Qt.length||ss.length)&&vd()}}let jt=null,yd=null;function Lo(e){const t=jt;return jt=e,yd=e&&e.type.__scopeId||null,t}function gt(e,t=jt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Fo(-1);const o=Lo(t);let i;try{i=e(...s)}finally{Lo(o),r._d&&Fo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Zn(e,t){if(jt===null)return e;const n=ui(jt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=_t]=t[s];o&&(Ge(o)&&(o={mounted:o,updated:o}),o.deep&&qn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ar(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&&(Yn(),_n(l,n,8,[e.el,a,e,t]),Xn())}}function Eo(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 vn(e,t,n=!1){const r=al();if(r||is){let s=is?is._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 ip=Symbol.for("v-scx"),ap=()=>vn(ip);function ht(e,t,n){return wd(e,t,n)}function wd(e,t,n=_t){const{immediate:r,deep:s,flush:o,once:i}=n,a=Nt({},n),l=t&&r||!t&&o!=="post";let d;if(Ys){if(o==="sync"){const I=ap();d=I.__watcherHandles||(I.__watcherHandles=[])}else if(!l){const I=()=>{};return I.stop=On,I.resume=On,I.pause=On,I}}const u=zt;a.call=(I,F,R)=>_n(I,u,F,R);let p=!1;o==="post"?a.scheduler=I=>{Ht(I,u&&u.suspense)}:o!=="sync"&&(p=!0,a.scheduler=(I,F)=>{F?I():nl(I)}),a.augmentJob=I=>{t&&(I.flags|=4),p&&(I.flags|=2,u&&(I.id=u.uid,I.i=u))};const w=np(e,t,a);return Ys&&(d?d.push(w):l&&w()),w}function lp(e,t,n){const r=this.proxy,s=It(e)?e.includes(".")?bd(r,e):()=>r[e]:e.bind(r,r);let o;Ge(t)?o=t:(o=t.handler,n=t);const i=oo(this),a=wd(s,o.bind(r),n);return i(),a}function bd(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 _d=Symbol("_vte"),kd=e=>e.__isTeleport,Ls=e=>e&&(e.disabled||e.disabled===""),jl=e=>e&&(e.defer||e.defer===""),Ul=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Bl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,pa=(e,t)=>{const n=e&&e.to;return It(n)?t?t(n):null:n},Td={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:p,pbc:w,o:{insert:I,querySelector:F,createText:R,createComment:B}}=d,N=Ls(t.props);let{shapeFlag:P,children:D,dynamicChildren:H}=t;if(e==null){const se=t.el=R(""),ae=t.anchor=R("");I(se,n,r),I(ae,n,r);const pe=(ce,te)=>{P&16&&u(D,ce,te,s,o,i,a,l)},Te=()=>{const ce=t.target=pa(t.props,F),te=ma(ce,t,R,I);ce&&(i!=="svg"&&Ul(ce)?i="svg":i!=="mathml"&&Bl(ce)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ce),N||(pe(ce,te),Co(t,!1)))};N&&(pe(n,ae),Co(t,!0)),jl(t.props)?(t.el.__isMounted=!1,Ht(()=>{Te(),delete t.el.__isMounted},o)):Te()}else{if(jl(t.props)&&e.el.__isMounted===!1){Ht(()=>{Td.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const se=t.anchor=e.anchor,ae=t.target=e.target,pe=t.targetAnchor=e.targetAnchor,Te=Ls(e.props),ce=Te?n:ae,te=Te?se:pe;if(i==="svg"||Ul(ae)?i="svg":(i==="mathml"||Bl(ae))&&(i="mathml"),H?(w(e.dynamicChildren,H,ce,s,o,i,a),ol(e,t,!0)):l||p(e,t,ce,te,s,o,i,a,!1),N)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):wo(t,n,se,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ie=t.target=pa(t.props,F);ie&&wo(t,ie,null,d,0)}else Te&&wo(t,ae,pe,d,1);Co(t,N)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:p,props:w}=e;if(p&&(s(d),s(u)),o&&s(l),i&16){const I=o||!Ls(w);for(let F=0;F<a.length;F++){const R=a[F];r(R,t,n,I,!!R.dynamicChildren)}}},move:wo,hydrate:cp};function wo(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,p=o===2;if(p&&r(i,t,n),(!p||Ls(u))&&l&16)for(let w=0;w<d.length;w++)s(d[w],t,n,2);p&&r(a,t,n)}function cp(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},p){function w(B,N){let P=N;for(;P;){if(P&&P.nodeType===8){if(P.data==="teleport start anchor")t.targetStart=P;else if(P.data==="teleport anchor"){t.targetAnchor=P,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}P=i(P)}}function I(B,N){N.anchor=p(i(B),N,a(B),n,r,s,o)}const F=t.target=pa(t.props,l),R=Ls(t.props);if(F){const B=F._lpa||F.firstChild;t.shapeFlag&16&&(R?(I(e,t),w(F,B),t.targetAnchor||ma(F,t,u,d,a(e)===F?e:null)):(t.anchor=i(e),w(F,B),t.targetAnchor||ma(F,t,u,d),p(B&&i(B),t,F,n,r,s,o))),Co(t,R)}else R&&t.shapeFlag&16&&(I(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const jo=Td;function Co(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 ma(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[_d]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),As=Symbol("_enterCb");function up(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sr(()=>{e.isMounted=!0}),or(()=>{e.isUnmounting=!0}),e}const un=[Function,Array],Sd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:un,onEnter:un,onAfterEnter:un,onEnterCancelled:un,onBeforeLeave:un,onLeave:un,onAfterLeave:un,onLeaveCancelled:un,onBeforeAppear:un,onAppear:un,onAfterAppear:un,onAppearCancelled:un},Id=e=>{const t=e.subTree;return t.component?Id(t.component):t},dp={name:"BaseTransition",props:Sd,setup(e,{slots:t}){const n=al(),r=up();return()=>{const s=t.default&&Ad(t.default(),!0);if(!s||!s.length)return;const o=Ed(s),i=lt(e),{mode:a}=i;if(r.isLeaving)return Oi(o);const l=Fl(o);if(!l)return Oi(o);let d=ga(l,i,r,n,p=>d=p);l.type!==Wt&&qs(l,d);let u=n.subTree&&Fl(n.subTree);if(u&&u.type!==Wt&&!$r(u,l)&&Id(n).type!==Wt){let p=ga(u,i,r,n);if(qs(u,p),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,u=void 0},Oi(o);a==="in-out"&&l.type!==Wt?p.delayLeave=(w,I,F)=>{const R=Cd(r,u);R[String(u.key)]=u,w[En]=()=>{I(),w[En]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{F(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Ed(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const fp=dp;function Cd(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 ga(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:p,onBeforeLeave:w,onLeave:I,onAfterLeave:F,onLeaveCancelled:R,onBeforeAppear:B,onAppear:N,onAfterAppear:P,onAppearCancelled:D}=t,H=String(e.key),se=Cd(n,e),ae=(ce,te)=>{ce&&_n(ce,r,9,te)},pe=(ce,te)=>{const ie=te[1];ae(ce,te),Ue(ce)?ce.every(Y=>Y.length<=1)&&ie():ce.length<=1&&ie()},Te={mode:i,persisted:a,beforeEnter(ce){let te=l;if(!n.isMounted)if(o)te=B||l;else return;ce[En]&&ce[En](!0);const ie=se[H];ie&&$r(e,ie)&&ie.el[En]&&ie.el[En](),ae(te,[ce])},enter(ce){if(se[H]===e)return;let te=d,ie=u,Y=p;if(!n.isMounted)if(o)te=N||d,ie=P||u,Y=D||p;else return;let Ae=!1;ce[As]=Me=>{Ae||(Ae=!0,Me?ae(Y,[ce]):ae(ie,[ce]),Te.delayedLeave&&Te.delayedLeave(),ce[As]=void 0)};const Se=ce[As].bind(null,!1);te?pe(te,[ce,Se]):Se()},leave(ce,te){const ie=String(e.key);if(ce[As]&&ce[As](!0),n.isUnmounting)return te();ae(w,[ce]);let Y=!1;ce[En]=Se=>{Y||(Y=!0,te(),Se?ae(R,[ce]):ae(F,[ce]),ce[En]=void 0,se[ie]===e&&delete se[ie])};const Ae=ce[En].bind(null,!1);se[ie]=e,I?pe(I,[ce,Ae]):Ae()},clone(ce){const te=ga(ce,t,n,r,s);return s&&s(te),te}};return Te}function Oi(e){if(oi(e))return e=Tr(e),e.children=null,e}function Fl(e){if(!oi(e))return kd(e.type)&&e.children?Ed(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 qs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ad(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Le?(i.patchFlag&128&&s++,r=r.concat(Ad(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?Tr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function $t(e,t){return Ge(e)?Nt({name:e.name},t,{setup:e}):e}function Rd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Hl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Uo=new WeakMap;function js(e,t,n,r,s=!1){if(Ue(e)){e.forEach((R,B)=>js(R,t&&(Ue(t)?t[B]:t),n,r,s));return}if(os(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&js(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ui(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===_t?a.refs={}:a.refs,p=a.setupState,w=lt(p),I=p===_t?Hu:R=>Hl(u,R)?!1:dt(w,R),F=(R,B)=>!(B&&Hl(u,B));if(d!=null&&d!==l){if(Vl(t),It(d))u[d]=null,I(d)&&(p[d]=null);else if(Gt(d)){const R=t;F(d,R.k)&&(d.value=null),R.k&&(u[R.k]=null)}}if(Ge(l))so(l,a,12,[i,u]);else{const R=It(l),B=Gt(l);if(R||B){const N=()=>{if(e.f){const P=R?I(l)?p[l]:u[l]:F()||!e.k?l.value:u[e.k];if(s)Ue(P)&&za(P,o);else if(Ue(P))P.includes(o)||P.push(o);else if(R)u[l]=[o],I(l)&&(p[l]=u[l]);else{const D=[o];F(l,e.k)&&(l.value=D),e.k&&(u[e.k]=D)}}else R?(u[l]=i,I(l)&&(p[l]=i)):B&&(F(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const P=()=>{N(),Uo.delete(e)};P.id=-1,Uo.set(e,P),Ht(P,n)}else Vl(e),N()}}}function Vl(e){const t=Uo.get(e);t&&(t.flags|=8,Uo.delete(e))}ti().requestIdleCallback;ti().cancelIdleCallback;const os=e=>!!e.type.__asyncLoader,oi=e=>e.type.__isKeepAlive;function hp(e,t){Pd(e,"a",t)}function pp(e,t){Pd(e,"da",t)}function Pd(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(ii(t,r,n),n){let s=n.parent;for(;s&&s.parent;)oi(s.parent.vnode)&&mp(r,t,n,s),s=s.parent}}function mp(e,t,n,r){const s=ii(t,e,r,!0);ai(()=>{za(r[t],s)},n)}function ii(e,t,n=zt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Yn();const a=oo(n),l=_n(t,n,e,i);return a(),Xn(),l});return r?s.unshift(o):s.push(o),o}}const rr=e=>(t,n=zt)=>{(!Ys||e==="sp")&&ii(e,(...r)=>t(...r),n)},gp=rr("bm"),sr=rr("m"),vp=rr("bu"),yp=rr("u"),or=rr("bum"),ai=rr("um"),wp=rr("sp"),bp=rr("rtg"),_p=rr("rtc");function kp(e,t=zt){ii("ec",e,t)}const Tp="components",xd=Symbol.for("v-ndc");function va(e){return It(e)?Sp(Tp,e,!1)||e:e||xd}function Sp(e,t,n=!0,r=!1){const s=jt||zt;if(s){const o=s.type;{const a=lm(o,!1);if(a&&(a===t||a===en(t)||a===ei(en(t))))return o}const i=Wl(s[e]||o[e],t)||Wl(s.appContext[e],t);return!i&&r?o:i}}function Wl(e,t){return e&&(e[t]||e[en(t)]||e[ei(en(t))])}function bt(e,t,n,r){let s;const o=n,i=Ue(e);if(i||It(e)){const a=i&&Br(e);let l=!1,d=!1;a&&(l=!fn(e),d=Qn(e),e=ni(e)),s=new Array(e.length);for(let u=0,p=e.length;u<p;u++)s[u]=t(l?d?ds(bn(e[u])):bn(e[u]):e[u],u,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(pt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function Mn(e,t,n={},r,s){if(jt.ce||jt.parent&&os(jt.parent)&&jt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ft(Le,null,[Ie("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),b();const i=o&&Md(o(n)),a=n.key||i&&i.key,l=ft(Le,{key:(a&&!wn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Md(e){return e.some(t=>Ks(t)?!(t.type===Wt||t.type===Le&&!Md(t.children)):!0)?e:null}const ya=e=>e?Qd(e)?ui(e):ya(e.parent):null,Us=Nt(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=>ya(e.parent),$root:e=>ya(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Nd(e),$forceUpdate:e=>e.f||(e.f=()=>{nl(e.update)}),$nextTick:e=>e.n||(e.n=qt.bind(e.proxy)),$watch:e=>lp.bind(e)}),Ni=(e,t)=>e!==_t&&!e.__isScriptSetup&&dt(e,t),Ip={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 w=i[t];if(w!==void 0)switch(w){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ni(r,t))return i[t]=1,r[t];if(s!==_t&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==_t&&dt(n,t))return i[t]=4,n[t];wa&&(i[t]=0)}}const d=Us[t];let u,p;if(d)return t==="$attrs"&&Vt(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==_t&&dt(n,t))return i[t]=4,n[t];if(p=l.config.globalProperties,dt(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ni(s,t)?(s[t]=n,!0):r!==_t&&dt(r,t)?(r[t]=n,!0):dt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==_t&&a[0]!=="$"&&dt(e,a)||Ni(t,a)||dt(o,a)||dt(r,a)||dt(Us,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ep(){return Cp().slots}function Cp(e){const t=al();return t.setupContext||(t.setupContext=ef(t))}function zl(e){return Ue(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let wa=!0;function Ap(e){const t=Nd(e),n=e.proxy,r=e.ctx;wa=!1,t.beforeCreate&&ql(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:p,mounted:w,beforeUpdate:I,updated:F,activated:R,deactivated:B,beforeDestroy:N,beforeUnmount:P,destroyed:D,unmounted:H,render:se,renderTracked:ae,renderTriggered:pe,errorCaptured:Te,serverPrefetch:ce,expose:te,inheritAttrs:ie,components:Y,directives:Ae,filters:Se}=t;if(d&&Rp(d,r,null),i)for(const Oe in i){const me=i[Oe];Ge(me)&&(r[Oe]=me.bind(n))}if(s){const Oe=s.call(n,n);pt(Oe)&&(e.data=ri(Oe))}if(wa=!0,o)for(const Oe in o){const me=o[Oe],at=Ge(me)?me.bind(n,n):Ge(me.get)?me.get.bind(n,n):On,Ye=!Ge(me)&&Ge(me.set)?me.set.bind(n):On,Xe=ue({get:at,set:Ye});Object.defineProperty(r,Oe,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:We=>Xe.value=We})}if(a)for(const Oe in a)Od(a[Oe],r,n,Oe);if(l){const Oe=Ge(l)?l.call(n):l;Reflect.ownKeys(Oe).forEach(me=>{Eo(me,Oe[me])})}u&&ql(u,e,"c");function Re(Oe,me){Ue(me)?me.forEach(at=>Oe(at.bind(n))):me&&Oe(me.bind(n))}if(Re(gp,p),Re(sr,w),Re(vp,I),Re(yp,F),Re(hp,R),Re(pp,B),Re(kp,Te),Re(_p,ae),Re(bp,pe),Re(or,P),Re(ai,H),Re(wp,ce),Ue(te))if(te.length){const Oe=e.exposed||(e.exposed={});te.forEach(me=>{Object.defineProperty(Oe,me,{get:()=>n[me],set:at=>n[me]=at,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===On&&(e.render=se),ie!=null&&(e.inheritAttrs=ie),Y&&(e.components=Y),Ae&&(e.directives=Ae),ce&&Rd(e)}function Rp(e,t,n=On){Ue(e)&&(e=ba(e));for(const r in e){const s=e[r];let o;pt(s)?"default"in s?o=vn(s.from||r,s.default,!0):o=vn(s.from||r):o=vn(s),Gt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ql(e,t,n){_n(Ue(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Od(e,t,n,r){let s=r.includes(".")?bd(n,r):()=>n[r];if(It(e)){const o=t[e];Ge(o)&&ht(s,o)}else if(Ge(e))ht(s,e.bind(n));else if(pt(e))if(Ue(e))e.forEach(o=>Od(o,t,n,r));else{const o=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(o)&&ht(s,o,e)}}function Nd(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>Bo(l,d,i,!0)),Bo(l,t,i)),pt(t)&&o.set(t,l),l}function Bo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Bo(e,o,n,!0),s&&s.forEach(i=>Bo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Pp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Pp={data:Gl,props:Kl,emits:Kl,methods:Os,computed:Os,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:Os,directives:Os,watch:Mp,provide:Gl,inject:xp};function Gl(e,t){return t?e?function(){return Nt(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function xp(e,t){return Os(ba(e),ba(t))}function ba(e){if(Ue(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Yt(e,t){return e?[...new Set([].concat(e,t))]:t}function Os(e,t){return e?Nt(Object.create(null),e,t):t}function Kl(e,t){return e?Ue(e)&&Ue(t)?[...new Set([...e,...t])]:Nt(Object.create(null),zl(e),zl(t??{})):t}function Mp(e,t){if(!e)return t;if(!t)return e;const n=Nt(Object.create(null),e);for(const r in t)n[r]=Yt(e[r],t[r]);return n}function $d(){return{app:null,config:{isNativeTag:Hu,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 Op=0;function Np(e,t){return function(r,s=null){Ge(r)||(r=Nt({},r)),s!=null&&!pt(s)&&(s=null);const o=$d(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Op++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:um,get config(){return o.config},set config(u){},use(u,...p){return i.has(u)||(u&&Ge(u.install)?(i.add(u),u.install(d,...p)):Ge(u)&&(i.add(u),u(d,...p))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,p){return p?(o.components[u]=p,d):o.components[u]},directive(u,p){return p?(o.directives[u]=p,d):o.directives[u]},mount(u,p,w){if(!l){const I=d._ceVNode||Ie(r,s);return I.appContext=o,w===!0?w="svg":w===!1&&(w=void 0),e(I,u,w),l=!0,d._container=u,u.__vue_app__=d,ui(I.component)}},onUnmount(u){a.push(u)},unmount(){l&&(_n(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,p){return o.provides[u]=p,d},runWithContext(u){const p=is;is=d;try{return u()}finally{is=p}}};return d}}let is=null;const $p=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${en(t)}Modifiers`]||e[`${Sr(t)}Modifiers`];function Dp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||_t;let s=n;const o=t.startsWith("update:"),i=o&&$p(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>It(u)?u.trim():u)),i.number&&(s=n.map(Ga)));let a,l=r[a=Ai(t)]||r[a=Ai(en(t))];!l&&o&&(l=r[a=Ai(Sr(t))]),l&&_n(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,_n(d,e,6,s)}}const Lp=new WeakMap;function Dd(e,t,n=!1){const r=n?Lp: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=d=>{const u=Dd(d,t,!0);u&&(a=!0,Nt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(pt(e)&&r.set(e,null),null):(Ue(o)?o.forEach(l=>i[l]=null):Nt(i,o),pt(e)&&r.set(e,i),i)}function li(e,t){return!e||!Qo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Sr(t))||dt(e,t))}function Jl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:p,data:w,setupState:I,ctx:F,inheritAttrs:R}=e,B=Lo(e);let N,P;try{if(n.shapeFlag&4){const H=s||r,se=H;N=An(d.call(se,H,u,p,I,w,F)),P=a}else{const H=t;N=An(H.length>1?H(p,{attrs:a,slots:i,emit:l}):H(p,null)),P=t.props?a:jp(a)}}catch(H){Bs.length=0,si(H,e,1),N=Ie(Wt)}let D=N;if(P&&R!==!1){const H=Object.keys(P),{shapeFlag:se}=D;H.length&&se&7&&(o&&H.some(Wa)&&(P=Up(P,o)),D=Tr(D,P,!1,!0))}return n.dirs&&(D=Tr(D,null,!1,!0),D.dirs=D.dirs?D.dirs.concat(n.dirs):n.dirs),n.transition&&qs(D,n.transition),N=D,Lo(B),N}const jp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Qo(n))&&((t||(t={}))[n]=e[n]);return t},Up=(e,t)=>{const n={};for(const r in e)(!Wa(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Bp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Yl(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let p=0;p<u.length;p++){const w=u[p];if(Ld(i,r,w)&&!li(d,w))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Yl(r,i,d):!0:!!i;return!1}function Yl(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(Ld(t,e,o)&&!li(n,o))return!0}return!1}function Ld(e,t,n){const r=e[n],s=t[n];return n==="style"&&pt(r)&&pt(s)?!Ka(r,s):r!==s}function Fp({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const jd={},Ud=()=>Object.create(jd),Bd=e=>Object.getPrototypeOf(e)===jd;function Hp(e,t,n,r=!1){const s={},o=Ud();e.propsDefaults=Object.create(null),Fd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:dd(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Vp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=lt(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let p=0;p<u.length;p++){let w=u[p];if(li(e.emitsOptions,w))continue;const I=t[w];if(l)if(dt(o,w))I!==o[w]&&(o[w]=I,d=!0);else{const F=en(w);s[F]=_a(l,a,F,I,e,!1)}else I!==o[w]&&(o[w]=I,d=!0)}}}else{Fd(e,t,s,o)&&(d=!0);let u;for(const p in a)(!t||!dt(t,p)&&((u=Sr(p))===p||!dt(t,u)))&&(l?n&&(n[p]!==void 0||n[u]!==void 0)&&(s[p]=_a(l,a,p,void 0,e,!0)):delete s[p]);if(o!==a)for(const p in o)(!t||!dt(t,p))&&(delete o[p],d=!0)}d&&zn(e.attrs,"set","")}function Fd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ns(l))continue;const d=t[l];let u;s&&dt(s,u=en(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:li(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=lt(n),d=a||_t;for(let u=0;u<o.length;u++){const p=o[u];n[p]=_a(s,l,p,d[p],e,!dt(d,p))}}return i}function _a(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ge(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=oo(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Sr(n))&&(r=!0))}return r}const Wp=new WeakMap;function Hd(e,t,n=!1){const r=n?Wp:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ge(e)){const u=p=>{l=!0;const[w,I]=Hd(p,t,!0);Nt(i,w),I&&a.push(...I)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return pt(e)&&r.set(e,ns),ns;if(Ue(o))for(let u=0;u<o.length;u++){const p=en(o[u]);Xl(p)&&(i[p]=_t)}else if(o)for(const u in o){const p=en(u);if(Xl(p)){const w=o[u],I=i[p]=Ue(w)||Ge(w)?{type:w}:Nt({},w),F=I.type;let R=!1,B=!0;if(Ue(F))for(let N=0;N<F.length;++N){const P=F[N],D=Ge(P)&&P.name;if(D==="Boolean"){R=!0;break}else D==="String"&&(B=!1)}else R=Ge(F)&&F.name==="Boolean";I[0]=R,I[1]=B,(R||dt(I,"default"))&&a.push(p)}}const d=[i,a];return pt(e)&&r.set(e,d),d}function Xl(e){return e[0]!=="$"&&!Ns(e)}const rl=e=>e==="_"||e==="_ctx"||e==="$stable",sl=e=>Ue(e)?e.map(An):[An(e)],zp=(e,t,n)=>{if(t._n)return t;const r=gt((...s)=>sl(t(...s)),n);return r._c=!1,r},Vd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(rl(s))continue;const o=e[s];if(Ge(o))t[s]=zp(s,o,r);else if(o!=null){const i=sl(o);t[s]=()=>i}}},Wd=(e,t)=>{const n=sl(t);e.slots.default=()=>n},zd=(e,t,n)=>{for(const r in t)(n||!rl(r))&&(e[r]=t[r])},qp=(e,t,n)=>{const r=e.slots=Ud();if(e.vnode.shapeFlag&32){const s=t._;s?(zd(r,t,n),n&&Gu(r,"_",s,!0)):Vd(t,r)}else t&&Wd(e,t)},Gp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=_t;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:zd(s,t,n):(o=!t.$stable,Vd(t,s)),i=t}else t&&(Wd(e,t),i={default:1});if(o)for(const a in s)!rl(a)&&i[a]==null&&delete s[a]},Ht=Qp;function Kp(e){return Jp(e)}function Jp(e,t){const n=ti();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:p,nextSibling:w,setScopeId:I=On,insertStaticContent:F}=e,R=(y,k,M,W=null,U=null,x=null,j=void 0,q=null,K=!!k.dynamicChildren)=>{if(y===k)return;y&&!$r(y,k)&&(W=V(y),We(y,U,x,!0),y=null),k.patchFlag===-2&&(K=!1,k.dynamicChildren=null);const{type:G,ref:ge,shapeFlag:fe}=k;switch(G){case ci:B(y,k,M,W);break;case Wt:N(y,k,M,W);break;case Di:y==null&&P(k,M,W,j);break;case Le:Y(y,k,M,W,U,x,j,q,K);break;default:fe&1?se(y,k,M,W,U,x,j,q,K):fe&6?Ae(y,k,M,W,U,x,j,q,K):(fe&64||fe&128)&&G.process(y,k,M,W,U,x,j,q,K,we)}ge!=null&&U?js(ge,y&&y.ref,x,k||y,!k):ge==null&&y&&y.ref!=null&&js(y.ref,null,x,y,!0)},B=(y,k,M,W)=>{if(y==null)r(k.el=a(k.children),M,W);else{const U=k.el=y.el;k.children!==y.children&&d(U,k.children)}},N=(y,k,M,W)=>{y==null?r(k.el=l(k.children||""),M,W):k.el=y.el},P=(y,k,M,W)=>{[y.el,y.anchor]=F(y.children,k,M,W,y.el,y.anchor)},D=({el:y,anchor:k},M,W)=>{let U;for(;y&&y!==k;)U=w(y),r(y,M,W),y=U;r(k,M,W)},H=({el:y,anchor:k})=>{let M;for(;y&&y!==k;)M=w(y),s(y),y=M;s(k)},se=(y,k,M,W,U,x,j,q,K)=>{if(k.type==="svg"?j="svg":k.type==="math"&&(j="mathml"),y==null)ae(k,M,W,U,x,j,q,K);else{const G=y.el&&y.el._isVueCE?y.el:null;try{G&&G._beginPatch(),ce(y,k,U,x,j,q,K)}finally{G&&G._endPatch()}}},ae=(y,k,M,W,U,x,j,q)=>{let K,G;const{props:ge,shapeFlag:fe,transition:be,dirs:Ee}=y;if(K=y.el=i(y.type,x,ge&&ge.is,ge),fe&8?u(K,y.children):fe&16&&Te(y.children,K,null,W,U,$i(y,x),j,q),Ee&&Ar(y,null,W,"created"),pe(K,y,y.scopeId,j,W),ge){for(const Ve in ge)Ve!=="value"&&!Ns(Ve)&&o(K,Ve,null,ge[Ve],x,W);"value"in ge&&o(K,"value",null,ge.value,x),(G=ge.onVnodeBeforeMount)&&Sn(G,W,y)}Ee&&Ar(y,null,W,"beforeMount");const Ne=Yp(U,be);Ne&&be.beforeEnter(K),r(K,k,M),((G=ge&&ge.onVnodeMounted)||Ne||Ee)&&Ht(()=>{G&&Sn(G,W,y),Ne&&be.enter(K),Ee&&Ar(y,null,W,"mounted")},U)},pe=(y,k,M,W,U)=>{if(M&&I(y,M),W)for(let x=0;x<W.length;x++)I(y,W[x]);if(U){let x=U.subTree;if(k===x||Kd(x.type)&&(x.ssContent===k||x.ssFallback===k)){const j=U.vnode;pe(y,j,j.scopeId,j.slotScopeIds,U.parent)}}},Te=(y,k,M,W,U,x,j,q,K=0)=>{for(let G=K;G<y.length;G++){const ge=y[G]=q?Wn(y[G]):An(y[G]);R(null,ge,k,M,W,U,x,j,q)}},ce=(y,k,M,W,U,x,j)=>{const q=k.el=y.el;let{patchFlag:K,dynamicChildren:G,dirs:ge}=k;K|=y.patchFlag&16;const fe=y.props||_t,be=k.props||_t;let Ee;if(M&&Rr(M,!1),(Ee=be.onVnodeBeforeUpdate)&&Sn(Ee,M,k,y),ge&&Ar(k,y,M,"beforeUpdate"),M&&Rr(M,!0),(fe.innerHTML&&be.innerHTML==null||fe.textContent&&be.textContent==null)&&u(q,""),G?te(y.dynamicChildren,G,q,M,W,$i(k,U),x):j||me(y,k,q,null,M,W,$i(k,U),x,!1),K>0){if(K&16)ie(q,fe,be,M,U);else if(K&2&&fe.class!==be.class&&o(q,"class",null,be.class,U),K&4&&o(q,"style",fe.style,be.style,U),K&8){const Ne=k.dynamicProps;for(let Ve=0;Ve<Ne.length;Ve++){const Be=Ne[Ve],Je=fe[Be],vt=be[Be];(vt!==Je||Be==="value")&&o(q,Be,Je,vt,U,M)}}K&1&&y.children!==k.children&&u(q,k.children)}else!j&&G==null&&ie(q,fe,be,M,U);((Ee=be.onVnodeUpdated)||ge)&&Ht(()=>{Ee&&Sn(Ee,M,k,y),ge&&Ar(k,y,M,"updated")},W)},te=(y,k,M,W,U,x,j)=>{for(let q=0;q<k.length;q++){const K=y[q],G=k[q],ge=K.el&&(K.type===Le||!$r(K,G)||K.shapeFlag&198)?p(K.el):M;R(K,G,ge,null,W,U,x,j,!0)}},ie=(y,k,M,W,U)=>{if(k!==M){if(k!==_t)for(const x in k)!Ns(x)&&!(x in M)&&o(y,x,k[x],null,U,W);for(const x in M){if(Ns(x))continue;const j=M[x],q=k[x];j!==q&&x!=="value"&&o(y,x,q,j,U,W)}"value"in M&&o(y,"value",k.value,M.value,U)}},Y=(y,k,M,W,U,x,j,q,K)=>{const G=k.el=y?y.el:a(""),ge=k.anchor=y?y.anchor:a("");let{patchFlag:fe,dynamicChildren:be,slotScopeIds:Ee}=k;Ee&&(q=q?q.concat(Ee):Ee),y==null?(r(G,M,W),r(ge,M,W),Te(k.children||[],M,ge,U,x,j,q,K)):fe>0&&fe&64&&be&&y.dynamicChildren&&y.dynamicChildren.length===be.length?(te(y.dynamicChildren,be,M,U,x,j,q),(k.key!=null||U&&k===U.subTree)&&ol(y,k,!0)):me(y,k,M,ge,U,x,j,q,K)},Ae=(y,k,M,W,U,x,j,q,K)=>{k.slotScopeIds=q,y==null?k.shapeFlag&512?U.ctx.activate(k,M,W,j,K):Se(k,M,W,U,x,j,K):Me(y,k,K)},Se=(y,k,M,W,U,x,j)=>{const q=y.component=sm(y,W,U);if(oi(y)&&(q.ctx.renderer=we),om(q,!1,j),q.asyncDep){if(U&&U.registerDep(q,Re,j),!y.el){const K=q.subTree=Ie(Wt);N(null,K,k,M),y.placeholder=K.el}}else Re(q,y,k,M,U,x,j)},Me=(y,k,M)=>{const W=k.component=y.component;if(Bp(y,k,M))if(W.asyncDep&&!W.asyncResolved){Oe(W,k,M);return}else W.next=k,W.update();else k.el=y.el,W.vnode=k},Re=(y,k,M,W,U,x,j)=>{const q=()=>{if(y.isMounted){let{next:fe,bu:be,u:Ee,parent:Ne,vnode:Ve}=y;{const kt=qd(y);if(kt){fe&&(fe.el=Ve.el,Oe(y,fe,j)),kt.asyncDep.then(()=>{Ht(()=>{y.isUnmounted||G()},U)});return}}let Be=fe,Je;Rr(y,!1),fe?(fe.el=Ve.el,Oe(y,fe,j)):fe=Ve,be&&Io(be),(Je=fe.props&&fe.props.onVnodeBeforeUpdate)&&Sn(Je,Ne,fe,Ve),Rr(y,!0);const vt=Jl(y),it=y.subTree;y.subTree=vt,R(it,vt,p(it.el),V(it),y,U,x),fe.el=vt.el,Be===null&&Fp(y,vt.el),Ee&&Ht(Ee,U),(Je=fe.props&&fe.props.onVnodeUpdated)&&Ht(()=>Sn(Je,Ne,fe,Ve),U)}else{let fe;const{el:be,props:Ee}=k,{bm:Ne,m:Ve,parent:Be,root:Je,type:vt}=y,it=os(k);Rr(y,!1),Ne&&Io(Ne),!it&&(fe=Ee&&Ee.onVnodeBeforeMount)&&Sn(fe,Be,k),Rr(y,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(vt,y.parent?y.parent.type:void 0);const kt=y.subTree=Jl(y);R(null,kt,M,W,y,U,x),k.el=kt.el}if(Ve&&Ht(Ve,U),!it&&(fe=Ee&&Ee.onVnodeMounted)){const kt=k;Ht(()=>Sn(fe,Be,kt),U)}(k.shapeFlag&256||Be&&os(Be.vnode)&&Be.vnode.shapeFlag&256)&&y.a&&Ht(y.a,U),y.isMounted=!0,k=M=W=null}};y.scope.on();const K=y.effect=new Xu(q);y.scope.off();const G=y.update=K.run.bind(K),ge=y.job=K.runIfDirty.bind(K);ge.i=y,ge.id=y.uid,K.scheduler=()=>nl(ge),Rr(y,!0),G()},Oe=(y,k,M)=>{k.component=y;const W=y.vnode.props;y.vnode=k,y.next=null,Vp(y,k.props,W,M),Gp(y,k.children,M),Yn(),Ll(y),Xn()},me=(y,k,M,W,U,x,j,q,K=!1)=>{const G=y&&y.children,ge=y?y.shapeFlag:0,fe=k.children,{patchFlag:be,shapeFlag:Ee}=k;if(be>0){if(be&128){Ye(G,fe,M,W,U,x,j,q,K);return}else if(be&256){at(G,fe,M,W,U,x,j,q,K);return}}Ee&8?(ge&16&&ze(G,U,x),fe!==G&&u(M,fe)):ge&16?Ee&16?Ye(G,fe,M,W,U,x,j,q,K):ze(G,U,x,!0):(ge&8&&u(M,""),Ee&16&&Te(fe,M,W,U,x,j,q,K))},at=(y,k,M,W,U,x,j,q,K)=>{y=y||ns,k=k||ns;const G=y.length,ge=k.length,fe=Math.min(G,ge);let be;for(be=0;be<fe;be++){const Ee=k[be]=K?Wn(k[be]):An(k[be]);R(y[be],Ee,M,null,U,x,j,q,K)}G>ge?ze(y,U,x,!0,!1,fe):Te(k,M,W,U,x,j,q,K,fe)},Ye=(y,k,M,W,U,x,j,q,K)=>{let G=0;const ge=k.length;let fe=y.length-1,be=ge-1;for(;G<=fe&&G<=be;){const Ee=y[G],Ne=k[G]=K?Wn(k[G]):An(k[G]);if($r(Ee,Ne))R(Ee,Ne,M,null,U,x,j,q,K);else break;G++}for(;G<=fe&&G<=be;){const Ee=y[fe],Ne=k[be]=K?Wn(k[be]):An(k[be]);if($r(Ee,Ne))R(Ee,Ne,M,null,U,x,j,q,K);else break;fe--,be--}if(G>fe){if(G<=be){const Ee=be+1,Ne=Ee<ge?k[Ee].el:W;for(;G<=be;)R(null,k[G]=K?Wn(k[G]):An(k[G]),M,Ne,U,x,j,q,K),G++}}else if(G>be)for(;G<=fe;)We(y[G],U,x,!0),G++;else{const Ee=G,Ne=G,Ve=new Map;for(G=Ne;G<=be;G++){const yt=k[G]=K?Wn(k[G]):An(k[G]);yt.key!=null&&Ve.set(yt.key,G)}let Be,Je=0;const vt=be-Ne+1;let it=!1,kt=0;const Et=new Array(vt);for(G=0;G<vt;G++)Et[G]=0;for(G=Ee;G<=fe;G++){const yt=y[G];if(Je>=vt){We(yt,U,x,!0);continue}let qe;if(yt.key!=null)qe=Ve.get(yt.key);else for(Be=Ne;Be<=be;Be++)if(Et[Be-Ne]===0&&$r(yt,k[Be])){qe=Be;break}qe===void 0?We(yt,U,x,!0):(Et[qe-Ne]=G+1,qe>=kt?kt=qe:it=!0,R(yt,k[qe],M,null,U,x,j,q,K),Je++)}const mt=it?Xp(Et):ns;for(Be=mt.length-1,G=vt-1;G>=0;G--){const yt=Ne+G,qe=k[yt],nt=k[yt+1],Ut=yt+1<ge?nt.el||Gd(nt):W;Et[G]===0?R(null,qe,M,Ut,U,x,j,q,K):it&&(Be<0||G!==mt[Be]?Xe(qe,M,Ut,2):Be--)}}},Xe=(y,k,M,W,U=null)=>{const{el:x,type:j,transition:q,children:K,shapeFlag:G}=y;if(G&6){Xe(y.component.subTree,k,M,W);return}if(G&128){y.suspense.move(k,M,W);return}if(G&64){j.move(y,k,M,we);return}if(j===Le){r(x,k,M);for(let fe=0;fe<K.length;fe++)Xe(K[fe],k,M,W);r(y.anchor,k,M);return}if(j===Di){D(y,k,M);return}if(W!==2&&G&1&&q)if(W===0)q.beforeEnter(x),r(x,k,M),Ht(()=>q.enter(x),U);else{const{leave:fe,delayLeave:be,afterLeave:Ee}=q,Ne=()=>{y.ctx.isUnmounted?s(x):r(x,k,M)},Ve=()=>{x._isLeaving&&x[En](!0),fe(x,()=>{Ne(),Ee&&Ee()})};be?be(x,Ne,Ve):Ve()}else r(x,k,M)},We=(y,k,M,W=!1,U=!1)=>{const{type:x,props:j,ref:q,children:K,dynamicChildren:G,shapeFlag:ge,patchFlag:fe,dirs:be,cacheIndex:Ee}=y;if(fe===-2&&(U=!1),q!=null&&(Yn(),js(q,null,M,y,!0),Xn()),Ee!=null&&(k.renderCache[Ee]=void 0),ge&256){k.ctx.deactivate(y);return}const Ne=ge&1&&be,Ve=!os(y);let Be;if(Ve&&(Be=j&&j.onVnodeBeforeUnmount)&&Sn(Be,k,y),ge&6)je(y.component,M,W);else{if(ge&128){y.suspense.unmount(M,W);return}Ne&&Ar(y,null,k,"beforeUnmount"),ge&64?y.type.remove(y,k,M,we,W):G&&!G.hasOnce&&(x!==Le||fe>0&&fe&64)?ze(G,k,M,!1,!0):(x===Le&&fe&384||!U&&ge&16)&&ze(K,k,M),W&&Qe(y)}(Ve&&(Be=j&&j.onVnodeUnmounted)||Ne)&&Ht(()=>{Be&&Sn(Be,k,y),Ne&&Ar(y,null,k,"unmounted")},M)},Qe=y=>{const{type:k,el:M,anchor:W,transition:U}=y;if(k===Le){tt(M,W);return}if(k===Di){H(y);return}const x=()=>{s(M),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(y.shapeFlag&1&&U&&!U.persisted){const{leave:j,delayLeave:q}=U,K=()=>j(M,x);q?q(y.el,x,K):K()}else x()},tt=(y,k)=>{let M;for(;y!==k;)M=w(y),s(y),y=M;s(k)},je=(y,k,M)=>{const{bum:W,scope:U,job:x,subTree:j,um:q,m:K,a:G}=y;Ql(K),Ql(G),W&&Io(W),U.stop(),x&&(x.flags|=8,We(j,y,k,M)),q&&Ht(q,k),Ht(()=>{y.isUnmounted=!0},k)},ze=(y,k,M,W=!1,U=!1,x=0)=>{for(let j=x;j<y.length;j++)We(y[j],k,M,W,U)},V=y=>{if(y.shapeFlag&6)return V(y.component.subTree);if(y.shapeFlag&128)return y.suspense.next();const k=w(y.anchor||y.el),M=k&&k[_d];return M?w(M):k};let ne=!1;const le=(y,k,M)=>{let W;y==null?k._vnode&&(We(k._vnode,null,null,!0),W=k._vnode.component):R(k._vnode||null,y,k,null,null,null,M),k._vnode=y,ne||(ne=!0,Ll(W),gd(),ne=!1)},we={p:R,um:We,m:Xe,r:Qe,mt:Se,mc:Te,pc:me,pbc:te,n:V,o:e};return{render:le,hydrate:void 0,createApp:Np(le)}}function $i({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 Rr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Yp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ol(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]=Wn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&ol(i,a)),a.type===ci&&(a.patchFlag===-1&&(a=s[o]=Wn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Xp(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function qd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:qd(t)}function Ql(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Gd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Gd(t.subTree):null}const Kd=e=>e.__isSuspense;function Qp(e,t){t&&t.pendingBranch?Ue(e)?t.effects.push(...e):t.effects.push(e):op(e)}const Le=Symbol.for("v-fgt"),ci=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Di=Symbol.for("v-stc"),Bs=[];let cn=null;function b(e=!1){Bs.push(cn=e?null:[])}function Zp(){Bs.pop(),cn=Bs[Bs.length-1]||null}let Gs=1;function Fo(e,t=!1){Gs+=e,e<0&&cn&&t&&(cn.hasOnce=!0)}function Jd(e){return e.dynamicChildren=Gs>0?cn||ns:null,Zp(),Gs>0&&cn&&cn.push(e),e}function S(e,t,n,r,s,o){return Jd(v(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return Jd(Ie(e,t,n,r,s,!0))}function Ks(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Yd=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?It(e)||Gt(e)||Ge(e)?{i:jt,r:e,k:t,f:!!n}:e:null);function v(e,t=null,n=null,r=0,s=null,o=e===Le?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Yd(t),ref:t&&Ao(t),scopeId:yd,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:jt};return a?(il(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=It(n)?8:16),Gs>0&&!i&&cn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&cn.push(l),l}const Ie=em;function em(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===xd)&&(e=Wt),Ks(e)){const a=Tr(e,t,!0);return n&&il(a,n),Gs>0&&!o&&cn&&(a.shapeFlag&6?cn[cn.indexOf(e)]=a:cn.push(a)),a.patchFlag=-2,a}if(cm(e)&&(e=e.__vccOpts),t){t=tm(t);let{class:a,style:l}=t;a&&!It(a)&&(t.class=ot(a)),pt(l)&&(tl(l)&&!Ue(l)&&(l=Nt({},l)),t.style=Hr(l))}const i=It(e)?1:Kd(e)?128:kd(e)?64:pt(e)?4:Ge(e)?2:0;return v(e,t,n,r,s,i,o,!0)}function tm(e){return e?tl(e)||Bd(e)?Nt({},e):e:null}function Tr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?Xd(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Yd(d),ref:t&&t.ref?n&&o?Ue(o)?o.concat(Ao(t)):[o,Ao(t)]:Ao(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!==Le?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&&Tr(e.ssContent),ssFallback:e.ssFallback&&Tr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&qs(u,l.clone(u)),u}function Js(e=" ",t=0){return Ie(ci,null,e,t)}function re(e="",t=!1){return t?(b(),ft(Wt,null,e)):Ie(Wt,null,e)}function An(e){return e==null||typeof e=="boolean"?Ie(Wt):Ue(e)?Ie(Le,null,e.slice()):Ks(e)?Wn(e):Ie(ci,null,String(e))}function Wn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Tr(e)}function il(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),il(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Bd(t)?t._ctx=jt:s===3&&jt&&(jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ge(t)?(t={default:t,_ctx:jt},n=32):(t=String(t),r&64?(n=16,t=[Js(t)]):n=8);e.children=t,e.shapeFlag|=n}function Xd(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=ot([t.class,r.class]));else if(s==="style")t.style=Hr([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)}else s!==""&&(t[s]=r[s])}return t}function Sn(e,t,n,r=null){_n(e,t,7,[n,r])}const nm=$d();let rm=0;function sm(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||nm,o={uid:rm++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Rh(!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:Hd(r,s),emitsOptions:Dd(r,s),emit:null,emitted:null,propsDefaults:_t,inheritAttrs:r.inheritAttrs,ctx:_t,data:_t,props:_t,attrs:_t,slots:_t,refs:_t,setupState:_t,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=Dp.bind(null,o),e.ce&&e.ce(o),o}let zt=null;const al=()=>zt||jt;let Ho,ka;{const e=ti(),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)}};Ho=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),ka=t("__VUE_SSR_SETTERS__",n=>Ys=n)}const oo=e=>{const t=zt;return Ho(e),e.scope.on(),()=>{e.scope.off(),Ho(t)}},Zl=()=>{zt&&zt.scope.off(),Ho(null)};function Qd(e){return e.vnode.shapeFlag&4}let Ys=!1;function om(e,t=!1,n=!1){t&&ka(t);const{props:r,children:s}=e.vnode,o=Qd(e);Hp(e,r,o,t),qp(e,s,n||t);const i=o?im(e,t):void 0;return t&&ka(!1),i}function im(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ip);const{setup:r}=n;if(r){Yn();const s=e.setupContext=r.length>1?ef(e):null,o=oo(e),i=so(r,e,0,[e.props,s]),a=Wu(i);if(Xn(),o(),(a||e.sp)&&!os(e)&&Rd(e),a){if(i.then(Zl,Zl),t)return i.then(l=>{ec(e,l)}).catch(l=>{si(l,e,0)});e.asyncDep=i}else ec(e,i)}else Zd(e)}function ec(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)&&(e.setupState=hd(t)),Zd(e)}function Zd(e,t,n){const r=e.type;e.render||(e.render=r.render||On);{const s=oo(e);Yn();try{Ap(e)}finally{Xn(),s()}}}const am={get(e,t){return Vt(e,"get",""),e[t]}};function ef(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,am),slots:e.slots,emit:e.emit,expose:t}}function ui(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(hd(Jh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Us)return Us[n](e)},has(t,n){return n in t||n in Us}})):e.proxy}function lm(e,t=!0){return Ge(e)?e.displayName||e.name:e.name||t&&e.__name}function cm(e){return Ge(e)&&"__vccOpts"in e}const ue=(e,t)=>ep(e,t,Ys);function ll(e,t,n){try{Fo(-1);const r=arguments.length;return r===2?pt(t)&&!Ue(t)?Ks(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ks(n)&&(n=[n]),Ie(e,t,n))}finally{Fo(1)}}const um="3.5.30";/**
14
+ * @vue/runtime-dom v3.5.30
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Ta;const tc=typeof window<"u"&&window.trustedTypes;if(tc)try{Ta=tc.createPolicy("vue",{createHTML:e=>e})}catch{}const tf=Ta?e=>Ta.createHTML(e):e=>e,dm="http://www.w3.org/2000/svg",fm="http://www.w3.org/1998/Math/MathML",Vn=typeof document<"u"?document:null,nc=Vn&&Vn.createElement("template"),hm={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"?Vn.createElementNS(dm,e):t==="mathml"?Vn.createElementNS(fm,e):n?Vn.createElement(e,{is:n}):Vn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Vn.createTextNode(e),createComment:e=>Vn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Vn.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{nc.innerHTML=tf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=nc.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]}},dr="transition",Rs="animation",Xs=Symbol("_vtc"),nf={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},pm=Nt({},Sd,nf),mm=e=>(e.displayName="Transition",e.props=pm,e),rf=mm((e,{slots:t})=>ll(fp,gm(e),t)),Pr=(e,t=[])=>{Ue(e)?e.forEach(n=>n(...t)):e&&e(...t)},rc=e=>e?Ue(e)?e.some(t=>t.length>1):e.length>1:!1;function gm(e){const t={};for(const Y in e)Y in nf||(t[Y]=e[Y]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:u=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:w=`${n}-leave-active`,leaveToClass:I=`${n}-leave-to`}=e,F=vm(s),R=F&&F[0],B=F&&F[1],{onBeforeEnter:N,onEnter:P,onEnterCancelled:D,onLeave:H,onLeaveCancelled:se,onBeforeAppear:ae=N,onAppear:pe=P,onAppearCancelled:Te=D}=t,ce=(Y,Ae,Se,Me)=>{Y._enterCancelled=Me,xr(Y,Ae?u:a),xr(Y,Ae?d:i),Se&&Se()},te=(Y,Ae)=>{Y._isLeaving=!1,xr(Y,p),xr(Y,I),xr(Y,w),Ae&&Ae()},ie=Y=>(Ae,Se)=>{const Me=Y?pe:P,Re=()=>ce(Ae,Y,Se);Pr(Me,[Ae,Re]),sc(()=>{xr(Ae,Y?l:o),Fn(Ae,Y?u:a),rc(Me)||oc(Ae,r,R,Re)})};return Nt(t,{onBeforeEnter(Y){Pr(N,[Y]),Fn(Y,o),Fn(Y,i)},onBeforeAppear(Y){Pr(ae,[Y]),Fn(Y,l),Fn(Y,d)},onEnter:ie(!1),onAppear:ie(!0),onLeave(Y,Ae){Y._isLeaving=!0;const Se=()=>te(Y,Ae);Fn(Y,p),Y._enterCancelled?(Fn(Y,w),lc(Y)):(lc(Y),Fn(Y,w)),sc(()=>{Y._isLeaving&&(xr(Y,p),Fn(Y,I),rc(H)||oc(Y,r,B,Se))}),Pr(H,[Y,Se])},onEnterCancelled(Y){ce(Y,!1,void 0,!0),Pr(D,[Y])},onAppearCancelled(Y){ce(Y,!0,void 0,!0),Pr(Te,[Y])},onLeaveCancelled(Y){te(Y),Pr(se,[Y])}})}function vm(e){if(e==null)return null;if(pt(e))return[Li(e.enter),Li(e.leave)];{const t=Li(e);return[t,t]}}function Li(e){return _h(e)}function Fn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Xs]||(e[Xs]=new Set)).add(t)}function xr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Xs];n&&(n.delete(t),n.size||(e[Xs]=void 0))}function sc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ym=0;function oc(e,t,n,r){const s=e._endId=++ym,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=wm(e,t);if(!i)return r();const d=i+"end";let u=0;const p=()=>{e.removeEventListener(d,w),o()},w=I=>{I.target===e&&++u>=l&&p()};setTimeout(()=>{u<l&&p()},a+1),e.addEventListener(d,w)}function wm(e,t){const n=window.getComputedStyle(e),r=F=>(n[F]||"").split(", "),s=r(`${dr}Delay`),o=r(`${dr}Duration`),i=ic(s,o),a=r(`${Rs}Delay`),l=r(`${Rs}Duration`),d=ic(a,l);let u=null,p=0,w=0;t===dr?i>0&&(u=dr,p=i,w=o.length):t===Rs?d>0&&(u=Rs,p=d,w=l.length):(p=Math.max(i,d),u=p>0?i>d?dr:Rs:null,w=u?u===dr?o.length:l.length:0);const I=u===dr&&/\b(?:transform|all)(?:,|$)/.test(r(`${dr}Property`).toString());return{type:u,timeout:p,propCount:w,hasTransform:I}}function ic(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ac(n)+ac(e[r])))}function ac(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function lc(e){return(e?e.ownerDocument:document).body.offsetHeight}function bm(e,t,n){const r=e[Xs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const cc=Symbol("_vod"),_m=Symbol("_vsh"),km=Symbol(""),Tm=/(?:^|;)\s*display\s*:/;function Sm(e,t,n){const r=e.style,s=It(n);let o=!1;if(n&&!s){if(t)if(It(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ro(r,a,"")}else for(const i in t)n[i]==null&&Ro(r,i,"");for(const i in n)i==="display"&&(o=!0),Ro(r,i,n[i])}else if(s){if(t!==n){const i=r[km];i&&(n+=";"+i),r.cssText=n,o=Tm.test(n)}}else t&&e.removeAttribute("style");cc in e&&(e[cc]=o?r.display:"",e[_m]&&(r.display="none"))}const uc=/\s*!important$/;function Ro(e,t,n){if(Ue(n))n.forEach(r=>Ro(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Im(e,t);uc.test(n)?e.setProperty(Sr(r),n.replace(uc,""),"important"):e[r]=n}}const dc=["Webkit","Moz","ms"],ji={};function Im(e,t){const n=ji[t];if(n)return n;let r=en(t);if(r!=="filter"&&r in e)return ji[t]=r;r=ei(r);for(let s=0;s<dc.length;s++){const o=dc[s]+r;if(o in e)return ji[t]=o}return t}const fc="http://www.w3.org/1999/xlink";function hc(e,t,n,r,s,o=Ch(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(fc,t.slice(6,t.length)):e.setAttributeNS(fc,t,n):n==null||o&&!Ku(n)?e.removeAttribute(t):e.setAttribute(t,o?"":wn(n)?String(n):n)}function pc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?tf(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=Ku(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 es(e,t,n,r){e.addEventListener(t,n,r)}function Em(e,t,n,r){e.removeEventListener(t,n,r)}const mc=Symbol("_vei");function Cm(e,t,n,r,s=null){const o=e[mc]||(e[mc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Am(t);if(r){const d=o[t]=xm(r,s);es(e,a,d,l)}else i&&(Em(e,a,i,l),o[t]=void 0)}}const gc=/(?:Once|Passive|Capture)$/;function Am(e){let t;if(gc.test(e)){t={};let r;for(;r=e.match(gc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Sr(e.slice(2)),t]}let Ui=0;const Rm=Promise.resolve(),Pm=()=>Ui||(Rm.then(()=>Ui=0),Ui=Date.now());function xm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_n(Mm(r,n.value),t,5,[r])};return n.value=e,n.attached=Pm(),n}function Mm(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 vc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Om=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?bm(e,r,i):t==="style"?Sm(e,n,r):Qo(t)?Wa(t)||Cm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Nm(e,t,r,i))?(pc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&hc(e,t,r,i,o,t!=="value")):e._isVueCE&&($m(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!It(r)))?pc(e,en(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),hc(e,t,r,i))};function Nm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&vc(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 vc(t)&&It(n)?!1:t in e}function $m(e,t){const n=e._def.props;if(!n)return!1;const r=en(t);return Array.isArray(n)?n.some(s=>en(s)===r):Object.keys(n).some(s=>en(s)===r)}const yc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ue(t)?n=>Io(t,n):t};function Dm(e){e.target.composing=!0}function wc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Bi=Symbol("_assign");function bc(e,t,n){return t&&(e=e.trim()),n&&(e=Ga(e)),e}const er={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Bi]=yc(s);const o=r||s.props&&s.props.type==="number";es(e,t?"change":"input",i=>{i.target.composing||e[Bi](bc(e.value,n,o))}),(n||o)&&es(e,"change",()=>{e.value=bc(e.value,n,o)}),t||(es(e,"compositionstart",Dm),es(e,"compositionend",wc),es(e,"change",wc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Bi]=yc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ga(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Lm=["ctrl","shift","alt","meta"],jm={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)=>Lm.some(n=>e[`${n}Key`]&&!t.includes(n))},st=(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=jm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Um={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Zt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Sr(s.key);if(t.some(i=>i===o||Um[i]===o))return e(s)}))},Bm=Nt({patchProp:Om},hm);let _c;function Fm(){return _c||(_c=Kp(Bm))}const Hm=((...e)=>{const t=Fm().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Wm(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,Vm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Vm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wm(e){return It(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const ts=typeof document<"u";function sf(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function zm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&sf(e.default)}const ut=Object.assign;function Fi(e,t){const n={};for(const r in t){const s=t[r];n[r]=kn(s)?s.map(e):e(s)}return n}const Fs=()=>{},kn=Array.isArray;function kc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const of=/#/g,qm=/&/g,Gm=/\//g,Km=/=/g,Jm=/\?/g,af=/\+/g,Ym=/%5B/g,Xm=/%5D/g,lf=/%5E/g,Qm=/%60/g,cf=/%7B/g,Zm=/%7C/g,uf=/%7D/g,eg=/%20/g;function cl(e){return e==null?"":encodeURI(""+e).replace(Zm,"|").replace(Ym,"[").replace(Xm,"]")}function tg(e){return cl(e).replace(cf,"{").replace(uf,"}").replace(lf,"^")}function Sa(e){return cl(e).replace(af,"%2B").replace(eg,"+").replace(of,"%23").replace(qm,"%26").replace(Qm,"`").replace(cf,"{").replace(uf,"}").replace(lf,"^")}function ng(e){return Sa(e).replace(Km,"%3D")}function rg(e){return cl(e).replace(of,"%23").replace(Jm,"%3F")}function sg(e){return rg(e).replace(Gm,"%2F")}function Qs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const og=/\/$/,ig=e=>e.replace(og,"");function Hi(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=ug(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Qs(i)}}function ag(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Tc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function lg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&fs(t.matched[r],n.matched[s])&&df(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function fs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function df(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!cg(e[n],t[n]))return!1;return!0}function cg(e,t){return kn(e)?Sc(e,t):kn(t)?Sc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Sc(e,t){return kn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ug(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 fr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ia=(function(e){return e.pop="pop",e.push="push",e})({}),Vi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function dg(e){if(!e)if(ts){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ig(e)}const fg=/^[^#]+#/;function hg(e,t){return e.replace(fg,"#")+t}function pg(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 di=()=>({left:window.scrollX,top:window.scrollY});function mg(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=pg(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 Ic(e,t){return(history.state?history.state.position-t:-1)+e}const Ea=new Map;function gg(e,t){Ea.set(e,t)}function vg(e){const t=Ea.get(e);return Ea.delete(e),t}function yg(e){return typeof e=="string"||e&&typeof e=="object"}function ff(e){return typeof e=="string"||typeof e=="symbol"}let Ct=(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 hf=Symbol("");Ct.MATCHER_NOT_FOUND+"",Ct.NAVIGATION_GUARD_REDIRECT+"",Ct.NAVIGATION_ABORTED+"",Ct.NAVIGATION_CANCELLED+"",Ct.NAVIGATION_DUPLICATED+"";function hs(e,t){return ut(new Error,{type:e,[hf]:!0},t)}function Hn(e,t){return e instanceof Error&&hf in e&&(t==null||!!(e.type&t))}const wg=["params","query","hash"];function bg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of wg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function _g(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(af," "),o=s.indexOf("="),i=Qs(o<0?s:s.slice(0,o)),a=o<0?null:Qs(s.slice(o+1));if(i in t){let l=t[i];kn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Ec(e){let t="";for(let n in e){const r=e[n];if(n=ng(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(kn(r)?r.map(s=>s&&Sa(s)):[r&&Sa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function kg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=kn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Tg=Symbol(""),Cc=Symbol(""),fi=Symbol(""),ul=Symbol(""),Ca=Symbol("");function Ps(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function gr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=w=>{w===!1?l(hs(Ct.NAVIGATION_ABORTED,{from:n,to:t})):w instanceof Error?l(w):yg(w)?l(hs(Ct.NAVIGATION_GUARD_REDIRECT,{from:t,to:w})):(i&&r.enterCallbacks[s]===i&&typeof w=="function"&&i.push(w),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let p=Promise.resolve(u);e.length<3&&(p=p.then(d)),p.catch(w=>l(w))})}function Wi(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(sf(l)){const d=(l.__vccOpts||l)[t];d&&o.push(gr(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const p=zm(u)?u.default:u;i.mods[a]=u,i.components[a]=p;const w=(p.__vccOpts||p)[t];return w&&gr(w,n,r,i,a,s)()}))}}return o}function Sg(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>fs(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>fs(d,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let Ig=()=>location.protocol+"//"+location.host;function pf(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),Tc(a,"")}return Tc(n,e)+r+s}function Eg(e,t,n,r){let s=[],o=[],i=null;const a=({state:w})=>{const I=pf(e,location),F=n.value,R=t.value;let B=0;if(w){if(n.value=I,t.value=w,i&&i===F){i=null;return}B=R?w.position-R.position:0}else r(I);s.forEach(N=>{N(n.value,F,{delta:B,type:Ia.pop,direction:B?B>0?Vi.forward:Vi.back:Vi.unknown})})};function l(){i=n.value}function d(w){s.push(w);const I=()=>{const F=s.indexOf(w);F>-1&&s.splice(F,1)};return o.push(I),I}function u(){if(document.visibilityState==="hidden"){const{history:w}=window;if(!w.state)return;w.replaceState(ut({},w.state,{scroll:di()}),"")}}function p(){for(const w of o)w();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:p}}function Ac(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?di():null}}function Cg(e){const{history:t,location:n}=window,r={value:pf(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const p=e.indexOf("#"),w=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+l:Ig()+e+l;try{t[u?"replaceState":"pushState"](d,"",w),s.value=d}catch(I){console.error(I),n[u?"replace":"assign"](w)}}function i(l,d){o(l,ut({},t.state,Ac(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=ut({},s.value,t.state,{forward:l,scroll:di()});o(u.current,u,!0),o(l,ut({},Ac(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Ag(e){e=dg(e);const t=Cg(e),n=Eg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:hg.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 Rg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Ag(e)}let Lr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ot=(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})(Ot||{});const Pg={type:Lr.Static,value:""},xg=/[a-zA-Z0-9_]/;function Mg(e){if(!e)return[[]];if(e==="/")return[[Pg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(I){throw new Error(`ERR (${n})/"${d}": ${I}`)}let n=Ot.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function p(){d&&(n===Ot.Static?o.push({type:Lr.Static,value:d}):n===Ot.Param||n===Ot.ParamRegExp||n===Ot.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Lr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function w(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ot.ParamRegExp){r=n,n=Ot.EscapeNext;continue}switch(n){case Ot.Static:l==="/"?(d&&p(),i()):l===":"?(p(),n=Ot.Param):w();break;case Ot.EscapeNext:w(),n=r;break;case Ot.Param:l==="("?n=Ot.ParamRegExp:xg.test(l)?w():(p(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ot.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Ot.ParamRegExpEnd:u+=l;break;case Ot.ParamRegExpEnd:p(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===Ot.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),i(),s}const Rc="[^/]+?",Og={sensitive:!1,strict:!1,start:!0,end:!0};var Xt=(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})(Xt||{});const Ng=/[.+*?^${}()[\]/\\]/g;function $g(e,t){const n=ut({},Og,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Xt.Root];n.strict&&!d.length&&(s+="/");for(let p=0;p<d.length;p++){const w=d[p];let I=Xt.Segment+(n.sensitive?Xt.BonusCaseSensitive:0);if(w.type===Lr.Static)p||(s+="/"),s+=w.value.replace(Ng,"\\$&"),I+=Xt.Static;else if(w.type===Lr.Param){const{value:F,repeatable:R,optional:B,regexp:N}=w;o.push({name:F,repeatable:R,optional:B});const P=N||Rc;if(P!==Rc){I+=Xt.BonusCustomRegExp;try{`${P}`}catch(H){throw new Error(`Invalid custom RegExp for param "${F}" (${P}): `+H.message)}}let D=R?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;p||(D=B&&d.length<2?`(?:/${D})`:"/"+D),B&&(D+="?"),s+=D,I+=Xt.Dynamic,B&&(I+=Xt.BonusOptional),R&&(I+=Xt.BonusRepeatable),P===".*"&&(I+=Xt.BonusWildcard)}u.push(I)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Xt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),p={};if(!u)return null;for(let w=1;w<u.length;w++){const I=u[w]||"",F=o[w-1];p[F.name]=I&&F.repeatable?I.split("/"):I}return p}function l(d){let u="",p=!1;for(const w of e){(!p||!u.endsWith("/"))&&(u+="/"),p=!1;for(const I of w)if(I.type===Lr.Static)u+=I.value;else if(I.type===Lr.Param){const{value:F,repeatable:R,optional:B}=I,N=F in d?d[F]:"";if(kn(N)&&!R)throw new Error(`Provided param "${F}" is an array but it is not repeatable (* or + modifiers)`);const P=kn(N)?N.join("/"):N;if(!P)if(B)w.length<2&&(u.endsWith("/")?u=u.slice(0,-1):p=!0);else throw new Error(`Missing required param "${F}"`);u+=P}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Dg(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]===Xt.Static+Xt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Xt.Static+Xt.Segment?1:-1:0}function mf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Dg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Pc(r))return 1;if(Pc(s))return-1}return s.length-r.length}function Pc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Lg={strict:!1,end:!0,sensitive:!1};function jg(e,t,n){const r=$g(Mg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Ug(e,t){const n=[],r=new Map;t=kc(Lg,t);function s(p){return r.get(p)}function o(p,w,I){const F=!I,R=Mc(p);R.aliasOf=I&&I.record;const B=kc(t,p),N=[R];if("alias"in p){const H=typeof p.alias=="string"?[p.alias]:p.alias;for(const se of H)N.push(Mc(ut({},R,{components:I?I.record.components:R.components,path:se,aliasOf:I?I.record:R})))}let P,D;for(const H of N){const{path:se}=H;if(w&&se[0]!=="/"){const ae=w.record.path,pe=ae[ae.length-1]==="/"?"":"/";H.path=w.record.path+(se&&pe+se)}if(P=jg(H,w,B),I?I.alias.push(P):(D=D||P,D!==P&&D.alias.push(P),F&&p.name&&!Oc(P)&&i(p.name)),gf(P)&&l(P),R.children){const ae=R.children;for(let pe=0;pe<ae.length;pe++)o(ae[pe],P,I&&I.children[pe])}I=I||P}return D?()=>{i(D)}:Fs}function i(p){if(ff(p)){const w=r.get(p);w&&(r.delete(p),n.splice(n.indexOf(w),1),w.children.forEach(i),w.alias.forEach(i))}else{const w=n.indexOf(p);w>-1&&(n.splice(w,1),p.record.name&&r.delete(p.record.name),p.children.forEach(i),p.alias.forEach(i))}}function a(){return n}function l(p){const w=Hg(p,n);n.splice(w,0,p),p.record.name&&!Oc(p)&&r.set(p.record.name,p)}function d(p,w){let I,F={},R,B;if("name"in p&&p.name){if(I=r.get(p.name),!I)throw hs(Ct.MATCHER_NOT_FOUND,{location:p});B=I.record.name,F=ut(xc(w.params,I.keys.filter(D=>!D.optional).concat(I.parent?I.parent.keys.filter(D=>D.optional):[]).map(D=>D.name)),p.params&&xc(p.params,I.keys.map(D=>D.name))),R=I.stringify(F)}else if(p.path!=null)R=p.path,I=n.find(D=>D.re.test(R)),I&&(F=I.parse(R),B=I.record.name);else{if(I=w.name?r.get(w.name):n.find(D=>D.re.test(w.path)),!I)throw hs(Ct.MATCHER_NOT_FOUND,{location:p,currentLocation:w});B=I.record.name,F=ut({},w.params,p.params),R=I.stringify(F)}const N=[];let P=I;for(;P;)N.unshift(P.record),P=P.parent;return{name:B,path:R,params:F,matched:N,meta:Fg(N)}}e.forEach(p=>o(p));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function xc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Mc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Bg(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Bg(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Oc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Fg(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Hg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;mf(e,t[o])<0?r=o:n=o+1}const s=Vg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Vg(e){let t=e;for(;t=t.parent;)if(gf(t)&&mf(e,t)===0)return t}function gf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Nc(e){const t=vn(fi),n=vn(ul),r=ue(()=>{const l=ve(e.to);return t.resolve(l)}),s=ue(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],p=n.matched;if(!u||!p.length)return-1;const w=p.findIndex(fs.bind(null,u));if(w>-1)return w;const I=$c(l[d-2]);return d>1&&$c(u)===I&&p[p.length-1].path!==I?p.findIndex(fs.bind(null,l[d-2])):w}),o=ue(()=>s.value>-1&&Kg(n.params,r.value.params)),i=ue(()=>s.value>-1&&s.value===n.matched.length-1&&df(n.params,r.value.params));function a(l={}){if(Gg(l)){const d=t[ve(e.replace)?"replace":"push"](ve(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ue(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Wg(e){return e.length===1?e[0]:e}const zg=$t({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:Nc,setup(e,{slots:t}){const n=ri(Nc(e)),{options:r}=vn(fi),s=ue(()=>({[Dc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Dc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Wg(t.default(n));return e.custom?o:ll("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),qg=zg;function Gg(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 Kg(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(!kn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function $c(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Dc=(e,t,n)=>e??t??n,Jg=$t({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=vn(Ca),s=ue(()=>e.route||r.value),o=vn(Cc,0),i=ue(()=>{let d=ve(o);const{matched:u}=s.value;let p;for(;(p=u[d])&&!p.components;)d++;return d}),a=ue(()=>s.value.matched[i.value]);Eo(Cc,ue(()=>i.value+1)),Eo(Tg,a),Eo(Ca,s);const l=L();return ht(()=>[l.value,a.value,e.name],([d,u,p],[w,I,F])=>{u&&(u.instances[p]=d,I&&I!==u&&d&&d===w&&(u.leaveGuards.size||(u.leaveGuards=I.leaveGuards),u.updateGuards.size||(u.updateGuards=I.updateGuards))),d&&u&&(!I||!fs(u,I)||!w)&&(u.enterCallbacks[p]||[]).forEach(R=>R(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,p=a.value,w=p&&p.components[u];if(!w)return Lc(n.default,{Component:w,route:d});const I=p.props[u],F=I?I===!0?d.params:typeof I=="function"?I(d):I:null,B=ll(w,ut({},F,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(p.instances[u]=null)},ref:l}));return Lc(n.default,{Component:B,route:d})||B}}});function Lc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Yg=Jg;function Xg(e){const t=Ug(e.routes,e),n=e.parseQuery||_g,r=e.stringifyQuery||Ec,s=e.history,o=Ps(),i=Ps(),a=Ps(),l=Yh(fr);let d=fr;ts&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Fi.bind(null,V=>""+V),p=Fi.bind(null,sg),w=Fi.bind(null,Qs);function I(V,ne){let le,we;return ff(V)?(le=t.getRecordMatcher(V),we=ne):we=V,t.addRoute(we,le)}function F(V){const ne=t.getRecordMatcher(V);ne&&t.removeRoute(ne)}function R(){return t.getRoutes().map(V=>V.record)}function B(V){return!!t.getRecordMatcher(V)}function N(V,ne){if(ne=ut({},ne||l.value),typeof V=="string"){const M=Hi(n,V,ne.path),W=t.resolve({path:M.path},ne),U=s.createHref(M.fullPath);return ut(M,W,{params:w(W.params),hash:Qs(M.hash),redirectedFrom:void 0,href:U})}let le;if(V.path!=null)le=ut({},V,{path:Hi(n,V.path,ne.path).path});else{const M=ut({},V.params);for(const W in M)M[W]==null&&delete M[W];le=ut({},V,{params:p(M)}),ne.params=p(ne.params)}const we=t.resolve(le,ne),$e=V.hash||"";we.params=u(w(we.params));const y=ag(r,ut({},V,{hash:tg($e),path:we.path})),k=s.createHref(y);return ut({fullPath:y,hash:$e,query:r===Ec?kg(V.query):V.query||{}},we,{redirectedFrom:void 0,href:k})}function P(V){return typeof V=="string"?Hi(n,V,l.value.path):ut({},V)}function D(V,ne){if(d!==V)return hs(Ct.NAVIGATION_CANCELLED,{from:ne,to:V})}function H(V){return pe(V)}function se(V){return H(ut(P(V),{replace:!0}))}function ae(V,ne){const le=V.matched[V.matched.length-1];if(le&&le.redirect){const{redirect:we}=le;let $e=typeof we=="function"?we(V,ne):we;return typeof $e=="string"&&($e=$e.includes("?")||$e.includes("#")?$e=P($e):{path:$e},$e.params={}),ut({query:V.query,hash:V.hash,params:$e.path!=null?{}:V.params},$e)}}function pe(V,ne){const le=d=N(V),we=l.value,$e=V.state,y=V.force,k=V.replace===!0,M=ae(le,we);if(M)return pe(ut(P(M),{state:typeof M=="object"?ut({},$e,M.state):$e,force:y,replace:k}),ne||le);const W=le;W.redirectedFrom=ne;let U;return!y&&lg(r,we,le)&&(U=hs(Ct.NAVIGATION_DUPLICATED,{to:W,from:we}),Xe(we,we,!0,!1)),(U?Promise.resolve(U):te(W,we)).catch(x=>Hn(x)?Hn(x,Ct.NAVIGATION_GUARD_REDIRECT)?x:Ye(x):me(x,W,we)).then(x=>{if(x){if(Hn(x,Ct.NAVIGATION_GUARD_REDIRECT))return pe(ut({replace:k},P(x.to),{state:typeof x.to=="object"?ut({},$e,x.to.state):$e,force:y}),ne||W)}else x=Y(W,we,!0,k,$e);return ie(W,we,x),x})}function Te(V,ne){const le=D(V,ne);return le?Promise.reject(le):Promise.resolve()}function ce(V){const ne=tt.values().next().value;return ne&&typeof ne.runWithContext=="function"?ne.runWithContext(V):V()}function te(V,ne){let le;const[we,$e,y]=Sg(V,ne);le=Wi(we.reverse(),"beforeRouteLeave",V,ne);for(const M of we)M.leaveGuards.forEach(W=>{le.push(gr(W,V,ne))});const k=Te.bind(null,V,ne);return le.push(k),ze(le).then(()=>{le=[];for(const M of o.list())le.push(gr(M,V,ne));return le.push(k),ze(le)}).then(()=>{le=Wi($e,"beforeRouteUpdate",V,ne);for(const M of $e)M.updateGuards.forEach(W=>{le.push(gr(W,V,ne))});return le.push(k),ze(le)}).then(()=>{le=[];for(const M of y)if(M.beforeEnter)if(kn(M.beforeEnter))for(const W of M.beforeEnter)le.push(gr(W,V,ne));else le.push(gr(M.beforeEnter,V,ne));return le.push(k),ze(le)}).then(()=>(V.matched.forEach(M=>M.enterCallbacks={}),le=Wi(y,"beforeRouteEnter",V,ne,ce),le.push(k),ze(le))).then(()=>{le=[];for(const M of i.list())le.push(gr(M,V,ne));return le.push(k),ze(le)}).catch(M=>Hn(M,Ct.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function ie(V,ne,le){a.list().forEach(we=>ce(()=>we(V,ne,le)))}function Y(V,ne,le,we,$e){const y=D(V,ne);if(y)return y;const k=ne===fr,M=ts?history.state:{};le&&(we||k?s.replace(V.fullPath,ut({scroll:k&&M&&M.scroll},$e)):s.push(V.fullPath,$e)),l.value=V,Xe(V,ne,le,k),Ye()}let Ae;function Se(){Ae||(Ae=s.listen((V,ne,le)=>{if(!je.listening)return;const we=N(V),$e=ae(we,je.currentRoute.value);if($e){pe(ut($e,{replace:!0,force:!0}),we).catch(Fs);return}d=we;const y=l.value;ts&&gg(Ic(y.fullPath,le.delta),di()),te(we,y).catch(k=>Hn(k,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_CANCELLED)?k:Hn(k,Ct.NAVIGATION_GUARD_REDIRECT)?(pe(ut(P(k.to),{force:!0}),we).then(M=>{Hn(M,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_DUPLICATED)&&!le.delta&&le.type===Ia.pop&&s.go(-1,!1)}).catch(Fs),Promise.reject()):(le.delta&&s.go(-le.delta,!1),me(k,we,y))).then(k=>{k=k||Y(we,y,!1),k&&(le.delta&&!Hn(k,Ct.NAVIGATION_CANCELLED)?s.go(-le.delta,!1):le.type===Ia.pop&&Hn(k,Ct.NAVIGATION_ABORTED|Ct.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ie(we,y,k)}).catch(Fs)}))}let Me=Ps(),Re=Ps(),Oe;function me(V,ne,le){Ye(V);const we=Re.list();return we.length?we.forEach($e=>$e(V,ne,le)):console.error(V),Promise.reject(V)}function at(){return Oe&&l.value!==fr?Promise.resolve():new Promise((V,ne)=>{Me.add([V,ne])})}function Ye(V){return Oe||(Oe=!V,Se(),Me.list().forEach(([ne,le])=>V?le(V):ne()),Me.reset()),V}function Xe(V,ne,le,we){const{scrollBehavior:$e}=e;if(!ts||!$e)return Promise.resolve();const y=!le&&vg(Ic(V.fullPath,0))||(we||!le)&&history.state&&history.state.scroll||null;return qt().then(()=>$e(V,ne,y)).then(k=>k&&mg(k)).catch(k=>me(k,V,ne))}const We=V=>s.go(V);let Qe;const tt=new Set,je={currentRoute:l,listening:!0,addRoute:I,removeRoute:F,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:R,resolve:N,options:e,push:H,replace:se,go:We,back:()=>We(-1),forward:()=>We(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Re.add,isReady:at,install(V){V.component("RouterLink",qg),V.component("RouterView",Yg),V.config.globalProperties.$router=je,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>ve(l)}),ts&&!Qe&&l.value===fr&&(Qe=!0,H(s.location).catch(we=>{}));const ne={};for(const we in fr)Object.defineProperty(ne,we,{get:()=>l.value[we],enumerable:!0});V.provide(fi,je),V.provide(ul,dd(ne)),V.provide(Ca,l);const le=V.unmount;tt.add(V),V.unmount=function(){tt.delete(V),tt.size<1&&(d=fr,Ae&&Ae(),Ae=null,l.value=fr,Qe=!1,Oe=!1),le()}}};function ze(V){return V.reduce((ne,le)=>ne.then(()=>ce(le)),Promise.resolve())}return je}function Qg(){return vn(fi)}function Zg(e){return vn(ul)}const jc=768;function vf(){const e=L(typeof window<"u"?window.innerWidth<jc:!1);let t=null;function n(r){e.value=r.matches}return sr(()=>{t=window.matchMedia(`(max-width: ${jc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ai(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const ev={key:0,class:"desktop-sidebar"},tv={class:"desktop-main"},Uc="codex-web-local.sidebar-width.v1",nv=260,rv=620,Bc=320,sv=$t({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=vf();function r(d){return Math.min(rv,Math.max(nv,d))}function s(){if(typeof window>"u")return Bc;const d=window.localStorage.getItem(Uc),u=Number(d);return Number.isFinite(u)?r(u):Bc}const o=L(s()),i=ue(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(Uc,String(d))}function l(d){d.preventDefault();const u=d.clientX,p=o.value,w=F=>{const R=F.clientX-u;o.value=r(p+R)},I=()=>{a(o.value),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",I)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",I)}return(d,u)=>(b(),S("div",{class:ot(["desktop-layout",{"is-mobile":ve(n)}]),style:Hr(i.value)},[ve(n)?(b(),ft(jo,{key:0,to:"body"},[Ie(rf,{name:"drawer"},{default:gt(()=>[e.isSidebarCollapsed?re("",!0):(b(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=p=>d.$emit("close-sidebar"))},[v("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=st(()=>{},["stop"]))},[Mn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):re("",!0),ve(n)?re("",!0):(b(),S(Le,{key:1},[e.isSidebarCollapsed?re("",!0):(b(),S("aside",ev,[Mn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?re("",!0):(b(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),v("section",tv,[Mn(d.$slots,"content",{},void 0)])],6))}}),et=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ov=et(sv,[["__scopeId","data-v-df29c633"]]),iv={},av={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lv(e,t){return b(),S("svg",av,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const hi=et(iv,[["render",lv]]),cv={},uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dv(e,t){return b(),S("svg",uv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const yf=et(cv,[["render",dv]]),fv={},hv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function pv(e,t){return b(),S("svg",hv,[...t[0]||(t[0]=[v("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const xs=et(fv,[["render",pv]]),mv={},gv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function vv(e,t){return b(),S("svg",gv,[...t[0]||(t[0]=[v("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 Vo=et(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 b(),S("svg",wv,[...t[0]||(t[0]=[v("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 dl=et(yv,[["render",bv]]),_v={},kv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tv(e,t){return b(),S("svg",kv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const Sv=et(_v,[["render",Tv]]),Iv={},Ev={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cv(e,t){return b(),S("svg",Ev,[...t[0]||(t[0]=[v("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 Po=et(Iv,[["render",Cv]]),Av={},Rv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Pv(e,t){return b(),S("svg",Rv,[...t[0]||(t[0]=[v("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 zi=et(Av,[["render",Pv]]),xv={key:0,class:"sidebar-menu-row-left"},Mv={class:"sidebar-menu-row-main"},Ov={key:1,class:"sidebar-menu-row-right"},Nv={key:0,class:"sidebar-menu-row-right-default"},$v={key:1,class:"sidebar-menu-row-right-hover"},Dv=$t({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Ep(),r=ue(()=>!!n.left),s=ue(()=>!!n.right),o=ue(()=>!!n["right-hover"]),i=ue(()=>s.value||o.value);return(a,l)=>(b(),ft(va(t.as),Xd({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:gt(()=>[r.value?(b(),S("span",xv,[Mn(a.$slots,"left",{},void 0,!0)])):re("",!0),v("span",Mv,[Mn(a.$slots,"default",{},void 0,!0)]),i.value?(b(),S("span",Ov,[s.value?(b(),S("span",Nv,[Mn(a.$slots,"right",{},void 0,!0)])):re("",!0),o.value?(b(),S("span",$v,[Mn(a.$slots,"right-hover",{},void 0,!0)])):re("",!0)])):re("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Mr=et(Dv,[["__scopeId","data-v-daeca4df"]]),Lv={class:"thread-tree-root"},jv={key:0,class:"pinned-section"},Uv={class:"thread-list"},Bv={class:"thread-left-stack"},Fv=["data-state"],Hv=["onClick"],Vv=["onClick"],Wv={class:"thread-row-title-wrap"},zv={class:"thread-row-title"},qv={class:"thread-row-time"},Gv=["onClick"],Kv=["onClick"],Jv=["onClick"],Yv=["onClick"],Xv=["aria-expanded"],Qv=["data-active"],Zv={key:0},ey=["data-active"],ty={key:0},ny={key:1,class:"thread-tree-no-results"},ry={key:2,class:"thread-tree-loading"},sy={key:3,class:"thread-list thread-list-global"},oy={class:"thread-left-stack"},iy=["data-state"],ay=["onClick"],ly=["onClick"],cy={class:"thread-row-title-wrap"},uy={class:"thread-row-title"},dy={class:"thread-row-time"},fy=["onClick"],hy=["onClick"],py=["onClick"],my=["onClick"],gy=["data-project-name","data-expanded","data-dragging"],vy={class:"project-icon-stack"},yy={class:"project-icon-folder"},wy={class:"project-icon-chevron"},by=["data-dragging-handle","onMousedown"],_y={class:"project-title"},ky={class:"project-hover-controls"},Ty=["onClick"],Sy=["onClick"],Iy=["onClick"],Ey=["onClick"],Cy=["onInput"],Ay=["aria-label","title","onClick"],Ry={key:0,class:"thread-list"},Py={class:"thread-left-stack"},xy=["data-state"],My=["onClick"],Oy=["onClick"],Ny={class:"thread-row-title-wrap"},$y={class:"thread-row-title"},Dy={class:"thread-row-time"},Ly=["onClick"],jy=["onClick"],Uy=["onClick"],By=["onClick"],Fy=["onClick"],Hy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Vy=["onKeydown"],Wy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},zy={class:"rename-thread-subtitle"},qy=4,Fc=6,Hc="codex-web-local.thread-view-mode.v1",Vc="codex-web-local.collapsed-projects.v1",Gy=$t({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),d=L("actions"),u=L(""),p=L(!1),w=L(""),I=L(""),F=L(null),R=L(!1),B=L(""),N=L(""),P=L(null),D=L(null),H=L(null);let se=null,ae=null;const pe=L(""),Te=L({}),ce=new Map,te=new Map,ie=new Map,Y=new WeakMap,Ae=L(null),Se=L(!1),Me=L(me()),Re=typeof window<"u"?new ResizeObserver(A=>{for(const O of A){const $=O.target,Q=Y.get($);Q&&T(Q,$)}}):null;function Oe(){if(typeof window>"u")return{};try{const A=window.localStorage.getItem(Vc);if(!A)return{};const O=JSON.parse(A);return!O||typeof O!="object"||Array.isArray(O)?{}:O}catch{return{}}}function me(){return typeof window>"u"?"project":window.localStorage.getItem(Hc)==="chronological"?"chronological":"project"}o.value=Oe(),ht(o,A=>{typeof window>"u"||window.localStorage.setItem(Vc,JSON.stringify(A))},{deep:!0}),ht(Me,A=>{typeof window>"u"||window.localStorage.setItem(Hc,A)});const at=ue(()=>n.searchQuery.trim().toLowerCase()),Ye=ue(()=>at.value.length>0),Xe=ue(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function We(A){if(!Ye.value)return!0;if(Xe.value)return Xe.value.has(A.id);const O=at.value;return A.title.toLowerCase().includes(O)||A.preview.toLowerCase().includes(O)}const Qe=ue(()=>Ye.value?n.groups.map(A=>({...A,threads:A.threads.filter(We)})).filter(A=>A.threads.length>0):n.groups),tt=ue(()=>Me.value==="chronological"),je=ue(()=>{const A=Qe.value,O=[];for(const $ of A)for(const Q of $.threads)k(Q.id)||O.push(Q);return O.sort(($,Q)=>{const Fe=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(Q.updatedAtIso||Q.createdAtIso).getTime()-Fe})}),ze=ue(()=>{const A=new Map;for(const O of n.groups)for(const $ of O.threads)A.set($.id,$);return A}),V=ue(()=>i.value.map(A=>ze.value.get(A)??null).filter(A=>A!==null).filter(We)),ne=ue(()=>{const A=H.value;if(!A||A.dropTargetIndexFull===null||n.groups.length===0)return null;const O=Math.max(0,Math.min(A.dropTargetIndexFull,n.groups.length)),$=O>A.fromIndex?O-1:O,Q=Math.max(0,Math.min($,n.groups.length-1));return Q===A.fromIndex?null:Q}),le=ue(()=>{const O=(Ye.value?Qe.value:n.groups).map(ln=>ln.projectName),$=H.value,Q=ne.value;if(!$||Q===null)return O;const Fe=[...O],[Rt]=Fe.splice($.fromIndex,1);return Rt?(Fe.splice(Q,0,Rt),Fe):O}),we=ue(()=>{const A={};let O=0;for(const $ of le.value)A[$]=O,O+=rn($);return A}),$e=ue(()=>{let A=0;for(const O of le.value)A+=rn(O);return{height:`${Math.max(0,A)}px`}});function y(A){const O=new Date(A).getTime();if(Number.isNaN(O))return"n/a";const $=Math.abs(Date.now()-O);if($<6e4)return"now";const Q=Math.floor($/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(A){return i.value.includes(A)}function M(A){if(k(A)){i.value=i.value.filter(O=>O!==A);return}i.value=[A,...i.value]}function W(A){r("select",A)}function U(A){r("export-thread",A),G()}function x(A){return`start new thread ${Je(A)}`}function j(A){r("start-new-thread",A)}function q(A){l.value===A&&G()}function K(A){return l.value===A}function G(){l.value=""}function ge(A){if(l.value===A){G();return}l.value=A}function fe(A,O){w.value=A,I.value=O,p.value=!0,G(),qt(()=>{var $,Q;($=F.value)==null||$.focus(),(Q=F.value)==null||Q.select()})}function be(){p.value=!1,w.value="",I.value=""}function Ee(){const A=w.value,O=I.value.trim();!A||!O||(r("rename-thread",{threadId:A,title:O}),be())}function Ne(A,O){B.value=A,N.value=O,R.value=!0,G()}function Ve(){R.value=!1,B.value="",N.value=""}function Be(){const A=B.value;A&&(i.value=i.value.filter(O=>O!==A),r("archive",A),Ve())}function Je(A){return n.projectDisplayNameById[A]??A}function vt(A){return a.value===A}function it(){a.value="",d.value="actions",u.value=""}function kt(){Se.value=!Se.value}function Et(A){Me.value=A,Se.value=!1}function mt(A){if(a.value===A){it();return}a.value=A,d.value="actions",u.value=Je(A)}function yt(A){a.value=A,d.value="rename",u.value=Je(A)}function qe(A){r("rename-project",{projectName:A,displayName:u.value})}function nt(A){r("remove-project",A),it()}function Ut(A){r("browse-project-files",A),it()}function Pt(A,O){if(!A.altKey||A.key!=="ArrowUp"&&A.key!=="ArrowDown")return;const $=n.groups.findIndex(Rt=>Rt.projectName===O);if($<0)return;const Q=A.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min($+Q,n.groups.length-1));Fe!==$&&(A.preventDefault(),r("reorder-project",{projectName:O,toIndex:Fe}))}function Kt(A){return s.value[A]===!0}function At(A){return o.value[A]===!0}function an(A){s.value={...s.value,[A]:!Kt(A)}}function Bt(A){if(pe.value===A){pe.value="";return}o.value={...o.value,[A]:!At(A)}}function rn(A){const O=Te.value[A]??0,$=H.value,Fe=(($==null?void 0:$.projectName)===A?$.groupHeight:null)??O,Rt=At(A)?0:Fc;return Math.max(0,Fe+Rt)}function Dt(A,O){const $=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if($){te.set(A,$);return}te.delete(A)}function Ce(A,O){const $=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if($){ie.set(A,$);return}ie.delete(A)}function Pe(A){const O=a.value;if(!O)return!1;const $=te.get(O);if(!$)return!1;if((typeof A.composedPath=="function"?A.composedPath():[]).includes($))return!0;const Fe=A.target;return Fe instanceof Node?$.contains(Fe):!1}function sn(A){const O=l.value;if(!O)return!1;const $=ie.get(O);if(!$)return!1;if((typeof A.composedPath=="function"?A.composedPath():[]).includes($))return!0;const Fe=A.target;return Fe instanceof Node?$.contains(Fe):!1}function hn(A){if(Se.value){const O=Ae.value,$=typeof A.composedPath=="function"?A.composedPath():[];!!O&&($.includes(O)||A.target instanceof Node&&O.contains(A.target))||(Se.value=!1)}a.value&&(Pe(A)||it(),l.value&&(sn(A)||G()))}function pn(A){a.value&&!Pe(A)&&it(),l.value&&!sn(A)&&G()}function _(){Se.value&&(Se.value=!1),a.value&&it(),l.value&&G()}function f(){window.addEventListener("pointerdown",hn,{capture:!0}),window.addEventListener("focusin",pn,{capture:!0}),window.addEventListener("blur",_)}function m(){window.removeEventListener("pointerdown",hn,{capture:!0}),window.removeEventListener("focusin",pn,{capture:!0}),window.removeEventListener("blur",_)}function T(A,O){const $=O.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const Q=Te.value[A];Q!==void 0&&Math.abs(Q-$)<.5||(Te.value={...Te.value,[A]:$})}function J(A,O){const $=ce.get(A);$&&$!==O&&Re&&Re.unobserve($);const Q=O instanceof HTMLElement?O:O&&"$el"in O&&O.$el instanceof HTMLElement?O.$el:null;if(Q){ce.set(A,Q),Y.set(Q,A),T(A,Q),Re==null||Re.observe(Q);return}$&&(Re==null||Re.unobserve($)),ce.delete(A)}function ee(A,O){if(A.button!==0||D.value||H.value)return;const $=n.groups.findIndex(ln=>ln.projectName===O),Q=ce.get(O);if($<0||!Q)return;const Fe=Q.getBoundingClientRect(),Rt=At(O)?0:Fc;D.value={projectName:O,fromIndex:$,startClientX:A.clientX,startClientY:A.clientY,pointerOffsetY:A.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+Rt},A.preventDefault(),_e()}function _e(){window.addEventListener("mousemove",De),window.addEventListener("mouseup",Ze),window.addEventListener("keydown",ct)}function de(){window.removeEventListener("mousemove",De),window.removeEventListener("mouseup",Ze),window.removeEventListener("keydown",ct)}function De(A){se={clientX:A.clientX,clientY:A.clientY},Mt()}function Ze(A){Dn({clientX:A.clientX,clientY:A.clientY});const O=H.value;if(O&&ne.value!==null){const $=n.groups.findIndex(Q=>Q.projectName===O.projectName);if($>=0){const Q=ne.value;Q!==$&&r("reorder-project",{projectName:O.projectName,toIndex:Q})}}xt()}function ct(A){A.key==="Escape"&&(!D.value&&!H.value||(A.preventDefault(),xt()))}function xt(){ae!==null&&(window.cancelAnimationFrame(ae),ae=null),se=null,D.value=null,H.value=null,pe.value="",de()}function Mt(){ae===null&&(ae=window.requestAnimationFrame(()=>{if(ae=null,!se)return;const A=se;se=null,Dn(A)}))}function Dn(A){const O=D.value;if(!H.value&&O){const $=A.clientX-O.startClientX,Q=A.clientY-O.startClientY;if(Math.hypot($,Q)<qy)return;it(),pe.value=O.projectName,H.value={projectName:O.projectName,fromIndex:O.fromIndex,pointerOffsetY:O.pointerOffsetY,groupLeft:O.groupLeft,groupWidth:O.groupWidth,groupHeight:O.groupHeight,groupOuterHeight:O.groupOuterHeight,ghostTop:A.clientY-O.pointerOffsetY,dropTargetIndexFull:null}}H.value&&Wr(A)}function Wr(A){const O=H.value;if(!O)return;if(O.ghostTop=A.clientY-O.pointerOffsetY,!bs(A)){O.dropTargetIndexFull=null;return}const $=A.clientY,Q=P.value;if(!Q){O.dropTargetIndexFull=null;return}const Fe=Q.getBoundingClientRect(),Rt=new Map(n.groups.map((Jt,Ln)=>[Jt.projectName,Ln])),ln=n.groups.map(Jt=>Jt.projectName).filter(Jt=>Jt!==O.projectName);let qr=0,cr=n.groups.length;for(const Jt of ln){const Ln=Rt.get(Jt);if(Ln===void 0)continue;const Gr=rn(Jt),Er=Fe.top+qr+Gr/2;if($<Er){cr=Ln;break}qr+=Gr}O.dropTargetIndexFull=cr}function bs(A){const O=P.value;if(!O)return!1;const $=O.getBoundingClientRect(),Q=A.clientX>=$.left&&A.clientX<=$.right,Fe=A.clientY>=$.top-32&&A.clientY<=$.bottom+32;return Q&&Fe}function zr(A){var O;return((O=H.value)==null?void 0:O.projectName)===A}function _s(A){const O=H.value,$=we.value[A]??0,Q=a.value===A;return!O||O.projectName!==A?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Q?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${O.groupLeft}px`,width:`${O.groupWidth}px`,height:`${O.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${O.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function ir(A){return A.threads.filter(O=>!k(O.id))}function ks(A){if(Ye.value)return ir(A);if(At(A.projectName))return[];const O=ir(A);return Kt(A.projectName)?O:O.slice(0,10)}function Ts(A){return Ye.value?!1:!At(A.projectName)&&ir(A).length>10}function ar(A){return ir(A).length>0}function lr(A){return A.inProgress?"working":A.unread?"unread":"idle"}ht(()=>n.groups.map(A=>A.projectName),A=>{var Fe,Rt;const O=((Fe=H.value)==null?void 0:Fe.projectName)??((Rt=D.value)==null?void 0:Rt.projectName)??"";O&&!n.groups.some(ln=>ln.projectName===O)&&xt();const $=new Set(A),Q=Object.fromEntries(Object.entries(Te.value).filter(([ln])=>$.has(ln)));Object.keys(Q).length!==Object.keys(Te.value).length&&(Te.value=Q)});const Ss=ue(()=>Se.value||a.value!=="");return ht(Ss,A=>{if(A){f();return}m()}),or(()=>{for(const A of ce.values())Re==null||Re.unobserve(A);ce.clear(),te.clear(),m(),xt()}),(A,O)=>(b(),S("section",Lv,[V.value.length>0?(b(),S("section",jv,[v("ul",Uv,[(b(!0),S(Le,null,bt(V.value,$=>(b(),S("li",{key:$.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":k($.id),onMouseleave:Q=>q($.id)},{left:gt(()=>[v("span",Bv,[$.inProgress||$.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":lr($)},null,8,Fv)):re("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>M($.id)},[Ie(zi,{class:"thread-icon"})],8,Hv)])]),right:gt(()=>[v("span",qv,oe(y($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[v("div",{ref_for:!0,ref:Q=>Ce($.id,Q),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Q=>ge($.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,Gv),K($.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:O[0]||(O[0]=st(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:Q=>U($.id)}," Export chat ",8,Kv),v("button",{class:"thread-menu-item",type:"button",onClick:Q=>fe($.id,$.title)}," Rename thread ",8,Jv),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Ne($.id,$.title)}," Delete thread ",8,Yv)])):re("",!0)],512)]),default:gt(()=>[v("button",{class:"thread-main-button",type:"button",onClick:Q=>W($.id)},[v("span",Wv,[v("span",zv,oe($.title),1),$.hasWorktree?(b(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Vv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):re("",!0),Ie(Mr,{as:"header",class:"thread-tree-header-row"},{right:gt(()=>[v("div",{ref_key:"organizeMenuWrapRef",ref:Ae,class:"organize-menu-wrap"},[v("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Se.value,"aria-label":"Organize threads",title:"Organize threads",onClick:kt},[Ie(xs,{class:"thread-icon"})],8,Xv),Se.value?(b(),S("div",{key:0,class:"organize-menu-panel",onClick:O[3]||(O[3]=st(()=>{},["stop"]))},[O[11]||(O[11]=v("p",{class:"organize-menu-title"},"Organize",-1)),v("button",{class:"organize-menu-item","data-active":Me.value==="project",type:"button",onClick:O[1]||(O[1]=$=>Et("project"))},[O[9]||(O[9]=v("span",null,"By project",-1)),Me.value==="project"?(b(),S("span",Zv,"✓")):re("",!0)],8,Qv),v("button",{class:"organize-menu-item","data-active":Me.value==="chronological",type:"button",onClick:O[2]||(O[2]=$=>Et("chronological"))},[O[10]||(O[10]=v("span",null,"Chronological list",-1)),Me.value==="chronological"?(b(),S("span",ty,"✓")):re("",!0)],8,ey)])):re("",!0)],512)]),default:gt(()=>[O[12]||(O[12]=v("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ye.value&&Qe.value.length===0?(b(),S("p",ny,"No matching threads")):e.isLoading&&e.groups.length===0?(b(),S("p",ry,"Loading threads...")):tt.value?(b(),S("ul",sy,[(b(!0),S(Le,null,bt(je.value,$=>(b(),S("li",{key:$.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":k($.id),onMouseleave:Q=>q($.id)},{left:gt(()=>[v("span",oy,[$.inProgress||$.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":lr($)},null,8,iy)):re("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Q=>M($.id)},[Ie(zi,{class:"thread-icon"})],8,ay)])]),right:gt(()=>[v("span",dy,oe(y($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[v("div",{ref_for:!0,ref:Q=>Ce($.id,Q),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Q=>ge($.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,fy),K($.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:O[4]||(O[4]=st(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:Q=>U($.id)}," Export chat ",8,hy),v("button",{class:"thread-menu-item",type:"button",onClick:Q=>fe($.id,$.title)}," Rename thread ",8,py),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Q=>Ne($.id,$.title)}," Delete thread ",8,my)])):re("",!0)],512)]),default:gt(()=>[v("button",{class:"thread-main-button",type:"button",onClick:Q=>W($.id)},[v("span",cy,[v("span",uy,oe($.title),1),$.hasWorktree?(b(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,ly)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),S("div",{key:4,ref_key:"groupsContainerRef",ref:P,class:"thread-tree-groups",style:Hr($e.value)},[(b(!0),S(Le,null,bt(Qe.value,$=>(b(),S("article",{key:$.projectName,ref_for:!0,ref:Q=>J($.projectName,Q),class:"project-group","data-project-name":$.projectName,"data-expanded":!At($.projectName),"data-dragging":zr($.projectName),style:Hr(_s($.projectName))},[Ie(Mr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Q=>Bt($.projectName),onKeydown:[Q=>Pt(Q,$.projectName),Zt(st(Q=>Bt($.projectName),["prevent"]),["enter"]),Zt(st(Q=>Bt($.projectName),["prevent"]),["space"])]},{left:gt(()=>[v("span",vy,[v("span",yy,[At($.projectName)?(b(),ft(dl,{key:0,class:"thread-icon"})):(b(),ft(Sv,{key:1,class:"thread-icon"}))]),v("span",wy,[At($.projectName)?(b(),ft(yf,{key:0,class:"thread-icon"})):(b(),ft(hi,{key:1,class:"thread-icon"}))])])]),right:gt(()=>[v("div",ky,[v("div",{ref_for:!0,ref:Q=>Dt($.projectName,Q),class:"project-menu-wrap"},[v("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:st(Q=>mt($.projectName),["stop"])},[Ie(xs,{class:"thread-icon"})],8,Ty),vt($.projectName)?(b(),S("div",{key:0,class:"project-menu-panel",onClick:O[6]||(O[6]=st(()=>{},["stop"]))},[d.value==="actions"?(b(),S(Le,{key:0},[v("button",{class:"project-menu-item",type:"button",onClick:Q=>Ut($.projectName)}," Browse files ",8,Sy),v("button",{class:"project-menu-item",type:"button",onClick:Q=>yt($.projectName)}," Edit name ",8,Iy),v("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Q=>nt($.projectName)}," Remove ",8,Ey)],64)):(b(),S(Le,{key:1},[O[13]||(O[13]=v("label",{class:"project-menu-label"},"Project name",-1)),Zn(v("input",{"onUpdate:modelValue":O[5]||(O[5]=Q=>u.value=Q),class:"project-menu-input",type:"text",onInput:Q=>qe($.projectName)},null,40,Cy),[[er,u.value]])],64))])):re("",!0)],512),v("button",{class:"thread-start-button",type:"button","aria-label":x($.projectName),title:x($.projectName),onClick:st(Q=>j($.projectName),["stop"])},[Ie(Vo,{class:"thread-icon"})],8,Ay)])]),default:gt(()=>[v("span",{class:"project-main-button","data-dragging-handle":zr($.projectName),onMousedown:st(Q=>ee(Q,$.projectName),["left"])},[v("span",_y,oe(Je($.projectName)),1)],40,by)]),_:2},1032,["onClick","onKeydown"]),ar($)?(b(),S("ul",Ry,[(b(!0),S(Le,null,bt(ks($),Q=>(b(),S("li",{key:Q.id,class:"thread-row-item"},[Ie(Mr,{class:"thread-row","data-active":Q.id===e.selectedThreadId,"data-pinned":k(Q.id),onMouseleave:Fe=>q(Q.id)},{left:gt(()=>[v("span",Py,[Q.inProgress||Q.unread?(b(),S("span",{key:0,class:"thread-status-indicator","data-state":lr(Q)},null,8,xy)):re("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Fe=>M(Q.id)},[Ie(zi,{class:"thread-icon"})],8,My)])]),right:gt(()=>[v("span",Dy,oe(y(Q.createdAtIso||Q.updatedAtIso)),1)]),"right-hover":gt(()=>[v("div",{ref_for:!0,ref:Fe=>Ce(Q.id,Fe),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:st(Fe=>ge(Q.id),["stop"])},[Ie(xs,{class:"thread-icon"})],8,Ly),K(Q.id)?(b(),S("div",{key:0,class:"thread-menu-panel",onClick:O[7]||(O[7]=st(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:Fe=>U(Q.id)}," Export chat ",8,jy),v("button",{class:"thread-menu-item",type:"button",onClick:Fe=>fe(Q.id,Q.title)}," Rename thread ",8,Uy),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Fe=>Ne(Q.id,Q.title)}," Delete thread ",8,By)])):re("",!0)],512)]),default:gt(()=>[v("button",{class:"thread-main-button",type:"button",onClick:Fe=>W(Q.id)},[v("span",Ny,[v("span",$y,oe(Q.title),1),Q.hasWorktree?(b(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Oy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(b(),ft(Mr,{key:1,as:"p",class:"project-empty-row"},{left:gt(()=>[...O[14]||(O[14]=[v("span",{class:"project-empty-spacer"},null,-1)])]),default:gt(()=>[O[15]||(O[15]=v("span",{class:"project-empty"},"No threads",-1))]),_:1})),Ts($)?(b(),ft(Mr,{key:2,class:"thread-show-more-row"},{left:gt(()=>[...O[16]||(O[16]=[v("span",{class:"thread-show-more-spacer"},null,-1)])]),default:gt(()=>[v("button",{class:"thread-show-more-button",type:"button",onClick:Q=>an($.projectName)},oe(Kt($.projectName)?"Show less":"Show more"),9,Fy)]),_:2},1024)):re("",!0)],12,gy))),128))],4)),(b(),ft(jo,{to:"body"},[p.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:st(be,["self"])},[v("div",Hy,[O[17]||(O[17]=v("h3",{class:"rename-thread-title"},"Rename thread",-1)),O[18]||(O[18]=v("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Zn(v("input",{ref_key:"renameThreadInputRef",ref:F,"onUpdate:modelValue":O[8]||(O[8]=$=>I.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Zt(st(Ee,["prevent"]),["enter"]),Zt(st(be,["prevent"]),["esc"])]},null,40,Vy),[[er,I.value]]),v("div",{class:"rename-thread-actions"},[v("button",{class:"rename-thread-button",type:"button",onClick:be},"Cancel"),v("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Ee},"Save")])])])):re("",!0)])),(b(),ft(jo,{to:"body"},[R.value?(b(),S("div",{key:0,class:"rename-thread-overlay",onClick:st(Ve,["self"])},[v("div",Wy,[O[19]||(O[19]=v("h3",{class:"rename-thread-title"},"Delete thread?",-1)),v("p",zy,' This will archive the thread "'+oe(N.value)+'". You can find it later in archived threads. ',1),v("div",{class:"rename-thread-actions"},[v("button",{class:"rename-thread-button",type:"button",onClick:Ve},"Cancel"),v("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Be},"Delete")])])])):re("",!0)]))]))}}),Ky=et(Gy,[["__scopeId","data-v-e2f8a8e1"]]),Jy={class:"content-header"},Yy={class:"content-leading"},Xy={class:"content-title"},Qy={class:"content-actions"},Zy=$t({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(b(),S("header",Jy,[v("div",Yy,[Mn(t.$slots,"leading",{},void 0)]),v("h1",Xy,oe(e.title),1),v("div",Qy,[Mn(t.$slots,"actions",{},void 0)])]))}}),ew=et(Zy,[["__scopeId","data-v-66ee223c"]]),tw={},nw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rw(e,t){return b(),S("svg",nw,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const fl=et(tw,[["render",rw]]),sw={},ow={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function iw(e,t){return b(),S("svg",ow,[...t[0]||(t[0]=[v("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 aw=et(sw,[["render",iw]]),lw={},cw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function uw(e,t){return b(),S("svg",cw,[...t[0]||(t[0]=[v("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 dw=et(lw,[["render",uw]]),fw={class:"conversation-root"},hw={key:0,class:"conversation-loading"},pw={key:1,class:"conversation-empty"},mw={class:"message-row"},gw={class:"message-stack"},vw={class:"request-card"},yw={class:"request-title"},ww={class:"request-meta"},bw={key:0,class:"request-reason"},_w={key:1,class:"request-actions"},kw=["onClick"],Tw=["onClick"],Sw=["onClick"],Iw=["onClick"],Ew={key:2,class:"request-actions"},Cw=["onClick"],Aw=["onClick"],Rw=["onClick"],Pw=["onClick"],xw={key:3,class:"request-user-input"},Mw={class:"request-question-title"},Ow={key:0,class:"request-question-text"},Nw=["value","onChange"],$w=["value"],Dw=["value","onInput"],Lw=["onClick"],jw={key:4,class:"request-actions"},Uw=["onClick"],Bw=["onClick"],Fw={key:5,class:"request-actions"},Hw=["onClick"],Vw=["onClick"],Ww=["data-role","data-message-type"],zw={key:0,class:"message-row","data-role":"system"},qw={class:"message-stack","data-role":"system"},Gw=["onClick"],Kw={class:"cmd-label"},Jw={class:"cmd-status"},Yw={class:"cmd-output-inner"},Xw={class:"cmd-output"},Qw=["data-role","data-message-type"],Zw=["data-role"],eb=["data-role"],tb=["data-role"],nb=["onClick"],rb=["src"],sb={key:1,class:"message-file-attachments"},ob={class:"message-file-link-wrap"},ib=["href","title"],ab=["href","title"],lb=["data-role"],cb={key:0,class:"worked-separator-wrap","aria-live":"polite"},ub=["onClick"],db={class:"worked-separator-text"},fb={key:0,class:"worked-details"},hb=["onClick"],pb={class:"cmd-label"},mb={class:"cmd-status"},gb={class:"cmd-output-inner"},vb={class:"cmd-output"},yb={key:1,class:"message-text-flow"},wb={key:0,class:"message-text"},bb={key:0},_b={key:1,class:"message-bold-text"},kb={key:2,class:"message-file-link-wrap"},Tb=["href","title"],Sb=["href","title"],Ib=["href","title"],Eb={key:4,class:"message-inline-code"},Cb={key:1,class:"message-text"},Ab=["onClick"],Rb=["src","alt","onError"],Pb={key:0,class:"message-actions"},xb=["onClick"],Mb=["onClick"],Ob={key:0,class:"conversation-item conversation-item-overlay"},Nb={class:"message-row"},$b={class:"message-stack"},Db={class:"live-overlay-inline","aria-live":"polite"},Lb={class:"live-overlay-label"},jb={key:1,class:"live-overlay-error"},Ub=["src"],Bb=16,Fb=$t({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var f;return((f=_.commandExecution)==null?void 0:f.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function d(_){var m;if(((m=_.commandExecution)==null?void 0:m.status)==="inProgress")return;const f=new Set(n.value);f.has(_.id)?f.delete(_.id):f.add(_.id),n.value=f}function u(_){const f=new Set(s.value);f.has(_.id)?f.delete(_.id):f.add(_.id),s.value=f}function p(_){return s.value.has(_.id)}function w(_){const f=_.commandExecution;if(!f)return"";switch(f.status){case"inProgress":return"⟳ Running";case"completed":return f.exitCode===0?"✓ Completed":`✗ Exit ${f.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function I(_){var m,T;const f=(m=_.commandExecution)==null?void 0:m.status;return f==="inProgress"?"cmd-status-running":f==="completed"&&((T=_.commandExecution)==null?void 0:T.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function F(_){const f=new Set(r.value);f.add(_),r.value=f,setTimeout(()=>{const m=new Set(r.value);m.delete(_),r.value=m},1e3)}function R(_,f){const m=[];for(let T=f-1;T>=0;T--){const J=_[T];if(J.messageType==="commandExecution")m.unshift(J);else if(J.role==="user"||J.messageType==="worked")break}return m}const B=e,N=t,P=L(null),D=L(null),H=L(null),se=L(""),ae=L({}),pe=L({});let Te=0,ce=0,te=0;const ie=new WeakSet,Y=L(new Set);function Ae(_){if(!_||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const f=_.startsWith("/"),m=/^[A-Za-z]:[\\/]/u.test(_),T=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),J=_.includes("/")||_.includes("\\");return f||m||T||J}function Se(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Me(_){return _.replace(/\\/gu,"/")}function Re(_){if(!_.startsWith("file://"))return _;let f=_.replace(/^file:\/\//u,"");try{f=decodeURIComponent(f)}catch{}return/^\/[A-Za-z]:\//u.test(f)&&(f=f.slice(1)),f}function Oe(_){const f=Me(_),m=f.match(/^\/Users\/([^/]+)/u);if(m)return`/Users/${m[1]}`;const T=f.match(/^\/home\/([^/]+)/u);return T?`/home/${T[1]}`:""}function me(_){const f=Me(_);if(!f)return f;let m="",T=f;const J=T.match(/^([A-Za-z]:)(\/.*)?$/u);J?(m=`${J[1]}/`,T=(J[2]??"").replace(/^\/+/u,"")):T.startsWith("/")&&(m="/",T=T.slice(1));const ee=T.split("/").filter(Boolean),_e=[];for(const De of ee)if(De!=="."){if(De===".."){_e.length>0&&_e.pop();continue}_e.push(De)}const de=_e.join("/");return m?`${m}${de}`.replace(/\/+$/u,"")||m:de||f}function at(_,f){const m=Me(Re(_.trim()));if(!m)return"";if(m.startsWith("/")||/^[A-Za-z]:\//u.test(m))return me(m);if(m.startsWith("~/")){const ee=Oe(f);if(ee)return me(`${ee}/${m.slice(2)}`)}const J=Me(f.trim());return me(J?`${J.replace(/\/+$/u,"")}/${m}`:m)}function Ye(_){if(!_)return null;let f=_.trim();f=Xe(f).core.trim();let T=null;const J=f.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(J)f=J[1],T=Number(J[2]);else{const ee=f.match(/^(.*):(\d+)(?::\d+)?$/u);ee&&(f=ee[1],T=Number(ee[2]))}return f=Re(f),Ae(f)?{path:f,line:T}:null}function Xe(_){let f=_,m="",T="";for(;/^[('"`[{<“‘]/u.test(f);)m+=f[0],f=f.slice(1);for(;/[)"'`\]}>”’]$/u.test(f);)T=f.slice(-1)+T,f=f.slice(0,-1);return{core:f,leading:m,trailing:T}}function We(_){const f=_.trim(),m=Qe(f,0);if(!m||m.end!==f.length)return null;const T=m.label.trim(),J=m.target.trim(),ee=Xe(T).core.trim()||T,_e=Xe(J).core.trim();return _e?{label:ee,target:_e}:null}function Qe(_,f){if(_[f]!=="[")return null;const m=_.indexOf("](",f+1);if(m<0)return null;const T=_.slice(f+1,m);if(!T||T.includes(`
26
+ `))return null;let J=m+2,ee=1;for(;J<_.length;){const _e=_[J];if(_e===`
27
+ `)return null;if(_e==="(")ee+=1;else if(_e===")"&&(ee-=1,ee===0)){const de=_.slice(m+2,J);return de.trim()?{label:T,target:de,end:J+1}:null}J+=1}return null}function tt(_){const f=[],m=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let T=0;for(const J of _.matchAll(m)){if(typeof J.index!="number")continue;const ee=J.index,_e=ee+J[0].length;ee>T&&f.push({kind:"text",value:_.slice(T,ee)});let de=J[0],De="";for(;/[.,;:]$/u.test(de);)De=de.slice(-1)+De,de=de.slice(0,-1);const Ze=Xe(de);de=Ze.core;const ct=Ze.leading,xt=Ze.trailing+De;if(ct&&f.push({kind:"text",value:ct}),de.startsWith("**")&&de.endsWith("**")&&de.length>4)f.push({kind:"bold",value:de.slice(2,-2)}),xt&&f.push({kind:"text",value:xt});else if(/^https?:\/\//u.test(de))f.push({kind:"url",value:de,href:de}),xt&&f.push({kind:"text",value:xt});else{const Mt=Ye(de);Mt?(f.push({kind:"file",value:de,path:Mt.path,displayPath:de,downloadName:Se(Mt.path)}),xt&&f.push({kind:"text",value:xt})):f.push({kind:"text",value:J[0]})}T=_e}return T<_.length&&f.push({kind:"text",value:_.slice(T)}),je(f)}function je(_){const f=[];let m=!1,T="";const J=ee=>{ee&&f.push({kind:"text",value:ee})};for(const ee of _){if(ee.kind!=="text"){m&&(J(`**${T}`),m=!1,T=""),f.push(ee);continue}let _e=ee.value;for(;_e.length>0;){const de=_e.indexOf("**");if(de<0){m?T+=_e:J(_e);break}const De=_e.slice(0,de);m?T+=De:J(De),_e=_e.slice(de+2),m?(T.length>0?f.push({kind:"bold",value:T}):J("****"),T="",m=!1):m=!0}}return m&&J(`**${T}`),f}function ze(_){const f=[];let m=0;for(;m<_.length;){const T=_.indexOf("[",m);if(T<0)break;const J=Qe(_,T);if(!J){m=T+1;continue}T>m&&f.push(...tt(_.slice(m,T)));const ee=Xe(J.label.trim()).core.trim()||J.label.trim(),_e=Xe(J.target.trim()).core.trim();if(/^https?:\/\//u.test(_e))f.push({kind:"url",value:ee||_e,href:_e});else{const de=Ye(_e);de?f.push({kind:"file",value:_e,path:de.path,displayPath:ee||_e,downloadName:Se(de.path)}):f.push({kind:"text",value:_.slice(T,J.end)})}m=J.end}return m<_.length&&f.push(...tt(_.slice(m))),f}function V(_){if(!_.includes("`"))return ze(_);const f=[];let m=0,T=0;for(;m<_.length;){if(_[m]!=="`"){m+=1;continue}let J=1;for(;m+J<_.length&&_[m+J]==="`";)J+=1;const ee="`".repeat(J);let _e=m+J,de=-1;for(;_e<_.length;){const Ze=_.indexOf(ee,_e);if(Ze<0)break;const ct=Ze>0&&_[Ze-1]==="`",xt=Ze+J<_.length&&_[Ze+J]==="`",Mt=_.slice(m+J,Ze).includes(`
28
+ `);if(!ct&&!xt&&!Mt){de=Ze;break}_e=Ze+1}if(de<0){m+=J;continue}m>T&&f.push(...ze(_.slice(T,m)));const De=_.slice(m+J,de);if(De.length>0){const Ze=We(De);if(Ze)if(/^https?:\/\//u.test(Ze.target))f.push({kind:"url",value:Ze.label||Ze.target,href:Ze.target});else{const ct=Ye(Ze.target);ct?f.push({kind:"file",value:Ze.target,path:ct.path,displayPath:Ze.label||Ze.target,downloadName:Se(ct.path)}):f.push({kind:"code",value:De})}else{const ct=Ye(De);if(ct){const xt=ct.line?`${ct.path}:${String(ct.line)}`:ct.path;f.push({kind:"file",value:De,path:ct.path,displayPath:xt,downloadName:Se(ct.path)})}else f.push({kind:"code",value:De})}}else f.push({kind:"text",value:`${ee}${ee}`});m=de+J,T=m}return T<_.length&&f.push(...ze(_.slice(T))),f}function ne(_){const f=_.trim();if(!f)return"";if(f.startsWith("data:")||f.startsWith("blob:")||f.startsWith("http://")||f.startsWith("https://")||f.startsWith("/codex-local-image?"))return f;if(f.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(f)}`;const m=f.startsWith("/"),T=/^[A-Za-z]:[\\/]/u.test(f);return m||T?`/codex-local-image?path=${encodeURIComponent(f)}`:f}function le(_){const f=_.trim();if(!f)return"#";const m=_e=>_e.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(_e),T=Ye(f),J=(T==null?void 0:T.path)??f,ee=at(J,B.cwd);if(m(ee)){const _e=ee.startsWith("/")?ee:`/${ee}`;return`/codex-local-browse${encodeURI(_e)}`}return"#"}function we(_){return $e(_)!=="#"}function $e(_){const f=_.trim();if(!f)return"#";const m=Ye(f),T=(m==null?void 0:m.path)??f,J=at(T,B.cwd);if(!(de=>de.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(de))(J))return"#";const _e=J.startsWith("/")?J:`/${J}`;return`/codex-local-edit${encodeURI(_e)}`}function y(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const f=[],m=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let T=0;for(const J of _.matchAll(m)){const[ee,_e,de]=J;if(typeof J.index!="number")continue;const De=J.index,Ze=De+ee.length,ct=ne(de.trim());ct&&(De>T&&f.push({kind:"text",value:_.slice(T,De)}),f.push({kind:"image",url:ct,alt:_e.trim(),markdown:ee}),T=Ze)}return T<_.length&&f.push({kind:"text",value:_.slice(T)}),f.length>0?f:[{kind:"text",value:_}]}function k(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function M(_){const f=new Date(_);return Number.isNaN(f.getTime())?_:f.toLocaleTimeString()}function W(_){const f=k(_.params),m=f==null?void 0:f.reason;return typeof m=="string"?m.trim():""}function U(_,f){return`${String(_)}:${f}`}function x(_){const f=k(_.params),m=Array.isArray(f==null?void 0:f.questions)?f.questions:[],T=[];for(const J of m){const ee=k(J);if(!ee)continue;const _e=typeof ee.id=="string"?ee.id:"";if(!_e)continue;const de=Array.isArray(ee.options)?ee.options.map(De=>k(De)).map(De=>De==null?void 0:De.label).filter(De=>typeof De=="string"&&De.length>0):[];T.push({id:_e,header:typeof ee.header=="string"?ee.header:"",question:typeof ee.question=="string"?ee.question:"",isOther:ee.isOther===!0,options:de})}return T}function j(_,f,m){const T=U(_,f),J=ae.value[T];return typeof J=="string"&&J.length>0?J:m}function q(_,f){const m=U(_,f);return pe.value[m]??""}function K(_,f,m){const T=m.target;if(!(T instanceof HTMLSelectElement))return;const J=U(_,f);ae.value={...ae.value,[J]:T.value}}function G(_,f,m){const T=m.target;if(!(T instanceof HTMLInputElement))return;const J=U(_,f);pe.value={...pe.value,[J]:T.value}}function ge(_,f){N("respondServerRequest",{id:_,result:{decision:f}})}function fe(_){const f=x(_),m={};for(const T of f){const J=j(_.id,T.id,T.options[0]||""),ee=q(_.id,T.id).trim(),_e=[J,ee].map(de=>de.trim()).filter(de=>de.length>0);m[T.id]={answers:_e}}N("respondServerRequest",{id:_.id,result:{answers:m}})}function be(_){N("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Ee(_){N("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function Ne(_){N("respondServerRequest",{id:_,result:{}})}function Ve(_){N("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Be(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function Je(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function vt(_){return Je(_)||Be(_)}async function it(_){if(!Je(_))return;const f=_.text.trim();try{await navigator.clipboard.writeText(f)}catch{const m=document.createElement("textarea");m.value=f,m.setAttribute("readonly","true"),m.style.position="fixed",m.style.opacity="0",document.body.appendChild(m),m.select(),document.execCommand("copy"),document.body.removeChild(m)}}function kt(_){if(!Be(_))return;const f=_.role==="user"?_.text.trim():"";N("rollback",{turnIndex:_.turnIndex,prependText:f.length>0?f:void 0})}function Et(){const _=P.value,f=D.value;!_||!f||(_.scrollTop=_.scrollHeight,f.scrollIntoView({block:"end"}))}function mt(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=Bb}function yt(_){if(!B.activeThreadId)return;const f=Math.max(_.scrollHeight-_.clientHeight,0),m=f>0?Math.min(Math.max(_.scrollTop/f,0),1):1;N("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:mt(_),scrollRatio:m}})}function qe(){const _=P.value;if(!_)return;const f=B.scrollState;if(!f||f.isAtBottom){nt();return}const m=Math.max(_.scrollHeight-_.clientHeight,0),T=typeof f.scrollRatio=="number"?f.scrollRatio*m:f.scrollTop;_.scrollTop=Math.min(Math.max(T,0),m),yt(_)}function nt(){const _=P.value;_&&(Et(),yt(_))}function Ut(){const _=B.scrollState;return!_||_.isAtBottom===!0}function Pt(){if(!Ut()){te=0,ce=0;return}if(nt(),te-=1,te<=0){ce=0;return}ce=requestAnimationFrame(Pt)}function Kt(_=6){Ut()&&(ce&&(cancelAnimationFrame(ce),ce=0),te=Math.max(_,1),ce=requestAnimationFrame(Pt))}function At(){Kt(3)}function an(){if(!Ut())return;const _=P.value;if(!_)return;const f=_.querySelectorAll("img.message-image-preview");for(const m of f)m.complete||ie.has(m)||(ie.add(m),m.addEventListener("load",At,{once:!0}),m.addEventListener("error",At,{once:!0}))}async function Bt(){await qt(),Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=0,qe(),an(),Kt()})}ht(()=>B.messages,async _=>{if(!B.isLoading){for(const f of _){if(f.messageType!=="commandExecution"||!f.commandExecution)continue;const m=o.value[f.id],T=f.commandExecution.status;m==="inProgress"&&T!=="inProgress"&&F(f.id),o.value[f.id]=T}await Bt()}}),ht(()=>B.liveOverlay,async _=>{_&&(await qt(),nt(),Kt(8))},{deep:!0}),ht(()=>B.isLoading,async _=>{_||await Bt()}),ht(()=>B.activeThreadId,()=>{se.value="",Y.value=new Set},{flush:"post"});function rn(){const _=P.value;!_||B.isLoading||yt(_)}function Dt(_){se.value=ne(_)}function Ce(_,f){return`${_}:${String(f)}`}function Pe(_,f){const m=new Set(Y.value);m.add(Ce(_,f)),Y.value=m}function sn(_,f){return Y.value.has(Ce(_,f))}function hn(){se.value=""}function pn(){const _=H.value;_&&(_.scrollTop=_.scrollHeight)}return ht(()=>{var _;return(_=B.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await qt(),pn())}),or(()=>{Te&&cancelAnimationFrame(Te),ce&&cancelAnimationFrame(ce)}),(_,f)=>(b(),S("section",fw,[e.isLoading?(b(),S("p",hw,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(b(),S("p",pw," No messages in this thread yet. ")):(b(),S("ul",{key:2,ref_key:"conversationListRef",ref:P,class:"conversation-list",onScroll:rn},[(b(!0),S(Le,null,bt(e.pendingRequests,m=>(b(),S("li",{key:`server-request:${m.id}`,class:"conversation-item conversation-item-request"},[v("div",mw,[v("div",gw,[v("article",vw,[v("p",yw,oe(m.method),1),v("p",ww,"Request #"+oe(m.id)+" · "+oe(M(m.receivedAtIso)),1),W(m)?(b(),S("p",bw,oe(W(m)),1)):re("",!0),m.method==="item/commandExecution/requestApproval"?(b(),S("section",_w,[v("button",{type:"button",class:"request-button request-button-primary",onClick:T=>ge(m.id,"accept")},"Accept",8,kw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"acceptForSession")},"Accept for Session",8,Tw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"decline")},"Decline",8,Sw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"cancel")},"Cancel",8,Iw)])):m.method==="item/fileChange/requestApproval"?(b(),S("section",Ew,[v("button",{type:"button",class:"request-button request-button-primary",onClick:T=>ge(m.id,"accept")},"Accept",8,Cw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"acceptForSession")},"Accept for Session",8,Aw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"decline")},"Decline",8,Rw),v("button",{type:"button",class:"request-button",onClick:T=>ge(m.id,"cancel")},"Cancel",8,Pw)])):m.method==="item/tool/requestUserInput"?(b(),S("section",xw,[(b(!0),S(Le,null,bt(x(m),T=>(b(),S("div",{key:`${m.id}:${T.id}`,class:"request-question"},[v("p",Mw,oe(T.header||T.question),1),T.header&&T.question?(b(),S("p",Ow,oe(T.question),1)):re("",!0),v("select",{class:"request-select",value:j(m.id,T.id,T.options[0]||""),onChange:J=>K(m.id,T.id,J)},[(b(!0),S(Le,null,bt(T.options,J=>(b(),S("option",{key:`${m.id}:${T.id}:${J}`,value:J},oe(J),9,$w))),128))],40,Nw),T.isOther?(b(),S("input",{key:1,class:"request-input",type:"text",value:q(m.id,T.id),placeholder:"Other answer",onInput:J=>G(m.id,T.id,J)},null,40,Dw)):re("",!0)]))),128)),v("button",{type:"button",class:"request-button request-button-primary",onClick:T=>fe(m)}," Submit Answers ",8,Lw)])):m.method==="item/tool/call"?(b(),S("section",jw,[v("button",{type:"button",class:"request-button request-button-primary",onClick:T=>be(m.id)},"Fail Tool Call",8,Uw),v("button",{type:"button",class:"request-button",onClick:T=>Ee(m.id)},"Success (Empty)",8,Bw)])):(b(),S("section",Fw,[v("button",{type:"button",class:"request-button request-button-primary",onClick:T=>Ne(m.id)},"Return Empty Result",8,Hw),v("button",{type:"button",class:"request-button",onClick:T=>Ve(m.id)},"Reject Request",8,Vw)]))])])])]))),128)),(b(!0),S(Le,null,bt(e.messages,m=>{var T,J;return b(),S("li",{key:m.id,class:ot(["conversation-item",{"conversation-item-actionable":vt(m)}]),"data-role":m.role,"data-message-type":m.messageType||""},[i(m)?(b(),S("div",zw,[v("div",qw,[v("button",{type:"button",class:ot(["cmd-row",[I(m),{"cmd-expanded":a(m)}]]),onClick:ee=>d(m)},[v("span",{class:ot(["cmd-chevron",{"cmd-chevron-open":a(m)}])},"▶",2),v("code",Kw,oe(((T=m.commandExecution)==null?void 0:T.command)||"(command)"),1),v("span",Jw,oe(w(m)),1)],10,Gw),v("div",{class:ot(["cmd-output-wrap",{"cmd-output-visible":a(m),"cmd-output-collapsing":l(m)}])},[v("div",Yw,[v("pre",Xw,oe(((J=m.commandExecution)==null?void 0:J.aggregatedOutput)||"(no output)"),1)])],2)])])):(b(),S("div",{key:1,class:"message-row","data-role":m.role,"data-message-type":m.messageType||""},[v("div",{class:"message-stack","data-role":m.role},[v("article",{class:"message-body","data-role":m.role},[m.images&&m.images.length>0?(b(),S("ul",{key:0,class:"message-image-list","data-role":m.role},[(b(!0),S(Le,null,bt(m.images,ee=>(b(),S("li",{key:ee,class:"message-image-item"},[v("button",{class:"message-image-button",type:"button",onClick:_e=>Dt(ee)},[v("img",{class:"message-image-preview",src:ne(ee),alt:"Message image preview",loading:"lazy"},null,8,rb)],8,nb)]))),128))],8,tb)):re("",!0),m.fileAttachments&&m.fileAttachments.length>0?(b(),S("div",sb,[(b(!0),S(Le,null,bt(m.fileAttachments,ee=>(b(),S("span",{key:ee.path,class:"message-file-chip"},[f[1]||(f[1]=v("span",{class:"message-file-chip-icon"},"📄",-1)),v("span",ob,[v("a",{class:"message-file-link message-file-chip-name",href:le(ee.path),target:"_blank",rel:"noopener noreferrer",title:ee.path},oe(ee.path),9,ib),we(ee.path)?(b(),S("a",{key:0,class:"message-file-edit-link",href:$e(ee.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${ee.path}`,"aria-label":"Edit file"}," Edit ",8,ab)):re("",!0)])]))),128))])):re("",!0),m.text.length>0?(b(),S("article",{key:2,class:"message-card","data-role":m.role},[m.messageType==="worked"?(b(),S("div",cb,[v("button",{type:"button",class:"worked-separator",onClick:ee=>u(m)},[f[2]||(f[2]=v("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),v("span",{class:ot(["worked-chevron",{"worked-chevron-open":p(m)}])},"▶",2),v("p",db,oe(m.text),1),f[3]||(f[3]=v("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,ub),p(m)?(b(),S("div",fb,[(b(!0),S(Le,null,bt(R(e.messages,e.messages.indexOf(m)),ee=>{var _e,de;return b(),S("div",{key:`worked-cmd-${ee.id}`,class:"worked-cmd-item"},[v("button",{type:"button",class:ot(["cmd-row",[I(ee),{"cmd-expanded":a(ee)}]]),onClick:De=>d(ee)},[v("span",{class:ot(["cmd-chevron",{"cmd-chevron-open":a(ee)}])},"▶",2),v("code",pb,oe(((_e=ee.commandExecution)==null?void 0:_e.command)||"(command)"),1),v("span",mb,oe(w(ee)),1)],10,hb),v("div",{class:ot(["cmd-output-wrap",{"cmd-output-visible":a(ee),"cmd-output-collapsing":l(ee)}])},[v("div",gb,[v("pre",vb,oe(((de=ee.commandExecution)==null?void 0:de.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):re("",!0)])):(b(),S("div",yb,[(b(!0),S(Le,null,bt(y(m.text),(ee,_e)=>(b(),S(Le,{key:`block-${_e}`},[ee.kind==="text"?(b(),S("p",wb,[(b(!0),S(Le,null,bt(V(ee.value),(de,De)=>(b(),S(Le,{key:`seg-${_e}-${De}`},[de.kind==="text"?(b(),S("span",bb,oe(de.value),1)):de.kind==="bold"?(b(),S("strong",_b,oe(de.value),1)):de.kind==="file"?(b(),S("span",kb,[v("a",{class:"message-file-link",href:le(de.path),target:"_blank",rel:"noopener noreferrer",title:de.path},oe(de.displayPath),9,Tb),we(de.path)?(b(),S("a",{key:0,class:"message-file-edit-link",href:$e(de.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${de.path}`,"aria-label":"Edit file"}," Edit ",8,Sb)):re("",!0)])):de.kind==="url"?(b(),S("a",{key:3,class:"message-file-link",href:de.href,target:"_blank",rel:"noopener noreferrer",title:de.href},oe(de.value),9,Ib)):(b(),S("code",Eb,oe(de.value),1))],64))),128))])):sn(m.id,_e)?(b(),S("p",Cb,oe(ee.markdown),1)):(b(),S("button",{key:2,class:"message-image-button",type:"button",onClick:de=>Dt(ee.url)},[v("img",{class:"message-image-preview message-markdown-image",src:ee.url,alt:ee.alt||"Embedded message image",loading:"lazy",onError:de=>Pe(m.id,_e)},null,40,Rb)],8,Ab))],64))),128))]))],8,lb)):re("",!0)],8,eb),vt(m)?(b(),S("div",Pb,[Je(m)?(b(),S("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:ee=>it(m)},[Ie(dw,{class:"message-action-icon"}),f[4]||(f[4]=v("span",{class:"message-action-label"},"Copy",-1))],8,xb)):re("",!0),Be(m)?(b(),S("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:ee=>kt(m)},[Ie(aw,{class:"message-action-icon"}),f[5]||(f[5]=v("span",{class:"message-action-label"},"Rollback",-1))],8,Mb)):re("",!0)])):re("",!0)],8,Zw)],8,Qw))],10,Ww)}),128)),e.liveOverlay?(b(),S("li",Ob,[v("div",Nb,[v("div",$b,[v("article",Db,[v("p",Lb,oe(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(b(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:H},oe(e.liveOverlay.reasoningText),513)):re("",!0),e.liveOverlay.errorText?(b(),S("p",jb,oe(e.liveOverlay.errorText),1)):re("",!0)])])])])):re("",!0),v("li",{ref_key:"bottomAnchorRef",ref:D,class:"conversation-bottom-anchor"},null,512)],544)),se.value.length>0?(b(),S("div",{key:3,class:"image-modal-backdrop",onClick:hn},[v("div",{class:"image-modal-content",onClick:f[0]||(f[0]=st(()=>{},["stop"]))},[v("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:hn},[Ie(fl,{class:"icon-svg"})]),v("img",{class:"image-modal-image",src:se.value,alt:"Expanded message image"},null,8,Ub)])])):re("",!0)]))}}),Hb=et(Fb,[["__scopeId","data-v-e041595f"]]),Wc=.0025,qi=3,zc=2,Vb=256;function Wb(e){var te;const t=L("idle"),n=L(typeof navigator<"u"&&!!((te=navigator.mediaDevices)!=null&&te.getUserMedia)),r=L(0),s=L(null);let o=null,i=null,a=[],l=null,d=null,u=null,p=null,w=[],I=!1,F=!1,R=null;function B(){R&&(R.abort(),R=null),t.value==="transcribing"&&(t.value="idle")}function N(){const ie=s.value;if(!ie||typeof window>"u")return;const Y=ie.getContext("2d");if(!Y)return;const Ae=Math.max(1,Math.floor(ie.clientWidth)),Se=Math.max(1,Math.floor(ie.clientHeight||36)),Me=window.devicePixelRatio||1,Re=Math.max(1,Math.floor(Ae*Me)),Oe=Math.max(1,Math.floor(Se*Me));(ie.width!==Re||ie.height!==Oe)&&(ie.width=Re,ie.height=Oe),Y.setTransform(Me,0,0,Me,0,0),Y.clearRect(0,0,Ae,Se);const me=Math.max(12,Math.floor(Ae/(qi+zc))),at=w.slice(-me),Ye=Math.max(0,me-at.length),Xe=Se/2,We=getComputedStyle(ie).color||"#000000";for(let Qe=0;Qe<me;Qe+=1){const tt=at[Qe-Ye]??0,ze=Math.max(.08,Math.min(1,tt*18))*Xe,V=Qe*(qi+zc);Y.globalAlpha=tt<=Wc?.35:1,Y.fillStyle=We,Y.fillRect(V,Xe-ze,qi,ze*2)}Y.globalAlpha=1}function P(){w=[],r.value=0,N()}function D(){u&&(u.disconnect(),u.onaudioprocess=null,u=null),d&&(d.disconnect(),d=null),l&&(l.close(),l=null),p=null}function H(ie){if(typeof window>"u")return;const Y=window.webkitAudioContext,Ae=window.AudioContext??Y;Ae&&(D(),P(),l=new Ae,d=l.createMediaStreamSource(ie),u=l.createScriptProcessor(2048,1,1),p=performance.now(),u.onaudioprocess=Se=>{const Me=Se.inputBuffer.getChannelData(0);let Re=0;for(let Oe=0;Oe<Me.length;Oe+=1){const me=Math.abs(Me[Oe]??0);Re+=me<Wc?0:me}w.push(Re/Me.length),w.length>Vb&&w.shift(),p!==null&&(r.value=Math.max(0,performance.now()-p)),N()},d.connect(u),u.connect(l.destination),N())}async function se(){var ie;if(t.value==="transcribing"&&B(),!(t.value!=="idle"||!n.value||I)){I=!0,F=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=Y=>{Y.data.size>0&&a.push(Y.data)},o.onstop=()=>{var Se;const Y=a,Ae=(o==null?void 0:o.mimeType)||((Se=Y[0])==null?void 0:Se.type)||"audio/webm";Te(),pe(Y,Ae)},H(i),o.start(250),t.value="recording",F&&ae()}catch(Y){Te(),t.value="idle",(ie=e.onError)==null||ie.call(e,Y)}finally{I=!1}}}function ae(){if(I&&t.value==="idle"){F=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function pe(ie,Y){var Me,Re,Oe,me,at;if(ie.length===0){(Me=e.onEmpty)==null||Me.call(e),t.value="idle";return}const Ae=new Blob(ie,{type:Y});t.value="transcribing";let Se=null;try{const Ye=Y.split(/[/;]/)[1]??"webm",Xe=new FormData;Xe.append("file",Ae,`codex.${Ye}`);const We=((Re=e.getLanguage)==null?void 0:Re.call(e).trim())??"";We&&We.toLowerCase()!=="auto"&&Xe.append("language",We),Se=new AbortController,R=Se;const Qe=await fetch("/codex-api/transcribe",{method:"POST",body:Xe,signal:Se.signal}),tt=await Qe.text();let je=null;try{je=tt.trim()?JSON.parse(tt):null}catch{je=null}if(!Qe.ok){const V=(Oe=je==null?void 0:je.error)==null?void 0:Oe.trim(),ne=tt.trim();throw new Error(V||ne||`Transcription failed: ${Qe.status}`)}const ze=((je==null?void 0:je.text)??"").trim();ze.length>0?e.onTranscript(ze):(me=e.onEmpty)==null||me.call(e)}catch(Ye){if(Ye instanceof DOMException&&Ye.name==="AbortError")return;(at=e.onError)==null||at.call(e,Ye)}finally{Se&&R===Se&&(R=null),t.value==="transcribing"&&(t.value="idle")}}function Te(){D(),P(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ie=>ie.stop()),i=null),a=[]}or(()=>{B(),Te()});function ce(){if(t.value==="recording"){ae();return}(t.value==="idle"||t.value==="transcribing")&&se()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:se,stopRecording:ae,toggleRecording:ce}}function qc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Jn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function hl(e,t){const n=qc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=qc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function vs(e,t,n){return e instanceof Jn?e:e instanceof Error?new Jn(e.message||t,{code:"unknown_error",method:n}):new Jn(t,{code:"unknown_error",method:n})}function wf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function zb(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 Jn(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 Jn(hl(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 Jn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Gc(e){const t=wf(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 qb(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=Gc(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Gc(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function Gb(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 Jn(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 Jn(hl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Kb(){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 Jn(hl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=wf(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Kc(e){return new Date(e*1e3).toISOString()}function Jb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Yb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Xb=/^##\s+(.+?):\s+(.+?)\s*$/,Qb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Zb(e){var s,o;const t=e.split(`
29
+ `).findIndex(i=>Qb.test(i.trim()));if(t<0)return[];const n=e.split(`
30
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Xb);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function e_(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 t_(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:Yb(l),isUnhandled:!0});const o=n.join(`
31
+ `),i=Zb(o);return{text:e_(o),images:r,fileAttachments:i,rawBlocks:s}}function n_(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=t_(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=r_(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 r_(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function s_(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function o_(e){const t=s_(e);return t.length>0?t:"Untitled thread"}function bf(e){return(e==null?void 0:e.status)==="inProgress"}function i_(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 bf(r)}function a_(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:o_(e),projectName:Jb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Kc(e.createdAt),updatedAtIso:Kc(e.updatedAt),preview:e.preview,unread:!1,inProgress:i_(e)}}function l_(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 c_(e){const t=e.data.map(a_);return l_(t)}function _f(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 n_(i))n.push({...a,turnIndex:r})}return n}function u_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return bf(t.at(-1))}async function nn(e,t){try{return await zb(e,t)}catch(n){throw vs(n,`RPC ${e} failed`,e)}}function d_(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function f_(){const e=await nn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return c_(e)}async function h_(e){const t=await nn("thread/read",{threadId:e,includeTurns:!0});return{messages:_f(t),inProgress:u_(t)}}async function p_(){try{return await f_()}catch(e){throw vs(e,"Failed to load thread groups","thread/list")}}async function m_(e){try{return await h_(e)}catch(t){throw vs(t,`Failed to load thread ${e}`,"thread/read")}}function g_(e){return qb(e)}async function v_(e,t){await Gb({id:e,...t})}async function y_(){return Kb()}async function Gi(e){await nn("thread/resume",{threadId:e})}async function w_(e){await nn("thread/archive",{threadId:e})}async function b_(e,t){await nn("thread/name/set",{threadId:e,name:t})}async function Jc(e,t){const n=await nn("thread/rollback",{threadId:e,numTurns:t});return _f(n)}function __(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 Yc(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=__(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw vs(n,"Failed to start a new thread","thread/start")}}function k_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
32
+ `;for(const r of t)n+=`
33
+ ## ${r.label}: ${r.path}
34
+ `;return`${n}
35
+ ## My request for Codex:
36
+
37
+ ${e}
38
+ `}async function Ki(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:k_(t,i)}];for(const p of n){const w=p.trim();w&&l.push({type:"image",url:w,image_url:w})}if(o)for(const p of o)l.push({type:"skill",name:p.name,path:p.path});const d=i.map(p=>({label:p.label,path:p.path,fsPath:p.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await nn("turn/start",u)}catch(a){throw vs(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function T_(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 vs(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function S_(e){await nn("setDefaultModel",{model:e})}async function I_(){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 E_(){const e=await nn("config/read",{}),t=e.config.model??"",n=d_(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}async function C_(){return await nn("account/rateLimits/read")}function A_(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 Aa(){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 A_(n.data)}async function R_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function Xc(){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 P_(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 Qc(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=pl(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 x_(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=pl(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 M_(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=pl(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const p=d.path,w=typeof p=="string"?p.trim():"";w&&l.push({path:w})}return l}async function O_(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 pl(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 N_(){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 Ji(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 $_(e,t){var n;try{return((n=(await nn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function D_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await nn("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function Zc(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 L_={},j_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function U_(e,t){return b(),S("svg",j_,[...t[0]||(t[0]=[v("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 B_=et(L_,[["render",U_]]),F_={},H_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function V_(e,t){return b(),S("svg",H_,[...t[0]||(t[0]=[v("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 W_=et(F_,[["render",V_]]),z_={},q_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function G_(e,t){return b(),S("svg",q_,[...t[0]||(t[0]=[v("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),v("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 eu=et(z_,[["render",G_]]),K_=["disabled"],J_={class:"composer-dropdown-value"},Y_={class:"composer-dropdown-menu"},X_={key:0,class:"composer-dropdown-search-wrap"},Q_=["placeholder","onKeydown"],Z_={class:"composer-dropdown-options",role:"listbox"},ek=["onClick"],tk={key:0,class:"composer-dropdown-empty"},nk={key:1,class:"composer-dropdown-add-wrap"},rk=["placeholder","onKeydown"],sk=$t({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),d=L(!1),u=L(""),p=ue(()=>{var ie;const te=n.options.find(Y=>Y.value===n.modelValue);return te?te.label:((ie=n.placeholder)==null?void 0:ie.trim())||""}),w=ue(()=>n.openDirection??"down"),I=ue(()=>n.enableSearch===!0),F=ue(()=>n.showAddAction===!0),R=ue(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),B=ue(()=>{var te;return((te=n.addActionLabel)==null?void 0:te.trim())||"Add new project"}),N=ue(()=>{var te;return((te=n.addPlaceholder)==null?void 0:te.trim())||"Project name or absolute path"}),P=ue(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(ie=>ie.label.toLowerCase().includes(te)||ie.value.toLowerCase().includes(te)):n.options});function D(){n.disabled||(a.value=!a.value)}function H(te){r("update:modelValue",te),a.value=!1,l.value=""}function se(){var te;d.value=!0,u.value=((te=n.defaultAddValue)==null?void 0:te.trim())||"",qt(()=>{var ie;return(ie=i.value)==null?void 0:ie.focus()})}function ae(){if(l.value.length>0){l.value="";return}a.value=!1}function pe(){const te=u.value.trim();te&&(r("add",te),d.value=!1,u.value="",a.value=!1,l.value="")}function Te(){d.value=!1,u.value="",a.value=!1,l.value=""}function ce(te){if(!a.value)return;const ie=s.value;if(!ie)return;const Y=te.target;Y instanceof Node&&(ie.contains(Y)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ht(a,te=>{if(!te){d.value=!1,u.value="";return}I.value&&qt(()=>{var ie;return(ie=o.value)==null?void 0:ie.focus()})}),sr(()=>{window.addEventListener("pointerdown",ce)}),or(()=>{window.removeEventListener("pointerdown",ce)}),(te,ie)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[v("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:D},[v("span",J_,oe(p.value),1),Ie(hi,{class:"composer-dropdown-chevron"})],8,K_),a.value?(b(),S("div",{key:0,class:ot(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":w.value==="up","composer-dropdown-menu-wrap-down":w.value==="down"}])},[v("div",Y_,[I.value?(b(),S("div",X_,[Zn(v("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ie[0]||(ie[0]=Y=>l.value=Y),class:"composer-dropdown-search-input",type:"text",placeholder:R.value,onKeydown:Zt(st(ae,["prevent"]),["esc"])},null,40,Q_),[[er,l.value]])])):re("",!0),v("ul",Z_,[(b(!0),S(Le,null,bt(P.value,Y=>(b(),S("li",{key:Y.value},[v("button",{class:ot(["composer-dropdown-option",{"is-selected":Y.value===e.modelValue}]),type:"button",onClick:Ae=>H(Y.value)},oe(Y.label),11,ek)]))),128)),P.value.length===0?(b(),S("li",tk," No matching projects ")):re("",!0)]),F.value?(b(),S("div",nk,[d.value?(b(),S(Le,{key:0},[Zn(v("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ie[1]||(ie[1]=Y=>u.value=Y),class:"composer-dropdown-add-input",type:"text",placeholder:N.value,onKeydown:[Zt(st(pe,["prevent"]),["enter"]),Zt(st(Te,["prevent"]),["esc"])]},null,40,rk),[[er,u.value]]),v("div",{class:"composer-dropdown-add-actions"},[v("button",{type:"button",class:"composer-dropdown-add-btn",onClick:pe},"Open"),v("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Te},"Cancel")])],64)):(b(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:se},oe(B.value),1))])):re("",!0)])],2)):re("",!0)],512))}}),Wo=et(sk,[["__scopeId","data-v-7cfa2012"]]),ok=["disabled"],ik={class:"search-dropdown-value"},ak={class:"search-dropdown-search-wrap"},lk=["placeholder","onKeydown"],ck={key:0,class:"search-dropdown-list",role:"listbox"},uk=["onClick","onPointerenter"],dk={class:"search-dropdown-option-check"},fk={class:"search-dropdown-option-label"},hk={key:0,class:"search-dropdown-option-desc"},pk={key:1,class:"search-dropdown-empty"},mk=$t({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),d=ue(()=>n.openDirection??"down"),u=ue(()=>new Set(n.selectedValues)),p=ue(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const P=n.options.find(D=>D.value===n.selectedValues[0]);return(P==null?void 0:P.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),w=ue(()=>{const P=a.value.toLowerCase().trim();return P?n.options.filter(D=>{var H;return D.label.toLowerCase().includes(P)||(((H=D.description)==null?void 0:H.toLowerCase().includes(P))??!1)}):n.options});function I(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,qt(()=>{var P;return(P=o.value)==null?void 0:P.focus()})))}function F(P){r("toggle",P.value,!u.value.has(P.value))}function R(P){w.value.length!==0&&(l.value=(l.value+P+w.value.length)%w.value.length)}function B(){const P=w.value[l.value];P&&F(P)}function N(P){if(!i.value)return;const D=s.value;if(!D)return;const H=P.target;H instanceof Node&&(D.contains(H)||(i.value=!1))}return ht(a,()=>{l.value=0}),sr(()=>window.addEventListener("pointerdown",N)),or(()=>window.removeEventListener("pointerdown",N)),(P,D)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[v("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:I},[v("span",ik,oe(p.value),1),Ie(hi,{class:"search-dropdown-chevron"})],8,ok),i.value?(b(),S("div",{key:0,class:ot(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[v("div",ak,[Zn(v("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":D[0]||(D[0]=H=>a.value=H),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[D[1]||(D[1]=Zt(st(H=>i.value=!1,["prevent"]),["escape"])),Zt(st(B,["prevent"]),["enter"]),D[2]||(D[2]=Zt(st(H=>R(1),["prevent"]),["arrow-down"])),D[3]||(D[3]=Zt(st(H=>R(-1),["prevent"]),["arrow-up"]))]},null,40,lk),[[er,a.value]])]),w.value.length>0?(b(),S("ul",ck,[(b(!0),S(Le,null,bt(w.value,(H,se)=>(b(),S("li",{key:H.value},[v("button",{class:ot(["search-dropdown-option",{"is-selected":u.value.has(H.value),"is-highlighted":se===l.value}]),type:"button",onClick:ae=>F(H),onPointerenter:ae=>l.value=se},[v("span",dk,oe(u.value.has(H.value)?"✓":""),1),v("span",fk,oe(H.label),1),H.description?(b(),S("span",hk,oe(H.description),1)):re("",!0)],42,uk)]))),128))])):(b(),S("div",pk,"No results"))],2)):re("",!0)],512))}}),gk=et(mk,[["__scopeId","data-v-a0f2edd4"]]),vk={class:"skill-picker-header"},yk=["onKeydown"],wk={key:0,class:"skill-picker-list",role:"listbox"},bk=["onClick","onPointerenter"],_k={class:"skill-picker-name"},kk={key:0,class:"skill-picker-desc"},Tk={key:1,class:"skill-picker-empty"},Sk=$t({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=ue(()=>{const w=i.value.toLowerCase().trim();return w?n.skills.filter(I=>I.name.toLowerCase().includes(w)||I.description.toLowerCase().includes(w)):n.skills}),d=ue(()=>{const w={};return n.anchorBottom!=null&&(w.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(w.left=`${n.anchorLeft}px`),w});function u(w){l.value.length!==0&&(a.value=(a.value+w+l.value.length)%l.value.length)}function p(){const w=l.value[a.value];w&&r("select",w)}return ht(()=>n.visible,w=>{w&&(i.value="",a.value=0,qt(()=>{var I;return(I=o.value)==null?void 0:I.focus()}))}),ht(i,()=>{a.value=0}),(w,I)=>e.visible?(b(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Hr(d.value)},[v("div",vk,[Zn(v("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":I[0]||(I[0]=F=>i.value=F),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[I[1]||(I[1]=Zt(st(F=>w.$emit("close"),["prevent"]),["escape"])),Zt(st(p,["prevent"]),["enter"]),I[2]||(I[2]=Zt(st(F=>u(1),["prevent"]),["arrow-down"])),I[3]||(I[3]=Zt(st(F=>u(-1),["prevent"]),["arrow-up"]))]},null,40,yk),[[er,i.value]])]),l.value.length>0?(b(),S("ul",wk,[(b(!0),S(Le,null,bt(l.value,(F,R)=>(b(),S("li",{key:F.path},[v("button",{class:ot(["skill-picker-item",{"is-highlighted":R===a.value}]),type:"button",onClick:B=>w.$emit("select",F),onPointerenter:B=>a.value=R},[v("span",_k,oe(F.name),1),F.description?(b(),S("span",kk,oe(F.description),1)):re("",!0)],42,bk)]))),128))])):(b(),S("div",Tk,"No skills found"))],4)):re("",!0)}}),Ik=et(Sk,[["__scopeId","data-v-ff3fb7dc"]]),Ek={key:0,class:"thread-composer-dictation-error"},Ck={key:0,class:"thread-composer-attachments"},Ak=["src","alt"],Rk=["aria-label","disabled","onClick"],Pk={key:1,class:"thread-composer-folder-chips"},xk=["title"],Mk={class:"thread-composer-folder-chip-meta"},Ok=["aria-label","disabled","onClick"],Nk={key:2,class:"thread-composer-file-chips"},$k=["title"],Dk=["aria-label","disabled","onClick"],Lk={key:3,class:"thread-composer-skill-chips"},jk={class:"thread-composer-skill-chip-name"},Uk=["aria-label","onClick"],Bk={class:"thread-composer-input-wrap"},Fk={key:0,class:"thread-composer-file-mentions"},Hk=["onMousedown"],Vk={key:1,class:"thread-composer-file-mention-icon-markdown"},Wk={class:"thread-composer-file-mention-text"},zk={class:"thread-composer-file-mention-name"},qk={key:0,class:"thread-composer-file-mention-dir"},Gk={key:1,class:"thread-composer-file-mention-empty"},Kk=["placeholder","disabled"],Jk=["disabled"],Yk={key:0,class:"thread-composer-attach-menu"},Xk=["disabled"],Qk=["disabled"],Zk=["disabled"],e0={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},t0={key:1,class:"thread-composer-dictation-timer"},n0=["aria-label","title","disabled"],r0=["disabled"],s0=["aria-label","title","disabled"],o0=["disabled"],i0=["disabled"],a0=["disabled"],l0=$t({__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=L(""),o=L([]),i=L([]),a=L([]),l=L([]),d=L(""),{state:u,isSupported:p,recordingDurationMs:w,waveformCanvasRef:I,startRecording:F,stopRecording:R,toggleRecording:B}=Wb({getLanguage:()=>n.dictationLanguage??"auto",onTranscript:f=>{if(s.value=s.value?`${s.value}
39
+ ${f}`:f,d.value="",n.dictationAutoSend!==!1){const m=n.isTurnInProgress?ze.value:"steer";y(m,{rollbackLatestUserTurn:m==="steer"&&Re}),Re=!1;return}qt(()=>{var m;return(m=se.value)==null?void 0:m.focus()})},onEmpty:()=>{d.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:f=>{if(f instanceof DOMException&&f.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=f instanceof Error?f.message:"Dictation failed."}}),N=L(null),P=L(null),D=L(null),H=L(null),se=L(null),ae=L(!1),pe=L(!1),Te=L(null),ce=L(""),te=L([]),ie=L(!1),Y=L(0);let Ae=0,Se=null,Me=!1,Re=!1;const Oe=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=ue(()=>n.models.map(f=>({value:f,label:f}))),Ye=ue(()=>n.skills??[]),Xe=ue(()=>i.value.map(f=>f.path)),We=ue(()=>(n.skills??[]).map(f=>({value:f.path,label:f.name,description:f.description}))),Qe=ue(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),tt=ue(()=>{const f=new Set;for(const m of l.value)for(const T of m.filePaths)f.add(T);return a.value.filter(m=>!f.has(m.fsPath))}),je=ue(()=>n.disabled||!n.activeThreadId),ze=ue(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),V=ue(()=>u.value==="recording"),ne=ue(()=>u.value==="recording"?"Stop dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),le=ue(()=>u.value==="idle"?d.value.trim():""),we=ue(()=>{const f=Math.max(0,Math.floor(w.value/1e3)),m=Math.floor(f/60),T=f%60;return`${m}:${String(T).padStart(2,"0")}`}),$e=ue(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function y(f="steer",m){var J;const T=s.value.trim();if(Qe.value){if(r("submit",{text:T,imageUrls:o.value.map(ee=>ee.url),fileAttachments:[...a.value],skills:i.value.map(ee=>({name:ee.name,path:ee.path})),mode:f,rollbackLatestUserTurn:(m==null?void 0:m.rollbackLatestUserTurn)===!0}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],ae.value=!1,pe.value=!1,Pt(),Oe){(J=se.value)==null||J.blur();return}qt(()=>{var ee;return(ee=se.value)==null?void 0:ee.focus()})}}function k(){r("interrupt")}function M(f){r("update:selected-model",f)}function W(f){r("update:selected-reasoning-effort",f)}function U(){n.dictationClickToToggle&&(d.value&&(d.value=""),u.value==="idle"&&(Re=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer"),B())}function x(f){if(n.dictationClickToToggle||(f.preventDefault(),Me))return;Me=!0;const m=f.currentTarget;if(m)try{m.setPointerCapture(f.pointerId)}catch{}d.value&&(d.value=""),Re=n.isTurnInProgress===!0&&n.inProgressSubmitMode==="steer",window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j),window.addEventListener("blur",j),F()}function j(){n.dictationClickToToggle||Me&&(Me=!1,window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),window.removeEventListener("blur",j),R())}function q(){je.value||(ae.value=!ae.value)}function K(){var f;(f=P.value)==null||f.click()}function G(){var f;(f=D.value)==null||f.click()}function ge(){var f;(f=H.value)==null||f.click()}function fe(f){o.value=o.value.filter(m=>m.id!==f)}function be(f){i.value=i.value.filter(m=>m.path!==f)}function Ee(f){a.value=a.value.filter(m=>m.fsPath!==f)}function Ne(f){const m=l.value.find(J=>J.id===f);if(!m)return;const T=new Set(m.filePaths);a.value=a.value.filter(J=>!T.has(J.fsPath)),l.value=l.value.filter(J=>J.id!==f)}function Ve(f){return f.total<=0?0:Math.round(f.processed/f.total*100)}function Be(f,m){const T=f.replace(/\\/g,"/");if(a.value.some(_e=>_e.fsPath===T))return;const J=T.split("/").filter(Boolean),ee=(m==null?void 0:m.trim())||J[J.length-1]||T;a.value=[...a.value,{label:ee,path:T,fsPath:T}]}function Je(f){return f.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(f.name)}function vt(f){if(!(!f||f.length===0))for(const m of Array.from(f))if(Je(m)){const T=new FileReader;T.onload=()=>{typeof T.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:m.name,url:T.result})},T.readAsDataURL(m)}else Zc(m).then(T=>{T&&Be(T)}).catch(()=>{})}async function it(f){if(!f||f.length===0)return;const m=Array.from(f),J=(m[0].webkitRelativePath||m[0].name).split("/").filter(Boolean)[0]||"Folder",ee=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:ee,name:J,total:m.length,processed:0,filePaths:[],isUploading:!0}];const _e=de=>{l.value=l.value.map(De=>De.id===ee?de(De):De)};for(const de of m)try{const De=await Zc(de);if(De){const Ze=de.webkitRelativePath||de.name;Be(De,Ze),_e(ct=>({...ct,processed:ct.processed+1,filePaths:[...ct.filePaths,De]}));continue}_e(Ze=>({...Ze,processed:Ze.processed+1}))}catch{_e(De=>({...De,processed:De.processed+1}))}_e(de=>({...de,isUploading:!1}))}function kt(f){f&&(f.value="")}function Et(f){const m=f.target;vt((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function mt(f){const m=f.target;vt((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function yt(f){const m=f.target;it((m==null?void 0:m.files)??null),kt(m),ae.value=!1}function qe(){d.value&&(d.value="");const m=s.value.startsWith("/");m!==pe.value&&(pe.value=m),Kt()}function nt(f){if(ie.value){if(f.key==="Escape"){f.preventDefault(),Pt();return}if(f.key==="ArrowDown"){f.preventDefault(),te.value.length>0&&(Y.value=(Y.value+1)%te.value.length);return}if(f.key==="ArrowUp"){if(f.preventDefault(),te.value.length>0){const T=te.value.length;Y.value=(Y.value+T-1)%T}return}if(f.key==="Enter"||f.key==="Tab"){f.preventDefault();const T=te.value[Y.value];T?an(T):Pt();return}}if(n.sendWithEnter!==!1?f.key==="Enter"&&!f.shiftKey:f.key==="Enter"&&(f.metaKey||f.ctrlKey)){f.preventDefault(),y(n.isTurnInProgress?ze.value:"steer");return}if(pe.value){if(f.key==="Escape"){f.preventDefault(),Ut();return}if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault();return}}}function Ut(){var f;pe.value=!1,(f=se.value)==null||f.focus()}function Pt(){ie.value=!1,Te.value=null,ce.value="",te.value=[],Y.value=0}function Kt(){const f=se.value;if(!f){Pt();return}const m=f.selectionStart??s.value.length,J=s.value.slice(0,m).match(/(^|\s)(@[^\s@]*)$/);if(!J){Pt();return}const ee=J[2]??"",_e=ee.length,de=m-_e;Te.value=de,ce.value=ee.slice(1),ie.value=!0,At()}async function At(){if(!ie.value)return;const f=(n.cwd??"").trim();if(!f){te.value=[];return}Se&&clearTimeout(Se);const m=++Ae;Se=setTimeout(async()=>{try{const T=await M_(f,ce.value,20);if(!ie.value||m!==Ae)return;te.value=T,Y.value=0}catch{if(!ie.value||m!==Ae)return;te.value=[]}},120)}function an(f){const m=se.value,T=Te.value;if(T!==null&&m){const J=m.selectionStart??s.value.length;s.value=`${s.value.slice(0,T)}${s.value.slice(J)}`.trimEnd()}Be(f.path),Pt(),qt(()=>m==null?void 0:m.focus())}function Bt(f){const m=f.lastIndexOf("/");return m<0?f:f.slice(m+1)}function rn(f){const m=f.lastIndexOf("/");return m<=0?"":f.slice(0,m)}function Dt(f){const m=Bt(f),T=m.lastIndexOf(".");return T<=0?"":m.slice(T+1).toLowerCase()}function Ce(f){const m=Dt(f);return m==="ts"?"TS":m==="tsx"?"TSX":m==="js"?"JS":m==="jsx"?"JSX":m==="json"?"{}":""}function Pe(f){const m=Dt(f);return m.startsWith("ts")?"ts":m.startsWith("js")?"js":m==="json"?"json":"default"}function sn(f){const m=Dt(f);return m==="md"||m==="mdx"}function hn(f){var m;i.value.some(T=>T.path===f.path)||(i.value=[...i.value,f]),s.value=s.value.startsWith("/")?"":s.value,pe.value=!1,(m=se.value)==null||m.focus()}function pn(f,m){if(m){const T=(n.skills??[]).find(J=>J.path===f);T&&!i.value.some(J=>J.path===f)&&(i.value=[...i.value,T])}else i.value=i.value.filter(T=>T.path!==f)}function _(f){if(!ae.value)return;const m=N.value;if(!m)return;const T=f.target;!T||m.contains(T)||(ae.value=!1)}return sr(()=>{document.addEventListener("click",_)}),or(()=>{document.removeEventListener("click",_),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),window.removeEventListener("blur",j),Se&&clearTimeout(Se)}),ht(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],d.value="",ae.value=!1,pe.value=!1,Pt()}),ht(()=>n.cwd,()=>{ie.value&&At()}),ht(()=>{var f;return(f=n.prependDraftRequest)==null?void 0:f.id},()=>{var m,T;const f=((T=(m=n.prependDraftRequest)==null?void 0:m.text)==null?void 0:T.trim())??"";f&&(s.value=s.value?`${f}
40
+ ${s.value}`:f,qe(),qt(()=>{var J;return(J=se.value)==null?void 0:J.focus()}))}),(f,m)=>(b(),S("form",{class:"thread-composer",onSubmit:m[2]||(m[2]=st(T=>y("steer"),["prevent"]))},[le.value?(b(),S("p",Ek,oe(le.value),1)):re("",!0),v("div",{class:ot(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(b(),S("div",Ck,[(b(!0),S(Le,null,bt(o.value,T=>(b(),S("div",{key:T.id,class:"thread-composer-attachment"},[v("img",{class:"thread-composer-attachment-image",src:T.url,alt:T.name||"Selected image"},null,8,Ak),v("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${T.name||"image"}`,disabled:je.value,onClick:J=>fe(T.id)}," x ",8,Rk)]))),128))])):re("",!0),l.value.length>0?(b(),S("div",Pk,[(b(!0),S(Le,null,bt(l.value,T=>(b(),S("span",{key:T.id,class:"thread-composer-folder-chip"},[Ie(dl,{class:"thread-composer-folder-chip-icon"}),v("span",{class:"thread-composer-folder-chip-name",title:T.name},oe(T.name),9,xk),v("span",Mk,[T.isUploading?(b(),S(Le,{key:0},[Js(oe(Ve(T))+"% uploading ("+oe(T.processed)+"/"+oe(T.total)+") ",1)],64)):(b(),S(Le,{key:1},[Js(oe(T.filePaths.length)+" file"+oe(T.filePaths.length===1?"":"s"),1)],64))]),v("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${T.name}`,disabled:je.value,onClick:J=>Ne(T.id)},"×",8,Ok)]))),128))])):re("",!0),tt.value.length>0?(b(),S("div",Nk,[(b(!0),S(Le,null,bt(tt.value,T=>(b(),S("span",{key:T.fsPath,class:"thread-composer-file-chip"},[Ie(Vo,{class:"thread-composer-file-chip-icon"}),v("span",{class:"thread-composer-file-chip-name",title:T.fsPath},oe(T.label),9,$k),v("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${T.label}`,disabled:je.value,onClick:J=>Ee(T.fsPath)},"×",8,Dk)]))),128))])):re("",!0),i.value.length>0?(b(),S("div",Lk,[(b(!0),S(Le,null,bt(i.value,T=>(b(),S("span",{key:T.path,class:"thread-composer-skill-chip"},[v("span",jk,oe(T.name),1),v("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${T.name}`,onClick:J=>be(T.path)},"×",8,Uk)]))),128))])):re("",!0),v("div",Bk,[ie.value?(b(),S("div",Fk,[te.value.length>0?(b(!0),S(Le,{key:0},bt(te.value,(T,J)=>(b(),S("button",{key:T.path,class:ot(["thread-composer-file-mention-row",{"is-active":J===Y.value}]),type:"button",onMousedown:st(ee=>an(T),["prevent"])},[Ce(T.path)?(b(),S("span",{key:0,class:ot(["thread-composer-file-mention-icon-badge",`is-${Pe(T.path)}`])},oe(Ce(T.path)),3)):sn(T.path)?(b(),S("span",Vk,"↓")):(b(),ft(Vo,{key:2,class:"thread-composer-file-mention-icon-file"})),v("span",Wk,[v("span",zk,oe(Bt(T.path)),1),rn(T.path)?(b(),S("span",qk,oe(rn(T.path)),1)):re("",!0)])],42,Hk))),128)):(b(),S("div",Gk,"No matching files"))])):re("",!0),Zn(v("textarea",{ref_key:"inputRef",ref:se,"onUpdate:modelValue":m[0]||(m[0]=T=>s.value=T),class:"thread-composer-input",placeholder:$e.value,disabled:je.value,onInput:qe,onKeydown:nt},null,40,Kk),[[er,s.value]]),Ie(Ik,{skills:Ye.value,visible:pe.value,"anchor-bottom":44,"anchor-left":0,onSelect:hn,onClose:Ut},null,8,["skills","visible"])]),v("div",{class:ot(["thread-composer-controls",{"thread-composer-controls--recording":V.value}])},[v("div",{ref_key:"attachMenuRootRef",ref:N,class:"thread-composer-attach"},[v("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:je.value,onClick:q}," + ",8,Jk),ae.value?(b(),S("div",Yk,[v("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:K}," Add photos & files ",8,Xk),v("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:ge}," Add folder ",8,Qk),v("button",{class:"thread-composer-attach-item",type:"button",disabled:je.value,onClick:G}," Take photo ",8,Zk)])):re("",!0)],512),V.value?re("",!0):(b(),S(Le,{key:0},[Ie(Wo,{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":M},null,8,["model-value","options","disabled"]),Ie(gk,{class:"thread-composer-control",options:We.value,"selected-values":Xe.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:pn},null,8,["options","selected-values","disabled"]),Ie(Wo,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:me,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":W},null,8,["model-value","disabled"])],64)),v("div",{class:ot(["thread-composer-actions",{"thread-composer-actions--recording":V.value}])},[ve(u)==="recording"?(b(),S("div",e0,[v("canvas",{ref_key:"dictationWaveformCanvasRef",ref:I,class:"thread-composer-dictation-waveform"},null,512)])):re("",!0),ve(u)==="recording"?(b(),S("span",t0,oe(we.value),1)):re("",!0),ve(p)?(b(),S("button",{key:2,class:ot(["thread-composer-mic",{"thread-composer-mic--active":ve(u)==="recording"}]),type:"button","aria-label":ne.value,title:ne.value,disabled:je.value,onClick:U,onPointerdown:x,onPointerup:j,onPointercancel:j},[ve(u)==="recording"?(b(),ft(eu,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(b(),ft(W_,{key:1,class:"thread-composer-mic-icon"}))],42,n0)):re("",!0),e.isTurnInProgress?(b(),S("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:k},[Ie(eu,{class:"thread-composer-stop-icon"})],8,r0)):(b(),S("button",{key:4,class:ot(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ze.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ze.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${ze.value}`:"Send",disabled:!Qe.value,onClick:m[1]||(m[1]=T=>y(e.isTurnInProgress?ze.value:"steer"))},[Ie(B_,{class:"thread-composer-submit-icon"})],10,s0))],2)],2)],2),v("input",{ref_key:"photoLibraryInputRef",ref:P,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:je.value,onChange:Et},null,40,o0),v("input",{ref_key:"cameraCaptureInputRef",ref:D,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:je.value,onChange:mt},null,40,i0),v("input",{ref_key:"folderPickerInputRef",ref:H,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:je.value,onChange:yt},null,40,a0)],32))}}),tu=et(l0,[["__scopeId","data-v-c1acf67b"]]),c0={key:0,class:"queued-messages"},u0={class:"queued-messages-inner"},d0={class:"queued-row-text"},f0={class:"queued-row-actions"},h0=["onClick"],p0=["onClick"],m0=$t({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(b(),S("div",c0,[v("div",u0,[(b(!0),S(Le,null,bt(e.messages,r=>(b(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=v("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[v("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)),v("span",d0,oe(r.text),1),v("div",f0,[v("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,h0),v("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]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[v("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,p0)])]))),128))])])):re("",!0)}}),g0=et(m0,[["__scopeId","data-v-ea583733"]]),v0={key:0,class:"rate-limit-status","aria-live":"polite"},y0=["title"],w0={class:"rate-limit-card-header"},b0={class:"rate-limit-card-title"},_0={key:0,class:"rate-limit-card-plan"},k0={class:"rate-limit-card-metrics"},T0={key:0,class:"rate-limit-card-footer"},S0=$t({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(N){var P,D;return((P=N.limitId)==null?void 0:P.trim())||((D=N.limitName)==null?void 0:D.trim())||"__default__"}function n(N){var P,D;return((P=N.limitName)==null?void 0:P.trim())||((D=N.limitId)==null?void 0:D.trim())||"Rate limits"}function r(N){const P=N.trim();return P?P.replace(/[_-]+/g," ").replace(/\b\w/g,D=>D.toUpperCase()):""}function s(N){return!N||N<=0?"Window":N%1440===0?`${N/1440}d`:N%60===0?`${N/60}h`:N<60?`${N}m`:`${Math.round(N/60*10)/10}h`}function o(N){const P=Math.max(0,Math.min(100,100-N));return`${Math.round(P)}% left`}function i(N){return`${Math.round(N)}%`}function a(N,P){return{key:P,label:`${s(N.windowDurationMins)} ${o(N.usedPercent)}`}}function l(N){const P=[];return N.primary&&P.push(a(N.primary,"primary")),N.secondary&&P.push(a(N.secondary,"secondary")),P}function d(N){if(!N)return"";const P=new Date(N*1e3),D=P.getMonth()+1,H=String(P.getDate()).padStart(2,"0"),se=String(P.getHours()).padStart(2,"0"),ae=String(P.getMinutes()).padStart(2,"0");return`${D}.${H} ${se}:${ae}`}function u(N){if(!(N!=null&&N.resetsAt))return"";const P=N.resetsAt*1e3-Date.now();if(P<=0)return"Resetting now";const D=Math.round(P/6e4);if(D<60)return`Resets in ${D}m`;const H=Math.round(D/60);return H<24?`Resets in ${H}h`:`Resets in ${Math.round(H/24)}d`}function p(N){return[N.primary,N.secondary].filter(P=>P!==null)}function w(N){const P=p(N);return P.length===0?null:[...P].sort((D,H)=>{const se=D.windowDurationMins??Number.MAX_SAFE_INTEGER,ae=H.windowDurationMins??Number.MAX_SAFE_INTEGER;return se!==ae?se-ae:(D.resetsAt??Number.MAX_SAFE_INTEGER)-(H.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function I(N){const P=p(N);if(P.length===0)return"";const D=[...P].sort((se,ae)=>{const pe=se.windowDurationMins??-1,Te=ae.windowDurationMins??-1;return pe!==Te?Te-pe:(ae.resetsAt??-1)-(se.resetsAt??-1)})[0],H=d(D.resetsAt);return H||""}function F(N){const P=N.credits;return P?P.unlimited?"Unlimited credits":P.balance?`Credits ${P.balance}`:P.hasCredits?"Credits available":"":""}function R(N){return[u(w(N)),I(N),F(N)].filter(P=>P.length>0)}function B(N){const P=[n(N)];for(const D of l(N))P.push(D.label);for(const D of p(N))P.push(`${s(D.windowDurationMins)} used ${i(D.usedPercent)}`);for(const D of R(N))P.push(D);return P.join(`
41
+ `)}return(N,P)=>e.snapshots.length>0?(b(),S("aside",v0,[(b(!0),S(Le,null,bt(e.snapshots,D=>(b(),S("div",{key:t(D),class:"rate-limit-card",title:B(D)},[v("div",w0,[v("span",b0,oe(n(D)),1),D.planType?(b(),S("span",_0,oe(r(D.planType)),1)):re("",!0)]),v("div",k0,[(b(!0),S(Le,null,bt(l(D),H=>(b(),S("span",{key:H.key,class:"rate-limit-card-metric"},oe(H.label),1))),128))]),R(D).length>0?(b(),S("div",T0,oe(R(D).join(" | ")),1)):re("",!0)],8,y0))),128))])):re("",!0)}}),I0=et(S0,[["__scopeId","data-v-df88906b"]]),E0={class:"runtime-dropdown-trigger-label"},C0={key:0,class:"runtime-dropdown-menu-wrap"},A0={class:"runtime-dropdown-menu"},R0=["onClick"],P0={class:"runtime-dropdown-option-label"},x0={key:0,class:"runtime-dropdown-option-check"},M0=$t({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:dl},{value:"worktree",label:"New worktree",icon:Po}],a=ue(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const p=s.value;if(!p)return;const w=u.target;w instanceof Node&&(p.contains(w)||(o.value=!1))}return sr(()=>{window.addEventListener("pointerdown",d)}),or(()=>{window.removeEventListener("pointerdown",d)}),(u,p)=>(b(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[v("button",{class:"runtime-dropdown-trigger",type:"button",onClick:p[0]||(p[0]=w=>o.value=!o.value)},[(b(),ft(va(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),v("span",E0,oe(a.value.label),1),Ie(hi,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(b(),S("div",C0,[v("div",A0,[p[1]||(p[1]=v("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(b(),S(Le,null,bt(i,w=>v("button",{key:w.value,class:ot(["runtime-dropdown-option",{"is-selected":e.modelValue===w.value}]),type:"button",onClick:I=>l(w.value)},[(b(),ft(va(w.icon),{class:"runtime-dropdown-option-icon"})),v("span",P0,oe(w.label),1),e.modelValue===w.value?(b(),S("span",x0,"✓")):re("",!0)],10,R0)),64))])])):re("",!0)],512))}}),O0=et(M0,[["__scopeId","data-v-9c9b71e5"]]),N0={},$0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function D0(e,t){return b(),S("svg",$0,[...t[0]||(t[0]=[v("circle",{cx:"11",cy:"11",r:"8"},null,-1),v("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Ra=et(N0,[["render",D0]]),L0={class:"skill-card-top"},j0=["src","alt"],U0={key:1,class:"skill-card-avatar-fallback"},B0={class:"skill-card-info"},F0={class:"skill-card-header"},H0={class:"skill-card-name"},V0={key:0,class:"skill-card-badge-disabled"},W0={key:1,class:"skill-card-badge"},z0={class:"skill-card-owner"},q0={key:0,class:"skill-card-desc"},G0={key:1,class:"skill-card-date"},K0=$t({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ue(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(b(),S("button",{class:ot(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[v("div",L0,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,j0)):(b(),S("div",U0,oe(e.skill.owner.charAt(0)),1)),v("div",B0,[v("div",F0,[v("span",H0,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(b(),S("span",V0,"Disabled")):e.skill.installed?(b(),S("span",W0,"Installed")):re("",!0)]),v("span",z0,oe(e.skill.owner),1)])]),e.skill.description?(b(),S("p",q0,oe(e.skill.description),1)):re("",!0),n.value?(b(),S("span",G0,oe(n.value),1)):re("",!0)],2))}}),nu=et(K0,[["__scopeId","data-v-2a1e8196"]]),J0={class:"sdm-panel"},Y0={class:"sdm-header"},X0={class:"sdm-title-area"},Q0=["src","alt"],Z0={class:"sdm-title-col"},eT={class:"sdm-title-row"},tT={class:"sdm-title"},nT={key:0,class:"sdm-badge-disabled"},rT={class:"sdm-owner"},sT={class:"sdm-body"},oT={key:0,class:"sdm-desc"},iT={key:1,class:"sdm-readme-loading"},aT=["innerHTML"],lT=["href"],cT={class:"sdm-footer"},uT={class:"sdm-footer-actions"},dT=["disabled"],fT=["disabled"],hT=["disabled"],pT=$t({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(""),i=L(!1),a=ue(()=>s.value??n.skill.enabled??!0),l=ue(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ue(()=>{const R=o.value;if(!R)return"";const B=R.replace(/^---[\s\S]*?---\s*/,"");return u(B)});function u(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 p(){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}),B=await fetch(`/codex-api/skills-hub/readme?${R}`);if(!B.ok)return;const N=await B.json();o.value=N.content??""}catch{}finally{i.value=!1}}}ht(()=>n.visible,R=>{R&&(s.value=null,o.value="",p())});function w(){r("install",n.skill)}function I(){r("uninstall",n.skill)}function F(){const R=!a.value;s.value=R,r("toggle-enabled",n.skill,R)}return(R,B)=>(b(),ft(jo,{to:"body"},[e.visible?(b(),S("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=st(N=>R.$emit("close"),["self"]))},[v("div",J0,[v("div",Y0,[v("div",X0,[e.skill.avatarUrl?(b(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,Q0)):re("",!0),v("div",Z0,[v("div",eT,[v("h3",tT,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(b(),S("span",nT,"Disabled")):re("",!0)]),v("span",rT,oe(e.skill.owner),1)])]),v("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=N=>R.$emit("close"))},[Ie(fl,{class:"sdm-close-icon"})])]),v("div",sT,[e.skill.description?(b(),S("p",oT,oe(e.skill.description),1)):re("",!0),i.value?(b(),S("div",iT,"Loading skill contents...")):o.value?(b(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,aT)):re("",!0),v("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,lT)]),v("div",cT,[v("div",uT,[e.skill.installed?(b(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:I},oe(n.isUninstalling?"Uninstalling...":"Uninstall"),9,dT)):(b(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:w},oe(n.isInstalling?"Installing...":"Install"),9,fT)),e.skill.installed?(b(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:F},oe(a.value?"Disable":"Enable"),9,hT)):re("",!0)])])])])):re("",!0)]))}}),mT=et(pT,[["__scopeId","data-v-19a385ca"]]),gT=()=>{};var ru={};/**
42
+ * @license
43
+ * Copyright 2017 Google LLC
44
+ *
45
+ * Licensed under the Apache License, Version 2.0 (the "License");
46
+ * you may not use this file except in compliance with the License.
47
+ * You may obtain a copy of the License at
48
+ *
49
+ * http://www.apache.org/licenses/LICENSE-2.0
50
+ *
51
+ * Unless required by applicable law or agreed to in writing, software
52
+ * distributed under the License is distributed on an "AS IS" BASIS,
53
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
+ * See the License for the specific language governing permissions and
55
+ * limitations under the License.
56
+ */const kf=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},vT=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("")},Tf={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,d=l?e[s+2]:0,u=o>>2,p=(o&3)<<4|a>>4;let w=(a&15)<<2|d>>6,I=d&63;l||(I=64,i||(w=64)),r.push(n[u],n[p],n[w],n[I])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(kf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):vT(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 d=s<e.length?n[e.charAt(s)]:64;++s;const p=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||d==null||p==null)throw new yT;const w=o<<2|a>>4;if(r.push(w),d!==64){const I=a<<4&240|d>>2;if(r.push(I),p!==64){const F=d<<6&192|p;r.push(F)}}}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 yT extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const wT=function(e){const t=kf(e);return Tf.encodeByteArray(t,!0)},Sf=function(e){return wT(e).replace(/\./g,"")},If=function(e){try{return Tf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
57
+ * @license
58
+ * Copyright 2022 Google LLC
59
+ *
60
+ * Licensed under the Apache License, Version 2.0 (the "License");
61
+ * you may not use this file except in compliance with the License.
62
+ * You may obtain a copy of the License at
63
+ *
64
+ * http://www.apache.org/licenses/LICENSE-2.0
65
+ *
66
+ * Unless required by applicable law or agreed to in writing, software
67
+ * distributed under the License is distributed on an "AS IS" BASIS,
68
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
69
+ * See the License for the specific language governing permissions and
70
+ * limitations under the License.
71
+ */function bT(){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.")}/**
72
+ * @license
73
+ * Copyright 2022 Google LLC
74
+ *
75
+ * Licensed under the Apache License, Version 2.0 (the "License");
76
+ * you may not use this file except in compliance with the License.
77
+ * You may obtain a copy of the License at
78
+ *
79
+ * http://www.apache.org/licenses/LICENSE-2.0
80
+ *
81
+ * Unless required by applicable law or agreed to in writing, software
82
+ * distributed under the License is distributed on an "AS IS" BASIS,
83
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84
+ * See the License for the specific language governing permissions and
85
+ * limitations under the License.
86
+ */const _T=()=>bT().__FIREBASE_DEFAULTS__,kT=()=>{if(typeof process>"u"||typeof ru>"u")return;const e=ru.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},TT=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&If(e[1]);return t&&JSON.parse(t)},ml=()=>{try{return gT()||_T()||kT()||TT()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},ST=e=>{var t,n;return(n=(t=ml())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},Ef=()=>{var e;return(e=ml())==null?void 0:e.config},Cf=e=>{var t;return(t=ml())==null?void 0:t[`_${e}`]};/**
87
+ * @license
88
+ * Copyright 2017 Google LLC
89
+ *
90
+ * Licensed under the Apache License, Version 2.0 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * http://www.apache.org/licenses/LICENSE-2.0
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" BASIS,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ */class IT{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))}}}/**
102
+ * @license
103
+ * Copyright 2017 Google LLC
104
+ *
105
+ * Licensed under the Apache License, Version 2.0 (the "License");
106
+ * you may not use this file except in compliance with the License.
107
+ * You may obtain a copy of the License at
108
+ *
109
+ * http://www.apache.org/licenses/LICENSE-2.0
110
+ *
111
+ * Unless required by applicable law or agreed to in writing, software
112
+ * distributed under the License is distributed on an "AS IS" BASIS,
113
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ * See the License for the specific language governing permissions and
115
+ * limitations under the License.
116
+ */function tn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function ET(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(tn())}function CT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function AT(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function RT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function PT(){const e=tn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function xT(){try{return typeof indexedDB=="object"}catch{return!1}}function MT(){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)}})}/**
117
+ * @license
118
+ * Copyright 2017 Google LLC
119
+ *
120
+ * Licensed under the Apache License, Version 2.0 (the "License");
121
+ * you may not use this file except in compliance with the License.
122
+ * You may obtain a copy of the License at
123
+ *
124
+ * http://www.apache.org/licenses/LICENSE-2.0
125
+ *
126
+ * Unless required by applicable law or agreed to in writing, software
127
+ * distributed under the License is distributed on an "AS IS" BASIS,
128
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
129
+ * See the License for the specific language governing permissions and
130
+ * limitations under the License.
131
+ */const OT="FirebaseError";class Ir extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=OT,Object.setPrototypeOf(this,Ir.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,io.prototype.create)}}class io{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?NT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Ir(s,a,r)}}function NT(e,t){return e.replace($T,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const $T=/\{\$([^}]+)}/g;function DT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function ps(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(su(o)&&su(i)){if(!ps(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function su(e){return e!==null&&typeof e=="object"}/**
132
+ * @license
133
+ * Copyright 2017 Google LLC
134
+ *
135
+ * Licensed under the Apache License, Version 2.0 (the "License");
136
+ * you may not use this file except in compliance with the License.
137
+ * You may obtain a copy of the License at
138
+ *
139
+ * http://www.apache.org/licenses/LICENSE-2.0
140
+ *
141
+ * Unless required by applicable law or agreed to in writing, software
142
+ * distributed under the License is distributed on an "AS IS" BASIS,
143
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
144
+ * See the License for the specific language governing permissions and
145
+ * limitations under the License.
146
+ */function ao(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function LT(e,t){const n=new jT(e,t);return n.subscribe.bind(n)}class jT{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.");UT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Yi),s.error===void 0&&(s.error=Yi),s.complete===void 0&&(s.complete=Yi);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 UT(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 Yi(){}/**
147
+ * @license
148
+ * Copyright 2021 Google LLC
149
+ *
150
+ * Licensed under the Apache License, Version 2.0 (the "License");
151
+ * you may not use this file except in compliance with the License.
152
+ * You may obtain a copy of the License at
153
+ *
154
+ * http://www.apache.org/licenses/LICENSE-2.0
155
+ *
156
+ * Unless required by applicable law or agreed to in writing, software
157
+ * distributed under the License is distributed on an "AS IS" BASIS,
158
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
159
+ * See the License for the specific language governing permissions and
160
+ * limitations under the License.
161
+ */function ys(e){return e&&e._delegate?e._delegate:e}/**
162
+ * @license
163
+ * Copyright 2025 Google LLC
164
+ *
165
+ * Licensed under the Apache License, Version 2.0 (the "License");
166
+ * you may not use this file except in compliance with the License.
167
+ * You may obtain a copy of the License at
168
+ *
169
+ * http://www.apache.org/licenses/LICENSE-2.0
170
+ *
171
+ * Unless required by applicable law or agreed to in writing, software
172
+ * distributed under the License is distributed on an "AS IS" BASIS,
173
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
174
+ * See the License for the specific language governing permissions and
175
+ * limitations under the License.
176
+ */function gl(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 ms{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}}/**
177
+ * @license
178
+ * Copyright 2019 Google LLC
179
+ *
180
+ * Licensed under the Apache License, Version 2.0 (the "License");
181
+ * you may not use this file except in compliance with the License.
182
+ * You may obtain a copy of the License at
183
+ *
184
+ * http://www.apache.org/licenses/LICENSE-2.0
185
+ *
186
+ * Unless required by applicable law or agreed to in writing, software
187
+ * distributed under the License is distributed on an "AS IS" BASIS,
188
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ * See the License for the specific language governing permissions and
190
+ * limitations under the License.
191
+ */const Nr="[DEFAULT]";/**
192
+ * @license
193
+ * Copyright 2019 Google LLC
194
+ *
195
+ * Licensed under the Apache License, Version 2.0 (the "License");
196
+ * you may not use this file except in compliance with the License.
197
+ * You may obtain a copy of the License at
198
+ *
199
+ * http://www.apache.org/licenses/LICENSE-2.0
200
+ *
201
+ * Unless required by applicable law or agreed to in writing, software
202
+ * distributed under the License is distributed on an "AS IS" BASIS,
203
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204
+ * See the License for the specific language governing permissions and
205
+ * limitations under the License.
206
+ */class FT{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 IT;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(VT(t))try{this.getOrInitializeService({instanceIdentifier:Nr})}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=Nr){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=Nr){return this.instances.has(t)}getOptions(t=Nr){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:HT(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=Nr){return this.component?this.component.multipleInstances?t:Nr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function HT(e){return e===Nr?void 0:e}function VT(e){return e.instantiationMode==="EAGER"}/**
207
+ * @license
208
+ * Copyright 2019 Google LLC
209
+ *
210
+ * Licensed under the Apache License, Version 2.0 (the "License");
211
+ * you may not use this file except in compliance with the License.
212
+ * You may obtain a copy of the License at
213
+ *
214
+ * http://www.apache.org/licenses/LICENSE-2.0
215
+ *
216
+ * Unless required by applicable law or agreed to in writing, software
217
+ * distributed under the License is distributed on an "AS IS" BASIS,
218
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
219
+ * See the License for the specific language governing permissions and
220
+ * limitations under the License.
221
+ */class WT{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 FT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
222
+ * @license
223
+ * Copyright 2017 Google LLC
224
+ *
225
+ * Licensed under the Apache License, Version 2.0 (the "License");
226
+ * you may not use this file except in compliance with the License.
227
+ * You may obtain a copy of the License at
228
+ *
229
+ * http://www.apache.org/licenses/LICENSE-2.0
230
+ *
231
+ * Unless required by applicable law or agreed to in writing, software
232
+ * distributed under the License is distributed on an "AS IS" BASIS,
233
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
234
+ * See the License for the specific language governing permissions and
235
+ * limitations under the License.
236
+ */var wt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(wt||(wt={}));const zT={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},qT=wt.INFO,GT={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},KT=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=GT[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 Af{constructor(t){this.name=t,this._logLevel=qT,this._logHandler=KT,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?zT[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const JT=(e,t)=>t.some(n=>e instanceof n);let ou,iu;function YT(){return ou||(ou=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function XT(){return iu||(iu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Rf=new WeakMap,Pa=new WeakMap,Pf=new WeakMap,Xi=new WeakMap,vl=new WeakMap;function QT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(_r(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&Rf.set(n,e)}).catch(()=>{}),vl.set(t,e),t}function ZT(e){if(Pa.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)});Pa.set(e,t)}let xa={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Pa.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Pf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return _r(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 eS(e){xa=e(xa)}function tS(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Qi(this),t,...n);return Pf.set(r,t.sort?t.sort():[t]),_r(r)}:XT().includes(e)?function(...t){return e.apply(Qi(this),t),_r(Rf.get(this))}:function(...t){return _r(e.apply(Qi(this),t))}}function nS(e){return typeof e=="function"?tS(e):(e instanceof IDBTransaction&&ZT(e),JT(e,YT())?new Proxy(e,xa):e)}function _r(e){if(e instanceof IDBRequest)return QT(e);if(Xi.has(e))return Xi.get(e);const t=nS(e);return t!==e&&(Xi.set(e,t),vl.set(t,e)),t}const Qi=e=>vl.get(e);function rS(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=_r(i);return r&&i.addEventListener("upgradeneeded",l=>{r(_r(i.result),l.oldVersion,l.newVersion,_r(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",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),a}const sS=["get","getKey","getAll","getAllKeys","count"],oS=["put","add","delete","clear"],Zi=new Map;function au(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Zi.get(t))return Zi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=oS.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||sS.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let d=l.store;return r&&(d=d.index(a.shift())),(await Promise.all([d[n](...a),s&&l.done]))[0]};return Zi.set(t,o),o}eS(e=>({...e,get:(t,n,r)=>au(t,n)||e.get(t,n,r),has:(t,n)=>!!au(t,n)||e.has(t,n)}));/**
237
+ * @license
238
+ * Copyright 2019 Google LLC
239
+ *
240
+ * Licensed under the Apache License, Version 2.0 (the "License");
241
+ * you may not use this file except in compliance with the License.
242
+ * You may obtain a copy of the License at
243
+ *
244
+ * http://www.apache.org/licenses/LICENSE-2.0
245
+ *
246
+ * Unless required by applicable law or agreed to in writing, software
247
+ * distributed under the License is distributed on an "AS IS" BASIS,
248
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
249
+ * See the License for the specific language governing permissions and
250
+ * limitations under the License.
251
+ */class iS{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(aS(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function aS(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Ma="@firebase/app",lu="0.14.10";/**
252
+ * @license
253
+ * Copyright 2019 Google LLC
254
+ *
255
+ * Licensed under the Apache License, Version 2.0 (the "License");
256
+ * you may not use this file except in compliance with the License.
257
+ * You may obtain a copy of the License at
258
+ *
259
+ * http://www.apache.org/licenses/LICENSE-2.0
260
+ *
261
+ * Unless required by applicable law or agreed to in writing, software
262
+ * distributed under the License is distributed on an "AS IS" BASIS,
263
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
264
+ * See the License for the specific language governing permissions and
265
+ * limitations under the License.
266
+ */const tr=new Af("@firebase/app"),lS="@firebase/app-compat",cS="@firebase/analytics-compat",uS="@firebase/analytics",dS="@firebase/app-check-compat",fS="@firebase/app-check",hS="@firebase/auth",pS="@firebase/auth-compat",mS="@firebase/database",gS="@firebase/data-connect",vS="@firebase/database-compat",yS="@firebase/functions",wS="@firebase/functions-compat",bS="@firebase/installations",_S="@firebase/installations-compat",kS="@firebase/messaging",TS="@firebase/messaging-compat",SS="@firebase/performance",IS="@firebase/performance-compat",ES="@firebase/remote-config",CS="@firebase/remote-config-compat",AS="@firebase/storage",RS="@firebase/storage-compat",PS="@firebase/firestore",xS="@firebase/ai",MS="@firebase/firestore-compat",OS="firebase",NS="12.11.0";/**
267
+ * @license
268
+ * Copyright 2019 Google LLC
269
+ *
270
+ * Licensed under the Apache License, Version 2.0 (the "License");
271
+ * you may not use this file except in compliance with the License.
272
+ * You may obtain a copy of the License at
273
+ *
274
+ * http://www.apache.org/licenses/LICENSE-2.0
275
+ *
276
+ * Unless required by applicable law or agreed to in writing, software
277
+ * distributed under the License is distributed on an "AS IS" BASIS,
278
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
279
+ * See the License for the specific language governing permissions and
280
+ * limitations under the License.
281
+ */const Oa="[DEFAULT]",$S={[Ma]:"fire-core",[lS]:"fire-core-compat",[uS]:"fire-analytics",[cS]:"fire-analytics-compat",[fS]:"fire-app-check",[dS]:"fire-app-check-compat",[hS]:"fire-auth",[pS]:"fire-auth-compat",[mS]:"fire-rtdb",[gS]:"fire-data-connect",[vS]:"fire-rtdb-compat",[yS]:"fire-fn",[wS]:"fire-fn-compat",[bS]:"fire-iid",[_S]:"fire-iid-compat",[kS]:"fire-fcm",[TS]:"fire-fcm-compat",[SS]:"fire-perf",[IS]:"fire-perf-compat",[ES]:"fire-rc",[CS]:"fire-rc-compat",[AS]:"fire-gcs",[RS]:"fire-gcs-compat",[PS]:"fire-fst",[MS]:"fire-fst-compat",[xS]:"fire-vertex","fire-js":"fire-js",[OS]:"fire-js-all"};/**
282
+ * @license
283
+ * Copyright 2019 Google LLC
284
+ *
285
+ * Licensed under the Apache License, Version 2.0 (the "License");
286
+ * you may not use this file except in compliance with the License.
287
+ * You may obtain a copy of the License at
288
+ *
289
+ * http://www.apache.org/licenses/LICENSE-2.0
290
+ *
291
+ * Unless required by applicable law or agreed to in writing, software
292
+ * distributed under the License is distributed on an "AS IS" BASIS,
293
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
294
+ * See the License for the specific language governing permissions and
295
+ * limitations under the License.
296
+ */const Zs=new Map,DS=new Map,Na=new Map;function cu(e,t){try{e.container.addComponent(t)}catch(n){tr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function eo(e){const t=e.name;if(Na.has(t))return tr.debug(`There were multiple attempts to register component ${t}.`),!1;Na.set(t,e);for(const n of Zs.values())cu(n,e);for(const n of DS.values())cu(n,e);return!0}function xf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Pn(e){return e==null?!1:e.settings!==void 0}/**
297
+ * @license
298
+ * Copyright 2019 Google LLC
299
+ *
300
+ * Licensed under the Apache License, Version 2.0 (the "License");
301
+ * you may not use this file except in compliance with the License.
302
+ * You may obtain a copy of the License at
303
+ *
304
+ * http://www.apache.org/licenses/LICENSE-2.0
305
+ *
306
+ * Unless required by applicable law or agreed to in writing, software
307
+ * distributed under the License is distributed on an "AS IS" BASIS,
308
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
309
+ * See the License for the specific language governing permissions and
310
+ * limitations under the License.
311
+ */const LS={"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."},kr=new io("app","Firebase",LS);/**
312
+ * @license
313
+ * Copyright 2019 Google LLC
314
+ *
315
+ * Licensed under the Apache License, Version 2.0 (the "License");
316
+ * you may not use this file except in compliance with the License.
317
+ * You may obtain a copy of the License at
318
+ *
319
+ * http://www.apache.org/licenses/LICENSE-2.0
320
+ *
321
+ * Unless required by applicable law or agreed to in writing, software
322
+ * distributed under the License is distributed on an "AS IS" BASIS,
323
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
324
+ * See the License for the specific language governing permissions and
325
+ * limitations under the License.
326
+ */class jS{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 ms("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 kr.create("app-deleted",{appName:this._name})}}/**
327
+ * @license
328
+ * Copyright 2019 Google LLC
329
+ *
330
+ * Licensed under the Apache License, Version 2.0 (the "License");
331
+ * you may not use this file except in compliance with the License.
332
+ * You may obtain a copy of the License at
333
+ *
334
+ * http://www.apache.org/licenses/LICENSE-2.0
335
+ *
336
+ * Unless required by applicable law or agreed to in writing, software
337
+ * distributed under the License is distributed on an "AS IS" BASIS,
338
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
339
+ * See the License for the specific language governing permissions and
340
+ * limitations under the License.
341
+ */const lo=NS;function Mf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:Oa,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw kr.create("bad-app-name",{appName:String(s)});if(n||(n=Ef()),!n)throw kr.create("no-options");const o=Zs.get(s);if(o){if(ps(n,o.options)&&ps(r,o.config))return o;throw kr.create("duplicate-app",{appName:s})}const i=new WT(s);for(const l of Na.values())i.addComponent(l);const a=new jS(n,r,i);return Zs.set(s,a),a}function Of(e=Oa){const t=Zs.get(e);if(!t&&e===Oa&&Ef())return Mf();if(!t)throw kr.create("no-app",{appName:e});return t}function US(){return Array.from(Zs.values())}function as(e,t,n){let r=$S[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 "/")`),tr.warn(i.join(" "));return}eo(new ms(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
342
+ * @license
343
+ * Copyright 2021 Google LLC
344
+ *
345
+ * Licensed under the Apache License, Version 2.0 (the "License");
346
+ * you may not use this file except in compliance with the License.
347
+ * You may obtain a copy of the License at
348
+ *
349
+ * http://www.apache.org/licenses/LICENSE-2.0
350
+ *
351
+ * Unless required by applicable law or agreed to in writing, software
352
+ * distributed under the License is distributed on an "AS IS" BASIS,
353
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
354
+ * See the License for the specific language governing permissions and
355
+ * limitations under the License.
356
+ */const BS="firebase-heartbeat-database",FS=1,to="firebase-heartbeat-store";let ea=null;function Nf(){return ea||(ea=rS(BS,FS,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(to)}catch(n){console.warn(n)}}}}).catch(e=>{throw kr.create("idb-open",{originalErrorMessage:e.message})})),ea}async function HS(e){try{const n=(await Nf()).transaction(to),r=await n.objectStore(to).get($f(e));return await n.done,r}catch(t){if(t instanceof Ir)tr.warn(t.message);else{const n=kr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});tr.warn(n.message)}}}async function uu(e,t){try{const r=(await Nf()).transaction(to,"readwrite");await r.objectStore(to).put(t,$f(e)),await r.done}catch(n){if(n instanceof Ir)tr.warn(n.message);else{const r=kr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});tr.warn(r.message)}}}function $f(e){return`${e.name}!${e.options.appId}`}/**
357
+ * @license
358
+ * Copyright 2021 Google LLC
359
+ *
360
+ * Licensed under the Apache License, Version 2.0 (the "License");
361
+ * you may not use this file except in compliance with the License.
362
+ * You may obtain a copy of the License at
363
+ *
364
+ * http://www.apache.org/licenses/LICENSE-2.0
365
+ *
366
+ * Unless required by applicable law or agreed to in writing, software
367
+ * distributed under the License is distributed on an "AS IS" BASIS,
368
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
369
+ * See the License for the specific language governing permissions and
370
+ * limitations under the License.
371
+ */const VS=1024,WS=30;class zS{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new GS(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=du();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>WS){const i=KS(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){tr.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=du(),{heartbeatsToSend:r,unsentEntries:s}=qS(this._heartbeatsCache.heartbeats),o=Sf(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 tr.warn(n),""}}}function du(){return new Date().toISOString().substring(0,10)}function qS(e,t=VS){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),fu(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),fu(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class GS{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return xT()?MT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await HS(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 uu(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 uu(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function fu(e){return Sf(JSON.stringify({version:2,heartbeats:e})).length}function KS(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}/**
372
+ * @license
373
+ * Copyright 2019 Google LLC
374
+ *
375
+ * Licensed under the Apache License, Version 2.0 (the "License");
376
+ * you may not use this file except in compliance with the License.
377
+ * You may obtain a copy of the License at
378
+ *
379
+ * http://www.apache.org/licenses/LICENSE-2.0
380
+ *
381
+ * Unless required by applicable law or agreed to in writing, software
382
+ * distributed under the License is distributed on an "AS IS" BASIS,
383
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
384
+ * See the License for the specific language governing permissions and
385
+ * limitations under the License.
386
+ */function JS(e){eo(new ms("platform-logger",t=>new iS(t),"PRIVATE")),eo(new ms("heartbeat",t=>new zS(t),"PRIVATE")),as(Ma,lu,e),as(Ma,lu,"esm2020"),as("fire-js","")}JS("");var YS="firebase",XS="12.11.0";/**
387
+ * @license
388
+ * Copyright 2020 Google LLC
389
+ *
390
+ * Licensed under the Apache License, Version 2.0 (the "License");
391
+ * you may not use this file except in compliance with the License.
392
+ * You may obtain a copy of the License at
393
+ *
394
+ * http://www.apache.org/licenses/LICENSE-2.0
395
+ *
396
+ * Unless required by applicable law or agreed to in writing, software
397
+ * distributed under the License is distributed on an "AS IS" BASIS,
398
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
399
+ * See the License for the specific language governing permissions and
400
+ * limitations under the License.
401
+ */as(YS,XS,"app");function Df(){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 QS=Df,Lf=new io("auth","Firebase",Df());/**
402
+ * @license
403
+ * Copyright 2020 Google LLC
404
+ *
405
+ * Licensed under the Apache License, Version 2.0 (the "License");
406
+ * you may not use this file except in compliance with the License.
407
+ * You may obtain a copy of the License at
408
+ *
409
+ * http://www.apache.org/licenses/LICENSE-2.0
410
+ *
411
+ * Unless required by applicable law or agreed to in writing, software
412
+ * distributed under the License is distributed on an "AS IS" BASIS,
413
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
414
+ * See the License for the specific language governing permissions and
415
+ * limitations under the License.
416
+ */const zo=new Af("@firebase/auth");function ZS(e,...t){zo.logLevel<=wt.WARN&&zo.warn(`Auth (${lo}): ${e}`,...t)}function xo(e,...t){zo.logLevel<=wt.ERROR&&zo.error(`Auth (${lo}): ${e}`,...t)}/**
417
+ * @license
418
+ * Copyright 2020 Google LLC
419
+ *
420
+ * Licensed under the Apache License, Version 2.0 (the "License");
421
+ * you may not use this file except in compliance with the License.
422
+ * You may obtain a copy of the License at
423
+ *
424
+ * http://www.apache.org/licenses/LICENSE-2.0
425
+ *
426
+ * Unless required by applicable law or agreed to in writing, software
427
+ * distributed under the License is distributed on an "AS IS" BASIS,
428
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
429
+ * See the License for the specific language governing permissions and
430
+ * limitations under the License.
431
+ */function $n(e,...t){throw wl(e,...t)}function yn(e,...t){return wl(e,...t)}function yl(e,t,n){const r={...QS(),[t]:n};return new io("auth","Firebase",r).create(t,{appName:e.name})}function Fr(e){return yl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function eI(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),yl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function wl(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 Lf.create(e,...t)}function He(e,t,...n){if(!e)throw wl(t,...n)}function Gn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw xo(t),new Error(t)}function nr(e,t){e||Gn(t)}/**
432
+ * @license
433
+ * Copyright 2020 Google LLC
434
+ *
435
+ * Licensed under the Apache License, Version 2.0 (the "License");
436
+ * you may not use this file except in compliance with the License.
437
+ * You may obtain a copy of the License at
438
+ *
439
+ * http://www.apache.org/licenses/LICENSE-2.0
440
+ *
441
+ * Unless required by applicable law or agreed to in writing, software
442
+ * distributed under the License is distributed on an "AS IS" BASIS,
443
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
444
+ * See the License for the specific language governing permissions and
445
+ * limitations under the License.
446
+ */function $a(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function tI(){return hu()==="http:"||hu()==="https:"}function hu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
447
+ * @license
448
+ * Copyright 2020 Google LLC
449
+ *
450
+ * Licensed under the Apache License, Version 2.0 (the "License");
451
+ * you may not use this file except in compliance with the License.
452
+ * You may obtain a copy of the License at
453
+ *
454
+ * http://www.apache.org/licenses/LICENSE-2.0
455
+ *
456
+ * Unless required by applicable law or agreed to in writing, software
457
+ * distributed under the License is distributed on an "AS IS" BASIS,
458
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
459
+ * See the License for the specific language governing permissions and
460
+ * limitations under the License.
461
+ */function nI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(tI()||AT()||"connection"in navigator)?navigator.onLine:!0}function rI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
462
+ * @license
463
+ * Copyright 2020 Google LLC
464
+ *
465
+ * Licensed under the Apache License, Version 2.0 (the "License");
466
+ * you may not use this file except in compliance with the License.
467
+ * You may obtain a copy of the License at
468
+ *
469
+ * http://www.apache.org/licenses/LICENSE-2.0
470
+ *
471
+ * Unless required by applicable law or agreed to in writing, software
472
+ * distributed under the License is distributed on an "AS IS" BASIS,
473
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
474
+ * See the License for the specific language governing permissions and
475
+ * limitations under the License.
476
+ */class co{constructor(t,n){this.shortDelay=t,this.longDelay=n,nr(n>t,"Short delay should be less than long delay!"),this.isMobile=ET()||RT()}get(){return nI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
477
+ * @license
478
+ * Copyright 2020 Google LLC
479
+ *
480
+ * Licensed under the Apache License, Version 2.0 (the "License");
481
+ * you may not use this file except in compliance with the License.
482
+ * You may obtain a copy of the License at
483
+ *
484
+ * http://www.apache.org/licenses/LICENSE-2.0
485
+ *
486
+ * Unless required by applicable law or agreed to in writing, software
487
+ * distributed under the License is distributed on an "AS IS" BASIS,
488
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
489
+ * See the License for the specific language governing permissions and
490
+ * limitations under the License.
491
+ */function bl(e,t){nr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
492
+ * @license
493
+ * Copyright 2020 Google LLC
494
+ *
495
+ * Licensed under the Apache License, Version 2.0 (the "License");
496
+ * you may not use this file except in compliance with the License.
497
+ * You may obtain a copy of the License at
498
+ *
499
+ * http://www.apache.org/licenses/LICENSE-2.0
500
+ *
501
+ * Unless required by applicable law or agreed to in writing, software
502
+ * distributed under the License is distributed on an "AS IS" BASIS,
503
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
504
+ * See the License for the specific language governing permissions and
505
+ * limitations under the License.
506
+ */class jf{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;Gn("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;Gn("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;Gn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
507
+ * @license
508
+ * Copyright 2020 Google LLC
509
+ *
510
+ * Licensed under the Apache License, Version 2.0 (the "License");
511
+ * you may not use this file except in compliance with the License.
512
+ * You may obtain a copy of the License at
513
+ *
514
+ * http://www.apache.org/licenses/LICENSE-2.0
515
+ *
516
+ * Unless required by applicable law or agreed to in writing, software
517
+ * distributed under the License is distributed on an "AS IS" BASIS,
518
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
519
+ * See the License for the specific language governing permissions and
520
+ * limitations under the License.
521
+ */const sI={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"};/**
522
+ * @license
523
+ * Copyright 2020 Google LLC
524
+ *
525
+ * Licensed under the Apache License, Version 2.0 (the "License");
526
+ * you may not use this file except in compliance with the License.
527
+ * You may obtain a copy of the License at
528
+ *
529
+ * http://www.apache.org/licenses/LICENSE-2.0
530
+ *
531
+ * Unless required by applicable law or agreed to in writing, software
532
+ * distributed under the License is distributed on an "AS IS" BASIS,
533
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
534
+ * See the License for the specific language governing permissions and
535
+ * limitations under the License.
536
+ */const oI=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],iI=new co(3e4,6e4);function _l(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function ws(e,t,n,r,s={}){return Uf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ao({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const d={method:t,headers:l,...o};return CT()||(d.referrerPolicy="no-referrer"),e.emulatorConfig&&gl(e.emulatorConfig.host)&&(d.credentials="include"),jf.fetch()(await Bf(e,e.config.apiHost,n,a),d)})}async function Uf(e,t,n){e._canInitEmulator=!1;const r={...sI,...t};try{const s=new lI(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw bo(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,d]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw bo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw bo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw bo(e,"user-disabled",i);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw yl(e,u,d);$n(e,u)}}catch(s){if(s instanceof Ir)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function aI(e,t,n,r,s={}){const o=await ws(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function Bf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?bl(e.config,s):`${e.config.apiScheme}://${s}`;return oI.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class lI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(yn(this.auth,"network-request-failed")),iI.get())})}}function bo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=yn(e,t,r);return s.customData._tokenResponse=n,s}/**
537
+ * @license
538
+ * Copyright 2020 Google LLC
539
+ *
540
+ * Licensed under the Apache License, Version 2.0 (the "License");
541
+ * you may not use this file except in compliance with the License.
542
+ * You may obtain a copy of the License at
543
+ *
544
+ * http://www.apache.org/licenses/LICENSE-2.0
545
+ *
546
+ * Unless required by applicable law or agreed to in writing, software
547
+ * distributed under the License is distributed on an "AS IS" BASIS,
548
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
549
+ * See the License for the specific language governing permissions and
550
+ * limitations under the License.
551
+ */async function cI(e,t){return ws(e,"POST","/v1/accounts:delete",t)}async function qo(e,t){return ws(e,"POST","/v1/accounts:lookup",t)}/**
552
+ * @license
553
+ * Copyright 2020 Google LLC
554
+ *
555
+ * Licensed under the Apache License, Version 2.0 (the "License");
556
+ * you may not use this file except in compliance with the License.
557
+ * You may obtain a copy of the License at
558
+ *
559
+ * http://www.apache.org/licenses/LICENSE-2.0
560
+ *
561
+ * Unless required by applicable law or agreed to in writing, software
562
+ * distributed under the License is distributed on an "AS IS" BASIS,
563
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
564
+ * See the License for the specific language governing permissions and
565
+ * limitations under the License.
566
+ */function Hs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function uI(e,t=!1){const n=ys(e),r=await n.getIdToken(t),s=kl(r);He(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Hs(ta(s.auth_time)),issuedAtTime:Hs(ta(s.iat)),expirationTime:Hs(ta(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function ta(e){return Number(e)*1e3}function kl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return xo("JWT malformed, contained fewer than 3 sections"),null;try{const s=If(n);return s?JSON.parse(s):(xo("Failed to decode base64 JWT payload"),null)}catch(s){return xo("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function pu(e){const t=kl(e);return He(t,"internal-error"),He(typeof t.exp<"u","internal-error"),He(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
567
+ * @license
568
+ * Copyright 2020 Google LLC
569
+ *
570
+ * Licensed under the Apache License, Version 2.0 (the "License");
571
+ * you may not use this file except in compliance with the License.
572
+ * You may obtain a copy of the License at
573
+ *
574
+ * http://www.apache.org/licenses/LICENSE-2.0
575
+ *
576
+ * Unless required by applicable law or agreed to in writing, software
577
+ * distributed under the License is distributed on an "AS IS" BASIS,
578
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
579
+ * See the License for the specific language governing permissions and
580
+ * limitations under the License.
581
+ */async function no(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Ir&&dI(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function dI({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
582
+ * @license
583
+ * Copyright 2020 Google LLC
584
+ *
585
+ * Licensed under the Apache License, Version 2.0 (the "License");
586
+ * you may not use this file except in compliance with the License.
587
+ * You may obtain a copy of the License at
588
+ *
589
+ * http://www.apache.org/licenses/LICENSE-2.0
590
+ *
591
+ * Unless required by applicable law or agreed to in writing, software
592
+ * distributed under the License is distributed on an "AS IS" BASIS,
593
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
594
+ * See the License for the specific language governing permissions and
595
+ * limitations under the License.
596
+ */class fI{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()}}/**
597
+ * @license
598
+ * Copyright 2020 Google LLC
599
+ *
600
+ * Licensed under the Apache License, Version 2.0 (the "License");
601
+ * you may not use this file except in compliance with the License.
602
+ * You may obtain a copy of the License at
603
+ *
604
+ * http://www.apache.org/licenses/LICENSE-2.0
605
+ *
606
+ * Unless required by applicable law or agreed to in writing, software
607
+ * distributed under the License is distributed on an "AS IS" BASIS,
608
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
609
+ * See the License for the specific language governing permissions and
610
+ * limitations under the License.
611
+ */class Da{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Hs(this.lastLoginAt),this.creationTime=Hs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
612
+ * @license
613
+ * Copyright 2019 Google LLC
614
+ *
615
+ * Licensed under the Apache License, Version 2.0 (the "License");
616
+ * you may not use this file except in compliance with the License.
617
+ * You may obtain a copy of the License at
618
+ *
619
+ * http://www.apache.org/licenses/LICENSE-2.0
620
+ *
621
+ * Unless required by applicable law or agreed to in writing, software
622
+ * distributed under the License is distributed on an "AS IS" BASIS,
623
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
624
+ * See the License for the specific language governing permissions and
625
+ * limitations under the License.
626
+ */async function Go(e){var p;const t=e.auth,n=await e.getIdToken(),r=await no(e,qo(t,{idToken:n}));He(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(p=s.providerUserInfo)!=null&&p.length?Ff(s.providerUserInfo):[],i=pI(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),d=a?l:!1,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:i,metadata:new Da(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,u)}async function hI(e){const t=ys(e);await Go(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function pI(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function Ff(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}))}/**
627
+ * @license
628
+ * Copyright 2020 Google LLC
629
+ *
630
+ * Licensed under the Apache License, Version 2.0 (the "License");
631
+ * you may not use this file except in compliance with the License.
632
+ * You may obtain a copy of the License at
633
+ *
634
+ * http://www.apache.org/licenses/LICENSE-2.0
635
+ *
636
+ * Unless required by applicable law or agreed to in writing, software
637
+ * distributed under the License is distributed on an "AS IS" BASIS,
638
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
639
+ * See the License for the specific language governing permissions and
640
+ * limitations under the License.
641
+ */async function mI(e,t){const n=await Uf(e,{},async()=>{const r=ao({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await Bf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&gl(e.emulatorConfig.host)&&(l.credentials="include"),jf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function gI(e,t){return ws(e,"POST","/v2/accounts:revokeToken",_l(e,t))}/**
642
+ * @license
643
+ * Copyright 2020 Google LLC
644
+ *
645
+ * Licensed under the Apache License, Version 2.0 (the "License");
646
+ * you may not use this file except in compliance with the License.
647
+ * You may obtain a copy of the License at
648
+ *
649
+ * http://www.apache.org/licenses/LICENSE-2.0
650
+ *
651
+ * Unless required by applicable law or agreed to in writing, software
652
+ * distributed under the License is distributed on an "AS IS" BASIS,
653
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
654
+ * See the License for the specific language governing permissions and
655
+ * limitations under the License.
656
+ */class ls{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){He(t.idToken,"internal-error"),He(typeof t.idToken<"u","internal-error"),He(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):pu(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){He(t.length!==0,"internal-error");const n=pu(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(He(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 mI(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 ls;return r&&(He(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(He(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(He(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 ls,this.toJSON())}_performRefresh(){return Gn("not implemented")}}/**
657
+ * @license
658
+ * Copyright 2020 Google LLC
659
+ *
660
+ * Licensed under the Apache License, Version 2.0 (the "License");
661
+ * you may not use this file except in compliance with the License.
662
+ * You may obtain a copy of the License at
663
+ *
664
+ * http://www.apache.org/licenses/LICENSE-2.0
665
+ *
666
+ * Unless required by applicable law or agreed to in writing, software
667
+ * distributed under the License is distributed on an "AS IS" BASIS,
668
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
669
+ * See the License for the specific language governing permissions and
670
+ * limitations under the License.
671
+ */function hr(e,t){He(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class mn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new fI(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 Da(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await no(this,this.stsTokenManager.getToken(this.auth,t));return He(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return uI(this,t)}reload(){return hI(this)}_assign(t){this!==t&&(He(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 mn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){He(!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 Go(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Pn(this.auth.app))return Promise.reject(Fr(this.auth));const t=await this.getIdToken();return await no(this,cI(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,d=n.createdAt??void 0,u=n.lastLoginAt??void 0,{uid:p,emailVerified:w,isAnonymous:I,providerData:F,stsTokenManager:R}=n;He(p&&R,t,"internal-error");const B=ls.fromJSON(this.name,R);He(typeof p=="string",t,"internal-error"),hr(r,t.name),hr(s,t.name),He(typeof w=="boolean",t,"internal-error"),He(typeof I=="boolean",t,"internal-error"),hr(o,t.name),hr(i,t.name),hr(a,t.name),hr(l,t.name),hr(d,t.name),hr(u,t.name);const N=new mn({uid:p,auth:t,email:s,emailVerified:w,displayName:r,isAnonymous:I,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:B,createdAt:d,lastLoginAt:u});return F&&Array.isArray(F)&&(N.providerData=F.map(P=>({...P}))),l&&(N._redirectEventId=l),N}static async _fromIdTokenResponse(t,n,r=!1){const s=new ls;s.updateFromServerResponse(n);const o=new mn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Go(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];He(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Ff(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new ls;a.updateFromIdToken(r);const l=new mn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),d={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 Da(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,d),l}}/**
672
+ * @license
673
+ * Copyright 2020 Google LLC
674
+ *
675
+ * Licensed under the Apache License, Version 2.0 (the "License");
676
+ * you may not use this file except in compliance with the License.
677
+ * You may obtain a copy of the License at
678
+ *
679
+ * http://www.apache.org/licenses/LICENSE-2.0
680
+ *
681
+ * Unless required by applicable law or agreed to in writing, software
682
+ * distributed under the License is distributed on an "AS IS" BASIS,
683
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
684
+ * See the License for the specific language governing permissions and
685
+ * limitations under the License.
686
+ */const mu=new Map;function Kn(e){nr(e instanceof Function,"Expected a class definition");let t=mu.get(e);return t?(nr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,mu.set(e,t),t)}/**
687
+ * @license
688
+ * Copyright 2019 Google LLC
689
+ *
690
+ * Licensed under the Apache License, Version 2.0 (the "License");
691
+ * you may not use this file except in compliance with the License.
692
+ * You may obtain a copy of the License at
693
+ *
694
+ * http://www.apache.org/licenses/LICENSE-2.0
695
+ *
696
+ * Unless required by applicable law or agreed to in writing, software
697
+ * distributed under the License is distributed on an "AS IS" BASIS,
698
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
699
+ * See the License for the specific language governing permissions and
700
+ * limitations under the License.
701
+ */class Hf{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){}}Hf.type="NONE";const gu=Hf;/**
702
+ * @license
703
+ * Copyright 2019 Google LLC
704
+ *
705
+ * Licensed under the Apache License, Version 2.0 (the "License");
706
+ * you may not use this file except in compliance with the License.
707
+ * You may obtain a copy of the License at
708
+ *
709
+ * http://www.apache.org/licenses/LICENSE-2.0
710
+ *
711
+ * Unless required by applicable law or agreed to in writing, software
712
+ * distributed under the License is distributed on an "AS IS" BASIS,
713
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
714
+ * See the License for the specific language governing permissions and
715
+ * limitations under the License.
716
+ */function Mo(e,t,n){return`firebase:${e}:${t}:${n}`}class cs{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Mo(this.userKey,s.apiKey,o),this.fullPersistenceKey=Mo("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 qo(this.auth,{idToken:t}).catch(()=>{});return n?mn._fromGetAccountInfoResponse(this.auth,n,t):null}return mn._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 cs(Kn(gu),t,r);const s=(await Promise.all(n.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let o=s[0]||Kn(gu);const i=Mo(r,t.config.apiKey,t.name);let a=null;for(const d of n)try{const u=await d._get(i);if(u){let p;if(typeof u=="string"){const w=await qo(t,{idToken:u}).catch(()=>{});if(!w)break;p=await mn._fromGetAccountInfoResponse(t,w,u)}else p=mn._fromJSON(t,u);d!==o&&(a=p),o=d;break}}catch{}const l=s.filter(d=>d._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new cs(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async d=>{if(d!==o)try{await d._remove(i)}catch{}})),new cs(o,t,r))}}/**
717
+ * @license
718
+ * Copyright 2020 Google LLC
719
+ *
720
+ * Licensed under the Apache License, Version 2.0 (the "License");
721
+ * you may not use this file except in compliance with the License.
722
+ * You may obtain a copy of the License at
723
+ *
724
+ * http://www.apache.org/licenses/LICENSE-2.0
725
+ *
726
+ * Unless required by applicable law or agreed to in writing, software
727
+ * distributed under the License is distributed on an "AS IS" BASIS,
728
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
729
+ * See the License for the specific language governing permissions and
730
+ * limitations under the License.
731
+ */function vu(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(qf(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Vf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Kf(t))return"Blackberry";if(Jf(t))return"Webos";if(Wf(t))return"Safari";if((t.includes("chrome/")||zf(t))&&!t.includes("edge/"))return"Chrome";if(Gf(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 Vf(e=tn()){return/firefox\//i.test(e)}function Wf(e=tn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function zf(e=tn()){return/crios\//i.test(e)}function qf(e=tn()){return/iemobile/i.test(e)}function Gf(e=tn()){return/android/i.test(e)}function Kf(e=tn()){return/blackberry/i.test(e)}function Jf(e=tn()){return/webos/i.test(e)}function Tl(e=tn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function vI(e=tn()){var t;return Tl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function yI(){return PT()&&document.documentMode===10}function Yf(e=tn()){return Tl(e)||Gf(e)||Jf(e)||Kf(e)||/windows phone/i.test(e)||qf(e)}/**
732
+ * @license
733
+ * Copyright 2020 Google LLC
734
+ *
735
+ * Licensed under the Apache License, Version 2.0 (the "License");
736
+ * you may not use this file except in compliance with the License.
737
+ * You may obtain a copy of the License at
738
+ *
739
+ * http://www.apache.org/licenses/LICENSE-2.0
740
+ *
741
+ * Unless required by applicable law or agreed to in writing, software
742
+ * distributed under the License is distributed on an "AS IS" BASIS,
743
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
744
+ * See the License for the specific language governing permissions and
745
+ * limitations under the License.
746
+ */function Xf(e,t=[]){let n;switch(e){case"Browser":n=vu(tn());break;case"Worker":n=`${vu(tn())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${lo}/${r}`}/**
747
+ * @license
748
+ * Copyright 2022 Google LLC
749
+ *
750
+ * Licensed under the Apache License, Version 2.0 (the "License");
751
+ * you may not use this file except in compliance with the License.
752
+ * You may obtain a copy of the License at
753
+ *
754
+ * http://www.apache.org/licenses/LICENSE-2.0
755
+ *
756
+ * Unless required by applicable law or agreed to in writing, software
757
+ * distributed under the License is distributed on an "AS IS" BASIS,
758
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
759
+ * See the License for the specific language governing permissions and
760
+ * limitations under the License.
761
+ */class wI{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})}}}/**
762
+ * @license
763
+ * Copyright 2023 Google LLC
764
+ *
765
+ * Licensed under the Apache License, Version 2.0 (the "License");
766
+ * you may not use this file except in compliance with the License.
767
+ * You may obtain a copy of the License at
768
+ *
769
+ * http://www.apache.org/licenses/LICENSE-2.0
770
+ *
771
+ * Unless required by applicable law or agreed to in writing, software
772
+ * distributed under the License is distributed on an "AS IS" BASIS,
773
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
774
+ * See the License for the specific language governing permissions and
775
+ * limitations under the License.
776
+ */async function bI(e,t={}){return ws(e,"GET","/v2/passwordPolicy",_l(e,t))}/**
777
+ * @license
778
+ * Copyright 2023 Google LLC
779
+ *
780
+ * Licensed under the Apache License, Version 2.0 (the "License");
781
+ * you may not use this file except in compliance with the License.
782
+ * You may obtain a copy of the License at
783
+ *
784
+ * http://www.apache.org/licenses/LICENSE-2.0
785
+ *
786
+ * Unless required by applicable law or agreed to in writing, software
787
+ * distributed under the License is distributed on an "AS IS" BASIS,
788
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
789
+ * See the License for the specific language governing permissions and
790
+ * limitations under the License.
791
+ */const _I=6;class kI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??_I,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))}}/**
792
+ * @license
793
+ * Copyright 2020 Google LLC
794
+ *
795
+ * Licensed under the Apache License, Version 2.0 (the "License");
796
+ * you may not use this file except in compliance with the License.
797
+ * You may obtain a copy of the License at
798
+ *
799
+ * http://www.apache.org/licenses/LICENSE-2.0
800
+ *
801
+ * Unless required by applicable law or agreed to in writing, software
802
+ * distributed under the License is distributed on an "AS IS" BASIS,
803
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
804
+ * See the License for the specific language governing permissions and
805
+ * limitations under the License.
806
+ */class TI{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 yu(this),this.idTokenSubscription=new yu(this),this.beforeStateQueue=new wI(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=Lf,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=Kn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await cs.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 qo(this,{idToken:t}),r=await mn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(Pn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return He(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 Go(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=rI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Pn(this.app))return Promise.reject(Fr(this));const n=t?ys(t):null;return n&&He(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&&He(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Pn(this.app)?Promise.reject(Fr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Pn(this.app)?Promise.reject(Fr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Kn(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 bI(this),n=new kI(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new io("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await gI(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&&Kn(t)||this._popupRedirectResolver;He(n,this,"argument-error"),this.redirectPersistenceManager=await cs.create(this,[Kn(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(He(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 He(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Xf(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(Pn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&ZS(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function pi(e){return ys(e)}class yu{constructor(t){this.auth=t,this.observer=null,this.addObserver=LT(n=>this.observer=n)}get next(){return He(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
807
+ * @license
808
+ * Copyright 2020 Google LLC
809
+ *
810
+ * Licensed under the Apache License, Version 2.0 (the "License");
811
+ * you may not use this file except in compliance with the License.
812
+ * You may obtain a copy of the License at
813
+ *
814
+ * http://www.apache.org/licenses/LICENSE-2.0
815
+ *
816
+ * Unless required by applicable law or agreed to in writing, software
817
+ * distributed under the License is distributed on an "AS IS" BASIS,
818
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
819
+ * See the License for the specific language governing permissions and
820
+ * limitations under the License.
821
+ */let Sl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function SI(e){Sl=e}function II(e){return Sl.loadJS(e)}function EI(){return Sl.gapiScript}function CI(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
822
+ * @license
823
+ * Copyright 2020 Google LLC
824
+ *
825
+ * Licensed under the Apache License, Version 2.0 (the "License");
826
+ * you may not use this file except in compliance with the License.
827
+ * You may obtain a copy of the License at
828
+ *
829
+ * http://www.apache.org/licenses/LICENSE-2.0
830
+ *
831
+ * Unless required by applicable law or agreed to in writing, software
832
+ * distributed under the License is distributed on an "AS IS" BASIS,
833
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
834
+ * See the License for the specific language governing permissions and
835
+ * limitations under the License.
836
+ */function AI(e,t){const n=xf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(ps(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function RI(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Kn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function PI(e,t,n){const r=pi(e);He(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Qf(t),{host:i,port:a}=xI(t),l=a===null?"":`:${a}`,d={url:`${o}//${i}${l}/`},u=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){He(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),He(ps(d,r.config.emulator)&&ps(u,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=u,r.settings.appVerificationDisabledForTesting=!0,gl(i)?BT(`${o}//${i}${l}`):MI()}function Qf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function xI(e){const t=Qf(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:wu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:wu(i)}}}function wu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function MI(){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())}/**
837
+ * @license
838
+ * Copyright 2020 Google LLC
839
+ *
840
+ * Licensed under the Apache License, Version 2.0 (the "License");
841
+ * you may not use this file except in compliance with the License.
842
+ * You may obtain a copy of the License at
843
+ *
844
+ * http://www.apache.org/licenses/LICENSE-2.0
845
+ *
846
+ * Unless required by applicable law or agreed to in writing, software
847
+ * distributed under the License is distributed on an "AS IS" BASIS,
848
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
849
+ * See the License for the specific language governing permissions and
850
+ * limitations under the License.
851
+ */class Zf{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Gn("not implemented")}_getIdTokenResponse(t){return Gn("not implemented")}_linkToIdToken(t,n){return Gn("not implemented")}_getReauthenticationResolver(t){return Gn("not implemented")}}/**
852
+ * @license
853
+ * Copyright 2020 Google LLC
854
+ *
855
+ * Licensed under the Apache License, Version 2.0 (the "License");
856
+ * you may not use this file except in compliance with the License.
857
+ * You may obtain a copy of the License at
858
+ *
859
+ * http://www.apache.org/licenses/LICENSE-2.0
860
+ *
861
+ * Unless required by applicable law or agreed to in writing, software
862
+ * distributed under the License is distributed on an "AS IS" BASIS,
863
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
864
+ * See the License for the specific language governing permissions and
865
+ * limitations under the License.
866
+ */async function us(e,t){return aI(e,"POST","/v1/accounts:signInWithIdp",_l(e,t))}/**
867
+ * @license
868
+ * Copyright 2020 Google LLC
869
+ *
870
+ * Licensed under the Apache License, Version 2.0 (the "License");
871
+ * you may not use this file except in compliance with the License.
872
+ * You may obtain a copy of the License at
873
+ *
874
+ * http://www.apache.org/licenses/LICENSE-2.0
875
+ *
876
+ * Unless required by applicable law or agreed to in writing, software
877
+ * distributed under the License is distributed on an "AS IS" BASIS,
878
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
879
+ * See the License for the specific language governing permissions and
880
+ * limitations under the License.
881
+ */const OI="http://localhost";class Vr extends Zf{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Vr(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):$n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new Vr(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 us(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,us(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,us(t,n)}buildRequest(){const t={requestUri:OI,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=ao(n)}return t}}/**
882
+ * @license
883
+ * Copyright 2020 Google LLC
884
+ *
885
+ * Licensed under the Apache License, Version 2.0 (the "License");
886
+ * you may not use this file except in compliance with the License.
887
+ * You may obtain a copy of the License at
888
+ *
889
+ * http://www.apache.org/licenses/LICENSE-2.0
890
+ *
891
+ * Unless required by applicable law or agreed to in writing, software
892
+ * distributed under the License is distributed on an "AS IS" BASIS,
893
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
894
+ * See the License for the specific language governing permissions and
895
+ * limitations under the License.
896
+ */class Il{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}}/**
897
+ * @license
898
+ * Copyright 2019 Google LLC
899
+ *
900
+ * Licensed under the Apache License, Version 2.0 (the "License");
901
+ * you may not use this file except in compliance with the License.
902
+ * You may obtain a copy of the License at
903
+ *
904
+ * http://www.apache.org/licenses/LICENSE-2.0
905
+ *
906
+ * Unless required by applicable law or agreed to in writing, software
907
+ * distributed under the License is distributed on an "AS IS" BASIS,
908
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
909
+ * See the License for the specific language governing permissions and
910
+ * limitations under the License.
911
+ */class uo extends Il{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
912
+ * @license
913
+ * Copyright 2020 Google LLC
914
+ *
915
+ * Licensed under the Apache License, Version 2.0 (the "License");
916
+ * you may not use this file except in compliance with the License.
917
+ * You may obtain a copy of the License at
918
+ *
919
+ * http://www.apache.org/licenses/LICENSE-2.0
920
+ *
921
+ * Unless required by applicable law or agreed to in writing, software
922
+ * distributed under the License is distributed on an "AS IS" BASIS,
923
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
924
+ * See the License for the specific language governing permissions and
925
+ * limitations under the License.
926
+ */class yr extends uo{constructor(){super("facebook.com")}static credential(t){return Vr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return yr.credential(t.oauthAccessToken)}catch{return null}}}yr.FACEBOOK_SIGN_IN_METHOD="facebook.com";yr.PROVIDER_ID="facebook.com";/**
927
+ * @license
928
+ * Copyright 2020 Google LLC
929
+ *
930
+ * Licensed under the Apache License, Version 2.0 (the "License");
931
+ * you may not use this file except in compliance with the License.
932
+ * You may obtain a copy of the License at
933
+ *
934
+ * http://www.apache.org/licenses/LICENSE-2.0
935
+ *
936
+ * Unless required by applicable law or agreed to in writing, software
937
+ * distributed under the License is distributed on an "AS IS" BASIS,
938
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
939
+ * See the License for the specific language governing permissions and
940
+ * limitations under the License.
941
+ */class wr extends uo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Vr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.GOOGLE_SIGN_IN_METHOD="google.com";wr.PROVIDER_ID="google.com";/**
942
+ * @license
943
+ * Copyright 2020 Google LLC
944
+ *
945
+ * Licensed under the Apache License, Version 2.0 (the "License");
946
+ * you may not use this file except in compliance with the License.
947
+ * You may obtain a copy of the License at
948
+ *
949
+ * http://www.apache.org/licenses/LICENSE-2.0
950
+ *
951
+ * Unless required by applicable law or agreed to in writing, software
952
+ * distributed under the License is distributed on an "AS IS" BASIS,
953
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
954
+ * See the License for the specific language governing permissions and
955
+ * limitations under the License.
956
+ */class xn extends uo{constructor(){super("github.com")}static credential(t){return Vr._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return xn.credentialFromTaggedObject(t)}static credentialFromError(t){return xn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return xn.credential(t.oauthAccessToken)}catch{return null}}}xn.GITHUB_SIGN_IN_METHOD="github.com";xn.PROVIDER_ID="github.com";/**
957
+ * @license
958
+ * Copyright 2020 Google LLC
959
+ *
960
+ * Licensed under the Apache License, Version 2.0 (the "License");
961
+ * you may not use this file except in compliance with the License.
962
+ * You may obtain a copy of the License at
963
+ *
964
+ * http://www.apache.org/licenses/LICENSE-2.0
965
+ *
966
+ * Unless required by applicable law or agreed to in writing, software
967
+ * distributed under the License is distributed on an "AS IS" BASIS,
968
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
969
+ * See the License for the specific language governing permissions and
970
+ * limitations under the License.
971
+ */class br extends uo{constructor(){super("twitter.com")}static credential(t,n){return Vr._fromParams({providerId:br.PROVIDER_ID,signInMethod:br.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret: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{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return br.credential(n,r)}catch{return null}}}br.TWITTER_SIGN_IN_METHOD="twitter.com";br.PROVIDER_ID="twitter.com";/**
972
+ * @license
973
+ * Copyright 2020 Google LLC
974
+ *
975
+ * Licensed under the Apache License, Version 2.0 (the "License");
976
+ * you may not use this file except in compliance with the License.
977
+ * You may obtain a copy of the License at
978
+ *
979
+ * http://www.apache.org/licenses/LICENSE-2.0
980
+ *
981
+ * Unless required by applicable law or agreed to in writing, software
982
+ * distributed under the License is distributed on an "AS IS" BASIS,
983
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
984
+ * See the License for the specific language governing permissions and
985
+ * limitations under the License.
986
+ */class gs{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 mn._fromIdTokenResponse(t,r,s),i=bu(r);return new gs({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=bu(r);return new gs({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function bu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
987
+ * @license
988
+ * Copyright 2020 Google LLC
989
+ *
990
+ * Licensed under the Apache License, Version 2.0 (the "License");
991
+ * you may not use this file except in compliance with the License.
992
+ * You may obtain a copy of the License at
993
+ *
994
+ * http://www.apache.org/licenses/LICENSE-2.0
995
+ *
996
+ * Unless required by applicable law or agreed to in writing, software
997
+ * distributed under the License is distributed on an "AS IS" BASIS,
998
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
999
+ * See the License for the specific language governing permissions and
1000
+ * limitations under the License.
1001
+ */class Ko extends Ir{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Ko.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 Ko(t,n,r,s)}}function eh(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Ko._fromErrorAndOperation(e,o,t,r):o})}async function NI(e,t,n=!1){const r=await no(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return gs._forOperation(e,"link",r)}/**
1002
+ * @license
1003
+ * Copyright 2019 Google LLC
1004
+ *
1005
+ * Licensed under the Apache License, Version 2.0 (the "License");
1006
+ * you may not use this file except in compliance with the License.
1007
+ * You may obtain a copy of the License at
1008
+ *
1009
+ * http://www.apache.org/licenses/LICENSE-2.0
1010
+ *
1011
+ * Unless required by applicable law or agreed to in writing, software
1012
+ * distributed under the License is distributed on an "AS IS" BASIS,
1013
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1014
+ * See the License for the specific language governing permissions and
1015
+ * limitations under the License.
1016
+ */async function $I(e,t,n=!1){const{auth:r}=e;if(Pn(r.app))return Promise.reject(Fr(r));const s="reauthenticate";try{const o=await no(e,eh(r,s,t,e),n);He(o.idToken,r,"internal-error");const i=kl(o.idToken);He(i,r,"internal-error");const{sub:a}=i;return He(e.uid===a,r,"user-mismatch"),gs._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
1017
+ * @license
1018
+ * Copyright 2020 Google LLC
1019
+ *
1020
+ * Licensed under the Apache License, Version 2.0 (the "License");
1021
+ * you may not use this file except in compliance with the License.
1022
+ * You may obtain a copy of the License at
1023
+ *
1024
+ * http://www.apache.org/licenses/LICENSE-2.0
1025
+ *
1026
+ * Unless required by applicable law or agreed to in writing, software
1027
+ * distributed under the License is distributed on an "AS IS" BASIS,
1028
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1029
+ * See the License for the specific language governing permissions and
1030
+ * limitations under the License.
1031
+ */async function DI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Fr(e));const r="signIn",s=await eh(e,r,t),o=await gs._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function LI(e,t,n,r){return ys(e).onIdTokenChanged(t,n,r)}function jI(e,t,n){return ys(e).beforeAuthStateChanged(t,n)}const Jo="__sak";/**
1032
+ * @license
1033
+ * Copyright 2019 Google LLC
1034
+ *
1035
+ * Licensed under the Apache License, Version 2.0 (the "License");
1036
+ * you may not use this file except in compliance with the License.
1037
+ * You may obtain a copy of the License at
1038
+ *
1039
+ * http://www.apache.org/licenses/LICENSE-2.0
1040
+ *
1041
+ * Unless required by applicable law or agreed to in writing, software
1042
+ * distributed under the License is distributed on an "AS IS" BASIS,
1043
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1044
+ * See the License for the specific language governing permissions and
1045
+ * limitations under the License.
1046
+ */class th{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Jo,"1"),this.storage.removeItem(Jo),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()}}/**
1047
+ * @license
1048
+ * Copyright 2020 Google LLC
1049
+ *
1050
+ * Licensed under the Apache License, Version 2.0 (the "License");
1051
+ * you may not use this file except in compliance with the License.
1052
+ * You may obtain a copy of the License at
1053
+ *
1054
+ * http://www.apache.org/licenses/LICENSE-2.0
1055
+ *
1056
+ * Unless required by applicable law or agreed to in writing, software
1057
+ * distributed under the License is distributed on an "AS IS" BASIS,
1058
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1059
+ * See the License for the specific language governing permissions and
1060
+ * limitations under the License.
1061
+ */const UI=1e3,BI=10;class nh extends th{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Yf(),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);yI()&&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)})},UI)}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]}}nh.type="LOCAL";const FI=nh;/**
1062
+ * @license
1063
+ * Copyright 2020 Google LLC
1064
+ *
1065
+ * Licensed under the Apache License, Version 2.0 (the "License");
1066
+ * you may not use this file except in compliance with the License.
1067
+ * You may obtain a copy of the License at
1068
+ *
1069
+ * http://www.apache.org/licenses/LICENSE-2.0
1070
+ *
1071
+ * Unless required by applicable law or agreed to in writing, software
1072
+ * distributed under the License is distributed on an "AS IS" BASIS,
1073
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1074
+ * See the License for the specific language governing permissions and
1075
+ * limitations under the License.
1076
+ */class rh extends th{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}rh.type="SESSION";const sh=rh;/**
1077
+ * @license
1078
+ * Copyright 2019 Google LLC
1079
+ *
1080
+ * Licensed under the Apache License, Version 2.0 (the "License");
1081
+ * you may not use this file except in compliance with the License.
1082
+ * You may obtain a copy of the License at
1083
+ *
1084
+ * http://www.apache.org/licenses/LICENSE-2.0
1085
+ *
1086
+ * Unless required by applicable law or agreed to in writing, software
1087
+ * distributed under the License is distributed on an "AS IS" BASIS,
1088
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1089
+ * See the License for the specific language governing permissions and
1090
+ * limitations under the License.
1091
+ */function HI(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1092
+ * @license
1093
+ * Copyright 2019 Google LLC
1094
+ *
1095
+ * Licensed under the Apache License, Version 2.0 (the "License");
1096
+ * you may not use this file except in compliance with the License.
1097
+ * You may obtain a copy of the License at
1098
+ *
1099
+ * http://www.apache.org/licenses/LICENSE-2.0
1100
+ *
1101
+ * Unless required by applicable law or agreed to in writing, software
1102
+ * distributed under the License is distributed on an "AS IS" BASIS,
1103
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1104
+ * See the License for the specific language governing permissions and
1105
+ * limitations under the License.
1106
+ */class mi{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 mi(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 d=>d(n.origin,o)),l=await HI(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)}}mi.receivers=[];/**
1107
+ * @license
1108
+ * Copyright 2020 Google LLC
1109
+ *
1110
+ * Licensed under the Apache License, Version 2.0 (the "License");
1111
+ * you may not use this file except in compliance with the License.
1112
+ * You may obtain a copy of the License at
1113
+ *
1114
+ * http://www.apache.org/licenses/LICENSE-2.0
1115
+ *
1116
+ * Unless required by applicable law or agreed to in writing, software
1117
+ * distributed under the License is distributed on an "AS IS" BASIS,
1118
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1119
+ * See the License for the specific language governing permissions and
1120
+ * limitations under the License.
1121
+ */function El(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1122
+ * @license
1123
+ * Copyright 2019 Google LLC
1124
+ *
1125
+ * Licensed under the Apache License, Version 2.0 (the "License");
1126
+ * you may not use this file except in compliance with the License.
1127
+ * You may obtain a copy of the License at
1128
+ *
1129
+ * http://www.apache.org/licenses/LICENSE-2.0
1130
+ *
1131
+ * Unless required by applicable law or agreed to in writing, software
1132
+ * distributed under the License is distributed on an "AS IS" BASIS,
1133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1134
+ * See the License for the specific language governing permissions and
1135
+ * limitations under the License.
1136
+ */class VI{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 d=El("",20);s.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(p){const w=p;if(w.data.eventId===d)switch(w.data.status){case"ack":clearTimeout(u),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(w.data.response);break;default:clearTimeout(u),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:d,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1137
+ * @license
1138
+ * Copyright 2020 Google LLC
1139
+ *
1140
+ * Licensed under the Apache License, Version 2.0 (the "License");
1141
+ * you may not use this file except in compliance with the License.
1142
+ * You may obtain a copy of the License at
1143
+ *
1144
+ * http://www.apache.org/licenses/LICENSE-2.0
1145
+ *
1146
+ * Unless required by applicable law or agreed to in writing, software
1147
+ * distributed under the License is distributed on an "AS IS" BASIS,
1148
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1149
+ * See the License for the specific language governing permissions and
1150
+ * limitations under the License.
1151
+ */function Nn(){return window}function WI(e){Nn().location.href=e}/**
1152
+ * @license
1153
+ * Copyright 2020 Google LLC.
1154
+ *
1155
+ * Licensed under the Apache License, Version 2.0 (the "License");
1156
+ * you may not use this file except in compliance with the License.
1157
+ * You may obtain a copy of the License at
1158
+ *
1159
+ * http://www.apache.org/licenses/LICENSE-2.0
1160
+ *
1161
+ * Unless required by applicable law or agreed to in writing, software
1162
+ * distributed under the License is distributed on an "AS IS" BASIS,
1163
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1164
+ * See the License for the specific language governing permissions and
1165
+ * limitations under the License.
1166
+ */function oh(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function zI(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function qI(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function GI(){return oh()?self:null}/**
1167
+ * @license
1168
+ * Copyright 2019 Google LLC
1169
+ *
1170
+ * Licensed under the Apache License, Version 2.0 (the "License");
1171
+ * you may not use this file except in compliance with the License.
1172
+ * You may obtain a copy of the License at
1173
+ *
1174
+ * http://www.apache.org/licenses/LICENSE-2.0
1175
+ *
1176
+ * Unless required by applicable law or agreed to in writing, software
1177
+ * distributed under the License is distributed on an "AS IS" BASIS,
1178
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1179
+ * See the License for the specific language governing permissions and
1180
+ * limitations under the License.
1181
+ */const ih="firebaseLocalStorageDb",KI=1,Yo="firebaseLocalStorage",ah="fbase_key";class fo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function gi(e,t){return e.transaction([Yo],t?"readwrite":"readonly").objectStore(Yo)}function JI(){const e=indexedDB.deleteDatabase(ih);return new fo(e).toPromise()}function La(){const e=indexedDB.open(ih,KI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Yo,{keyPath:ah})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Yo)?t(r):(r.close(),await JI(),t(await La()))})})}async function _u(e,t,n){const r=gi(e,!0).put({[ah]:t,value:n});return new fo(r).toPromise()}async function YI(e,t){const n=gi(e,!1).get(t),r=await new fo(n).toPromise();return r===void 0?null:r.value}function ku(e,t){const n=gi(e,!0).delete(t);return new fo(n).toPromise()}const XI=800,QI=3;class lh{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 La(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>QI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return oh()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=mi._getInstance(GI()),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 zI(),!this.activeServiceWorker)return;this.sender=new VI(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||qI()!==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 La();return await _u(t,Jo,"1"),await ku(t,Jo),!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=>_u(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>YI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>ku(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=gi(s,!1).getAll();return new fo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),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()}}lh.type="LOCAL";const ZI=lh;new co(3e4,6e4);/**
1182
+ * @license
1183
+ * Copyright 2021 Google LLC
1184
+ *
1185
+ * Licensed under the Apache License, Version 2.0 (the "License");
1186
+ * you may not use this file except in compliance with the License.
1187
+ * You may obtain a copy of the License at
1188
+ *
1189
+ * http://www.apache.org/licenses/LICENSE-2.0
1190
+ *
1191
+ * Unless required by applicable law or agreed to in writing, software
1192
+ * distributed under the License is distributed on an "AS IS" BASIS,
1193
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1194
+ * See the License for the specific language governing permissions and
1195
+ * limitations under the License.
1196
+ */function ch(e,t){return t?Kn(t):(He(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1197
+ * @license
1198
+ * Copyright 2019 Google LLC
1199
+ *
1200
+ * Licensed under the Apache License, Version 2.0 (the "License");
1201
+ * you may not use this file except in compliance with the License.
1202
+ * You may obtain a copy of the License at
1203
+ *
1204
+ * http://www.apache.org/licenses/LICENSE-2.0
1205
+ *
1206
+ * Unless required by applicable law or agreed to in writing, software
1207
+ * distributed under the License is distributed on an "AS IS" BASIS,
1208
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1209
+ * See the License for the specific language governing permissions and
1210
+ * limitations under the License.
1211
+ */class Cl extends Zf{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return us(t,this._buildIdpRequest())}_linkToIdToken(t,n){return us(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return us(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 eE(e){return DI(e.auth,new Cl(e),e.bypassAuthState)}function tE(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),$I(n,new Cl(e),e.bypassAuthState)}async function nE(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),NI(n,new Cl(e),e.bypassAuthState)}/**
1212
+ * @license
1213
+ * Copyright 2020 Google LLC
1214
+ *
1215
+ * Licensed under the Apache License, Version 2.0 (the "License");
1216
+ * you may not use this file except in compliance with the License.
1217
+ * You may obtain a copy of the License at
1218
+ *
1219
+ * http://www.apache.org/licenses/LICENSE-2.0
1220
+ *
1221
+ * Unless required by applicable law or agreed to in writing, software
1222
+ * distributed under the License is distributed on an "AS IS" BASIS,
1223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1224
+ * See the License for the specific language governing permissions and
1225
+ * limitations under the License.
1226
+ */class uh{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(d){this.reject(d)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return eE;case"linkViaPopup":case"linkViaRedirect":return nE;case"reauthViaPopup":case"reauthViaRedirect":return tE;default:$n(this.auth,"internal-error")}}resolve(t){nr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){nr(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()}}/**
1227
+ * @license
1228
+ * Copyright 2020 Google LLC
1229
+ *
1230
+ * Licensed under the Apache License, Version 2.0 (the "License");
1231
+ * you may not use this file except in compliance with the License.
1232
+ * You may obtain a copy of the License at
1233
+ *
1234
+ * http://www.apache.org/licenses/LICENSE-2.0
1235
+ *
1236
+ * Unless required by applicable law or agreed to in writing, software
1237
+ * distributed under the License is distributed on an "AS IS" BASIS,
1238
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1239
+ * See the License for the specific language governing permissions and
1240
+ * limitations under the License.
1241
+ */const rE=new co(2e3,1e4);async function sE(e,t,n){if(Pn(e.app))return Promise.reject(yn(e,"operation-not-supported-in-this-environment"));const r=pi(e);eI(e,t,Il);const s=ch(r,n);return new jr(r,"signInViaPopup",t,s).executeNotNull()}class jr extends uh{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,jr.currentPopupAction&&jr.currentPopupAction.cancel(),jr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return He(t,this.auth,"internal-error"),t}async onExecution(){nr(this.filter.length===1,"Popup operations only handle one event");const t=El();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(yn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(yn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,jr.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(yn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,rE.get())};t()}}jr.currentPopupAction=null;/**
1242
+ * @license
1243
+ * Copyright 2020 Google LLC
1244
+ *
1245
+ * Licensed under the Apache License, Version 2.0 (the "License");
1246
+ * you may not use this file except in compliance with the License.
1247
+ * You may obtain a copy of the License at
1248
+ *
1249
+ * http://www.apache.org/licenses/LICENSE-2.0
1250
+ *
1251
+ * Unless required by applicable law or agreed to in writing, software
1252
+ * distributed under the License is distributed on an "AS IS" BASIS,
1253
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1254
+ * See the License for the specific language governing permissions and
1255
+ * limitations under the License.
1256
+ */const oE="pendingRedirect",Oo=new Map;class iE extends uh{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Oo.get(this.auth._key());if(!t){try{const r=await aE(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Oo.set(this.auth._key(),t)}return this.bypassAuthState||Oo.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 aE(e,t){const n=uE(t),r=cE(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function lE(e,t){Oo.set(e._key(),t)}function cE(e){return Kn(e._redirectPersistence)}function uE(e){return Mo(oE,e.config.apiKey,e.name)}async function dE(e,t,n=!1){if(Pn(e.app))return Promise.reject(Fr(e));const r=pi(e),s=ch(r,t),i=await new iE(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1257
+ * @license
1258
+ * Copyright 2020 Google LLC
1259
+ *
1260
+ * Licensed under the Apache License, Version 2.0 (the "License");
1261
+ * you may not use this file except in compliance with the License.
1262
+ * You may obtain a copy of the License at
1263
+ *
1264
+ * http://www.apache.org/licenses/LICENSE-2.0
1265
+ *
1266
+ * Unless required by applicable law or agreed to in writing, software
1267
+ * distributed under the License is distributed on an "AS IS" BASIS,
1268
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1269
+ * See the License for the specific language governing permissions and
1270
+ * limitations under the License.
1271
+ */const fE=600*1e3;class hE{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||!pE(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!dh(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(yn(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>=fE&&this.cachedEventUids.clear(),this.cachedEventUids.has(Tu(t))}saveEventToCache(t){this.cachedEventUids.add(Tu(t)),this.lastProcessedEventTime=Date.now()}}function Tu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function dh({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function pE(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return dh(e);default:return!1}}/**
1272
+ * @license
1273
+ * Copyright 2020 Google LLC
1274
+ *
1275
+ * Licensed under the Apache License, Version 2.0 (the "License");
1276
+ * you may not use this file except in compliance with the License.
1277
+ * You may obtain a copy of the License at
1278
+ *
1279
+ * http://www.apache.org/licenses/LICENSE-2.0
1280
+ *
1281
+ * Unless required by applicable law or agreed to in writing, software
1282
+ * distributed under the License is distributed on an "AS IS" BASIS,
1283
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1284
+ * See the License for the specific language governing permissions and
1285
+ * limitations under the License.
1286
+ */async function mE(e,t={}){return ws(e,"GET","/v1/projects",t)}/**
1287
+ * @license
1288
+ * Copyright 2020 Google LLC
1289
+ *
1290
+ * Licensed under the Apache License, Version 2.0 (the "License");
1291
+ * you may not use this file except in compliance with the License.
1292
+ * You may obtain a copy of the License at
1293
+ *
1294
+ * http://www.apache.org/licenses/LICENSE-2.0
1295
+ *
1296
+ * Unless required by applicable law or agreed to in writing, software
1297
+ * distributed under the License is distributed on an "AS IS" BASIS,
1298
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1299
+ * See the License for the specific language governing permissions and
1300
+ * limitations under the License.
1301
+ */const gE=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,vE=/^https?/;async function yE(e){if(e.config.emulator)return;const{authorizedDomains:t}=await mE(e);for(const n of t)try{if(wE(n))return}catch{}$n(e,"unauthorized-domain")}function wE(e){const t=$a(),{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(!vE.test(n))return!1;if(gE.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1302
+ * @license
1303
+ * Copyright 2020 Google LLC.
1304
+ *
1305
+ * Licensed under the Apache License, Version 2.0 (the "License");
1306
+ * you may not use this file except in compliance with the License.
1307
+ * You may obtain a copy of the License at
1308
+ *
1309
+ * http://www.apache.org/licenses/LICENSE-2.0
1310
+ *
1311
+ * Unless required by applicable law or agreed to in writing, software
1312
+ * distributed under the License is distributed on an "AS IS" BASIS,
1313
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314
+ * See the License for the specific language governing permissions and
1315
+ * limitations under the License.
1316
+ */const bE=new co(3e4,6e4);function Su(){const e=Nn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function _E(e){return new Promise((t,n)=>{var s,o,i;function r(){Su(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Su(),n(yn(e,"network-request-failed"))},timeout:bE.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=CI("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(yn(e,"network-request-failed"))},II(`${EI()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw No=null,t})}let No=null;function kE(e){return No=No||_E(e),No}/**
1317
+ * @license
1318
+ * Copyright 2020 Google LLC.
1319
+ *
1320
+ * Licensed under the Apache License, Version 2.0 (the "License");
1321
+ * you may not use this file except in compliance with the License.
1322
+ * You may obtain a copy of the License at
1323
+ *
1324
+ * http://www.apache.org/licenses/LICENSE-2.0
1325
+ *
1326
+ * Unless required by applicable law or agreed to in writing, software
1327
+ * distributed under the License is distributed on an "AS IS" BASIS,
1328
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1329
+ * See the License for the specific language governing permissions and
1330
+ * limitations under the License.
1331
+ */const TE=new co(5e3,15e3),SE="__/auth/iframe",IE="emulator/auth/iframe",EE={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},CE=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function AE(e){const t=e.config;He(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?bl(t,IE):`https://${e.config.authDomain}/${SE}`,r={apiKey:t.apiKey,appName:e.name,v:lo},s=CE.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ao(r).slice(1)}`}async function RE(e){const t=await kE(e),n=Nn().gapi;return He(n,e,"internal-error"),t.open({where:document.body,url:AE(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:EE,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=yn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},TE.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1332
+ * @license
1333
+ * Copyright 2020 Google LLC.
1334
+ *
1335
+ * Licensed under the Apache License, Version 2.0 (the "License");
1336
+ * you may not use this file except in compliance with the License.
1337
+ * You may obtain a copy of the License at
1338
+ *
1339
+ * http://www.apache.org/licenses/LICENSE-2.0
1340
+ *
1341
+ * Unless required by applicable law or agreed to in writing, software
1342
+ * distributed under the License is distributed on an "AS IS" BASIS,
1343
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1344
+ * See the License for the specific language governing permissions and
1345
+ * limitations under the License.
1346
+ */const PE={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},xE=500,ME=600,OE="_blank",NE="http://localhost";class Iu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function $E(e,t,n,r=xE,s=ME){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={...PE,width:r.toString(),height:s.toString(),top:o,left:i},d=tn().toLowerCase();n&&(a=zf(d)?OE:n),Vf(d)&&(t=t||NE,l.scrollbars="yes");const u=Object.entries(l).reduce((w,[I,F])=>`${w}${I}=${F},`,"");if(vI(d)&&a!=="_self")return DE(t||"",a),new Iu(null);const p=window.open(t||"",a,u);He(p,e,"popup-blocked");try{p.focus()}catch{}return new Iu(p)}function DE(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)}/**
1347
+ * @license
1348
+ * Copyright 2021 Google LLC
1349
+ *
1350
+ * Licensed under the Apache License, Version 2.0 (the "License");
1351
+ * you may not use this file except in compliance with the License.
1352
+ * You may obtain a copy of the License at
1353
+ *
1354
+ * http://www.apache.org/licenses/LICENSE-2.0
1355
+ *
1356
+ * Unless required by applicable law or agreed to in writing, software
1357
+ * distributed under the License is distributed on an "AS IS" BASIS,
1358
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1359
+ * See the License for the specific language governing permissions and
1360
+ * limitations under the License.
1361
+ */const LE="__/auth/handler",jE="emulator/auth/handler",UE=encodeURIComponent("fac");async function Eu(e,t,n,r,s,o){He(e.config.authDomain,e,"auth-domain-config-required"),He(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:lo,eventId:s};if(t instanceof Il){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",DT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[u,p]of Object.entries({}))i[u]=p}if(t instanceof uo){const u=t.getScopes().filter(p=>p!=="");u.length>0&&(i.scopes=u.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await e._getAppCheckToken(),d=l?`#${UE}=${encodeURIComponent(l)}`:"";return`${BE(e)}?${ao(a).slice(1)}${d}`}function BE({config:e}){return e.emulator?bl(e,jE):`https://${e.authDomain}/${LE}`}/**
1362
+ * @license
1363
+ * Copyright 2020 Google LLC
1364
+ *
1365
+ * Licensed under the Apache License, Version 2.0 (the "License");
1366
+ * you may not use this file except in compliance with the License.
1367
+ * You may obtain a copy of the License at
1368
+ *
1369
+ * http://www.apache.org/licenses/LICENSE-2.0
1370
+ *
1371
+ * Unless required by applicable law or agreed to in writing, software
1372
+ * distributed under the License is distributed on an "AS IS" BASIS,
1373
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1374
+ * See the License for the specific language governing permissions and
1375
+ * limitations under the License.
1376
+ */const na="webStorageSupport";class FE{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=sh,this._completeRedirectFn=dE,this._overrideRedirectResult=lE}async _openPopup(t,n,r,s){var i;nr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await Eu(t,n,r,$a(),s);return $E(t,o,El())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await Eu(t,n,r,$a(),s);return WI(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):(nr(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 RE(t),r=new hE(t);return n.register("authEvent",s=>(He(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(na,{type:na},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[na];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=yE(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Yf()||Wf()||Tl()}}const HE=FE;var Cu="@firebase/auth",Au="1.12.2";/**
1377
+ * @license
1378
+ * Copyright 2020 Google LLC
1379
+ *
1380
+ * Licensed under the Apache License, Version 2.0 (the "License");
1381
+ * you may not use this file except in compliance with the License.
1382
+ * You may obtain a copy of the License at
1383
+ *
1384
+ * http://www.apache.org/licenses/LICENSE-2.0
1385
+ *
1386
+ * Unless required by applicable law or agreed to in writing, software
1387
+ * distributed under the License is distributed on an "AS IS" BASIS,
1388
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1389
+ * See the License for the specific language governing permissions and
1390
+ * limitations under the License.
1391
+ */class VE{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(){He(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1392
+ * @license
1393
+ * Copyright 2020 Google LLC
1394
+ *
1395
+ * Licensed under the Apache License, Version 2.0 (the "License");
1396
+ * you may not use this file except in compliance with the License.
1397
+ * You may obtain a copy of the License at
1398
+ *
1399
+ * http://www.apache.org/licenses/LICENSE-2.0
1400
+ *
1401
+ * Unless required by applicable law or agreed to in writing, software
1402
+ * distributed under the License is distributed on an "AS IS" BASIS,
1403
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1404
+ * See the License for the specific language governing permissions and
1405
+ * limitations under the License.
1406
+ */function WE(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 zE(e){eo(new ms("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;He(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:Xf(e)},d=new TI(r,s,o,l);return RI(d,n),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),eo(new ms("auth-internal",t=>{const n=pi(t.getProvider("auth").getImmediate());return(r=>new VE(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),as(Cu,Au,WE(e)),as(Cu,Au,"esm2020")}/**
1407
+ * @license
1408
+ * Copyright 2021 Google LLC
1409
+ *
1410
+ * Licensed under the Apache License, Version 2.0 (the "License");
1411
+ * you may not use this file except in compliance with the License.
1412
+ * You may obtain a copy of the License at
1413
+ *
1414
+ * http://www.apache.org/licenses/LICENSE-2.0
1415
+ *
1416
+ * Unless required by applicable law or agreed to in writing, software
1417
+ * distributed under the License is distributed on an "AS IS" BASIS,
1418
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1419
+ * See the License for the specific language governing permissions and
1420
+ * limitations under the License.
1421
+ */const qE=300,GE=Cf("authIdTokenMaxAge")||qE;let Ru=null;const KE=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>GE)return;const s=n==null?void 0:n.token;Ru!==s&&(Ru=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function JE(e=Of()){const t=xf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=AI(e,{popupRedirectResolver:HE,persistence:[ZI,FI,sh]}),r=Cf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=KE(o.toString());jI(n,i,()=>i(n.currentUser)),LI(n,a=>i(a))}}const s=ST("auth");return s&&PI(n,`http://${s}`),n}function YE(){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=yn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",YE().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="});zE("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 QE(e){const t=L(null),n=L(""),r=L(""),s=L(""),o=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=ue(()=>s.value==="pull"),a=ue(()=>s.value==="push"),l=ue(()=>s.value!=="");async function d(){try{const R=await fetch("/codex-api/skills-sync/status");if(!R.ok)return;const B=await R.json();B.data&&(o.value=B.data)}catch{}}async function u(){try{const R=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),B=await R.json();if(!R.ok||!B.data)throw new Error("Failed to start GitHub login");t.value=B.data;const N=30,P=Math.max((B.data.interval??5)*1e3,3e3);let D=!1;for(let H=0;H<N;H++){await new Promise(pe=>setTimeout(pe,P));const se=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:B.data.device_code})}),ae=await se.json();if(!se.ok)throw new Error(ae.error||"Failed to complete GitHub login");if(ae.ok){D=!0;break}if(!ae.pending)throw new Error(ae.error||"Failed to complete GitHub login")}if(!D)throw new Error("GitHub login timed out. Please retry.");t.value=null,await d(),e.showToast("GitHub login successful")}catch(R){e.showToast(R instanceof Error?R.message:"Failed GitHub login","error")}}async function p(){try{const R=US().length>0?Of():Mf(XE),B=JE(R),N=new xn;N.addScope("repo");const P=await sE(B,N),D=xn.credentialFromResult(P),H=(D==null?void 0:D.accessToken)??"";if(!H)throw new Error("GitHub access token missing from Firebase login");const se=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:H})}),ae=await se.json();if(!se.ok||!ae.ok)throw new Error(ae.error||"Failed to login with GitHub token");await d(),e.showToast("GitHub login successful")}catch(R){const B=R instanceof Error?R.message:"Failed Firebase GitHub login";e.showToast(B,"error")}}async function w(){r.value="",n.value="pull-started",s.value="pull";try{const R=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.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 B=R instanceof Error?R.message:"Failed to pull sync";r.value=B,n.value="pull-failed",e.showToast(B,"error")}finally{s.value=""}}async function I(){r.value="",n.value="push-started",s.value="push";try{const R=await fetch("/codex-api/skills-sync/push",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(R){const B=R instanceof Error?R.message:"Failed to push sync";r.value=B,n.value="push-failed",e.showToast(B,"error")}finally{s.value=""}}async function F(){try{const R=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),B=await R.json();if(!R.ok||!B.ok)throw new Error(B.error||"Failed to logout GitHub");await d(),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:d,logoutGithub:F,pullSkillsSync:w,pushSkillsSync:I,startGithubFirebaseLogin:p,startGithubLogin:u,syncActionError:r,syncActionStatus:n,syncStatus:o}}const ZE={class:"skills-hub"},eC={class:"skills-sync-panel"},tC={class:"skills-sync-header"},nC={key:0,class:"skills-sync-badge"},rC={key:1,class:"skills-sync-badge"},sC={key:2,class:"skills-sync-badge"},oC={class:"skills-sync-meta"},iC={key:0,class:"skills-sync-error"},aC={key:1,class:"skills-sync-meta"},lC={key:2,class:"skills-sync-error"},cC={key:3,class:"skills-sync-device"},uC=["href"],dC={class:"skills-sync-actions"},fC=["disabled"],hC=["disabled"],pC=["disabled"],mC={key:1,class:"skills-hub-section"},gC={class:"skills-hub-section-title"},vC={key:0,class:"skills-hub-grid"},yC={class:"skills-hub-toolbar"},wC={class:"skills-hub-search-wrap"},bC={key:0,class:"skills-hub-count"},_C={class:"skills-hub-section"},kC={key:0,class:"skills-hub-loading"},TC={key:1,class:"skills-hub-error"},SC={key:0,class:"skills-hub-grid"},IC={key:1,class:"skills-hub-empty"},_o="codex-web-local.skills-hub.cache.v1",EC=$t({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),d=L(!1),u=L(""),p=L(!0),w=L(!1),I=L(n),F=L(null),R=L(""),B=L(!1),N=L(!1);let P=null,D=null;const H=t,se=ue(()=>o.value==="date"?"Newest":"A-Z"),ae=ue(()=>{var x;return((x=F.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),pe=ue(()=>`${I.value.owner}/${I.value.name}`),Te=ue(()=>B.value&&R.value===pe.value),ce=ue(()=>N.value&&R.value===pe.value),te=ue(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter(j=>j.name.toLowerCase().includes(x)||j.owner.toLowerCase().includes(x)||(j.displayName??"").toLowerCase().includes(x)):a.value});function ie(x,j="success"){F.value={text:x,type:j},D&&clearTimeout(D),D=setTimeout(()=>{F.value=null},3e3)}function Y(){o.value=o.value==="date"?"name":"date",me(s.value)}function Ae(x){return`${o.value}::${x.trim().toLowerCase()}`}function Se(x){var j;if(typeof window>"u")return null;try{const q=window.localStorage.getItem(_o);return q?((j=JSON.parse(q).byKey)==null?void 0:j[x])??null:null}catch{return null}}function Me(x,j){if(!(typeof window>"u"))try{const q=window.localStorage.getItem(_o),G=(q?JSON.parse(q):{}).byKey??{};G[x]=j,window.localStorage.setItem(_o,JSON.stringify({byKey:G}))}catch{}}function Re(){if(!(typeof window>"u"))try{window.localStorage.removeItem(_o)}catch{}}function Oe(x){const j=x.installed??[];a.value=j;const q=new Set(j.map(K=>K.name));i.value=x.data.map(K=>{if(K.installed||q.has(K.name)){const G=j.find(ge=>ge.name===K.name);return{...K,installed:!0,path:(G==null?void 0:G.path)??K.path,enabled:(G==null?void 0:G.enabled)??K.enabled}}return K}).filter(K=>!K.installed),l.value=x.total}async function me(x){const j=Ae(x),q=Se(j);q&&Oe(q),d.value=!q,u.value="";try{const K=new URLSearchParams;x.trim()&&K.set("q",x.trim()),K.set("limit","100"),K.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${K}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const ge=await G.json();Oe(ge),Me(j,ge)}catch(K){u.value=K instanceof Error?K.message:"Failed to load skills"}finally{d.value=!1}}function at(){P&&clearTimeout(P),P=setTimeout(()=>me(s.value),300)}function Ye(x){I.value=x,w.value=!0}async function Xe(x){R.value=`${x.owner}/${x.name}`,B.value=!0;try{const q=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(!q.ok)throw new Error(q.error||"Install failed");const K={...x,installed:!0,path:q.path,enabled:!0};a.value=[...a.value,K],i.value=i.value.filter(G=>G.name!==x.name),I.value=K,ie(`${x.displayName||x.name} skill installed`),w.value=!1,Re(),H("skills-changed")}catch(j){ie(j instanceof Error?j.message:"Failed to install skill","error")}finally{B.value=!1}}async function We(x){R.value=`${x.owner}/${x.name}`,N.value=!0;try{const q=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(!q.ok)throw new Error(q.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}]),ie(`${x.displayName||x.name} skill uninstalled`),w.value=!1,Re(),H("skills-changed")}catch(j){ie(j instanceof Error?j.message:"Failed to uninstall skill","error")}finally{N.value=!1}}async function Qe(x,j){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:j}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ie(`${x.displayName||x.name} skill ${j?"enabled":"disabled"}`),await me(s.value)}catch(q){ie(q instanceof Error?q.message:"Failed to update skill","error")}}const{deviceLogin:tt,isPullInFlight:je,isPushInFlight:ze,isSyncActionInFlight:V,loadSyncStatus:ne,logoutGithub:le,pullSkillsSync:we,pushSkillsSync:$e,startGithubFirebaseLogin:y,startGithubLogin:k,syncActionError:M,syncActionStatus:W,syncStatus:U}=QE({showToast:ie,onPulled:async()=>{await me(s.value),H("skills-changed")}});return sr(()=>{me(""),ne()}),(x,j)=>(b(),S("div",ZE,[j[11]||(j[11]=v("div",{class:"skills-hub-header"},[v("h2",{class:"skills-hub-title"},"Skills Hub"),v("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),v("div",eC,[v("div",tC,[j[8]||(j[8]=v("strong",null,"Skills Sync (GitHub)",-1)),ve(U).configured?(b(),S("span",nC,"Connected: "+oe(ve(U).repoOwner)+"/"+oe(ve(U).repoName),1)):ve(U).loggedIn?(b(),S("span",rC,"Logged in as "+oe(ve(U).githubUsername),1)):(b(),S("span",sC,"Not connected"))]),v("div",oC,[v("span",null,"Startup: "+oe(ve(U).startup.mode),1),v("span",null,"Branch: "+oe(ve(U).startup.branch),1),v("span",null,"Action: "+oe(ve(U).startup.lastAction),1)]),ve(U).startup.lastError?(b(),S("div",iC,oe(ve(U).startup.lastError),1)):re("",!0),ve(W)?(b(),S("div",aC,[v("span",null,"Manual sync: "+oe(ve(W)),1)])):re("",!0),ve(M)?(b(),S("div",lC,oe(ve(M)),1)):re("",!0),ve(tt)?(b(),S("div",cC,[v("span",null,[j[9]||(j[9]=Js("Open ",-1)),v("a",{href:ve(tt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,uC),j[10]||(j[10]=Js(" and enter code:",-1))]),v("code",null,oe(ve(tt).user_code),1)])):re("",!0),v("div",dC,[ve(U).loggedIn?re("",!0):(b(),S("button",{key:0,class:"skills-hub-sort",type:"button",onClick:j[0]||(j[0]=(...q)=>ve(y)&&ve(y)(...q))},"Login with GitHub")),ve(U).loggedIn?re("",!0):(b(),S("button",{key:1,class:"skills-hub-sort",type:"button",onClick:j[1]||(j[1]=(...q)=>ve(k)&&ve(k)(...q))},"Device Login")),ve(U).loggedIn?(b(),S("button",{key:2,class:"skills-hub-sort",type:"button",onClick:j[2]||(j[2]=(...q)=>ve(le)&&ve(le)(...q)),disabled:ve(V)},"Logout GitHub",8,fC)):re("",!0),v("button",{class:"skills-hub-sort",type:"button",onClick:j[3]||(j[3]=(...q)=>ve(we)&&ve(we)(...q)),disabled:ve(V)},oe(ve(je)?"Pulling...":"Pull"),9,hC),ve(U).loggedIn?(b(),S("button",{key:3,class:"skills-hub-sort",type:"button",onClick:j[4]||(j[4]=(...q)=>ve($e)&&ve($e)(...q)),disabled:!ve(U).configured||ve(V)},oe(ve(ze)?"Pushing...":"Push"),9,pC)):re("",!0)])]),F.value?(b(),S("div",{key:0,class:ot(["skills-hub-toast",ae.value])},oe(F.value.text),3)):re("",!0),te.value.length>0?(b(),S("div",mC,[v("button",{class:"skills-hub-section-toggle",type:"button",onClick:j[5]||(j[5]=q=>p.value=!p.value)},[v("span",gC,"Installed ("+oe(te.value.length)+")",1),Ie(yf,{class:ot(["skills-hub-section-chevron",{"is-open":p.value}])},null,8,["class"])]),p.value?(b(),S("div",vC,[(b(!0),S(Le,null,bt(te.value,q=>(b(),ft(nu,{key:q.name,skill:q,onSelect:K=>Ye(K)},null,8,["skill","onSelect"]))),128))])):re("",!0)])):re("",!0),v("div",yC,[v("div",wC,[Ie(Ra,{class:"skills-hub-search-icon"}),Zn(v("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":j[6]||(j[6]=q=>s.value=q),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:at},null,544),[[er,s.value]]),l.value>0?(b(),S("span",bC,oe(l.value)+" skills",1)):re("",!0)]),v("button",{class:"skills-hub-sort",type:"button",onClick:Y},oe(se.value),1)]),v("div",_C,[d.value?(b(),S("div",kC,"Loading skills...")):u.value?(b(),S("div",TC,oe(u.value),1)):(b(),S(Le,{key:2},[i.value.length>0?(b(),S("div",SC,[(b(!0),S(Le,null,bt(i.value,q=>(b(),ft(nu,{key:q.url,skill:q,onSelect:K=>Ye(K)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(b(),S("div",IC,'No skills found for "'+oe(s.value)+'"',1)):re("",!0)],64))]),Ie(mT,{skill:I.value,visible:w.value,"is-installing":Te.value,"is-uninstalling":ce.value,onClose:j[7]||(j[7]=q=>w.value=!1),onInstall:Xe,onUninstall:We,onToggleEnabled:Qe},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),CC=et(EC,[["__scopeId","data-v-2f6920be"]]),AC={},RC={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 PC(e,t){return b(),S("svg",RC,[...t[0]||(t[0]=[v("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),v("path",{d:"M9 4l0 16"},null,-1)])])}const xC=et(AC,[["render",PC]]),MC={},OC={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function NC(e,t){return b(),S("svg",OC,[...t[0]||(t[0]=[v("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 $C=et(MC,[["render",NC]]),DC={class:"sidebar-thread-controls"},LC=["aria-label","title"],jC=$t({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(b(),S("div",DC,[v("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(b(),ft($C,{key:0,class:"sidebar-thread-controls-icon"})):(b(),ft(xC,{key:1,class:"sidebar-thread-controls-icon"}))],8,LC),Mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(b(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ie(Vo,{class:"sidebar-thread-controls-icon"})])):re("",!0)]))}}),Pu=et(jC,[["__scopeId","data-v-46a10052"]]),UC={},BC={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function FC(e,t){return b(),S("svg",BC,[...t[0]||(t[0]=[v("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[v("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"}),v("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const HC=et(UC,[["render",FC]]);function vr(e){return e.flatMap(t=>t.threads)}const fh="codex-web-local.thread-read-state.v1",hh="codex-web-local.thread-scroll-state.v1",ja="codex-web-local.selected-thread-id.v1",Ua="codex-web-local.selected-model-id.v1",ph="codex-web-local.project-order.v1",mh="codex-web-local.project-display-name.v1",ra=220,VC=500,xu=["none","minimal","low","medium","high","xhigh"],Ms="__global__",dn="gpt-5.2-codex";function WC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(fh);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Mu(e){typeof window>"u"||window.localStorage.setItem(fh,JSON.stringify(e))}function Ba(e,t,n){return Math.min(Math.max(e,t),n)}function zC(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=Ba(t.scrollRatio,0,1)),n}function qC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(hh);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=zC(s);o&&(n[r]=o)}return n}catch{return{}}}function Ou(e){typeof window>"u"||window.localStorage.setItem(hh,JSON.stringify(e))}function GC(){return typeof window>"u"?"":window.localStorage.getItem(ja)??""}function KC(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(ja);return}window.localStorage.setItem(ja,e)}}function JC(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(Ua))==null?void 0:e.trim())??""}function sa(e){if(typeof window>"u")return;const t=e.trim();if(!t){window.localStorage.removeItem(Ua);return}window.localStorage.setItem(Ua,t)}function YC(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(ph);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 Qr(e){typeof window>"u"||window.localStorage.setItem(ph,JSON.stringify(e))}function XC(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(mh);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 oa(e){typeof window>"u"||window.localStorage.setItem(mh,JSON.stringify(e))}function ko(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 Dr(e,n)?e:n}function ia(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??null).filter(s=>s!==null&&s.threads.length>0);for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Dr(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 QC(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 ZC(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function To(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 Fa(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Dr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&ZC(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Xo(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 eA(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const p=r.get(u.id);return p&&Fa(p,u)?p:u});if(n.preserveMissing!==!0)return Xo(e,o)?e:o;const i=e.map(u=>{const p=s.get(u.id);return!p||Fa(u,p)?u:p}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Xo(e,d)?e:d}function Ha(e){return e.replace(/\s+/gu," ").trim()}function tA(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ha(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=Ha(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Nu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Fa(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const gh="worked";function pr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function nA(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 rA(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function sA(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 oA(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${nA(e.durationMs)}`,messageType:gh}}function iA(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function aA(e,t){const n=oA(t),r=e.filter(i=>i.messageType!==gh),s=iA(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Lt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function lA(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 cA(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 uA(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 So(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&lA(d,l)?d:l});return o&&o.projectName===s.projectName&&cA(o.threads,a)?o:{projectName:s.projectName,threads:a}});return uA(e,r)?e:r}function dA(e,t,n){const r=new Set(vr(t).map(a=>a.id)),s=vr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function fA(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function aa(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function hA(e){const t=e.split(`
1422
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function pA(){const e=L([]),t=L([]),n=L(GC()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),d=L({}),u=L([]),p=L(JC()),w=L("medium"),I=L(WC()),F=L(qC()),R=L(YC()),B=L(XC()),N=L({}),P=L({}),D=L({}),H=L({}),se=L({}),ae=L({}),pe=L({}),Te=L({}),ce=L({}),te=L({}),ie=L([]),Y=L([]),Ae=L(!1),Se=L(!1),Me=L(!1),Re=L(!1),Oe=L(!1),me=L(""),at=L(!1),Ye=L(!1);let Xe=null,We=null,Qe=null,tt=null,je=!1;const ze=new Set;let V=!1,ne=!1;const le=new Map,we=new Set,$e=ue(()=>vr(e.value)),y=ue(()=>$e.value.find(c=>c.id===n.value)??null),k=ue(()=>F.value[n.value]??null),M=ue(()=>{const c=[],h=n.value;return h&&Array.isArray(Te.value[h])&&c.push(...Te.value[h]),Array.isArray(Te.value[Ms])&&c.push(...Te.value[Ms]),c.sort((g,C)=>g.receivedAtIso.localeCompare(C.receivedAtIso))}),W=ue(()=>{var Z;const c=n.value;if(!c)return null;const h=se.value[c],g=(o.value[c]??"").trim(),C=(((Z=ae.value[c])==null?void 0:Z.message)??"").trim();return!h&&!g&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:g,errorText:C}}),U=ue(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],g=s.value[c]??[],C=i.value[c]??[],Z=[...h,...C,...g],X=H.value[c];return X?aA(Z,X):Z});function x(c){n.value!==c&&(n.value=c,KC(c),ne=!1)}function j(c){p.value=c.trim(),sa(p.value)}async function q(){p.value=dn,sa(p.value),u.value.includes(dn)||(u.value=[...u.value,dn]);try{await S_(dn)}catch{}}function K(c,h){ce.value={...ce.value,[c]:h}}function G(c){ce.value[c]&&(ce.value=Lt(ce.value,c))}async function ge(c){if(we.has(c))return;const h=ce.value[c];if(!(!h||h.fallbackRetried)){we.add(c),K(c,{...h,fallbackRetried:!0});try{await q();try{const g=await Jc(c,1);Kt(c,g),At(c,[]),Dt(c),i.value[c]&&(i.value=Lt(i.value,c))}catch{}nt(c,null),me.value="",Et(c,null),qe(c,{label:"Thinking",details:be(dn,h.effort)}),mt(c,!0),D.value[c]!==!0&&await Gi(c),await Ki(c,h.text,h.imageUrls,dn,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),D.value={...D.value,[c]:!0},Ve(),ze.add(c),je=!0,await jn()}catch(g){const C=g instanceof Error?g.message:"Unknown application error";nt(c,C),me.value=C,mt(c,!1),qe(c,null)}finally{we.delete(c)}}}function fe(c){c&&!xu.includes(c)||(w.value=c)}function be(c,h){const g=c.trim()||"default",C=h||"default";return[`Model: ${g}`,`Thinking: ${C}`]}async function Ee(){try{const[c,h]=await Promise.all([I_(),E_()]);u.value=c,p.value.length>0&&c.includes(p.value)||(h.model&&c.includes(h.model)?p.value=h.model:c.length>0?p.value=c[0]:p.value="",sa(p.value)),h.reasoningEffort&&xu.includes(h.reasoningEffort)&&(w.value=h.reasoningEffort)}catch{}}async function Ne(){if(tt){await tt;return}tt=(async()=>{try{Y.value=f(await C_())}catch{}finally{tt=null}})(),await tt}function Ve(){if(typeof window>"u"){Ne();return}Qe!==null&&window.clearTimeout(Qe),Qe=window.setTimeout(()=>{Qe=null,Ne()},VC)}function Be(c){const h=te.value;return Object.keys(h).length===0?c:c.map(g=>({projectName:g.projectName,threads:g.threads.map(C=>{const Z=h[C.id];return Z?{...C,title:Z}:C})}))}function Je(){const h=Be(t.value).map(g=>({projectName:g.projectName,threads:g.threads.map(C=>{const Z=a.value[C.id]===!0,X=n.value===C.id,ye=I.value[C.id],xe=d.value[C.id]===!0,ke=!X&&!Z&&(xe||ye!==C.updatedAtIso);return{...C,inProgress:Z,unread:ke}})}));e.value=So(e.value,h)}function vt(c,h,g){const C=new Date().toISOString(),Z=h.trim(),X=fA(Z),ye={id:c,title:hA(g),projectName:X,cwd:Z,hasWorktree:Z.includes("/.codex/worktrees/")||Z.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:g,unread:!1,inProgress:!1},xe=t.value.findIndex(rt=>rt.projectName===X);if(xe>=0){const St=t.value[xe].threads.filter(ur=>ur.id!==c),Yr={projectName:X,threads:[ye,...St]},Un=[...t.value];Un.splice(xe,1,Yr),t.value=Un}else t.value=[{projectName:X,threads:[ye]},...t.value];const ke=ko(R.value,t.value);Dr(R.value,ke)||(R.value=ke,Qr(R.value)),Je()}function it(c){const h=new Set(c.map(X=>X.id)),g=Ft(I.value,h);g!==I.value&&(I.value=g,Mu(g));const C=Ft(F.value,h);C!==F.value&&(F.value=C,Ou(C)),P.value=Ft(P.value,h),N.value=Ft(N.value,h),D.value=Ft(D.value,h),r.value=Ft(r.value,h),s.value=Ft(s.value,h),o.value=Ft(o.value,h),i.value=Ft(i.value,h),H.value=Ft(H.value,h),se.value=Ft(se.value,h),ae.value=Ft(ae.value,h),pe.value=Ft(pe.value,h),d.value=Ft(d.value,h),a.value=Ft(a.value,h);const Z={};for(const[X,ye]of Object.entries(Te.value))(X===Ms||h.has(X))&&(Z[X]=ye);Te.value=Z}function kt(c){const h=vr(t.value).find(g=>g.id===c);h&&(I.value={...I.value,[c]:h.updatedAtIso},Mu(I.value),d.value[c]&&(d.value=Lt(d.value,c)),Je())}function Et(c,h){if(!c)return;const g=H.value[c];if(h){if(rA(g,h))return;H.value={...H.value,[c]:h}}else g&&(H.value=Lt(H.value,c))}function mt(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Lt(a.value,c),Je())}function yt(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Je())}function qe(c,h){if(!c)return;const g=se.value[c];if(!h){g&&(se.value=Lt(se.value,c));return}const C=Ze(h.label)||"Thinking",Z=h.details.map(xe=>Ze(xe)).filter(xe=>xe.length>0&&xe!==C),X=Array.from(new Set([...(g==null?void 0:g.details)??[],...Z])).slice(-3),ye={label:C,details:X};sA(g,ye)||(se.value={...se.value,[c]:ye})}function nt(c,h){if(!c)return;const g=ae.value[c],C=h?Ha(h):"";if(!C){g&&(ae.value=Lt(ae.value,c));return}(g==null?void 0:g.message)!==C&&(ae.value={...ae.value,[c]:{message:C}})}function Ut(c){const h=vr(t.value).find(g=>g.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Pt(c,h){if(!c)return;const g={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(g.scrollRatio=Ba(h.scrollRatio,0,1));const C=F.value[c];C&&C.scrollTop===g.scrollTop&&C.isAtBottom===g.isAtBottom&&C.scrollRatio===g.scrollRatio||(F.value={...F.value,[c]:g},Ou(F.value))}function Kt(c,h){const g=r.value[c]??[];Xo(g,h)||(r.value={...r.value,[c]:h})}function At(c,h){const g=s.value[c]??[];Xo(g,h)||(s.value={...s.value,[c]:h})}function an(c,h){const g=s.value[c]??[],C=Nu(g,h);At(c,C)}function Bt(c,h){if(!c)return;const g=h.trim(),C=o.value[c]??"";if(g.length===0){if(!C)return;o.value=Lt(o.value,c);return}C!==g&&(o.value={...o.value,[c]:g})}function rn(c,h){if(!c)return;const g=o.value[c]??"";Bt(c,`${g}${h}`)}function Dt(c){c&&c in o.value&&(o.value=Lt(o.value,c))}function Ce(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Pe(c){return typeof c=="string"?c:""}function sn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function hn(c){var h,g;return((h=c.limitId)==null?void 0:h.trim())||((g=c.limitName)==null?void 0:g.trim())||"__default__"}function pn(c){const h=Ce(c);return h?{usedPercent:Ba(sn(h.usedPercent)??0,0,100),windowDurationMins:sn(h.windowDurationMins),resetsAt:sn(h.resetsAt)}:null}function _(c){const h=Ce(c);if(!h)return null;const g=Ce(h.credits);return{limitId:Pe(h.limitId)||null,limitName:Pe(h.limitName)||null,primary:pn(h.primary),secondary:pn(h.secondary),credits:g?{hasCredits:g.hasCredits===!0,unlimited:g.unlimited===!0,balance:Pe(g.balance)||null}:null,planType:Pe(h.planType)||null}}function f(c){const h=Ce(c);if(!h)return[];const g=[],C=new Set,Z=ye=>{if(!ye)return;const xe=hn(ye);C.has(xe)||(C.add(xe),g.push(ye))};Z(_(h.rateLimits));const X=Ce(h.rateLimitsByLimitId);if(X)for(const ye of Object.values(X))Z(_(ye));return g}function m(c){const h=Ce(c.params);if(!h)return"";const g=Pe(h.threadId);if(g)return g;const C=Pe(h.thread_id);if(C)return C;const Z=Pe(h.conversationId);if(Z)return Z;const X=Pe(h.conversation_id);if(X)return X;const ye=Ce(h.thread),xe=Pe(ye==null?void 0:ye.id);if(xe)return xe;const ke=Ce(h.turn),rt=Pe(ke==null?void 0:ke.threadId);if(rt)return rt;const St=Pe(ke==null?void 0:ke.thread_id);return St||""}function T(c){if(c.method!=="turn/completed")return"";const h=Ce(c.params),g=Ce(h==null?void 0:h.turn);if(!g||g.status!=="failed")return"";const C=Ce(g.error);return Pe(C==null?void 0:C.message)}function J(c){var g;if(c.method!=="error")return"";const h=Ce(c.params);return Pe(h==null?void 0:h.message)||Pe((g=Ce(h==null?void 0:h.error))==null?void 0:g.message)}function ee(c){const h=Ce(c);if(!h)return null;const g=h.id,C=Pe(h.method),Z=h.params;if(typeof g!="number"||!Number.isInteger(g)||!C)return null;const X=Ce(Z),ye=Pe(X==null?void 0:X.threadId)||Ms,xe=Pe(X==null?void 0:X.turnId),ke=Pe(X==null?void 0:X.itemId),rt=Pe(h.receivedAtIso)||new Date().toISOString();return{id:g,method:C,threadId:ye,turnId:xe,itemId:ke,receivedAtIso:rt,params:Z??null}}function _e(c){const h=c.threadId||Ms,g=Te.value[h]??[],C=g.findIndex(X=>X.id===c.id),Z=[...g];C>=0?Z.splice(C,1,c):Z.push(c),Te.value={...Te.value,[h]:Z.sort((X,ye)=>X.receivedAtIso.localeCompare(ye.receivedAtIso))}}function de(c){const h={};for(const[g,C]of Object.entries(Te.value)){const Z=C.filter(X=>X.id!==c);Z.length>0&&(h[g]=Z)}Te.value=h}function De(c){if(c.method==="server/request"){const h=ee(c.params);return h&&_e(h),!0}if(c.method==="server/request/resolved"){const h=Ce(c.params),g=h==null?void 0:h.id;return typeof g=="number"&&Number.isInteger(g)&&de(g),!0}return!1}function Ze(c){return c.replace(/\s+/gu," ").trim()}function ct(c){const h=m(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const g=Ce(c.params),C=Ce(g==null?void 0:g.item),Z=Pe(C==null?void 0:C.type).toLowerCase();if(Z==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(Z==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(Z==="commandexecution"){const X=Pe(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:X?[X]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function xt(c){if(c.method!=="turn/started")return null;const h=Ce(c.params);if(!h)return null;const g=m(c);if(!g)return null;const C=Ce(h.turn),Z=Pe(C==null?void 0:C.id)||Pe(h.turnId)||`${g}:unknown`;if(!Z)return null;const X=pr(Pe(C==null?void 0:C.startedAt))??pr(Pe(h.startedAt))??pr(c.atIso)??Date.now();return{threadId:g,turnId:Z,startedAtMs:X}}function Mt(c){if(c.method!=="turn/completed")return null;const h=Ce(c.params);if(!h)return null;const g=m(c);if(!g)return null;const C=Ce(h.turn),Z=Pe(C==null?void 0:C.id)||Pe(h.turnId)||`${g}:unknown`;if(!Z)return null;const X=pr(Pe(C==null?void 0:C.completedAt))??pr(Pe(h.completedAt))??pr(c.atIso)??Date.now(),ye=pr(Pe(C==null?void 0:C.startedAt))??pr(Pe(h.startedAt))??void 0;return{threadId:g,turnId:Z,completedAtMs:X,startedAtMs:ye}}function Dn(c){return`${c}:live-reasoning`}function Wr(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/started"){const g=Ce(h.item);return!g||g.type!=="reasoning"?"":Pe(g.id)}return""}function bs(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const g=Pe(h.itemId),C=Pe(h.delta);return!g||!C?null:{messageId:Dn(g),delta:C}}return null}function zr(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const g=Pe(h.itemId);return g?Dn(g):""}return""}function _s(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/completed"){const g=Ce(h.item);return!g||g.type!=="reasoning"?"":Dn(Pe(g.id))}return""}function ir(c){const h=Ce(c.params);if(!h)return"";if(c.method==="item/started"){const g=Ce(h.item);return!g||g.type!=="agentMessage"?"":Pe(g.id)}return""}function ks(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const g=Pe(h.itemId),C=Pe(h.delta);return!g||!C?null:{messageId:g,delta:C}}return null}function Ts(c){const h=Ce(c.params);if(!h)return null;if(c.method==="item/completed"){const g=Ce(h.item);if(!g||g.type!=="agentMessage")return null;const C=Pe(g.id),Z=Pe(g.text);return!C||!Z?null:{id:C,role:"assistant",text:Z,messageType:"agentMessage.live"}}return null}function ar(c){if(c.method!=="item/started")return null;const h=Ce(c.params),g=Ce(h==null?void 0:h.item);if(!g||g.type!=="commandExecution")return null;const C=Pe(g.id),Z=Pe(g.command);if(!C)return null;const X=typeof g.cwd=="string"?g.cwd:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:X,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function lr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Ce(c.params);if(!h)return null;const g=Pe(h.itemId),C=Pe(h.delta);return!g||!C?null:{itemId:g,delta:C}}function Ss(c){if(c.method!=="item/completed")return null;const h=Ce(c.params),g=Ce(h==null?void 0:h.item);if(!g||g.type!=="commandExecution")return null;const C=Pe(g.id),Z=Pe(g.command);if(!C)return null;const X=typeof g.cwd=="string"?g.cwd:null,ye=Pe(g.status),xe=ye==="failed"?"failed":ye==="declined"?"declined":ye==="interrupted"?"interrupted":"completed",ke=typeof g.aggregatedOutput=="string"?g.aggregatedOutput:"",rt=typeof g.exitCode=="number"?g.exitCode:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:X,status:xe,aggregatedOutput:ke,exitCode:rt}}}function A(c,h){const g=i.value[c]??[],C=Nu(g,h);C!==g&&(i.value={...i.value,[c]:C})}function O(c,h){const g=i.value[c];if(!g||g.length===0)return;const C=new Set(h.map(X=>X.id)),Z=g.filter(X=>!C.has(X.id));Z.length!==g.length&&(Z.length===0?i.value=Lt(i.value,c):i.value={...i.value,[c]:Z})}function $(c){if(c.method==="item/agentMessage/delta")return!0;const h=Ce(c.params);if(!h)return!1;if(c.method==="item/completed"){const g=Ce(h.item);return(g==null?void 0:g.type)==="agentMessage"}return!1}function Q(c){var Rl,Pl,xl,Ml;if(De(c))return;if(c.method==="account/rateLimits/updated"&&Ve(),c.method==="thread/name/updated"){const Ke=Ce(c.params),Tn=Pe(Ke==null?void 0:Ke.threadId),Cr=Pe(Ke==null?void 0:Ke.threadName);Tn&&Cr&&(te.value={...te.value,[Tn]:Cr},Je(),Ji(Tn,Cr))}const h=ct(c);h&&qe(h.threadId,h.activity);const g=xt(c);g&&(le.set(g.turnId,g),pe.value={...pe.value,[g.threadId]:g.turnId},Et(g.threadId,null),nt(g.threadId,null),mt(g.threadId,!0),d.value[g.threadId]&&(d.value=Lt(d.value,g.threadId)));const C=Mt(c),Z=T(c),ye=!!((C==null?void 0:C.threadId)??m(c))&&!!Z&&p.value!==dn&&To(new Error(Z));if(C){const Ke=le.get(C.turnId);Ke&&le.delete(C.turnId);const Tn=sn((Rl=Ce(c.params))==null?void 0:Rl.durationMs)??sn((xl=Ce((Pl=Ce(c.params))==null?void 0:Pl.turn))==null?void 0:xl.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(Ke?C.completedAtMs-Ke.startedAtMs:null),Cr=typeof Tn=="number"?Math.max(0,Tn):0;Et(C.threadId,{turnId:C.turnId,durationMs:Cr}),pe.value[C.threadId]&&(pe.value=Lt(pe.value,C.threadId)),mt(C.threadId,!1),qe(C.threadId,null),yt(C.threadId),ye||(G(C.threadId),po(C.threadId))}if(Z){const Ke=(C==null?void 0:C.threadId)||m(c);Ke&&nt(Ke,Z),me.value=Z,Ke&&ye&&ge(Ke)}else C&&nt(C.threadId,null);const xe=J(c);if(xe){const Ke=m(c);Ke&&nt(Ke,xe),me.value=xe,p.value!==dn&&To(new Error(xe))&&(Ke?ge(Ke):q())}const ke=m(c);if(!ke||ke!==n.value)return;ir(c);const rt=ks(c);if(rt){const Ke=(s.value[ke]??[]).find(Cr=>Cr.id===rt.messageId),Tn=`${(Ke==null?void 0:Ke.text)??""}${rt.delta}`;an(ke,{id:rt.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const St=Ts(c);St&&an(ke,St),Wr(c);const Yr=bs(c);if(Yr&&rn(ke,Yr.delta),zr(c)){const Ke=o.value[ke]??"";Ke.trim().length>0&&!Ke.endsWith(`
1423
+
1424
+ `)&&Bt(ke,`${Ke}
1425
+
1426
+ `)}_s(c);const ur=ar(c);ur&&(A(ke,ur),qe(ke,{label:"Running command",details:[((Ml=ur.commandExecution)==null?void 0:Ml.command)??""]}));const Ci=lr(c);if(Ci){const Ke=(i.value[ke]??[]).find(Tn=>Tn.id===Ci.itemId);Ke!=null&&Ke.commandExecution&&A(ke,{...Ke,commandExecution:{...Ke.commandExecution,aggregatedOutput:`${Ke.commandExecution.aggregatedOutput}${Ci.delta}`}})}const Al=Ss(c);if(Al&&A(ke,Al),$(c)&&(ne&&n.value&&Pt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Dt(ke)),c.method==="turn/completed"){ne=!1,Dt(ke),i.value[ke]&&(i.value=Lt(i.value,ke));const Ke=m(c);Ke&&(mt(Ke,!1),qe(Ke,null),yt(Ke),ye||(G(Ke),po(Ke)))}}function Fe(c){const h=m(c);h&&ze.add(h);const g=c.method;(g.startsWith("thread/")||g.startsWith("turn/")||g.startsWith("item/"))&&(je=!0),!(We!==null||typeof window>"u")&&(We=window.setTimeout(()=>{We=null,jn()},ra))}async function Rt(c){if(!V){V=!0;try{const h=await Aa(),g=[];for(const C of h.order){const Z=aa(C);g.includes(Z)||g.push(Z)}if(g.length>0){const C=ko(g,c);Dr(R.value,C)||(R.value=C,Qr(R.value))}if(Object.keys(h.labels).length>0){const C={...B.value};let Z=!1;for(const[X,ye]of Object.entries(h.labels)){const xe=aa(X);C[xe]!==ye&&(C[xe]=ye,Z=!0)}Z&&(B.value=C,oa(C))}}catch{}}}async function ln(){if(!(Object.keys(te.value).length>0))try{const c=await N_();Object.keys(c.titles).length>0&&(te.value=c.titles)}catch{}}async function qr(c,h,g){if(te.value[c])return;const C=h.trim();if(!C)return;const Z=C.length>300?C.slice(0,300):C;try{const X=await $_(Z,g);if(!X||te.value[c])return;te.value={...te.value,[c]:X},Je(),Ji(c,X)}catch{}}async function cr(){var c;Ye.value||(Ae.value=!0);try{const[h]=await Promise.all([p_(),ln()]);await Rt(h);const g=ko(R.value,h);Dr(R.value,g)||(R.value=g,Qr(R.value));const C=ia(h,R.value),Z=dA(t.value,C,a.value);t.value=So(t.value,Z),a.value=Ft(a.value,new Set(vr(t.value).map(xe=>xe.id))),Je(),Ye.value=!0;const X=vr(e.value);it(X),X.some(xe=>xe.id===n.value)||x(((c=X[0])==null?void 0:c.id)??"")}finally{Ae.value=!1}}async function Jt(c,h={}){if(!c)return;const g=P.value[c]===!0,C=h.silent!==!0&&!g;C&&(Se.value=!0);try{D.value[c]!==!0&&(await Gi(c),D.value={...D.value,[c]:!0});const{messages:Z,inProgress:X}=await m_(c),ye=r.value[c]??[],xe=eA(ye,Z,{preserveMissing:h.silent===!0});Kt(c,xe);const ke=s.value[c]??[],rt=tA(ke,Z);At(c,rt),O(c,Z),P.value={...P.value,[c]:!0};const St=Ut(c);St&&(N.value={...N.value,[c]:St}),mt(c,X),kt(c)}finally{C&&(Se.value=!1)}}async function Ln(){try{const c=t.value.flatMap(h=>h.threads.map(g=>g.cwd)).filter(Boolean);ie.value=await D_(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Gr(){me.value="";try{await cr(),await Promise.all([Ee(),Ne(),Ln()]),await Jt(n.value)}catch(c){me.value=c instanceof Error?c.message:"Unknown application error"}}async function Er(c){x(c);try{await Jt(c)}catch(h){me.value=h instanceof Error?h.message:"Unknown application error"}}async function vi(c){try{await w_(c),await cr(),n.value===c&&await Jt(n.value)}catch(h){me.value=h instanceof Error?h.message:"Unknown application error"}}async function yi(c,h){const g=h.trim();if(!(!c||!g))try{await b_(c,g),te.value={...te.value,[c]:g},Je(),Ji(c,g)}catch(C){me.value=C instanceof Error?C.message:"Unknown application error"}}async function ho(c,h=[],g=[],C="steer",Z=[]){const X=n.value,ye=c.trim();if(!X||!ye&&h.length===0&&Z.length===0)return;const xe=a.value[X]===!0;if(xe&&C==="queue"){const ke=l.value[X]??[],rt=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[X]:[...ke,{id:rt,text:ye,imageUrls:h,skills:g,fileAttachments:Z}]};return}if(xe){ne=!0,Kr(X,ye,h,g,Z).catch(ke=>{const rt=ke instanceof Error?ke.message:"Unknown application error";nt(X,rt),me.value=rt});return}me.value="",ne=!0,Et(X,null),qe(X,{label:"Thinking",details:be(p.value,w.value)}),nt(X,null),mt(X,!0);try{await Kr(X,ye,h,g,Z)}catch(ke){ne=!1,mt(X,!1),qe(X,null);const rt=ke instanceof Error?ke.message:"Unknown application error";throw nt(X,rt),me.value=rt,ke}}async function wi(c,h,g=[],C=[],Z=[]){const X=c.trim(),ye=h.trim(),xe=p.value.trim();if(!X&&g.length===0&&Z.length===0)return"";Me.value=!0,me.value="";let ke="";try{try{ke=await Yc(ye||void 0,xe||void 0)}catch(Un){if(xe&&xe!==dn&&To(Un))await q(),ke=await Yc(ye||void 0,dn);else throw Un}if(!ke)return"";vt(ke,ye,X||"[Image]"),D.value={...D.value,[ke]:!0},x(ke),ne=!0,Et(ke,null),qe(ke,{label:"Thinking",details:be(p.value,w.value)}),nt(ke,null),mt(ke,!0);const rt=ke,St=ye||null,Yr=X;return Kr(ke,X,g,C,Z).catch(Un=>{ne=!1,mt(ke,!1),qe(ke,null);const ur=Un instanceof Error?Un.message:"Unknown application error";nt(ke,ur),me.value=ur}).finally(()=>{Me.value=!1}),qr(rt,Yr,St),ke}catch(rt){ne=!1,ke&&(mt(ke,!1),qe(ke,null));const St=rt instanceof Error?rt.message:"Unknown application error";throw ke&&nt(ke,St),me.value=St,Me.value=!1,rt}}async function Kr(c,h,g=[],C=[],Z=[]){const X=p.value.trim(),ye=w.value,xe=h.trim(),ke=C.map(St=>({name:St.name,path:St.path})),rt=Z.map(St=>({...St}));K(c,{text:xe,imageUrls:[...g],skills:ke,fileAttachments:rt,effort:ye,fallbackRetried:!1});try{D.value[c]!==!0&&await Gi(c);try{await Ki(c,h,g,X||void 0,ye||void 0,C.length>0?C:void 0,Z)}catch(St){if(X&&X!==dn&&To(St))await q(),K(c,{text:xe,imageUrls:[...g],skills:ke,fileAttachments:rt,effort:ye,fallbackRetried:!0}),await Ki(c,h,g,dn,ye||void 0,C.length>0?C:void 0,Z);else throw St}D.value={...D.value,[c]:!0},ze.add(c),je=!0,await jn()}catch(St){throw St}}async function po(c){const h=l.value[c];if(!h||h.length===0)return;const[g,...C]=h;l.value=C.length>0?{...l.value,[c]:C}:Lt(l.value,c),Me.value=!0,me.value="",ne=!0,Et(c,null),qe(c,{label:"Thinking",details:be(p.value,w.value)}),nt(c,null),mt(c,!0);try{await Kr(c,g.text,g.imageUrls,g.skills,g.fileAttachments)}catch{mt(c,!1),qe(c,null)}finally{Me.value=!1}}async function bi(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=pe.value[c];Re.value=!0,me.value="";try{await T_(c,h),mt(c,!1),qe(c,null),nt(c,null),pe.value[c]&&(pe.value=Lt(pe.value,c)),ze.add(c),je=!0,await jn()}catch(g){const C=g instanceof Error?g.message:"Failed to interrupt active turn";nt(c,C),me.value=C}finally{Re.value=!1}}async function _i(c){const h=n.value;if(!h||Oe.value)return;const C=(r.value[h]??[]).reduce((X,ye)=>typeof ye.turnIndex=="number"&&ye.turnIndex>X?ye.turnIndex:X,-1);if(C<0||c>C)return;const Z=C-c+1;if(!(Z<1)){Oe.value=!0,me.value="";try{const X=await Jc(h,Z);Kt(h,X),At(h,[]),Dt(h),i.value[h]&&(i.value=Lt(i.value,h)),Et(h,null),qe(h,null),nt(h,null),je=!0,await jn()}catch(X){me.value=X instanceof Error?X.message:"Failed to rollback thread"}finally{Oe.value=!1}}}function ki(c,h){c.length===0||(B.value[c]??"")===h||(B.value={...B.value,[c]:h},oa(B.value))}function Ti(c){var Z;if(c.length===0)return;const h=R.value.filter(X=>X!==c);if(Dr(R.value,h)||(R.value=h,Qr(R.value)),t.value=t.value.filter(X=>X.projectName!==c),B.value[c]!==void 0){const X={...B.value};delete X[c],B.value=X,oa(X)}Je();const g=vr(e.value);it(g),g.some(X=>X.id===n.value)||x(((Z=g[0])==null?void 0:Z.id)??""),Es()}function Is(c,h){if(c.length===0||t.value.length===0)return;const g=t.value.map(ke=>ke.projectName),C=g.indexOf(c);if(C===-1)return;const Z=Math.max(0,Math.min(h,g.length-1)),X=QC(g,C,Z);if(X===g)return;const ye=ko(X,t.value);R.value=ye,Qr(R.value);const xe=ia(t.value,R.value);t.value=So(t.value,xe),Je(),Es()}function Jr(c){const h=c.trim();if(!h)return;const g=[h,...R.value.filter(Z=>Z!==h)];if(Dr(R.value,g))return;R.value=g,Qr(R.value);const C=ia(t.value,R.value);t.value=So(t.value,C),Je(),Es()}async function Es(){var c,h;try{const g=await Aa(),C=new Map;for(const ye of g.order){const xe=aa(ye);C.has(xe)||C.set(xe,ye)}for(const ye of t.value){const xe=((h=(c=ye.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";xe&&C.set(ye.projectName,xe)}const Z=[];for(const ye of R.value){const xe=C.get(ye);xe&&!Z.includes(xe)&&Z.push(xe)}for(const ye of g.order)Z.includes(ye)||Z.push(ye);const X=g.active.filter(ye=>Z.includes(ye));X.length===0&&Z.length>0&&X.push(Z[0]),await P_({order:Z,labels:g.labels,active:X})}catch{}}async function jn(){if(at.value){typeof window<"u"&&We===null&&(We=window.setTimeout(()=>{We=null,jn()},ra));return}at.value=!0;const c=je,h=new Set(ze);je=!1,ze.clear();try{c&&await cr();const g=n.value;if(!g)return;const C=h.has(g),Z=a.value[g]===!0,X=Ut(g),ye=N.value[g]??"",xe=X.length>0&&X!==ye;(C||Z||xe||c)&&await Jt(g,{silent:!0})}catch{}finally{at.value=!1,(je||ze.size>0)&&typeof window<"u"&&We===null&&(We=window.setTimeout(()=>{We=null,jn()},ra))}}function Si(){typeof window>"u"||Xe||(Ii(),Xe=g_(c=>{Q(c),Fe(c)}))}async function Ii(){try{const c=await y_();for(const h of c){const g=ee(h);g&&_e(g)}}catch{}}async function mo(c){try{await v_(c.id,{result:c.result,error:c.error}),de(c.id)}catch(h){me.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Ei(){Xe&&(Xe(),Xe=null),je=!1,ze.clear(),le.clear(),We!==null&&typeof window<"u"&&(window.clearTimeout(We),We=null),Qe!==null&&typeof window<"u"&&(window.clearTimeout(Qe),Qe=null),ne=!1,r.value={},s.value={},o.value={},i.value={},se.value={},H.value={},ae.value={},pe.value={},l.value={}}const E=ue(()=>{const c=n.value;return c?l.value[c]??[]:[]});function z(c){const h=n.value;if(!h)return;const g=l.value[h];if(!g)return;const C=g.filter(Z=>Z.id!==c);l.value=C.length>0?{...l.value,[h]:C}:Lt(l.value,h)}function he(c){const h=n.value;if(!h)return;const g=l.value[h];if(!g)return;const C=g.find(Z=>Z.id===c);C&&(z(c),ho(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:y,selectedThreadScrollState:k,selectedThreadServerRequests:M,selectedLiveOverlay:W,selectedThreadId:n,availableModelIds:u,selectedModelId:p,selectedReasoningEffort:w,installedSkills:ie,accountRateLimitSnapshots:Y,messages:U,isLoadingThreads:Ae,isLoadingMessages:Se,isSendingMessage:Me,isInterruptingTurn:Re,error:me,refreshAll:Gr,refreshSkills:Ln,selectThread:Er,setThreadScrollState:Pt,archiveThreadById:vi,renameThreadById:yi,sendMessageToSelectedThread:ho,sendMessageToNewThread:wi,interruptSelectedThreadTurn:bi,rollbackSelectedThread:_i,isRollingBack:Oe,selectedThreadQueuedMessages:E,removeQueuedMessage:z,steerQueuedMessage:he,setSelectedModelId:j,setSelectedReasoningEffort:fe,respondToPendingServerRequest:mo,renameProject:ki,removeProject:Ti,reorderProject:Is,pinProjectToTop:Jr,startPolling:Si,stopPolling:Ei}}const mA={class:"sidebar-root"},gA={class:"sidebar-scrollable"},vA=["aria-pressed"],yA={key:1,class:"sidebar-search-bar"},wA={key:0,class:"sidebar-settings-area"},bA={key:0,class:"sidebar-settings-panel"},_A={class:"sidebar-settings-value"},kA={class:"sidebar-settings-value"},TA={class:"sidebar-settings-row sidebar-settings-row--select"},SA={class:"sidebar-settings-rate-limits"},IA={class:"content-root"},EA={class:"content-body"},CA={key:1,class:"content-grid"},AA={class:"new-thread-empty"},RA={class:"worktree-init-status-title"},PA={class:"worktree-init-status-message"},xA={key:2,class:"content-grid"},MA={class:"content-thread"},OA={class:"composer-with-queue"},NA={class:"build-badge","aria-label":"Worktree name and version"},$u="codex-web-local.sidebar-collapsed.v1",Du="codex-web-local.send-with-enter.v1",Lu="codex-web-local.in-progress-send-mode.v1",ju="codex-web-local.dark-mode.v1",Uu="codex-web-local.dictation-click-to-toggle.v1",Bu="codex-web-local.dictation-auto-send.v1",Fu="codex-web-local.dictation-language.v1",$A=$t({__name:"App",setup(e){const t="e30f",n="0.1.46",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:d,selectedThreadId:u,availableModelIds:p,selectedModelId:w,selectedReasoningEffort:I,installedSkills:F,accountRateLimitSnapshots:R,messages:B,isLoadingThreads:N,isLoadingMessages:P,isInterruptingTurn:D,refreshAll:H,refreshSkills:se,selectThread:ae,setThreadScrollState:pe,archiveThreadById:Te,renameThreadById:ce,sendMessageToSelectedThread:te,sendMessageToNewThread:ie,interruptSelectedThreadTurn:Y,rollbackSelectedThread:Ae,isRollingBack:Se,selectedThreadQueuedMessages:Me,removeQueuedMessage:Re,steerQueuedMessage:Oe,setSelectedModelId:me,setSelectedReasoningEffort:at,respondToPendingServerRequest:Ye,renameProject:Xe,removeProject:We,reorderProject:Qe,pinProjectToTop:tt,startPolling:je,stopPolling:ze}=pA(),V=Zg(),ne=Qg(),{isMobile:le}=vf(),we=L(!1),$e=L(!1),y=L(""),k=L("local"),M=L({order:[],labels:{}}),W=L({phase:"idle",title:"",message:""}),U=L(Es()),x=L(""),j=L(!1),q=L(null),K=L(null);let G=null;const ge=L("New Project (1)"),fe=L(""),be=L(!1),Ee=L(Er(Du,!0)),Ne=L(yi()),Ve=L(vi()),Be=L(Er(Uu,!1)),Je=L(null);let vt=0;const it=L(Er(Bu,!0)),kt=L(ki()),Et=ue(()=>Ti()),mt=ue(()=>{const E=V.params.threadId;return typeof E=="string"?E:""}),yt=ue(()=>{const E=new Set;for(const z of s.value)for(const he of z.threads)E.add(he.id);return E}),qe=ue(()=>V.name==="home"),nt=ue(()=>V.name==="skills"),Ut=ue(()=>{var E;return nt.value?"Skills":qe.value?"New thread":((E=i.value)==null?void 0:E.title)??"Choose a thread"}),Pt=ue(()=>B.value.filter(E=>{const z=Si(E.messageType,E.role);return z==="worked"?!0:!(z==="turnActivity.live"||z==="turnError.live"||z==="agentReasoning.live")})),Kt=ue(()=>{let E=-1;for(const z of B.value)z.role==="user"&&typeof z.turnIndex=="number"&&z.turnIndex>E&&(E=z.turnIndex);return E}),At=ue(()=>d.value),an=ue(()=>qe.value?"__new-thread__":u.value),Bt=ue(()=>{var E,z;return qe.value?y.value.trim():((z=(E=i.value)==null?void 0:E.cwd)==null?void 0:z.trim())??""}),rn=ue(()=>{var E;return!qe.value&&((E=i.value)==null?void 0:E.inProgress)===!0}),Dt=ue(()=>{var c,h;const E=[],z=new Set;for(const g of M.value.order){const C=g.trim();!C||z.has(C)||(z.add(C),E.push({value:C,label:M.value.labels[C]||$(C)}))}for(const g of s.value){const C=((h=(c=g.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";!C||z.has(C)||(z.add(C),E.push({value:C,label:o.value[g.projectName]??g.projectName}))}const he=y.value.trim();return he&&!z.has(he)&&E.unshift({value:he,label:$(he)}),E}),Ce=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;sr(()=>{window.addEventListener("keydown",Dn),Jr(),Ce==null||Ce.addEventListener("change",Jr),Ii(),ir(),Ss(),A(),ar()}),ai(()=>{window.removeEventListener("keydown",Dn),Ce==null||Ce.removeEventListener("change",Jr),G&&(clearTimeout(G),G=null),ze()}),ht(x,E=>{const z=E.trim();if(G&&(clearTimeout(G),G=null),!z){K.value=null;return}G=setTimeout(()=>{O_(z,1e3).then(he=>{x.value.trim()===z&&(K.value=he.threadIds)}).catch(()=>{x.value.trim()===z&&(K.value=null)})},220)});function Pe(){se()}function sn(){j.value=!j.value,j.value?qt(()=>{var E;return(E=q.value)==null?void 0:E.focus()}):x.value=""}function hn(){var E;x.value="",(E=q.value)==null||E.focus()}function pn(E){E.key==="Escape"&&(j.value=!1,x.value="")}function _(E){E&&(V.name==="thread"&&mt.value===E||(ne.push({name:"thread",params:{threadId:E}}),le.value&&Mt(!0)))}async function f(E){E&&(u.value!==E&&(await ae(E),await ne.push({name:"thread",params:{threadId:E}})),await qt(),cr())}function m(E){Te(E)}function T(E){var c,h;const z=s.value.find(g=>g.projectName===E),he=((h=(c=z==null?void 0:z.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";he&&(y.value=he),le.value&&Mt(!0),!qe.value&&ne.push({name:"home"})}function J(E){var c,h;const z=s.value.find(g=>g.projectName===E),he=((h=(c=z==null?void 0:z.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";!he||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(he)}`,"_blank","noopener,noreferrer")}function ee(){var z,he;const E=((he=(z=i.value)==null?void 0:z.cwd)==null?void 0:he.trim())??"";E&&(y.value=E),le.value&&Mt(!0),!qe.value&&ne.push({name:"home"})}function _e(E){Xe(E.projectName,E.displayName)}function de(E){ce(E.threadId,E.title)}function De(E){We(E)}function Ze(E){Qe(E.projectName,E.toIndex)}function ct(E){pe(E.threadId,E.state)}function xt(E){Ye(E)}function Mt(E){U.value!==E&&(U.value=E,jn(E))}function Dn(E){E.defaultPrevented||!E.ctrlKey&&!E.metaKey||E.shiftKey||E.altKey||E.key.toLowerCase()==="b"&&(E.preventDefault(),Mt(!U.value))}function Wr(E){const z=E.text;if(qe.value){Ei(z,E.imageUrls,E.skills,E.fileAttachments);return}if(E.rollbackLatestUserTurn===!0){bs(E);return}te(z,E.imageUrls,E.skills,E.mode,E.fileAttachments)}async function bs(E){rn.value&&await Y();const z=Kt.value;z>=0&&await Ae(z),await te(E.text,E.imageUrls,E.skills,"steer",E.fileAttachments)}function zr(E){y.value=E.trim()}async function _s(E){const z=E.trim();if(!z)return;const he=Ts(z),c=await ks(),h=he?z:Q(c,z);if(h)try{const g=await Qc(h,{createIfMissing:!he,label:he?"":z});g&&(y.value=g,tt($(g)),A(),ar())}catch{}}async function ir(){var z;if(typeof window>"u")return;const E=((z=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:z.trim())??"";if(E)try{const he=await Qc(E,{createIfMissing:!1,label:""});if(!he)return;y.value=he,tt($(he)),await ne.replace({name:"home"}),await A();const c=new URL(window.location.href);c.searchParams.delete("openProjectPath"),window.history.replaceState({},"",c.toString())}catch{}}async function ks(){const E=lr();if(E)return E;try{const z=await Xc();if(z)return fe.value=z,z}catch{}return""}function Ts(E){return E?E.startsWith("~/")||E.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(E):!1}async function ar(){const E=lr();if(!E){ge.value="New Project (1)";return}try{const z=await x_(E);ge.value=z.name||"New Project (1)"}catch{ge.value="New Project (1)"}}function lr(){var he,c;const E=y.value.trim();if(E)return O(E);const z=((c=(he=Dt.value[0])==null?void 0:he.value)==null?void 0:c.trim())??"";return z?O(z):fe.value.trim()}async function Ss(){try{fe.value=await Xc()}catch{fe.value=""}}async function A(){try{const E=await Aa();M.value={order:[...E.order],labels:{...E.labels}}}catch{M.value={order:[],labels:{}}}}function O(E){const z=E.trim().replace(/\/+$/,"");if(!z)return"";const he=z.lastIndexOf("/");return he<=0?"":z.slice(0,he)}function $(E){const z=E.trim().replace(/\/+$/,"");if(!z)return"";const he=z.lastIndexOf("/");return he<0?z:z.slice(he+1)}function Q(E,z){const he=E.trim().replace(/\/+$/,""),c=z.trim().replace(/^\/+/,"");return!he||!c?"":`${he}/${c}`}function Fe(E){me(E)}function Rt(E){at(E)}function ln(){Y()}function qr(E){var he;const z=((he=E.prependText)==null?void 0:he.trim())??"";z.length>0&&(vt+=1,Je.value={id:vt,text:z}),Ae(E.turnIndex)}function cr(){if(qe.value||nt.value||typeof document>"u"||!i.value||Pt.value.length===0)return;const E=Jt(),z=Ln(),he=new Blob([E],{type:"text/markdown;charset=utf-8"}),c=URL.createObjectURL(he),h=document.createElement("a");h.href=c,h.download=z,document.body.appendChild(h),h.click(),document.body.removeChild(h),window.setTimeout(()=>URL.revokeObjectURL(c),0)}function Jt(){var he,c,h;const E=[],z=((c=(he=i.value)==null?void 0:he.title)==null?void 0:c.trim())||"Untitled thread";E.push(`# ${Gr(z)}`),E.push(""),E.push(`- Exported: ${new Date().toISOString()}`),E.push(`- Thread ID: ${((h=i.value)==null?void 0:h.id)??""}`),E.push(""),E.push("---"),E.push("");for(const g of Pt.value){const C=g.role?g.role.toUpperCase():"MESSAGE";E.push(`## ${C}`),E.push("");const Z=g.text.trim();if(Z&&(E.push(Z),E.push("")),g.commandExecution&&(E.push("```text"),E.push(`command: ${g.commandExecution.command}`),E.push(`status: ${g.commandExecution.status}`),g.commandExecution.cwd&&E.push(`cwd: ${g.commandExecution.cwd}`),g.commandExecution.exitCode!==null&&E.push(`exitCode: ${g.commandExecution.exitCode}`),E.push(g.commandExecution.aggregatedOutput||"(no output)"),E.push("```"),E.push("")),g.fileAttachments&&g.fileAttachments.length>0){E.push("Attachments:");for(const X of g.fileAttachments)E.push(`- ${X.path}`);E.push("")}if(g.images&&g.images.length>0){E.push("Images:");for(const X of g.images)E.push(`- ${X}`);E.push("")}}return`${E.join(`
1427
+ `).trimEnd()}
1428
+ `}function Ln(){var h,g;const he=(((g=(h=i.value)==null?void 0:h.title)==null?void 0:g.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",c=new Date().toISOString().replace(/[:.]/g,"-");return`${he}-${c}.md`}function Gr(E){return E.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function Er(E,z){if(typeof window>"u")return z;const he=window.localStorage.getItem(E);return he===null?z:he==="1"}function vi(){if(typeof window>"u")return"system";const E=window.localStorage.getItem(ju);return E==="light"||E==="dark"?E:"system"}function yi(){return typeof window>"u"?"steer":window.localStorage.getItem(Lu)==="queue"?"queue":"steer"}function ho(){Ee.value=!Ee.value,window.localStorage.setItem(Du,Ee.value?"1":"0")}function wi(){Ne.value=Ne.value==="steer"?"queue":"steer",window.localStorage.setItem(Lu,Ne.value)}function Kr(){const E=["system","light","dark"],z=E.indexOf(Ve.value);Ve.value=E[(z+1)%E.length],window.localStorage.setItem(ju,Ve.value),Jr()}function po(){Be.value=!Be.value,window.localStorage.setItem(Uu,Be.value?"1":"0")}function bi(){it.value=!it.value,window.localStorage.setItem(Bu,it.value?"1":"0")}function _i(E){const he=Is(E.trim())||"auto";kt.value=he,window.localStorage.setItem(Fu,he)}function ki(){var he;if(typeof window>"u")return"auto";const E=((he=window.localStorage.getItem(Fu))==null?void 0:he.trim())||"auto";return Is(E)||"auto"}function Ti(){const E=[{value:"auto",label:"Auto-detect"}],z=new Set(["auto"]);function he(h){const g=r[h]||h;return`${g.charAt(0).toUpperCase()+g.slice(1)} (${h})`}for(const h of typeof navigator<"u"?navigator.languages??[]:[]){const g=Is(h);!g||z.has(g)||(z.add(g),E.push({value:g,label:`Preferred: ${he(g)}`}))}for(const h of Object.keys(r))z.has(h)||(z.add(h),E.push({value:h,label:he(h)}));const c=kt.value.trim();return c&&!z.has(c)&&E.push({value:c,label:he(c)}),E}function Is(E){const z=E.trim().toLowerCase();if(!z||z==="auto")return"";if(z in r)return z;const he=z.split("-")[0]??z;return he in r?he:""}function Jr(){const E=document.documentElement;if(Ve.value==="dark")E.classList.add("dark");else if(Ve.value==="light")E.classList.remove("dark");else{const z=window.matchMedia("(prefers-color-scheme: dark)").matches;E.classList.toggle("dark",z)}}function Es(){return typeof window>"u"?!1:window.localStorage.getItem($u)==="1"}function jn(E){typeof window>"u"||window.localStorage.setItem($u,E?"1":"0")}function Si(E,z){const he=(E??"").trim();return he.length>0?he:z.trim()||"message"}async function Ii(){await H(),$e.value=!0,await mo(),je()}async function mo(){if(!we.value){we.value=!0;try{if(V.name==="home"||V.name==="skills"){u.value!==""&&await ae("");return}if(V.name==="thread"){const E=mt.value;if(!E)return;if(!yt.value.has(E)){await ne.replace({name:"home"});return}u.value!==E&&await ae(E);return}}finally{we.value=!1}}}ht(()=>[V.name,mt.value,N.value,yt.value.has(mt.value),u.value],async()=>{$e.value&&await mo()}),ht(()=>u.value,async E=>{if($e.value&&!we.value&&!(qe.value||nt.value)){if(!E){V.name!=="home"&&await ne.replace({name:"home"});return}V.name==="thread"&&mt.value===E||await ne.replace({name:"thread",params:{threadId:E}})}}),ht(()=>Dt.value,E=>{if(E.length===0){y.value="";return}E.some(he=>he.value===y.value)||(y.value=E[0].value),ar()},{immediate:!0}),ht(()=>y.value,()=>{W.value={phase:"idle",title:"",message:""},ar()}),ht(()=>k.value,E=>{E==="local"&&(W.value={phase:"idle",title:"",message:""})}),ht(()=>V.name,E=>{E!=="home"&&(W.value={phase:"idle",title:"",message:""})}),ht(()=>u.value,()=>{W.value={phase:"idle",title:"",message:""}}),ht(le,E=>{E&&!U.value&&Mt(!0)});async function Ei(E,z=[],he=[],c=[]){try{W.value={phase:"idle",title:"",message:""};let h=y.value;if(k.value==="worktree"){W.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const C=await R_(y.value);h=C.cwd,y.value=C.cwd,W.value={phase:"idle",title:"",message:""}}catch{W.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const g=await ie(E,h,z,he,c);if(!g)return;await ne.replace({name:"thread",params:{threadId:g}})}catch{}}return(E,z)=>(b(),S(Le,null,[Ie(ov,{"is-sidebar-collapsed":U.value,onCloseSidebar:z[6]||(z[6]=he=>Mt(!0))},{sidebar:gt(()=>[v("section",mA,[v("div",gA,[U.value?re("",!0):(b(),ft(Pu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":U.value,"show-new-thread-button":!0,onToggleSidebar:z[0]||(z[0]=he=>Mt(!U.value)),onStartNewThread:ee},{default:gt(()=>[v("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":j.value,"aria-label":"Search threads",title:"Search threads",onClick:sn},[Ie(Ra,{class:"sidebar-search-toggle-icon"})],8,vA)]),_:1},8,["is-sidebar-collapsed"])),!U.value&&j.value?(b(),S("div",yA,[Ie(Ra,{class:"sidebar-search-bar-icon"}),Zn(v("input",{ref_key:"sidebarSearchInputRef",ref:q,"onUpdate:modelValue":z[1]||(z[1]=he=>x.value=he),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:pn},null,544),[[er,x.value]]),x.value.length>0?(b(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:hn},[Ie(fl,{class:"sidebar-search-clear-icon"})])):re("",!0)])):re("",!0),U.value?re("",!0):(b(),S("button",{key:2,class:ot(["sidebar-skills-link",{"is-active":nt.value}]),type:"button",onClick:z[2]||(z[2]=he=>{ve(ne).push({name:"skills"}),ve(le)&&Mt(!0)})}," Skills Hub ",2)),U.value?re("",!0):(b(),ft(Ky,{key:3,groups:ve(s),"project-display-name-by-id":ve(o),"selected-thread-id":ve(u),"is-loading":ve(N),"search-query":x.value,"search-matched-thread-ids":K.value,onSelect:_,onArchive:m,onStartNewThread:T,onRenameProject:_e,onBrowseProjectFiles:J,onRenameThread:de,onRemoveProject:De,onReorderProject:Ze,onExportThread:f},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),U.value?re("",!0):(b(),S("div",wA,[Ie(rf,{name:"settings-panel"},{default:gt(()=>[be.value?(b(),S("div",bA,[v("button",{class:"sidebar-settings-row",type:"button",onClick:ho},[z[7]||(z[7]=v("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),v("span",{class:ot(["sidebar-settings-toggle",{"is-on":!Ee.value}])},null,2)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:wi},[z[8]||(z[8]=v("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),v("span",_A,oe(Ne.value==="steer"?"Steer":"Queue"),1)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:Kr},[z[9]||(z[9]=v("span",{class:"sidebar-settings-label"},"Appearance",-1)),v("span",kA,oe(Ve.value==="system"?"System":Ve.value==="dark"?"Dark":"Light"),1)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:po},[z[10]||(z[10]=v("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),v("span",{class:ot(["sidebar-settings-toggle",{"is-on":Be.value}])},null,2)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:bi},[z[11]||(z[11]=v("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),v("span",{class:ot(["sidebar-settings-toggle",{"is-on":it.value}])},null,2)]),v("div",TA,[z[12]||(z[12]=v("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Ie(Wo,{class:"sidebar-settings-language-dropdown","model-value":kt.value,options:Et.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":_i},null,8,["model-value","options"])]),v("div",SA,[Ie(I0,{snapshots:ve(R)},null,8,["snapshots"])])])):re("",!0)]),_:1}),v("button",{class:"sidebar-settings-button",type:"button",onClick:z[3]||(z[3]=he=>be.value=!be.value)},[Ie(HC,{class:"sidebar-settings-icon"}),z[13]||(z[13]=v("span",null,"Settings",-1))])]))])]),content:gt(()=>[v("section",IA,[Ie(ew,{title:Ut.value},{leading:gt(()=>[U.value||ve(le)?(b(),ft(Pu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":U.value,"show-new-thread-button":!0,onToggleSidebar:z[4]||(z[4]=he=>Mt(!U.value)),onStartNewThread:ee},null,8,["is-sidebar-collapsed"])):re("",!0)]),_:1},8,["title"]),v("section",EA,[nt.value?(b(),ft(CC,{key:0,onSkillsChanged:Pe})):qe.value?(b(),S("div",CA,[v("div",AA,[z[14]||(z[14]=v("p",{class:"new-thread-hero"},"Let's build",-1)),Ie(Wo,{class:"new-thread-folder-dropdown","model-value":y.value,options:Dt.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":ge.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":zr,onAdd:_s},null,8,["model-value","options","default-add-value"]),Ie(O0,{class:"new-thread-runtime-dropdown",modelValue:k.value,"onUpdate:modelValue":z[5]||(z[5]=he=>k.value=he)},null,8,["modelValue"]),W.value.phase!=="idle"?(b(),S("div",{key:0,class:ot(["worktree-init-status",{"is-running":W.value.phase==="running","is-error":W.value.phase==="error"}])},[v("strong",RA,oe(W.value.title),1),v("span",PA,oe(W.value.message),1)],2)):re("",!0)]),Ie(tu,{"active-thread-id":an.value,cwd:Bt.value,models:ve(p),"selected-model":ve(w),"selected-reasoning-effort":ve(I),skills:ve(F),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Ee.value,"in-progress-submit-mode":Ne.value,"dictation-click-to-toggle":Be.value,"dictation-auto-send":it.value,"prepend-draft-request":Je.value,"dictation-language":kt.value,onSubmit:Wr,"onUpdate:selectedModel":Fe,"onUpdate:selectedReasoningEffort":Rt},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"])])):(b(),S("div",xA,[v("div",MA,[Ie(Hb,{messages:Pt.value,"is-loading":ve(P),"active-thread-id":an.value,cwd:Bt.value,"scroll-state":ve(a),"live-overlay":At.value,"pending-requests":ve(l),"is-turn-in-progress":rn.value,"is-rolling-back":ve(Se),onUpdateScrollState:ct,onRespondServerRequest:xt,onRollback:qr},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),v("div",OA,[Ie(g0,{messages:ve(Me),onSteer:ve(Oe),onDelete:ve(Re)},null,8,["messages","onSteer","onDelete"]),Ie(tu,{"active-thread-id":an.value,cwd:Bt.value,models:ve(p),"selected-model":ve(w),"selected-reasoning-effort":ve(I),skills:ve(F),"is-turn-in-progress":rn.value,"is-interrupting-turn":ve(D),"has-queue-above":ve(Me).length>0,"send-with-enter":Ee.value,"in-progress-submit-mode":Ne.value,"dictation-click-to-toggle":Be.value,"dictation-auto-send":it.value,"prepend-draft-request":Je.value,"dictation-language":kt.value,onSubmit:Wr,"onUpdate:selectedModel":Fe,"onUpdate:selectedReasoningEffort":Rt,onInterrupt:ln},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"]),v("div",NA," WT "+oe(ve(t))+" · v"+oe(ve(n)),1)],64))}}),DA=et($A,[["__scopeId","data-v-5588f6ac"]]),la={render:()=>null},LA=Xg({history:Rg(),routes:[{path:"/",name:"home",component:la},{path:"/thread/:threadId",name:"thread",component:la},{path:"/skills",name:"skills",component:la},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Hm(DA).use(LA).mount("#app");