codexui-android 0.1.83 → 0.1.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ReviewPane-nTMVVMpp.js → ReviewPane-Blnhnm6J.js} +2 -2
- package/dist/assets/{ReviewPane-nTMVVMpp.js.map → ReviewPane-Blnhnm6J.js.map} +1 -1
- package/dist/assets/{SkillsHub-BqjWaUSP.js → SkillsHub-C93DMbLM.js} +2 -2
- package/dist/assets/{SkillsHub-BqjWaUSP.js.map → SkillsHub-C93DMbLM.js.map} +1 -1
- package/dist/assets/ThreadConversation-B-Ik7tFp.js +40 -0
- package/dist/assets/ThreadConversation-B-Ik7tFp.js.map +1 -0
- package/dist/assets/{ThreadConversation-BsN7bN3q.css → ThreadConversation-BKfO22g2.css} +1 -1
- package/dist/assets/{index-iN-aqOuT.css → index-C_knKlTI.css} +1 -1
- package/dist/assets/index-CmAz60O4.js +92 -0
- package/dist/assets/index-CmAz60O4.js.map +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/chunk-PUR7OUAG.js +127 -0
- package/dist-cli/chunk-PUR7OUAG.js.map +1 -0
- package/dist-cli/index.js +743 -142
- package/dist-cli/index.js.map +1 -1
- package/dist-cli/instrument.js +1 -1
- package/package.json +10 -4
- package/dist/assets/ThreadConversation-Ctw55jX6.js +0 -40
- package/dist/assets/ThreadConversation-Ctw55jX6.js.map +0 -1
- package/dist/assets/index-BEf3759i.js +0 -92
- package/dist/assets/index-BEf3759i.js.map +0 -1
- package/dist-cli/chunk-UUZOL7SL.js +0 -121
- package/dist-cli/chunk-UUZOL7SL.js.map +0 -1
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-Ctw55jX6.js","assets/ThreadConversation-BsN7bN3q.css","assets/ReviewPane-nTMVVMpp.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-BqjWaUSP.js","assets/SkillsHub-Bg1Le103.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/**
|
|
3
|
-
* @vue/shared v3.5.32
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Cf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Lt={},gi=[],lo=()=>{},qg=()=>!1,_c=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),bc=e=>e.startsWith("onUpdate:"),dn=Object.assign,Af=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},sw=Object.prototype.hasOwnProperty,xt=(e,t)=>sw.call(e,t),Je=Array.isArray,vi=e=>Ba(e)==="[object Map]",$i=e=>Ba(e)==="[object Set]",Lp=e=>Ba(e)==="[object Date]",rt=e=>typeof e=="function",Vt=e=>typeof e=="string",Ur=e=>typeof e=="symbol",Rt=e=>e!==null&&typeof e=="object",Hg=e=>(Rt(e)||rt(e))&&rt(e.then)&&rt(e.catch),Wg=Object.prototype.toString,Ba=e=>Wg.call(e),iw=e=>Ba(e).slice(8,-1),Vg=e=>Ba(e)==="[object Object]",xf=e=>Vt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,fa=Cf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wc=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},aw=/-\w/g,Jn=wc(e=>e.replace(aw,t=>t.slice(1).toUpperCase())),lw=/\B([A-Z])/g,us=wc(e=>e.replace(lw,"-$1").toLowerCase()),Sc=wc(e=>e.charAt(0).toUpperCase()+e.slice(1)),Mu=wc(e=>e?`on${Sc(e)}`:""),io=(e,t)=>!Object.is(e,t),Dl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},zg=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Tc=e=>{const t=parseFloat(e);return isNaN(t)?e:t},cw=e=>{const t=Vt(e)?Number(e):NaN;return isNaN(t)?e:t};let Dp;const Ec=()=>Dp||(Dp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ko(e){if(Je(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Vt(r)?pw(r):ko(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Vt(e)||Rt(e))return e}const uw=/;(?![^(]*\))/g,dw=/:([^]+)/,fw=/\/\*[^]*?\*\//g;function pw(e){const t={};return e.replace(fw,"").split(uw).forEach(n=>{if(n){const r=n.split(dw);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function pt(e){let t="";if(Vt(e))t=e;else if(Je(e))for(let n=0;n<e.length;n++){const r=pt(e[n]);r&&(t+=r+" ")}else if(Rt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const hw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mw=Cf(hw);function Gg(e){return!!e||e===""}function gw(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ni(e[r],t[r]);return n}function Ni(e,t){if(e===t)return!0;let n=Lp(e),r=Lp(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Ur(e),r=Ur(t),n||r)return e===t;if(n=Je(e),r=Je(t),n||r)return n&&r?gw(e,t):!1;if(n=Rt(e),r=Rt(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,s=Object.keys(t).length;if(o!==s)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!Ni(e[i],t[i]))return!1}}return String(e)===String(t)}function Rf(e,t){return e.findIndex(n=>Ni(n,t))}const Kg=e=>!!(e&&e.__v_isRef===!0),ue=e=>Vt(e)?e:e==null?"":Je(e)||Rt(e)&&(e.toString===Wg||!rt(e.toString))?Kg(e)?ue(e.value):JSON.stringify(e,Yg,2):String(e),Yg=(e,t)=>Kg(t)?Yg(e,t.value):vi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[Pu(r,s)+" =>"]=o,n),{})}:$i(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Pu(n))}:Ur(t)?Pu(t):Rt(t)&&!Je(t)&&!Vg(t)?String(t):t,Pu=(e,t="")=>{var n;return Ur(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
7
|
-
* @vue/reactivity v3.5.32
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let nr;class vw{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=nr,!t&&nr&&(this.index=(nr.scopes||(nr.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=nr;try{return nr=this,t()}finally{nr=n}}}on(){++this._on===1&&(this.prevScope=nr,nr=this)}off(){this._on>0&&--this._on===0&&(nr=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 o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function yw(){return nr}let jt;const $u=new WeakSet;class Jg{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,nr&&nr.active&&nr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,$u.has(this)&&($u.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Qg(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,jp(this),Zg(this);const t=jt,n=Fr;jt=this,Fr=!0;try{return this.fn()}finally{ev(this),jt=t,Fr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)$f(t);this.deps=this.depsTail=void 0,jp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?$u.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Md(this)&&this.run()}get dirty(){return Md(this)}}let Xg=0,pa,ha;function Qg(e,t=!1){if(e.flags|=8,t){e.next=ha,ha=e;return}e.next=pa,pa=e}function Mf(){Xg++}function Pf(){if(--Xg>0)return;if(ha){let t=ha;for(ha=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;pa;){let t=pa;for(pa=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 Zg(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ev(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),$f(r),_w(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Md(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(tv(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function tv(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ta)||(e.globalVersion=Ta,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Md(e))))return;e.flags|=2;const t=e.dep,n=jt,r=Fr;jt=e,Fr=!0;try{Zg(e);const o=e.fn(e._value);(t.version===0||io(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{jt=n,Fr=r,ev(e),e.flags&=-3}}function $f(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)$f(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _w(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Fr=!0;const nv=[];function Ro(){nv.push(Fr),Fr=!1}function Mo(){const e=nv.pop();Fr=e===void 0?!0:e}function jp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=jt;jt=void 0;try{t()}finally{jt=n}}}let Ta=0;class bw{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 Nf{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(!jt||!Fr||jt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==jt)n=this.activeLink=new bw(jt,this),jt.deps?(n.prevDep=jt.depsTail,jt.depsTail.nextDep=n,jt.depsTail=n):jt.deps=jt.depsTail=n,rv(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=jt.depsTail,n.nextDep=void 0,jt.depsTail.nextDep=n,jt.depsTail=n,jt.deps===n&&(jt.deps=r)}return n}trigger(t){this.version++,Ta++,this.notify(t)}notify(t){Mf();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Pf()}}}function rv(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)rv(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Pd=new WeakMap,Ds=Symbol(""),$d=Symbol(""),Ea=Symbol("");function Pn(e,t,n){if(Fr&&jt){let r=Pd.get(e);r||Pd.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Nf),o.map=r,o.key=n),o.track()}}function To(e,t,n,r,o,s){const i=Pd.get(e);if(!i){Ta++;return}const a=l=>{l&&l.trigger()};if(Mf(),t==="clear")i.forEach(a);else{const l=Je(e),u=l&&xf(n);if(l&&n==="length"){const d=Number(r);i.forEach((f,m)=>{(m==="length"||m===Ea||!Ur(m)&&m>=d)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Ea)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Ds)),vi(e)&&a(i.get($d)));break;case"delete":l||(a(i.get(Ds)),vi(e)&&a(i.get($d)));break;case"set":vi(e)&&a(i.get(Ds));break}}Pf()}function si(e){const t=Tt(e);return t===e?t:(Pn(t,"iterate",Ea),Er(e)?t:t.map(qr))}function kc(e){return Pn(e=Tt(e),"iterate",Ea),e}function oo(e,t){return Po(e)?Si(js(e)?qr(t):t):qr(t)}const ww={__proto__:null,[Symbol.iterator](){return Nu(this,Symbol.iterator,e=>oo(this,e))},concat(...e){return si(this).concat(...e.map(t=>Je(t)?si(t):t))},entries(){return Nu(this,"entries",e=>(e[1]=oo(this,e[1]),e))},every(e,t){return go(this,"every",e,t,void 0,arguments)},filter(e,t){return go(this,"filter",e,t,n=>n.map(r=>oo(this,r)),arguments)},find(e,t){return go(this,"find",e,t,n=>oo(this,n),arguments)},findIndex(e,t){return go(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return go(this,"findLast",e,t,n=>oo(this,n),arguments)},findLastIndex(e,t){return go(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return go(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ou(this,"includes",e)},indexOf(...e){return Ou(this,"indexOf",e)},join(e){return si(this).join(e)},lastIndexOf(...e){return Ou(this,"lastIndexOf",e)},map(e,t){return go(this,"map",e,t,void 0,arguments)},pop(){return oa(this,"pop")},push(...e){return oa(this,"push",e)},reduce(e,...t){return Fp(this,"reduce",e,t)},reduceRight(e,...t){return Fp(this,"reduceRight",e,t)},shift(){return oa(this,"shift")},some(e,t){return go(this,"some",e,t,void 0,arguments)},splice(...e){return oa(this,"splice",e)},toReversed(){return si(this).toReversed()},toSorted(e){return si(this).toSorted(e)},toSpliced(...e){return si(this).toSpliced(...e)},unshift(...e){return oa(this,"unshift",e)},values(){return Nu(this,"values",e=>oo(this,e))}};function Nu(e,t,n){const r=kc(e),o=r[t]();return r!==e&&!Er(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Sw=Array.prototype;function go(e,t,n,r,o,s){const i=kc(e),a=i!==e&&!Er(e),l=i[t];if(l!==Sw[t]){const f=l.apply(e,s);return a?qr(f):f}let u=n;i!==e&&(a?u=function(f,m){return n.call(this,oo(e,f),m,e)}:n.length>2&&(u=function(f,m){return n.call(this,f,m,e)}));const d=l.call(i,u,r);return a&&o?o(d):d}function Fp(e,t,n,r){const o=kc(e),s=o!==e&&!Er(e);let i=n,a=!1;o!==e&&(s?(a=r.length===0,i=function(u,d,f){return a&&(a=!1,u=oo(e,u)),n.call(this,u,oo(e,d),f,e)}):n.length>3&&(i=function(u,d,f){return n.call(this,u,d,f,e)}));const l=o[t](i,...r);return a?oo(e,l):l}function Ou(e,t,n){const r=Tt(e);Pn(r,"iterate",Ea);const o=r[t](...n);return(o===-1||o===!1)&&Df(n[0])?(n[0]=Tt(n[0]),r[t](...n)):o}function oa(e,t,n=[]){Ro(),Mf();const r=Tt(e)[t].apply(e,n);return Pf(),Mo(),r}const Tw=Cf("__proto__,__v_isRef,__isVue"),ov=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ur));function Ew(e){Ur(e)||(e=String(e));const t=Tt(this);return Pn(t,"has",e),t.hasOwnProperty(e)}class sv{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?Nw:cv:s?lv:av).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Je(t);if(!o){let l;if(i&&(l=ww[n]))return l;if(n==="hasOwnProperty")return Ew}const a=Reflect.get(t,n,Ln(t)?t:r);if((Ur(n)?ov.has(n):Tw(n))||(o||Pn(t,"get",n),s))return a;if(Ln(a)){const l=i&&xf(n)?a:a.value;return o&&Rt(l)?Od(l):l}return Rt(a)?o?Od(a):Ic(a):a}}class iv extends sv{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=Je(t)&&xf(n);if(!this._isShallow){const u=Po(s);if(!Er(r)&&!Po(r)&&(s=Tt(s),r=Tt(r)),!i&&Ln(s)&&!Ln(r))return u||(s.value=r),!0}const a=i?Number(n)<t.length:xt(t,n),l=Reflect.set(t,n,r,Ln(t)?t:o);return t===Tt(o)&&(a?io(r,s)&&To(t,"set",n,r):To(t,"add",n,r)),l}deleteProperty(t,n){const r=xt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&To(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!Ur(n)||!ov.has(n))&&Pn(t,"has",n),r}ownKeys(t){return Pn(t,"iterate",Je(t)?"length":Ds),Reflect.ownKeys(t)}}class kw extends sv{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Iw=new iv,Cw=new kw,Aw=new iv(!0);const Nd=e=>e,wl=e=>Reflect.getPrototypeOf(e);function xw(e,t,n){return function(...r){const o=this.__v_raw,s=Tt(o),i=vi(s),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=o[e](...r),d=n?Nd:t?Si:qr;return!t&&Pn(s,"iterate",l?$d:Ds),dn(Object.create(u),{next(){const{value:f,done:m}=u.next();return m?{value:f,done:m}:{value:a?[d(f[0]),d(f[1])]:d(f),done:m}}})}}function Sl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Rw(e,t){const n={get(o){const s=this.__v_raw,i=Tt(s),a=Tt(o);e||(io(o,a)&&Pn(i,"get",o),Pn(i,"get",a));const{has:l}=wl(i),u=t?Nd:e?Si:qr;if(l.call(i,o))return u(s.get(o));if(l.call(i,a))return u(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Pn(Tt(o),"iterate",Ds),o.size},has(o){const s=this.__v_raw,i=Tt(s),a=Tt(o);return e||(io(o,a)&&Pn(i,"has",o),Pn(i,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){const i=this,a=i.__v_raw,l=Tt(a),u=t?Nd:e?Si:qr;return!e&&Pn(l,"iterate",Ds),a.forEach((d,f)=>o.call(s,u(d),u(f),i))}};return dn(n,e?{add:Sl("add"),set:Sl("set"),delete:Sl("delete"),clear:Sl("clear")}:{add(o){const s=Tt(this),i=wl(s),a=Tt(o),l=!t&&!Er(o)&&!Po(o)?a:o;return i.has.call(s,l)||io(o,l)&&i.has.call(s,o)||io(a,l)&&i.has.call(s,a)||(s.add(l),To(s,"add",l,l)),this},set(o,s){!t&&!Er(s)&&!Po(s)&&(s=Tt(s));const i=Tt(this),{has:a,get:l}=wl(i);let u=a.call(i,o);u||(o=Tt(o),u=a.call(i,o));const d=l.call(i,o);return i.set(o,s),u?io(s,d)&&To(i,"set",o,s):To(i,"add",o,s),this},delete(o){const s=Tt(this),{has:i,get:a}=wl(s);let l=i.call(s,o);l||(o=Tt(o),l=i.call(s,o)),a&&a.call(s,o);const u=s.delete(o);return l&&To(s,"delete",o,void 0),u},clear(){const o=Tt(this),s=o.size!==0,i=o.clear();return s&&To(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=xw(o,e,t)}),n}function Of(e,t){const n=Rw(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(xt(n,o)&&o in r?n:r,o,s)}const Mw={get:Of(!1,!1)},Pw={get:Of(!1,!0)},$w={get:Of(!0,!1)};const av=new WeakMap,lv=new WeakMap,cv=new WeakMap,Nw=new WeakMap;function Ow(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Lw(e){return e.__v_skip||!Object.isExtensible(e)?0:Ow(iw(e))}function Ic(e){return Po(e)?e:Lf(e,!1,Iw,Mw,av)}function uv(e){return Lf(e,!1,Aw,Pw,lv)}function Od(e){return Lf(e,!0,Cw,$w,cv)}function Lf(e,t,n,r,o){if(!Rt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Lw(e);if(s===0)return e;const i=o.get(e);if(i)return i;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function js(e){return Po(e)?js(e.__v_raw):!!(e&&e.__v_isReactive)}function Po(e){return!!(e&&e.__v_isReadonly)}function Er(e){return!!(e&&e.__v_isShallow)}function Df(e){return e?!!e.__v_raw:!1}function Tt(e){const t=e&&e.__v_raw;return t?Tt(t):e}function Dw(e){return!xt(e,"__v_skip")&&Object.isExtensible(e)&&zg(e,"__v_skip",!0),e}const qr=e=>Rt(e)?Ic(e):e,Si=e=>Rt(e)?Od(e):e;function Ln(e){return e?e.__v_isRef===!0:!1}function N(e){return dv(e,!1)}function jw(e){return dv(e,!0)}function dv(e,t){return Ln(e)?e:new Fw(e,t)}class Fw{constructor(t,n){this.dep=new Nf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Tt(t),this._value=n?t:qr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Er(t)||Po(t);t=r?t:Tt(t),io(t,n)&&(this._rawValue=t,this._value=r?t:qr(t),this.dep.trigger())}}function He(e){return Ln(e)?e.value:e}const Bw={get:(e,t,n)=>t==="__v_raw"?e:He(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ln(o)&&!Ln(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function fv(e){return js(e)?e:new Proxy(e,Bw)}class Uw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Nf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ta-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&jt!==this)return Qg(this,!0),!0}get value(){const t=this.dep.track();return tv(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qw(e,t,n=!1){let r,o;return rt(e)?r=e:(r=e.get,o=e.set),new Uw(r,o,n)}const Tl={},Ql=new WeakMap;let xs;function Hw(e,t=!1,n=xs){if(n){let r=Ql.get(n);r||Ql.set(n,r=[]),r.push(e)}}function Ww(e,t,n=Lt){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,u=K=>o?K:Er(K)||o===!1||o===0?Eo(K,1):Eo(K);let d,f,m,v,E=!1,C=!1;if(Ln(e)?(f=()=>e.value,E=Er(e)):js(e)?(f=()=>u(e),E=!0):Je(e)?(C=!0,E=e.some(K=>js(K)||Er(K)),f=()=>e.map(K=>{if(Ln(K))return K.value;if(js(K))return u(K);if(rt(K))return l?l(K,2):K()})):rt(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){Ro();try{m()}finally{Mo()}}const K=xs;xs=d;try{return l?l(e,3,[v]):e(v)}finally{xs=K}}:f=lo,t&&o){const K=f,de=o===!0?1/0:o;f=()=>Eo(K(),de)}const H=yw(),M=()=>{d.stop(),H&&H.active&&Af(H.effects,d)};if(s&&t){const K=t;t=(...de)=>{K(...de),M()}}let O=C?new Array(e.length).fill(Tl):Tl;const V=K=>{if(!(!(d.flags&1)||!d.dirty&&!K))if(t){const de=d.run();if(o||E||(C?de.some((oe,ee)=>io(oe,O[ee])):io(de,O))){m&&m();const oe=xs;xs=d;try{const ee=[de,O===Tl?void 0:C&&O[0]===Tl?[]:O,v];O=de,l?l(t,3,ee):t(...ee)}finally{xs=oe}}}else d.run()};return a&&a(V),d=new Jg(f),d.scheduler=i?()=>i(V,!1):V,v=K=>Hw(K,!1,d),m=d.onStop=()=>{const K=Ql.get(d);if(K){if(l)l(K,4);else for(const de of K)de();Ql.delete(d)}},t?r?V(!0):O=d.run():i?i(V.bind(null,!0),!0):d.run(),M.pause=d.pause.bind(d),M.resume=d.resume.bind(d),M.stop=M,M}function Eo(e,t=1/0,n){if(t<=0||!Rt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ln(e))Eo(e.value,t,n);else if(Je(e))for(let r=0;r<e.length;r++)Eo(e[r],t,n);else if($i(e)||vi(e))e.forEach(r=>{Eo(r,t,n)});else if(Vg(e)){for(const r in e)Eo(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Eo(e[r],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.32
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/function Ua(e,t,n,r){try{return r?e(...r):e()}catch(o){qa(o,t,n)}}function Hr(e,t,n,r){if(rt(e)){const o=Ua(e,t,n,r);return o&&Hg(o)&&o.catch(s=>{qa(s,t,n)}),o}if(Je(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Hr(e[s],t,n,r));return o}}function qa(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Lt;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const d=a.ec;if(d){for(let f=0;f<d.length;f++)if(d[f](e,l,u)===!1)return}a=a.parent}if(s){Ro(),Ua(s,null,10,[e,l,u]),Mo();return}}Vw(e,n,o,r,i)}function Vw(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Yn=[];let no=-1;const yi=[];let Qo=null,ui=0;const pv=Promise.resolve();let Zl=null;function Jt(e){const t=Zl||pv;return e?t.then(this?e.bind(this):e):t}function zw(e){let t=no+1,n=Yn.length;for(;t<n;){const r=t+n>>>1,o=Yn[r],s=ka(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function jf(e){if(!(e.flags&1)){const t=ka(e),n=Yn[Yn.length-1];!n||!(e.flags&2)&&t>=ka(n)?Yn.push(e):Yn.splice(zw(t),0,e),e.flags|=1,hv()}}function hv(){Zl||(Zl=pv.then(gv))}function Gw(e){Je(e)?yi.push(...e):Qo&&e.id===-1?Qo.splice(ui+1,0,e):e.flags&1||(yi.push(e),e.flags|=1),hv()}function Bp(e,t,n=no+1){for(;n<Yn.length;n++){const r=Yn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Yn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function mv(e){if(yi.length){const t=[...new Set(yi)].sort((n,r)=>ka(n)-ka(r));if(yi.length=0,Qo){Qo.push(...t);return}for(Qo=t,ui=0;ui<Qo.length;ui++){const n=Qo[ui];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Qo=null,ui=0}}const ka=e=>e.id==null?e.flags&2?-1:1/0:e.id;function gv(e){try{for(no=0;no<Yn.length;no++){const t=Yn[no];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ua(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;no<Yn.length;no++){const t=Yn[no];t&&(t.flags&=-2)}no=-1,Yn.length=0,mv(),Zl=null,(Yn.length||yi.length)&&gv()}}let kn=null,vv=null;function ec(e){const t=kn;return kn=e,vv=e&&e.type.__scopeId||null,t}function Ct(e,t=kn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&rc(-1);const s=ec(t);let i;try{i=e(...o)}finally{ec(s),r._d&&rc(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Kn(e,t){if(kn===null)return e;const n=Mc(kn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,a,l=Lt]=t[o];s&&(rt(s)&&(s={mounted:s,updated:s}),s.deep&&Eo(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ts(e,t,n,r){const o=e.dirs,s=t&&t.dirs;for(let i=0;i<o.length;i++){const a=o[i];s&&(a.oldValue=s[i].value);let l=a.dir[r];l&&(Ro(),Hr(l,n,8,[e.el,a,e,t]),Mo())}}function jl(e,t){if(En){let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[e]=t}}function Br(e,t,n=!1){const r=Vf();if(r||bi){let o=bi?bi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&rt(t)?t.call(r&&r.proxy):t}}const Kw=Symbol.for("v-scx"),Yw=()=>Br(Kw);function ut(e,t,n){return yv(e,t,n)}function yv(e,t,n=Lt){const{immediate:r,deep:o,flush:s,once:i}=n,a=dn({},n),l=t&&r||!t&&s!=="post";let u;if(Ti){if(s==="sync"){const v=Yw();u=v.__watcherHandles||(v.__watcherHandles=[])}else if(!l){const v=()=>{};return v.stop=lo,v.resume=lo,v.pause=lo,v}}const d=En;a.call=(v,E,C)=>Hr(v,d,E,C);let f=!1;s==="post"?a.scheduler=v=>{zn(v,d&&d.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(v,E)=>{E?v():jf(v)}),a.augmentJob=v=>{t&&(v.flags|=4),f&&(v.flags|=2,d&&(v.id=d.uid,v.i=d))};const m=Ww(e,t,a);return Ti&&(u?u.push(m):l&&m()),m}function Jw(e,t,n){const r=this.proxy,o=Vt(e)?e.includes(".")?_v(r,e):()=>r[e]:e.bind(r,r);let s;rt(t)?s=t:(s=t.handler,n=t);const i=Wa(this),a=yv(o,s.bind(r),n);return i(),a}function _v(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Es=new WeakMap,bv=Symbol("_vte"),wv=e=>e.__isTeleport,Ps=e=>e&&(e.disabled||e.disabled===""),Xw=e=>e&&(e.defer||e.defer===""),Up=e=>typeof SVGElement<"u"&&e instanceof SVGElement,qp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ld=(e,t)=>{const n=e&&e.to;return Vt(n)?t?t(n):null:n},Qw={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,a,l,u){const{mc:d,pc:f,pbc:m,o:{insert:v,querySelector:E,createText:C,createComment:H}}=u,M=Ps(t.props);let{dynamicChildren:O}=t;const V=(oe,ee,ve)=>{oe.shapeFlag&16&&d(oe.children,ee,ve,o,s,i,a,l)},K=(oe=t)=>{const ee=Ps(oe.props),ve=oe.target=Ld(oe.props,E),Pe=Dd(ve,oe,C,v);ve&&(i!=="svg"&&Up(ve)?i="svg":i!=="mathml"&&qp(ve)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(ve),ee||(V(oe,ve,Pe),ua(oe,!1)))},de=oe=>{const ee=()=>{Es.get(oe)===ee&&(Es.delete(oe),Ps(oe.props)&&(V(oe,n,oe.anchor),ua(oe,!0)),K(oe))};Es.set(oe,ee),zn(ee,s)};if(e==null){const oe=t.el=C(""),ee=t.anchor=C("");if(v(oe,n,r),v(ee,n,r),Xw(t.props)||s&&s.pendingBranch){de(t);return}M&&(V(t,n,ee),ua(t,!0)),K()}else{t.el=e.el;const oe=t.anchor=e.anchor,ee=Es.get(e);if(ee){ee.flags|=8,Es.delete(e),de(t);return}t.targetStart=e.targetStart;const ve=t.target=e.target,Pe=t.targetAnchor=e.targetAnchor,Re=Ps(e.props),De=Re?n:ve,Q=Re?oe:Pe;if(i==="svg"||Up(ve)?i="svg":(i==="mathml"||qp(ve))&&(i="mathml"),O?(m(e.dynamicChildren,O,De,o,s,i,a),Hf(e,t,!0)):l||f(e,t,De,Q,o,s,i,a,!1),M)Re?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):El(t,n,oe,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const pe=t.target=Ld(t.props,E);pe&&El(t,pe,null,u,0)}else Re&&El(t,ve,Pe,u,1);ua(t,M)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:d,target:f,props:m}=e;let v=s||!Ps(m);const E=Es.get(e);if(E&&(E.flags|=8,Es.delete(e),v=!1),f&&(o(u),o(d)),s&&o(l),i&16)for(let C=0;C<a.length;C++){const H=a[C];r(H,t,n,v,!!H.dynamicChildren)}},move:El,hydrate:Zw};function El(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:d}=e,f=s===2;if(f&&r(i,t,n),(!f||Ps(d))&&l&16)for(let m=0;m<u.length;m++)o(u[m],t,n,2);f&&r(a,t,n)}function Zw(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:d}},f){function m(H,M){let O=M;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function v(H,M){M.anchor=f(i(H),M,a(H),n,r,o,s)}const E=t.target=Ld(t.props,l),C=Ps(t.props);if(E){const H=E._lpa||E.firstChild;t.shapeFlag&16&&(C?(v(e,t),m(E,H),t.targetAnchor||Dd(E,t,d,u,a(e)===E?e:null)):(t.anchor=i(e),m(E,H),t.targetAnchor||Dd(E,t,d,u),f(H&&i(H),t,E,n,r,o,s))),ua(t,C)}else C&&t.shapeFlag&16&&(v(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const ma=Qw;function ua(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Dd(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[bv]=i,e&&(r(s,e,o),r(i,e,o)),i}const ro=Symbol("_leaveCb"),sa=Symbol("_enterCb");function eS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ds(()=>{e.isMounted=!0}),Vs(()=>{e.isUnmounting=!0}),e}const wr=[Function,Array],Sv={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:wr,onEnter:wr,onAfterEnter:wr,onEnterCancelled:wr,onBeforeLeave:wr,onLeave:wr,onAfterLeave:wr,onLeaveCancelled:wr,onBeforeAppear:wr,onAppear:wr,onAfterAppear:wr,onAppearCancelled:wr},Tv=e=>{const t=e.subTree;return t.component?Tv(t.component):t},tS={name:"BaseTransition",props:Sv,setup(e,{slots:t}){const n=Vf(),r=eS();return()=>{const o=t.default&&Iv(t.default(),!0);if(!o||!o.length)return;const s=Ev(o),i=Tt(e),{mode:a}=i;if(r.isLeaving)return Lu(s);const l=Hp(s);if(!l)return Lu(s);let u=jd(l,i,r,n,f=>u=f);l.type!==Nn&&Ia(l,u);let d=n.subTree&&Hp(n.subTree);if(d&&d.type!==Nn&&!$s(d,l)&&Tv(n).type!==Nn){let f=jd(d,i,r,n);if(Ia(d,f),a==="out-in"&&l.type!==Nn)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,d=void 0},Lu(s);a==="in-out"&&l.type!==Nn?f.delayLeave=(m,v,E)=>{const C=kv(r,d);C[String(d.key)]=d,m[ro]=()=>{v(),m[ro]=void 0,delete u.delayedLeave,d=void 0},u.delayedLeave=()=>{E(),delete u.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function Ev(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nn){t=n;break}}return t}const nS=tS;function kv(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 jd(e,t,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:d,onEnterCancelled:f,onBeforeLeave:m,onLeave:v,onAfterLeave:E,onLeaveCancelled:C,onBeforeAppear:H,onAppear:M,onAfterAppear:O,onAppearCancelled:V}=t,K=String(e.key),de=kv(n,e),oe=(Pe,Re)=>{Pe&&Hr(Pe,r,9,Re)},ee=(Pe,Re)=>{const De=Re[1];oe(Pe,Re),Je(Pe)?Pe.every(Q=>Q.length<=1)&&De():Pe.length<=1&&De()},ve={mode:i,persisted:a,beforeEnter(Pe){let Re=l;if(!n.isMounted)if(s)Re=H||l;else return;Pe[ro]&&Pe[ro](!0);const De=de[K];De&&$s(e,De)&&De.el[ro]&&De.el[ro](),oe(Re,[Pe])},enter(Pe){if(de[K]===e)return;let Re=u,De=d,Q=f;if(!n.isMounted)if(s)Re=M||u,De=O||d,Q=V||f;else return;let pe=!1;Pe[sa]=qe=>{pe||(pe=!0,qe?oe(Q,[Pe]):oe(De,[Pe]),ve.delayedLeave&&ve.delayedLeave(),Pe[sa]=void 0)};const Me=Pe[sa].bind(null,!1);Re?ee(Re,[Pe,Me]):Me()},leave(Pe,Re){const De=String(e.key);if(Pe[sa]&&Pe[sa](!0),n.isUnmounting)return Re();oe(m,[Pe]);let Q=!1;Pe[ro]=Me=>{Q||(Q=!0,Re(),Me?oe(C,[Pe]):oe(E,[Pe]),Pe[ro]=void 0,de[De]===e&&delete de[De])};const pe=Pe[ro].bind(null,!1);de[De]=e,v?ee(v,[Pe,pe]):pe()},clone(Pe){const Re=jd(Pe,t,n,r,o);return o&&o(Re),Re}};return ve}function Lu(e){if(Ha(e))return e=is(e),e.children=null,e}function Hp(e){if(!Ha(e))return wv(e.type)&&e.children?Ev(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&&rt(n.default))return n.default()}}function Ia(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ia(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 Iv(e,t=!1,n){let r=[],o=0;for(let s=0;s<e.length;s++){let i=e[s];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:s);i.type===Qe?(i.patchFlag&128&&o++,r=r.concat(Iv(i.children,t,a))):(t||i.type!==Nn)&&r.push(a!=null?is(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function In(e,t){return rt(e)?dn({name:e.name},t,{setup:e}):e}function Ff(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Wp(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const tc=new WeakMap;function ga(e,t,n,r,o=!1){if(Je(e)){e.forEach((C,H)=>ga(C,t&&(Je(t)?t[H]:t),n,r,o));return}if(_i(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ga(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Mc(r.component):r.el,i=o?null:s,{i:a,r:l}=e,u=t&&t.r,d=a.refs===Lt?a.refs={}:a.refs,f=a.setupState,m=Tt(f),v=f===Lt?qg:C=>Wp(d,C)?!1:xt(m,C),E=(C,H)=>!(H&&Wp(d,H));if(u!=null&&u!==l){if(Vp(t),Vt(u))d[u]=null,v(u)&&(f[u]=null);else if(Ln(u)){const C=t;E(u,C.k)&&(u.value=null),C.k&&(d[C.k]=null)}}if(rt(l))Ua(l,a,12,[i,d]);else{const C=Vt(l),H=Ln(l);if(C||H){const M=()=>{if(e.f){const O=C?v(l)?f[l]:d[l]:E()||!e.k?l.value:d[e.k];if(o)Je(O)&&Af(O,s);else if(Je(O))O.includes(s)||O.push(s);else if(C)d[l]=[s],v(l)&&(f[l]=d[l]);else{const V=[s];E(l,e.k)&&(l.value=V),e.k&&(d[e.k]=V)}}else C?(d[l]=i,v(l)&&(f[l]=i)):H&&(E(l,e.k)&&(l.value=i),e.k&&(d[e.k]=i))};if(i){const O=()=>{M(),tc.delete(e)};O.id=-1,tc.set(e,O),zn(O,n)}else Vp(e),M()}}}function Vp(e){const t=tc.get(e);t&&(t.flags|=8,tc.delete(e))}const zp=e=>e.nodeType===8;Ec().requestIdleCallback;Ec().cancelIdleCallback;function rS(e,t){if(zp(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(zp(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const _i=e=>!!e.type.__asyncLoader;function Du(e){rt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:a=!0,onError:l}=e;let u=null,d,f=0;const m=()=>(f++,u=null,v()),v=()=>{let E;return u||(E=u=t().catch(C=>{if(C=C instanceof Error?C:new Error(String(C)),l)return new Promise((H,M)=>{l(C,()=>H(m()),()=>M(C),f+1)});throw C}).then(C=>E!==u&&u?u:(C&&(C.__esModule||C[Symbol.toStringTag]==="Module")&&(C=C.default),d=C,C)))};return In({name:"AsyncComponentWrapper",__asyncLoader:v,__asyncHydrate(E,C,H){let M=!1;(C.bu||(C.bu=[])).push(()=>M=!0);const O=()=>{M||H()},V=s?()=>{const K=s(O,de=>rS(E,de));K&&(C.bum||(C.bum=[])).push(K)}:O;d?V():v().then(()=>!C.isUnmounted&&V())},get __asyncResolved(){return d},setup(){const E=En;if(Ff(E),d)return()=>kl(d,E);const C=V=>{u=null,qa(V,E,13,!r)};if(a&&E.suspense||Ti)return v().then(V=>()=>kl(V,E)).catch(V=>(C(V),()=>r?ze(r,{error:V}):null));const H=N(!1),M=N(),O=N(!!o);return o&&setTimeout(()=>{O.value=!1},o),i!=null&&setTimeout(()=>{if(!H.value&&!M.value){const V=new Error(`Async component timed out after ${i}ms.`);C(V),M.value=V}},i),v().then(()=>{H.value=!0,E.parent&&Ha(E.parent.vnode)&&E.parent.update()}).catch(V=>{C(V),M.value=V}),()=>{if(H.value&&d)return kl(d,E);if(M.value&&r)return ze(r,{error:M.value});if(n&&!O.value)return kl(n,E)}}})}function kl(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=ze(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Ha=e=>e.type.__isKeepAlive;function oS(e,t){Cv(e,"a",t)}function sS(e,t){Cv(e,"da",t)}function Cv(e,t,n=En){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Cc(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Ha(o.parent.vnode)&&iS(r,t,n,o),o=o.parent}}function iS(e,t,n,r){const o=Cc(t,e,r,!0);Ac(()=>{Af(r[t],o)},n)}function Cc(e,t,n=En,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Ro();const a=Wa(n),l=Hr(t,n,e,i);return a(),Mo(),l});return r?o.unshift(s):o.push(s),s}}const jo=e=>(t,n=En)=>{(!Ti||e==="sp")&&Cc(e,(...r)=>t(...r),n)},aS=jo("bm"),ds=jo("m"),lS=jo("bu"),cS=jo("u"),Vs=jo("bum"),Ac=jo("um"),uS=jo("sp"),dS=jo("rtg"),fS=jo("rtc");function pS(e,t=En){Cc("ec",e,t)}const hS="components",Av=Symbol.for("v-ndc");function Bf(e){return Vt(e)?mS(hS,e,!1)||e:e||Av}function mS(e,t,n=!0,r=!1){const o=kn||En;if(o){const s=o.type;{const a=ZS(s,!1);if(a&&(a===t||a===Jn(t)||a===Sc(Jn(t))))return s}const i=Gp(o[e]||s[e],t)||Gp(o.appContext[e],t);return!i&&r?s:i}}function Gp(e,t){return e&&(e[t]||e[Jn(t)]||e[Sc(Jn(t))])}function Bt(e,t,n,r){let o;const s=n,i=Je(e);if(i||Vt(e)){const a=i&&js(e);let l=!1,u=!1;a&&(l=!Er(e),u=Po(e),e=kc(e)),o=new Array(e.length);for(let d=0,f=e.length;d<f;d++)o[d]=t(l?u?Si(qr(e[d])):qr(e[d]):e[d],d,void 0,s)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,s)}else if(Rt(e))if(e[Symbol.iterator])o=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);o=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const d=a[l];o[l]=t(e[d],d,l,s)}}else o=[];return o}function ao(e,t,n={},r,o){if(kn.ce||kn.parent&&_i(kn.parent)&&kn.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),A(),ht(Qe,null,[ze("slot",n,r)],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),A();const i=s&&xv(s(n)),a=n.key||i&&i.key,l=ht(Qe,{key:(a&&!Ur(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function xv(e){return e.some(t=>Aa(t)?!(t.type===Nn||t.type===Qe&&!xv(t.children)):!0)?e:null}const Fd=e=>e?Yv(e)?Mc(e):Fd(e.parent):null,va=dn(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=>Fd(e.parent),$root:e=>Fd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mv(e),$forceUpdate:e=>e.f||(e.f=()=>{jf(e.update)}),$nextTick:e=>e.n||(e.n=Jt.bind(e.proxy)),$watch:e=>Jw.bind(e)}),ju=(e,t)=>e!==Lt&&!e.__isScriptSetup&&xt(e,t),gS={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(ju(r,t))return i[t]=1,r[t];if(o!==Lt&&xt(o,t))return i[t]=2,o[t];if(xt(s,t))return i[t]=3,s[t];if(n!==Lt&&xt(n,t))return i[t]=4,n[t];Bd&&(i[t]=0)}}const u=va[t];let d,f;if(u)return t==="$attrs"&&Pn(e.attrs,"get",""),u(e);if((d=a.__cssModules)&&(d=d[t]))return d;if(n!==Lt&&xt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,xt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return ju(o,t)?(o[t]=n,!0):r!==Lt&&xt(r,t)?(r[t]=n,!0):xt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:s,type:i}},a){let l;return!!(n[a]||e!==Lt&&a[0]!=="$"&&xt(e,a)||ju(t,a)||xt(s,a)||xt(r,a)||xt(va,a)||xt(o.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:xt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function vS(){return yS().slots}function yS(e){const t=Vf();return t.setupContext||(t.setupContext=Xv(t))}function Kp(e){return Je(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Bd=!0;function _S(e){const t=Mv(e),n=e.proxy,r=e.ctx;Bd=!1,t.beforeCreate&&Yp(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:u,created:d,beforeMount:f,mounted:m,beforeUpdate:v,updated:E,activated:C,deactivated:H,beforeDestroy:M,beforeUnmount:O,destroyed:V,unmounted:K,render:de,renderTracked:oe,renderTriggered:ee,errorCaptured:ve,serverPrefetch:Pe,expose:Re,inheritAttrs:De,components:Q,directives:pe,filters:Me}=t;if(u&&bS(u,r,null),i)for(const Te in i){const le=i[Te];rt(le)&&(r[Te]=le.bind(n))}if(o){const Te=o.call(n,n);Rt(Te)&&(e.data=Ic(Te))}if(Bd=!0,s)for(const Te in s){const le=s[Te],Ee=rt(le)?le.bind(n,n):rt(le.get)?le.get.bind(n,n):lo,Fe=!rt(le)&&rt(le.set)?le.set.bind(n):lo,Ne=ie({get:Ee,set:Fe});Object.defineProperty(r,Te,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:Ge=>Ne.value=Ge})}if(a)for(const Te in a)Rv(a[Te],r,n,Te);if(l){const Te=rt(l)?l.call(n):l;Reflect.ownKeys(Te).forEach(le=>{jl(le,Te[le])})}d&&Yp(d,e,"c");function _e(Te,le){Je(le)?le.forEach(Ee=>Te(Ee.bind(n))):le&&Te(le.bind(n))}if(_e(aS,f),_e(ds,m),_e(lS,v),_e(cS,E),_e(oS,C),_e(sS,H),_e(pS,ve),_e(fS,oe),_e(dS,ee),_e(Vs,O),_e(Ac,K),_e(uS,Pe),Je(Re))if(Re.length){const Te=e.exposed||(e.exposed={});Re.forEach(le=>{Object.defineProperty(Te,le,{get:()=>n[le],set:Ee=>n[le]=Ee,enumerable:!0})})}else e.exposed||(e.exposed={});de&&e.render===lo&&(e.render=de),De!=null&&(e.inheritAttrs=De),Q&&(e.components=Q),pe&&(e.directives=pe),Pe&&Ff(e)}function bS(e,t,n=lo){Je(e)&&(e=Ud(e));for(const r in e){const o=e[r];let s;Rt(o)?"default"in o?s=Br(o.from||r,o.default,!0):s=Br(o.from||r):s=Br(o),Ln(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):t[r]=s}}function Yp(e,t,n){Hr(Je(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Rv(e,t,n,r){let o=r.includes(".")?_v(n,r):()=>n[r];if(Vt(e)){const s=t[e];rt(s)&&ut(o,s)}else if(rt(e))ut(o,e.bind(n));else if(Rt(e))if(Je(e))e.forEach(s=>Rv(s,t,n,r));else{const s=rt(e.handler)?e.handler.bind(n):t[e.handler];rt(s)&&ut(o,s,e)}}function Mv(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,a=s.get(t);let l;return a?l=a:!o.length&&!n&&!r?l=t:(l={},o.length&&o.forEach(u=>nc(l,u,i,!0)),nc(l,t,i)),Rt(t)&&s.set(t,l),l}function nc(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&nc(e,s,n,!0),o&&o.forEach(i=>nc(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=wS[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const wS={data:Jp,props:Xp,emits:Xp,methods:da,computed:da,beforeCreate:Vn,created:Vn,beforeMount:Vn,mounted:Vn,beforeUpdate:Vn,updated:Vn,beforeDestroy:Vn,beforeUnmount:Vn,destroyed:Vn,unmounted:Vn,activated:Vn,deactivated:Vn,errorCaptured:Vn,serverPrefetch:Vn,components:da,directives:da,watch:TS,provide:Jp,inject:SS};function Jp(e,t){return t?e?function(){return dn(rt(e)?e.call(this,this):e,rt(t)?t.call(this,this):t)}:t:e}function SS(e,t){return da(Ud(e),Ud(t))}function Ud(e){if(Je(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Vn(e,t){return e?[...new Set([].concat(e,t))]:t}function da(e,t){return e?dn(Object.create(null),e,t):t}function Xp(e,t){return e?Je(e)&&Je(t)?[...new Set([...e,...t])]:dn(Object.create(null),Kp(e),Kp(t??{})):t}function TS(e,t){if(!e)return t;if(!t)return e;const n=dn(Object.create(null),e);for(const r in t)n[r]=Vn(e[r],t[r]);return n}function Pv(){return{app:null,config:{isNativeTag:qg,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 ES=0;function kS(e,t){return function(r,o=null){rt(r)||(r=dn({},r)),o!=null&&!Rt(o)&&(o=null);const s=Pv(),i=new WeakSet,a=[];let l=!1;const u=s.app={_uid:ES++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:tT,get config(){return s.config},set config(d){},use(d,...f){return i.has(d)||(d&&rt(d.install)?(i.add(d),d.install(u,...f)):rt(d)&&(i.add(d),d(u,...f))),u},mixin(d){return s.mixins.includes(d)||s.mixins.push(d),u},component(d,f){return f?(s.components[d]=f,u):s.components[d]},directive(d,f){return f?(s.directives[d]=f,u):s.directives[d]},mount(d,f,m){if(!l){const v=u._ceVNode||ze(r,o);return v.appContext=s,m===!0?m="svg":m===!1&&(m=void 0),e(v,d,m),l=!0,u._container=d,d.__vue_app__=u,Mc(v.component)}},onUnmount(d){a.push(d)},unmount(){l&&(Hr(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(d,f){return s.provides[d]=f,u},runWithContext(d){const f=bi;bi=u;try{return d()}finally{bi=f}}};return u}}let bi=null;const IS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Jn(t)}Modifiers`]||e[`${us(t)}Modifiers`];function CS(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Lt;let o=n;const s=t.startsWith("update:"),i=s&&IS(r,t.slice(7));i&&(i.trim&&(o=n.map(d=>Vt(d)?d.trim():d)),i.number&&(o=n.map(Tc)));let a,l=r[a=Mu(t)]||r[a=Mu(Jn(t))];!l&&s&&(l=r[a=Mu(us(t))]),l&&Hr(l,e,6,o);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Hr(u,e,6,o)}}const AS=new WeakMap;function $v(e,t,n=!1){const r=n?AS:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!rt(e)){const l=u=>{const d=$v(u,t,!0);d&&(a=!0,dn(i,d))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(Rt(e)&&r.set(e,null),null):(Je(s)?s.forEach(l=>i[l]=null):dn(i,s),Rt(e)&&r.set(e,i),i)}function xc(e,t){return!e||!_c(t)?!1:(t=t.slice(2).replace(/Once$/,""),xt(e,t[0].toLowerCase()+t.slice(1))||xt(e,us(t))||xt(e,t))}function Qp(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:u,renderCache:d,props:f,data:m,setupState:v,ctx:E,inheritAttrs:C}=e,H=ec(e);let M,O;try{if(n.shapeFlag&4){const K=o||r,de=K;M=so(u.call(de,K,d,f,v,m,E)),O=a}else{const K=t;M=so(K.length>1?K(f,{attrs:a,slots:i,emit:l}):K(f,null)),O=t.props?a:xS(a)}}catch(K){ya.length=0,qa(K,e,1),M=ze(Nn)}let V=M;if(O&&C!==!1){const K=Object.keys(O),{shapeFlag:de}=V;K.length&&de&7&&(s&&K.some(bc)&&(O=RS(O,s)),V=is(V,O,!1,!0))}return n.dirs&&(V=is(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition&&Ia(V,n.transition),M=V,ec(H),M}const xS=e=>{let t;for(const n in e)(n==="class"||n==="style"||_c(n))&&((t||(t={}))[n]=e[n]);return t},RS=(e,t)=>{const n={};for(const r in e)(!bc(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function MS(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Zp(r,i,u):!!i;if(l&8){const d=t.dynamicProps;for(let f=0;f<d.length;f++){const m=d[f];if(Nv(i,r,m)&&!xc(u,m))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Zp(r,i,u):!0:!!i;return!1}function Zp(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(Nv(t,e,s)&&!xc(n,s))return!0}return!1}function Nv(e,t,n){const r=e[n],o=t[n];return n==="style"&&Rt(r)&&Rt(o)?!Ni(r,o):r!==o}function PS({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Ov={},Lv=()=>Object.create(Ov),Dv=e=>Object.getPrototypeOf(e)===Ov;function $S(e,t,n,r=!1){const o={},s=Lv();e.propsDefaults=Object.create(null),jv(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:uv(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function NS(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,a=Tt(o),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let f=0;f<d.length;f++){let m=d[f];if(xc(e.emitsOptions,m))continue;const v=t[m];if(l)if(xt(s,m))v!==s[m]&&(s[m]=v,u=!0);else{const E=Jn(m);o[E]=qd(l,a,E,v,e,!1)}else v!==s[m]&&(s[m]=v,u=!0)}}}else{jv(e,t,o,s)&&(u=!0);let d;for(const f in a)(!t||!xt(t,f)&&((d=us(f))===f||!xt(t,d)))&&(l?n&&(n[f]!==void 0||n[d]!==void 0)&&(o[f]=qd(l,a,f,void 0,e,!0)):delete o[f]);if(s!==a)for(const f in s)(!t||!xt(t,f))&&(delete s[f],u=!0)}u&&To(e.attrs,"set","")}function jv(e,t,n,r){const[o,s]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(fa(l))continue;const u=t[l];let d;o&&xt(o,d=Jn(l))?!s||!s.includes(d)?n[d]=u:(a||(a={}))[d]=u:xc(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(s){const l=Tt(n),u=a||Lt;for(let d=0;d<s.length;d++){const f=s[d];n[f]=qd(o,l,f,u[f],e,!xt(u,f))}}return i}function qd(e,t,n,r,o,s){const i=e[n];if(i!=null){const a=xt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&rt(l)){const{propsDefaults:u}=o;if(n in u)r=u[n];else{const d=Wa(o);r=u[n]=l.call(null,t),d()}}else r=l;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!a?r=!1:i[1]&&(r===""||r===us(n))&&(r=!0))}return r}const OS=new WeakMap;function Fv(e,t,n=!1){const r=n?OS:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,i={},a=[];let l=!1;if(!rt(e)){const d=f=>{l=!0;const[m,v]=Fv(f,t,!0);dn(i,m),v&&a.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!l)return Rt(e)&&r.set(e,gi),gi;if(Je(s))for(let d=0;d<s.length;d++){const f=Jn(s[d]);eh(f)&&(i[f]=Lt)}else if(s)for(const d in s){const f=Jn(d);if(eh(f)){const m=s[d],v=i[f]=Je(m)||rt(m)?{type:m}:dn({},m),E=v.type;let C=!1,H=!0;if(Je(E))for(let M=0;M<E.length;++M){const O=E[M],V=rt(O)&&O.name;if(V==="Boolean"){C=!0;break}else V==="String"&&(H=!1)}else C=rt(E)&&E.name==="Boolean";v[0]=C,v[1]=H,(C||xt(v,"default"))&&a.push(f)}}const u=[i,a];return Rt(e)&&r.set(e,u),u}function eh(e){return e[0]!=="$"&&!fa(e)}const Uf=e=>e==="_"||e==="_ctx"||e==="$stable",qf=e=>Je(e)?e.map(so):[so(e)],LS=(e,t,n)=>{if(t._n)return t;const r=Ct((...o)=>qf(t(...o)),n);return r._c=!1,r},Bv=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Uf(o))continue;const s=e[o];if(rt(s))t[o]=LS(o,s,r);else if(s!=null){const i=qf(s);t[o]=()=>i}}},Uv=(e,t)=>{const n=qf(t);e.slots.default=()=>n},qv=(e,t,n)=>{for(const r in t)(n||!Uf(r))&&(e[r]=t[r])},DS=(e,t,n)=>{const r=e.slots=Lv();if(e.vnode.shapeFlag&32){const o=t._;o?(qv(r,t,n),n&&zg(r,"_",o,!0)):Bv(t,r)}else t&&Uv(e,t)},jS=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,i=Lt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:qv(o,t,n):(s=!t.$stable,Bv(t,o)),i=t}else t&&(Uv(e,t),i={default:1});if(s)for(const a in o)!Uf(a)&&i[a]==null&&delete o[a]},zn=HS;function FS(e){return BS(e)}function BS(e,t){const n=Ec();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:u,setElementText:d,parentNode:f,nextSibling:m,setScopeId:v=lo,insertStaticContent:E}=e,C=(T,k,q,te=null,Z=null,X=null,ae=void 0,me=null,fe=!!k.dynamicChildren)=>{if(T===k)return;T&&!$s(T,k)&&(te=Y(T),Ge(T,Z,X,!0),T=null),k.patchFlag===-2&&(fe=!1,k.dynamicChildren=null);const{type:ne,ref:Le,shapeFlag:ke}=k;switch(ne){case Rc:H(T,k,q,te);break;case Nn:M(T,k,q,te);break;case Bu:T==null&&O(k,q,te,ae);break;case Qe:Q(T,k,q,te,Z,X,ae,me,fe);break;default:ke&1?de(T,k,q,te,Z,X,ae,me,fe):ke&6?pe(T,k,q,te,Z,X,ae,me,fe):(ke&64||ke&128)&&ne.process(T,k,q,te,Z,X,ae,me,fe,Ue)}Le!=null&&Z?ga(Le,T&&T.ref,X,k||T,!k):Le==null&&T&&T.ref!=null&&ga(T.ref,null,X,T,!0)},H=(T,k,q,te)=>{if(T==null)r(k.el=a(k.children),q,te);else{const Z=k.el=T.el;k.children!==T.children&&u(Z,k.children)}},M=(T,k,q,te)=>{T==null?r(k.el=l(k.children||""),q,te):k.el=T.el},O=(T,k,q,te)=>{[T.el,T.anchor]=E(T.children,k,q,te,T.el,T.anchor)},V=({el:T,anchor:k},q,te)=>{let Z;for(;T&&T!==k;)Z=m(T),r(T,q,te),T=Z;r(k,q,te)},K=({el:T,anchor:k})=>{let q;for(;T&&T!==k;)q=m(T),o(T),T=q;o(k)},de=(T,k,q,te,Z,X,ae,me,fe)=>{if(k.type==="svg"?ae="svg":k.type==="math"&&(ae="mathml"),T==null)oe(k,q,te,Z,X,ae,me,fe);else{const ne=T.el&&T.el._isVueCE?T.el:null;try{ne&&ne._beginPatch(),Pe(T,k,Z,X,ae,me,fe)}finally{ne&&ne._endPatch()}}},oe=(T,k,q,te,Z,X,ae,me)=>{let fe,ne;const{props:Le,shapeFlag:ke,transition:we,dirs:xe}=T;if(fe=T.el=i(T.type,X,Le&&Le.is,Le),ke&8?d(fe,T.children):ke&16&&ve(T.children,fe,null,te,Z,Fu(T,X),ae,me),xe&&Ts(T,null,te,"created"),ee(fe,T,T.scopeId,ae,te),Le){for(const $ in Le)$!=="value"&&!fa($)&&s(fe,$,null,Le[$],X,te);"value"in Le&&s(fe,"value",null,Le.value,X),(ne=Le.onVnodeBeforeMount)&&to(ne,te,T)}xe&&Ts(T,null,te,"beforeMount");const R=US(Z,we);R&&we.beforeEnter(fe),r(fe,k,q),((ne=Le&&Le.onVnodeMounted)||R||xe)&&zn(()=>{try{ne&&to(ne,te,T),R&&we.enter(fe),xe&&Ts(T,null,te,"mounted")}finally{}},Z)},ee=(T,k,q,te,Z)=>{if(q&&v(T,q),te)for(let X=0;X<te.length;X++)v(T,te[X]);if(Z){let X=Z.subTree;if(k===X||Vv(X.type)&&(X.ssContent===k||X.ssFallback===k)){const ae=Z.vnode;ee(T,ae,ae.scopeId,ae.slotScopeIds,Z.parent)}}},ve=(T,k,q,te,Z,X,ae,me,fe=0)=>{for(let ne=fe;ne<T.length;ne++){const Le=T[ne]=me?So(T[ne]):so(T[ne]);C(null,Le,k,q,te,Z,X,ae,me)}},Pe=(T,k,q,te,Z,X,ae)=>{const me=k.el=T.el;let{patchFlag:fe,dynamicChildren:ne,dirs:Le}=k;fe|=T.patchFlag&16;const ke=T.props||Lt,we=k.props||Lt;let xe;if(q&&ks(q,!1),(xe=we.onVnodeBeforeUpdate)&&to(xe,q,k,T),Le&&Ts(k,T,q,"beforeUpdate"),q&&ks(q,!0),(ke.innerHTML&&we.innerHTML==null||ke.textContent&&we.textContent==null)&&d(me,""),ne?Re(T.dynamicChildren,ne,me,q,te,Fu(k,Z),X):ae||le(T,k,me,null,q,te,Fu(k,Z),X,!1),fe>0){if(fe&16)De(me,ke,we,q,Z);else if(fe&2&&ke.class!==we.class&&s(me,"class",null,we.class,Z),fe&4&&s(me,"style",ke.style,we.style,Z),fe&8){const R=k.dynamicProps;for(let $=0;$<R.length;$++){const F=R[$],J=ke[F],ce=we[F];(ce!==J||F==="value")&&s(me,F,J,ce,Z,q)}}fe&1&&T.children!==k.children&&d(me,k.children)}else!ae&&ne==null&&De(me,ke,we,q,Z);((xe=we.onVnodeUpdated)||Le)&&zn(()=>{xe&&to(xe,q,k,T),Le&&Ts(k,T,q,"updated")},te)},Re=(T,k,q,te,Z,X,ae)=>{for(let me=0;me<k.length;me++){const fe=T[me],ne=k[me],Le=fe.el&&(fe.type===Qe||!$s(fe,ne)||fe.shapeFlag&198)?f(fe.el):q;C(fe,ne,Le,null,te,Z,X,ae,!0)}},De=(T,k,q,te,Z)=>{if(k!==q){if(k!==Lt)for(const X in k)!fa(X)&&!(X in q)&&s(T,X,k[X],null,Z,te);for(const X in q){if(fa(X))continue;const ae=q[X],me=k[X];ae!==me&&X!=="value"&&s(T,X,me,ae,Z,te)}"value"in q&&s(T,"value",k.value,q.value,Z)}},Q=(T,k,q,te,Z,X,ae,me,fe)=>{const ne=k.el=T?T.el:a(""),Le=k.anchor=T?T.anchor:a("");let{patchFlag:ke,dynamicChildren:we,slotScopeIds:xe}=k;xe&&(me=me?me.concat(xe):xe),T==null?(r(ne,q,te),r(Le,q,te),ve(k.children||[],q,Le,Z,X,ae,me,fe)):ke>0&&ke&64&&we&&T.dynamicChildren&&T.dynamicChildren.length===we.length?(Re(T.dynamicChildren,we,q,Z,X,ae,me),(k.key!=null||Z&&k===Z.subTree)&&Hf(T,k,!0)):le(T,k,q,Le,Z,X,ae,me,fe)},pe=(T,k,q,te,Z,X,ae,me,fe)=>{k.slotScopeIds=me,T==null?k.shapeFlag&512?Z.ctx.activate(k,q,te,ae,fe):Me(k,q,te,Z,X,ae,fe):qe(T,k,fe)},Me=(T,k,q,te,Z,X,ae)=>{const me=T.component=YS(T,te,Z);if(Ha(T)&&(me.ctx.renderer=Ue),JS(me,!1,ae),me.asyncDep){if(Z&&Z.registerDep(me,_e,ae),!T.el){const fe=me.subTree=ze(Nn);M(null,fe,k,q),T.placeholder=fe.el}}else _e(me,T,k,q,Z,X,ae)},qe=(T,k,q)=>{const te=k.component=T.component;if(MS(T,k,q))if(te.asyncDep&&!te.asyncResolved){Te(te,k,q);return}else te.next=k,te.update();else k.el=T.el,te.vnode=k},_e=(T,k,q,te,Z,X,ae)=>{const me=()=>{if(T.isMounted){let{next:ke,bu:we,u:xe,parent:R,vnode:$}=T;{const We=Hv(T);if(We){ke&&(ke.el=$.el,Te(T,ke,ae)),We.asyncDep.then(()=>{zn(()=>{T.isUnmounted||ne()},Z)});return}}let F=ke,J;ks(T,!1),ke?(ke.el=$.el,Te(T,ke,ae)):ke=$,we&&Dl(we),(J=ke.props&&ke.props.onVnodeBeforeUpdate)&&to(J,R,ke,$),ks(T,!0);const ce=Qp(T),Oe=T.subTree;T.subTree=ce,C(Oe,ce,f(Oe.el),Y(Oe),T,Z,X),ke.el=ce.el,F===null&&PS(T,ce.el),xe&&zn(xe,Z),(J=ke.props&&ke.props.onVnodeUpdated)&&zn(()=>to(J,R,ke,$),Z)}else{let ke;const{el:we,props:xe}=k,{bm:R,m:$,parent:F,root:J,type:ce}=T,Oe=_i(k);ks(T,!1),R&&Dl(R),!Oe&&(ke=xe&&xe.onVnodeBeforeMount)&&to(ke,F,k),ks(T,!0);{J.ce&&J.ce._hasShadowRoot()&&J.ce._injectChildStyle(ce,T.parent?T.parent.type:void 0);const We=T.subTree=Qp(T);C(null,We,q,te,T,Z,X),k.el=We.el}if($&&zn($,Z),!Oe&&(ke=xe&&xe.onVnodeMounted)){const We=k;zn(()=>to(ke,F,We),Z)}(k.shapeFlag&256||F&&_i(F.vnode)&&F.vnode.shapeFlag&256)&&T.a&&zn(T.a,Z),T.isMounted=!0,k=q=te=null}};T.scope.on();const fe=T.effect=new Jg(me);T.scope.off();const ne=T.update=fe.run.bind(fe),Le=T.job=fe.runIfDirty.bind(fe);Le.i=T,Le.id=T.uid,fe.scheduler=()=>jf(Le),ks(T,!0),ne()},Te=(T,k,q)=>{k.component=T;const te=T.vnode.props;T.vnode=k,T.next=null,NS(T,k.props,te,q),jS(T,k.children,q),Ro(),Bp(T),Mo()},le=(T,k,q,te,Z,X,ae,me,fe=!1)=>{const ne=T&&T.children,Le=T?T.shapeFlag:0,ke=k.children,{patchFlag:we,shapeFlag:xe}=k;if(we>0){if(we&128){Fe(ne,ke,q,te,Z,X,ae,me,fe);return}else if(we&256){Ee(ne,ke,q,te,Z,X,ae,me,fe);return}}xe&8?(Le&16&&Xe(ne,Z,X),ke!==ne&&d(q,ke)):Le&16?xe&16?Fe(ne,ke,q,te,Z,X,ae,me,fe):Xe(ne,Z,X,!0):(Le&8&&d(q,""),xe&16&&ve(ke,q,te,Z,X,ae,me,fe))},Ee=(T,k,q,te,Z,X,ae,me,fe)=>{T=T||gi,k=k||gi;const ne=T.length,Le=k.length,ke=Math.min(ne,Le);let we;for(we=0;we<ke;we++){const xe=k[we]=fe?So(k[we]):so(k[we]);C(T[we],xe,q,null,Z,X,ae,me,fe)}ne>Le?Xe(T,Z,X,!0,!1,ke):ve(k,q,te,Z,X,ae,me,fe,ke)},Fe=(T,k,q,te,Z,X,ae,me,fe)=>{let ne=0;const Le=k.length;let ke=T.length-1,we=Le-1;for(;ne<=ke&&ne<=we;){const xe=T[ne],R=k[ne]=fe?So(k[ne]):so(k[ne]);if($s(xe,R))C(xe,R,q,null,Z,X,ae,me,fe);else break;ne++}for(;ne<=ke&&ne<=we;){const xe=T[ke],R=k[we]=fe?So(k[we]):so(k[we]);if($s(xe,R))C(xe,R,q,null,Z,X,ae,me,fe);else break;ke--,we--}if(ne>ke){if(ne<=we){const xe=we+1,R=xe<Le?k[xe].el:te;for(;ne<=we;)C(null,k[ne]=fe?So(k[ne]):so(k[ne]),q,R,Z,X,ae,me,fe),ne++}}else if(ne>we)for(;ne<=ke;)Ge(T[ne],Z,X,!0),ne++;else{const xe=ne,R=ne,$=new Map;for(ne=R;ne<=we;ne++){const $t=k[ne]=fe?So(k[ne]):so(k[ne]);$t.key!=null&&$.set($t.key,ne)}let F,J=0;const ce=we-R+1;let Oe=!1,We=0;const st=new Array(ce);for(ne=0;ne<ce;ne++)st[ne]=0;for(ne=xe;ne<=ke;ne++){const $t=T[ne];if(J>=ce){Ge($t,Z,X,!0);continue}let _t;if($t.key!=null)_t=$.get($t.key);else for(F=R;F<=we;F++)if(st[F-R]===0&&$s($t,k[F])){_t=F;break}_t===void 0?Ge($t,Z,X,!0):(st[_t-R]=ne+1,_t>=We?We=_t:Oe=!0,C($t,k[_t],q,null,Z,X,ae,me,fe),J++)}const it=Oe?qS(st):gi;for(F=it.length-1,ne=ce-1;ne>=0;ne--){const $t=R+ne,_t=k[$t],on=k[$t+1],ot=$t+1<Le?on.el||Wv(on):te;st[ne]===0?C(null,_t,q,ot,Z,X,ae,me,fe):Oe&&(F<0||ne!==it[F]?Ne(_t,q,ot,2):F--)}}},Ne=(T,k,q,te,Z=null)=>{const{el:X,type:ae,transition:me,children:fe,shapeFlag:ne}=T;if(ne&6){Ne(T.component.subTree,k,q,te);return}if(ne&128){T.suspense.move(k,q,te);return}if(ne&64){ae.move(T,k,q,Ue);return}if(ae===Qe){r(X,k,q);for(let ke=0;ke<fe.length;ke++)Ne(fe[ke],k,q,te);r(T.anchor,k,q);return}if(ae===Bu){V(T,k,q);return}if(te!==2&&ne&1&&me)if(te===0)me.beforeEnter(X),r(X,k,q),zn(()=>me.enter(X),Z);else{const{leave:ke,delayLeave:we,afterLeave:xe}=me,R=()=>{T.ctx.isUnmounted?o(X):r(X,k,q)},$=()=>{X._isLeaving&&X[ro](!0),ke(X,()=>{R(),xe&&xe()})};we?we(X,R,$):$()}else r(X,k,q)},Ge=(T,k,q,te=!1,Z=!1)=>{const{type:X,props:ae,ref:me,children:fe,dynamicChildren:ne,shapeFlag:Le,patchFlag:ke,dirs:we,cacheIndex:xe,memo:R}=T;if(ke===-2&&(Z=!1),me!=null&&(Ro(),ga(me,null,q,T,!0),Mo()),xe!=null&&(k.renderCache[xe]=void 0),Le&256){k.ctx.deactivate(T);return}const $=Le&1&&we,F=!_i(T);let J;if(F&&(J=ae&&ae.onVnodeBeforeUnmount)&&to(J,k,T),Le&6)lt(T.component,q,te);else{if(Le&128){T.suspense.unmount(q,te);return}$&&Ts(T,null,k,"beforeUnmount"),Le&64?T.type.remove(T,k,q,Ue,te):ne&&!ne.hasOnce&&(X!==Qe||ke>0&&ke&64)?Xe(ne,k,q,!1,!0):(X===Qe&&ke&384||!Z&&Le&16)&&Xe(fe,k,q),te&&Ke(T)}const ce=R!=null&&xe==null;(F&&(J=ae&&ae.onVnodeUnmounted)||$||ce)&&zn(()=>{J&&to(J,k,T),$&&Ts(T,null,k,"unmounted"),ce&&(T.el=null)},q)},Ke=T=>{const{type:k,el:q,anchor:te,transition:Z}=T;if(k===Qe){Ye(q,te);return}if(k===Bu){K(T);return}const X=()=>{o(q),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(T.shapeFlag&1&&Z&&!Z.persisted){const{leave:ae,delayLeave:me}=Z,fe=()=>ae(q,X);me?me(T.el,X,fe):fe()}else X()},Ye=(T,k)=>{let q;for(;T!==k;)q=m(T),o(T),T=q;o(k)},lt=(T,k,q)=>{const{bum:te,scope:Z,job:X,subTree:ae,um:me,m:fe,a:ne}=T;th(fe),th(ne),te&&Dl(te),Z.stop(),X&&(X.flags|=8,Ge(ae,T,k,q)),me&&zn(me,k),zn(()=>{T.isUnmounted=!0},k)},Xe=(T,k,q,te=!1,Z=!1,X=0)=>{for(let ae=X;ae<T.length;ae++)Ge(T[ae],k,q,te,Z)},Y=T=>{if(T.shapeFlag&6)return Y(T.component.subTree);if(T.shapeFlag&128)return T.suspense.next();const k=m(T.anchor||T.el),q=k&&k[bv];return q?m(q):k};let Se=!1;const he=(T,k,q)=>{let te;T==null?k._vnode&&(Ge(k._vnode,null,null,!0),te=k._vnode.component):C(k._vnode||null,T,k,null,null,null,q),k._vnode=T,Se||(Se=!0,Bp(te),mv(),Se=!1)},Ue={p:C,um:Ge,m:Ne,r:Ke,mt:Me,mc:ve,pc:le,pbc:Re,n:Y,o:e};return{render:he,hydrate:void 0,createApp:kS(he)}}function Fu({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 ks({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function US(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Hf(e,t,n=!1){const r=e.children,o=t.children;if(Je(r)&&Je(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=So(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Hf(i,a)),a.type===Rc&&(a.patchFlag===-1&&(a=o[s]=So(a)),a.el=i.el),a.type===Nn&&!a.el&&(a.el=i.el)}}function qS(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(o=n[n.length-1],e[o]<u){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<u?s=a+1:i=a;u<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}function Hv(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hv(t)}function th(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Wv(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Wv(t.subTree):null}const Vv=e=>e.__isSuspense;function HS(e,t){t&&t.pendingBranch?Je(e)?t.effects.push(...e):t.effects.push(e):Gw(e)}const Qe=Symbol.for("v-fgt"),Rc=Symbol.for("v-txt"),Nn=Symbol.for("v-cmt"),Bu=Symbol.for("v-stc"),ya=[];let dr=null;function A(e=!1){ya.push(dr=e?null:[])}function WS(){ya.pop(),dr=ya[ya.length-1]||null}let Ca=1;function rc(e,t=!1){Ca+=e,e<0&&dr&&t&&(dr.hasOnce=!0)}function zv(e){return e.dynamicChildren=Ca>0?dr||gi:null,WS(),Ca>0&&dr&&dr.push(e),e}function D(e,t,n,r,o,s){return zv(_(e,t,n,r,o,s,!0))}function ht(e,t,n,r,o){return zv(ze(e,t,n,r,o,!0))}function Aa(e){return e?e.__v_isVNode===!0:!1}function $s(e,t){return e.type===t.type&&e.key===t.key}const Gv=({key:e})=>e??null,Fl=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Vt(e)||Ln(e)||rt(e)?{i:kn,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,r=0,o=null,s=e===Qe?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Gv(t),ref:t&&Fl(t),scopeId:vv,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:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:kn};return a?(Wf(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Vt(n)?8:16),Ca>0&&!i&&dr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&dr.push(l),l}const ze=VS;function VS(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Av)&&(e=Nn),Aa(e)){const a=is(e,t,!0);return n&&Wf(a,n),Ca>0&&!s&&dr&&(a.shapeFlag&6?dr[dr.indexOf(e)]=a:dr.push(a)),a.patchFlag=-2,a}if(eT(e)&&(e=e.__vccOpts),t){t=zS(t);let{class:a,style:l}=t;a&&!Vt(a)&&(t.class=pt(a)),Rt(l)&&(Df(l)&&!Je(l)&&(l=dn({},l)),t.style=ko(l))}const i=Vt(e)?1:Vv(e)?128:wv(e)?64:Rt(e)?4:rt(e)?2:0;return _(e,t,n,r,o,i,s,!0)}function zS(e){return e?Df(e)||Dv(e)?dn({},e):e:null}function is(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?Kv(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Gv(u),ref:t&&t.ref?n&&s?Je(s)?s.concat(Fl(t)):[s,Fl(t)]:Fl(t):s,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!==Qe?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&&is(e.ssContent),ssFallback:e.ssFallback&&is(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Ia(d,l.clone(d)),d}function Fs(e=" ",t=0){return ze(Rc,null,e,t)}function ge(e="",t=!1){return t?(A(),ht(Nn,null,e)):ze(Nn,null,e)}function so(e){return e==null||typeof e=="boolean"?ze(Nn):Je(e)?ze(Qe,null,e.slice()):Aa(e)?So(e):ze(Rc,null,String(e))}function So(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:is(e)}function Wf(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Je(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Wf(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Dv(t)?t._ctx=kn:o===3&&kn&&(kn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else rt(t)?(t={default:t,_ctx:kn},n=32):(t=String(t),r&64?(n=16,t=[Fs(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kv(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=pt([t.class,r.class]));else if(o==="style")t.style=ko([t.style,r.style]);else if(_c(o)){const s=t[o],i=r[o];i&&s!==i&&!(Je(s)&&s.includes(i))?t[o]=s?[].concat(s,i):i:i==null&&s==null&&!bc(o)&&(t[o]=i)}else o!==""&&(t[o]=r[o])}return t}function to(e,t,n,r=null){Hr(e,t,7,[n,r])}const GS=Pv();let KS=0;function YS(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||GS,s={uid:KS++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new vw(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Fv(r,o),emitsOptions:$v(r,o),emit:null,emitted:null,propsDefaults:Lt,inheritAttrs:r.inheritAttrs,ctx:Lt,data:Lt,props:Lt,attrs:Lt,slots:Lt,refs:Lt,setupState:Lt,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 s.ctx={_:s},s.root=t?t.root:s,s.emit=CS.bind(null,s),e.ce&&e.ce(s),s}let En=null;const Vf=()=>En||kn;let oc,Hd;{const e=Ec(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};oc=t("__VUE_INSTANCE_SETTERS__",n=>En=n),Hd=t("__VUE_SSR_SETTERS__",n=>Ti=n)}const Wa=e=>{const t=En;return oc(e),e.scope.on(),()=>{e.scope.off(),oc(t)}},nh=()=>{En&&En.scope.off(),oc(null)};function Yv(e){return e.vnode.shapeFlag&4}let Ti=!1;function JS(e,t=!1,n=!1){t&&Hd(t);const{props:r,children:o}=e.vnode,s=Yv(e);$S(e,r,s,t),DS(e,o,n||t);const i=s?XS(e,t):void 0;return t&&Hd(!1),i}function XS(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gS);const{setup:r}=n;if(r){Ro();const o=e.setupContext=r.length>1?Xv(e):null,s=Wa(e),i=Ua(r,e,0,[e.props,o]),a=Hg(i);if(Mo(),s(),(a||e.sp)&&!_i(e)&&Ff(e),a){if(i.then(nh,nh),t)return i.then(l=>{rh(e,l)}).catch(l=>{qa(l,e,0)});e.asyncDep=i}else rh(e,i)}else Jv(e)}function rh(e,t,n){rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Rt(t)&&(e.setupState=fv(t)),Jv(e)}function Jv(e,t,n){const r=e.type;e.render||(e.render=r.render||lo);{const o=Wa(e);Ro();try{_S(e)}finally{Mo(),o()}}}const QS={get(e,t){return Pn(e,"get",""),e[t]}};function Xv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,QS),slots:e.slots,emit:e.emit,expose:t}}function Mc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(fv(Dw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in va)return va[n](e)},has(t,n){return n in t||n in va}})):e.proxy}function ZS(e,t=!0){return rt(e)?e.displayName||e.name:e.name||t&&e.__name}function eT(e){return rt(e)&&"__vccOpts"in e}const ie=(e,t)=>qw(e,t,Ti);function zf(e,t,n){try{rc(-1);const r=arguments.length;return r===2?Rt(t)&&!Je(t)?Aa(t)?ze(e,null,[t]):ze(e,t):ze(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Aa(n)&&(n=[n]),ze(e,t,n))}finally{rc(1)}}const tT="3.5.32";/**
|
|
15
|
-
* @vue/runtime-dom v3.5.32
|
|
16
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
-
* @license MIT
|
|
18
|
-
**/let Wd;const oh=typeof window<"u"&&window.trustedTypes;if(oh)try{Wd=oh.createPolicy("vue",{createHTML:e=>e})}catch{}const Qv=Wd?e=>Wd.createHTML(e):e=>e,nT="http://www.w3.org/2000/svg",rT="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,sh=bo&&bo.createElement("template"),oT={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 o=t==="svg"?bo.createElementNS(nT,e):t==="mathml"?bo.createElementNS(rT,e):n?bo.createElement(e,{is:n}):bo.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>bo.createTextNode(e),createComment:e=>bo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bo.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{sh.innerHTML=Qv(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=sh.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]}},Go="transition",ia="animation",xa=Symbol("_vtc"),Zv={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},sT=dn({},Sv,Zv),iT=e=>(e.displayName="Transition",e.props=sT,e),ey=iT((e,{slots:t})=>zf(nS,aT(e),t)),Is=(e,t=[])=>{Je(e)?e.forEach(n=>n(...t)):e&&e(...t)},ih=e=>e?Je(e)?e.some(t=>t.length>1):e.length>1:!1;function aT(e){const t={};for(const Q in e)Q in Zv||(t[Q]=e[Q]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=i,appearToClass:d=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,E=lT(o),C=E&&E[0],H=E&&E[1],{onBeforeEnter:M,onEnter:O,onEnterCancelled:V,onLeave:K,onLeaveCancelled:de,onBeforeAppear:oe=M,onAppear:ee=O,onAppearCancelled:ve=V}=t,Pe=(Q,pe,Me,qe)=>{Q._enterCancelled=qe,Cs(Q,pe?d:a),Cs(Q,pe?u:i),Me&&Me()},Re=(Q,pe)=>{Q._isLeaving=!1,Cs(Q,f),Cs(Q,v),Cs(Q,m),pe&&pe()},De=Q=>(pe,Me)=>{const qe=Q?ee:O,_e=()=>Pe(pe,Q,Me);Is(qe,[pe,_e]),ah(()=>{Cs(pe,Q?l:s),vo(pe,Q?d:a),ih(qe)||lh(pe,r,C,_e)})};return dn(t,{onBeforeEnter(Q){Is(M,[Q]),vo(Q,s),vo(Q,i)},onBeforeAppear(Q){Is(oe,[Q]),vo(Q,l),vo(Q,u)},onEnter:De(!1),onAppear:De(!0),onLeave(Q,pe){Q._isLeaving=!0;const Me=()=>Re(Q,pe);vo(Q,f),Q._enterCancelled?(vo(Q,m),dh(Q)):(dh(Q),vo(Q,m)),ah(()=>{Q._isLeaving&&(Cs(Q,f),vo(Q,v),ih(K)||lh(Q,r,H,Me))}),Is(K,[Q,Me])},onEnterCancelled(Q){Pe(Q,!1,void 0,!0),Is(V,[Q])},onAppearCancelled(Q){Pe(Q,!0,void 0,!0),Is(ve,[Q])},onLeaveCancelled(Q){Re(Q),Is(de,[Q])}})}function lT(e){if(e==null)return null;if(Rt(e))return[Uu(e.enter),Uu(e.leave)];{const t=Uu(e);return[t,t]}}function Uu(e){return cw(e)}function vo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[xa]||(e[xa]=new Set)).add(t)}function Cs(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[xa];n&&(n.delete(t),n.size||(e[xa]=void 0))}function ah(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cT=0;function lh(e,t,n,r){const o=e._endId=++cT,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=uT(e,t);if(!i)return r();const u=i+"end";let d=0;const f=()=>{e.removeEventListener(u,m),s()},m=v=>{v.target===e&&++d>=l&&f()};setTimeout(()=>{d<l&&f()},a+1),e.addEventListener(u,m)}function uT(e,t){const n=window.getComputedStyle(e),r=E=>(n[E]||"").split(", "),o=r(`${Go}Delay`),s=r(`${Go}Duration`),i=ch(o,s),a=r(`${ia}Delay`),l=r(`${ia}Duration`),u=ch(a,l);let d=null,f=0,m=0;t===Go?i>0&&(d=Go,f=i,m=s.length):t===ia?u>0&&(d=ia,f=u,m=l.length):(f=Math.max(i,u),d=f>0?i>u?Go:ia:null,m=d?d===Go?s.length:l.length:0);const v=d===Go&&/\b(?:transform|all)(?:,|$)/.test(r(`${Go}Property`).toString());return{type:d,timeout:f,propCount:m,hasTransform:v}}function ch(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>uh(n)+uh(e[r])))}function uh(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function dh(e){return(e?e.ownerDocument:document).body.offsetHeight}function dT(e,t,n){const r=e[xa];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const fh=Symbol("_vod"),fT=Symbol("_vsh"),pT=Symbol(""),hT=/(?:^|;)\s*display\s*:/;function mT(e,t,n){const r=e.style,o=Vt(n);let s=!1;if(n&&!o){if(t)if(Vt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Bl(r,a,"")}else for(const i in t)n[i]==null&&Bl(r,i,"");for(const i in n)i==="display"&&(s=!0),Bl(r,i,n[i])}else if(o){if(t!==n){const i=r[pT];i&&(n+=";"+i),r.cssText=n,s=hT.test(n)}}else t&&e.removeAttribute("style");fh in e&&(e[fh]=s?r.display:"",e[fT]&&(r.display="none"))}const ph=/\s*!important$/;function Bl(e,t,n){if(Je(n))n.forEach(r=>Bl(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=gT(e,t);ph.test(n)?e.setProperty(us(r),n.replace(ph,""),"important"):e[r]=n}}const hh=["Webkit","Moz","ms"],qu={};function gT(e,t){const n=qu[t];if(n)return n;let r=Jn(t);if(r!=="filter"&&r in e)return qu[t]=r;r=Sc(r);for(let o=0;o<hh.length;o++){const s=hh[o]+r;if(s in e)return qu[t]=s}return t}const mh="http://www.w3.org/1999/xlink";function gh(e,t,n,r,o,s=mw(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(mh,t.slice(6,t.length)):e.setAttributeNS(mh,t,n):n==null||s&&!Gg(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Ur(n)?String(n):n)}function vh(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Qv(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="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=Gg(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function ts(e,t,n,r){e.addEventListener(t,n,r)}function vT(e,t,n,r){e.removeEventListener(t,n,r)}const yh=Symbol("_vei");function yT(e,t,n,r,o=null){const s=e[yh]||(e[yh]={}),i=s[t];if(r&&i)i.value=r;else{const[a,l]=_T(t);if(r){const u=s[t]=ST(r,o);ts(e,a,u,l)}else i&&(vT(e,a,i,l),s[t]=void 0)}}const _h=/(?:Once|Passive|Capture)$/;function _T(e){let t;if(_h.test(e)){t={};let r;for(;r=e.match(_h);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):us(e.slice(2)),t]}let Hu=0;const bT=Promise.resolve(),wT=()=>Hu||(bT.then(()=>Hu=0),Hu=Date.now());function ST(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Hr(TT(r,n.value),t,5,[r])};return n.value=e,n.attached=wT(),n}function TT(e,t){if(Je(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const bh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ET=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?dT(e,r,i):t==="style"?mT(e,n,r):_c(t)?bc(t)||yT(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kT(e,t,r,i))?(vh(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&gh(e,t,r,i,s,t!=="value")):e._isVueCE&&(IT(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Vt(r)))?vh(e,Jn(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),gh(e,t,r,i))};function kT(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&bh(t)&&rt(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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return bh(t)&&Vt(n)?!1:t in e}function IT(e,t){const n=e._def.props;if(!n)return!1;const r=Jn(t);return Array.isArray(n)?n.some(o=>Jn(o)===r):Object.keys(n).some(o=>Jn(o)===r)}const Ei=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Je(t)?n=>Dl(t,n):t};function CT(e){e.target.composing=!0}function wh(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Io=Symbol("_assign");function Sh(e,t,n){return t&&(e=e.trim()),n&&(e=Tc(e)),e}const rr={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Io]=Ei(o);const s=r||o.props&&o.props.type==="number";ts(e,t?"change":"input",i=>{i.target.composing||e[Io](Sh(e.value,n,s))}),(n||s)&&ts(e,"change",()=>{e.value=Sh(e.value,n,s)}),t||(ts(e,"compositionstart",CT),ts(e,"compositionend",wh),ts(e,"change",wh))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[Io]=Ei(i),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Tc(e.value):e.value,l=t??"";if(a===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===l)||(e.value=l)}},AT={deep:!0,created(e,t,n){e[Io]=Ei(n),ts(e,"change",()=>{const r=e._modelValue,o=Ra(e),s=e.checked,i=e[Io];if(Je(r)){const a=Rf(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const u=[...r];u.splice(a,1),i(u)}}else if($i(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(ty(e,s))})},mounted:Th,beforeUpdate(e,t,n){e[Io]=Ei(n),Th(e,t,n)}};function Th(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(Je(t))o=Rf(t,r.props.value)>-1;else if($i(t))o=t.has(r.props.value);else{if(t===n)return;o=Ni(t,ty(e,!0))}e.checked!==o&&(e.checked=o)}const e2={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=$i(t);ts(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Tc(Ra(i)):Ra(i));e[Io](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Jt(()=>{e._assigning=!1})}),e[Io]=Ei(r)},mounted(e,{value:t}){Eh(e,t)},beforeUpdate(e,t,n){e[Io]=Ei(n)},updated(e,{value:t}){e._assigning||Eh(e,t)}};function Eh(e,t){const n=e.multiple,r=Je(t);if(!(n&&!r&&!$i(t))){for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],a=Ra(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=t.some(u=>String(u)===String(a)):i.selected=Rf(t,a)>-1}else i.selected=t.has(a);else if(Ni(Ra(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ra(e){return"_value"in e?e._value:e.value}function ty(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const xT=["ctrl","shift","alt","meta"],RT={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)=>xT.some(n=>e[`${n}Key`]&&!t.includes(n))},ft=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const a=RT[t[i]];if(a&&a(o,t))return}return e(o,...s)}))},MT={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]=(o=>{if(!("key"in o))return;const s=us(o.key);if(t.some(i=>i===s||MT[i]===s))return e(o)}))},PT=dn({patchProp:ET},oT);let kh;function $T(){return kh||(kh=FS(PT))}const NT=((...e)=>{const t=$T().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=LT(r);if(!o)return;const s=t._component;!rt(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,OT(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function OT(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function LT(e){return Vt(e)?document.querySelector(e):e}const Ve=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,vt=globalThis,Bs="10.48.0";function zs(){return Pc(vt),vt}function Pc(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Bs,t[Bs]=t[Bs]||{}}function Oi(e,t,n=vt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Bs]=r[Bs]||{};return o[e]||(o[e]=t())}const DT=["debug","info","warn","error","log","assert","trace"],jT="Sentry Logger ",sc={};function Fo(e){if(!("console"in vt))return e();const t=vt.console,n={},r=Object.keys(sc);r.forEach(o=>{const s=sc[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function FT(){Kf().enabled=!0}function BT(){Kf().enabled=!1}function ny(){return Kf().enabled}function UT(...e){Gf("log",...e)}function qT(...e){Gf("warn",...e)}function HT(...e){Gf("error",...e)}function Gf(e,...t){Ve&&ny()&&Fo(()=>{vt.console[e](`${jT}[${e}]:`,...t)})}function Kf(){return Ve?Oi("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ce={enable:FT,disable:BT,isEnabled:ny,log:UT,warn:qT,error:HT},ry=50,Ws="?",Ih=/\(error: (.*)\)/,Ch=/captureMessage|captureException/;function oy(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(`
|
|
19
|
-
`);for(let a=r;a<i.length;a++){let l=i[a];l.length>1024&&(l=l.slice(0,1024));const u=Ih.test(l)?l.replace(Ih,"$1"):l;if(!u.includes("Error: ")){for(const d of t){const f=d(u);if(f){s.push(f);break}}if(s.length>=ry+o)break}}return VT(s.slice(o))}}function WT(e){return Array.isArray(e)?oy(...e):e}function VT(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Il(t).function||"")&&t.pop(),t.reverse(),Ch.test(Il(t).function||"")&&(t.pop(),Ch.test(Il(t).function||"")&&t.pop()),t.slice(0,ry).map(n=>({...n,filename:n.filename||Il(t).filename,function:n.function||Ws}))}function Il(e){return e[e.length-1]||{}}const Wu="<anonymous>";function $o(e){try{return!e||typeof e!="function"?Wu:e.name||Wu}catch{return Wu}}function Ah(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function sy(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Ul={},xh={};function fs(e,t){Ul[e]=Ul[e]||[],Ul[e].push(t)}function ps(e,t){if(!xh[e]){xh[e]=!0;try{t()}catch(n){Ve&&Ce.error(`Error while instrumenting ${e}`,n)}}}function kr(e,t){const n=e&&Ul[e];if(n)for(const r of n)try{r(t)}catch(o){Ve&&Ce.error(`Error while triggering instrumentation handler.
|
|
20
|
-
Type: ${e}
|
|
21
|
-
Name: ${$o(r)}
|
|
22
|
-
Error:`,o)}}let Vu=null;function iy(e){const t="error";fs(t,e),ps(t,zT)}function zT(){Vu=vt.onerror,vt.onerror=function(e,t,n,r,o){return kr("error",{column:r,error:o,line:n,msg:e,url:t}),Vu?Vu.apply(this,arguments):!1},vt.onerror.__SENTRY_INSTRUMENTED__=!0}let zu=null;function ay(e){const t="unhandledrejection";fs(t,e),ps(t,GT)}function GT(){zu=vt.onunhandledrejection,vt.onunhandledrejection=function(e){return kr("unhandledrejection",e),zu?zu.apply(this,arguments):!0},vt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const ly=Object.prototype.toString;function $c(e){switch(ly.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return No(e,Error)}}function Li(e,t){return ly.call(e)===`[object ${t}]`}function cy(e){return Li(e,"ErrorEvent")}function Rh(e){return Li(e,"DOMError")}function KT(e){return Li(e,"DOMException")}function Co(e){return Li(e,"String")}function Yf(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function ki(e){return e===null||Yf(e)||typeof e!="object"&&typeof e!="function"}function Ma(e){return Li(e,"Object")}function Nc(e){return typeof Event<"u"&&No(e,Event)}function YT(e){return typeof Element<"u"&&No(e,Element)}function JT(e){return Li(e,"RegExp")}function Di(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function XT(e){return Ma(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function No(e,t){try{return e instanceof t}catch{return!1}}function uy(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Jf(e){return typeof Request<"u"&&No(e,Request)}const Xf=vt,QT=80;function xr(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",l=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||QT;for(;n&&s++<r&&(u=ZT(n,d),!(u==="html"||s>1&&i+o.length*l+u.length>=f));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function ZT(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Xf.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t!=null&&t.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o!=null&&o.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const s=n.className;if(s&&Co(s)){const i=s.split(/\s+/);for(const a of i)r.push(`.${a}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function Va(){try{return Xf.document.location.href}catch{return""}}function dy(e){if(!Xf.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function fr(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&fy(o,r);try{e[t]=o}catch{Ve&&Ce.log(`Failed to replace method "${t}" in object`,e)}}function or(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ve&&Ce.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function fy(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,or(e,"__sentry_original__",t)}catch{}}function Qf(e){return e.__sentry_original__}function py(e){if($c(e))return{message:e.message,name:e.name,stack:e.stack,...Ph(e)};if(Nc(e)){const t={type:e.type,target:Mh(e.target),currentTarget:Mh(e.currentTarget),...Ph(e)};return typeof CustomEvent<"u"&&No(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Mh(e){try{return YT(e)?xr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Ph(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function e0(e){const t=Object.keys(py(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ii;function za(e){if(ii!==void 0)return ii?ii(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=vt;return t in n&&typeof n[t]=="function"?(ii=n[t],ii(e)):(ii=null,e())}function ns(){return za(()=>Math.random())}function Ga(){return za(()=>Date.now())}function Vd(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function $h(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{uy(o)?n.push(sy(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function ql(e,t,n=!1){return Co(e)?JT(t)?t.test(e):Co(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function rs(e,t=[],n=!1){return t.some(r=>ql(e,r,n))}function t0(){const e=vt;return e.crypto||e.msCrypto}let Gu;function n0(){return ns()*16}function Ir(e=t0()){try{if(e!=null&&e.randomUUID)return za(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Gu||(Gu="10000000100040008000"+1e11),Gu.replace(/[018]/g,t=>(t^(n0()&15)>>t/4).toString(16))}function hy(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Ns(e){const{message:t,event_id:n}=e;if(t)return t;const r=hy(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function zd(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Ii(e,t){const n=hy(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o==null?void 0:o.data,...t.data};n.mechanism.data=s}}function Nh(e){if(r0(e))return!0;try{or(e,"__sentry_captured__",!0)}catch{}return!1}function r0(e){try{return e.__sentry_captured__}catch{}}const my=1e3;function Gs(){return Ga()/my}function o0(){const{performance:e}=vt;if(!(e!=null&&e.now)||!e.timeOrigin)return Gs;const t=e.timeOrigin;return()=>(t+za(()=>e.now()))/my}let Oh;function tn(){return(Oh??(Oh=o0()))()}let Ku=null;function s0(){var i;const{performance:e}=vt;if(!(e!=null&&e.now))return;const t=3e5,n=za(()=>e.now()),r=Ga(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=(i=e.timing)==null?void 0:i.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function Rr(){return Ku===null&&(Ku=s0()),Ku}function i0(e){const t=tn(),n={sid:Ir(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>l0(n)};return e&&Ci(n,e),n}function Ci(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||tn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ir()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function a0(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Ci(e,n)}function l0(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Ka(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Ka(r[o],t[o],n-1));return r}function Oo(){return Ir()}function Ao(){return Ir().substring(16)}const Gd="_sentrySpan";function Ai(e,t){t?or(e,Gd,t):delete e[Gd]}function ic(e){return e[Gd]}const c0=100;class co{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Oo(),sampleRand:ns()}}clone(){const t=new co;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Ai(t,ic(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ci(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof co?n.getScopeData():Ma(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:l,level:u,fingerprint:d=[],propagationContext:f,conversationId:m}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),f&&(this._propagationContext=f),m&&(this._conversationId=m),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Ai(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Oo(),sampleRand:ns()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:c0;if(r<=0)return this;const o={timestamp:Gs(),...t,message:t.message?Vd(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(s=this._client)==null||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ic(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ka(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Ir();if(!this._client)return Ve&&Ce.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=(r==null?void 0:r.event_id)||Ir();if(!this._client)return Ve&&Ce.warn("No client configured on scope - will not capture message!"),o;const s=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Ir();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Ve&&Ce.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function u0(){return Oi("defaultCurrentScope",()=>new co)}function d0(){return Oi("defaultIsolationScope",()=>new co)}const Lh=e=>e instanceof Promise&&!e[gy],gy=Symbol("chained PromiseLike"),vy=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Lh(r)&&Lh(e)?r:f0(e,r)},f0=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[gy]:!0}),t};class p0{constructor(t,n){let r;t?r=t:r=new co;let o;n?o=n:o=new co,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Di(r)?vy(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function xi(){const e=zs(),t=Pc(e);return t.stack=t.stack||new p0(u0(),d0())}function h0(e){return xi().withScope(e)}function m0(e,t){const n=xi();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Dh(e){return xi().withScope(()=>e(xi().getIsolationScope()))}function g0(){return{withIsolationScope:Dh,withScope:h0,withSetScope:m0,withSetIsolationScope:(e,t)=>Dh(t),getCurrentScope:()=>xi().getScope(),getIsolationScope:()=>xi().getIsolationScope()}}function ji(e){const t=Pc(e);return t.acs?t.acs:g0()}function Nt(){const e=zs();return ji(e).getCurrentScope()}function Vr(){const e=zs();return ji(e).getIsolationScope()}function v0(){return Oi("globalScope",()=>new co)}function Oc(...e){const t=zs(),n=ji(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function Mt(){return Nt().getClient()}function y0(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Ao()};return r&&(s.parent_span_id=r),s}const Tr="sentry.source",Zf="sentry.sample_rate",yy="sentry.previous_trace_sample_rate",Lo="sentry.op",Xt="sentry.origin",Pa="sentry.idle_span_finish_reason",Ya="sentry.measurement_unit",Ja="sentry.measurement_value",jh="sentry.custom_span_name",ep="sentry.profile_id",Fi="sentry.exclusive_time",_0="sentry.link.type",b0="gen_ai.conversation.id",_y=0,Lc=1,cn=2;function w0(e){if(e<400&&e>=100)return{code:Lc};if(e>=400&&e<500)switch(e){case 401:return{code:cn,message:"unauthenticated"};case 403:return{code:cn,message:"permission_denied"};case 404:return{code:cn,message:"not_found"};case 409:return{code:cn,message:"already_exists"};case 413:return{code:cn,message:"failed_precondition"};case 429:return{code:cn,message:"resource_exhausted"};case 499:return{code:cn,message:"cancelled"};default:return{code:cn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:cn,message:"unimplemented"};case 503:return{code:cn,message:"unavailable"};case 504:return{code:cn,message:"deadline_exceeded"};default:return{code:cn,message:"internal_error"}}return{code:cn,message:"internal_error"}}function by(e,t){e.setAttribute("http.response.status_code",t);const n=w0(t);n.message!=="unknown_error"&&e.setStatus(n)}const wy="_sentryScope",Sy="_sentryIsolationScope";function S0(e){try{const t=vt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function T0(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function E0(e,t,n){e&&(or(e,Sy,S0(n)),or(e,wy,t))}function ac(e){const t=e;return{scope:t[wy],isolationScope:T0(t[Sy])}}const lc="sentry-",k0=8192;function Ty(e){const t=C0(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(lc)){const i=o.slice(lc.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function I0(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${lc}${r}`]=o),n),{});return A0(t)}function C0(e){if(!(!e||!Co(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Fh(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):Fh(e)}function Fh(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function A0(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>k0?(Ve&&Ce.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const x0=/^o(\d+)\./,R0=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function M0(e){return e==="http"||e==="https"}function Bi(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function P0(e){const t=R0.exec(e);if(!t){Fo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let l="",u=a;const d=u.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),u=d.pop()),u){const f=u.match(/^\d+/);f&&(u=f[0])}return Ey({host:s,pass:o,path:l,projectId:u,port:i,protocol:n,publicKey:r})}function Ey(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function $0(e){if(!Ve)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Ce.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?M0(r)?t&&isNaN(parseInt(t,10))?(Ce.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Ce.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ce.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function N0(e){const t=e.match(x0);return t==null?void 0:t[1]}function O0(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=N0(n)),r}function L0(e){const t=typeof e=="string"?P0(e):Ey(e);if(!(!t||!$0(t)))return t}function $a(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const ky=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function D0(e){if(!e)return;const t=e.match(ky);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function j0(e,t){const n=D0(e),r=Ty(t);if(!(n!=null&&n.traceId))return{traceId:Oo(),sampleRand:ns()};const o=F0(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Iy(e=Oo(),t=Ao(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Cy(e=Oo(),t=Ao(),n){return`00-${e}-${t}-${n?"01":"00"}`}function F0(e,t){const n=$a(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=$a(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?ns()*r:r+ns()*(1-r):ns()}const Ay=0,Dc=1;let Bh=!1;function B0(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:l}=wt(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:l}}function U0(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:wt(e).parent_span_id,s=ac(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Ao():t;return{parent_span_id:o,span_id:i,trace_id:n}}function q0(e){const{traceId:t,spanId:n}=e.spanContext(),r=hs(e);return Iy(t,n,r)}function H0(e){const{traceId:t,spanId:n}=e.spanContext(),r=hs(e);return Cy(t,n,r)}function xy(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Dc,attributes:s,...o}))}function W0(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Dc,attributes:o}))}function Us(e){return typeof e=="number"?Uh(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Uh(e.getTime()):tn()}function Uh(e){return e>9999999999?e/1e3:e}function wt(e){if(G0(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(z0(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:V0(e),start_timestamp:Us(o),timestamp:Us(i)||void 0,status:Ry(a),op:r[Lo],origin:r[Xt],links:xy(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function V0(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function z0(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function G0(e){return typeof e.getSpanJSON=="function"}function hs(e){const{traceFlags:t}=e.spanContext();return t===Dc}function Ry(e){if(!(!e||e.code===_y))return e.code===Lc?"ok":e.message||"internal_error"}function K0(e){return!e||e.code===Lc||e.code===_y||e.message==="cancelled"?"ok":"error"}const qs="_sentryChildSpans",Kd="_sentryRootSpan";function My(e,t){const n=e[Kd]||e;or(t,Kd,n),e[qs]?e[qs].add(t):or(e,qs,new Set([t]))}function Y0(e,t){e[qs]&&e[qs].delete(t)}function Hl(e){const t=new Set;function n(r){if(!t.has(r)&&hs(r)){t.add(r);const o=r[qs]?Array.from(r[qs]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const On=J0;function J0(e){return e[Kd]||e}function sr(){const e=zs(),t=ji(e);return t.getActiveSpan?t.getActiveSpan():ic(Nt())}function Yd(){Bh||(Fo(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Bh=!0)}let qh=!1;function X0(){if(qh)return;function e(){const t=sr(),n=t&&On(t);if(n){const r="internal_error";Ve&&Ce.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:cn,message:r})}}e.tag="sentry_tracingErrorCallback",qh=!0,iy(e),ay(e)}function Cr(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=Mt())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Hh(e){Ce.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Na(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Z0(n)){if(ql(e.description,n))return Ve&&Hh(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?ql(e.description,n.name):!0,o=n.op?e.op&&ql(e.op,n.op):!0;if(r&&o)return Ve&&Hh(e),!0}return!1}function Q0(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function Z0(e){return typeof e=="string"||e instanceof RegExp}const tp="production",Py="_frozenDsc";function Wl(e,t){or(e,Py,t)}function $y(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||tp,release:n.release,public_key:r,trace_id:e,org_id:O0(t)};return t.emit("createDsc",o),o}function Ny(e,t){const n=t.getPropagationContext();return n.dsc||$y(n.traceId,e)}function as(e){var E;const t=Mt();if(!t)return{};const n=On(e),r=wt(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[Zf]??o[yy];function a(C){return(typeof i=="number"||typeof i=="string")&&(C.sample_rate=`${i}`),C}const l=n[Py];if(l)return a(l);const u=s==null?void 0:s.get("sentry.dsc"),d=u&&Ty(u);if(d)return a(d);const f=$y(e.spanContext().traceId,t),m=o[Tr]??o["sentry.span.source"],v=r.description;return m!=="url"&&v&&(f.transaction=v),Cr()&&(f.sampled=String(hs(n)),f.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((E=ac(n).scope)==null?void 0:E.getPropagationContext().sampleRand.toString())),a(f),t.emit("createDsc",f,n),f}class Ar{constructor(t={}){this._traceId=t.traceId||Oo(),this._spanId=t.spanId||Ao(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Ay}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Oy(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function wo(e,t=100,n=1/0){try{return Jd("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ly(e,t=3,n=100*1024){const r=wo(e,t);return rE(r)>n?Ly(e,t-1,n):r}function Jd(e,t,n=1/0,r=1/0,o=oE()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=eE(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const v=u.toJSON();return Jd("",v,l-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const m=py(t);for(const v in m){if(!Object.prototype.hasOwnProperty.call(m,v))continue;if(f>=r){d[v]="[MaxProperties ~]";break}const E=m[v];d[v]=Jd(v,E,l-1,r,o),f++}return i(t),d}function eE(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(uy(t))return sy(t);if(XT(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${$o(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=tE(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function tE(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function nE(e){return~-encodeURI(e).split(/%..|./).length}function rE(e){return nE(JSON.stringify(e))}function oE(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Ks(e,t=[]){return[e,t]}function sE(e,t){const[n,r]=e;return[n,[...r,t]]}function Xd(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function iE(e,t){return Xd(e,(n,r)=>t.includes(r))}function Qd(e){const t=Pc(vt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function aE(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Qd(r),s]:r.push(typeof s=="string"?Qd(s):s)}for(const s of n){const[i,a]=s;if(o(`
|
|
23
|
-
${JSON.stringify(i)}
|
|
24
|
-
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(wo(a))}o(l)}}return typeof r=="string"?r:lE(r)}function lE(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function cE(e){return[{type:"span"},e]}function uE(e){const t=typeof e.data=="string"?Qd(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Dy={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function dE(e){return e in Dy}function Wh(e){return dE(e)?Dy[e]:e}function jy(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function fE(e,t,n,r){var s;const o=(s=e.sdkProcessingMetadata)==null?void 0:s.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Bi(r)},...o&&{trace:o}}}function pE(e,t){var r,o,s,i;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((o=e.sdk)==null?void 0:o.packages)||[],...t.packages||[]],settings:(s=e.sdk)!=null&&s.settings||t.settings?{...(i=e.sdk)==null?void 0:i.settings,...t.settings}:void 0},e}function hE(e,t,n,r){const o=jy(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Bi(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ks(s,[i])}function mE(e,t,n,r){const o=jy(n),s=e.type&&e.type!=="replay_event"?e.type:"event";pE(e,n==null?void 0:n.sdk);const i=fE(e,o,r,t);return delete e.sdkProcessingMetadata,Ks(i,[[{type:s},e]])}function gE(e,t){function n(v){return!!v.trace_id&&!!v.public_key}const r=as(e[0]),o=t==null?void 0:t.getDsn(),s=t==null?void 0:t.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:Bi(o)}},{beforeSendSpan:a,ignoreSpans:l}=(t==null?void 0:t.getOptions())||{},u=l!=null&&l.length?e.filter(v=>!Na(wt(v),l)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const f=a?v=>{const E=wt(v),C=Oy(a)?E:a(E);return C||(Yd(),E)}:wt,m=[];for(const v of u){const E=f(v);E&&m.push(cE(E))}return Ks(i,m)}function vE(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=wt(e),{spanId:o}=e.spanContext(),s=hs(e),i=On(e),a=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:f}=wt(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),f&&u.push(`root description: ${f}`)}Ce.log(`${l}
|
|
25
|
-
${u.join(`
|
|
26
|
-
`)}`)}function yE(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >"}=wt(e),{spanId:r}=e.spanContext(),s=On(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;Ce.log(i)}function _E(e,t,n,r=sr()){const o=r&&On(r);o&&(Ve&&Ce.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Ja]:t,[Ya]:n}))}function Vh(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Ya],s=r[Ja];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function Xa(e){return e.getOptions().traceLifecycle==="stream"}const zh=1e3;class jc{constructor(t={}){this._traceId=t.traceId||Oo(),this._spanId=t.spanId||Ao(),this._startTime=t.startTimestamp||tn(),this._links=t.links,this._attributes={},this.setAttributes({[Xt]:"manual",[Lo]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Dc:Ay}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Us(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Tr,"custom"),this}end(t){this._endTime||(this._endTime=Us(t),yE(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Lo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ry(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Xt],profile_id:this._attributes[ep],exclusive_time:this._attributes[Fi],measurements:Vh(this._events),is_segment:this._isStandaloneSpan&&On(this)===this||void 0,segment_id:this._isStandaloneSpan?On(this).spanContext().spanId:void 0,links:xy(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===On(this),status:K0(this._status),attributes:this._attributes,links:W0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){Ve&&Ce.log("[Tracing] Adding an event to span:",t);const o=Gh(n)?n:r||tn(),s=Gh(n)?{}:n||{},i={name:t,time:Us(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=Mt();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===On(this)))return;if(this._isStandaloneSpan){this._sampled?wE(gE([this],t)):(Ve&&Ce.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Xa(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(ac(this).scope||Nt()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Kh(wt(this)))return;this._name||(Ve&&Ce.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ac(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const s=Hl(this).filter(f=>f!==this&&!bE(f)).map(f=>wt(f)).filter(Kh),i=this._attributes[Tr];delete this._attributes[jh],s.forEach(f=>{delete f.data[jh]});const a={contexts:{trace:B0(this)},spans:s.length>zh?s.sort((f,m)=>f.start_timestamp-m.start_timestamp).slice(0,zh):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:as(this)},request:r,...i&&{transaction_info:{source:i}}},l=Vh(this._events);return l&&Object.keys(l).length&&(Ve&&Ce.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function Gh(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Kh(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function bE(e){return e instanceof jc&&e.isStandaloneSpan()}function wE(e){const t=Mt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function SE(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return TE(o,t,n,r)}function TE(e,t,n,r){return Di(e)?vy(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function EE(e,t,n){if(!Cr(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=$a(o);if(s===void 0)return Ve&&Ce.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return Ve&&Ce.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];const i=n<s;return i||Ve&&Ce.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const kE="__SENTRY_SUPPRESS_TRACING__";function Zd(e,t){const n=rp();if(n.startSpan)return n.startSpan(e,t);const r=By(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return Oc(a,()=>CE(s)(()=>{const u=Nt(),d=Uy(u,s),m=e.onlyIfParent&&!d?new Ar:Fy({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!xE(m)||!d)&&Ai(u,m),SE(()=>t(m),()=>{const{status:v}=wt(m);m.isRecording()&&(!v||v==="ok")&&m.setStatus({code:cn,message:"internal_error"})},()=>{m.end()})}))}function ls(e){const t=rp();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=By(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>Oc(e.scope,i):o!==void 0?i=>np(o,i):i=>i())(()=>{const i=Nt(),a=Uy(i,o);return e.onlyIfParent&&!a?new Ar:Fy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function np(e,t){const n=rp();return n.withActiveSpan?n.withActiveSpan(e,t):Oc(r=>(Ai(r,e||void 0),t(r)))}function Fy({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Cr()){const a=new Ar;if(n||!e){const l={sampled:"false",sample_rate:"0",transaction:t.name,...as(a)};Wl(a,l)}return a}const o=Mt();if(AE(o,t))return op(r)||o==null||o.recordDroppedEvent("ignored","span"),new Ar({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const s=Vr();let i;if(e&&!n)i=IE(e,r,t),My(e,i);else if(e){const a=as(e),{traceId:l,spanId:u}=e.spanContext(),d=hs(e);i=Yh({traceId:l,parentSpanId:u,...t},r,d),Wl(i,a)}else{const{traceId:a,dsc:l,parentSpanId:u,sampled:d}={...s.getPropagationContext(),...r.getPropagationContext()};i=Yh({traceId:a,parentSpanId:u,...t},r,d),l&&Wl(i,l)}return vE(i),E0(i,r,s),i}function By(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Us(e.startTime),delete r.startTime,r}return n}function rp(){const e=zs();return ji(e)}function Yh(e,t,n){var C;const r=Mt(),o=(r==null?void 0:r.getOptions())||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r==null||r.emit("beforeSampling",i,{decision:!1});const a=i.parentSampled??n,l=i.spanAttributes,u=t.getPropagationContext(),d=op(t),[f,m,v]=d?[!1]:EE(o,{name:s,parentSampled:a,attributes:l,parentSampleRate:$a((C=u.dsc)==null?void 0:C.sample_rate)},u.sampleRand),E=new jc({...e,attributes:{[Tr]:"custom",[Zf]:m!==void 0&&v?m:void 0,...l},sampled:f});return!f&&r&&!d&&(Ve&&Ce.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Xa(r)?"span":"transaction")),r&&r.emit("spanStart",E),E}function IE(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=op(t),i=s?!1:hs(e),a=i?new jc({...n,parentSpanId:r,traceId:o,sampled:i}):new Ar({traceId:o});My(e,a);const l=Mt();return l&&(Xa(l)&&a instanceof Ar&&(e instanceof Ar&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function Uy(e,t){if(t)return t;if(t===null)return;const n=ic(e);if(!n)return;const r=Mt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?On(n):n}function CE(e){return e!==void 0?t=>np(e,t):t=>t()}function AE(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!Xa(e)||!(n!=null&&n.length)?!1:Na({description:t.name||"",op:((r=t.attributes)==null?void 0:r[Lo])||t.op},n)}function xE(e){return e instanceof Ar&&e.dropReason==="ignored"}function op(e){return e.getScopeData().sdkProcessingMetadata[kE]===!0}const Vl={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},RE="heartbeatFailed",ME="idleTimeout",PE="finalTimeout",$E="externalFinish";function qy(e,t={}){const n=new Map;let r=!1,o,s=$E,i=!t.disableAutoFinish;const a=[],{idleTimeout:l=Vl.idleTimeout,finalTimeout:u=Vl.finalTimeout,childSpanTimeout:d=Vl.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:m=!0}=t,v=Mt();if(!v||!Cr()){const ee=new Ar,ve={sample_rate:"0",sampled:"false",...as(ee)};return Wl(ee,ve),ee}const E=Nt(),C=sr(),H=NE(e);H.end=new Proxy(H.end,{apply(ee,ve,Pe){if(f&&f(H),ve instanceof Ar)return;const[Re,...De]=Pe,Q=Re||tn(),pe=Us(Q),Me=Hl(H).filter(Fe=>Fe!==H),qe=wt(H);if(!Me.length||!m)return oe(pe),Reflect.apply(ee,ve,[pe,...De]);const _e=v.getOptions().ignoreSpans,Te=Me==null?void 0:Me.reduce((Fe,Ne)=>{const Ge=wt(Ne);return!Ge.timestamp||_e&&Na(Ge,_e)?Fe:Fe?Math.max(Fe,Ge.timestamp):Ge.timestamp},void 0),le=qe.start_timestamp,Ee=Math.min(le?le+u/1e3:1/0,Math.max(le||-1/0,Math.min(pe,Te||1/0)));return oe(Ee),Reflect.apply(ee,ve,[Ee,...De])}});function M(){o&&(clearTimeout(o),o=void 0)}function O(ee){M(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=ME,H.end(ee))},l)}function V(ee){o=setTimeout(()=>{!r&&i&&(s=RE,H.end(ee))},d)}function K(ee){M(),n.set(ee,!0);const ve=tn();V(ve+d/1e3)}function de(ee){if(n.has(ee)&&n.delete(ee),n.size===0){const ve=tn();O(ve+l/1e3)}}function oe(ee){r=!0,n.clear(),a.forEach(Me=>Me()),Ai(E,C);const ve=wt(H),{start_timestamp:Pe}=ve;if(!Pe)return;ve.data[Pa]||H.setAttribute(Pa,s);const De=ve.status;(!De||De==="unknown")&&H.setStatus({code:Lc}),Ce.log(`[Tracing] Idle span "${ve.op}" finished`);const Q=Hl(H).filter(Me=>Me!==H);let pe=0;Q.forEach(Me=>{Me.isRecording()&&(Me.setStatus({code:cn,message:"cancelled"}),Me.end(ee),Ve&&Ce.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Me,void 0,2)));const qe=wt(Me),{timestamp:_e=0,start_timestamp:Te=0}=qe,le=Te<=ee,Ee=(u+l)/1e3,Fe=_e-Te<=Ee;if(Ve){const Ne=JSON.stringify(Me,void 0,2);le?Fe||Ce.log("[Tracing] Discarding span since it finished after idle span final timeout",Ne):Ce.log("[Tracing] Discarding span since it happened after idle span was finished",Ne)}(!Fe||!le)&&(Y0(H,Me),pe++)}),pe>0&&H.setAttribute("sentry.idle_span_discarded_spans",pe)}return a.push(v.on("spanStart",ee=>{if(r||ee===H||wt(ee).timestamp||ee instanceof jc&&ee.isStandaloneSpan())return;Hl(H).includes(ee)&&K(ee.spanContext().spanId)})),a.push(v.on("spanEnd",ee=>{r||de(ee.spanContext().spanId)})),a.push(v.on("idleSpanEnableAutoFinish",ee=>{ee===H&&(i=!0,O(),n.size&&V())})),t.disableAutoFinish||O(),setTimeout(()=>{r||(H.setStatus({code:cn,message:"deadline_exceeded"}),s=PE,H.end())},u),H}function NE(e){const t=ls(e);return Ai(Nt(),t),Ve&&Ce.log("[Tracing] Started span is an idle span"),t}function OE(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;LE(e,t),r&&FE(e,r),BE(e,n),DE(e,o),jE(e,s)}function Jh(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:l,breadcrumbs:u,fingerprint:d,eventProcessors:f,attachments:m,propagationContext:v,transactionName:E,span:C}=t;aa(e,"extra",n),aa(e,"tags",r),aa(e,"attributes",o),aa(e,"user",s),aa(e,"contexts",i),e.sdkProcessingMetadata=Ka(e.sdkProcessingMetadata,l,2),a&&(e.level=a),E&&(e.transactionName=E),C&&(e.span=C),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext={...e.propagationContext,...v}}function aa(e,t,n){e[t]=Ka(e[t],n,1)}function Hy(e,t){const n=v0().getScopeData();return e&&Jh(n,e.getScopeData()),t&&Jh(n,t.getScopeData()),n}function LE(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function DE(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function jE(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function FE(e,t){e.contexts={trace:U0(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:as(t),...e.sdkProcessingMetadata};const n=On(t),r=wt(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function BE(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const Yu=0,Xh=1,Qh=2;function Qa(e){return new Oa(t=>{t(e)})}function sp(e){return new Oa((t,n)=>{n(e)})}class Oa{constructor(t){this._state=Yu,this._handlers=[],this._runExecutor(t)}then(t,n){return new Oa((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Oa((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Yu)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Xh&&n[1](this._value),this._state===Qh&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Yu){if(Di(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Xh,s)},o=s=>{n(Qh,s)};try{t(r,o)}catch(s){o(s)}}}function UE(e,t,n,r=0){try{const o=ef(t,n,e,r);return Di(o)?o:Qa(o)}catch(o){return sp(o)}}function ef(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return Ve&&s===null&&Ce.log(`Event processor "${o.id||"?"}" dropped event`),Di(s)?s.then(i=>ef(i,t,n,r+1)):ef(s,t,n,r+1)}let yo,Zh,em,Ko;function qE(e){const t=vt._sentryDebugIds,n=vt._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Ko&&r.length===Zh&&o.length===em)return Ko;Zh=r.length,em=o.length,Ko={},yo||(yo={});const s=(i,a)=>{for(const l of i){const u=a[l],d=yo==null?void 0:yo[l];if(d&&Ko&&u)Ko[d[0]]=u,yo&&(yo[l]=[d[0],u]);else if(u){const f=e(l);for(let m=f.length-1;m>=0;m--){const v=f[m],E=v==null?void 0:v.filename;if(E&&Ko&&yo){Ko[E]=u,yo[l]=[E,u];break}}}}};return t&&s(r,t),n&&s(o,n),Ko}function HE(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Ir(),timestamp:t.timestamp||Gs()},u=n.integrations||e.integrations.map(M=>M.name);WE(l,e),GE(l,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&VE(l,e.stackParser);const d=YE(r,n.captureContext);n.mechanism&&Ii(l,n.mechanism);const f=o?o.getEventProcessors():[],m=Hy(s,d),v=[...n.attachments||[],...m.attachments];v.length&&(n.attachments=v),OE(l,m);const E=[...f,...m.eventProcessors];return(n.data&&n.data.__sentry__===!0?Qa(l):UE(E,l,n)).then(M=>(M&&zE(M),typeof i=="number"&&i>0?KE(M,i,a):M))}function WE(e,t){var a,l;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||tp,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=Vd(i.url,s)),s&&((l=(a=e.exception)==null?void 0:a.values)==null||l.forEach(u=>{u.value&&(u.value=Vd(u.value,s))}))}function VE(e,t){var r,o;const n=qE(t);(o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.filename&&(l.debug_id=n[l.filename])})})}function zE(e){var r,o;const t={};if((o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.debug_id&&(l.abs_path?t[l.abs_path]=l.debug_id:l.filename&&(t[l.filename]=l.debug_id),delete l.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function GE(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function KE(e,t,n){var o,s;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:wo(i.data,t,n)}}))},...e.user&&{user:wo(e.user,t,n)},...e.contexts&&{contexts:wo(e.contexts,t,n)},...e.extra&&{extra:wo(e.extra,t,n)}};return(o=e.contexts)!=null&&o.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=wo(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:wo(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=wo(e.contexts.flags,3,n)),r}function YE(e,t){if(!t)return e;const n=e?e.clone():new co;return n.update(t),n}function JE(e){if(e)return XE(e)?{captureContext:e}:ZE(e)?{captureContext:e}:e}function XE(e){return e instanceof co||typeof e=="function"}const QE=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ZE(e){return Object.keys(e).some(t=>QE.includes(t))}function ip(e,t){return Nt().captureException(e,JE(t))}function Wy(e,t){return Nt().captureEvent(e,t)}function ek(e,t){Vr().setContext(e,t)}function tk(e,t){Vr().setTag(e,t)}function nk(){const e=Mt();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function tm(e){const t=Vr(),{user:n}=Hy(t,Nt()),{userAgent:r}=vt.navigator||{},o=i0({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&Ci(s,{status:"exited"}),Vy(),t.setSession(o),o}function Vy(){const e=Vr(),n=Nt().getSession()||e.getSession();n&&a0(n),zy(),e.setSession()}function zy(){const e=Vr(),t=Mt(),n=e.getSession();n&&t&&t.captureSession(n)}function Ju(e=!1){if(e){Vy();return}zy()}const rk="7";function ok(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function sk(e){return`${ok(e)}${e.projectId}/envelope/`}function ik(e,t){const n={sentry_version:rk};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ak(e,t,n){return t||`${sk(e)}?${ik(e,n)}`}const nm=[];function lk(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function ck(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return lk(r)}function uk(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Gy(e,r,n)}),n}function rm(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Gy(e,t,n){if(n[t.name]){Ve&&Ce.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!nm.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),nm.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}Ve&&Ce.log(`Integration installed: ${t.name}`)}function dk(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function fk(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Bi(r)),Ks(o,[dk(e)])}function tf(e,t){const n=t??pk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=fk(n,r._metadata,r.tunnel,e.getDsn());Ky().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function pk(e){return Ky().get(e)}function Ky(){return Oi("clientToLogBufferMap",()=>new WeakMap)}function hk(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function mk(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Bi(r)),Ks(o,[hk(e)])}function Yy(e,t){const n=t??gk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=mk(n,r._metadata,r.tunnel,e.getDsn());Jy().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function gk(e){return Jy().get(e)}function Jy(){return Oi("clientToMetricBufferMap",()=>new WeakMap)}function Xy(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ap=Symbol.for("SentryBufferFullError");function lp(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return sp(ap);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Qa(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const l=[a,new Promise(u=>Xy(setTimeout(()=>u(!1),i)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:s}}const vk=60*1e3;function yk(e,t=Ga()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?vk:r-t}function _k(e,t){return e[t]||e.all||0}function bk(e,t,n=Ga()){return _k(e,t)>n}function wk(e,{statusCode:t,headers:n},r=Ga()){const o={...e},s=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,u,,,d]=a.split(":",5),f=parseInt(l,10),m=(isNaN(f)?60:f)*1e3;if(!u)o.all=r+m;else for(const v of u.split(";"))v==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[v]=r+m):o[v]=r+m}else i?o.all=r+yk(i,r):t===429&&(o.all=r+60*1e3);return o}const Qy=64;function Sk(e,t,n=lp(e.bufferSize||Qy)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(Xd(i,(f,m)=>{const v=Wh(m);bk(r,v)?e.recordDroppedEvent("ratelimit_backoff",v):a.push(f)}),a.length===0)return Promise.resolve({});const l=Ks(i[0],a),u=f=>{if(iE(l,["client_report"])){Ve&&Ce.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}Xd(l,(m,v)=>{e.recordDroppedEvent(f,Wh(v))})},d=()=>t({body:aE(l)}).then(f=>f.statusCode===413?(Ve&&Ce.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),f):(Ve&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&Ce.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=wk(r,f),f),f=>{throw u("network_error"),Ve&&Ce.error("Encountered error running transport request:",f),f});return n.add(d).then(f=>f,f=>{if(f===ap)return Ve&&Ce.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function Tk(e,t,n){const r=[{type:"client_report"},{timestamp:Gs(),discarded_events:e}];return Ks(t?{dsn:t}:{},[r])}function Zy(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ek(e){var l;const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=((l=e.contexts)==null?void 0:l.trace)??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i==null?void 0:i[ep],exclusive_time:i==null?void 0:i[Fi],measurements:e.measurements,is_segment:!0}}function kk(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[ep]:e.profile_id},...e.exclusive_time&&{[Fi]:e.exclusive_time}}}},measurements:e.measurements}}const om="Not capturing exception because it's already been captured.",sm="Discarded session because of missing or non-string release",e_=Symbol.for("SentryInternalError"),t_=Symbol.for("SentryDoNotSendEventError"),Ik=5e3;function zl(e){return{message:e,[e_]:!0}}function Xu(e){return{message:e,[t_]:!0}}function im(e){return!!e&&typeof e=="object"&&e_ in e}function am(e){return!!e&&typeof e=="object"&&t_ in e}function lm(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,l=>{s+=r(l),s>=8e5?o(e):a||(a=!0,i=Xy(setTimeout(()=>{o(e)},Ik)))}),e.on("flush",()=>{o(e)})}class Ck{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=lp(((r=t.transportOptions)==null?void 0:r.bufferSize)??Qy),t.dsn?this._dsn=L0(t.dsn):Ve&&Ce.warn("No DSN provided, client will not send events."),this._dsn){const i=ak(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}this._options.enableLogs=this._options.enableLogs??((o=this._options._experiments)==null?void 0:o.enableLogs),this._options.enableLogs&&lm(this,"afterCaptureLog","flushLogs",Mk,tf),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&lm(this,"afterCaptureMetric","flushMetrics",Rk,Yy)}captureException(t,n,r){const o=Ir();if(Nh(t))return Ve&&Ce.log(om),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:Ir(),...r},i=Yf(t)?t:String(t),a=ki(t),l=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>l.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Ir();if(n!=null&&n.originalException&&Nh(n.originalException))return Ve&&Ce.log(om),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,l=i.capturedSpanIsolationScope,u=cm(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),u),s.event_id}captureSession(t){this.sendSession(t),Ci(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){tf(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Gy(this,t,this._integrations),n||rm(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=mE(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=sE(r,uE(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=tp}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){Ve&&Ce.warn(sm);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){Ve&&Ce.warn(sm);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=hE(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;Ve&&Ce.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Ve&&Ce.error("Error while sending envelope:",n),{}}return Ve&&Ce.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=uk(this,t),rm(this,t)}_updateSessionFromEvent(t,n){var l,u;let r=n.level==="fatal",o=!1;const s=(l=n.exception)==null?void 0:l.values;if(s){o=!0,r=!1;for(const d of s)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Ci(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&(i!=null&&i.length)&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),HE(s,t,n,r,this,o).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,...y0(r)},...a.contexts};const l=Ny(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=Nt(),o=Vr()){return Ve&&nf(t)&&Ce.log(`Captured error event \`${Zy(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{Ve&&(am(s)?Ce.log(s.message):im(s)?Ce.warn(s.message):Ce.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=n_(t),l=nf(t),d=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:$a(i);if(l&&typeof f=="number"&&ns()>f)return this.recordDroppedEvent("sample_rate","error"),sp(Xu(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const m=cm(t.type);return this._prepareEvent(t,n,r,o).then(v=>{var H;if(v===null)throw this.recordDroppedEvent("event_processor",m),Xu("An event processor returned `null`, will not send event.");if(((H=n.data)==null?void 0:H.__sentry__)===!0)return v;const C=xk(this,s,v,n);return Ak(C,d)}).then(v=>{var H;if(v===null){if(this.recordDroppedEvent("before_send",m),a){const O=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",O)}throw Xu(`${d} returned \`null\`, will not send event.`)}const E=r.getSession()||o.getSession();if(l&&E&&this._updateSessionFromEvent(E,v),a){const M=((H=v.sdkProcessingMetadata)==null?void 0:H.spanCountBeforeProcessing)||0,O=v.spans?v.spans.length:0,V=M-O;V>0&&this.recordDroppedEvent("before_send","span",V)}const C=v.transaction_info;if(a&&C&&v.transaction!==t.transaction){const M="custom";v.transaction_info={...C,source:M}}return this.sendEvent(v,n),v}).then(null,v=>{throw am(v)||im(v)?v:(this.captureException(v,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:v}),zl(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
27
|
-
Reason: ${v}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ap&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){Ve&&Ce.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ve&&Ce.log("No outcomes to send");return}if(!this._dsn){Ve&&Ce.log("No dsn provided, will not send outcomes");return}Ve&&Ce.log("Sending outcomes:",t);const n=Tk(t,this._options.tunnel&&Bi(this._dsn));this.sendEnvelope(n)}}function cm(e){return e==="replay_event"?"replay":e||"error"}function Ak(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Di(e))return e.then(r=>{if(!Ma(r)&&r!==null)throw zl(n);return r},r=>{throw zl(`${t} rejected with ${r}`)});if(!Ma(e)&&e!==null)throw zl(n);return e}function xk(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Oy(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(nf(l)&&o)return o(l,r);if(n_(l)){if(a||i){const u=Ek(l);if(i!=null&&i.length&&Na(u,i))return null;if(a){const d=a(u);d?l=Ka(n,kk(d)):Yd()}if(l.spans){const d=[],f=l.spans;for(const v of f){if(i!=null&&i.length&&Na(v,i)){Q0(f,v);continue}if(a){const E=a(v);E?d.push(E):(Yd(),d.push(v))}else d.push(v)}const m=l.spans.length-d.length;m&&e.recordDroppedEvent("before_send","span",m),l.spans=d}}if(s){if(l.spans){const u=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(l,r)}}return l}function nf(e){return e.type===void 0}function n_(e){return e.type==="transaction"}function Rk(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+r_(e.attributes)}function Mk(e){let t=0;return e.message&&(t+=e.message.length*2),t+r_(e.attributes)}function r_(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*um(n[0]):ki(n)?t+=um(n):t+=100}),t}function um(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Pk(e){return $c(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function dm(e){return Pk(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function $k(e,t){t.debug===!0&&(Ve?Ce.enable():Fo(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Nt().update(t.initialScope);const r=new e(t);return Nk(r),r.init(),r}function Nk(e){Nt().setClient(e)}const Ok="thismessage:/";function o_(e){return"isRelative"in e}function s_(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Ok:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Lk(e){if(o_(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Hs(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Dk(e){return e.split(/[?#]/,1)[0]}function os(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function jk(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function i_(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:Bs})),o.version=Bs)}function a_(e={}){const t=e.client||Mt();if(!nk()||!t)return{};const n=zs(),r=ji(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||Nt(),s=e.span||sr(),i=s?q0(s):Fk(o),a=s?as(s):Ny(t,o),l=I0(a);if(!ky.test(i))return Ce.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:l};return e.propagateTraceparent&&(d.traceparent=s?H0(s):Bk(o)),d}function Fk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Iy(t,r,n)}function Bk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Cy(t,r,n)}const Uk=100;function pr(e,t){const n=Mt(),r=Vr();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Uk}=n.getOptions();if(s<=0)return;const a={timestamp:Gs(),...e},l=o?Fo(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let fm;const qk="FunctionToString",pm=new WeakMap,Hk=(()=>({name:qk,setupOnce(){fm=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Qf(this),n=pm.has(Mt())&&t!==void 0?t:this;return fm.apply(n,e)}}catch{}},setup(e){pm.set(e,!0)}})),Wk=Hk,Vk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],zk="EventFilters",Gk=(e={})=>{let t;return{name:zk,setup(n){const r=n.getOptions();t=hm(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=hm(e,s)}return Yk(n,t)?null:n}}},Kk=((e={})=>({...Gk(e),name:"InboundFilters"}));function hm(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Vk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Yk(e,t){if(e.type){if(e.type==="transaction"&&Xk(e,t.ignoreTransactions))return Ve&&Ce.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
28
|
-
Event: ${Ns(e)}`),!0}else{if(Jk(e,t.ignoreErrors))return Ve&&Ce.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
29
|
-
Event: ${Ns(e)}`),!0;if(tI(e))return Ve&&Ce.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
30
|
-
Event: ${Ns(e)}`),!0;if(Qk(e,t.denyUrls))return Ve&&Ce.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
31
|
-
Event: ${Ns(e)}.
|
|
32
|
-
Url: ${cc(e)}`),!0;if(!Zk(e,t.allowUrls))return Ve&&Ce.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
33
|
-
Event: ${Ns(e)}.
|
|
34
|
-
Url: ${cc(e)}`),!0}return!1}function Jk(e,t){return t!=null&&t.length?Zy(e).some(n=>rs(n,t)):!1}function Xk(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?rs(n,t):!1}function Qk(e,t){if(!(t!=null&&t.length))return!1;const n=cc(e);return n?rs(n,t):!1}function Zk(e,t){if(!(t!=null&&t.length))return!0;const n=cc(e);return n?rs(n,t):!0}function eI(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function cc(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(s=>{var i,a,l;return((i=s.mechanism)==null?void 0:i.parent_id)===void 0&&((l=(a=s.stacktrace)==null?void 0:a.frames)==null?void 0:l.length)}),o=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return o?eI(o):null}catch{return Ve&&Ce.error(`Cannot extract url for event ${Ns(e)}`),null}}function tI(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function nI(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!No(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=rf(e,t,r,s.originalException,n,o.exception.values,i,0))}function rf(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let l=[...s];if(No(r[o],Error)){mm(i,a,r);const u=e(t,r[o]),d=l.length;gm(u,o,d,a),l=rf(e,t,n,r[o],o,[u,...l],u,d)}return l_(r)&&r.errors.forEach((u,d)=>{if(No(u,Error)){mm(i,a,r);const f=e(t,u),m=l.length;gm(f,`errors[${d}]`,m,a),l=rf(e,t,n,u,o,[f,...l],f,m)}}),l}function l_(e){return Array.isArray(e.errors)}function mm(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...l_(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function gm(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function rI(e){const t="console";fs(t,e),ps(t,oI)}function oI(){"console"in vt&&DT.forEach(function(e){e in vt.console&&fr(vt.console,e,function(t){return sc[e]=t,function(...n){kr("console",{args:n,level:e});const o=sc[e];o==null||o.apply(vt.console,n)}})})}function sI(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const iI="Dedupe",aI=(()=>{let e;return{name:iI,processEvent(t){if(t.type)return t;try{if(cI(t,e))return Ve&&Ce.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),lI=aI;function cI(e,t){return t?!!(uI(e,t)||dI(e,t)):!1}function uI(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!u_(e,t)||!c_(e,t))}function dI(e,t){const n=vm(t),r=vm(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!u_(e,t)||!c_(e,t))}function c_(e,t){let n=Ah(e),r=Ah(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function u_(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function vm(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const fI="ConversationId",pI=(()=>({name:fI,setup(e){e.on("spanStart",t=>{const n=Nt().getScopeData(),r=Vr().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(b0,o)})}})),hI=pI;function mI(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Cr()&&t(i);if(e.endTimestamp){const v=e.fetchData.__span;if(!v)return;const E=r[v];E&&(a&&(yI(E,e),gI(E,e,o)),delete r[v]);return}const{spanOrigin:l="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!sr(),f=a&&d?ls(bI(i,s,l)):new Ar;if(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){const v=e.args[0],E={...e.args[1]||{}},C=vI(v,E,Cr()&&d?f:void 0,u);C&&(e.args[1]=E,E.headers=C)}const m=Mt();if(m){const v={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};m.emit("beforeOutgoingRequestSpan",f,v)}return f}function gI(e,t,n){var o;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(o=t.response)==null?void 0:o.headers,error:t.error})}function vI(e,t,n,r){const o=a_({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const l=t.headers||(Jf(e)?e.headers:void 0);if(l)if(_I(l)){const u=new Headers(l);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?Cl(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(l)){const u=[...l];l.find(f=>f[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!l.find(f=>f[0]==="traceparent")&&u.push(["traceparent",a]);const d=l.find(f=>f[0]==="baggage"&&Cl(f[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,f="baggage"in l?l.baggage:void 0,m=f?Array.isArray(f)?[...f]:[f]:[],v=f&&(Array.isArray(f)?f.find(C=>Cl(C)):Cl(f));i&&!v&&m.push(i);const E={...l,"sentry-trace":u??s,baggage:m.length>0?m.join(","):void 0};return r&&a&&!d&&(E.traceparent=a),E}else return{...o}}function yI(e,t){var n,r;if(t.response){by(e,t.response.status);const o=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(o){const s=parseInt(o);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:cn,message:"internal_error"});e.end()}function Cl(e){return e.split(",").some(t=>t.trim().startsWith(lc))}function _I(e){return typeof Headers<"u"&&No(e,Headers)}function bI(e,t,n){if(e.startsWith("data:")){const s=os(e);return{name:`${t} ${s}`,attributes:ym(e,void 0,t,n)}}const r=s_(e),o=r?Lk(r):e;return{name:`${t} ${o}`,attributes:ym(e,r,t,n)}}function ym(e,t,n,r){const o={url:os(e),type:"fetch","http.method":n,[Xt]:r,[Lo]:"http.client"};return t&&(o_(t)||(o["http.url"]=os(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function d_(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const La=vt;function wI(){return"history"in La&&!!La.history}function SI(){if(!("fetch"in La))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function of(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function TI(){var n;if(typeof EdgeRuntime=="string")return!0;if(!SI())return!1;if(of(La.fetch))return!0;let e=!1;const t=La.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=of(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){Ve&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function f_(e,t){const n="fetch";fs(n,e),ps(n,()=>p_(void 0,t))}function EI(e){const t="fetch-body-resolved";fs(t,e),ps(t,()=>p_(II))}function p_(e,t=!1){t&&!TI()||fr(vt,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=CI(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:tn()*1e3,virtualError:o,headers:AI(r)};return e||kr("fetch",{...a}),n.apply(vt,r).then(async l=>(e?e(l):kr("fetch",{...a,endTimestamp:tn()*1e3,response:l}),l),l=>{kr("fetch",{...a,endTimestamp:tn()*1e3,error:l}),$c(l)&&l.stack===void 0&&(l.stack=o.stack,or(l,"framesToPop",1));const u=Mt(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const v=new URL(a.fetchData.url).host;d==="always"?l.message=`${l.message} (${v})`:or(l,"__sentry_fetch_url_host__",v)}catch{}throw l})}})}async function kI(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function II(e){let t;try{t=e.clone()}catch{return}kI(t,()=>{kr("fetch-body-resolved",{endTimestamp:tn()*1e3,response:e})})}function Gl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function _m(e){return typeof e=="string"?e:e?Gl(e,"url")?e.url:e.toString?e.toString():"":""}function CI(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:_m(n),method:Gl(r,"method")?String(r.method).toUpperCase():Jf(n)&&Gl(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:_m(t),method:Gl(t,"method")?String(t.method).toUpperCase():"GET"}}function AI(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Jf(t))return new Headers(t.headers)}catch{}}function xI(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function RI(){return"npm"}function MI(){return!xI()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function PI(){return typeof window<"u"&&(!MI()||$I())}function $I(){const e=vt.process;return(e==null?void 0:e.type)==="renderer"}const dt=vt;let sf=0;function h_(){return sf>0}function NI(){sf++,setTimeout(()=>{sf--})}function Ri(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Qf(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>Ri(i,t));return e.apply(this,s)}catch(s){throw NI(),Oc(i=>{i.addEventProcessor(a=>(t.mechanism&&(zd(a,void 0),Ii(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),ip(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}fy(r,e),or(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function cp(){const e=Va(),{referrer:t}=dt.document||{},{userAgent:n}=dt.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function up(e,t){const n=dp(e,t),r={type:FI(t),value:BI(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function OI(e,t,n,r){const o=Mt(),s=o==null?void 0:o.getOptions().normalizeDepth,i=VI(t),a={__serialized__:Ly(t,s)};if(i)return{exception:{values:[up(e,i)]},extra:a};const l={exception:{values:[{type:Nc(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:HI(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=dp(e,n);u.length&&(l.exception.values[0].stacktrace={frames:u})}return l}function Qu(e,t){return{exception:{values:[up(e,t)]}}}function dp(e,t){const n=t.stacktrace||t.stack||"",r=DI(t),o=jI(t);try{return e(n,r,o)}catch{}return[]}const LI=/Minified React error #\d+;/i;function DI(e){return e&&LI.test(e.message)?1:0}function jI(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function m_(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function FI(e){const t=e==null?void 0:e.name;return!t&&m_(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function BI(e){const t=e==null?void 0:e.message;return m_(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?dm(t.error):dm(e):"No error message"}function UI(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=fp(e,t,o,r);return Ii(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),Qa(s)}function qI(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=af(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),Qa(i)}function fp(e,t,n,r,o){let s;if(cy(t)&&t.error)return Qu(e,t.error);if(Rh(t)||KT(t)){const i=t;if("stack"in t)s=Qu(e,t);else{const a=i.name||(Rh(i)?"DOMError":"DOMException"),l=i.message?`${a}: ${i.message}`:a;s=af(e,l,n,r),zd(s,l)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return $c(t)?Qu(e,t):Ma(t)||Nc(t)?(s=OI(e,t,n,o),Ii(s,{synthetic:!0}),s):(s=af(e,t,n,r),zd(s,`${t}`),Ii(s,{synthetic:!0}),s)}function af(e,t,n,r){const o={};if(r&&n){const s=dp(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),Ii(o,{synthetic:!0})}if(Yf(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function HI(e,{isUnhandledRejection:t}){const n=e0(e),r=t?"promise rejection":"exception";return cy(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Nc(e)?`Event \`${WI(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function WI(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function VI(e){return Object.values(e).find(t=>t instanceof Error)}class zI extends Ck{constructor(t){var d;const n=GI(t),r=dt.SENTRY_SDK_SOURCE||RI();i_(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:l}=this._options,u=l??(a==null?void 0:a.enableMetrics)??!0;dt.document&&(s||i||u)&&dt.document.addEventListener("visibilitychange",()=>{dt.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&tf(this),u&&Yy(this))}),o&&this.on("beforeSendSession",jk)}eventFromException(t,n){return UI(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return qI(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function GI(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=dt.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Za=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,nt=vt,KI=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",el=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=KI(t.value,n),e(t)))}},tl=(e=!0)=>{var n,r;const t=(r=(n=nt.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ui=()=>{const e=tl();return(e==null?void 0:e.activationStart)??0};function ss(e,t,n){nt.document&&nt.addEventListener(e,t,n)}function uc(e,t,n){nt.document&&nt.removeEventListener(e,t,n)}let wi=-1;const g_=new Set,YI=()=>{var e,t;return((e=nt.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=nt.document)!=null&&t.prerendering)?0:1/0},Kl=e=>{if(JI(e)&&wi>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of g_)t();isFinite(wi)||(wi=e.type==="visibilitychange"?e.timeStamp:0,uc("prerenderingchange",Kl,!0))}},nl=()=>{var e;if(nt.document&&wi<0){const t=Ui();wi=(nt.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??YI(),ss("visibilitychange",Kl,!0),ss("pagehide",Kl,!0),ss("prerenderingchange",Kl,!0)}return{get firstHiddenTime(){return wi},onHidden(t){g_.add(t)}}};function JI(e){var t;return e.type==="pagehide"||((t=nt.document)==null?void 0:t.visibilityState)==="hidden"}const XI=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,rl=(e,t=-1)=>{var s,i;const n=tl();let r="navigate";return n&&((s=nt.document)!=null&&s.prerendering||Ui()>0?r="prerender":(i=nt.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:XI(),navigationType:r}},Zu=new WeakMap;function pp(e,t){try{return Zu.get(e)||Zu.set(e,new t),Zu.get(e)}catch{return new t}}class dc{constructor(){dc.prototype.__init.call(this),dc.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var o;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(o=this._onAfterProcessingUnexpectedShift)==null||o.call(this,t)}}const qi=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},hp=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Fc=e=>{var t;(t=nt.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},QI=[1800,3e3],ZI=(e,t={})=>{Fc(()=>{const n=nl(),r=rl("FCP");let o;const i=qi("paint",a=>{for(const l of a)l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Ui(),0),r.entries.push(l),o(!0)))});i&&(o=el(e,r,QI,t.reportAllChanges))})},eC=[.1,.25],tC=(e,t={})=>{ZI(hp(()=>{var l;const n=rl("CLS",0);let r;const o=nl(),s=pp(t,dc),i=u=>{for(const d of u)s._processEntry(d);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=qi("layout-shift",i);a&&(r=el(e,n,eC,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(l=nt==null?void 0:nt.setTimeout)==null||l.call(nt,r))}))};let v_=0,ed=1/0,Al=0;const nC=e=>{e.forEach(t=>{t.interactionId&&(ed=Math.min(ed,t.interactionId),Al=Math.max(Al,t.interactionId),v_=Al?(Al-ed)/7+1:0)})};let lf;const y_=()=>lf?v_:performance.interactionCount||0,rC=()=>{"interactionCount"in performance||lf||(lf=qi("event",nC,{type:"event",buffered:!0,durationThreshold:0}))},td=10;let __=0;const oC=()=>y_()-__;class fc{constructor(){fc.prototype.__init.call(this),fc.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){__=y_(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(oC()/50));return this._longestInteractionList[t]}_processEntry(t){var o,s;if((o=this._onBeforeProcessingEntry)==null||o.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<td||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>td){const i=this._longestInteractionList.splice(td);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const b_=e=>{var n;const t=nt.requestIdleCallback||nt.setTimeout;((n=nt.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=hp(e),ss("visibilitychange",e,{once:!0,capture:!0}),ss("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),uc("visibilitychange",e,{capture:!0}),uc("pagehide",e,{capture:!0})}))},sC=[200,500],iC=40,aC=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=nl();Fc(()=>{rC();const r=rl("INP");let o;const s=pp(t,fc),i=l=>{b_(()=>{for(const d of l)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=qi("event",i,{durationThreshold:t.durationThreshold??iC});o=el(e,r,sC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class lC{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const cC=[2500,4e3],uC=(e,t={})=>{Fc(()=>{const n=nl(),r=rl("LCP");let o;const s=pp(t,lC),i=l=>{t.reportAllChanges||(l=l.slice(-1));for(const u of l)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Ui(),0),r.entries=[u],o())},a=qi("largest-contentful-paint",i);if(a){o=el(e,r,cC,t.reportAllChanges);const l=hp(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(b_(l),uc(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])ss(d,u,{capture:!0})}})},dC=[800,1800],cf=e=>{var t,n;(t=nt.document)!=null&&t.prerendering?Fc(()=>cf(e)):((n=nt.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>cf(e),!0):setTimeout(e)},fC=(e,t={})=>{const n=rl("TTFB"),r=el(e,n,dC,t.reportAllChanges);cf(()=>{const o=tl();o&&(n.value=Math.max(o.responseStart-Ui(),0),n.entries=[o],r(!0))})},_a={},pc={};let w_,S_,T_,E_;function k_(e,t=!1){return Bc("cls",e,mC,w_,t)}function I_(e,t=!1){return Bc("lcp",e,gC,S_,t)}function pC(e){return Bc("ttfb",e,vC,T_)}function hC(e){return Bc("inp",e,yC,E_)}function Da(e,t){return C_(e,t),pc[e]||(_C(e),pc[e]=!0),A_(e,t)}function ol(e,t){const n=_a[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){Za&&Ce.error(`Error while triggering instrumentation handler.
|
|
35
|
-
Type: ${e}
|
|
36
|
-
Name: ${$o(r)}
|
|
37
|
-
Error:`,o)}}function mC(){return tC(e=>{ol("cls",{metric:e}),w_=e},{reportAllChanges:!0})}function gC(){return uC(e=>{ol("lcp",{metric:e}),S_=e},{reportAllChanges:!0})}function vC(){return fC(e=>{ol("ttfb",{metric:e}),T_=e})}function yC(){return aC(e=>{ol("inp",{metric:e}),E_=e})}function Bc(e,t,n,r,o=!1){C_(e,t);let s;return pc[e]||(s=n(),pc[e]=!0),r&&t({metric:r}),A_(e,t,o?s:void 0)}function _C(e){const t={};e==="event"&&(t.durationThreshold=0),qi(e,n=>{ol(e,{entries:n})},t)}function C_(e,t){_a[e]=_a[e]||[],_a[e].push(t)}function A_(e,t,n){return()=>{n&&n();const r=_a[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function bC(e){return"duration"in e}const wC=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=nt.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};ss("visibilitychange",t,{capture:!0,once:!0}),ss("pagehide",t,{capture:!0,once:!0})};function nd(e){return typeof e=="number"&&isFinite(e)}function cs(e,t,n,{...r}){const o=wt(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),np(e,()=>{const s=ls({startTime:t,...r});return s&&s.end(n),s})}function mp(e){var H;const t=Mt();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:l}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),f=Nt(),m=f.getUser(),v=m!==void 0?m.email||m.id||m.ip_address:void 0;let E;try{E=f.getScopeData().contexts.profile.profile_id}catch{}const C={release:i,environment:a,user:v||void 0,profile_id:E||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(H=nt.navigator)==null?void 0:H.userAgent,"client.address":l?"{{auto}}":void 0,...o};return ls({name:n,attributes:C,startTime:s,experimental:{standalone:!0}})}function Uc(){return nt.addEventListener&&nt.performance}function un(e){return e/1e3}function SC(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function x_(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function R_(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}wC(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,l)=>{l!=null&&l.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a.spanContext().spanId,i()})}function TC(e){let t=0,n;if(!x_("layout-shift"))return;const r=k_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);R_(e,(o,s)=>{EC(t,n,s,o),r()})}function EC(e,t,n,r){var u;Za&&Ce.log(`Sending CLS span (${e})`);const o=t?un((Rr()||0)+t.startTime):tn(),s=Nt().getScopeData().transactionName,i=t?xr((u=t.sources[0])==null?void 0:u.node):"Layout shift",a={[Xt]:"auto.http.browser.cls",[Lo]:"ui.webvital.cls",[Fi]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,f)=>{a[`cls.source.${f+1}`]=xr(d.node)});const l=mp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("cls",{[Ya]:"",[Ja]:e}),l.end(o))}function kC(e){let t=0,n;if(!x_("largest-contentful-paint"))return;const r=I_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);R_(e,(o,s)=>{IC(t,n,s,o),r()})}function IC(e,t,n,r){Za&&Ce.log(`Sending LCP span (${e})`);const o=un((Rr()||0)+((t==null?void 0:t.startTime)||0)),s=Nt().getScopeData().transactionName,i=t?xr(t.element):"Largest contentful paint",a={[Xt]:"auto.http.browser.lcp",[Lo]:"ui.webvital.lcp",[Fi]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=xr(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const l=mp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[Ya]:"millisecond",[Ja]:e}),l.end(o))}function Sr(e){return e&&((Rr()||performance.timeOrigin)+e)/1e3}function M_(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=SC(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return Rr()||(n=Uc())!=null&&n.timeOrigin?CC({...t,"http.request.redirect_start":Sr(e.redirectStart),"http.request.redirect_end":Sr(e.redirectEnd),"http.request.worker_start":Sr(e.workerStart),"http.request.fetch_start":Sr(e.fetchStart),"http.request.domain_lookup_start":Sr(e.domainLookupStart),"http.request.domain_lookup_end":Sr(e.domainLookupEnd),"http.request.connect_start":Sr(e.connectStart),"http.request.secure_connection_start":Sr(e.secureConnectionStart),"http.request.connection_end":Sr(e.connectEnd),"http.request.request_start":Sr(e.requestStart),"http.request.response_start":Sr(e.responseStart),"http.request.response_end":Sr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function CC(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const AC=2147483647;let bm=0,Dr={},tr,pi;function xC({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Uc();if(r&&Rr()){r.mark&&nt.performance.mark("sentry-tracing-init");const o=t?kC(n):NC(),s=OC(),i=e?TC(n):$C();return()=>{o==null||o(),s(),i==null||i()}}return()=>{}}function RC(){Da("longtask",({entries:e})=>{const t=sr();if(!t)return;const{op:n,start_timestamp:r}=wt(t);for(const o of e){const s=un(Rr()+o.startTime),i=un(o.duration);n==="navigation"&&r&&s<r||cs(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Xt]:"auto.ui.browser.metrics"}})}})}function MC(){new PerformanceObserver(t=>{const n=sr();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=un(Rr()+r.startTime),{start_timestamp:s,op:i}=wt(n);if(i==="navigation"&&s&&o<s)continue;const a=un(r.duration),l={[Xt]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:f,sourceURL:m,sourceFunctionName:v,sourceCharPosition:E}=u;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=f,m&&(l["code.filepath"]=m),v&&(l["code.function"]=v),E!==-1&&(l["browser.script.source_char_position"]=E),cs(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function PC(){Da("event",({entries:e})=>{const t=sr();if(t){for(const n of e)if(n.name==="click"){const r=un(Rr()+n.startTime),o=un(n.duration),s={name:xr(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Xt]:"auto.ui.browser.metrics"}},i=dy(n.target);i&&(s.attributes["ui.component_name"]=i),cs(t,r,r+o,s)}}})}function $C(){return k_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Dr.cls={value:e.value,unit:""},pi=t)},!0)}function NC(){return I_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Dr.lcp={value:e.value,unit:"millisecond"},tr=t)},!0)}function OC(){return pC(({metric:e})=>{e.entries[e.entries.length-1]&&(Dr.ttfb={value:e.value,unit:"millisecond"})})}function LC(e,t){const n=Uc(),r=Rr();if(!(n!=null&&n.getEntries)||!r)return;const o=un(r),s=n.getEntries(),{op:i,start_timestamp:a}=wt(e);s.slice(bm).forEach(l=>{const u=un(l.startTime),d=un(Math.max(0,l.duration));if(!(i==="navigation"&&a&&o+u<a))switch(l.entryType){case"navigation":{BC(e,l,o);break}case"mark":case"paint":case"measure":{jC(e,l,u,d,o,t.ignorePerformanceApiSpans);const f=nl(),m=l.startTime<f.firstHiddenTime;l.name==="first-paint"&&m&&(Dr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&m&&(Dr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{HC(e,l,l.name,u,d,o,t.ignoreResourceSpans);break}}}),bm=Math.max(s.length-1,0),WC(e),i==="pageload"&&(GC(Dr),t.recordClsOnPageloadSpan||delete Dr.cls,t.recordLcpOnPageloadSpan||delete Dr.lcp,Object.entries(Dr).forEach(([l,u])=>{_E(l,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Ui()),VC(e,t)),tr=void 0,pi=void 0,Dr={}}function DC(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function jC(e,t,n,r,o,s){if(DC(t)||["mark","measure"].includes(t.entryType)&&rs(t.name,s))return;const i=tl(!1),a=un(i?i.requestStart:0),l=o+Math.max(n,a),u=o+n,d=u+r,f={[Xt]:"auto.resource.browser.metrics"};l!==u&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),FC(f,t),l<=d&&cs(e,l,d,{name:t.name,op:t.entryType,attributes:f})}function FC(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&ki(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(ki(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function BC(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{xl(e,t,r,n)}),xl(e,t,"secureConnection",n,"TLS/SSL"),xl(e,t,"fetch",n,"cache"),xl(e,t,"domainLookup",n,"DNS"),qC(e,t,n)}function xl(e,t,n,r,o=n){const s=UC(n),i=t[s],a=t[`${n}Start`];!a||!i||cs(e,r+un(a),r+un(i),{op:`browser.${o}`,name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function UC(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function qC(e,t,n){const r=n+un(t.requestStart),o=n+un(t.responseEnd),s=n+un(t.responseStart);t.responseEnd&&(cs(e,r,o,{op:"browser.request",name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics"}}),cs(e,s,o,{op:"browser.response",name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics"}}))}function HC(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i!=null&&i.includes(a))return;const l={[Xt]:"auto.resource.browser.metrics"},u=Hs(n);u.protocol&&(l["url.scheme"]=u.protocol.split(":").pop()),u.host&&(l["server.address"]=u.host),l["url.same_origin"]=n.includes(nt.location.origin),zC(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...l,...M_(t)},f=s+r,m=f+o;cs(e,f,m,{name:n.replace(nt.location.origin,""),op:a,attributes:d})}function WC(e){const t=nt.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),nd(n.rtt)&&(Dr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),nd(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),nd(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function VC(e,t){tr&&t.recordLcpOnPageloadSpan&&(tr.element&&e.setAttribute("lcp.element",xr(tr.element)),tr.id&&e.setAttribute("lcp.id",tr.id),tr.url&&e.setAttribute("lcp.url",tr.url.trim().slice(0,200)),tr.loadTime!=null&&e.setAttribute("lcp.loadTime",tr.loadTime),tr.renderTime!=null&&e.setAttribute("lcp.renderTime",tr.renderTime),e.setAttribute("lcp.size",tr.size)),pi!=null&&pi.sources&&t.recordClsOnPageloadSpan&&pi.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,xr(n.node)))}function zC(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<AC||typeof s=="string")&&(t[o]=s)})}function GC(e){const t=tl(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const KC=1e3;let wm,uf,df;function YC(e){fs("dom",e),ps("dom",JC)}function JC(){if(!nt.document)return;const e=kr.bind(null,"dom"),t=Sm(e,!0);nt.document.addEventListener("click",t,!1),nt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=nt[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(fr(o,"addEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=f[l]=f[l]||{refCount:0};if(!m.handler){const v=Sm(e);m.handler=v,a.call(this,l,v,d)}m.refCount++}catch{}return a.call(this,l,u,d)}}),fr(o,"removeEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},m=f[l];m&&(m.refCount--,m.refCount<=0&&(a.call(this,l,m.handler,d),m.handler=void 0,delete f[l]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,u,d)}}))})}function XC(e){if(e.type!==uf)return!1;try{if(!e.target||e.target._sentryId!==df)return!1}catch{}return!0}function QC(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Sm(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=ZC(n);if(QC(n.type,r))return;or(n,"_sentryCaptured",!0),r&&!r._sentryId&&or(r,"_sentryId",Ir());const o=n.type==="keypress"?"input":n.type;XC(n)||(e({event:n,name:o,global:t}),uf=n.type,df=r?r._sentryId:void 0),clearTimeout(wm),wm=nt.setTimeout(()=>{df=void 0,uf=void 0},KC)}}function ZC(e){try{return e.target}catch{return null}}let Rl;function gp(e){const t="history";fs(t,e),ps(t,eA)}function eA(){if(nt.addEventListener("popstate",()=>{const t=nt.location.href,n=Rl;if(Rl=t,n===t)return;kr("history",{from:n,to:t})}),!wI())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Rl,s=tA(String(r));if(Rl=s,o===s)return t.apply(this,n);kr("history",{from:o,to:s})}return t.apply(this,n)}}fr(nt.history,"pushState",e),fr(nt.history,"replaceState",e)}function tA(e){try{return new URL(e,nt.location.origin).toString()}catch{return e}}const Yl={};function nA(e){const t=Yl[e];if(t)return t;let n=nt[e];if(of(n))return Yl[e]=n.bind(nt);const r=nt.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s!=null&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){Za&&Ce.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Yl[e]=n.bind(nt))}function rA(e){Yl[e]=void 0}const hi="__sentry_xhr_v3__";function P_(e){fs("xhr",e),ps("xhr",oA)}function oA(){if(!nt.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=tn()*1e3,i=Co(r[0])?r[0].toUpperCase():void 0,a=sA(r[1]);if(!i||!a)return t.apply(n,r);n[hi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const u=n[hi];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:tn()*1e3,startTimestamp:s,xhr:n,virtualError:o};kr("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,f){return l(),u.apply(d,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,f){const[m,v]=f,E=d[hi];return E&&Co(m)&&Co(v)&&(E.request_headers[m.toLowerCase()]=v),u.apply(d,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[hi];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:tn()*1e3,xhr:n};return kr("xhr",s),t.apply(n,r)}})}function sA(e){if(Co(e))return e;try{return e.toString()}catch{}}function iA(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Za&&Ce.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
38
|
-
`).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const rd=[],Jl=new Map,ai=new Map,aA=60;function lA(){if(Uc()&&Rr()){const t=cA();return()=>{t()}}return()=>{}}const ff={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function cA(){return hC(uA)}const uA=({metric:e})=>{if(e.value==null)return;const t=un(e.value);if(t>aA)return;const n=e.entries.find(E=>E.duration===e.value&&ff[E.name]);if(!n)return;const{interactionId:r}=n,o=ff[n.name],s=un(Rr()+n.startTime),i=sr(),a=i?On(i):void 0,l=r!=null?Jl.get(r):void 0,u=(l==null?void 0:l.span)||a,d=u?wt(u).description:Nt().getScopeData().transactionName,f=(l==null?void 0:l.elementName)||xr(n.target),m={[Xt]:"auto.http.browser.inp",[Lo]:`ui.interaction.${o}`,[Fi]:n.duration},v=mp({name:f,transaction:d,attributes:m,startTime:s});v&&(v.addEvent("inp",{[Ya]:"millisecond",[Ja]:e.value}),v.end(s+t))};function dA(){const e=Object.keys(ff);PI()&&e.forEach(o=>{nt.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=xr(s),a=Math.round(o.timeStamp);if(ai.set(a,i),ai.size>50){const l=ai.keys().next().value;l!==void 0&&ai.delete(l)}}function n(o){const s=Math.round(o.startTime);let i=ai.get(s);if(!i)for(let a=-5;a<=5;a++){const l=ai.get(s+a);if(l){i=l;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=sr(),i=s&&On(s);o.forEach(a=>{if(!bC(a))return;const l=a.interactionId;if(l==null||Jl.has(l))return;const u=a.target?xr(a.target):n(a);if(rd.length>10){const d=rd.shift();Jl.delete(d)}rd.push(l),Jl.set(l,{span:i,elementName:u})})};Da("event",r),Da("first-input",r)}const fA=40;function pA(e,t=nA("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw rA("fetch"),l}finally{n-=i,r--}}return Sk(e,o,lp(e.bufferSize||fA))}const hr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,hA=30,mA=50;function pf(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?Ws:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const gA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yA=/\((\S*)(?::(\d+))(?::(\d+))\)/,_A=/at (.+?) ?\(data:(.+?),/,bA=e=>{var o;const t=e.match(_A);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=gA.exec(e);if(n){const[,s,i,a]=n;return pf(s,Ws,+i,+a)}const r=vA.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const l=yA.exec(r[2]);l&&(r[2]=l[1],r[3]=l[2],r[4]=l[3])}const[i,a]=$_(r[1]||Ws,r[2]);return pf(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},wA=[hA,bA],SA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,TA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,EA=e=>{const t=SA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=TA.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||Ws;return[o,r]=$_(o,r),pf(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},kA=[mA,EA],IA=[wA,kA],CA=oy(...IA),$_=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Ws,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ml=1024,AA="Breadcrumbs",xA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:AA,setup(n){t.console&&rI($A(n)),t.dom&&YC(PA(n,t.dom)),t.xhr&&P_(NA(n)),t.fetch&&f_(OA(n)),t.history&&gp(LA(n)),t.sentry&&n.on("beforeSendEvent",MA(n))}}}),RA=xA;function MA(e){return function(n){Mt()===e&&pr({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ns(n)},{event:n})}}function PA(e,t){return function(r){if(Mt()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Ml&&(hr&&Ce.warn(`\`dom.maxStringLength\` cannot exceed ${Ml}, but a value of ${a} was configured. Sentry will use ${Ml} instead.`),a=Ml),typeof i=="string"&&(i=[i]);try{const u=r.event,d=DA(u)?u.target:u;o=xr(d,{keyAttrs:i,maxStringLength:a}),s=dy(d)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${r.name}`,message:o};s&&(l.data={"ui.component_name":s}),pr(l,{event:r.event,name:r.name,global:r.global})}}function $A(e){return function(n){if(Mt()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:sI(n.level),message:$h(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${$h(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;pr(r,{input:n.args,level:n.level})}}function NA(e){return function(n){if(Mt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[hi];if(!r||!o||!s)return;const{method:i,url:a,status_code:l,body:u}=s,d={method:i,url:a,status_code:l},f={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},m={category:"xhr",data:d,type:"http",level:d_(l)};e.emit("beforeOutgoingRequestBreadcrumb",m,f),pr(m,f)}}function OA(e){return function(n){if(Mt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),pr(i,s)}else{const s=n.response,i={...n.fetchData,status_code:s==null?void 0:s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:i,type:"http",level:d_(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),pr(l,a)}}}function LA(e){return function(n){if(Mt()!==e)return;let r=n.from,o=n.to;const s=Hs(dt.location.href);let i=r?Hs(r):void 0;const a=Hs(o);i!=null&&i.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),pr({category:"navigation",data:{from:r,to:o}})}}function DA(e){return!!e&&!!e.target}const jA="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),FA="BrowserApiErrors",BA=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:FA,setupOnce(){t.setTimeout&&fr(dt,"setTimeout",Tm),t.setInterval&&fr(dt,"setInterval",Tm),t.requestAnimationFrame&&fr(dt,"requestAnimationFrame",qA),t.XMLHttpRequest&&"XMLHttpRequest"in dt&&fr(XMLHttpRequest.prototype,"send",HA);const n=t.eventTarget;n&&(Array.isArray(n)?n:jA).forEach(o=>WA(o,t))}}}),UA=BA;function Tm(e){return function(...t){const n=t[0];return t[0]=Ri(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${$o(e)}`}}),e.apply(this,t)}}function qA(e){return function(t){return e.apply(this,[Ri(t,{mechanism:{data:{handler:$o(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function HA(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&fr(n,o,function(s){const i={mechanism:{data:{handler:$o(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Qf(s);return a&&(i.mechanism.data.handler=$o(a)),Ri(s,i)})}),e.apply(this,t)}}function WA(e,t){var o,s;const r=(o=dt[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(fr(r,"addEventListener",function(i){return function(a,l,u){try{VA(l)&&(l.handleEvent=Ri(l.handleEvent,{mechanism:{data:{handler:$o(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&zA(this,a,l),i.apply(this,[a,Ri(l,{mechanism:{data:{handler:$o(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),fr(r,"removeEventListener",function(i){return function(a,l,u){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,u)}catch{}return i.call(this,a,l,u)}}))}function VA(e){return typeof e.handleEvent=="function"}function zA(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const GA=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof dt.document>"u"){hr&&Ce.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}tm({ignoreDuration:!0}),Ju();const n=Vr();let r=n.getUser();n.addScopeListener(o=>{const s=o.getUser();((r==null?void 0:r.id)!==(s==null?void 0:s.id)||(r==null?void 0:r.ip_address)!==(s==null?void 0:s.ip_address))&&(Ju(),r=s)}),t==="route"&&gp(({from:o,to:s})=>{o!==s&&(tm({ignoreDuration:!0}),Ju())})}}},KA="CultureContext",YA=(()=>({name:KA,preprocessEvent(e){var n;const t=XA();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}})),JA=YA;function XA(){try{const e=dt.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const QA="GlobalHandlers",ZA=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:QA,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(tx(n),Em("onerror")),t.onunhandledrejection&&(nx(n),Em("onunhandledrejection"))}}}),ex=ZA;function tx(e){iy(t=>{const{stackParser:n,attachStacktrace:r}=N_();if(Mt()!==e||h_())return;const{msg:o,url:s,line:i,column:a,error:l}=t,u=sx(fp(n,l||o,void 0,r,!1),s,i,a);u.level="error",Wy(u,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function nx(e){ay(t=>{const{stackParser:n,attachStacktrace:r}=N_();if(Mt()!==e||h_())return;const o=rx(t),s=ki(o)?ox(o):fp(n,o,void 0,r,!0);s.level="error",Wy(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function rx(e){if(ki(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function ox(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function sx(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:ix(t)??Va(),function:Ws,in_app:!0}),e}function Em(e){hr&&Ce.log(`Global Handler attached: ${e}`)}function N_(){const e=Mt();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function ix(e){if(!(!Co(e)||e.length===0))return e.startsWith("data:")?`<${os(e,!1)}>`:e}const ax=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!dt.navigator&&!dt.location&&!dt.document)return;const t=cp(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),lx="cause",cx=5,ux="LinkedErrors",dx=((e={})=>{const t=e.limit||cx,n=e.key||lx;return{name:ux,preprocessEvent(r,o,s){const i=s.getOptions();nI(up,i.stackParser,n,t,r,o)}}}),fx=dx;function px(){return hx()?(hr&&Fo(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function hx(){var o;if(typeof dt.window>"u")return!1;const e=dt;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const n=Va();return!(dt===dt.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function O_(e){return[Kk(),Wk(),hI(),UA(),RA(),ex(),fx(),lI(),ax(),JA(),GA()]}function mx(e={}){const t=!e.skipBrowserExtensionCheck&&px();let n=e.defaultIntegrations==null?O_():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:WT(e.stackParser||CA),integrations:ck({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||pA};return $k(zI,r)}function gx(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function L_(e){try{return new URL(e,dt.location.origin).href}catch{return}}function vx(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function D_(e){try{return new Headers(e)}catch{return}}const km=new WeakMap,od=new Map,j_={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function yx(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:l,onRequestSpanEnd:u}={...j_,...t},d=typeof s=="function"?s:E=>!0,f=E=>bx(E,a),m={},v=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(E=>(E.type==="transaction"&&E.spans&&E.spans.forEach(C=>{if(C.op==="http.client"){const H=od.get(C.span_id);H&&(C.timestamp=H/1e3,od.delete(C.span_id))}}),E)),o&&EI(E=>{if(E.response){const C=km.get(E.response);C&&E.endTimestamp&&od.set(C,E.endTimestamp)}}),f_(E=>{const C=mI(E,d,f,m,{propagateTraceparent:v,onRequestSpanEnd:u});if(E.response&&E.fetchData.__span&&km.set(E.response,E.fetchData.__span),C){const H=L_(E.fetchData.url),M=H?Hs(H).host:void 0;C.setAttributes({"http.url":H?os(H):void 0,"server.address":M}),i&&Im(C,e),l==null||l(C,{headers:E.headers})}})),r&&P_(E=>{var H;const C=wx(E,d,f,m,v,u);C&&(i&&Im(C,e),l==null||l(C,{headers:D_((H=E.xhr.__sentry_xhr_v3__)==null?void 0:H.request_headers)}))})}const _x=300;function Im(e,t){const{url:n}=wt(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(Xa(t)){const s=e.end.bind(e);e.end=i=>{const a=i??tn();let l=!1;const u=()=>{l||(l=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,_x)}}const o=Da("resource",({entries:s})=>{s.forEach(i=>{vx(i)&&i.name.endsWith(n)&&(e.setAttributes(M_(i)),r())})})}function bx(e,t){const n=Va();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?rs(r.toString(),t)||s&&rs(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?rs(e,t):r}}function wx(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[hi];if(!i||i.__sentry_own_request__||!a)return;const{url:l,method:u}=a,d=Cr()&&t(l);if(e.endTimestamp){const M=i.__sentry_xhr_span_id__;if(!M)return;const O=r[M];O&&(d&&a.status_code!==void 0&&(by(O,a.status_code),O.end(),s==null||s(O,{headers:D_(iA(i)),error:e.error})),delete r[M]);return}const f=L_(l),m=Hs(f||l),v=os(Dk(l)),E=!!sr(),C=d&&E?ls({name:`${u} ${v}`,attributes:{url:os(l),type:"xhr","http.method":u,"http.url":f?os(f):void 0,"server.address":m==null?void 0:m.host,[Xt]:"auto.http.browser",[Lo]:"http.client",...(m==null?void 0:m.search)&&{"http.query":m==null?void 0:m.search},...(m==null?void 0:m.hash)&&{"http.fragment":m==null?void 0:m.hash}}}):new Ar;i.__sentry_xhr_span_id__=C.spanContext().spanId,r[i.__sentry_xhr_span_id__]=C,n(l)&&Sx(i,Cr()&&E?C:void 0,o);const H=Mt();return H&&H.emit("beforeOutgoingRequestSpan",C,e),C}function Sx(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=a_({span:t,propagateTraceparent:n});r&&Tx(e,r,o,s)}function Tx(e,t,n,r){var s;const o=(s=e.__sentry_xhr_v3__)==null?void 0:s.request_headers;if(!(o!=null&&o["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(o!=null&&o.traceparent)&&e.setRequestHeader("traceparent",r),n){const i=o==null?void 0:o.baggage;(!i||!gx(i))&&e.setRequestHeader("baggage",n)}}catch{}}function Ex(){dt.document?dt.document.addEventListener("visibilitychange",()=>{const e=sr();if(!e)return;const t=On(e);if(dt.document.hidden&&t){const n="cancelled",{op:r,status:o}=wt(t);hr&&Ce.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:cn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):hr&&Ce.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const kx=3600,F_="sentry_previous_trace",Ix="sentry.previous_trace";function Cx(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?Rx():void 0;e.on("spanStart",i=>{if(On(i)!==i)return;const a=Nt().getPropagationContext();o=Ax(o,i,a),r&&xx(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=Nt(),l=a.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(hf(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=hf(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[yy]:o.sampleRate}})}function Ax(e,t,n){const r=wt(t);function o(){var a,l;try{return Number((a=n.dsc)==null?void 0:a.sample_rate)??Number((l=r.data)==null?void 0:l[Zf])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=kx&&(hr&&Ce.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[_0]:"previous_trace"}}),t.setAttribute(Ix,`${i.traceId}-${i.spanId}-${hf(i)?1:0}`)),s)}function xx(e){try{dt.sessionStorage.setItem(F_,JSON.stringify(e))}catch(t){hr&&Ce.warn("Could not store previous trace in sessionStorage",t)}}function Rx(){var e;try{const t=(e=dt.sessionStorage)==null?void 0:e.getItem(F_);return JSON.parse(t)}catch{return}}function hf(e){return e.traceFlags===1}const Mx="BrowserTracing",Px=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function $x(){const e=dt.navigator;return e!=null&&e.userAgent?Px.test(e.userAgent):!1}const Nx={...Vl,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...j_},Cm=((e={})=>{"enableElementTiming"in e&&Fo(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=dt.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:u,idleTimeout:d,finalTimeout:f,childSpanTimeout:m,markBackgroundSpan:v,traceFetch:E,traceXHR:C,trackFetchStreamPerformance:H,shouldCreateSpanForRequest:M,enableHTTPTimings:O,ignoreResourceSpans:V,ignorePerformanceApiSpans:K,instrumentPageLoad:de,instrumentNavigation:oe,detectRedirects:ee,linkPreviousTrace:ve,consistentTraceSampling:Pe,enableReportPageLoaded:Re,onRequestSpanStart:De,onRequestSpanEnd:Q}={...Nx,...e},pe=$x();let Me,qe,_e;function Te(le,Ee,Fe=!0){const Ne=Ee.op==="pageload",Ge=Ee.name,Ke=u?u(Ee):Ee,Ye=Ke.attributes||{};if(Ge!==Ke.name&&(Ye[Tr]="custom",Ke.attributes=Ye),!Fe){const Y=Gs();ls({...Ke,startTime:Y}).end(Y);return}t.name=Ke.name,t.source=Ye[Tr];const lt=qy(Ke,{idleTimeout:d,finalTimeout:f,childSpanTimeout:m,disableAutoFinish:Ne,beforeSpanEnd:Y=>{Me==null||Me(),LC(Y,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:V,ignorePerformanceApiSpans:K}),Rm(le,void 0);const Se=Nt(),he=Se.getPropagationContext();Se.setPropagationContext({...he,traceId:lt.spanContext().traceId,sampled:hs(lt),dsc:as(Y)}),Ne&&(_e=void 0)},trimIdleSpanEndTimestamp:!Re});Ne&&Re&&(_e=lt),Rm(le,lt);function Xe(){n&&["interactive","complete"].includes(n.readyState)&&le.emit("idleSpanEnableAutoFinish",lt)}Ne&&!Re&&n&&(n.addEventListener("readystatechange",()=>{Xe()}),Xe())}return{name:Mx,setup(le){var Fe;if(pe){hr&&Ce.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(X0(),Me=xC({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:le}),r&&lA(),s&&vt.PerformanceObserver&&((Fe=PerformanceObserver.supportedEntryTypes)!=null&&Fe.includes("long-animation-frame"))?MC():o&&RC(),i&&PC(),ee&&n){const Ne=()=>{qe=tn()};addEventListener("click",Ne,{capture:!0}),addEventListener("keydown",Ne,{capture:!0,passive:!0})}function Ee(){const Ne=ja(le);Ne&&!wt(Ne).timestamp&&(hr&&Ce.log(`[Tracing] Finishing current active span with op: ${wt(Ne).op}`),Ne.setAttribute(Pa,"cancelled"),Ne.end())}le.on("startNavigationSpan",(Ne,Ge)=>{if(Mt()!==le)return;if(Ge!=null&&Ge.isRedirect){hr&&Ce.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Te(le,{op:"navigation.redirect",...Ne},!1);return}qe=void 0,Ee(),Vr().setPropagationContext({traceId:Oo(),sampleRand:Math.random(),propagationSpanId:Cr()?void 0:Ao()});const Ke=Nt();Ke.setPropagationContext({traceId:Oo(),sampleRand:Math.random(),propagationSpanId:Cr()?void 0:Ao()}),Ke.setSDKProcessingMetadata({normalizedRequest:void 0}),Te(le,{op:"navigation",...Ne,parentSpan:null,forceTransaction:!0})}),le.on("startPageLoadSpan",(Ne,Ge={})=>{if(Mt()!==le)return;Ee();const Ke=Ge.sentryTrace||Am("sentry-trace")||xm("sentry-trace"),Ye=Ge.baggage||Am("baggage")||xm("baggage"),lt=j0(Ke,Ye),Xe=Nt();Xe.setPropagationContext(lt),Cr()||(Xe.getPropagationContext().propagationSpanId=Ao()),Xe.setSDKProcessingMetadata({normalizedRequest:cp()}),Te(le,{op:"pageload",...Ne})}),le.on("endPageloadSpan",()=>{Re&&_e&&(_e.setAttribute(Pa,"reportPageLoaded"),_e.end())})},afterAllSetup(le){if(pe)return;let Ee=Va();if(ve!=="off"&&Cx(le,{linkPreviousTrace:ve,consistentTraceSampling:Pe}),dt.location){if(de){const Fe=Rr();Ox(le,{name:dt.location.pathname,startTime:Fe?Fe/1e3:void 0,attributes:{[Tr]:"url",[Xt]:"auto.pageload.browser"}})}oe&&gp(({to:Fe,from:Ne})=>{if(Ne===void 0&&(Ee==null?void 0:Ee.indexOf(Fe))!==-1){Ee=void 0;return}Ee=void 0;const Ge=s_(Fe),Ke=ja(le),Ye=Ke&&ee&&Dx(Ke,qe);B_(le,{name:(Ge==null?void 0:Ge.pathname)||dt.location.pathname,attributes:{[Tr]:"url",[Xt]:"auto.navigation.browser"}},{url:Fe,isRedirect:Ye})})}v&&Ex(),i&&Lx(le,d,f,m,t),r&&dA(),yx(le,{traceFetch:E,traceXHR:C,trackFetchStreamPerformance:H,tracePropagationTargets:le.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:M,enableHTTPTimings:O,onRequestSpanStart:De,onRequestSpanEnd:Q})}}});function Ox(e,t,n){e.emit("startPageLoadSpan",t,n),Nt().setTransactionName(t.name);const r=ja(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function B_(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=Nt();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...cp(),url:r}}),ja(e)}function Am(e){const t=dt.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function xm(e){var r,o,s;const t=(o=(r=dt.performance)==null?void 0:r.getEntriesByType)==null?void 0:o.call(r,"navigation")[0],n=(s=t==null?void 0:t.serverTiming)==null?void 0:s.find(i=>i.name===e);return n==null?void 0:n.description}function Lx(e,t,n,r,o){const s=dt.document;let i;const a=()=>{const l="ui.action.click",u=ja(e);if(u){const d=wt(u).op;if(["navigation","pageload"].includes(d)){hr&&Ce.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Pa,"interactionInterrupted"),i.end(),i=void 0),!o.name){hr&&Ce.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}i=qy({name:o.name,op:l,attributes:{[Tr]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const U_="_sentry_idleSpan";function ja(e){return e[U_]}function Rm(e,t){or(e,U_,t)}const Mm=1.5;function Dx(e,t){const n=wt(e),r=Gs(),o=n.start_timestamp;return!(r-o>Mm||t&&r-t<=Mm)}const q_=["activate","mount"],H_=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,jx=/(?:^|[-_])(\w)/g,Fx=e=>e.replace(jx,t=>t.toUpperCase()).replace(/[-_]/g,""),Bx="<Root>",sd="<Anonymous>",Ux=(e,t)=>e.repeat(t),ba=(e,t)=>{if(!e)return sd;if(e.$root===e)return Bx;if(!e.$options)return sd;const n=e.$options;let r=n.name||n._componentTag||n.__name;const o=n.__file;if(!r&&o){const s=o.match(/([^/\\]+)\.vue$/);s&&(r=s[1])}return(r?`<${Fx(r)}>`:sd)+(o&&t!==!1?` at ${o}`:"")},qx=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const o=t[t.length-1];if(o.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[o,n],n=0)}t.push(e),e=e.$parent}return`
|
|
39
|
-
|
|
40
|
-
found in
|
|
41
|
-
|
|
42
|
-
${t.map((o,s)=>`${(s===0?"---> ":Ux(" ",5+s*2))+(Array.isArray(o)?`${ba(o[0])}... (${o[1]} recursive calls)`:ba(o))}`).join(`
|
|
43
|
-
`)}`}return`
|
|
44
|
-
|
|
45
|
-
(found in ${ba(e)})`},Hx=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,o,s)=>{var u;const i=ba(o,!1),a=o?qx(o):"",l={componentName:i,lifecycleHook:s,trace:a};if((t==null?void 0:t.attachProps)!==!1&&o&&((u=o.$options)!=null&&u.propsData?l.propsData=o.$options.propsData:o.$props&&(l.propsData=o.$props)),setTimeout(()=>{ip(r,{captureContext:{contexts:{vue:l}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,o,s);else throw r}},Pm="ui.vue",Wx={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function id(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function Vx(e,t){function n(o){return o.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(o=>n(t)===n(o))}const zx=(e={})=>{const t=(e.hooks||[]).concat(q_).filter((o,s,i)=>i.indexOf(o)===s),n={},r=e.timeout||2e3;for(const o of t){const s=Wx[o];if(!s){H_&&Ce.warn(`Unknown hook: ${o}`);continue}for(const i of s)n[i]=function(){var m;const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||ls({name:"Application Render",op:`${Pm}.render`,attributes:{[Xt]:"auto.ui.vue"},onlyIfParent:!0}),id(this,tn(),r));const l=ba(this,!1);if(!(a||(Array.isArray(e.trackComponents)?Vx(e.trackComponents,l):e.trackComponents))){id(this,tn(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=i===s[0],f=((m=this.$root)==null?void 0:m.$_sentryRootComponentSpan)||sr();if(d){if(f){const v=this.$_sentryComponentSpans[o];v&&v.end(),this.$_sentryComponentSpans[o]=ls({name:`Vue ${l}`,op:`${Pm}.${o}`,attributes:{[Xt]:"auto.ui.vue"},onlyIfParent:!0})}}else{const v=this.$_sentryComponentSpans[o];if(!v)return;v.end(),id(this,tn(),r)}}}return n},Gx=vt,Kx={Vue:Gx.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:q_,timeout:2e3,trackComponents:!1}},Yx="Vue",Jx=(e={})=>({name:Yx,setup(t){const n={...Kx,...t.getOptions(),...e};if(!n.Vue&&!n.app){Fo(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(o=>$m(o,n)):n.Vue&&$m(n.Vue,n)}}),$m=(e,t)=>{var n;H_&&((n=e._instance)==null?void 0:n.isMounted)===!0&&Fo(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&Hx(e,t),Cr(t)&&e.mixin(zx(t.tracingOptions))};function Xx(e={}){const t={defaultIntegrations:[...O_(),Jx()],...e};return i_(t,"vue"),mx(t)}function Qx(e,t,n){let r=!1;const o="mode"in e;e.onError(s=>ip(s,{mechanism:{handled:!1}})),e.beforeEach((s,i,...a)=>{const l=r?void 0:Zx(),u={};for(const m of Object.keys(s.params))u[`url.path.parameter.${m}`]=s.params[m],u[`params.${m}`]=s.params[m];for(const m of Object.keys(s.query)){const v=s.query[m];v&&(u[`query.${m}`]=v)}let d=s.path,f="url";if(s.name&&t.routeLabel!=="path")d=s.name.toString(),f="custom";else if(s.matched.length>0){const m=s.matched.length-1;d=s.matched[m].path,f="route"}if(Nt().setTransactionName(d),t.instrumentPageLoad&&l&&(wt(l).data[Tr]!=="custom"&&(l.updateName(d),l.setAttribute(Tr,f)),l.setAttributes({...u,[Xt]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!l&&n({name:d,op:"navigation",attributes:{...u,[Xt]:"auto.navigation.vue",[Tr]:f}}),o){const m=a[0];typeof m=="function"&&m()}})}function Zx(){const e=sr(),t=e&&On(e);return t&&wt(t).op==="pageload"?t:void 0}function e1(e={}){if(!e.router)return Cm(e);const t=Cm({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:o=!0,routeLabel:s="name"}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i),Qx(n,{routeLabel:s,instrumentNavigation:r,instrumentPageLoad:o},l=>{B_(i,l)})}}}const t1="modulepreload",n1=function(e){return"/"+e},Nm={},ad=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=n1(u),u in Nm)return;Nm[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":t1,d||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((v,E)=>{m.addEventListener("load",v),m.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/*!
|
|
46
|
-
* vue-router v4.6.4
|
|
47
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/const di=typeof document<"u";function W_(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function r1(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&W_(e.default)}const At=Object.assign;function ld(e,t){const n={};for(const r in t){const o=t[r];n[r]=Wr(o)?o.map(e):e(o)}return n}const wa=()=>{},Wr=Array.isArray;function Om(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const V_=/#/g,o1=/&/g,s1=/\//g,i1=/=/g,a1=/\?/g,z_=/\+/g,l1=/%5B/g,c1=/%5D/g,G_=/%5E/g,u1=/%60/g,K_=/%7B/g,d1=/%7C/g,Y_=/%7D/g,f1=/%20/g;function vp(e){return e==null?"":encodeURI(""+e).replace(d1,"|").replace(l1,"[").replace(c1,"]")}function p1(e){return vp(e).replace(K_,"{").replace(Y_,"}").replace(G_,"^")}function mf(e){return vp(e).replace(z_,"%2B").replace(f1,"+").replace(V_,"%23").replace(o1,"%26").replace(u1,"`").replace(K_,"{").replace(Y_,"}").replace(G_,"^")}function h1(e){return mf(e).replace(i1,"%3D")}function m1(e){return vp(e).replace(V_,"%23").replace(a1,"%3F")}function g1(e){return m1(e).replace(s1,"%2F")}function Fa(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const v1=/\/$/,y1=e=>e.replace(v1,"");function cd(e,t,n="/"){let r,o={},s="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),s=t.slice(l,a>0?a:t.length),o=e(s.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=S1(r??t,n),{fullPath:r+s+i,path:r,query:o,hash:Fa(i)}}function _1(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Lm(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function b1(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Mi(t.matched[r],n.matched[o])&&J_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Mi(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function J_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!w1(e[n],t[n]))return!1;return!0}function w1(e,t){return Wr(e)?Dm(e,t):Wr(t)?Dm(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Dm(e,t){return Wr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function S1(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const Yo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let gf=(function(e){return e.pop="pop",e.push="push",e})({}),ud=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function T1(e){if(!e)if(di){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),y1(e)}const E1=/^[^#]+#/;function k1(e,t){return e.replace(E1,"#")+t}function I1(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 qc=()=>({left:window.scrollX,top:window.scrollY});function C1(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=I1(o,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 jm(e,t){return(history.state?history.state.position-t:-1)+e}const vf=new Map;function A1(e,t){vf.set(e,t)}function x1(e){const t=vf.get(e);return vf.delete(e),t}function R1(e){return typeof e=="string"||e&&typeof e=="object"}function X_(e){return typeof e=="string"||typeof e=="symbol"}let Yt=(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 Q_=Symbol("");Yt.MATCHER_NOT_FOUND+"",Yt.NAVIGATION_GUARD_REDIRECT+"",Yt.NAVIGATION_ABORTED+"",Yt.NAVIGATION_CANCELLED+"",Yt.NAVIGATION_DUPLICATED+"";function Pi(e,t){return At(new Error,{type:e,[Q_]:!0},t)}function _o(e,t){return e instanceof Error&&Q_ in e&&(t==null||!!(e.type&t))}const M1=["params","query","hash"];function P1(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of M1)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function $1(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 o=n[r].replace(z_," "),s=o.indexOf("="),i=Fa(s<0?o:o.slice(0,s)),a=s<0?null:Fa(o.slice(s+1));if(i in t){let l=t[i];Wr(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Fm(e){let t="";for(let n in e){const r=e[n];if(n=h1(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Wr(r)?r.map(o=>o&&mf(o)):[r&&mf(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function N1(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Wr(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const O1=Symbol(""),Bm=Symbol(""),Hc=Symbol(""),yp=Symbol(""),yf=Symbol("");function la(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Zo(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const u=m=>{m===!1?l(Pi(Yt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):R1(m)?l(Pi(Yt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&r.enterCallbacks[o]===i&&typeof m=="function"&&i.push(m),a())},d=s(()=>e.call(r&&r.instances[o],t,n,u));let f=Promise.resolve(d);e.length<3&&(f=f.then(u)),f.catch(m=>l(m))})}function dd(e,t,n,r,o=s=>s()){const s=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(W_(l)){const u=(l.__vccOpts||l)[t];u&&s.push(Zo(u,n,r,i,a,o))}else{let u=l();s.push(()=>u.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=r1(d)?d.default:d;i.mods[a]=d,i.components[a]=f;const m=(f.__vccOpts||f)[t];return m&&Zo(m,n,r,i,a,o)()}))}}return s}function L1(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const a=t.matched[i];a&&(e.matched.find(u=>Mi(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>Mi(u,l))||o.push(l))}return[n,r,o]}/*!
|
|
50
|
-
* vue-router v4.6.4
|
|
51
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
52
|
-
* @license MIT
|
|
53
|
-
*/let D1=()=>location.protocol+"//"+location.host;function Z_(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let i=o.includes(e.slice(s))?e.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),Lm(a,"")}return Lm(n,e)+r+o}function j1(e,t,n,r){let o=[],s=[],i=null;const a=({state:m})=>{const v=Z_(e,location),E=n.value,C=t.value;let H=0;if(m){if(n.value=v,t.value=m,i&&i===E){i=null;return}H=C?m.position-C.position:0}else r(v);o.forEach(M=>{M(n.value,E,{delta:H,type:gf.pop,direction:H?H>0?ud.forward:ud.back:ud.unknown})})};function l(){i=n.value}function u(m){o.push(m);const v=()=>{const E=o.indexOf(m);E>-1&&o.splice(E,1)};return s.push(v),v}function d(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(At({},m.state,{scroll:qc()}),"")}}function f(){for(const m of s)m();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:l,listen:u,destroy:f}}function Um(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?qc():null}}function F1(e){const{history:t,location:n}=window,r={value:Z_(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(l,u,d){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:D1()+e+l;try{t[d?"replaceState":"pushState"](u,"",m),o.value=u}catch(v){console.error(v),n[d?"replace":"assign"](m)}}function i(l,u){s(l,At({},t.state,Um(o.value.back,l,o.value.forward,!0),u,{position:o.value.position}),!0),r.value=l}function a(l,u){const d=At({},o.value,t.state,{forward:l,scroll:qc()});s(d.current,d,!0),s(l,At({},Um(r.value,l,null),{position:d.position+1},u),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function B1(e){e=T1(e);const t=F1(e),n=j1(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=At({location:"",base:e,go:r,createHref:k1.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function U1(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),B1(e)}let Ls=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var ln=(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})(ln||{});const q1={type:Ls.Static,value:""},H1=/[a-zA-Z0-9_]/;function W1(e){if(!e)return[[]];if(e==="/")return[[q1]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${u}": ${v}`)}let n=ln.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,u="",d="";function f(){u&&(n===ln.Static?s.push({type:Ls.Static,value:u}):n===ln.Param||n===ln.ParamRegExp||n===ln.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Ls.Param,value:u,regexp:d,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function m(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==ln.ParamRegExp){r=n,n=ln.EscapeNext;continue}switch(n){case ln.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=ln.Param):m();break;case ln.EscapeNext:m(),n=r;break;case ln.Param:l==="("?n=ln.ParamRegExp:H1.test(l)?m():(f(),n=ln.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case ln.ParamRegExp:l===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+l:n=ln.ParamRegExpEnd:d+=l;break;case ln.ParamRegExpEnd:f(),n=ln.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,d="";break;default:t("Unknown state");break}}return n===ln.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),o}const qm="[^/]+?",V1={sensitive:!1,strict:!1,start:!0,end:!0};var Gn=(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})(Gn||{});const z1=/[.+*?^${}()[\]/\\]/g;function G1(e,t){const n=At({},V1,t),r=[];let o=n.start?"^":"";const s=[];for(const u of e){const d=u.length?[]:[Gn.Root];n.strict&&!u.length&&(o+="/");for(let f=0;f<u.length;f++){const m=u[f];let v=Gn.Segment+(n.sensitive?Gn.BonusCaseSensitive:0);if(m.type===Ls.Static)f||(o+="/"),o+=m.value.replace(z1,"\\$&"),v+=Gn.Static;else if(m.type===Ls.Param){const{value:E,repeatable:C,optional:H,regexp:M}=m;s.push({name:E,repeatable:C,optional:H});const O=M||qm;if(O!==qm){v+=Gn.BonusCustomRegExp;try{`${O}`}catch(K){throw new Error(`Invalid custom RegExp for param "${E}" (${O}): `+K.message)}}let V=C?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(V=H&&u.length<2?`(?:/${V})`:"/"+V),H&&(V+="?"),o+=V,v+=Gn.Dynamic,H&&(v+=Gn.BonusOptional),C&&(v+=Gn.BonusRepeatable),O===".*"&&(v+=Gn.BonusWildcard)}d.push(v)}r.push(d)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Gn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(u){const d=u.match(i),f={};if(!d)return null;for(let m=1;m<d.length;m++){const v=d[m]||"",E=s[m-1];f[E.name]=v&&E.repeatable?v.split("/"):v}return f}function l(u){let d="",f=!1;for(const m of e){(!f||!d.endsWith("/"))&&(d+="/"),f=!1;for(const v of m)if(v.type===Ls.Static)d+=v.value;else if(v.type===Ls.Param){const{value:E,repeatable:C,optional:H}=v,M=E in u?u[E]:"";if(Wr(M)&&!C)throw new Error(`Provided param "${E}" is an array but it is not repeatable (* or + modifiers)`);const O=Wr(M)?M.join("/"):M;if(!O)if(H)m.length<2&&(d.endsWith("/")?d=d.slice(0,-1):f=!0);else throw new Error(`Missing required param "${E}"`);d+=O}}return d||"/"}return{re:i,score:r,keys:s,parse:a,stringify:l}}function K1(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]===Gn.Static+Gn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Gn.Static+Gn.Segment?1:-1:0}function eb(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=K1(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(Hm(r))return 1;if(Hm(o))return-1}return o.length-r.length}function Hm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Y1={strict:!1,end:!0,sensitive:!1};function J1(e,t,n){const r=G1(W1(e.path),n),o=At(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function X1(e,t){const n=[],r=new Map;t=Om(Y1,t);function o(f){return r.get(f)}function s(f,m,v){const E=!v,C=Vm(f);C.aliasOf=v&&v.record;const H=Om(t,f),M=[C];if("alias"in f){const K=typeof f.alias=="string"?[f.alias]:f.alias;for(const de of K)M.push(Vm(At({},C,{components:v?v.record.components:C.components,path:de,aliasOf:v?v.record:C})))}let O,V;for(const K of M){const{path:de}=K;if(m&&de[0]!=="/"){const oe=m.record.path,ee=oe[oe.length-1]==="/"?"":"/";K.path=m.record.path+(de&&ee+de)}if(O=J1(K,m,H),v?v.alias.push(O):(V=V||O,V!==O&&V.alias.push(O),E&&f.name&&!zm(O)&&i(f.name)),tb(O)&&l(O),C.children){const oe=C.children;for(let ee=0;ee<oe.length;ee++)s(oe[ee],O,v&&v.children[ee])}v=v||O}return V?()=>{i(V)}:wa}function i(f){if(X_(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const m=eR(f,n);n.splice(m,0,f),f.record.name&&!zm(f)&&r.set(f.record.name,f)}function u(f,m){let v,E={},C,H;if("name"in f&&f.name){if(v=r.get(f.name),!v)throw Pi(Yt.MATCHER_NOT_FOUND,{location:f});H=v.record.name,E=At(Wm(m.params,v.keys.filter(V=>!V.optional).concat(v.parent?v.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),f.params&&Wm(f.params,v.keys.map(V=>V.name))),C=v.stringify(E)}else if(f.path!=null)C=f.path,v=n.find(V=>V.re.test(C)),v&&(E=v.parse(C),H=v.record.name);else{if(v=m.name?r.get(m.name):n.find(V=>V.re.test(m.path)),!v)throw Pi(Yt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});H=v.record.name,E=At({},m.params,f.params),C=v.stringify(E)}const M=[];let O=v;for(;O;)M.unshift(O.record),O=O.parent;return{name:H,path:C,params:E,matched:M,meta:Z1(M)}}e.forEach(f=>s(f));function d(){n.length=0,r.clear()}return{addRoute:s,resolve:u,removeRoute:i,clearRoutes:d,getRoutes:a,getRecordMatcher:o}}function Wm(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Vm(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Q1(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 Q1(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 zm(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Z1(e){return e.reduce((t,n)=>At(t,n.meta),{})}function eR(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;eb(e,t[s])<0?r=s:n=s+1}const o=tR(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function tR(e){let t=e;for(;t=t.parent;)if(tb(t)&&eb(e,t)===0)return t}function tb({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Gm(e){const t=Br(Hc),n=Br(yp),r=ie(()=>{const l=He(e.to);return t.resolve(l)}),o=ie(()=>{const{matched:l}=r.value,{length:u}=l,d=l[u-1],f=n.matched;if(!d||!f.length)return-1;const m=f.findIndex(Mi.bind(null,d));if(m>-1)return m;const v=Km(l[u-2]);return u>1&&Km(d)===v&&f[f.length-1].path!==v?f.findIndex(Mi.bind(null,l[u-2])):m}),s=ie(()=>o.value>-1&&iR(n.params,r.value.params)),i=ie(()=>o.value>-1&&o.value===n.matched.length-1&&J_(n.params,r.value.params));function a(l={}){if(sR(l)){const u=t[He(e.replace)?"replace":"push"](He(e.to)).catch(wa);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:ie(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function nR(e){return e.length===1?e[0]:e}const rR=In({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:Gm,setup(e,{slots:t}){const n=Ic(Gm(e)),{options:r}=Br(Hc),o=ie(()=>({[Ym(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ym(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&nR(t.default(n));return e.custom?s:zf("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),oR=rR;function sR(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 iR(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Wr(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function Km(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ym=(e,t,n)=>e??t??n,aR=In({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Br(yf),o=ie(()=>e.route||r.value),s=Br(Bm,0),i=ie(()=>{let u=He(s);const{matched:d}=o.value;let f;for(;(f=d[u])&&!f.components;)u++;return u}),a=ie(()=>o.value.matched[i.value]);jl(Bm,ie(()=>i.value+1)),jl(O1,a),jl(yf,o);const l=N();return ut(()=>[l.value,a.value,e.name],([u,d,f],[m,v,E])=>{d&&(d.instances[f]=u,v&&v!==d&&u&&u===m&&(d.leaveGuards.size||(d.leaveGuards=v.leaveGuards),d.updateGuards.size||(d.updateGuards=v.updateGuards))),u&&d&&(!v||!Mi(d,v)||!m)&&(d.enterCallbacks[f]||[]).forEach(C=>C(u))},{flush:"post"}),()=>{const u=o.value,d=e.name,f=a.value,m=f&&f.components[d];if(!m)return Jm(n.default,{Component:m,route:u});const v=f.props[d],E=v?v===!0?u.params:typeof v=="function"?v(u):v:null,H=zf(m,At({},E,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(f.instances[d]=null)},ref:l}));return Jm(n.default,{Component:H,route:u})||H}}});function Jm(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const lR=aR;function cR(e){const t=X1(e.routes,e),n=e.parseQuery||$1,r=e.stringifyQuery||Fm,o=e.history,s=la(),i=la(),a=la(),l=jw(Yo);let u=Yo;di&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=ld.bind(null,Y=>""+Y),f=ld.bind(null,g1),m=ld.bind(null,Fa);function v(Y,Se){let he,Ue;return X_(Y)?(he=t.getRecordMatcher(Y),Ue=Se):Ue=Y,t.addRoute(Ue,he)}function E(Y){const Se=t.getRecordMatcher(Y);Se&&t.removeRoute(Se)}function C(){return t.getRoutes().map(Y=>Y.record)}function H(Y){return!!t.getRecordMatcher(Y)}function M(Y,Se){if(Se=At({},Se||l.value),typeof Y=="string"){const q=cd(n,Y,Se.path),te=t.resolve({path:q.path},Se),Z=o.createHref(q.fullPath);return At(q,te,{params:m(te.params),hash:Fa(q.hash),redirectedFrom:void 0,href:Z})}let he;if(Y.path!=null)he=At({},Y,{path:cd(n,Y.path,Se.path).path});else{const q=At({},Y.params);for(const te in q)q[te]==null&&delete q[te];he=At({},Y,{params:f(q)}),Se.params=f(Se.params)}const Ue=t.resolve(he,Se),Ze=Y.hash||"";Ue.params=d(m(Ue.params));const T=_1(r,At({},Y,{hash:p1(Ze),path:Ue.path})),k=o.createHref(T);return At({fullPath:T,hash:Ze,query:r===Fm?N1(Y.query):Y.query||{}},Ue,{redirectedFrom:void 0,href:k})}function O(Y){return typeof Y=="string"?cd(n,Y,l.value.path):At({},Y)}function V(Y,Se){if(u!==Y)return Pi(Yt.NAVIGATION_CANCELLED,{from:Se,to:Y})}function K(Y){return ee(Y)}function de(Y){return K(At(O(Y),{replace:!0}))}function oe(Y,Se){const he=Y.matched[Y.matched.length-1];if(he&&he.redirect){const{redirect:Ue}=he;let Ze=typeof Ue=="function"?Ue(Y,Se):Ue;return typeof Ze=="string"&&(Ze=Ze.includes("?")||Ze.includes("#")?Ze=O(Ze):{path:Ze},Ze.params={}),At({query:Y.query,hash:Y.hash,params:Ze.path!=null?{}:Y.params},Ze)}}function ee(Y,Se){const he=u=M(Y),Ue=l.value,Ze=Y.state,T=Y.force,k=Y.replace===!0,q=oe(he,Ue);if(q)return ee(At(O(q),{state:typeof q=="object"?At({},Ze,q.state):Ze,force:T,replace:k}),Se||he);const te=he;te.redirectedFrom=Se;let Z;return!T&&b1(r,Ue,he)&&(Z=Pi(Yt.NAVIGATION_DUPLICATED,{to:te,from:Ue}),Ne(Ue,Ue,!0,!1)),(Z?Promise.resolve(Z):Re(te,Ue)).catch(X=>_o(X)?_o(X,Yt.NAVIGATION_GUARD_REDIRECT)?X:Fe(X):le(X,te,Ue)).then(X=>{if(X){if(_o(X,Yt.NAVIGATION_GUARD_REDIRECT))return ee(At({replace:k},O(X.to),{state:typeof X.to=="object"?At({},Ze,X.to.state):Ze,force:T}),Se||te)}else X=Q(te,Ue,!0,k,Ze);return De(te,Ue,X),X})}function ve(Y,Se){const he=V(Y,Se);return he?Promise.reject(he):Promise.resolve()}function Pe(Y){const Se=Ye.values().next().value;return Se&&typeof Se.runWithContext=="function"?Se.runWithContext(Y):Y()}function Re(Y,Se){let he;const[Ue,Ze,T]=L1(Y,Se);he=dd(Ue.reverse(),"beforeRouteLeave",Y,Se);for(const q of Ue)q.leaveGuards.forEach(te=>{he.push(Zo(te,Y,Se))});const k=ve.bind(null,Y,Se);return he.push(k),Xe(he).then(()=>{he=[];for(const q of s.list())he.push(Zo(q,Y,Se));return he.push(k),Xe(he)}).then(()=>{he=dd(Ze,"beforeRouteUpdate",Y,Se);for(const q of Ze)q.updateGuards.forEach(te=>{he.push(Zo(te,Y,Se))});return he.push(k),Xe(he)}).then(()=>{he=[];for(const q of T)if(q.beforeEnter)if(Wr(q.beforeEnter))for(const te of q.beforeEnter)he.push(Zo(te,Y,Se));else he.push(Zo(q.beforeEnter,Y,Se));return he.push(k),Xe(he)}).then(()=>(Y.matched.forEach(q=>q.enterCallbacks={}),he=dd(T,"beforeRouteEnter",Y,Se,Pe),he.push(k),Xe(he))).then(()=>{he=[];for(const q of i.list())he.push(Zo(q,Y,Se));return he.push(k),Xe(he)}).catch(q=>_o(q,Yt.NAVIGATION_CANCELLED)?q:Promise.reject(q))}function De(Y,Se,he){a.list().forEach(Ue=>Pe(()=>Ue(Y,Se,he)))}function Q(Y,Se,he,Ue,Ze){const T=V(Y,Se);if(T)return T;const k=Se===Yo,q=di?history.state:{};he&&(Ue||k?o.replace(Y.fullPath,At({scroll:k&&q&&q.scroll},Ze)):o.push(Y.fullPath,Ze)),l.value=Y,Ne(Y,Se,he,k),Fe()}let pe;function Me(){pe||(pe=o.listen((Y,Se,he)=>{if(!lt.listening)return;const Ue=M(Y),Ze=oe(Ue,lt.currentRoute.value);if(Ze){ee(At(Ze,{replace:!0,force:!0}),Ue).catch(wa);return}u=Ue;const T=l.value;di&&A1(jm(T.fullPath,he.delta),qc()),Re(Ue,T).catch(k=>_o(k,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_CANCELLED)?k:_o(k,Yt.NAVIGATION_GUARD_REDIRECT)?(ee(At(O(k.to),{force:!0}),Ue).then(q=>{_o(q,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&!he.delta&&he.type===gf.pop&&o.go(-1,!1)}).catch(wa),Promise.reject()):(he.delta&&o.go(-he.delta,!1),le(k,Ue,T))).then(k=>{k=k||Q(Ue,T,!1),k&&(he.delta&&!_o(k,Yt.NAVIGATION_CANCELLED)?o.go(-he.delta,!1):he.type===gf.pop&&_o(k,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),De(Ue,T,k)}).catch(wa)}))}let qe=la(),_e=la(),Te;function le(Y,Se,he){Fe(Y);const Ue=_e.list();return Ue.length?Ue.forEach(Ze=>Ze(Y,Se,he)):console.error(Y),Promise.reject(Y)}function Ee(){return Te&&l.value!==Yo?Promise.resolve():new Promise((Y,Se)=>{qe.add([Y,Se])})}function Fe(Y){return Te||(Te=!Y,Me(),qe.list().forEach(([Se,he])=>Y?he(Y):Se()),qe.reset()),Y}function Ne(Y,Se,he,Ue){const{scrollBehavior:Ze}=e;if(!di||!Ze)return Promise.resolve();const T=!he&&x1(jm(Y.fullPath,0))||(Ue||!he)&&history.state&&history.state.scroll||null;return Jt().then(()=>Ze(Y,Se,T)).then(k=>k&&C1(k)).catch(k=>le(k,Y,Se))}const Ge=Y=>o.go(Y);let Ke;const Ye=new Set,lt={currentRoute:l,listening:!0,addRoute:v,removeRoute:E,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:C,resolve:M,options:e,push:K,replace:de,go:Ge,back:()=>Ge(-1),forward:()=>Ge(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:_e.add,isReady:Ee,install(Y){Y.component("RouterLink",oR),Y.component("RouterView",lR),Y.config.globalProperties.$router=lt,Object.defineProperty(Y.config.globalProperties,"$route",{enumerable:!0,get:()=>He(l)}),di&&!Ke&&l.value===Yo&&(Ke=!0,K(o.location).catch(Ue=>{}));const Se={};for(const Ue in Yo)Object.defineProperty(Se,Ue,{get:()=>l.value[Ue],enumerable:!0});Y.provide(Hc,lt),Y.provide(yp,uv(Se)),Y.provide(yf,l);const he=Y.unmount;Ye.add(Y),Y.unmount=function(){Ye.delete(Y),Ye.size<1&&(u=Yo,pe&&pe(),pe=null,l.value=Yo,Ke=!1,Te=!1),he()}}};function Xe(Y){return Y.reduce((Se,he)=>Se.then(()=>Pe(he)),Promise.resolve())}return lt}function uR(){return Br(Hc)}function dR(e){return Br(yp)}const Xm=768;function _p(){const e=N(typeof window<"u"?window.innerWidth<Xm:!1);let t=null;function n(r){e.value=r.matches}return ds(()=>{t=window.matchMedia(`(max-width: ${Xm-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Ac(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const fR={key:0,class:"desktop-sidebar"},pR={class:"desktop-main"},Qm="codex-web-local.sidebar-width.v1",hR=260,mR=620,Zm=320,gR=In({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=_p();function r(u){return Math.min(mR,Math.max(hR,u))}function o(){if(typeof window>"u")return Zm;const u=window.localStorage.getItem(Qm),d=Number(u);return Number.isFinite(d)?r(d):Zm}const s=N(o()),i=ie(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${s.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(Qm,String(u))}function l(u){u.preventDefault();const d=u.clientX,f=s.value,m=E=>{const C=E.clientX-d;s.value=r(f+C)},v=()=>{a(s.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",v)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",v)}return(u,d)=>(A(),D("div",{class:pt(["desktop-layout",{"is-mobile":He(n)}]),style:ko(i.value)},[He(n)?(A(),ht(ma,{key:0,to:"body"},[ze(ey,{name:"drawer"},{default:Ct(()=>[e.isSidebarCollapsed?ge("",!0):(A(),D("div",{key:0,class:"mobile-drawer-backdrop",onClick:d[1]||(d[1]=f=>u.$emit("close-sidebar"))},[_("aside",{class:"mobile-drawer",onClick:d[0]||(d[0]=ft(()=>{},["stop"]))},[ao(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ge("",!0),He(n)?ge("",!0):(A(),D(Qe,{key:1},[e.isSidebarCollapsed?ge("",!0):(A(),D("aside",fR,[ao(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ge("",!0):(A(),D("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),_("section",pR,[ao(u.$slots,"content",{},void 0)])],6))}}),Et=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},vR=Et(gR,[["__scopeId","data-v-4c6dbcd7"]]);function eg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class xo extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function bp(e,t){const n=eg(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=eg(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Do(e,t,n){return e instanceof xo?e:e instanceof Error?new xo(e.message||t,{code:"unknown_error",method:n}):new xo(t,{code:"unknown_error",method:n})}function nb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function yR(e,t){const n={method:e,params:t??null};return Zd({name:`rpc ${e}`,op:"rpc.client"},async()=>{let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new xo(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let o=null;try{o=await r.json()}catch{o=null}if(!r.ok)throw new xo(bp(o,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const s=o;if(!s||typeof s!="object"||!("result"in s))throw new xo(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result})}function _R(e){const t=nb(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 tg(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function bR(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null,o=0;const s=()=>{r!==null&&(window.clearTimeout(r),r=null)},i=(d,f)=>{if(n||r!==null)return;const m=Math.min(1e3*2**f,1e4);r=window.setTimeout(()=>{r=null,!n&&d()},m)},a=d=>{const f=_R(d);f&&e(f)},l=(d=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const f=new EventSource("/codex-api/events");let m=!1;f.onmessage=v=>{try{a(JSON.parse(v.data))}catch{}},f.addEventListener("ready",v=>{try{const E=v.data?JSON.parse(v.data):{ok:!0};tg(e,E)}catch{tg(e)}}),f.onerror=()=>{n||m||f.readyState===EventSource.CLOSED&&(m=!0,f.close(),i(()=>l(d+1),d))},t=()=>{m=!0,f.close()}},u=(d=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const f=window.location.protocol==="https:"?"wss:":"ws:",m=new WebSocket(`${f}//${window.location.host}/codex-api/ws`);let v=!1,E=!1,C=window.setTimeout(()=>{v||n||E||(E=!0,m.close(),l())},2500);m.onopen=()=>{v=!0,s(),C!==null&&(window.clearTimeout(C),C=null),pr({category:"ws",message:"WebSocket connected",level:"info"})},m.onmessage=H=>{try{a(JSON.parse(String(H.data)))}catch{}},m.onerror=()=>{},m.onclose=()=>{if(C!==null&&(window.clearTimeout(C),C=null),!(n||E)){if(o++,pr({category:"ws",message:`WebSocket closed (attempt ${d})`,data:{totalReconnects:o},level:"warning"}),tk("ws_reconnects",o),!v){l();return}i(()=>u(d+1),d)}},t=()=>{E=!0,C!==null&&(window.clearTimeout(C),C=null),m.close()}};return typeof WebSocket<"u"?u():l(),()=>{n=!0,s(),t==null||t()}}async function wR(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 xo(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 xo(bp(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function SR(){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 xo(bp(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=nb(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function TR(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function en(e){return TR(e)}function ER(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function kR(e){const t=en(e).replace(/[\\/]+/gu,"/");return ER(t)?t.toLowerCase():t}function Rs(e){const t=en(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function fd(e){const t=en(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function sl(e){return Rs(e)||en(e)||"unknown-project"}function ng(e){return new Date(e*1e3).toISOString()}function IR(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const CR=/^##\s+(.+?):\s+(.+?)\s*$/,AR=/^#\s*files mentioned by the user\s*:?\s*$/i;function xR(e){var o,s;const t=e.split(`
|
|
54
|
-
`).findIndex(i=>AR.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
55
|
-
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(CR);if(!l)break;const u=(o=l[1])==null?void 0:o.trim(),d=(s=l[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&d&&r.push({label:u,path:d})}return r}function RR(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 o=r.index+r[0].length;return e.slice(o).trim()}function MR(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],o=[];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"&&o.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:IR(l),isUnhandled:!0});const s=n.join(`
|
|
56
|
-
`),i=xR(s);return{text:RR(s),images:r,fileAttachments:i,rawBlocks:o}}function PR(e){var s;const t=e.replace(/\r\n/g,`
|
|
57
|
-
`).trim();if(!t)return null;const n=t.split(`
|
|
58
|
-
`),r=[],o=[];for(const i of n){const a=i.trim();if(!a){r.length===0&&o.push("");continue}const l=a.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(l){const u=(l[1]??" ").toLowerCase(),d=(s=l[2])==null?void 0:s.trim();if(!d)continue;let f="pending";u==="x"&&(f="completed"),(u==="~"||u===">"||u==="-")&&(f="inProgress"),r.push({step:d,status:f});continue}o.push(a)}return r.length===0?null:{explanation:o.join(`
|
|
59
|
-
`).trim()||void 0,steps:r}}function rg(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
|
|
60
|
-
`),n=t.endsWith(`
|
|
61
|
-
`)?t.slice(0,-1):t;return n?n.split(`
|
|
62
|
-
`).length:0}function $R(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
|
|
63
|
-
`).split(`
|
|
64
|
-
`))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function rb(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function ob(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const o=r,s=typeof o.path=="string"?o.path:"",i=typeof o.diff=="string"?o.diff:"",a=o.kind,l=a==null?void 0:a.type;if(!s||l!=="add"&&l!=="delete"&&l!=="update")continue;const u=l==="update"&&typeof(a==null?void 0:a.move_path)=="string"?a.move_path:null,d=l==="update"?$R(i):l==="add"?{addedLineCount:rg(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:rg(i)};n.push({path:s,operation:l,movedToPath:u,diff:i,...d})}return n}function NR(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=MR(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==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:PR(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=OR(t.status),r=typeof t.command=="string"?t.command:"",o=typeof t.cwd=="string"?t.cwd:null,s=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:o,status:n,aggregatedOutput:s,exitCode:i}}]}if(e.type==="fileChange"){const t=ob(e.changes),n=rb(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function OR(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function LR(e){const t=e,n=[t.name,t.title,e.preview];for(const r of n)if(typeof r=="string"&&r.trim().length>0)return r.trim();return""}function DR(e){const t=LR(e);return t.length>0?t:"Untitled thread"}function wp(e){return(e==null?void 0:e.status)==="inProgress"}function jR(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 wp(r)}function FR(e){const t=e,n=en(typeof t.cwd=="string"?t.cwd:e.cwd),r=kR(n),o=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||r.includes("/.codex/worktrees/")||r.includes("/.git/worktrees/");return{id:e.id,title:DR(e),projectName:sl(n),cwd:n,hasWorktree:o,createdAtIso:ng(e.createdAt),updatedAtIso:ng(e.updatedAt),preview:e.preview,unread:!1,inProgress:jR(e)}}function BR(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((o,s)=>new Date(s.updatedAtIso).getTime()-new Date(o.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const o=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()-o})}function UR(e){const t=e.data.map(FR);return BR(t)}function Wc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const o=t[r],s=typeof(o==null?void 0:o.id)=="string"?o.id:void 0,i=Array.isArray(o.items)?o.items:[];for(const a of i)for(const l of NR(a))n.push({...l,turnId:s,turnIndex:r})}return n}function qR(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return wp(t.at(-1))}function sb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(wp(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const HR=5e3;function pd(e){return e&&e.length>0?e:null}function hd(e){return e&&e.length>0?e:null}const og=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function sg(e,t){const n=t.trim();if(!n)return"";const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[o="",s=""]=e.split("/",2),i=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=o&&s?`${i}\\s*/\\s*${a}`:r;return n.replace(/^[★☆*\s:|\-]+/u,"").replace(/^(sponsor|star)\s+/i,"").replace(new RegExp(`^${r}\\s*[-:|]*\\s*`,"i"),"").replace(new RegExp(`^${l}\\s*[-:|]*\\s*`,"i"),"").replace(/^(sponsor|star)\s+/i,"").trim()}function _n(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function mt(e){return typeof e=="string"&&e.length>0?e:null}function $n(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function hc(e){return typeof e=="boolean"?e:null}function WR(e){return e==="payment_required"?e:null}function VR(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function ig(e){const t=_n(e);if(!t)return null;const n=$n(t.usedPercent??t.used_percent);if(n===null)return null;const r=$n(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:$n(t.resetsAt??t.resets_at)}}function zR(e){const t=_n(e);if(!t)return null;const n=hc(t.hasCredits??t.has_credits),r=hc(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:mt(t.balance)}}function _f(e){const t=_n(e);if(!t)return null;const n=ig(t.primary),r=ig(t.secondary),o=zR(t.credits);return!n&&!r&&!o?null:{limitId:mt(t.limitId??t.limit_id),limitName:mt(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:mt(t.planType??t.plan_type)}}function ib(e,t=null){const n=_n(e);if(!n)return null;const r=mt(n.accountId),o=mt(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:mt(n.authMode),email:mt(n.email),planType:mt(n.planType),lastRefreshedAtIso:mt(n.lastRefreshedAtIso)??"",lastActivatedAtIso:mt(n.lastActivatedAtIso),quotaSnapshot:_f(n.quotaSnapshot),quotaUpdatedAtIso:mt(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:mt(n.quotaError),unavailableReason:WR(n.unavailableReason)??(VR(mt(n.quotaError))?"payment_required":null),isActive:hc(n.isActive)??r===t}:null}function ab(e){const t=_n(e);if(!t)return null;const n=_n(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=_f(n==null?void 0:n.codex);return r||_f(t.rateLimits??t.rate_limits)}async function rn(e,t){try{return await yR(e,t)}catch(n){throw Do(n,`RPC ${e} failed`,e)}}function lb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n={};for(let r=0;r<t.length;r+=1){const o=t[r];typeof(o==null?void 0:o.id)!="string"||o.id.length===0||(n[o.id]=r)}return n}function GR(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function KR(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function YR(){const e=await rn("thread/list",{archived:!1,limit:100,sortKey:"updated_at",modelProviders:[]});return UR(e)}async function JR(e){try{const t=await fetch(`/codex-api/thread-live-state?threadId=${encodeURIComponent(e)}`);return t.ok?await t.json():null}catch{return null}}function XR(e){const t=e.conversationState;if(!t||!Array.isArray(t.turns)||t.turns.length===0)return null;const n={thread:{id:e.threadId,turns:t.turns}};return{messages:Wc(n),inProgress:e.isInProgress,activeTurnId:sb(n),turnIndexByTurnId:lb(n)}}async function QR(e){const t=await JR(e);if(t&&!t.liveStateError){const o=XR(t);if(o&&o.messages.length>0)return o}const n=await rn("thread/read",{threadId:e,includeTurns:!0});return{messages:Wc(n),inProgress:qR(n),activeTurnId:sb(n),turnIndexByTurnId:lb(n)}}async function ZR(){try{return await YR()}catch(e){throw Do(e,"Failed to load thread groups","thread/list")}}async function ag(e){try{return await QR(e)}catch(t){throw Do(t,`Failed to load thread ${e}`,"thread/read")}}function eM(e){const t=_n(e);if(!t)return null;const n=mt(t.key),r=typeof t.text=="string"?t.text:"",o=mt(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:$n(t.oldLine),newLine:$n(t.newLine)}}function tM(e){const t=_n(e);if(!t)return null;const n=mt(t.id),r=typeof t.header=="string"?t.header:"",o=typeof t.patch=="string"?t.patch:"";return n?{id:n,header:r,patch:o,addedLineCount:$n(t.addedLineCount)??0,removedLineCount:$n(t.removedLineCount)??0,oldStart:$n(t.oldStart),oldLineCount:$n(t.oldLineCount)??0,newStart:$n(t.newStart),newLineCount:$n(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>eM(s)).filter(s=>s!==null):[]}:null}function nM(e){const t=_n(e);if(!t)return null;const n=mt(t.id),r=mt(t.path),o=mt(t.absolutePath),s=mt(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:mt(t.previousPath),previousAbsolutePath:mt(t.previousAbsolutePath),operation:s,addedLineCount:$n(t.addedLineCount)??0,removedLineCount:$n(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>tM(i)).filter(i=>i!==null):[]}}function cb(e){const t=_n(e),n=_n(t==null?void 0:t.data),r=_n(n==null?void 0:n.summary),o=mt(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=mt(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:mt(n==null?void 0:n.cwd)??"",gitRoot:mt(n==null?void 0:n.gitRoot),isGitRepo:hc(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:mt(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>mt(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:mt(n==null?void 0:n.headBranch),mergeBaseSha:mt(n==null?void 0:n.mergeBaseSha),generatedAtIso:mt(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:$n(r==null?void 0:r.fileCount)??0,addedLineCount:$n(r==null?void 0:r.addedLineCount)??0,removedLineCount:$n(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>nM(i)).filter(i=>i!==null):[]}}function rM(e){var r;const t=e.trim();if(!t)return{absolutePath:null,startLine:null,endLine:null};const n=t.match(/^(.*?):(\d+)-(\d+)$/u);return n?{absolutePath:((r=n[1])==null?void 0:r.trim())||null,startLine:Number(n[2]),endLine:Number(n[3])}:{absolutePath:t||null,startLine:null,endLine:null}}function oM(e){var i;const t=e.replace(/\r\n/g,`
|
|
65
|
-
`).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,o=n>=0?t.slice(n).trim():"",s=[];if(o){const l=o.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let u=0;for(const d of l){const f=((i=d[1])==null?void 0:i.trim())??"",m=rM(d[2]??""),v=(d[0]??"").trim(),E=(d[3]??"").split(`
|
|
66
|
-
`).map(C=>C.replace(/^ /u,"")).join(`
|
|
67
|
-
`).trim();s.push({id:`finding:${u}`,title:f||`Finding ${u+1}`,body:E,path:m.absolutePath?m.absolutePath.split("/").filter(Boolean).slice(-1)[0]??m.absolutePath:null,absolutePath:m.absolutePath,startLine:m.startLine,endLine:m.endLine,rawText:v}),u+=1}}return{reviewText:t,summary:r,findings:s}}function lg(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const o=n[r],s=Array.isArray(o==null?void 0:o.items)?o.items:[];for(let i=s.length-1;i>=0;i-=1){const a=s[i];if((a==null?void 0:a.type)!==t)continue;const l=typeof a.review=="string"?a.review.trim():"";if(l)return l}}return null}async function t2(e){const t=await rn("thread/read",{threadId:e,includeTurns:!0}),n=lg(t,"exitedReviewMode");return{enteredReviewLabel:lg(t,"enteredReviewMode"),result:n?oM(n):null}}function sM(e){return bR(e)}async function iM(e,t){await wR({id:e,...t})}async function aM(){return SR()}async function cg(){try{const e=await rn("account/rateLimits/read");return ab(e)}catch(e){throw Do(e,"Failed to load account rate limits","account/rateLimits/read")}}function Sp(e){const t=_n(e),n=mt(t==null?void 0:t.activeAccountId),r=Array.isArray(t==null?void 0:t.accounts)?t==null?void 0:t.accounts:[];return{activeAccountId:n,importedAccountId:mt(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>ib(o,n)).filter(o=>o!==null)}}async function lM(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(Dn(t,"Failed to load accounts"));const n=_n(t);return Sp(n==null?void 0:n.data)}async function cM(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(Dn(t,"Failed to refresh accounts"));const n=_n(t);return Sp(n==null?void 0:n.data)}async function uM(e){const t=await fetch("/codex-api/accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to switch account"));const r=_n(n),o=_n(r==null?void 0:r.data),s=ib(o==null?void 0:o.account,mt(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function dM(e){const t=await fetch("/codex-api/accounts/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to remove account"));const r=_n(n);return Sp(r==null?void 0:r.data)}async function md(e){const t=await rn("thread/resume",{threadId:e});return{model:mc(t)}}async function fM(e){await rn("thread/archive",{threadId:e})}async function pM(e,t){await rn("thread/name/set",{threadId:e,name:t})}async function gd(e,t){const n=await rn("thread/rollback",{threadId:e,numTurns:t});return Wc(n)}async function hM(e,t,n){try{const r=await fetch("/codex-api/thread/rollback-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,turnId:t,cwd:n})});return r.ok?await r.json():{reverted:0,errors:["Server error"]}}catch{return{reverted:0,errors:["Network error"]}}}function bf(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""}function mM(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.cwd;if(typeof r=="string"&&r.length>0)return r}return""}function mc(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function ug(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 rn("thread/start",n),o=bf(r);if(!o)throw new Error("thread/start did not return a thread id");return{threadId:o,model:mc(r)}}catch(n){throw Do(n,"Failed to start a new thread","thread/start")}}async function dg(e,t,n){if(arguments.length<=1)try{const r=await rn("thread/fork",{threadId:e,persistExtendedHistory:!0}),o=bf(r);if(!o)throw new Error("thread/fork did not return a thread id");return{threadId:o,cwd:mM(r),model:mc(r),messages:Wc(r)}}catch(r){throw Do(r,`Failed to fork thread ${e}`,"thread/fork")}try{const r=e.trim();if(!r)throw new Error("thread/fork requires threadId");const o={threadId:r};typeof t=="string"&&t.trim().length>0&&(o.cwd=t.trim()),typeof n=="string"&&n.trim().length>0&&(o.model=n.trim());const s=await rn("thread/fork",o),i=bf(s);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:mc(s)}}catch(r){throw Do(r,`Failed to fork thread ${e}`,"thread/fork")}}function gM(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
68
|
-
`;for(const r of t)n+=`
|
|
69
|
-
## ${r.label}: ${r.path}
|
|
70
|
-
`;return`${n}
|
|
71
|
-
## My request for Codex:
|
|
72
|
-
|
|
73
|
-
${e}
|
|
74
|
-
`}async function vM(e,t,n){var l;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?pd(n):hd(n)};let o=null;try{o=await db()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?pd(n??(o==null?void 0:o.reasoningEffort)):hd(n??(o==null?void 0:o.reasoningEffort))};let i=[];try{i=await ub()}catch{i=[]}const a=((l=i.find(u=>u.trim().length>0))==null?void 0:l.trim())??"";if(a)return{model:a,reasoningEffort:e==="plan"?pd(n??(o==null?void 0:o.reasoningEffort)):hd(n??(o==null?void 0:o.reasoningEffort))};throw new Error(`${e==="plan"?"Plan":"Default"} mode requires an available model. Wait for models to load and try again.`)}async function vd(e,t,n=[],r,o,s,i=[],a){var l;try{const u=(r==null?void 0:r.trim())??"",f=[{type:"text",text:gM(t,i)}];for(const C of n){const H=C.trim();H&&f.push({type:"image",url:H,image_url:H})}if(s)for(const C of s)f.push({type:"skill",name:C.name,path:C.path});const m=i.map(C=>({label:C.label,path:C.path,fsPath:C.fsPath})),v={threadId:e,input:f};if(m.length>0&&(v.attachments=m),u&&(v.model=u),typeof o=="string"&&o.length>0&&(v.effort=o),a){const C=await vM(a,u,o);v.collaborationMode={mode:a,settings:{model:C.model,reasoning_effort:C.reasoningEffort,developer_instructions:null}}}const E=await rn("turn/start",v);return typeof((l=E==null?void 0:E.turn)==null?void 0:l.id)=="string"?E.turn.id.trim():""}catch(u){throw Do(u,`Failed to start turn for thread ${e}`,"turn/start")}}async function yM(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 rn("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Do(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function _M(e){const t=e==="fast"?"fast":"standard";await rn("config/batchWrite",{edits:[{keyPath:"features.fast_mode",value:!0,mergeStrategy:"upsert"},{keyPath:"service_tier",value:t==="fast"?"fast":null,mergeStrategy:t==="fast"?"upsert":"replace"}],filePath:null,expectedVersion:null})}async function bM(){return await(await fetch("/codex-api/free-mode/status")).json()}async function fg(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function pg(e){return await(await fetch("/codex-api/free-mode/custom-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e})})).json()}async function wM(e,t){return await(await fetch("/codex-api/free-mode/custom-provider",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t})})).json()}async function ub(){const e=await rn("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}try{const n=await fetch("/codex-api/provider-models",{signal:AbortSignal.timeout(HR)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data)){if(r.exclusive)return r.data.filter(o=>typeof o=="string"&&o.trim().length>0);for(const o of r.data){if(typeof o!="string")continue;const s=o.trim();!s||t.includes(s)||t.push(s)}}}catch{}return t}async function db(){const e=await rn("config/read",{}),t=e.config.model??"",n=GR(e.config.model_reasoning_effort),r=KR(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function SM(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function TM(){try{const e=await rn("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const o=r.mode;o!=="default"&&o!=="plan"||t.has(o)||(t.add(o),n.push({value:o,label:SM(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of og)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return og}function EM(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=s=>{if(!Array.isArray(s))return[];const i=[];for(const a of s)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,o={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[s,i]of Object.entries(r)){const a=typeof s=="string"?en(s):"";a.length>0&&typeof i=="string"&&(o[a]=i)}return{order:n(t.order).map(s=>en(s)),labels:o,active:n(t.active).map(s=>en(s))}}async function Ms(){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 EM(n.data)}async function kM(e,t){const n=(t??"").trim(),r=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e,baseBranch:n||void 0})}),o=await r.json();if(!r.ok||!o.data)throw new Error(o.error||"Failed to create worktree");return{...o.data,cwd:en(o.data.cwd),gitRoot:en(o.data.gitRoot)}}async function IM(e){const t=e.trim();if(!t)return[];const n=new URLSearchParams({sourceCwd:t}),r=await fetch(`/codex-api/worktree/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load branches");const s=Array.isArray(o.data)?o.data:[],i=[],a=new Set;for(const l of s){if(!l||typeof l!="object"||Array.isArray(l))continue;const u=l,d=typeof u.value=="string"?u.value.trim():"",f=typeof u.label=="string"?u.label.trim():"";!d||a.has(d)||(a.add(d),i.push({value:d,label:f||d}))}return i}async function CM(e){const t=e.trim();if(!t)return{currentBranch:null,options:[]};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load Git branch state");const s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},i=s.currentBranch,a=typeof i=="string"&&i.trim()?i.trim():null,l=Array.isArray(s.options)?s.options:[],u=[],d=new Set;for(const f of l){if(!f||typeof f!="object"||Array.isArray(f))continue;const m=f,v=typeof m.value=="string"?m.value.trim():"",E=typeof m.label=="string"?m.label.trim():"";!v||d.has(v)||(d.add(v),u.push({value:v,label:E||v}))}return a&&!d.has(a)&&u.unshift({value:a,label:a}),{currentBranch:a,options:u}}async function AM(e,t){var s;const n=await fetch("/codex-api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.trim(),branch:t.trim()})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to switch branch");const o=(s=r.data)==null?void 0:s.currentBranch;return typeof o=="string"&&o.trim()?o.trim():null}async function n2(e,t,n,r){const o=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&o.set("baseBranch",r.trim());const s=await fetch(`/codex-api/review/snapshot?${o.toString()}`),i=await s.json();if(!s.ok)throw new Error(Dn(i,"Failed to load review snapshot"));return cb(i)}async function r2(e){const t=await fetch("/codex-api/review/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to apply review action"));return cb(n)}async function o2(e){const t=await fetch("/codex-api/review/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await t.json();if(!t.ok)throw new Error(Dn(n,"Failed to initialize Git"))}async function s2(e,t,n,r){const o=t==="baseBranch"?{type:"baseBranch",branch:(r??"").trim()}:{type:"uncommittedChanges"};if(o.type==="baseBranch"&&!o.branch)throw new Error("Base branch is unavailable");await rn("review/start",{threadId:e,target:o,delivery:"inline"})}async function hg(){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 xM(e,t){const n=new URLSearchParams({path:e});(t==null?void 0:t.showHidden)===!0&&n.set("showHidden","1");const r=await fetch(`/codex-local-directories?${n.toString()}`),o=await fb(r);if(!r.ok){const l=Dn(o,"Failed to load local directories");throw new Error(l)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},i=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{},a=Array.isArray(i.entries)?i.entries:[];return{path:typeof i.path=="string"?en(i.path):"",parentPath:typeof i.parentPath=="string"?en(i.parentPath):"",entries:a.flatMap(l=>{if(!l||typeof l!="object"||Array.isArray(l))return[];const u=l,d=typeof u.name=="string"?u.name.trim():"",f=typeof u.path=="string"?en(u.path):"";return d&&f?[{name:d,path:f}]:[]})}}async function fb(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function yd(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 _d(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=Dn(r,"Failed to open project root");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return typeof s.path=="string"?en(s.path):""}async function RM(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await fb(t);if(!t.ok){const s=Dn(n,"Failed to create local directory");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof o.path=="string"?en(o.path):""}async function MM(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=Dn(r,"Failed to suggest project name");throw new Error(i)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return{name:typeof s.name=="string"?s.name.trim():"",path:typeof s.path=="string"?en(s.path):""}}async function PM(e,t,n=20){const r=e.trim();if(!r)return[];const o=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),s=await o.json();if(!o.ok){const u=Dn(s,"Failed to search files");throw new Error(u)}const i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function $M(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}}async function NM(e,t){const n=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e,allowedUserIds:t})}),r=await n.json();if(!n.ok){const o=Dn(r,"Failed to connect Telegram bot");throw new Error(o)}}async function OM(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const i=Dn(t,"Failed to load Telegram configuration");throw new Error(i)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{},o=Array.isArray(r.allowedUserIds)?r.allowedUserIds:[],s=[];for(const i of o){if(i==="*"){s.push("*");continue}typeof i=="number"&&Number.isFinite(i)&&s.push(Math.trunc(i))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:s}}async function LM(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=Dn(t,"Failed to load Telegram status");throw new Error(o)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return{configured:r.configured===!0,active:r.active===!0,mappedChats:typeof r.mappedChats=="number"?r.mappedChats:0,mappedThreads:typeof r.mappedThreads=="number"?r.mappedThreads:0,allowedUsers:typeof r.allowedUsers=="number"?r.allowedUsers:0,allowAllUsers:r.allowAllUsers===!0,lastError:typeof r.lastError=="string"?r.lastError:""}}function DM(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function jM(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const d=new Date;e==="search-daily"?d.setUTCDate(d.getUTCDate()-1):e==="search-weekly"?d.setUTCDate(d.getUTCDate()-7):d.setUTCDate(d.getUTCDate()-30);const f=new URLSearchParams({q:`created:>=${DM(d)}`,sort:"stars",order:"desc",per_page:String(n)}),m=await fetch(`https://api.github.com/search/repositories?${f.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!m.ok)throw new Error(`Failed to fetch GitHub search projects (${m.status})`);const v=await m.json(),E=v&&typeof v=="object"&&!Array.isArray(v)?v:{},C=Array.isArray(E.items)?E.items:[],H=[];for(const M of C){if(!M||typeof M!="object"||Array.isArray(M))continue;const O=M,V=typeof O.id=="number"?O.id:0,K=typeof O.full_name=="string"?O.full_name.trim():"",de=typeof O.html_url=="string"?O.html_url.trim():"";if(!V||!K||!de)continue;const[oe="",ee=""]=K.split("/",2);H.push({id:V,fullName:K,owner:oe,repo:ee,url:de,description:sg(K,typeof O.description=="string"?O.description:""),language:typeof O.language=="string"?O.language.trim():"",stars:typeof O.stargazers_count=="number"?O.stargazers_count:0})}return H}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",o=new URLSearchParams({since:r,limit:String(n)}),s=await fetch(`/codex-api/github-trending?${o.toString()}`),i=await s.json();if(!s.ok){const d=Dn(i,"Failed to fetch GitHub trending projects");throw new Error(d)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],u=[];for(const d of l){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d,m=typeof f.id=="number"?f.id:0,v=typeof f.fullName=="string"?f.fullName.trim():"",E=typeof f.url=="string"?f.url.trim():"";if(!m||!v||!E)continue;const[C="",H=""]=v.split("/",2);u.push({id:m,fullName:v,owner:C,repo:H,url:E,description:sg(v,typeof f.description=="string"?f.description:""),language:typeof f.language=="string"?f.language.trim():"",stars:typeof f.stars=="number"?f.stars:0})}return u}function Dn(e,t){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.message;if(typeof r=="string"&&r.trim().length>0)return r;const o=n.error;return typeof o=="string"&&o.trim().length>0?o:t}async function FM(){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 bd(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 BM(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function UM(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function qM(e,t){var n;try{return((n=(await rn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function HM(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await rn("skills/list",t),r=[],o=new Set;for(const s of n.data)for(const i of s.skills)!i.name||o.has(i.path)||(o.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[]}}const WM=6e4;async function wd(e){const t=new AbortController,n=setTimeout(()=>t.abort(),WM);try{const r=new FormData;r.append("file",e);const o=await fetch("/codex-api/upload-file",{method:"POST",body:r,signal:t.signal});return o.ok?(await o.json()).path??null:null}catch{return null}finally{clearTimeout(n)}}const VM={},zM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function GM(e,t){return A(),D("svg",zM,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Tp=Et(VM,[["render",GM]]),KM={},YM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function JM(e,t){return A(),D("svg",YM,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const XM=Et(KM,[["render",JM]]),QM={},ZM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function eP(e,t){return A(),D("svg",ZM,[...t[0]||(t[0]=[_("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 ca=Et(QM,[["render",eP]]),tP={},nP={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function rP(e,t){return A(),D("svg",nP,[...t[0]||(t[0]=[_("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 gc=Et(tP,[["render",rP]]),oP={},sP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function iP(e,t){return A(),D("svg",sP,[...t[0]||(t[0]=[_("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 Ep=Et(oP,[["render",iP]]),aP={},lP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cP(e,t){return A(),D("svg",lP,[...t[0]||(t[0]=[_("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 uP=Et(aP,[["render",cP]]),dP={},fP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function pP(e,t){return A(),D("svg",fP,[...t[0]||(t[0]=[_("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 Xl=Et(dP,[["render",pP]]),hP={},mP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gP(e,t){return A(),D("svg",mP,[...t[0]||(t[0]=[_("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 Sd=Et(hP,[["render",gP]]),vP={key:0,class:"sidebar-menu-row-left"},yP={class:"sidebar-menu-row-main"},_P={key:1,class:"sidebar-menu-row-right"},bP={key:0,class:"sidebar-menu-row-right-default"},wP={key:1,class:"sidebar-menu-row-right-hover"},SP=In({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=vS(),r=ie(()=>!!n.left),o=ie(()=>!!n.right),s=ie(()=>!!n["right-hover"]),i=ie(()=>o.value||s.value);return(a,l)=>(A(),ht(Bf(t.as),Kv({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":s.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:Ct(()=>[r.value?(A(),D("span",vP,[ao(a.$slots,"left",{},void 0,!0)])):ge("",!0),_("span",yP,[ao(a.$slots,"default",{},void 0,!0)]),i.value?(A(),D("span",_P,[o.value?(A(),D("span",bP,[ao(a.$slots,"right",{},void 0,!0)])):ge("",!0),s.value?(A(),D("span",wP,[ao(a.$slots,"right-hover",{},void 0,!0)])):ge("",!0)])):ge("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),As=Et(SP,[["__scopeId","data-v-36239f39"]]),TP={class:"thread-tree-root"},EP={key:0,class:"pinned-section"},kP={class:"thread-list"},IP=["data-menu-open"],CP={class:"thread-left-stack"},AP=["data-state"],xP=["onClick"],RP=["onClick"],MP={class:"thread-row-title-wrap"},PP={class:"thread-row-title-line"},$P={class:"thread-row-title"},NP=["data-state"],OP={class:"thread-row-time"},LP=["onClick"],DP=["aria-expanded"],jP=["data-active"],FP={key:0},BP=["data-active"],UP={key:0},qP={key:1,class:"thread-tree-no-results"},HP={key:2,class:"thread-tree-loading"},WP={key:3,class:"thread-list thread-list-global"},VP=["data-menu-open"],zP={class:"thread-left-stack"},GP=["data-state"],KP=["onClick"],YP=["onClick"],JP={class:"thread-row-title-wrap"},XP={class:"thread-row-title-line"},QP={class:"thread-row-title"},ZP=["data-state"],e$={class:"thread-row-time"},t$=["onClick"],n$=["data-project-name","data-expanded","data-dragging"],r$={class:"project-icon-stack"},o$={class:"project-icon-folder"},s$={class:"project-icon-chevron"},i$=["data-dragging-handle","onMousedown"],a$={class:"project-title"},l$={class:"project-hover-controls"},c$=["onClick"],u$=["data-open-direction"],d$=["onClick"],f$=["onClick"],p$=["onInput"],h$=["aria-label","title","onClick"],m$={key:0,class:"thread-list"},g$=["data-menu-open"],v$={class:"thread-left-stack"},y$=["data-state"],_$=["onClick"],b$=["onClick"],w$={class:"thread-row-title-wrap"},S$={class:"thread-row-title-line"},T$={class:"thread-row-title"},E$=["data-state"],k$={class:"thread-row-time"},I$=["onClick"],C$=["onClick"],A$=["data-open-direction"],x$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},R$=["onKeydown"],M$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},P$={class:"rename-thread-subtitle"},$$=4,mg=6,gg="codex-web-local.thread-view-mode.v1",vg="codex-web-local.collapsed-projects.v1",N$=In({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-thread-files","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread"],setup(e,{emit:t}){const n=e,r=t,o=N({}),s=N({});let i=!1;const a=N([]),l=N(""),u=N(""),d=N({}),f=N({}),m=N({}),v=N("actions"),E=N(""),C=N(!1),H=N(""),M=N(""),O=N(null),V=N(!1),K=N(""),de=N(""),oe=N(null),ee=N(null),ve=N(null);let Pe=null,Re=null;const De=N(""),Q=N({}),pe=new Map,Me=new Map,qe=new Map,_e=new WeakMap,Te=N(null),le=N(null),Ee=N(!1),Fe=N(Ke()),Ne=typeof window<"u"?new ResizeObserver(S=>{for(const x of S){const L=x.target,W=_e.get(L);W&&cr(W,L)}}):null;function Ge(){if(typeof window>"u")return{};try{const S=window.localStorage.getItem(vg);if(!S)return{};const x=JSON.parse(S);return!x||typeof x!="object"||Array.isArray(x)?{}:x}catch{return{}}}function Ke(){return typeof window>"u"?"project":window.localStorage.getItem(gg)==="chronological"?"chronological":"project"}s.value=Ge(),ut(s,S=>{typeof window>"u"||window.localStorage.setItem(vg,JSON.stringify(S))},{deep:!0}),ut(Fe,S=>{typeof window>"u"||window.localStorage.setItem(gg,S)});const Ye=ie(()=>n.searchQuery.trim().toLowerCase()),lt=ie(()=>Ye.value.length>0),Xe=ie(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),Y=ie(()=>new Set(a.value));function Se(S){if(!lt.value)return!0;if(Xe.value)return Xe.value.has(S.id);const x=Ye.value;return S.title.toLowerCase().includes(x)||S.preview.toLowerCase().includes(x)}const he=ie(()=>lt.value?n.groups.map(S=>({...S,threads:S.threads.filter(Se)})).filter(S=>S.threads.length>0):n.groups),Ue=ie(()=>Fe.value==="chronological"),Ze=ie(()=>{const S=he.value,x=[];for(const L of S)for(const W of L.threads)Y.value.has(W.id)||x.push(W);return x.sort((L,W)=>{const w=new Date(L.updatedAtIso||L.createdAtIso).getTime();return new Date(W.updatedAtIso||W.createdAtIso).getTime()-w})}),T=ie(()=>{const S=new Map;for(const x of n.groups)for(const L of x.threads)S.set(L.id,L);return S});ut(a,S=>{i&&UM(S)}),ut(T,S=>{const x=a.value.filter(L=>S.has(L));x.length!==a.value.length&&(a.value=x)}),ds(async()=>{const{threadIds:S}=await BM(),x=Array.isArray(S)?S.filter(L=>typeof L=="string").map(L=>L.trim()).filter((L,W,w)=>L.length>0&&w.indexOf(L)===W):[];x.length>0&&(a.value=x),i=!0});const k=ie(()=>{const S=new Map;for(const x of n.groups)for(const L of x.threads)S.set(L.id,x.projectName);return S}),q=ie(()=>{const S=new Map;for(const x of n.groups){const L=x.threads.filter(W=>!Y.value.has(W.id));S.set(x.projectName,L)}return S}),te=ie(()=>{const S=new Map;for(const x of n.groups)for(const L of x.threads){const W=new Date(L.updatedAtIso||L.createdAtIso).getTime();S.set(L.id,W)}return S}),Z=ie(()=>{const S=u.value;return S?T.value.get(S)??null:null}),X=ie(()=>a.value.map(S=>T.value.get(S)??null).filter(S=>S!==null).filter(Se)),ae=ie(()=>{const S=ve.value;if(!S||S.dropTargetIndexFull===null||n.groups.length===0)return null;const x=Math.max(0,Math.min(S.dropTargetIndexFull,n.groups.length)),L=x>S.fromIndex?x-1:x,W=Math.max(0,Math.min(L,n.groups.length-1));return W===S.fromIndex?null:W}),me=ie(()=>{const x=(lt.value?he.value:n.groups).map(z=>z.projectName),L=ve.value,W=ae.value;if(!L||W===null)return x;const w=[...x],[P]=w.splice(L.fromIndex,1);return P?(w.splice(W,0,P),w):x}),fe=ie(()=>{const S={};let x=0;for(const L of me.value)S[L]=x,x+=hn(L);return S}),ne=ie(()=>{let S=0;for(const x of me.value)S+=hn(x);return{height:`${Math.max(0,S)}px`}});function Le(S){if(Number.isNaN(S))return"n/a";const x=Math.abs(Date.now()-S);if(x<6e4)return"now";const L=Math.floor(x/6e4);if(L<60)return`${L}m`;const W=Math.floor(L/60);return W<24?`${W}h`:`${Math.floor(W/24)}d`}function ke(S){const x=te.value.get(S.id);return Le(typeof x=="number"?x:new Date(S.updatedAtIso||S.createdAtIso).getTime())}function we(S){return Y.value.has(S)}function xe(S){if(we(S)){a.value=a.value.filter(x=>x!==S);return}a.value=[S,...a.value]}function R(S){r("select",S)}function $(S){r("export-thread",S),it()}function F(S){r("fork-thread",S),it()}function J(S){return`start new thread ${Xn(S)}`}function ce(S){r("start-new-thread",S)}function Oe(S){r("browse-thread-files",S),it()}function We(S,x){if(u.value===S){if(x){const L=x.relatedTarget,W=le.value;if(L instanceof Node&&W&&W.contains(L))return}it()}}function st(S){return u.value===S}function it(){u.value="",m.value={}}function $t(S){if(u.value===S){it();return}kt(),Ee.value=!1,u.value=S,Jt(()=>{It(S)})}function _t(S,x){S.preventDefault(),u.value=x}function on(S,x){H.value=S,M.value=x,C.value=!0,it(),Jt(()=>{var L,W;(L=O.value)==null||L.focus(),(W=O.value)==null||W.select()})}function ot(){C.value=!1,H.value="",M.value=""}function fn(){const S=H.value,x=M.value.trim();!S||!x||(r("rename-thread",{threadId:S,title:x}),ot())}function Qt(S,x){K.value=S,de.value=x,V.value=!0,it()}function mr(){V.value=!1,K.value="",de.value=""}function ir(){const S=K.value;S&&(a.value=a.value.filter(x=>x!==S),r("archive",S),mr())}function Xn(S){return n.projectDisplayNameById[S]??S}function zt(S){return l.value===S}function kt(){l.value="",v.value="actions",E.value=""}function pn(){const S=!Ee.value;S&&(kt(),it()),Ee.value=S}function Ut(S){Fe.value=S,Ee.value=!1}function uo(S){if(l.value===S){kt();return}it(),Ee.value=!1,l.value=S,v.value="actions",E.value=Xn(S),Jt(()=>{mn(S)})}function ms(S){it(),l.value=S,v.value="rename",E.value=Xn(S),Jt(()=>{mn(S)})}function fo(S){r("rename-project",{projectName:S,displayName:E.value})}function gr(S){r("remove-project",S),kt()}function zr(S,x){if(!S.altKey||S.key!=="ArrowUp"&&S.key!=="ArrowDown")return;const L=n.groups.findIndex(P=>P.projectName===x);if(L<0)return;const W=S.key==="ArrowUp"?-1:1,w=Math.max(0,Math.min(L+W,n.groups.length-1));w!==L&&(S.preventDefault(),r("reorder-project",{projectName:x,toIndex:w}))}function bn(S){return o.value[S]===!0}function sn(S){return s.value[S]===!0}function Gr(S){o.value={...o.value,[S]:!bn(S)}}function wn(S){if(De.value===S){De.value="";return}s.value={...s.value,[S]:!sn(S)}}function hn(S){const x=Q.value[S]??0,L=ve.value,w=((L==null?void 0:L.projectName)===S?L.groupHeight:null)??x,P=sn(S)?0:mg;return Math.max(0,w+P)}function jn(S,x){const L=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(L){Me.set(S,L);return}Me.delete(S)}function ar(S,x){const L=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(L){qe.set(S,L);return}qe.delete(S)}function Fn(S){let x=S.parentElement;for(;x;){const L=window.getComputedStyle(x),W=L.overflowY||L.overflow;if(W==="auto"||W==="scroll"||W==="hidden"||W==="clip")return x.getBoundingClientRect();x=x.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function qt(S,x){const L=S.getBoundingClientRect(),W=Fn(S),w=6,P=W.bottom-L.bottom,z=L.top-W.top;return P>=x+w?"down":z>P?"up":"down"}function vr(S,x){const L=qe.get(S);if(!L)return"down";const W=qt(L,x);return f.value={...f.value,[S]:W},W}function lr(S){return f.value[S]??"down"}function mn(S){const x=Me.get(S);x&&(d.value={...d.value,[S]:qt(x,112)})}function Ht(S,x,L){return Math.min(Math.max(S,x),L)}function It(S){const x=qe.get(S);if(!x)return;const L=le.value,W=L==null?void 0:L.getBoundingClientRect(),w=(W==null?void 0:W.height)||(L==null?void 0:L.offsetHeight)||112,P=(W==null?void 0:W.width)||(L==null?void 0:L.offsetWidth)||160,z=vr(S,w),be=x.getBoundingClientRect(),tt=8,Pt=4,Gt=Math.max(tt,window.innerWidth-P-tt),Ot=Ht(be.right-P,tt,Gt),Ft=Ht(z==="up"?be.top-w-Pt:be.bottom+Pt,tt,Math.max(tt,window.innerHeight-w-tt));m.value={left:`${Math.round(Ot)}px`,top:`${Math.round(Ft)}px`}}function Sn(){const S=u.value;S&&It(S)}function Cn(){window.addEventListener("resize",Sn),document.addEventListener("scroll",Sn,!0)}function An(){window.removeEventListener("resize",Sn),document.removeEventListener("scroll",Sn,!0)}function gn(S){const x=l.value;if(!x)return!1;const L=Me.get(x);if(!L)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(L))return!0;const w=S.target;return w instanceof Node?L.contains(w):!1}function Bn(S){const x=u.value;if(!x)return!1;const L=qe.get(x);if(!L)return!1;const W=typeof S.composedPath=="function"?S.composedPath():[];if(W.includes(L))return!0;const w=le.value;if(w&&W.includes(w))return!0;const P=S.target;return P instanceof Node?!!(L.contains(P)||w&&w.contains(P)):!1}function xn(S){if(Ee.value){const x=Te.value,L=typeof S.composedPath=="function"?S.composedPath():[];!!x&&(L.includes(x)||S.target instanceof Node&&x.contains(S.target))||(Ee.value=!1)}l.value&&(gn(S)||kt(),u.value&&(Bn(S)||it()))}function yt(S){l.value&&!gn(S)&&kt(),u.value&&!Bn(S)&&it()}function St(){Ee.value&&(Ee.value=!1),l.value&&kt(),u.value&&it()}function yr(){window.addEventListener("pointerdown",xn,{capture:!0}),window.addEventListener("focusin",yt,{capture:!0}),window.addEventListener("blur",St)}function Un(){window.removeEventListener("pointerdown",xn,{capture:!0}),window.removeEventListener("focusin",yt,{capture:!0}),window.removeEventListener("blur",St)}function cr(S,x){const L=x.getBoundingClientRect().height;if(!Number.isFinite(L)||L<=0)return;const W=Q.value[S];W!==void 0&&Math.abs(W-L)<.5||(Q.value={...Q.value,[S]:L})}function Bo(S,x){const L=pe.get(S);L&&L!==x&&Ne&&Ne.unobserve(L);const W=x instanceof HTMLElement?x:x&&"$el"in x&&x.$el instanceof HTMLElement?x.$el:null;if(W){pe.set(S,W),_e.set(W,S),cr(S,W),Ne==null||Ne.observe(W);return}L&&(Ne==null||Ne.unobserve(L)),pe.delete(S)}function vn(S,x){if(S.button!==0||ee.value||ve.value)return;const L=n.groups.findIndex(z=>z.projectName===x),W=pe.get(x);if(L<0||!W)return;const w=W.getBoundingClientRect(),P=sn(x)?0:mg;ee.value={projectName:x,fromIndex:L,startClientX:S.clientX,startClientY:S.clientY,pointerOffsetY:S.clientY-w.top,groupLeft:w.left,groupWidth:w.width,groupHeight:w.height,groupOuterHeight:w.height+P},S.preventDefault(),Qn()}function Qn(){window.addEventListener("mousemove",Zn),window.addEventListener("mouseup",Yr),window.addEventListener("keydown",qn)}function Kr(){window.removeEventListener("mousemove",Zn),window.removeEventListener("mouseup",Yr),window.removeEventListener("keydown",qn)}function Zn(S){Pe={clientX:S.clientX,clientY:S.clientY},Tn()}function Yr(S){_r({clientX:S.clientX,clientY:S.clientY});const x=ve.value;if(x&&ae.value!==null){const L=n.groups.findIndex(W=>W.projectName===x.projectName);if(L>=0){const W=ae.value;W!==L&&r("reorder-project",{projectName:x.projectName,toIndex:W})}}Wt()}function qn(S){S.key==="Escape"&&(!ee.value&&!ve.value||(S.preventDefault(),Wt()))}function Wt(){Re!==null&&(window.cancelAnimationFrame(Re),Re=null),Pe=null,ee.value=null,ve.value=null,De.value="",Kr()}function Tn(){Re===null&&(Re=window.requestAnimationFrame(()=>{if(Re=null,!Pe)return;const S=Pe;Pe=null,_r(S)}))}function _r(S){const x=ee.value;if(!ve.value&&x){const L=S.clientX-x.startClientX,W=S.clientY-x.startClientY;if(Math.hypot(L,W)<$$)return;kt(),De.value=x.projectName,ve.value={projectName:x.projectName,fromIndex:x.fromIndex,pointerOffsetY:x.pointerOffsetY,groupLeft:x.groupLeft,groupWidth:x.groupWidth,groupHeight:x.groupHeight,groupOuterHeight:x.groupOuterHeight,ghostTop:S.clientY-x.pointerOffsetY,dropTargetIndexFull:null}}ve.value&&Hn(S)}function Hn(S){const x=ve.value;if(!x)return;if(x.ghostTop=S.clientY-x.pointerOffsetY,!an(S)){x.dropTargetIndexFull=null;return}const L=S.clientY,W=oe.value;if(!W){x.dropTargetIndexFull=null;return}const w=W.getBoundingClientRect(),P=new Map(n.groups.map((Pt,Gt)=>[Pt.projectName,Gt])),z=n.groups.map(Pt=>Pt.projectName).filter(Pt=>Pt!==x.projectName);let be=0,tt=n.groups.length;for(const Pt of z){const Gt=P.get(Pt);if(Gt===void 0)continue;const Ot=hn(Pt),Ft=w.top+be+Ot/2;if(L<Ft){tt=Gt;break}be+=Ot}x.dropTargetIndexFull=tt}function an(S){const x=oe.value;if(!x)return!1;const L=x.getBoundingClientRect(),W=S.clientX>=L.left&&S.clientX<=L.right,w=S.clientY>=L.top-32&&S.clientY<=L.bottom+32;return W&&w}function Mr(S){var x;return((x=ve.value)==null?void 0:x.projectName)===S}function br(S){const x=ve.value,L=fe.value[S]??0,W=u.value?k.value.get(u.value)??"":"",w=l.value===S||W===S;return!x||x.projectName!==S?{position:"absolute",top:"0",left:"0",right:"0",zIndex:w?"40":"1",transform:`translate3d(0, ${L}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${x.groupLeft}px`,width:`${x.groupWidth}px`,height:`${x.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${x.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function yn(S){return q.value.get(S.projectName)??[]}function Jr(S){if(lt.value)return yn(S);if(sn(S.projectName))return[];const x=yn(S);return bn(S.projectName)?x:x.slice(0,10)}function er(S){return lt.value?!1:!sn(S.projectName)&&yn(S).length>10}function ur(S){return yn(S).length>0}function $e(S){return!!S.pendingRequestState||S.inProgress||S.unread}function ye(S){return S.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function Dt(S){return S.pendingRequestState==="approval"?"awaiting-approval":S.pendingRequestState==="response"?"awaiting-response":S.inProgress?"working":S.unread?"unread":"idle"}ut(()=>n.groups.map(S=>S.projectName),S=>{var w,P;const x=((w=ve.value)==null?void 0:w.projectName)??((P=ee.value)==null?void 0:P.projectName)??"";x&&!n.groups.some(z=>z.projectName===x)&&Wt();const L=new Set(S),W=Object.fromEntries(Object.entries(Q.value).filter(([z])=>L.has(z)));Object.keys(W).length!==Object.keys(Q.value).length&&(Q.value=W)});const Uo=ie(()=>Ee.value||l.value!==""||u.value!=="");return ut(Uo,S=>{if(S){yr();return}Un()}),ut(u,S=>{if(!S){An();return}Cn(),Jt(()=>{It(S)})}),Vs(()=>{for(const S of pe.values())Ne==null||Ne.unobserve(S);pe.clear(),Me.clear(),An(),Un(),Wt()}),(S,x)=>(A(),D("section",TP,[X.value.length>0?(A(),D("section",EP,[_("ul",kP,[(A(!0),D(Qe,null,Bt(X.value,L=>(A(),D("li",{key:L.id,class:"thread-row-item","data-menu-open":st(L.id)?"true":"false"},[ze(As,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":we(L.id),"data-menu-open":st(L.id)?"true":"false","force-right-hover":st(L.id),onMouseleave:W=>We(L.id,W),onContextmenu:W=>_t(W,L.id)},{left:Ct(()=>[_("span",CP,[$e(L)?(A(),D("span",{key:0,class:"thread-status-indicator","data-state":Dt(L)},null,8,AP)):ge("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:W=>xe(L.id)},[ze(Sd,{class:"thread-icon"})],8,xP)])]),right:Ct(()=>[_("span",OP,ue(ke(L)),1)]),"right-hover":Ct(()=>[_("div",{ref_for:!0,ref:W=>ar(L.id,W),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(W=>$t(L.id),["stop"])},[ze(ca,{class:"thread-icon"})],8,LP)],512)]),default:Ct(()=>[_("button",{class:"thread-main-button",type:"button",onClick:W=>R(L.id)},[_("span",MP,[_("span",PP,[_("span",$P,ue(L.title),1),L.hasWorktree?(A(),ht(Xl,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),L.pendingRequestState?(A(),D("span",{key:1,class:"thread-row-request-chip","data-state":L.pendingRequestState},ue(ye(L)),9,NP)):ge("",!0)])])],8,RP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,IP))),128))])])):ge("",!0),ze(As,{as:"header",class:"thread-tree-header-row"},{right:Ct(()=>[_("div",{ref_key:"organizeMenuWrapRef",ref:Te,class:"organize-menu-wrap"},[_("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Ee.value,"aria-label":"Organize threads",title:"Organize threads",onClick:pn},[ze(ca,{class:"thread-icon"})],8,DP),Ee.value?(A(),D("div",{key:0,class:"organize-menu-panel",onClick:x[2]||(x[2]=ft(()=>{},["stop"]))},[x[14]||(x[14]=_("p",{class:"organize-menu-title"},"Organize",-1)),_("button",{class:"organize-menu-item","data-active":Fe.value==="project",type:"button",onClick:x[0]||(x[0]=L=>Ut("project"))},[x[12]||(x[12]=_("span",null,"By project",-1)),Fe.value==="project"?(A(),D("span",FP,"✓")):ge("",!0)],8,jP),_("button",{class:"organize-menu-item","data-active":Fe.value==="chronological",type:"button",onClick:x[1]||(x[1]=L=>Ut("chronological"))},[x[13]||(x[13]=_("span",null,"Chronological list",-1)),Fe.value==="chronological"?(A(),D("span",UP,"✓")):ge("",!0)],8,BP)])):ge("",!0)],512)]),default:Ct(()=>[x[15]||(x[15]=_("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),lt.value&&he.value.length===0?(A(),D("p",qP,"No matching threads")):e.isLoading&&e.groups.length===0?(A(),D("p",HP,"Loading threads...")):Ue.value?(A(),D("ul",WP,[(A(!0),D(Qe,null,Bt(Ze.value,L=>(A(),D("li",{key:L.id,class:"thread-row-item","data-menu-open":st(L.id)?"true":"false"},[ze(As,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":we(L.id),"data-menu-open":st(L.id)?"true":"false","force-right-hover":st(L.id),onMouseleave:W=>We(L.id,W),onContextmenu:W=>_t(W,L.id)},{left:Ct(()=>[_("span",zP,[$e(L)?(A(),D("span",{key:0,class:"thread-status-indicator","data-state":Dt(L)},null,8,GP)):ge("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:W=>xe(L.id)},[ze(Sd,{class:"thread-icon"})],8,KP)])]),right:Ct(()=>[_("span",e$,ue(ke(L)),1)]),"right-hover":Ct(()=>[_("div",{ref_for:!0,ref:W=>ar(L.id,W),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(W=>$t(L.id),["stop"])},[ze(ca,{class:"thread-icon"})],8,t$)],512)]),default:Ct(()=>[_("button",{class:"thread-main-button",type:"button",onClick:W=>R(L.id)},[_("span",JP,[_("span",XP,[_("span",QP,ue(L.title),1),L.hasWorktree?(A(),ht(Xl,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),L.pendingRequestState?(A(),D("span",{key:1,class:"thread-row-request-chip","data-state":L.pendingRequestState},ue(ye(L)),9,ZP)):ge("",!0)])])],8,YP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,VP))),128))])):(A(),D("div",{key:4,ref_key:"groupsContainerRef",ref:oe,class:"thread-tree-groups",style:ko(ne.value)},[(A(!0),D(Qe,null,Bt(he.value,L=>(A(),D("article",{key:L.projectName,ref_for:!0,ref:W=>Bo(L.projectName,W),class:"project-group","data-project-name":L.projectName,"data-expanded":!sn(L.projectName),"data-dragging":Mr(L.projectName),style:ko(br(L.projectName))},[ze(As,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:W=>wn(L.projectName),onKeydown:[W=>zr(W,L.projectName),Zt(ft(W=>wn(L.projectName),["prevent"]),["enter"]),Zt(ft(W=>wn(L.projectName),["prevent"]),["space"])]},{left:Ct(()=>[_("span",r$,[_("span",o$,[sn(L.projectName)?(A(),ht(Ep,{key:0,class:"thread-icon"})):(A(),ht(uP,{key:1,class:"thread-icon"}))]),_("span",s$,[sn(L.projectName)?(A(),ht(XM,{key:0,class:"thread-icon"})):(A(),ht(Tp,{key:1,class:"thread-icon"}))])])]),right:Ct(()=>[_("div",l$,[_("div",{ref_for:!0,ref:W=>jn(L.projectName,W),class:"project-menu-wrap"},[_("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ft(W=>uo(L.projectName),["stop"])},[ze(ca,{class:"thread-icon"})],8,c$),zt(L.projectName)?(A(),D("div",{key:0,class:"project-menu-panel","data-open-direction":d.value[L.projectName]??"down",onClick:x[4]||(x[4]=ft(()=>{},["stop"]))},[v.value==="actions"?(A(),D(Qe,{key:0},[_("button",{class:"project-menu-item",type:"button",onClick:W=>ms(L.projectName)}," Edit name ",8,d$),_("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:W=>gr(L.projectName)}," Remove ",8,f$)],64)):(A(),D(Qe,{key:1},[x[16]||(x[16]=_("label",{class:"project-menu-label"},"Project name",-1)),Kn(_("input",{"onUpdate:modelValue":x[3]||(x[3]=W=>E.value=W),class:"project-menu-input",type:"text",onInput:W=>fo(L.projectName)},null,40,p$),[[rr,E.value]])],64))],8,u$)):ge("",!0)],512),_("button",{class:"thread-start-button",type:"button","aria-label":J(L.projectName),title:J(L.projectName),onClick:ft(W=>ce(L.projectName),["stop"])},[ze(gc,{class:"thread-icon"})],8,h$)])]),default:Ct(()=>[_("span",{class:"project-main-button","data-dragging-handle":Mr(L.projectName),onMousedown:ft(W=>vn(W,L.projectName),["left"])},[_("span",a$,ue(Xn(L.projectName)),1)],40,i$)]),_:2},1032,["onClick","onKeydown"]),ur(L)?(A(),D("ul",m$,[(A(!0),D(Qe,null,Bt(Jr(L),W=>(A(),D("li",{key:W.id,class:"thread-row-item","data-menu-open":st(W.id)?"true":"false"},[ze(As,{class:"thread-row","data-active":W.id===e.selectedThreadId,"data-pinned":we(W.id),"data-menu-open":st(W.id)?"true":"false","force-right-hover":st(W.id),onMouseleave:w=>We(W.id,w),onContextmenu:w=>_t(w,W.id)},{left:Ct(()=>[_("span",v$,[$e(W)?(A(),D("span",{key:0,class:"thread-status-indicator","data-state":Dt(W)},null,8,y$)):ge("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:w=>xe(W.id)},[ze(Sd,{class:"thread-icon"})],8,_$)])]),right:Ct(()=>[_("span",k$,ue(ke(W)),1)]),"right-hover":Ct(()=>[_("div",{ref_for:!0,ref:w=>ar(W.id,w),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(w=>$t(W.id),["stop"])},[ze(ca,{class:"thread-icon"})],8,I$)],512)]),default:Ct(()=>[_("button",{class:"thread-main-button",type:"button",onClick:w=>R(W.id)},[_("span",w$,[_("span",S$,[_("span",T$,ue(W.title),1),W.hasWorktree?(A(),ht(Xl,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ge("",!0),W.pendingRequestState?(A(),D("span",{key:1,class:"thread-row-request-chip","data-state":W.pendingRequestState},ue(ye(W)),9,E$)):ge("",!0)])])],8,b$)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,g$))),128))])):(A(),ht(As,{key:1,as:"p",class:"project-empty-row"},{left:Ct(()=>[...x[17]||(x[17]=[_("span",{class:"project-empty-spacer"},null,-1)])]),default:Ct(()=>[x[18]||(x[18]=_("span",{class:"project-empty"},"No threads",-1))]),_:1})),er(L)?(A(),ht(As,{key:2,class:"thread-show-more-row"},{left:Ct(()=>[...x[19]||(x[19]=[_("span",{class:"thread-show-more-spacer"},null,-1)])]),default:Ct(()=>[_("button",{class:"thread-show-more-button",type:"button",onClick:W=>Gr(L.projectName)},ue(bn(L.projectName)?"Show less":"Show more"),9,C$)]),_:2},1024)):ge("",!0)],12,n$))),128))],4)),(A(),ht(ma,{to:"body"},[Z.value?(A(),D("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:le,class:"thread-menu-panel thread-menu-panel-fixed",style:ko(m.value),"data-open-direction":lr(Z.value.id),onClick:x[10]||(x[10]=ft(()=>{},["stop"]))},[_("button",{class:"thread-menu-item",type:"button",onClick:x[5]||(x[5]=L=>Oe(Z.value.id))}," Browse files "),_("button",{class:"thread-menu-item",type:"button",onClick:x[6]||(x[6]=L=>$(Z.value.id))}," Export chat "),_("button",{class:"thread-menu-item",type:"button",onClick:x[7]||(x[7]=L=>F(Z.value.id))}," Create chat fork "),_("button",{class:"thread-menu-item",type:"button",onClick:x[8]||(x[8]=L=>on(Z.value.id,Z.value.title))}," Rename thread "),_("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:x[9]||(x[9]=L=>Qt(Z.value.id,Z.value.title))}," Delete thread ")],12,A$)):ge("",!0)])),(A(),ht(ma,{to:"body"},[C.value?(A(),D("div",{key:0,class:"rename-thread-overlay",onClick:ft(ot,["self"])},[_("div",x$,[x[20]||(x[20]=_("h3",{class:"rename-thread-title"},"Rename thread",-1)),x[21]||(x[21]=_("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Kn(_("input",{ref_key:"renameThreadInputRef",ref:O,"onUpdate:modelValue":x[11]||(x[11]=L=>M.value=L),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Zt(ft(fn,["prevent"]),["enter"]),Zt(ft(ot,["prevent"]),["esc"])]},null,40,R$),[[rr,M.value]]),_("div",{class:"rename-thread-actions"},[_("button",{class:"rename-thread-button",type:"button",onClick:ot},"Cancel"),_("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:fn},"Save")])])])):ge("",!0)])),(A(),ht(ma,{to:"body"},[V.value?(A(),D("div",{key:0,class:"rename-thread-overlay",onClick:ft(mr,["self"])},[_("div",M$,[x[22]||(x[22]=_("h3",{class:"rename-thread-title"},"Delete thread?",-1)),_("p",P$,' This will archive the thread "'+ue(de.value)+'". You can find it later in archived threads. ',1),_("div",{class:"rename-thread-actions"},[_("button",{class:"rename-thread-button",type:"button",onClick:mr},"Cancel"),_("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:ir},"Delete")])])])):ge("",!0)]))]))}}),O$=Et(N$,[["__scopeId","data-v-24f893c5"]]),L$={class:"content-header"},D$={class:"content-leading"},j$={class:"content-title"},F$={class:"content-actions"},B$=In({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(A(),D("header",L$,[_("div",D$,[ao(t.$slots,"leading",{},void 0)]),_("h1",j$,ue(e.title),1),_("div",F$,[ao(t.$slots,"actions",{},void 0)])]))}}),U$=Et(B$,[["__scopeId","data-v-66ee223c"]]),yg=.0025,Td=3,_g=2,q$=256;function H$(e){var De;const t=N("idle"),n=N(typeof navigator<"u"&&!!((De=navigator.mediaDevices)!=null&&De.getUserMedia)),r=N(0),o=N(null);let s=null,i=null,a=[],l=null,u=null,d=null,f=null,m=[],v=!1,E=!1,C=null;function H(){C&&(C.abort(),C=null),t.value==="transcribing"&&(t.value="idle")}function M(){const Q=o.value;if(!Q||typeof window>"u")return;const pe=Q.getContext("2d");if(!pe)return;const Me=Math.max(1,Math.floor(Q.clientWidth)),qe=Math.max(1,Math.floor(Q.clientHeight||36)),_e=window.devicePixelRatio||1,Te=Math.max(1,Math.floor(Me*_e)),le=Math.max(1,Math.floor(qe*_e));(Q.width!==Te||Q.height!==le)&&(Q.width=Te,Q.height=le),pe.setTransform(_e,0,0,_e,0,0),pe.clearRect(0,0,Me,qe);const Ee=Math.max(12,Math.floor(Me/(Td+_g))),Fe=m.slice(-Ee),Ne=Math.max(0,Ee-Fe.length),Ge=qe/2,Ke=getComputedStyle(Q).color||"#000000";for(let Ye=0;Ye<Ee;Ye+=1){const lt=Fe[Ye-Ne]??0,Y=Math.max(.08,Math.min(1,lt*18))*Ge,Se=Ye*(Td+_g);pe.globalAlpha=lt<=yg?.35:1,pe.fillStyle=Ke,pe.fillRect(Se,Ge-Y,Td,Y*2)}pe.globalAlpha=1}function O(){m=[],r.value=0,M()}function V(){d&&(d.disconnect(),d.onaudioprocess=null,d=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function K(Q){if(typeof window>"u")return;const pe=window.webkitAudioContext,Me=window.AudioContext??pe;Me&&(V(),O(),l=new Me,u=l.createMediaStreamSource(Q),d=l.createScriptProcessor(2048,1,1),f=performance.now(),d.onaudioprocess=qe=>{const _e=qe.inputBuffer.getChannelData(0);let Te=0;for(let le=0;le<_e.length;le+=1){const Ee=Math.abs(_e[le]??0);Te+=Ee<yg?0:Ee}m.push(Te/_e.length),m.length>q$&&m.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),M()},u.connect(d),d.connect(l.destination),M())}async function de(){var Q;if(t.value==="transcribing"&&H(),!(t.value!=="idle"||!n.value||v)){v=!0,E=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],s=new MediaRecorder(i),s.ondataavailable=pe=>{pe.data.size>0&&a.push(pe.data)},s.onstop=()=>{var qe;const pe=a,Me=(s==null?void 0:s.mimeType)||((qe=pe[0])==null?void 0:qe.type)||"audio/webm";Pe(),ve(pe,Me)},K(i),s.start(250),t.value="recording",E&&oe()}catch(pe){Pe(),t.value="idle",(Q=e.onError)==null||Q.call(e,pe)}finally{v=!1}}}function oe(){if(v&&t.value==="idle"){E=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function ee(){E=!1,H(),Pe(),t.value="idle"}async function ve(Q,pe){var _e,Te,le,Ee,Fe;if(Q.length===0){(_e=e.onEmpty)==null||_e.call(e),t.value="idle";return}const Me=new Blob(Q,{type:pe});t.value="transcribing";let qe=null;try{const Ne=pe.split(/[/;]/)[1]??"webm",Ge=new FormData;Ge.append("file",Me,`codex.${Ne}`);const Ke=((Te=e.getLanguage)==null?void 0:Te.call(e).trim())??"";Ke&&Ke.toLowerCase()!=="auto"&&Ge.append("language",Ke),qe=new AbortController,C=qe;const Ye=await fetch("/codex-api/transcribe",{method:"POST",body:Ge,signal:qe.signal}),lt=await Ye.text();let Xe=null;try{Xe=lt.trim()?JSON.parse(lt):null}catch{Xe=null}if(!Ye.ok){const Se=(le=Xe==null?void 0:Xe.error)==null?void 0:le.trim(),he=lt.trim();throw new Error(Se||he||`Transcription failed: ${Ye.status}`)}const Y=((Xe==null?void 0:Xe.text)??"").trim();Y.length>0?e.onTranscript(Y):(Ee=e.onEmpty)==null||Ee.call(e)}catch(Ne){if(Ne instanceof DOMException&&Ne.name==="AbortError")return;(Fe=e.onError)==null||Fe.call(e,Ne)}finally{qe&&C===qe&&(C=null),t.value==="transcribing"&&(t.value="idle")}}function Pe(){V(),O(),s&&(s.ondataavailable=null,s.onstop=null,s=null),i&&(i.getTracks().forEach(Q=>Q.stop()),i=null),a=[]}Vs(()=>{ee()});function Re(){if(t.value==="recording"){oe();return}(t.value==="idle"||t.value==="transcribing")&&de()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:de,stopRecording:oe,toggleRecording:Re,cancel:ee}}const W$={},V$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function z$(e,t){return A(),D("svg",V$,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const G$=Et(W$,[["render",z$]]),K$={},Y$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function J$(e,t){return A(),D("svg",Y$,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3L4 14h6l-1 7l9-11h-6z"},null,-1)])])}const X$=Et(K$,[["render",J$]]),Q$={},Z$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function eN(e,t){return A(),D("svg",Z$,[...t[0]||(t[0]=[_("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 tN=Et(Q$,[["render",eN]]),nN={},rN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function oN(e,t){return A(),D("svg",rN,[...t[0]||(t[0]=[_("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),_("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 bg=Et(nN,[["render",oN]]),sN=["disabled"],iN={class:"composer-dropdown-value"},aN={class:"composer-dropdown-menu"},lN={key:0,class:"composer-dropdown-search-wrap"},cN=["placeholder","onKeydown"],uN={class:"composer-dropdown-options",role:"listbox"},dN=["onClick"],fN={key:0,class:"composer-dropdown-empty"},pN=In({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(!1),a=N(""),l=ie(()=>{var O;const M=n.options.find(V=>V.value===n.modelValue);return M?M.label:((O=n.placeholder)==null?void 0:O.trim())||""}),u=ie(()=>n.openDirection??"down"),d=ie(()=>n.enableSearch===!0),f=ie(()=>{var M;return((M=n.searchPlaceholder)==null?void 0:M.trim())||"Quick search projects"}),m=ie(()=>{const M=a.value.trim().toLowerCase();return M?n.options.filter(O=>O.label.toLowerCase().includes(M)||O.value.toLowerCase().includes(M)):n.options});function v(){n.disabled||(i.value=!i.value)}function E(M){r("update:modelValue",M),i.value=!1,a.value=""}function C(){if(a.value.length>0){a.value="";return}i.value=!1}function H(M){if(!i.value)return;const O=o.value;if(!O)return;const V=M.target;V instanceof Node&&(O.contains(V)||(i.value=!1,a.value=""))}return ut(i,M=>{M&&d.value&&Jt(()=>{var O;return(O=s.value)==null?void 0:O.focus()})}),ds(()=>{window.addEventListener("pointerdown",H)}),Vs(()=>{window.removeEventListener("pointerdown",H)}),(M,O)=>(A(),D("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[_("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:v},[e.selectedPrefixIcon?(A(),ht(Bf(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ge("",!0),_("span",iN,ue(l.value),1),ze(Tp,{class:"composer-dropdown-chevron"})],8,sN),i.value?(A(),D("div",{key:0,class:pt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":u.value==="up","composer-dropdown-menu-wrap-down":u.value==="down"}])},[_("div",aN,[d.value?(A(),D("div",lN,[Kn(_("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":O[0]||(O[0]=V=>a.value=V),class:"composer-dropdown-search-input",type:"text",placeholder:f.value,onKeydown:Zt(ft(C,["prevent"]),["esc"])},null,40,cN),[[rr,a.value]])])):ge("",!0),_("ul",uN,[(A(!0),D(Qe,null,Bt(m.value,V=>(A(),D("li",{key:V.value},[_("button",{class:pt(["composer-dropdown-option",{"is-selected":V.value===e.modelValue}]),type:"button",onClick:K=>E(V.value)},ue(V.label),11,dN)]))),128)),m.value.length===0?(A(),D("li",fN," No matching projects ")):ge("",!0)])])],2)):ge("",!0)],512))}}),Os=Et(pN,[["__scopeId","data-v-fce3cdfb"]]),hN=["disabled"],mN={class:"search-dropdown-value"},gN={class:"search-dropdown-search-wrap"},vN=["placeholder","onKeydown"],yN={key:0,class:"search-dropdown-list",role:"listbox"},_N=["onClick","onPointerenter"],bN={class:"search-dropdown-option-check"},wN={class:"search-dropdown-option-label"},SN={key:0,class:"search-dropdown-option-desc"},TN={key:1,class:"search-dropdown-empty"},EN=In({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(null),a=N(!1),l=N(""),u=N(0),d=ie(()=>n.openDirection??"down"),f=ie(()=>new Set(n.selectedValues)),m=ie(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const K=n.options.find(de=>de.value===n.selectedValues[0]);return(K==null?void 0:K.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),v=ie(()=>{const K=l.value.toLowerCase().trim();return K?n.options.filter(de=>{var oe;return de.label.toLowerCase().includes(K)||(((oe=de.description)==null?void 0:oe.toLowerCase().includes(K))??!1)}):n.options});function E(){const K=s.value,de=o.value;if(!K||!de||window.innerWidth>=640)return;const oe=de.getBoundingClientRect();d.value==="up"?(K.style.setProperty("bottom",`${window.innerHeight-oe.top+8}px`,"important"),K.style.setProperty("top","auto","important")):(K.style.setProperty("top",`${oe.bottom+8}px`,"important"),K.style.setProperty("bottom","auto","important"))}function C(){n.disabled||(a.value=!a.value,a.value&&(l.value="",u.value=0,Jt(()=>{var K;Jt(()=>{E()}),(K=i.value)==null||K.focus()})))}function H(K){r("toggle",K.value,!f.value.has(K.value)),a.value=!1}function M(K){v.value.length!==0&&(u.value=(u.value+K+v.value.length)%v.value.length)}function O(){const K=v.value[u.value];K&&H(K)}function V(K){if(!a.value)return;const de=o.value;if(!de)return;const oe=K.target;oe instanceof Node&&(de.contains(oe)||(a.value=!1))}return ut(l,()=>{u.value=0}),ds(()=>window.addEventListener("pointerdown",V)),Vs(()=>window.removeEventListener("pointerdown",V)),(K,de)=>(A(),D("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[_("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:C},[_("span",mN,ue(m.value),1),ze(Tp,{class:"search-dropdown-chevron"})],8,hN),a.value?(A(),D("div",{key:0,ref_key:"menuRef",ref:s,class:pt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[_("div",gN,[Kn(_("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":de[0]||(de[0]=oe=>l.value=oe),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[de[1]||(de[1]=Zt(ft(oe=>a.value=!1,["prevent"]),["escape"])),Zt(ft(O,["prevent"]),["enter"]),de[2]||(de[2]=Zt(ft(oe=>M(1),["prevent"]),["arrow-down"])),de[3]||(de[3]=Zt(ft(oe=>M(-1),["prevent"]),["arrow-up"]))]},null,40,vN),[[rr,l.value]])]),v.value.length>0?(A(),D("ul",yN,[(A(!0),D(Qe,null,Bt(v.value,(oe,ee)=>(A(),D("li",{key:oe.value},[_("button",{class:pt(["search-dropdown-option",{"is-selected":f.value.has(oe.value),"is-highlighted":ee===u.value}]),type:"button",onClick:ve=>H(oe),onPointerenter:ve=>u.value=ee},[_("span",bN,ue(f.value.has(oe.value)?"✓":""),1),_("span",wN,ue(oe.label),1),oe.description?(A(),D("span",SN,ue(oe.description),1)):ge("",!0)],42,_N)]))),128))])):(A(),D("div",TN,"No results"))],2)):ge("",!0)],512))}}),kN=Et(EN,[["__scopeId","data-v-3147b20f"]]),IN={class:"skill-picker-header"},CN=["onKeydown"],AN={key:0,class:"skill-picker-list",role:"listbox"},xN=["onClick","onPointerenter"],RN={class:"skill-picker-name"},MN={key:0,class:"skill-picker-desc"},PN={key:1,class:"skill-picker-empty"},$N=In({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(""),a=N(0),l=ie(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(v=>v.name.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)):n.skills}),u=ie(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function d(m){l.value.length!==0&&(a.value=(a.value+m+l.value.length)%l.value.length)}function f(){const m=l.value[a.value];m&&r("select",m)}return ut(()=>n.visible,m=>{m&&(i.value="",a.value=0,Jt(()=>{var v;return(v=s.value)==null?void 0:v.focus()}))}),ut(i,()=>{a.value=0}),(m,v)=>e.visible?(A(),D("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:ko(u.value)},[_("div",IN,[Kn(_("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":v[0]||(v[0]=E=>i.value=E),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[v[1]||(v[1]=Zt(ft(E=>m.$emit("close"),["prevent"]),["escape"])),Zt(ft(f,["prevent"]),["enter"]),v[2]||(v[2]=Zt(ft(E=>d(1),["prevent"]),["arrow-down"])),v[3]||(v[3]=Zt(ft(E=>d(-1),["prevent"]),["arrow-up"]))]},null,40,CN),[[rr,i.value]])]),l.value.length>0?(A(),D("ul",AN,[(A(!0),D(Qe,null,Bt(l.value,(E,C)=>(A(),D("li",{key:E.path},[_("button",{class:pt(["skill-picker-item",{"is-highlighted":C===a.value}]),type:"button",onClick:H=>m.$emit("select",E),onPointerenter:H=>a.value=C},[_("span",RN,ue(E.name),1),E.description?(A(),D("span",MN,ue(E.description),1)):ge("",!0)],42,xN)]))),128))])):(A(),D("div",PN,"No skills found"))],4)):ge("",!0)}}),NN=Et($N,[["__scopeId","data-v-ff3fb7dc"]]),ON={key:0,class:"thread-composer-dictation-error"},LN={key:0,class:"thread-composer-attachments"},DN=["src","alt"],jN=["aria-label","disabled","onClick"],FN={key:1,class:"thread-composer-folder-chips"},BN=["title"],UN={class:"thread-composer-folder-chip-meta"},qN=["aria-label","disabled","onClick"],HN={key:2,class:"thread-composer-file-chips"},WN=["title"],VN=["aria-label","disabled","onClick"],zN={key:3,class:"thread-composer-skill-chips"},GN={class:"thread-composer-skill-chip-name"},KN=["aria-label","onClick"],YN={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},JN={key:1,class:"thread-composer-file-mentions"},XN=["onMousedown"],QN={key:1,class:"thread-composer-file-mention-icon-markdown"},ZN={class:"thread-composer-file-mention-text"},eO={class:"thread-composer-file-mention-name"},tO={key:0,class:"thread-composer-file-mention-dir"},nO={key:1,class:"thread-composer-file-mention-empty"},rO=["placeholder","disabled"],oO=["disabled"],sO={key:0,class:"thread-composer-attach-menu"},iO=["disabled"],aO=["disabled"],lO=["disabled"],cO={class:"thread-composer-attach-mode"},uO={class:"thread-composer-attach-mode-buttons"},dO=["disabled"],fO=["disabled"],pO=["aria-checked","aria-label","disabled"],hO={class:"thread-composer-attach-setting-copy"},mO={class:"thread-composer-attach-setting-description"},gO=["aria-checked","aria-label","disabled"],vO={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},yO={key:1,class:"thread-composer-dictation-timer"},_O=["aria-label","title","disabled"],bO=["aria-label","title","disabled"],wO={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},SO=["aria-label","title","disabled"],TO=["disabled"],EO=["disabled"],kO=["disabled"],IO=2e3,CO="codex-web-local.thread-draft.v1.",AO=In({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isStopPending:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=N(""),i=N([]),a=N([]),l=N([]),u=N([]),d=N(""),f=N(0),m=N(null),v=N(!1),{state:E,isSupported:C,recordingDurationMs:H,waveformCanvasRef:M,startRecording:O,stopRecording:V,toggleRecording:K,cancel:de}=H$({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:w=>{if(s.value=s.value?`${s.value}
|
|
75
|
-
${w}`:w,d.value="",r.dictationAutoSend!==!1){const P=r.isTurnInProgress?we.value:"steer";Oe(P);return}Jt(()=>{var P;return(P=Re.value)==null?void 0:P.focus()})},onEmpty:()=>{d.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:w=>{if(w instanceof DOMException&&w.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=w instanceof Error?w.message:"Dictation failed."}}),oe=N(null),ee=N(null),ve=N(null),Pe=N(null),Re=N(null),{isMobile:De}=_p(),Q=N(!1),pe=N(!1),Me=N(null),qe=N(""),_e=N([]),Te=N(!1),le=N(0),Ee=N(0);let Fe=0,Ne=null,Ge=!1,Ke=0,Ye=0;const lt=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let Xe="";const Y=[{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"}];function Se(w){return w.trim().replace(/^gpt/i,"GPT")}const he=ie(()=>r.models.map(w=>({value:w,label:Se(w)}))),Ue=ie(()=>r.selectedCollaborationMode==="plan"),Ze=ie(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),T=ie(()=>r.skills??[]),k=ie(()=>a.value.map(w=>w.path)),q=ie(()=>(r.skills??[]).map(w=>({value:w.path,label:w.name,description:w.description}))),te=ie(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||Ze.value||f.value>0?!1:s.value.trim().length>0||i.value.length>0||l.value.length>0),Z=ie(()=>s.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||u.value.length>0),X=ie(()=>{const w=new Set;for(const P of u.value)for(const z of P.filePaths)w.add(z);return l.value.filter(P=>!w.has(P.fsPath))}),ae=ie(()=>r.disabled||!r.activeThreadId),me=ie(()=>r.selectedModel.trim()==="gpt-5.4"),fe=ie(()=>r.selectedSpeedMode==="fast"&&me.value),ne=ie(()=>ae.value||r.isUpdatingSpeedMode===!0),Le=ie(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),ke=ie(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),we=N(ke.value),xe=ie(()=>E.value==="recording"),R=ie(()=>E.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),$=ie(()=>E.value==="idle"?d.value.trim():""),F=ie(()=>{const w=Math.max(0,Math.floor(H.value/1e3)),P=Math.floor(w/60),z=w%60;return`${P}:${String(z).padStart(2,"0")}`}),J=ie(()=>r.activeThreadId?Ze.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),ce=ie(()=>s.value.trim().length>0||i.value.length>0||l.value.length>0);function Oe(w="steer"){var z;const P=s.value.trim();if(te.value){if(o("submit",{text:P,imageUrls:i.value.map(be=>be.url),fileAttachments:[...l.value],skills:a.value.map(be=>({name:be.name,path:be.path})),mode:w}),ot(r.activeThreadId),it(),u.value=[],Q.value=!1,pe.value=!1,an(),lt||De.value){(z=Re.value)==null||z.blur();return}Jt(()=>{var be;return(be=Re.value)==null?void 0:be.focus()})}}function We(w){we.value=w}function st(w){Ee.value+=1,s.value=w.text,i.value=w.imageUrls.map((P,z)=>({id:`queued-${Date.now()}-${z}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${z+1}`,url:P})),a.value=w.skills.map(P=>(r.skills??[]).find(z=>z.path===P.path)??{name:P.name,description:"",path:P.path}),l.value=w.fileAttachments.map(P=>({...P})),u.value=[],d.value="",m.value=null,f.value=0,Q.value=!1,pe.value=!1,an(),Ye+=1}function it(){st({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function $t(w){return`${CO}${w}`}function _t(w){if(typeof window>"u")return null;const P=w.trim();if(!P)return null;try{const z=window.localStorage.getItem($t(P));if(!z)return null;const be=JSON.parse(z);return typeof be=="string"?{text:be,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof be.text=="string"?be.text:"",imageUrls:Array.isArray(be.imageUrls)?be.imageUrls.filter(tt=>typeof tt=="string"):[],fileAttachments:Array.isArray(be.fileAttachments)?be.fileAttachments.filter(tt=>!!tt&&typeof tt.label=="string"&&typeof tt.path=="string"&&typeof tt.fsPath=="string"):[],skills:Array.isArray(be.skills)?be.skills.filter(tt=>!!tt&&typeof tt.name=="string"&&typeof tt.path=="string"):[]}}catch{return null}}function on(w,P){if(typeof window>"u")return;const z=w.trim();if(z)try{if(P.text.trim().length>0||P.imageUrls.length>0||P.fileAttachments.length>0||P.skills.length>0){window.localStorage.setItem($t(z),JSON.stringify(P));return}window.localStorage.removeItem($t(z))}catch{}}function ot(w){on(w,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function fn(){return{text:s.value,imageUrls:i.value.map(w=>w.url),fileAttachments:l.value.map(w=>({...w})),skills:a.value.map(w=>({name:w.name,path:w.path}))}}function Qt(){o("interrupt")}function mr(w){o("update:selected-model",w)}function ir(){o("update:selected-collaboration-mode",Ue.value?"default":"plan")}function Xn(w){o("update:selected-reasoning-effort",w)}function zt(){ne.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function kt(){r.dictationClickToToggle&&(d.value&&(d.value=""),K())}function pn(w){if(r.dictationClickToToggle||(w.preventDefault(),Ge))return;Ge=!0;const P=w.currentTarget;if(P)try{P.setPointerCapture(w.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",Ut),window.addEventListener("pointercancel",Ut),window.addEventListener("blur",Ut),O()}function Ut(){r.dictationClickToToggle||Ge&&(Ge=!1,window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),window.removeEventListener("blur",Ut),V())}function uo(){ae.value||(Q.value=!Q.value)}function ms(){var w;(w=ee.value)==null||w.click()}function fo(){var w;(w=ve.value)==null||w.click()}function gr(){var w;(w=Pe.value)==null||w.click()}function zr(w){i.value=i.value.filter(P=>P.id!==w)}function bn(w){a.value=a.value.filter(P=>P.path!==w)}function sn(w){l.value=l.value.filter(P=>P.fsPath!==w)}function Gr(w){const P=u.value.find(be=>be.id===w);if(!P)return;const z=new Set(P.filePaths);l.value=l.value.filter(be=>!z.has(be.fsPath)),u.value=u.value.filter(be=>be.id!==w)}function wn(w){return w.total<=0?0:Math.round(w.processed/w.total*100)}function hn(w,P){const z=w.replace(/\\/g,"/");if(l.value.some(Pt=>Pt.fsPath===z))return;const be=z.split("/").filter(Boolean),tt=(P==null?void 0:P.trim())||be[be.length-1]||z;l.value=[...l.value,{label:tt,path:z,fsPath:z}]}function jn(w){return w.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(w.name)}function ar(w){return w?Array.from(w):[]}function Fn(w){return w!==Ye?!1:(f.value+=1,!0)}function qt(w){w===Ye&&(f.value=Math.max(0,f.value-1))}function vr(w){if(w<=0)return;const P=m.value,z=P?P.succeeded+P.failed:0;if(!P||z>=P.total){m.value={total:w,succeeded:0,failed:0};return}m.value={...P,total:P.total+w}}function lr(w){const P=m.value;P&&(m.value={...P,succeeded:P.succeeded+(w==="success"?1:0),failed:P.failed+(w==="failure"?1:0)})}function mn(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Ht(w){const P=new Date,z=[P.getFullYear(),String(P.getMonth()+1).padStart(2,"0"),String(P.getDate()).padStart(2,"0"),String(P.getHours()).padStart(2,"0"),String(P.getMinutes()).padStart(2,"0"),String(P.getSeconds()).padStart(2,"0")].join("-"),be=w.type.startsWith("image/")&&w.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${z}.${be}`}function It(){const w=new Date;return`pasted-text-${[w.getFullYear(),String(w.getMonth()+1).padStart(2,"0"),String(w.getDate()).padStart(2,"0"),String(w.getHours()).padStart(2,"0"),String(w.getMinutes()).padStart(2,"0"),String(w.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Sn(w){return w.name.trim()?w:new File([w],Ht(w),{type:w.type||"image/png",lastModified:Date.now()})}function Cn(w){return new Promise((P,z)=>{const be=new FileReader;be.onload=()=>{if(typeof be.result=="string"){P(be.result);return}z(new Error("Image read returned an unsupported result"))},be.onerror=()=>{z(be.error??new Error("Image read failed"))},be.readAsDataURL(w)})}async function An(w,P){if(Fn(P))try{const z=Sn(w),be=await Cn(z);if(P!==Ye)return;i.value=[...i.value,{id:mn(),name:z.name,url:be}],lr("success")}catch{P===Ye&&lr("failure")}finally{qt(P)}}async function gn(w,P){if(Fn(P))try{const z=await wd(w);if(P!==Ye)return;if(!z){lr("failure");return}hn(z),lr("success")}catch{P===Ye&&lr("failure")}finally{qt(P)}}function Bn(w){const P=ar(w);if(P.length===0)return;vr(P.length),Q.value=!1,pe.value=!1,an();const z=Ye;for(const be of P)jn(be)?An(be,z):gn(be,z)}function xn(){Ke=0,v.value=!1}function yt(w){if(!w||w.length===0)return;const P=Ee.value;for(const z of Array.from(w))if(jn(z)){const be=new FileReader;be.onload=()=>{P===Ee.value&&typeof be.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:z.name,url:be.result})},be.readAsDataURL(z)}else wd(z).then(be=>{P===Ee.value&&be&&hn(be)}).catch(()=>{})}function St(w){return w?Array.from(w.types??[]).includes("Files"):!1}async function yr(w){if(!w||w.length===0)return;const P=Ee.value,z=Array.from(w),tt=(z[0].webkitRelativePath||z[0].name).split("/").filter(Boolean)[0]||"Folder",Pt=`${Date.now()}-${Math.random().toString(36).slice(2)}`;u.value=[...u.value,{id:Pt,name:tt,total:z.length,processed:0,filePaths:[],isUploading:!0}];const Gt=Ot=>{P===Ee.value&&(u.value=u.value.map(Ft=>Ft.id===Pt?Ot(Ft):Ft))};for(const Ot of z)try{const Ft=await wd(Ot);if(P!==Ee.value)return;if(Ft){const Xr=Ot.webkitRelativePath||Ot.name;hn(Ft,Xr),Gt(Pr=>({...Pr,processed:Pr.processed+1,filePaths:[...Pr.filePaths,Ft]}));continue}Gt(Xr=>({...Xr,processed:Xr.processed+1}))}catch{Gt(Ft=>({...Ft,processed:Ft.processed+1}))}Gt(Ot=>({...Ot,isUploading:!1}))}function Un(w){w&&(w.value="")}function cr(w){const P=w.target;yt((P==null?void 0:P.files)??null),Un(P),Q.value=!1}function Bo(w){const P=w.target;yt((P==null?void 0:P.files)??null),Un(P),Q.value=!1}function vn(w){const P=w.target;yr((P==null?void 0:P.files)??null),Un(P),Q.value=!1}function Qn(w){ae.value||!St(w.dataTransfer)||(w.preventDefault(),Ke+=1,v.value=!0)}function Kr(w){ae.value||!St(w.dataTransfer)||(w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="copy"),v.value=!0)}function Zn(w){v.value&&(w.preventDefault(),Ke=Math.max(0,Ke-1),Ke===0&&xn())}function Yr(w){var P;ae.value||!St(w.dataTransfer)||(w.preventDefault(),xn(),Bn(((P=w.dataTransfer)==null?void 0:P.files)??null))}function qn(){!v.value&&Ke===0||xn()}function Wt(w){var Pt,Gt;if(ae.value)return;const P=((Pt=w.clipboardData)==null?void 0:Pt.getData("text/plain"))??"";if(P.length>=IO){w.preventDefault();const Ot=new File([P],It(),{type:"text/plain",lastModified:Date.now()});Bn([Ot]);return}const z=Array.from(((Gt=w.clipboardData)==null?void 0:Gt.items)??[]);if(z.length===0)return;const be=P.length>0,tt=z.filter(Ot=>Ot.kind==="file"&&Ot.type.startsWith("image/")).map(Ot=>Ot.getAsFile()).filter(Ot=>Ot instanceof File);tt.length!==0&&(be||w.preventDefault(),Bn(tt))}function Tn(){d.value&&(d.value="");const P=s.value.startsWith("/");P!==pe.value&&(pe.value=P),Mr()}function _r(w){if(Te.value){if(w.key==="Escape"){w.preventDefault(),an();return}if(w.key==="ArrowDown"){w.preventDefault(),_e.value.length>0&&(le.value=(le.value+1)%_e.value.length);return}if(w.key==="ArrowUp"){if(w.preventDefault(),_e.value.length>0){const z=_e.value.length;le.value=(le.value+z-1)%z}return}if(w.key==="Enter"||w.key==="Tab"){w.preventDefault();const z=_e.value[le.value];z?yn(z):an();return}}if(r.sendWithEnter!==!1?w.key==="Enter"&&!w.shiftKey:w.key==="Enter"&&(w.metaKey||w.ctrlKey)){w.preventDefault(),Oe(r.isTurnInProgress?we.value:"steer");return}if(pe.value){if(w.key==="Escape"){w.preventDefault(),Hn();return}if(w.key==="ArrowDown"||w.key==="ArrowUp"){w.preventDefault();return}}}function Hn(){var w;pe.value=!1,(w=Re.value)==null||w.focus()}function an(){Te.value=!1,Me.value=null,qe.value="",_e.value=[],le.value=0}function Mr(){const w=Re.value;if(!w){an();return}const P=w.selectionStart??s.value.length,be=s.value.slice(0,P).match(/(^|\s)(@[^\s@]*)$/);if(!be){an();return}const tt=be[2]??"",Pt=tt.length,Gt=P-Pt;Me.value=Gt,qe.value=tt.slice(1),Te.value=!0,br()}async function br(){if(!Te.value)return;const w=(r.cwd??"").trim();if(!w){_e.value=[];return}Ne&&clearTimeout(Ne);const P=++Fe;Ne=setTimeout(async()=>{try{const z=await PM(w,qe.value,20);if(!Te.value||P!==Fe)return;_e.value=z,le.value=0}catch{if(!Te.value||P!==Fe)return;_e.value=[]}},120)}function yn(w){const P=Re.value,z=Me.value;if(z!==null&&P){const be=P.selectionStart??s.value.length;s.value=`${s.value.slice(0,z)}${s.value.slice(be)}`.trimEnd()}hn(w.path),an(),Jt(()=>P==null?void 0:P.focus())}function Jr(w){de(),st(w),Jt(()=>{var P;return(P=Re.value)==null?void 0:P.focus()})}function er(w){const P=w.trim();P&&(de(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
|
|
76
|
-
${P}`:s.value=P,Jt(()=>{var z;return(z=Re.value)==null?void 0:z.focus()}))}function ur(w){const P=w.lastIndexOf("/");return P<0?w:w.slice(P+1)}function $e(w){const P=w.lastIndexOf("/");return P<=0?"":w.slice(0,P)}function ye(w){const P=ur(w),z=P.lastIndexOf(".");return z<=0?"":P.slice(z+1).toLowerCase()}function Dt(w){const P=ye(w);return P==="ts"?"TS":P==="tsx"?"TSX":P==="js"?"JS":P==="jsx"?"JSX":P==="json"?"{}":""}function Uo(w){const P=ye(w);return P.startsWith("ts")?"ts":P.startsWith("js")?"js":P==="json"?"json":"default"}function S(w){const P=ye(w);return P==="md"||P==="mdx"}function x(w){var P;a.value.some(z=>z.path===w.path)||(a.value=[...a.value,w]),s.value=s.value.startsWith("/")?"":s.value,pe.value=!1,(P=Re.value)==null||P.focus()}function L(w,P){if(P){const z=(r.skills??[]).find(be=>be.path===w);z&&!a.value.some(be=>be.path===w)&&(a.value=[...a.value,z])}else a.value=a.value.filter(z=>z.path!==w)}function W(w){if(!Q.value)return;const P=oe.value;if(!P)return;const z=w.target;!z||P.contains(z)||(Q.value=!1)}return ds(()=>{document.addEventListener("click",W),window.addEventListener("drop",qn),window.addEventListener("dragend",qn),window.addEventListener("blur",qn)}),t({hydrateDraft:Jr,appendTextToDraft:er,hasUnsavedDraft:()=>Z.value}),Vs(()=>{document.removeEventListener("click",W),window.removeEventListener("drop",qn),window.removeEventListener("dragend",qn),window.removeEventListener("blur",qn),window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),window.removeEventListener("blur",Ut),Ne&&clearTimeout(Ne)}),ut(()=>r.activeThreadId,w=>{de(),Xe&&on(Xe,fn()),it();const P=_t(w);P&&(st(P),Tn()),Xe=w.trim()},{immediate:!0}),ut([s,i,l,a],()=>{Xe&&on(Xe,fn())},{deep:!0}),ut(()=>r.cwd,()=>{Te.value&&br()}),ut(ke,w=>{we.value=w}),(w,P)=>(A(),D("form",{class:"thread-composer",onSubmit:P[4]||(P[4]=ft(z=>Oe(e.isTurnInProgress?we.value:"steer"),["prevent"]))},[$.value?(A(),D("p",ON,ue($.value),1)):ge("",!0),_("div",{class:pt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":v.value}])},[i.value.length>0?(A(),D("div",LN,[(A(!0),D(Qe,null,Bt(i.value,z=>(A(),D("div",{key:z.id,class:"thread-composer-attachment"},[_("img",{class:"thread-composer-attachment-image",src:z.url,alt:z.name||"Selected image"},null,8,DN),_("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${z.name||"image"}`,disabled:ae.value,onClick:be=>zr(z.id)}," x ",8,jN)]))),128))])):ge("",!0),u.value.length>0?(A(),D("div",FN,[(A(!0),D(Qe,null,Bt(u.value,z=>(A(),D("span",{key:z.id,class:"thread-composer-folder-chip"},[ze(Ep,{class:"thread-composer-folder-chip-icon"}),_("span",{class:"thread-composer-folder-chip-name",title:z.name},ue(z.name),9,BN),_("span",UN,[z.isUploading?(A(),D(Qe,{key:0},[Fs(ue(wn(z))+"% uploading ("+ue(z.processed)+"/"+ue(z.total)+") ",1)],64)):(A(),D(Qe,{key:1},[Fs(ue(z.filePaths.length)+" file"+ue(z.filePaths.length===1?"":"s"),1)],64))]),_("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${z.name}`,disabled:ae.value,onClick:be=>Gr(z.id)},"×",8,qN)]))),128))])):ge("",!0),X.value.length>0?(A(),D("div",HN,[(A(!0),D(Qe,null,Bt(X.value,z=>(A(),D("span",{key:z.fsPath,class:"thread-composer-file-chip"},[ze(gc,{class:"thread-composer-file-chip-icon"}),_("span",{class:"thread-composer-file-chip-name",title:z.fsPath},ue(z.label),9,WN),_("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${z.label}`,disabled:ae.value,onClick:be=>sn(z.fsPath)},"×",8,VN)]))),128))])):ge("",!0),a.value.length>0?(A(),D("div",zN,[(A(!0),D(Qe,null,Bt(a.value,z=>(A(),D("span",{key:z.path,class:"thread-composer-skill-chip"},[_("span",GN,ue(z.name),1),_("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${z.name}`,onClick:be=>bn(z.path)},"×",8,KN)]))),128))])):ge("",!0),_("div",{class:pt(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":v.value}]),onDragenter:Qn,onDragover:Kr,onDragleave:Zn,onDrop:Yr},[v.value?(A(),D("div",YN,[...P[5]||(P[5]=[_("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):ge("",!0),Te.value?(A(),D("div",JN,[_e.value.length>0?(A(!0),D(Qe,{key:0},Bt(_e.value,(z,be)=>(A(),D("button",{key:z.path,class:pt(["thread-composer-file-mention-row",{"is-active":be===le.value}]),type:"button",onMousedown:ft(tt=>yn(z),["prevent"])},[Dt(z.path)?(A(),D("span",{key:0,class:pt(["thread-composer-file-mention-icon-badge",`is-${Uo(z.path)}`])},ue(Dt(z.path)),3)):S(z.path)?(A(),D("span",QN,"↓")):(A(),ht(gc,{key:2,class:"thread-composer-file-mention-icon-file"})),_("span",ZN,[_("span",eO,ue(ur(z.path)),1),$e(z.path)?(A(),D("span",tO,ue($e(z.path)),1)):ge("",!0)])],42,XN))),128)):(A(),D("div",nO,"No matching files"))])):ge("",!0),Kn(_("textarea",{ref_key:"inputRef",ref:Re,"onUpdate:modelValue":P[0]||(P[0]=z=>s.value=z),class:"thread-composer-input",placeholder:J.value,disabled:ae.value,onInput:Tn,onKeydown:_r,onPaste:Wt},null,40,rO),[[rr,s.value]]),ze(NN,{skills:T.value,visible:pe.value,"anchor-bottom":44,"anchor-left":0,onSelect:x,onClose:Hn},null,8,["skills","visible"])],34),_("div",{class:pt(["thread-composer-controls",{"thread-composer-controls--recording":xe.value}])},[_("div",{ref_key:"attachMenuRootRef",ref:oe,class:"thread-composer-attach"},[_("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:ae.value,onClick:uo}," + ",8,oO),Q.value?(A(),D("div",sO,[_("button",{class:"thread-composer-attach-item",type:"button",disabled:ae.value,onClick:ms}," Add photos & files ",8,iO),_("button",{class:"thread-composer-attach-item",type:"button",disabled:ae.value,onClick:gr}," Add folder ",8,aO),_("button",{class:"thread-composer-attach-item",type:"button",disabled:ae.value,onClick:fo}," Take photo ",8,lO),P[9]||(P[9]=_("div",{class:"thread-composer-attach-separator"},null,-1)),_("div",cO,[P[6]||(P[6]=_("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),_("div",uO,[_("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":we.value==="steer"}]),type:"button",disabled:ae.value,onClick:P[1]||(P[1]=z=>We("steer"))}," Steer ",10,dO),_("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":we.value==="queue"}]),type:"button",disabled:ae.value,onClick:P[2]||(P[2]=z=>We("queue"))}," Queue ",10,fO)])]),P[10]||(P[10]=_("div",{class:"thread-composer-attach-separator"},null,-1)),me.value?(A(),D("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:ne.value,onClick:zt},[_("span",hO,[P[7]||(P[7]=_("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),_("span",mO,ue(Le.value),1)]),_("span",{class:pt(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":ne.value}])},null,2)],8,pO)):ge("",!0),_("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Ue.value,"aria-label":Ue.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:ir},[P[8]||(P[8]=_("span",{class:"thread-composer-attach-setting-copy"},[_("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),_("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),_("span",{class:pt(["thread-composer-attach-switch",{"is-on":Ue.value}])},null,2)],8,gO)])):ge("",!0)],512),xe.value?ge("",!0):(A(),D(Qe,{key:0},[ze(Os,{class:"thread-composer-control","model-value":e.selectedModel,options:he.value,"selected-prefix-icon":fe.value?X$:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":mr},null,8,["model-value","options","selected-prefix-icon","disabled"]),ze(kN,{class:"thread-composer-control",options:q.value,"selected-values":k.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:L},null,8,["options","selected-values","disabled"]),ze(Os,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Y,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Xn},null,8,["model-value","disabled"])],64)),_("div",{class:pt(["thread-composer-actions",{"thread-composer-actions--recording":xe.value}])},[He(E)==="recording"?(A(),D("div",vO,[_("canvas",{ref_key:"dictationWaveformCanvasRef",ref:M,class:"thread-composer-dictation-waveform"},null,512)])):ge("",!0),He(E)==="recording"?(A(),D("span",yO,ue(F.value),1)):ge("",!0),He(C)?(A(),D("button",{key:2,class:pt(["thread-composer-mic",{"thread-composer-mic--active":He(E)==="recording"}]),type:"button","aria-label":R.value,title:R.value,disabled:ae.value,onClick:kt,onPointerdown:pn,onPointerup:Ut,onPointercancel:Ut},[He(E)==="recording"?(A(),ht(bg,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(A(),ht(tN,{key:1,class:"thread-composer-mic-icon"}))],42,_O)):ge("",!0),e.isTurnInProgress&&!ce.value?(A(),D("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?"Saving thread before stop is available":"Stop",title:e.isStopPending?"Saving thread before stop is available":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:Qt},[e.isStopPending?(A(),D("span",wO)):(A(),ht(bg,{key:1,class:"thread-composer-stop-icon"}))],8,bO)):(A(),D("button",{key:4,class:pt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&we.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&we.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${we.value}`:"Send",disabled:!te.value,onClick:P[3]||(P[3]=z=>Oe(e.isTurnInProgress?we.value:"steer"))},[ze(G$,{class:"thread-composer-submit-icon"})],10,SO))],2)],2)],2),_("input",{ref_key:"photoLibraryInputRef",ref:ee,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:ae.value,onChange:cr},null,40,TO),_("input",{ref_key:"cameraCaptureInputRef",ref:ve,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:ae.value,onChange:Bo},null,40,EO),_("input",{ref_key:"folderPickerInputRef",ref:Pe,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:ae.value,onChange:vn},null,40,kO)],32))}}),wg=Et(AO,[["__scopeId","data-v-87fc1f7f"]]),xO={key:0,class:"thread-pending-request"},RO={class:"thread-pending-request-title"},MO=["title"],PO={class:"thread-pending-request-approval"},$O={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},NO=["aria-pressed","onClick"],OO={class:"thread-pending-request-option-index"},LO={class:"thread-pending-request-option-label"},DO={class:"thread-pending-request-footer thread-pending-request-footer--approval"},jO=["value"],FO={class:"thread-pending-request-header"},BO={class:"thread-pending-request-heading"},UO={class:"thread-pending-request-eyebrow"},qO={class:"thread-pending-request-title"},HO={key:0,class:"thread-pending-request-counter"},WO={key:0,class:"thread-pending-request-preview"},VO={class:"thread-pending-request-preview-code"},zO={key:1,class:"thread-pending-request-user-input"},GO={key:0,class:"thread-pending-request-question-description"},KO=["href"],YO={class:"thread-pending-request-question-title"},JO={key:0},XO={key:0,class:"thread-pending-request-question-text"},QO={key:1,class:"thread-pending-request-input-wrap"},ZO=["type","value","onInput"],eL={key:2,class:"thread-pending-request-select-wrap"},tL=["value","onChange"],nL={key:0,value:""},rL={key:3,class:"thread-pending-request-select-wrap"},oL=["value","onChange"],sL={key:0,value:""},iL=["value"],aL={key:4,class:"thread-pending-request-question-options"},lL=["checked","onChange"],cL={class:"thread-pending-request-checkbox-label"},uL={key:2,class:"thread-pending-request-validation-error"},dL={class:"thread-pending-request-footer"},fL={key:2,class:"thread-pending-request-user-input"},pL={class:"thread-pending-request-question-title"},hL={key:0,class:"thread-pending-request-question-text"},mL={key:1,class:"thread-pending-request-question-options"},gL={class:"thread-pending-request-select-wrap"},vL=["value","onChange"],yL=["value"],_L={key:0,class:"thread-pending-request-question-description"},bL={key:2,class:"thread-pending-request-input-wrap"},wL=["value","onInput"],SL={class:"thread-pending-request-footer"},TL={key:3,class:"thread-pending-request-actions"},EL={key:4,class:"thread-pending-request-actions"},kL=In({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=N("accept"),s=N(""),i=N({}),a=N({}),l=N({}),u=N("");function d(R){return R!==null&&typeof R=="object"&&!Array.isArray(R)?R:null}function f(R){return typeof R=="string"?R.trim():""}function m(R){return typeof R=="string"?R:null}function v(R){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(R)?R:JSON.stringify(R)}function E(R){const F=(Array.isArray(R.commandActions)?R.commandActions:[]).map(J=>d(J)).map(J=>f(J==null?void 0:J.command)).find(J=>J.length>0);if(F)return F.replace(/\s+/g," ").trim();if(Array.isArray(R.command)){const J=R.command.filter(ce=>typeof ce=="string").map(ce=>ce.trim()).filter(ce=>ce.length>0);if(J.length>0)return J.map(ce=>v(ce)).join(" ")}return ee(f(R.command))}function C(R){return R.method==="item/commandExecution/requestApproval"||R.method==="execCommandApproval"}function H(R){return R.method==="item/fileChange/requestApproval"||R.method==="applyPatchApproval"}function M(R){return R.method==="item/permissions/requestApproval"}function O(R){return C(R)||H(R)||M(R)}function V(R){return R.method==="mcpServer/elicitation/request"}function K(R){const $=d(R.params);return f($==null?void 0:$.reason)||f($==null?void 0:$.prompt)||f($==null?void 0:$.message)}function de(R){return O(R)?"Awaiting approval":V(R)?"MCP server input required":R.method==="item/tool/requestUserInput"?"Awaiting response":R.method==="item/tool/call"?"Tool call waiting for response":R.method}function oe(R){const $=K(R);return $||(C(R)?"Do you want to run this command?":H(R)?"Do you want to make these changes?":M(R)?"Do you want to grant these permissions?":V(R)?"An MCP server needs your input before Codex can continue.":R.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function ee(R){var Oe;const $=R.trim();if(!$)return"";const F=$.match(/-Command\s+(.+)$/i),J=((Oe=F==null?void 0:F[1])==null?void 0:Oe.trim())??$;return(J.startsWith('"')&&J.endsWith('"')?J.slice(1,-1):J).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function ve(R){const $=d(R.params);if(!$)return"";if(C(R))return E($);if(H(R)){const F=f($.grantRoot)||f($.grant_root);if(F)return F.replace(/\s+/g," ").trim();const J=d($.fileChanges)??d($.changes);if(!J)return"";const ce=Object.keys(J).map(Oe=>Oe.trim()).filter(Oe=>Oe.length>0);return ce.length===0?"":ce.slice(0,3).join(", ")}return M(R)?Pe($.permissions):V(R)?f($.serverName)||f($.url):""}function Pe(R){const $=d(R);if(!$)return"";const F=[],J=d($.fileSystem),ce=d($.network),Oe=Array.isArray(J==null?void 0:J.read)?J.read.filter(st=>typeof st=="string"):[],We=Array.isArray(J==null?void 0:J.write)?J.write.filter(st=>typeof st=="string"):[];return Oe.length>0&&F.push(`Read: ${Oe.join(", ")}`),We.length>0&&F.push(`Write: ${We.join(", ")}`),(ce==null?void 0:ce.enabled)===!0&&F.push("Network access"),F.join(" • ")}function Re(R){return!R||!O(R)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const De=ie(()=>Re(n.request));ut(()=>{var R;return((R=n.request)==null?void 0:R.id)??0},()=>{var R;s.value="",i.value={},a.value={},l.value={},u.value="",o.value=((R=De.value[0])==null?void 0:R.id)??"accept"},{immediate:!0}),ut(De,R=>{var $;o.value!=="decline"&&(R.some(F=>F.id===o.value)||(o.value=(($=R[0])==null?void 0:$.id)??"accept"))},{immediate:!0});function Q(R,$){return`${String(R)}:${$}`}function pe(R){const $=d(R.params),F=Array.isArray($==null?void 0:$.questions)?$.questions:[],J=[];for(const ce of F){const Oe=d(ce);if(!Oe)continue;const We=f(Oe.id);if(!We)continue;const st=Array.isArray(Oe.options)?Oe.options.map(it=>d(it)).map(it=>({label:f(it==null?void 0:it.label),description:f(it==null?void 0:it.description)})).filter(it=>it.label.length>0):[];J.push({id:We,header:f(Oe.header),question:f(Oe.question),isOther:Oe.isOther===!0,options:st})}return J}function Me(R,$,F){const J=Q(R,$),ce=i.value[J];return typeof ce=="string"&&ce.length>0?ce:F}function qe(R,$){return a.value[Q(R,$)]??""}function _e(R,$,F){const J=F.target;if(!(J instanceof HTMLSelectElement))return;const ce=Q(R,$);i.value={...i.value,[ce]:J.value}}function Te(R,$,F){const J=F.target;if(!(J instanceof HTMLInputElement))return;const ce=Q(R,$);a.value={...a.value,[ce]:J.value}}function le(R,$,F){var ce,Oe;const J=Me(R,$,((ce=F[0])==null?void 0:ce.label)||"");return((Oe=F.find(We=>We.label===J))==null?void 0:Oe.description)??""}function Ee(R,$){return`${String(R)}:${$}`}function Fe(R){var $;return f(($=d(R.params))==null?void 0:$.serverName)}function Ne(R){var F;const $=f((F=d(R.params))==null?void 0:F.url);if(!$)return"";try{const J=new URL($),ce=J.protocol.toLowerCase();return ce==="https:"||ce==="http:"?J.toString():""}catch{return""}}function Ge(R){const $=d(R.params),F=d($==null?void 0:$.requestedSchema),J=d(F==null?void 0:F.properties);if(!J)return[];const ce=new Set(Array.isArray(F==null?void 0:F.required)?F.required.filter(Oe=>typeof Oe=="string"):[]);return Object.entries(J).map(([Oe,We])=>Ke(Oe,d(We),ce.has(Oe))).filter(Oe=>Oe!==null)}function Ke(R,$,F){if(!$)return null;const J=f($.title)||R,ce=f($.description),Oe=f($.type);if(Oe==="boolean")return{key:R,label:J,description:ce,required:F,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof $.default=="boolean"?$.default:null,hasExplicitDefault:typeof $.default=="boolean"};if(Oe==="number"||Oe==="integer")return{key:R,label:J,description:ce,required:F,kind:"number",inputType:"number",options:[],defaultValue:typeof $.default=="number"?$.default:null,hasExplicitDefault:typeof $.default=="number"};const We=Ye($);if(Oe==="array")return{key:R,label:J,description:ce,required:F,kind:"multiEnum",inputType:"checkbox",options:We,defaultValue:Array.isArray($.default)?$.default.filter(it=>typeof it=="string"):[],hasExplicitDefault:Array.isArray($.default)};const st=m($.default);return We.length>0?{key:R,label:J,description:ce,required:F,kind:"singleEnum",inputType:"select",options:We,defaultValue:st,hasExplicitDefault:st!==null}:{key:R,label:J,description:ce,required:F,kind:"string",inputType:lt($),options:[],defaultValue:st,hasExplicitDefault:st!==null}}function Ye(R){const F=(Array.isArray(R.oneOf)?R.oneOf:Array.isArray(R.anyOf)?R.anyOf:[]).map(We=>d(We)).map(We=>({value:f(We==null?void 0:We.const),label:f(We==null?void 0:We.title)||f(We==null?void 0:We.const)})).filter(We=>We.value.length>0);if(F.length>0)return F;const J=d(R.items);if(J){const We=Ye(J);if(We.length>0)return We}const ce=Array.isArray(R.enum)?R.enum.filter(We=>typeof We=="string"):[],Oe=Array.isArray(R.enumNames)?R.enumNames.filter(We=>typeof We=="string"):[];return ce.map((We,st)=>({value:We,label:Oe[st]||We}))}function lt(R){const $=f(R.format);return $==="email"?"email":$==="uri"?"url":$==="date"?"date":$==="date-time"?"datetime-local":"text"}function Xe(R,$){const F=l.value[Ee(R,$.key)];return F!==void 0?F:$.defaultValue}function Y(R,$){const F=Xe(R,$);return Array.isArray(F)?F.filter(J=>typeof J=="string"):[]}function Se(R,$,F){const J=F.target;if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLSelectElement))return;const ce=J.value,Oe=($.kind==="number",ce);l.value={...l.value,[Ee(R,$.key)]:ce.length>0?Oe:null},u.value=""}function he(R,$,F){const J=F.target;if(!(J instanceof HTMLSelectElement))return;let ce=null;J.value==="true"?ce=!0:J.value==="false"&&(ce=!1),l.value={...l.value,[Ee(R,$.key)]:ce},u.value=""}function Ue(R,$,F,J){const ce=J.target;if(!(ce instanceof HTMLInputElement))return;const Oe=new Set(Y(R,$));ce.checked?Oe.add(F):Oe.delete(F),l.value={...l.value,[Ee(R,$.key)]:Array.from(Oe)},u.value=""}function Ze(R){return R===!0?"true":R===!1?"false":""}function T(R,$){const F=Xe(R,$);return $.kind==="multiEnum"?Array.isArray(F)&&F.length>0:$.kind==="boolean"?typeof F=="boolean":$.kind==="number"&&typeof F=="number"?!0:typeof F=="string"&&F.trim().length>0}function k(R){const $=Ge(R).filter(F=>F.required&&!T(R.id,F)).map(F=>F.label);return $.length===0?"":$.length===1?`Answer the required field: ${$[0]}.`:`Answer the required fields: ${$.join(", ")}.`}function q(R){const $={};for(const F of Ge(R)){const J=Xe(R.id,F);if(F.kind==="multiEnum"){const Oe=Array.isArray(J)?J:[];(Oe.length>0||F.required)&&($[F.key]=Oe);continue}if(F.kind==="boolean"){typeof J=="boolean"&&($[F.key]=J);continue}if(F.kind==="number"){const Oe=typeof J=="number"?J:Number(String(J).trim());Number.isNaN(Oe)||($[F.key]=Oe);continue}const ce=String(J??"").trim();(ce.length>0||F.required)&&($[F.key]=ce)}return $}function te(R){o.value=R}function Z(){o.value="decline"}function X(R){const $=R.target;$ instanceof HTMLInputElement&&(s.value=$.value,o.value="decline")}function ae(R,$){var F;if(M(R)){if($==="decline"||$==="cancel"){r("respondServerRequest",{id:R.id,error:{code:-32e3,message:$==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const J=d((F=d(R.params))==null?void 0:F.permissions)??{};r("respondServerRequest",{id:R.id,result:{permissions:J,scope:$==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:R.id,result:{decision:$}})}function me(R){const $=s.value.trim(),F=$.length>0?"decline":o.value;if(M(R)){ae(R,F);return}r("respondServerRequest",{id:R.id,result:{decision:F},followUpMessageText:$||void 0})}function fe(R,$){const F=d(R.params),J={action:$};if($==="accept"&&f(F==null?void 0:F.mode)==="form"){const ce=k(R);if(ce){u.value=ce;return}J.content=q(R)}r("respondServerRequest",{id:R.id,result:J})}function ne(R){var J;const $=pe(R),F={};for(const ce of $){const Oe=Me(R.id,ce.id,((J=ce.options[0])==null?void 0:J.label)||""),We=qe(R.id,ce.id).trim(),st=[Oe,We].map(it=>it.trim()).filter(it=>it.length>0);F[ce.id]={answers:st}}r("respondServerRequest",{id:R.id,result:{answers:F}})}function Le(R){r("respondServerRequest",{id:R.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function ke(R){r("respondServerRequest",{id:R.id,result:{success:!0,contentItems:[]}})}function we(R){r("respondServerRequest",{id:R.id,result:{}})}function xe(R){r("respondServerRequest",{id:R.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(R,$)=>e.request?(A(),D("section",xO,[_("article",{class:pt(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[O(e.request)?(A(),D(Qe,{key:0},[_("p",RO,ue(oe(e.request)),1),ve(e.request)?(A(),D("p",{key:0,class:"thread-pending-request-command-line",title:ve(e.request)},ue(ve(e.request)),9,MO)):ge("",!0),_("section",PO,[_("div",$O,[(A(!0),D(Qe,null,Bt(De.value,(F,J)=>(A(),D("button",{key:F.id,type:"button",class:pt(["thread-pending-request-option",{"is-selected":o.value===F.id}]),"aria-pressed":o.value===F.id,onClick:ce=>te(F.id)},[_("span",OO,ue(J+1)+".",1),_("span",LO,ue(F.label),1)],10,NO))),128))]),_("footer",DO,[_("label",{class:pt(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[$[11]||($[11]=_("span",{class:"thread-pending-request-option-index"},"3.",-1)),_("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:Z,onInput:X,onKeydown:$[0]||($[0]=Zt(ft(F=>me(e.request),["prevent"]),["enter"]))},null,40,jO)],2),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[1]||($[1]=F=>ae(e.request,"cancel"))}," Skip "),_("button",{type:"button",class:"thread-pending-request-primary",onClick:$[2]||($[2]=F=>me(e.request))}," Send ")])])],64)):(A(),D(Qe,{key:1},[_("header",FO,[_("div",BO,[_("p",UO,ue(de(e.request)),1),_("p",qO,ue(oe(e.request)),1)]),(e.requestCount??0)>1?(A(),D("span",HO,ue(e.requestCount??0)+" pending",1)):ge("",!0)]),ve(e.request)?(A(),D("div",WO,[_("code",VO,ue(ve(e.request)),1)])):ge("",!0),e.request.method==="mcpServer/elicitation/request"?(A(),D("section",zO,[Fe(e.request)?(A(),D("p",GO," Server: "+ue(Fe(e.request)),1)):ge("",!0),Ne(e.request)?(A(),D("a",{key:1,class:"thread-pending-request-link",href:Ne(e.request),target:"_blank",rel:"noopener noreferrer"}," Open authorization link ",8,KO)):ge("",!0),(A(!0),D(Qe,null,Bt(Ge(e.request),F=>(A(),D("div",{key:`${e.request.id}:${F.key}`,class:"thread-pending-request-question"},[_("p",YO,[Fs(ue(F.label),1),F.required?(A(),D("span",JO," *")):ge("",!0)]),F.description?(A(),D("p",XO,ue(F.description),1)):ge("",!0),F.kind==="string"||F.kind==="number"?(A(),D("label",QO,[$[12]||($[12]=_("span",{class:"thread-pending-request-select-label"},"Value",-1)),_("input",{class:"thread-pending-request-input",type:F.inputType,value:String(Xe(e.request.id,F)??""),onInput:J=>Se(e.request.id,F,J)},null,40,ZO)])):F.kind==="boolean"?(A(),D("label",eL,[$[15]||($[15]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:Ze(Xe(e.request.id,F)),onChange:J=>he(e.request.id,F,J)},[F.hasExplicitDefault?ge("",!0):(A(),D("option",nL,"Select true or false")),$[13]||($[13]=_("option",{value:"true"},"True",-1)),$[14]||($[14]=_("option",{value:"false"},"False",-1))],40,tL)])):F.kind==="singleEnum"?(A(),D("label",rL,[$[16]||($[16]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:String(Xe(e.request.id,F)??""),onChange:J=>Se(e.request.id,F,J)},[F.hasExplicitDefault?ge("",!0):(A(),D("option",sL,"Select an option")),(A(!0),D(Qe,null,Bt(F.options,J=>(A(),D("option",{key:`${e.request.id}:${F.key}:${J.value}`,value:J.value},ue(J.label),9,iL))),128))],40,oL)])):(A(),D("div",aL,[(A(!0),D(Qe,null,Bt(F.options,J=>(A(),D("label",{key:`${e.request.id}:${F.key}:${J.value}`,class:"thread-pending-request-checkbox-row"},[_("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:Y(e.request.id,F).includes(J.value),onChange:ce=>Ue(e.request.id,F,J.value,ce)},null,40,lL),_("span",cL,ue(J.label),1)]))),128))]))]))),128)),u.value?(A(),D("p",uL,ue(u.value),1)):ge("",!0),_("footer",dL,[_("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[3]||($[3]=F=>fe(e.request,"cancel"))}," Cancel "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[4]||($[4]=F=>fe(e.request,"decline"))}," Decline "),_("button",{type:"button",class:"thread-pending-request-primary",onClick:$[5]||($[5]=F=>fe(e.request,"accept"))}," Continue ")])])):e.request.method==="item/tool/requestUserInput"?(A(),D("section",fL,[(A(!0),D(Qe,null,Bt(pe(e.request),F=>{var J;return A(),D("div",{key:`${e.request.id}:${F.id}`,class:"thread-pending-request-question"},[_("p",pL,ue(F.header||F.question),1),F.question?(A(),D("p",hL,ue(F.question),1)):ge("",!0),F.options.length>0?(A(),D("div",mL,[_("label",gL,[$[17]||($[17]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:Me(e.request.id,F.id,((J=F.options[0])==null?void 0:J.label)||""),onChange:ce=>_e(e.request.id,F.id,ce)},[(A(!0),D(Qe,null,Bt(F.options,ce=>(A(),D("option",{key:`${e.request.id}:${F.id}:${ce.label}`,value:ce.label},ue(ce.label),9,yL))),128))],40,vL)]),le(e.request.id,F.id,F.options)?(A(),D("p",_L,ue(le(e.request.id,F.id,F.options)),1)):ge("",!0)])):ge("",!0),F.isOther?(A(),D("label",bL,[$[18]||($[18]=_("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),_("input",{class:"thread-pending-request-input",type:"text",value:qe(e.request.id,F.id),placeholder:"Other answer",onInput:ce=>Te(e.request.id,F.id,ce)},null,40,wL)])):ge("",!0)])}),128)),_("footer",SL,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:$[6]||($[6]=F=>ne(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(A(),D("section",TL,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:$[7]||($[7]=F=>Le(e.request))}," Fail Tool Call "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[8]||($[8]=F=>ke(e.request))}," Success (Empty) ")])):(A(),D("section",EL,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:$[9]||($[9]=F=>we(e.request))}," Return Empty Result "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[10]||($[10]=F=>xe(e.request))}," Reject Request ")]))],64))],2)])):ge("",!0)}}),IL=Et(kL,[["__scopeId","data-v-a033894d"]]),CL={key:0,class:"queued-messages"},AL={class:"queued-messages-inner"},xL={class:"queued-row-text"},RL={class:"queued-row-actions"},ML=["onClick"],PL=["onClick"],$L=["onClick"],NL=In({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,u,d;const r=n.text.trim();if(r)return r;const o=[],s=((l=n.imageUrls)==null?void 0:l.length)??0,i=((u=n.fileAttachments)==null?void 0:u.length)??0,a=((d=n.skills)==null?void 0:d.length)??0;return s>0&&o.push(`${s} image${s===1?"":"s"}`),i>0&&o.push(`${i} file${i===1?"":"s"}`),a>0&&o.push(`${a} skill${a===1?"":"s"}`),o.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(A(),D("div",CL,[_("div",AL,[(A(!0),D(Qe,null,Bt(e.messages,o=>(A(),D("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=_("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[_("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)),_("span",xL,ue(t(o)),1),_("div",RL,[_("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,ML),_("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,PL),_("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>n.$emit("delete",o.id)},[...r[0]||(r[0]=[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[_("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,$L)])]))),128))])])):ge("",!0)}}),OL=Et(NL,[["__scopeId","data-v-835c6739"]]),LL={key:0,class:"rate-limit-status","aria-live":"polite"},DL=["title"],jL={class:"rate-limit-card-header"},FL={class:"rate-limit-card-title"},BL={key:0,class:"rate-limit-card-plan"},UL={class:"rate-limit-card-metrics"},qL={key:0,class:"rate-limit-card-footer"},HL=In({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(M){var O,V;return((O=M.limitId)==null?void 0:O.trim())||((V=M.limitName)==null?void 0:V.trim())||"__default__"}function n(M){var O,V;return((O=M.limitName)==null?void 0:O.trim())||((V=M.limitId)==null?void 0:V.trim())||"Rate limits"}function r(M){const O=M.trim();return O?O.replace(/[_-]+/g," ").replace(/\b\w/g,V=>V.toUpperCase()):""}function o(M){return!M||M<=0?"Window":M%1440===0?`${M/1440}d`:M%60===0?`${M/60}h`:M<60?`${M}m`:`${Math.round(M/60*10)/10}h`}function s(M){const O=Math.max(0,Math.min(100,100-M));return`${Math.round(O)}% left`}function i(M){return`${Math.round(M)}%`}function a(M,O){return{key:O,label:`${o(M.windowDurationMins)} ${s(M.usedPercent)}`}}function l(M){const O=[];return M.primary&&O.push(a(M.primary,"primary")),M.secondary&&O.push(a(M.secondary,"secondary")),O}function u(M){if(!M)return"";const O=new Date(M*1e3),V=O.getMonth()+1,K=String(O.getDate()).padStart(2,"0"),de=String(O.getHours()).padStart(2,"0"),oe=String(O.getMinutes()).padStart(2,"0");return`${V}.${K} ${de}:${oe}`}function d(M){if(!(M!=null&&M.resetsAt))return"";const O=M.resetsAt*1e3-Date.now();if(O<=0)return"Resetting now";const V=Math.round(O/6e4);if(V<60)return`Resets in ${V}m`;const K=Math.round(V/60);return K<24?`Resets in ${K}h`:`Resets in ${Math.round(K/24)}d`}function f(M){return[M.primary,M.secondary].filter(O=>O!==null)}function m(M){const O=f(M);return O.length===0?null:[...O].sort((V,K)=>{const de=V.windowDurationMins??Number.MAX_SAFE_INTEGER,oe=K.windowDurationMins??Number.MAX_SAFE_INTEGER;return de!==oe?de-oe:(V.resetsAt??Number.MAX_SAFE_INTEGER)-(K.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function v(M){const O=f(M);if(O.length===0)return"";const V=[...O].sort((de,oe)=>{const ee=de.windowDurationMins??-1,ve=oe.windowDurationMins??-1;return ee!==ve?ve-ee:(oe.resetsAt??-1)-(de.resetsAt??-1)})[0],K=u(V.resetsAt);return K||""}function E(M){const O=M.credits;return O?O.unlimited?"Unlimited credits":O.balance?`Credits ${O.balance}`:O.hasCredits?"Credits available":"":""}function C(M){return[d(m(M)),v(M),E(M)].filter(O=>O.length>0)}function H(M){const O=[n(M)];for(const V of l(M))O.push(V.label);for(const V of f(M))O.push(`${o(V.windowDurationMins)} used ${i(V.usedPercent)}`);for(const V of C(M))O.push(V);return O.join(`
|
|
77
|
-
`)}return(M,O)=>e.snapshots.length>0?(A(),D("aside",LL,[(A(!0),D(Qe,null,Bt(e.snapshots,V=>(A(),D("div",{key:t(V),class:"rate-limit-card",title:H(V)},[_("div",jL,[_("span",FL,ue(n(V)),1),V.planType?(A(),D("span",BL,ue(r(V.planType)),1)):ge("",!0)]),_("div",UL,[(A(!0),D(Qe,null,Bt(l(V),K=>(A(),D("span",{key:K.key,class:"rate-limit-card-metric"},ue(K.label),1))),128))]),C(V).length>0?(A(),D("div",qL,ue(C(V).join(" | ")),1)):ge("",!0)],8,DL))),128))])):ge("",!0)}}),WL=Et(HL,[["__scopeId","data-v-df88906b"]]),VL={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},zL=["aria-checked","onClick"],GL={class:"runtime-toggle-option-label"},KL=In({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:Ep},{value:"worktree",label:"New worktree",icon:Xl}];function o(s){n("update:modelValue",s)}return(s,i)=>(A(),D("div",VL,[(A(),D(Qe,null,Bt(r,a=>_("button",{key:a.value,class:pt(["runtime-toggle-option",{"is-selected":e.modelValue===a.value}]),type:"button",role:"radio","aria-checked":e.modelValue===a.value,onClick:l=>o(a.value)},[(A(),ht(Bf(a.icon),{class:"runtime-toggle-option-icon"})),_("span",GL,ue(a.label),1)],10,zL)),64))]))}}),YL=Et(KL,[["__scopeId","data-v-e8b0d0ac"]]),JL={},XL={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 QL(e,t){return A(),D("svg",XL,[...t[0]||(t[0]=[_("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),_("path",{d:"M9 4l0 16"},null,-1)])])}const ZL=Et(JL,[["render",QL]]),eD={},tD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function nD(e,t){return A(),D("svg",tD,[...t[0]||(t[0]=[_("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 rD=Et(eD,[["render",nD]]),oD={class:"sidebar-thread-controls"},sD=["aria-label","title"],iD=In({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(A(),D("div",oD,[_("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?(A(),ht(rD,{key:0,class:"sidebar-thread-controls-icon"})):(A(),ht(ZL,{key:1,class:"sidebar-thread-controls-icon"}))],8,sD),ao(t.$slots,"default",{},void 0),e.showNewThreadButton?(A(),D("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"))},[ze(gc,{class:"sidebar-thread-controls-icon"})])):ge("",!0)]))}}),Sg=Et(iD,[["__scopeId","data-v-46a10052"]]),aD={},lD={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function cD(e,t){return A(),D("svg",lD,[...t[0]||(t[0]=[_("circle",{cx:"11",cy:"11",r:"8"},null,-1),_("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Tg=Et(aD,[["render",cD]]),uD={},dD={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function fD(e,t){return A(),D("svg",dD,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("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"}),_("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const pD=Et(uD,[["render",fD]]),hD={},mD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gD(e,t){return A(),D("svg",mD,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const vD=Et(hD,[["render",gD]]);function Lr(e){return e.flatMap(t=>t.threads)}const pb="codex-web-local.thread-read-state.v1",hb="codex-web-local.thread-scroll-state.v1",mb="codex-web-local.thread-token-usage.v1",wf="codex-web-local.selected-thread-id.v1",Sf="codex-web-local.selected-model-by-context.v1",gb="codex-web-local.selected-model-id.v1",vb="codex-web-local.project-order.v1",yb="codex-web-local.project-display-name.v1",Tf="codex-web-local.collaboration-mode-by-context.v1",_b="codex-web-local.collaboration-mode.v1",il="__new-thread__",Ed=220,yD=500,_D=3e3,Eg=["none","minimal","low","medium","high","xhigh"],li="__global__",bD="gpt-5.4-mini",Or="gpt-5.2-codex";function wD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(pb);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function kg(e){typeof window>"u"||window.localStorage.setItem(pb,JSON.stringify(e))}function Ef(e){return e==="plan"?"plan":"default"}function vc(e){return typeof e=="string"?e.trim():""}function jr(){return Object.create(null)}function kd(e){const t=jr();for(const[n,r]of Object.entries(e))t[n]=r;return t}function Id(e,t){if(!(t in e))return e;const n=jr();for(const[r,o]of Object.entries(e))r!==t&&(n[r]=o);return n}function Ig(e,t){let n=!1;const r=jr();for(const[o,s]of Object.entries(e)){if(o===il||t.has(o)){r[o]=s;continue}n=!0}return n?r:e}function yc(e){return e.trim()||il}function SD(){if(typeof window>"u")return jr();try{const n=window.localStorage.getItem(Sf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return jr();const o=jr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=vc(i);a&&(o[s]=a)}return o}}catch{}const e=vc(window.localStorage.getItem(gb)),t=jr();return e&&(t[il]=e),t}function Cg(e,t){const n=yc(t),r=vc(e[n]);return r||vc(e[il])||bD}function Cd(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Sf):window.localStorage.setItem(Sf,JSON.stringify(e)),window.localStorage.removeItem(gb)}catch{}}function TD(){if(typeof window>"u")return jr();try{const n=window.localStorage.getItem(Tf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return jr();const o=jr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=Ef(i);a==="plan"&&(o[s]=a)}return o}}catch{}const e=Ef(window.localStorage.getItem(_b)),t=jr();return e==="plan"&&(t[il]="plan"),t}function Pl(e,t){const n=yc(t);return Ef(e[n])}function Ag(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Tf):window.localStorage.setItem(Tf,JSON.stringify(e)),window.localStorage.removeItem(_b)}catch{}}function Sa(e,t,n){return Math.min(Math.max(e,t),n)}function ED(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=Sa(t.scrollRatio,0,1)),n}function kD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(hb);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=ED(o);s&&(n[r]=s)}return n}catch{return{}}}function xg(e){typeof window>"u"||window.localStorage.setItem(hb,JSON.stringify(e))}function fi(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.trunc(e));if(typeof e=="string"&&e.trim().length>0){const t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.trunc(t))}return null}function Rg(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:fi(t.totalTokens)??0,inputTokens:fi(t.inputTokens)??0,cachedInputTokens:fi(t.cachedInputTokens)??0,outputTokens:fi(t.outputTokens)??0,reasoningOutputTokens:fi(t.reasoningOutputTokens)??0}}function ID(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Rg(t.total),r=Rg(t.last);if(!n||!r)return null;const o=fi(t.modelContextWindow),s=r.totalTokens,i=typeof o=="number"?Math.max(o-s,0):null,a=typeof o=="number"&&o>0?Sa(Math.round((i??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:i,remainingContextPercent:a}}function CD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(mb);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=ID(o);s&&(n[r]=s)}return n}catch{return{}}}function Mg(e){typeof window>"u"||window.localStorage.setItem(mb,JSON.stringify(e))}function AD(){return typeof window>"u"?"":window.localStorage.getItem(wf)??""}function xD(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(wf);return}window.localStorage.setItem(wf,e)}}function RD(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(vb);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t){if(typeof r!="string"||r.length===0)continue;const o=sl(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function ci(e){typeof window>"u"||window.localStorage.setItem(vb,JSON.stringify(e))}function MD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(yb);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){const s=typeof r=="string"?sl(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function Ad(e){typeof window>"u"||window.localStorage.setItem(yb,JSON.stringify(e))}function $l(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 es(e,n)?e:n}function xd(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>n.get(o)??null).filter(o=>o!==null&&o.threads.length>0);for(const o of e)t.includes(o.projectName)||r.push(o);return r}function es(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1)if(n[o]!==r[o])return!1;return!0}function PD(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[o]=r.splice(t,1);return r.splice(n,0,o),r}function $D(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function ND(e=[],t=[]){var n,r,o,s;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(((n=e[i])==null?void 0:n.step)!==((r=t[i])==null?void 0:r.step)||((o=e[i])==null?void 0:o.status)!==((s=t[i])==null?void 0:s.status))return!1;return!0}function OD(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&ND(e.steps,t.steps)}function Nl(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 kf(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&es(e.images,t.images)&&DD(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&$D(e.commandExecution,t.commandExecution)&&OD(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function mi(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 LD(e,t,n={}){const r=new Map(e.map(d=>[d.id,d])),o=new Map(t.map(d=>[d.id,d])),s=t.map(d=>{const f=r.get(d.id);return f&&kf(f,d)?f:d});if(n.preserveMissing!==!0)return mi(e,s)?e:s;const i=e.map(d=>{const f=o.get(d.id);return!f||kf(d,f)?d:f}),a=new Set(e.map(d=>d.id)),l=s.filter(d=>!a.has(d.id)),u=[...i,...l];return mi(e,u)?e:u}function DD(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],o=t[n];if(r.path!==o.path||r.operation!==o.operation||r.movedToPath!==o.movedToPath||r.diff!==o.diff||r.addedLineCount!==o.addedLineCount||r.removedLineCount!==o.removedLineCount)return!1}return!0}function If(e){return e.replace(/\s+/gu," ").trim()}function jD(e,t){const n=new Set(t.filter(o=>o.role==="assistant").map(o=>If(o.text)).filter(o=>o.length>0));if(n.size===0)return e;const r=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;const s=If(o.text);return s.length===0?!1:!n.has(s)});return r.length===e.length?e:r}function Ol(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(kf(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const bb="worked";function Jo(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function FD(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),o=t%60,s=[];n>0&&s.push(`${n}h`),(r>0||n>0)&&s.push(`${r}m`);const i=o>0||s.length===0?o:0;return s.push(`${i}s`),s.join(" ")}function BD(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function UD(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 qD(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${FD(e.durationMs)}`,messageType:bb,turnId:e.turnId}}function HD(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function WD(e,t){const n=qD(t),r=e.filter(i=>i.messageType!==bb),o=HD(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function bt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function VD(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[o,s]of Object.entries(e)){if(t.has(o)){n=!0;continue}r[o]=s}return n?r:e}function zD(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&&e.pendingRequestState===t.pendingRequestState}function GD(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 KD(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 Kt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Ll(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>{const s=n.get(o.projectName),i=new Map((s==null?void 0:s.threads.map(l=>[l.id,l]))??[]),a=o.threads.map(l=>{const u=i.get(l.id);return u&&zD(u,l)?u:l});return s&&s.projectName===o.projectName&&GD(s.threads,a)?s:{projectName:o.projectName,threads:a}});return KD(e,r)?e:r}function YD(e,t,n){const r=new Set(Lr(t).map(a=>a.id)),o=Lr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(o.length===0)return t;const s=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of o){if(s.get(a.projectName)){const u=i.findIndex(d=>d.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function Xo(e){return sl(e)}function JD(e){const t=e.split(`
|
|
78
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function XD(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function QD(){const e=N([]),t=N([]),n=N(AD()),r=N({}),o=N({}),s=N({}),i=N({}),a=N({}),l=N({}),u=N({}),d=N({}),f=N({}),m=N({}),v=N([]),E=N([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),C=N(TD()),H=N(SD()),M=N(Pl(C.value,n.value)),O=N(Cg(H.value,n.value)),V=N("medium"),K=N("standard"),de=N(wD()),oe=N(kD()),ee=N(RD()),ve=N(MD()),Pe=N({}),Re=N({}),De=N({}),Q=N({}),pe=N({}),Me=N({}),qe=N({}),_e=N({}),Te=N({}),le=N({}),Ee=N({}),Fe=N({}),Ne=N({}),Ge=N(null),Ke=N(CD()),Ye=N({}),lt=N([]),Xe=N([]),Y=N(!1),Se=N(!1),he=N(!1),Ue=N(!1),Ze=N(!1),T=N(!1),k=N(""),q=N(!1),te=N(!1);let Z=null,X=null,ae=null;const me=new Map;let fe=null,ne=!1;const Le=new Set;let ke=!1,we=!1;const xe=new Map,R=new Set,$=ie(()=>Lr(e.value)),F=ie(()=>$.value.find(c=>c.id===n.value)??null),J=ie(()=>oe.value[n.value]??null),ce=ie(()=>{const c=n.value;return c?Te.value[c]===!0:!1}),Oe=ie(()=>{const c=[],p=n.value;return p&&Array.isArray(Fe.value[p])&&c.push(...Fe.value[p]),Array.isArray(Fe.value[li])&&c.push(...Fe.value[li]),c.sort((g,b)=>g.receivedAtIso.localeCompare(b.receivedAtIso))}),We=ie(()=>{var j;const c=n.value;if(!c)return null;const p=Me.value[c],g=(i.value[c]??"").trim(),b=(((j=qe.value[c])==null?void 0:j.message)??"").trim();return!p&&!g&&!b?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:g,errorText:b}}),st=ie(()=>Ge.value),it=ie(()=>{const c=n.value;return c?Ke.value[c]??null:null}),$t=ie(()=>{const c=n.value;if(!c)return[];const p=r.value[c]??[],g=o.value[c]??[],b=s.value[c]??[],j=a.value[c]??[],B=l.value[c]??[],U=[...p,...g,...j,...B,...b],G=pe.value[c];return G?WD(U,G):U});function _t(c){return Cg(H.value,c).trim()}function on(...c){const p=[...v.value];for(const g of c){const b=g.trim();b&&!p.includes(b)&&p.push(b)}es(v.value,p)||(v.value=p)}function ot(c){n.value!==c&&(n.value=c,xD(c),O.value=_t(c),on(O.value),M.value=Pl(C.value,c),we=!1)}function fn(c){const p=c.trim(),g=yc(n.value);if(p){const b=kd(H.value);b[g]=p,H.value=b}else H.value=Id(H.value,g);O.value=_t(n.value),on(O.value),Cd(H.value),pr({category:"ui.model",message:`model → ${O.value}`,level:"info"})}function Qt(c,p){const g=c.trim();if(!g)return;const b=p.trim();if(b){const j=kd(H.value);j[g]=b,H.value=j}else H.value=Id(H.value,g);on(b),n.value===g&&(O.value=_t(n.value)),Cd(H.value)}function mr(c,p){const g=c.trim();if(!g)return;if(!p){if(!(g in Ke.value))return;Ke.value=bt(Ke.value,g),Mg(Ke.value);return}const b=Ke.value[g];b&&JSON.stringify(b)===JSON.stringify(p)||(Ke.value={...Ke.value,[g]:p},Mg(Ke.value))}function ir(c){const p=c==="plan"?"plan":"default",g=yc(n.value);if(!(Pl(C.value,n.value)===p&&M.value===p)){if(M.value=p,p==="plan"){const j=kd(C.value);j[g]=p,C.value=j}else C.value=Id(C.value,g);Ag(C.value)}}function Xn(c){Ge.value=c}async function zt(c=n.value){c.trim()?Qt(c,Or):fn(Or),on(Or)}function kt(c,p){Ne.value={...Ne.value,[c]:p}}function pn(c){Ne.value[c]&&(Ne.value=bt(Ne.value,c))}async function Ut(c){if(R.has(c))return;const p=Ne.value[c];if(!(!p||p.fallbackRetried)){R.add(c),kt(c,{...p,fallbackRetried:!0});try{await zt(c);try{const g=await gd(c,1);vn(c,g),an(c),Qn(c,[]),Hn(c),a.value[c]&&(a.value=bt(a.value,c))}catch{}St(c,null),k.value="",Ht(c,null),yt(c,{label:"Thinking",details:gr(Or,p.effort,p.collaborationMode)}),It(c,!0),De.value[c]!==!0&&await md(c),await vd(c,p.text,p.imageUrls,Or,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments,p.collaborationMode),De.value={...De.value,[c]:!0},sn(),Le.add(c),ne=!0,await Nr()}catch(g){const b=g instanceof Error?g.message:"Unknown application error";St(c,b),k.value=b,It(c,!1),yt(c,null)}finally{R.delete(c)}}}function uo(c){c&&!Eg.includes(c)||(V.value=c)}async function ms(c){const p=c==="fast"?"fast":"standard";if(Ze.value||K.value===p)return;const g=K.value;K.value=p,Ze.value=!0,k.value="";try{await _M(p)}catch(b){K.value=g,k.value=b instanceof Error?b.message:"Failed to update Fast mode"}finally{Ze.value=!1}}async function fo(){try{const c=await TM();E.value=c,c.some(p=>p.value===M.value)||ir("default")}catch{}}function gr(c,p,g=M.value){const b=c.trim()||"default",j=p||"default",B=g==="plan"?"Plan":"Default",U=K.value==="fast"?"Fast":"Standard";return[`Mode: ${B}`,`Model: ${b}`,`Thinking: ${j}`,`Speed: ${U}`]}async function zr(){try{const[c,p]=await Promise.all([ub(),db()]),g=_t(n.value),b=p.model.trim(),j=[...c];for(const B of[g,b])B&&!j.includes(B)&&j.push(B);v.value=j,g||(b&&j.includes(b)?fn(p.model):j.length>0?fn(j[0]):fn("")),p.reasoningEffort&&Eg.includes(p.reasoningEffort)&&(V.value=p.reasoningEffort),K.value=p.speedMode}catch{}}async function bn(){if(fe){await fe;return}fe=(async()=>{try{Xe.value=L(await cg())}catch{}finally{fe=null}})(),await fe}function sn(){if(typeof window>"u"){bn();return}ae!==null&&window.clearTimeout(ae),ae=window.setTimeout(()=>{ae=null,bn()},yD)}function Gr(c){if(!c||typeof window>"u")return;const p=me.get(c);p!==void 0&&(window.clearTimeout(p),me.delete(c))}function wn(c){if(!c||typeof window>"u")return;Gr(c);const p=window.setTimeout(()=>{me.delete(c),Le.add(c),Nr()},_D);me.set(c,p)}function hn(c){const p=Ye.value;return Object.keys(p).length===0?c:c.map(g=>({projectName:g.projectName,threads:g.threads.map(b=>{const j=p[b.id];return j?{...b,title:j}:b})}))}function jn(c){return c?Array.isArray(Fe.value[c])?Fe.value[c]:[]:[]}function ar(c){return c==="item/commandExecution/requestApproval"||c==="item/fileChange/requestApproval"||c==="item/permissions/requestApproval"||c==="execCommandApproval"||c==="applyPatchApproval"}function Fn(c){return c.some(p=>ar(p.method))?"approval":c.length>0?"response":null}function qt(){const p=hn(t.value).map(g=>({projectName:g.projectName,threads:g.threads.map(b=>{const j=u.value[b.id]===!0,B=Fn(jn(b.id)),U=n.value===b.id,G=de.value[b.id],re=m.value[b.id]===!0,je=!U&&!j&&(re||G!==b.updatedAtIso);return{...b,inProgress:j,unread:je,pendingRequestState:B}})}));e.value=Ll(e.value,p)}function vr(c,p,g){const b=new Date().toISOString(),j=en(p),B=sl(j),U={id:c,title:JD(g),projectName:B,cwd:j,hasWorktree:j.includes("/.codex/worktrees/")||j.includes("/.git/worktrees/"),createdAtIso:b,updatedAtIso:b,preview:g,unread:!1,inProgress:!1},G=t.value.findIndex(je=>je.projectName===B);if(G>=0){const Be=t.value[G].threads.filter(nn=>nn.id!==c),ct={projectName:B,threads:[U,...Be]},gt=[...t.value];gt.splice(G,1,ct),t.value=gt}else t.value=[{projectName:B,threads:[U]},...t.value];const re=$l(ee.value,t.value);es(ee.value,re)||(ee.value=re,ci(ee.value)),qt()}function lr(c){const p=new Set(c.map(G=>G.id)),g=Ig(H.value,p);g!==H.value&&(H.value=g,O.value=_t(n.value),on(O.value),Cd(g));const b=Ig(C.value,p);b!==C.value&&(C.value=b,M.value=Pl(b,n.value),Ag(b));const j=Kt(de.value,p);j!==de.value&&(de.value=j,kg(j));const B=Kt(oe.value,p);B!==oe.value&&(oe.value=B,xg(B)),Re.value=Kt(Re.value,p),Pe.value=Kt(Pe.value,p),De.value=Kt(De.value,p),Q.value=Kt(Q.value,p),r.value=Kt(r.value,p),s.value=Kt(s.value,p),i.value=Kt(i.value,p),a.value=Kt(a.value,p),l.value=Kt(l.value,p),pe.value=Kt(pe.value,p),Me.value=Kt(Me.value,p),qe.value=Kt(qe.value,p),_e.value=Kt(_e.value,p),Te.value=Kt(Te.value,p),le.value=Kt(le.value,p),Ee.value=Kt(Ee.value,p),Ke.value=Kt(Ke.value,p),m.value=Kt(m.value,p),u.value=Kt(u.value,p);const U={};for(const[G,re]of Object.entries(Fe.value))(G===li||p.has(G))&&(U[G]=re);Fe.value=U}function mn(c){const p=Lr(t.value).find(g=>g.id===c);p&&(de.value={...de.value,[c]:p.updatedAtIso},kg(de.value),m.value[c]&&(m.value=bt(m.value,c)),qt())}function Ht(c,p){if(!c)return;const g=pe.value[c];if(p){if(BD(g,p))return;pe.value={...pe.value,[c]:p}}else g&&(pe.value=bt(pe.value,c))}function It(c,p){!c||u.value[c]===!0===p||(p?u.value={...u.value,[c]:!0}:(u.value=bt(u.value,c),Sn(c)),qt())}function Sn(c){c&&(Te.value[c]&&(Te.value=bt(Te.value,c)),le.value[c]&&(le.value=bt(le.value,c)),Ee.value[c]&&(Ee.value=bt(Ee.value,c)))}function Cn(c){c&&(Te.value={...Te.value,[c]:!0},le.value[c]&&(le.value=bt(le.value,c)),Ee.value[c]&&(Ee.value=bt(Ee.value,c)))}function An(c){c&&Te.value[c]===!0&&le.value[c]===!0&&Ee.value[c]===!0&&Sn(c)}function gn(c){const p=Object.keys(Te.value);if(p.length===0)return;let g=le.value,b=!1;for(const j of p)!c.has(j)||g[j]===!0||(g={...g,[j]:!0},b=!0);if(b){le.value=g;for(const j of p)An(j)}}function Bn(c,p){c&&Te.value[c]===!0&&p.some(g=>g.role==="user")&&(Ee.value[c]!==!0&&(Ee.value={...Ee.value,[c]:!0}),An(c))}function xn(c){c&&c!==n.value&&m.value[c]!==!0&&(m.value={...m.value,[c]:!0},qt())}function yt(c,p){if(!c)return;const g=Me.value[c];if(!p){g&&(Me.value=bt(Me.value,c));return}const b=gs(p.label)||"Thinking",j=p.details.map(G=>gs(G)).filter(G=>G.length>0&&G!==b),B=Array.from(new Set([...(g==null?void 0:g.details)??[],...j])).slice(-3),U={label:b,details:B};UD(g,U)||(Me.value={...Me.value,[c]:U})}function St(c,p,g={}){if(!c)return;const b=qe.value[c],j=p?If(p):"";if(!j){b&&(qe.value=bt(qe.value,c));return}const B=g.transient===!0;(b==null?void 0:b.message)===j&&b.transient===B||(qe.value={...qe.value,[c]:{message:j,transient:B}})}function yr(c){var p;c&&(p=qe.value[c])!=null&&p.transient&&St(c,null)}function Un(){const c=Object.entries(qe.value).filter(([,g])=>g==null?void 0:g.transient).map(([g])=>g);if(c.length===0)return;let p=qe.value;for(const g of c)p=bt(p,g);qe.value=p}function cr(c){const p=Lr(t.value).find(g=>g.id===c);return(p==null?void 0:p.updatedAtIso)??""}function Bo(c,p){if(!c)return;const g={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(g.scrollRatio=Sa(p.scrollRatio,0,1));const b=oe.value[c];b&&b.scrollTop===g.scrollTop&&b.isAtBottom===g.isAtBottom&&b.scrollRatio===g.scrollRatio||(oe.value={...oe.value,[c]:g},xg(oe.value))}function vn(c,p){const g=r.value[c]??[];mi(g,p)||(r.value={...r.value,[c]:p})}function Qn(c,p){const g=s.value[c]??[];mi(g,p)||(s.value={...s.value,[c]:p})}function Kr(c,p){const g=l.value[c]??[];mi(g,p)||(l.value={...l.value,[c]:p})}function Zn(c,p){const g=o.value[c]??[];mi(g,p)||(o.value={...o.value,[c]:p})}function Yr(c,p){const g=o.value[c]??[],b=Ol(g,p);Zn(c,b)}function qn(c,p){const g=s.value[c]??[],b=Ol(g,p);Qn(c,b)}function Wt(c,p){const g=l.value[c]??[],b=Ol(g,p);Kr(c,b)}function Tn(c,p){if(!c)return;const g=p.trim(),b=i.value[c]??"";if(g.length===0){if(!b)return;i.value=bt(i.value,c);return}b!==g&&(i.value={...i.value,[c]:g})}function _r(c,p){if(!c)return;const g=i.value[c]??"";Tn(c,`${g}${p}`)}function Hn(c){c&&c in i.value&&(i.value=bt(i.value,c))}function an(c){c&&c in o.value&&(o.value=bt(o.value,c))}function Mr(c){c&&c in l.value&&(l.value=bt(l.value,c))}function br(c){c&&(an(c),Hn(c),yt(c,null),a.value[c]&&(a.value=bt(a.value,c)),_e.value[c]&&(_e.value=bt(_e.value,c)),pn(c))}function yn(c){return c==="completed"?"completed":c==="inProgress"||c==="in_progress"?"inProgress":"pending"}function Jr(c){var g;const p=[];(g=c.explanation)!=null&&g.trim()&&p.push(c.explanation.trim());for(const b of c.steps){const j=b.status==="completed"?"x":b.status==="inProgress"?"~":" ";p.push(`- [${j}] ${b.step}`)}return p.join(`
|
|
79
|
-
`).trim()}function er(c){if(c.method!=="turn/plan/updated")return null;const p=$e(c.params),g=z(c),b=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),B=(Array.isArray(p==null?void 0:p.plan)?p==null?void 0:p.plan:[]).map(re=>$e(re)).map(re=>({step:ye(re==null?void 0:re.step),status:yn(re==null?void 0:re.status)})).filter(re=>re.step.length>0);if(!g||!b)return null;const G={explanation:ye(p==null?void 0:p.explanation).trim()||void 0,steps:B,isStreaming:!0};return{threadId:g,message:{id:`${b}:plan`,role:"assistant",text:Jr(G),messageType:"plan.live",plan:G}}}function ur(c){if(c.method!=="item/plan/delta")return null;const p=$e(c.params),g=z(c),b=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),j=ye(p==null?void 0:p.delta);if(!g||!b||!j)return null;const B=`${b}:plan`,U=(o.value[g]??[]).find(je=>je.id===B),G=`${(U==null?void 0:U.text)??""}${j}`,re=U!=null&&U.plan?{...U.plan,isStreaming:!0}:void 0;return{threadId:g,message:{id:B,role:"assistant",text:G,messageType:"plan.live",plan:re}}}function $e(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function ye(c){return typeof c=="string"?c:""}function Dt(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Uo(c){var p,g;return((p=c.limitId)==null?void 0:p.trim())||((g=c.limitName)==null?void 0:g.trim())||"__default__"}function S(c){const p=$e(c);if(!p)return null;const g=Dt(p.windowDurationMins);return{usedPercent:Sa(Dt(p.usedPercent)??0,0,100),windowDurationMins:g,windowMinutes:g,resetsAt:Dt(p.resetsAt)}}function x(c){const p=$e(c);if(!p)return null;const g=$e(p.credits);return{limitId:ye(p.limitId)||null,limitName:ye(p.limitName)||null,primary:S(p.primary),secondary:S(p.secondary),credits:g?{hasCredits:g.hasCredits===!0,unlimited:g.unlimited===!0,balance:ye(g.balance)||null}:null,planType:ye(p.planType)||null}}function L(c){const p=$e(c);if(!p)return[];const g=[],b=new Set,j=U=>{if(!U)return;const G=Uo(U);b.has(G)||(b.add(G),g.push(U))};j(x(p.rateLimits));const B=$e(p.rateLimitsByLimitId);if(B)for(const U of Object.values(B))j(x(U));return g}function W(c){const p=$e(c);if(!p)return null;const g=Dt(p.totalTokens??p.total_tokens),b=Dt(p.inputTokens??p.input_tokens),j=Dt(p.cachedInputTokens??p.cached_input_tokens),B=Dt(p.outputTokens??p.output_tokens),U=Dt(p.reasoningOutputTokens??p.reasoning_output_tokens);return g===null||b===null||j===null||B===null||U===null?null:{totalTokens:g,inputTokens:b,cachedInputTokens:j,outputTokens:B,reasoningOutputTokens:U}}function w(c){const p=$e(c);if(!p)return null;const g=W(p.total),b=W(p.last);if(!g||!b)return null;const j=Dt(p.modelContextWindow??p.model_context_window),B=b.totalTokens,U=typeof j=="number"?Math.max(j-B,0):null,G=typeof j=="number"&&j>0?Sa(Math.round((U??0)/j*100),0,100):null;return{total:g,last:b,modelContextWindow:j,currentContextTokens:B,remainingContextTokens:U,remainingContextPercent:G}}function P(c){if(c.method!=="thread/tokenUsage/updated")return null;const p=$e(c.params),g=z(c),b=w((p==null?void 0:p.tokenUsage)??(p==null?void 0:p.token_usage));return!g||!b?null:{threadId:g,usage:b}}function z(c){const p=$e(c.params);if(!p)return"";const g=ye(p.threadId);if(g)return g;const b=ye(p.thread_id);if(b)return b;const j=ye(p.conversationId);if(j)return j;const B=ye(p.conversation_id);if(B)return B;const U=$e(p.thread),G=ye(U==null?void 0:U.id);if(G)return G;const re=$e(p.turn),je=ye(re==null?void 0:re.threadId);if(je)return je;const Be=ye(re==null?void 0:re.thread_id);return Be||""}function be(c){if(c.method!=="turn/completed")return"";const p=$e(c.params),g=$e(p==null?void 0:p.turn);if(!g||g.status!=="failed")return"";const b=$e(g.error);return ye(b==null?void 0:b.message)}function tt(c){var b;if(c.method!=="error")return null;const p=$e(c.params),g=ye(p==null?void 0:p.message)||ye((b=$e(p==null?void 0:p.error))==null?void 0:b.message);return g?{message:g,transient:(p==null?void 0:p.willRetry)===!0}:null}function Pt(c){const p=$e(c);if(!p)return null;const g=p.id,b=ye(p.method),j=p.params;if(typeof g!="number"||!Number.isInteger(g)||!b)return null;const B=$e(j),U=Gt(b,B),G=ye(B==null?void 0:B.threadId)||ye(B==null?void 0:B.thread_id)||ye(B==null?void 0:B.conversationId)||ye(B==null?void 0:B.conversation_id)||li,re=ye(B==null?void 0:B.turnId)||ye(B==null?void 0:B.turn_id),je=ye(B==null?void 0:B.itemId)||ye(B==null?void 0:B.item_id)||ye(B==null?void 0:B.callId)||ye(B==null?void 0:B.call_id),Be=ye(p.receivedAtIso)||new Date().toISOString();return{id:g,method:U,threadId:G,turnId:re,itemId:je,receivedAtIso:Be,params:j??null}}function Gt(c,p){const g=c.trim();return g&&(g==="item/commandExecution/requestApproval"||g==="execCommandApproval"||g==="exec_approval_request"||Ot(p)?"item/commandExecution/requestApproval":g==="item/fileChange/requestApproval"||g==="applyPatchApproval"||g==="apply_patch_approval_request"||Ft(p)?"item/fileChange/requestApproval":g==="item/tool/requestUserInput"||g==="request_user_input"||Xr(p)?"item/tool/requestUserInput":g==="mcpServer/elicitation/request"||g==="elicitation_request"||po(p)?"mcpServer/elicitation/request":g==="item/permissions/requestApproval"||al(p)?"item/permissions/requestApproval":g==="item/tool/call"||g==="dynamic_tool_call_request"||Pr(p)?"item/tool/call":g)}function Ot(c){if(!c)return!1;const p=c.command;return Array.isArray(p)&&p.some(g=>typeof g=="string"&&g.trim().length>0)||typeof p=="string"&&p.trim().length>0?!0:Array.isArray(c.commandActions)}function Ft(c){return c?typeof c.grantRoot=="string"&&c.grantRoot.trim().length>0||typeof c.grant_root=="string"&&c.grant_root.trim().length>0||$e(c.fileChanges)?!0:$e(c.changes)!==null:!1}function Xr(c){return!!(c&&Array.isArray(c.questions))}function Pr(c){return c?typeof c.toolName=="string"||typeof c.tool_name=="string"||typeof c.name=="string"||Array.isArray(c.arguments):!1}function po(c){if(!c)return!1;const p=ye(c.mode);return typeof c.serverName=="string"&&typeof c.threadId=="string"&&typeof c.message=="string"&&(p==="form"||p==="url")}function al(c){return c?typeof c.threadId=="string"&&typeof c.turnId=="string"&&typeof c.itemId=="string"&&$e(c.permissions)!==null:!1}function Rn(c){if(c.method!=="item/tool/requestUserInput")return[];const p=$e(c.params),g=Array.isArray(p==null?void 0:p.questions)?p.questions:[],b=[];for(const j of g){const B=$e(j),U=ye(B==null?void 0:B.id).trim();U&&b.push(U)}return b}function qo(c){const p=c.threadId||li,g=Fe.value[p]??[],b=g.findIndex(B=>B.id===c.id),j=[...g];b>=0?j.splice(b,1,c):j.push(c),Fe.value={...Fe.value,[p]:j.sort((B,U)=>B.receivedAtIso.localeCompare(U.receivedAtIso))},qt()}function ll(c){const p={};for(const[g,b]of Object.entries(Fe.value)){const j=b.filter(B=>B.id!==c);j.length>0&&(p[g]=j)}Fe.value=p,qt()}function Vc(c){const p={};for(const g of c){const b=g.threadId||li,j=p[b]??[];j.push(g),p[b]=j}for(const g of Object.values(p))g.sort((b,j)=>b.receivedAtIso.localeCompare(j.receivedAtIso));Fe.value=p}function zc(c){if(c.method==="server/request"){const p=Pt(c.params);return p&&qo(p),!0}if(c.method==="server/request/resolved"){const p=$e(c.params),g=p==null?void 0:p.id;return typeof g=="number"&&Number.isInteger(g)&&ll(g),!0}return!1}function gs(c){return c.replace(/\s+/gu," ").trim()}function Gc(c){const p=z(c);if(!p)return null;if(c.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const g=$e(c.params),b=$e(g==null?void 0:g.item),j=ye(b==null?void 0:b.type).toLowerCase();if(j==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(j==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(j==="commandexecution"){const B=ye(b==null?void 0:b.command);return{threadId:p,activity:{label:"Running command",details:B?[B]:[]}}}if(j==="filechange"){const U=(Array.isArray(b==null?void 0:b.changes)?b.changes:[])[0],G=ye(U==null?void 0:U.path);return{threadId:p,activity:{label:"Applying changes",details:G?[G]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:c.method==="item/fileChange/outputDelta"?{threadId:p,activity:{label:"Applying changes",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function Hi(c){if(c.method!=="turn/started")return null;const p=$e(c.params);if(!p)return null;const g=z(c);if(!g)return null;const b=$e(p.turn),j=ye(b==null?void 0:b.id)||ye(p.turnId)||`${g}:unknown`;if(!j)return null;const B=Jo(ye(b==null?void 0:b.startedAt))??Jo(ye(p.startedAt))??Jo(c.atIso)??Date.now();return{threadId:g,turnId:j,startedAtMs:B}}function cl(c){if(c.method!=="turn/completed")return null;const p=$e(c.params);if(!p)return null;const g=z(c);if(!g)return null;const b=$e(p.turn),j=ye(b==null?void 0:b.id)||ye(p.turnId)||`${g}:unknown`;if(!j)return null;const B=Jo(ye(b==null?void 0:b.completedAt))??Jo(ye(p.completedAt))??Jo(c.atIso)??Date.now(),U=Jo(ye(b==null?void 0:b.startedAt))??Jo(ye(p.startedAt))??void 0;return{threadId:g,turnId:j,completedAtMs:B,startedAtMs:U}}function $r(c){return`${c}:live-reasoning`}function Wi(c){const p=r.value[c]??[];let g=-1;for(const b of p)typeof b.turnIndex=="number"&&Number.isFinite(b.turnIndex)&&(g=Math.max(g,b.turnIndex));return g+1}function Kc(c,p,g){if(!c||!p||!Number.isInteger(g)||g<0)return;const b=Q.value[c]??{};b[p]!==g&&(Q.value={...Q.value,[c]:{...b,[p]:g}})}function Vi(c,p){const g=Q.value[c]??{},b=Object.entries(g),j=Object.entries(p);b.length===j.length&&b.every(([B,U])=>p[B]===U)||(Q.value={...Q.value,[c]:{...p}})}function Ys(c){const p=l.value[c];if(!p||p.length===0)return;const g=Q.value[c]??{};let b=!1;const j=p.map(B=>{if(typeof B.turnIndex=="number"||!B.turnId)return B;const U=g[B.turnId];return typeof U!="number"?B:(b=!0,{...B,turnIndex:U})});b&&(l.value={...l.value,[c]:j})}function Yc(c){const p=$e(c.params);if(!p)return"";if(c.method==="item/started"){const g=$e(p.item);return!g||g.type!=="reasoning"?"":ye(g.id)}return""}function ul(c){const p=$e(c.params);if(!p)return null;if(c.method==="item/reasoning/summaryTextDelta"){const g=ye(p.itemId),b=ye(p.delta);return!g||!b?null:{messageId:$r(g),delta:b}}return null}function Jc(c){const p=$e(c.params);if(!p)return"";if(c.method==="item/reasoning/summaryPartAdded"){const g=ye(p.itemId);return g?$r(g):""}return""}function Xc(c){const p=$e(c.params);if(!p)return"";if(c.method==="item/completed"){const g=$e(p.item);return!g||g.type!=="reasoning"?"":$r(ye(g.id))}return""}function Qc(c){const p=$e(c.params);if(!p)return"";if(c.method==="item/started"){const g=$e(p.item);return!g||g.type!=="agentMessage"?"":ye(g.id)}return""}function zi(c){const p=$e(c.params);if(!p)return null;if(c.method==="item/agentMessage/delta"){const g=ye(p.itemId),b=ye(p.delta);return!g||!b?null:{messageId:g,delta:b}}return null}function Gi(c){const p=$e(c.params);if(!p)return null;if(c.method==="item/completed"){const g=$e(p.item);if(!g||g.type!=="agentMessage")return null;const b=ye(g.id),j=ye(g.text);return!b||!j?null:{id:b,role:"assistant",text:j,messageType:"agentMessage.live"}}return null}function dl(c){var je;if(c.method!=="item/started")return null;const p=$e(c.params),g=$e(p==null?void 0:p.item);if(!g||g.type!=="commandExecution")return null;const b=ye(g.id),j=ye(g.command);if(!b)return null;const B=typeof g.cwd=="string"?g.cwd:null,U=z(c),G=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),re=U&&G?(je=Q.value[U])==null?void 0:je[G]:void 0;return{id:b,role:"system",text:j,messageType:"commandExecution",commandExecution:{command:j,cwd:B,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:G||void 0,turnIndex:typeof re=="number"?re:void 0}}function Zc(c){if(c.method!=="item/commandExecution/outputDelta")return null;const p=$e(c.params);if(!p)return null;const g=ye(p.itemId),b=ye(p.delta);return!g||!b?null:{itemId:g,delta:b}}function eu(c){var nn;if(c.method!=="item/completed")return null;const p=$e(c.params),g=$e(p==null?void 0:p.item);if(!g||g.type!=="commandExecution")return null;const b=ye(g.id),j=ye(g.command);if(!b)return null;const B=typeof g.cwd=="string"?g.cwd:null,U=ye(g.status),G=U==="failed"?"failed":U==="declined"?"declined":U==="interrupted"?"interrupted":"completed",re=typeof g.aggregatedOutput=="string"?g.aggregatedOutput:"",je=typeof g.exitCode=="number"?g.exitCode:null,Be=z(c),ct=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),gt=Be&&ct?(nn=Q.value[Be])==null?void 0:nn[ct]:void 0;return{id:b,role:"system",text:j,messageType:"commandExecution",commandExecution:{command:j,cwd:B,status:G,aggregatedOutput:re,exitCode:je},turnId:ct||void 0,turnIndex:typeof gt=="number"?gt:void 0}}function fl(c){var je;if(c.method!=="item/completed")return null;const p=$e(c.params),g=$e(p==null?void 0:p.item);if(!g||g.type!=="fileChange")return null;const b=ye(g.id);if(!b)return null;const j=ye(p==null?void 0:p.threadId),B=ye(p==null?void 0:p.turnId),U=j&&B?(je=Q.value[j])==null?void 0:je[B]:void 0,G=ob(g.changes),re=rb(g.status);return G.length===0||re!=="completed"?null:{id:b,role:"system",text:"",messageType:"fileChange",fileChangeStatus:re,fileChanges:G,turnId:B||void 0,turnIndex:typeof U=="number"?U:void 0}}function Js(c,p){const g=a.value[c]??[],b=Ol(g,p);b!==g&&(a.value={...a.value,[c]:b})}function tu(c,p){const g=a.value[c];if(!g||g.length===0)return;const b=new Set(p.map(B=>B.id)),j=g.filter(B=>!b.has(B.id));j.length!==g.length&&(j.length===0?a.value=bt(a.value,c):a.value={...a.value,[c]:j})}function nu(c,p){const g=l.value[c];if(!g||g.length===0)return;const b=new Set(p.map(G=>G.id)),j=new Set(p.filter(G=>G.messageType==="fileChange"&&typeof G.turnId=="string"&&G.turnId.length>0).map(G=>G.turnId)),B=new Set(p.filter(G=>G.messageType==="fileChange"&&typeof G.turnIndex=="number").map(G=>G.turnIndex)),U=g.filter(G=>!b.has(G.id)&&!(G.turnId&&j.has(G.turnId))&&!(typeof G.turnIndex=="number"&&B.has(G.turnIndex)));U.length!==g.length&&(U.length===0?l.value=bt(l.value,c):l.value={...l.value,[c]:U})}function ru(c){if(c.method==="item/agentMessage/delta")return!0;const p=$e(c.params);if(!p)return!1;if(c.method==="item/completed"){const g=$e(p.item);return(g==null?void 0:g.type)==="agentMessage"}return!1}function pl(c){var Vo,Ss,ni,ta,yl;if(zc(c))return;if(c.method==="account/rateLimits/updated"&&sn(),c.method==="thread/name/updated"){const et=$e(c.params),Wn=ye(et==null?void 0:et.threadId),mo=ye(et==null?void 0:et.threadName);Wn&&mo&&(Ye.value={...Ye.value,[Wn]:mo},qt(),bd(Wn,mo))}if(c.method==="account/rateLimits/updated"){Xn(ab(c.params));return}const p=P(c);if(p){mr(p.threadId,p.usage);return}const g=Gc(c);g&&yt(g.threadId,g.activity);const b=z(c),j=tt(c);!j&&b&&yr(b);const B=Hi(c);B&&(xe.set(B.turnId,B),Kc(B.threadId,B.turnId,Wi(B.threadId)),_e.value={..._e.value,[B.threadId]:B.turnId},an(B.threadId),Mr(B.threadId),Ht(B.threadId,null),St(B.threadId,null),It(B.threadId,!0),m.value[B.threadId]&&(m.value=bt(m.value,B.threadId)));const U=cl(c),G=be(c),re=(U==null?void 0:U.threadId)??z(c),je=re?_t(re):"",Be=!!re&&!!G&&je!==Or&&Nl(new Error(G));if(U){Ne.value[U.threadId];const et=xe.get(U.turnId);et&&xe.delete(U.turnId);const Wn=Dt((Vo=$e(c.params))==null?void 0:Vo.durationMs)??Dt((ni=$e((Ss=$e(c.params))==null?void 0:Ss.turn))==null?void 0:ni.durationMs)??(typeof U.startedAtMs=="number"?U.completedAtMs-U.startedAtMs:null)??(et?U.completedAtMs-et.startedAtMs:null),mo=typeof Wn=="number"?Math.max(0,Wn):0;Ht(U.threadId,{turnId:U.turnId,durationMs:mo}),_e.value[U.threadId]&&(_e.value=bt(_e.value,U.threadId)),It(U.threadId,!1),yt(U.threadId,null),xn(U.threadId),Be||(pn(U.threadId),Xi(U.threadId))}if(G){const et=(U==null?void 0:U.threadId)||z(c);et&&St(et,G),k.value=G,et&&Be&&Ut(et)}else U&&St(U.threadId,null);if(j){const et=b,Wn=et?_t(et):O.value.trim();et&&St(et,j.message,{transient:j.transient}),k.value=j.message,Wn!==Or&&Nl(new Error(j.message))&&(et?Ut(et):zt())}const ct=er(c);ct&&(Yr(ct.threadId,ct.message),yt(ct.threadId,{label:"Planning",details:((ta=ct.message.plan)==null?void 0:ta.steps.map(et=>et.step).slice(0,2))??[]}));const gt=ur(c);if(gt&&(Yr(gt.threadId,gt.message),yt(gt.threadId,{label:"Planning",details:[]})),!b||b!==n.value)return;Qc(c);const nn=zi(c);if(nn){const et=(s.value[b]??[]).find(mo=>mo.id===nn.messageId),Wn=`${(et==null?void 0:et.text)??""}${nn.delta}`;qn(b,{id:nn.messageId,role:"assistant",text:Wn,messageType:"agentMessage.live"})}const ys=Gi(c);ys&&qn(b,ys),Yc(c);const _s=ul(c);if(_s&&_r(b,_s.delta),Jc(c)){const et=i.value[b]??"";et.trim().length>0&&!et.endsWith(`
|
|
80
|
-
|
|
81
|
-
`)&&Tn(b,`${et}
|
|
82
|
-
|
|
83
|
-
`)}Xc(c);const ho=dl(c);ho&&(Js(b,ho),yt(b,{label:"Running command",details:[((yl=ho.commandExecution)==null?void 0:yl.command)??""]}));const bs=Zc(c);if(bs){const et=(a.value[b]??[]).find(Wn=>Wn.id===bs.itemId);et!=null&&et.commandExecution&&Js(b,{...et,commandExecution:{...et.commandExecution,aggregatedOutput:`${et.commandExecution.aggregatedOutput}${bs.delta}`}})}const Wo=eu(c);Wo&&Js(b,Wo);const ws=fl(c);if(ws&&Wt(b,ws),ru(c)&&(we&&n.value&&Bo(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Hn(b)),c.method==="turn/completed"){we=!1,Hn(b),a.value[b]&&(a.value=bt(a.value,b));const et=z(c);et&&(It(et,!1),yt(et,null),xn(et),Be||(pn(et),Xi(et)))}}function Ki(c){if(c.method==="thread/tokenUsage/updated")return;const p=z(c);p&&Le.add(p);const g=c.method;(g.startsWith("thread/")||g.startsWith("turn/")||g.startsWith("item/"))&&(ne=!0),!(X!==null||typeof window>"u")&&(X=window.setTimeout(()=>{X=null,Nr()},Ed))}async function Ho(c){if(!ke){ke=!0;try{const p=await Ms(),g=[];for(const b of p.order){const j=Xo(b);g.includes(j)||g.push(j)}if(g.length>0){const b=$l(g,c);es(ee.value,b)||(ee.value=b,ci(ee.value))}if(Object.keys(p.labels).length>0){const b={...ve.value};let j=!1;for(const[B,U]of Object.entries(p.labels)){const G=Xo(B);b[G]!==U&&(b[G]=U,j=!0)}j&&(ve.value=b,Ad(b))}}catch{}}}async function ou(){if(!(Object.keys(Ye.value).length>0))try{const c=await FM();Object.keys(c.titles).length>0&&(Ye.value=c.titles)}catch{}}async function su(c,p,g){if(Ye.value[c])return;const b=p.trim();if(!b)return;const j=b.length>300?b.slice(0,300):b;try{const B=await qM(j,g);if(!B||Ye.value[c])return;Ye.value={...Ye.value,[c]:B},qt(),bd(c,B)}catch{}}async function iu(c){try{const p=await Ms();if(p.order.length===0)return c;const g=new Set(p.order.map(b=>Xo(b)));return c.filter(b=>g.has(b.projectName))}catch{return c}}async function vs(){var p;te.value||(Y.value=!0);const c=performance.now();try{const[g]=await Zd({name:"loadThreads",op:"ui.load.threads"},()=>Promise.all([ZR(),ou()]));await Ho(g);const b=await iu(g),j=$l(ee.value,b);es(ee.value,j)||(ee.value=j,ci(ee.value));const B=xd(b,ee.value);gn(new Set(Lr(B).map(Be=>Be.id)));const U=YD(t.value,B,u.value);t.value=Ll(t.value,U),u.value=Kt(u.value,new Set(Lr(t.value).map(Be=>Be.id))),qt(),te.value=!0;const G=Lr(e.value);lr(G),G.some(Be=>Be.id===n.value)||ot(((p=G[0])==null?void 0:p.id)??"");const je=Math.round(performance.now()-c);pr({category:"threads",message:`loaded ${G.length} threads in ${je}ms`,data:{projectCount:b.length},level:"info"})}finally{Y.value=!1}}async function Qr(c,p={}){var B;if(!c)return;const g=Re.value[c]===!0,b=p.silent!==!0&&!g;b&&(Se.value=!0);const j=performance.now();try{const G=De.value[c]!==!0?md(c):null,re=ag(c),[je,Be]=await Zd({name:"thread.loadMessages",op:"ui.load",attributes:{threadId:c,silent:p.silent??!1}},()=>Promise.all([G,re]));je&&(Qt(c,je.model),De.value={...De.value,[c]:!0});const{messages:ct,inProgress:gt,activeTurnId:nn,turnIndexByTurnId:ys}=Be;Bn(c,ct),Vi(c,ys),Ys(c);const _s=r.value[c]??[],ea=LD(_s,ct,{preserveMissing:p.silent===!0});vn(c,ea);const ho=s.value[c]??[],bs=jD(ho,ct);Qn(c,bs),tu(c,ct),nu(c,ct),Re.value={...Re.value,[c]:!0};const Wo=cr(c);Wo&&(Pe.value={...Pe.value,[c]:Wo}),It(c,gt),nn?_e.value={..._e.value,[c]:nn}:_e.value[c]&&(_e.value=bt(_e.value,c)),gt||br(c),mn(c);const ws=Math.round(performance.now()-j),Vo=$.value.find(ni=>ni.id===c),Ss=((B=Vo==null?void 0:Vo.cwd)==null?void 0:B.split("/").pop())??"unknown";ek("thread",{id:c,messageCount:ct.length,loadMs:ws,projectFolder:Ss}),pr({category:"thread",message:`loaded ${ct.length} msgs in ${ws}ms`,data:{threadId:c,projectFolder:Ss},level:"info"})}finally{b&&(Se.value=!1)}}async function Yi(c,p={}){c&&Re.value[c]!==!0&&await Qr(c,p)}async function Xs(){var c,p;try{const g=((p=(c=F.value)==null?void 0:c.cwd)==null?void 0:p.trim())??"";lt.value=await HM(g?[g]:void 0)}catch{}}async function au(){try{Xn(await cg())}catch{}}async function lu(c={}){k.value="";const p=c.includeSelectedThreadMessages!==!1,g=c.awaitAncillaryRefreshes===!0;try{await vs();const b=Promise.allSettled([zr(),bn(),fo(),Xs(),au()]).then(()=>{});p&&await Qr(n.value),g&&await b}catch(b){k.value=b instanceof Error?b.message:"Unknown application error"}}async function cu(c){ot(c);try{await Promise.all([Qr(c),Xs()])}catch(p){k.value=p instanceof Error?p.message:"Unknown application error"}}async function uu(c){try{await fM(c),await vs(),n.value===c&&await Qr(n.value)}catch(p){k.value=p instanceof Error?p.message:"Unknown application error"}}async function hl(c,p){const g=p.trim();if(!(!c||!g))try{await pM(c,g),Ye.value={...Ye.value,[c]:g},qt(),bd(c,g)}catch(b){k.value=b instanceof Error?b.message:"Unknown application error"}}async function du(c){var U,G;const p=c.trim();if(!p)return"";const g=Lr(t.value).find(re=>re.id===p),b=((U=g==null?void 0:g.cwd)==null?void 0:U.trim())??"",j=((G=g==null?void 0:g.title)==null?void 0:G.trim())??"Forked chat",B=_t(p);k.value="";try{const re=await dg(p,b||void 0,B||void 0),je=re.threadId.trim();return je?(vr(je,b,j),Qt(je,re.model),De.value={...De.value,[je]:!0},ot(je),await vs(),await Qr(je),je):""}catch(re){return k.value=re instanceof Error?re.message:"Unknown application error",""}}async function fu(c,p){var U;const g=c.trim();if(!g||!Number.isInteger(p)||p<0)return"";if(u.value[g]===!0)return k.value="Finish the current turn before forking from a response.","";if(Re.value[g]!==!0)try{await Qr(g)}catch(G){return k.value=G instanceof Error?G.message:"Unknown application error",""}const b=r.value[g]??[];let j=-1;for(const G of b)typeof G.turnIndex=="number"&&Number.isFinite(G.turnIndex)&&(j=Math.max(j,G.turnIndex));if(j>=0&&p>j)return"";const B=Lr(t.value).find(G=>G.id===g)??null;try{k.value="";const G=await dg(g),re=G.threadId.trim();if(!re)return"";const je=G.cwd.trim()||((U=B==null?void 0:B.cwd)==null?void 0:U.trim())||"",Be=XD((B==null?void 0:B.title)||(B==null?void 0:B.preview)||"Untitled thread");vr(re,je,Be),Qt(re,G.model),vn(re,G.messages),Re.value={...Re.value,[re]:!0},De.value={...De.value,[re]:!0},an(re),Qn(re,[]),Hn(re),a.value[re]&&(a.value=bt(a.value,re)),Ht(re,null),yt(re,null),St(re,null),It(re,!1);const ct=j-p;if(ct>0){const gt=await gd(re,ct);vn(re,gt)}return await hl(re,Be),ot(re),vs().catch(()=>{}),re}catch(G){return k.value=G instanceof Error?G.message:"Unknown application error",""}}async function pu(c,p,g=[],b=[],j=[]){if(!c||!p.trim()||g.length>0||b.length>0||j.length>0)return!1;const U=(Fe.value[c]??[]).filter(je=>je.method==="item/tool/requestUserInput");if(U.length!==1)return!1;const[G]=U,re=Rn(G);return re.length!==1?!1:vl({id:G.id,result:{answers:{[re[0]]:{answers:[p.trim()]}}}})}async function Ji(c,p=[],g=[],b="steer",j=[],B){if(Ze.value)return;const U=n.value,G=c.trim();if(!U||!G&&p.length===0&&j.length===0||await pu(U,G,p,g,j))return;pr({category:"ui.action",message:"send message",data:{threadId:U,hasImages:p.length>0,skillCount:g.length},level:"info"});const re=u.value[U]===!0;if(re&&b==="queue"){const je=d.value[U]??[],Be=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ct=[...je],gt=typeof B=="number"?Math.max(0,Math.min(B,ct.length)):ct.length;ct.splice(gt,0,{id:Be,text:G,imageUrls:p,skills:g,fileAttachments:j,collaborationMode:M.value}),d.value={...d.value,[U]:ct};return}if(re){we=!0,Zr(U,G,p,g,j).catch(je=>{const Be=je instanceof Error?je.message:"Unknown application error";St(U,Be),k.value=Be});return}k.value="",we=!0,Ht(U,null),yt(U,{label:"Thinking",details:gr(_t(U),V.value,M.value)}),St(U,null),It(U,!0);try{await Zr(U,G,p,g,j)}catch(je){we=!1,It(U,!1),yt(U,null);const Be=je instanceof Error?je.message:"Unknown application error";throw St(U,Be),k.value=Be,je}}async function hu(c,p,g=[],b=[],j=[]){if(Ze.value)return"";const B=c.trim(),U=p.trim(),G=O.value.trim();if(!B&&g.length===0&&j.length===0)return"";he.value=!0,k.value="";let re="";try{try{const gt=await ug(U||void 0,G||void 0);re=gt.threadId,Qt(re,gt.model)}catch(gt){if(G&&G!==Or&&Nl(gt)){await zt();const nn=await ug(U||void 0,Or);re=nn.threadId,Qt(re,nn.model)}else throw gt}if(!re)return"";vr(re,U,B||"[Image]"),Cn(re),De.value={...De.value,[re]:!0},ot(re),we=!0,Ht(re,null),yt(re,{label:"Thinking",details:gr(O.value,V.value,M.value)}),St(re,null),It(re,!0);const je=re,Be=U||null,ct=B;return Zr(re,B,g,b,j).catch(gt=>{we=!1,It(re,!1),yt(re,null);const nn=gt instanceof Error?gt.message:"Unknown application error";St(re,nn),k.value=nn}).finally(()=>{he.value=!1}),su(je,ct,Be),re}catch(je){we=!1,re&&(It(re,!1),yt(re,null));const Be=je instanceof Error?je.message:"Unknown application error";throw re&&St(re,Be),k.value=Be,he.value=!1,je}}async function Zr(c,p,g=[],b=[],j=[]){const B=V.value,U=M.value,G=p.trim(),re=b.map(Be=>({name:Be.name,path:Be.path})),je=j.map(Be=>({...Be}));kt(c,{text:G,imageUrls:[...g],skills:re,fileAttachments:je,effort:B,collaborationMode:U,fallbackRetried:!1});try{if(De.value[c]!==!0){const gt=await md(c);Qt(c,gt.model)}const Be=_t(c);let ct="";try{ct=await vd(c,p,g,Be||void 0,B||void 0,b.length>0?b:void 0,j,U)}catch(gt){if(Be&&Be!==Or&&Nl(gt))await zt(c),kt(c,{text:G,imageUrls:[...g],skills:re,fileAttachments:je,effort:B,collaborationMode:U,fallbackRetried:!0}),ct=await vd(c,p,g,Or,B||void 0,b.length>0?b:void 0,j,U);else throw gt}ct&&(_e.value={..._e.value,[c]:ct}),De.value={...De.value,[c]:!0},Le.add(c),ne=!0,await Nr(),wn(c)}catch(Be){throw Be}}async function Xi(c){if(f.value[c]===!0)return;const p=d.value[c];if(!p||p.length===0)return;f.value={...f.value,[c]:!0};const[g,...b]=p;d.value=b.length>0?{...d.value,[c]:b}:bt(d.value,c),he.value=!0,k.value="",we=!0,Ht(c,null),yt(c,{label:"Thinking",details:gr(_t(c),V.value,g.collaborationMode)}),St(c,null),It(c,!0);try{ir(g.collaborationMode),await Zr(c,g.text,g.imageUrls,g.skills,g.fileAttachments)}catch{It(c,!1),yt(c,null)}finally{f.value=bt(f.value,c),he.value=!1}}async function Qs(){const c=n.value;if(!c||u.value[c]!==!0||Te.value[c]===!0)return;let p=_e.value[c];if(!p){const{activeTurnId:g}=await ag(c);p=g,p&&(_e.value={..._e.value,[c]:p})}if(!p)throw new Error("Could not determine active turn id for interrupt");Ue.value=!0,k.value="";try{await yM(c,p),It(c,!1),yt(c,null),St(c,null),_e.value[c]&&(_e.value=bt(_e.value,c)),Le.add(c),ne=!0,await Nr()}catch(g){const b=g instanceof Error?g.message:"Failed to interrupt active turn";St(c,b),k.value=b}finally{Ue.value=!1}}async function ml(c){var G,re;const p=n.value;if(!p||T.value||!c.trim())return;const g=r.value[p]??[],b=g.find(je=>je.turnId===c),j=typeof(b==null?void 0:b.turnIndex)=="number"?b.turnIndex:-1;if(j<0)return;const B=g.reduce((je,Be)=>typeof Be.turnIndex=="number"&&Be.turnIndex>je?Be.turnIndex:je,-1);if(B<0||j>B)return;const U=B-j+1;if(!(U<1)){T.value=!0,k.value="";try{const je=((re=(G=F.value)==null?void 0:G.cwd)==null?void 0:re.trim())??"";je&&await hM(p,c,je);const Be=await gd(p,U);vn(p,Be),Qn(p,[]),Hn(p),a.value[p]&&(a.value=bt(a.value,p)),Ht(p,null),yt(p,null),St(p,null),ne=!0,await Nr()}catch(je){k.value=je instanceof Error?je.message:"Failed to rollback thread"}finally{T.value=!1}}}let Zs=null;async function mu(c,p){try{const g=await Ms(),b={...g.labels};let j=!1;for(const B of g.order){if(Xo(B)!==c)continue;const U=p.trim();U.length===0?b[B]!==void 0&&(delete b[B],j=!0):b[B]!==U&&(b[B]=U,j=!0)}j&&await yd({order:g.order,labels:b,active:g.active})}catch{}}function gu(c,p){c.length===0||(ve.value[c]??"")===p||(ve.value={...ve.value,[c]:p},Ad(ve.value),Zs!==null&&clearTimeout(Zs),Zs=setTimeout(()=>{Zs=null,mu(c,p)},500))}async function vu(c){var B;if(c.length===0)return;const p=ee.value.filter(U=>U!==c);if(es(ee.value,p)||(ee.value=p,ci(ee.value)),t.value=t.value.filter(U=>U.projectName!==c),ve.value[c]!==void 0){const U={...ve.value};delete U[c],ve.value=U,Ad(U)}qt();const g=Lr(e.value);lr(g),g.some(U=>U.id===n.value)||ot(((B=g[0])==null?void 0:B.id)??"");const j=new Set;try{const U=await Ms();for(const G of U.order)Xo(G)===c&&j.add(G);for(const G of U.active)Xo(G)===c&&j.add(G);for(const G of Object.keys(U.labels))Xo(G)===c&&j.add(G)}catch{}if(j.size>0)try{const U=await Ms(),G=U.order.filter(Be=>!j.has(Be)),re=U.active.filter(Be=>!j.has(Be)),je=re.length===0&&G.length>0?[G[0]]:re;await yd({order:G,labels:VD(U.labels,j),active:je});return}catch{}await ei()}function yu(c,p){if(c.length===0||t.value.length===0)return;const g=t.value.map(re=>re.projectName),b=g.indexOf(c);if(b===-1)return;const j=Math.max(0,Math.min(p,g.length-1)),B=PD(g,b,j);if(B===g)return;const U=$l(B,t.value);ee.value=U,ci(ee.value);const G=xd(t.value,ee.value);t.value=Ll(t.value,G),qt(),ei()}function _u(c){const p=c.trim();if(!p)return;const g=[p,...ee.value.filter(j=>j!==p)];if(es(ee.value,g))return;ee.value=g,ci(ee.value);const b=xd(t.value,ee.value);t.value=Ll(t.value,b),qt(),ei()}async function ei(){var c,p;try{const g=await Ms(),b=new Map;for(const U of g.order){const G=Xo(U);b.has(G)||b.set(G,U)}for(const U of t.value){const G=((p=(c=U.threads[0])==null?void 0:c.cwd)==null?void 0:p.trim())??"";G&&b.set(U.projectName,G)}const j=[];for(const U of ee.value){const G=b.get(U);G&&!j.includes(G)&&j.push(G)}for(const U of g.order)j.includes(U)||j.push(U);const B=g.active.filter(U=>j.includes(U));B.length===0&&j.length>0&&B.push(j[0]),await yd({order:j,labels:g.labels,active:B})}catch{}}async function Nr(){if(q.value){typeof window<"u"&&X===null&&(X=window.setTimeout(()=>{X=null,Nr()},Ed));return}q.value=!0;const c=ne,p=new Set(Le);ne=!1,Le.clear();try{c&&await vs();const g=n.value;if(!g)return;const b=p.has(g),j=u.value[g]===!0,B=cr(g),U=Pe.value[g]??"",G=B.length>0&&B!==U;(b||j||G||c)&&await Qr(g,{silent:!0})}catch{}finally{q.value=!1,(ne||Le.size>0)&&typeof window<"u"&&X===null&&(X=window.setTimeout(()=>{X=null,Nr()},Ed))}}async function ti(){await gl(),ne=!0,n.value&&Le.add(n.value),await Nr()}function bu(){typeof window>"u"||Z||(gl(),Z=sM(c=>{if(c.method==="ready"){Un(),ti();return}pl(c),Ki(c)}))}async function gl(){try{const p=(await aM()).map(g=>Pt(g)).filter(g=>g!==null);Vc(p)}catch{}}async function vl(c){try{return await iM(c.id,{result:c.result,error:c.error}),ll(c.id),!0}catch(p){return k.value=p instanceof Error?p.message:"Failed to reply to server request",!1}}function wu(){if(Z&&(Z(),Z=null),ne=!1,Le.clear(),xe.clear(),X!==null&&typeof window<"u"&&(window.clearTimeout(X),X=null),ae!==null&&typeof window<"u"&&(window.clearTimeout(ae),ae=null),typeof window<"u")for(const c of me.values())window.clearTimeout(c);me.clear(),we=!1,r.value={},o.value={},s.value={},i.value={},a.value={},l.value={},Q.value={},Me.value={},pe.value={},qe.value={},_e.value={},Te.value={},le.value={},Ee.value={},d.value={},f.value={},Ge.value=null,Ke.value={}}const Su=ie(()=>{const c=n.value;return c?d.value[c]??[]:[]});function Qi(c){const p=n.value;if(!p)return;const g=d.value[p];if(!g)return;const b=g.filter(j=>j.id!==c);d.value=b.length>0?{...d.value,[p]:b}:bt(d.value,p)}function Zi(c){const p=n.value;if(!p)return;const g=d.value[p];if(!g)return;const b=g.find(j=>j.id===c);b&&(Qi(c),ir(b.collaborationMode),Ji(b.text,b.imageUrls,b.skills,"steer",b.fileAttachments))}function Tu(c){ot(c)}return{projectGroups:e,projectDisplayNameById:ve,selectedThread:F,selectedThreadTokenUsage:it,selectedThreadScrollState:J,isSelectedThreadInterruptPending:ce,selectedThreadServerRequests:Oe,selectedLiveOverlay:We,codexQuota:st,selectedThreadId:n,availableCollaborationModes:E,availableModelIds:v,selectedCollaborationMode:M,selectedModelId:O,selectedReasoningEffort:V,selectedSpeedMode:K,installedSkills:lt,accountRateLimitSnapshots:Xe,messages:$t,isLoadingThreads:Y,isLoadingMessages:Se,isSendingMessage:he,isInterruptingTurn:Ue,isUpdatingSpeedMode:Ze,isRollingBack:T,error:k,refreshAll:lu,refreshSkills:Xs,selectThread:cu,loadMessages:Qr,ensureThreadMessagesLoaded:Yi,setThreadScrollState:Bo,archiveThreadById:uu,renameThreadById:hl,forkThreadById:du,forkThreadFromTurn:fu,rollbackSelectedThread:ml,sendMessageToSelectedThread:Ji,sendMessageToNewThread:hu,interruptSelectedThreadTurn:Qs,selectedThreadQueuedMessages:Su,removeQueuedMessage:Qi,steerQueuedMessage:Zi,setSelectedCollaborationMode:ir,setSelectedModelId:fn,setSelectedReasoningEffort:uo,updateSelectedSpeedMode:ms,respondToPendingServerRequest:vl,renameProject:gu,removeProject:vu,reorderProject:yu,pinProjectToTop:_u,startPolling:bu,stopPolling:wu,primeSelectedThread:Tu}}const ZD={class:"sidebar-root"},ej={class:"sidebar-scrollable"},tj=["aria-pressed"],nj={key:1,class:"sidebar-search-bar"},rj={class:"sidebar-settings-account-section"},oj={class:"sidebar-settings-account-header"},sj={class:"sidebar-settings-account-header-main"},ij=["aria-expanded","title"],aj={class:"sidebar-settings-account-collapse-icon"},lj={class:"sidebar-settings-account-count"},cj=["disabled"],uj={key:0,class:"sidebar-settings-account-error"},dj={key:1,class:"sidebar-settings-account-empty"},fj={key:2,class:"sidebar-settings-account-list"},pj=["title","onMouseenter","onMouseleave"],hj={class:"sidebar-settings-account-main"},mj={class:"sidebar-settings-account-email"},gj={class:"sidebar-settings-account-meta"},vj={class:"sidebar-settings-account-quota"},yj={class:"sidebar-settings-account-id"},_j={class:"sidebar-settings-account-actions"},bj=["disabled","onClick"],wj=["disabled","onClick"],Sj=["title"],Tj=["title"],Ej={class:"sidebar-settings-value"},kj=["title"],Ij={class:"sidebar-settings-value"},Cj=["title"],Aj={class:"sidebar-settings-value"},xj=["title"],Rj=["title"],Mj=["title"],Pj={class:"sidebar-settings-row sidebar-settings-row--select",title:"Choose the API provider for the Codex backend"},$j=["value","disabled"],Nj={key:0,class:"sidebar-settings-row sidebar-settings-row--input"},Oj={class:"sidebar-settings-key-group"},Lj={class:"sidebar-settings-key-masked"},Dj=["disabled"],jj=["disabled"],Fj={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},Bj={class:"sidebar-settings-key-group"},Uj={class:"sidebar-settings-key-group"},qj=["disabled"],Hj=["title"],Wj={class:"sidebar-settings-value"},Vj={key:2,class:"sidebar-settings-telegram-panel"},zj={class:"sidebar-settings-field"},Gj={class:"sidebar-settings-field"},Kj={key:0,class:"sidebar-settings-telegram-error"},Yj={class:"sidebar-settings-telegram-actions"},Jj=["disabled"],Xj=["data-state","title"],Qj=["data-state"],Zj={class:"sidebar-settings-context-meta"},eF={class:"sidebar-settings-rate-limits"},tF={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},nF={class:"sidebar-settings-button-version"},rF={class:"content-body"},oF={key:1,class:"content-grid content-grid-home"},sF={class:"new-thread-empty"},iF=["title"],aF=["onKeydown"],lF={class:"new-thread-open-folder-current"},cF=["title"],uF=["disabled"],dF={class:"new-thread-open-folder-actions"},fF={class:"new-thread-open-folder-toggle"},pF=["aria-pressed","disabled"],hF={key:0,class:"new-thread-open-folder-create"},mF={class:"new-thread-open-folder-create-composer"},gF=["onKeydown"],vF=["disabled"],yF={key:0,class:"new-thread-open-folder-error"},_F=["onKeydown"],bF={key:1,class:"new-thread-open-folder-error-actions"},wF={class:"new-thread-open-folder-error"},SF=["disabled"],TF={key:2,class:"new-thread-open-folder-status"},EF={key:3,class:"new-thread-open-folder-status"},kF={key:4,class:"new-thread-open-folder-list"},IF=["title","disabled","onClick"],CF={class:"new-thread-open-folder-item-name"},AF=["disabled","onClick"],xF={key:1,class:"new-thread-branch-select"},RF={class:"new-thread-branch-select-help"},MF={class:"worktree-init-status-title"},PF={class:"worktree-init-status-message"},$F={key:3,class:"new-thread-trending"},NF={class:"new-thread-trending-header"},OF={key:0,class:"new-thread-trending-empty"},LF={key:1,class:"new-thread-trending-empty"},DF={key:2,class:"new-thread-trending-list"},jF=["onClick"],FF=["title"],BF={class:"new-thread-trending-tip-name-owner"},UF={class:"new-thread-trending-tip-name-repo"},qF={key:1,class:"new-thread-trending-tip-name-repo"},HF={class:"new-thread-trending-tip-meta"},WF={class:"new-thread-trending-tip-description"},VF={class:"composer-with-queue"},zF={key:2,class:"content-grid"},GF={class:"content-thread"},KF={class:"composer-with-queue"},Pg="codex-web-local.sidebar-collapsed.v1",$g="codex-web-local.accounts-section-collapsed.v1",Ng="codex-web-local.send-with-enter.v1",Og="codex-web-local.in-progress-send-mode.v1",Lg="codex-web-local.dark-mode.v1",Dg="codex-web-local.dictation-click-to-toggle.v1",jg="codex-web-local.dictation-auto-send.v1",Fg="codex-web-local.dictation-language.v1",Bg="codex-web-local.github-trending-projects.v1",Ug="codex-web-local.chat-width.v1",YF=400,JF=In({__name:"App",setup(e){const t=Du(()=>ad(()=>import("./ThreadConversation-Ctw55jX6.js"),__vite__mapDeps([0,1]))),n=Du(()=>ad(()=>import("./ReviewPane-nTMVVMpp.js"),__vite__mapDeps([2,3]))),r=Du(()=>ad(()=>import("./SkillsHub-BqjWaUSP.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.83",i={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",chatWidth:"Choose how wide the conversation column and composer can grow on desktop screens.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",githubTrendingProjects:"Show or hide GitHub trending project cards on the new thread screen.",dictationLanguage:"Choose transcription language or keep auto-detect."},a={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},l={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:u,projectDisplayNameById:d,selectedThread:f,selectedThreadTokenUsage:m,selectedThreadScrollState:v,selectedThreadServerRequests:E,selectedLiveOverlay:C,codexQuota:H,selectedThreadId:M,availableCollaborationModes:O,availableModelIds:V,selectedCollaborationMode:K,selectedModelId:de,selectedReasoningEffort:oe,selectedSpeedMode:ee,installedSkills:ve,accountRateLimitSnapshots:Pe,messages:Re,isLoadingThreads:De,isLoadingMessages:Q,isSendingMessage:pe,isInterruptingTurn:Me,isSelectedThreadInterruptPending:qe,isUpdatingSpeedMode:_e,refreshAll:Te,refreshSkills:le,selectThread:Ee,ensureThreadMessagesLoaded:Fe,setThreadScrollState:Ne,archiveThreadById:Ge,forkThreadById:Ke,renameThreadById:Ye,forkThreadFromTurn:lt,sendMessageToSelectedThread:Xe,sendMessageToNewThread:Y,interruptSelectedThreadTurn:Se,selectedThreadQueuedMessages:he,removeQueuedMessage:Ue,steerQueuedMessage:Ze,setSelectedCollaborationMode:T,setSelectedModelId:k,setSelectedReasoningEffort:q,updateSelectedSpeedMode:te,respondToPendingServerRequest:Z,renameProject:X,removeProject:ae,reorderProject:me,pinProjectToTop:fe,startPolling:ne,stopPolling:Le,primeSelectedThread:ke,rollbackSelectedThread:we}=QD(),xe=dR(),R=uR(),{isMobile:$}=_p(),F=N(null),J=N(null),ce=N(null),Oe=N([]),We=N(!1),st=N("trending-daily"),it=N(null),$t=N(!1);let _t=!1;const on=N(!1),ot=N(""),fn=N("local"),Qt=N(""),mr=N([]),ir=N(!1),Xn=N({order:[],labels:{}}),zt=N({phase:"idle",title:"",message:""}),kt=N(Qb()),pn=N(""),Ut=N(!1),uo=N(null),ms=N(null),fo=N(null),gr=N(null),zr=N(null);let bn=null;const sn=N("New Project (1)"),Gr=N(""),wn=N(!1),hn=N(ew()),jn=N(!1),ar=N([]),Fn=N(null),qt=N(!1),vr=N(!1),lr=N(null),mn=N([]),Ht=N(!1),It=N(!1),Sn=N(""),Cn=N(""),An=N(""),gn=N(""),Bn=N(_l(Ng,!0)),xn=N(jb()),yt=N(Db()),St=N(Fb()),yr=N(_l(Dg,!1)),Un=N(_l(jg,!0)),cr=N(Jb()),Bo=ie(()=>Xb()),vn=N(_l(Bg,!1)),Qn=N(!1),Kr=N(!1),Zn=N(""),Yr=N(!1),qn=N(null),Wt=N(!1),Tn=N("codex"),_r=N(""),Hn=N(""),an=N(!1),Mr=N(""),br=N(""),yn=N(""),Jr=N(!1),er=N(!1),ur=N(""),$e=N(""),ye=N(!1),Dt=N(!1),Uo=N(null),S=N(""),x=N(""),L=N([]),W=N(""),w=N(!1),P=N(!1),z=N(!1),be=N(""),tt=N({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),Pt=N(null),Gt=N(!1),Ot=N(!1);let Ft=null,Xr=!1,Pr=0;const po=ie(()=>{const h=xe.params.threadId;return typeof h=="string"?h:""}),al=ie(()=>{const h=new Set;for(const y of u.value)for(const I of y.threads)h.add(I.id);return h}),Rn=ie(()=>xe.name==="home"),qo=ie(()=>xe.name==="skills"),ll=ie(()=>{var h;return qo.value?"Skills":Rn.value?"New thread":((h=f.value)==null?void 0:h.title)??"Choose a thread"}),Vc=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",zc=ie(()=>{var y,I;return(((I=(y=f.value)==null?void 0:y.title)==null?void 0:I.trim())??"")||Vc}),gs=ie(()=>Re.value.filter(h=>{const y=nw(h.messageType,h.role);return y==="worked"?!0:!(y==="turnActivity.live"||y==="turnError.live"||y==="agentReasoning.live")})),Gc=ie(()=>C.value),Hi=ie(()=>Rn.value?"__new-thread__":M.value),cl=ie(()=>{const h=E.value;return h.length>0?h[h.length-1]:null}),$r=ie(()=>{var h,y;return Rn.value?ot.value.trim():((y=(h=f.value)==null?void 0:h.cwd)==null?void 0:y.trim())??""}),Wi=ie(()=>{var h;return!Rn.value&&((h=f.value)==null?void 0:h.inProgress)===!0}),Kc=ie(()=>!Rn.value&&!qo.value&&M.value.trim().length>0),Vi=ie(()=>pe.value||Me.value||Wi.value||E.value.length>0);function Ys(h){return Number.isFinite(h)?new Intl.NumberFormat("en-US",{notation:h>=1e3?"compact":"standard",maximumFractionDigits:h>=1e5?0:1}).format(Math.max(0,Math.trunc(h))):"0"}function Yc(h){if(!h)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const y=[`Current context usage: ${h.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${h.total.totalTokens.toLocaleString()} tokens`];return typeof h.modelContextWindow=="number"?(y.unshift(`Model context window: ${h.modelContextWindow.toLocaleString()} tokens`),y.push(`Remaining context: ${(h.remainingContextTokens??0).toLocaleString()} tokens`)):y.push("Model context window is unavailable in the latest usage event."),y.join(`
|
|
84
|
-
`)}const ul=ie(()=>{var y;const h=(y=m.value)==null?void 0:y.remainingContextPercent;return h===null||typeof h!="number"?"pending":h<=10?"danger":h<=25?"warning":"ok"}),Jc=ie(()=>{const h=m.value;return h?typeof h.remainingContextTokens=="number"?`${Ys(h.remainingContextTokens)} left`:`${Ys(h.currentContextTokens)} used`:"Awaiting data"}),Xc=ie(()=>{const h=m.value;return h?typeof h.modelContextWindow=="number"?`${Ys(h.currentContextTokens)} used / ${Ys(h.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),Qc=ie(()=>Yc(m.value)),zi=ie(()=>{var se,Ie;const h=[],y=new Set;for(const Ae of Xn.value.order){const at=Ae.trim();!at||y.has(at)||(y.add(at),h.push({value:at,label:Xn.value.labels[at]||Rs(at)}))}for(const Ae of u.value){const at=((Ie=(se=Ae.threads[0])==null?void 0:se.cwd)==null?void 0:Ie.trim())??"";!at||y.has(at)||(y.add(at),h.push({value:at,label:d.value[Ae.projectName]??Ae.projectName}))}const I=ot.value.trim();return I&&!y.has(I)&&h.unshift({value:I,label:Rs(I)}),h}),Gi=ie(()=>{const h=Qt.value.trim(),y=[...mr.value];return h&&!y.some(I=>I.value===h)&&y.unshift({value:h,label:h}),y}),dl=ie(()=>{const h=Qt.value.trim();if(!h)return"";const y=Gi.value.find(I=>I.value===h);return(y==null?void 0:y.label)??h}),Zc=ie(()=>Fn.value??"__detached_head__"),eu=ie(()=>{var se;const h=[{value:"__review__",label:jn.value?"Review (Open)":"Review"}],y=new Set,I=((se=Fn.value)==null?void 0:se.trim())??"";I?(h.push({value:I,label:I}),y.add(I)):(h.push({value:"__detached_head__",label:"Detached HEAD"}),y.add("__detached_head__"));for(const Ie of ar.value)!Ie.value||y.has(Ie.value)||(y.add(Ie.value),h.push(Ie));return h}),fl=ie(()=>S.value.trim()),Js=ie(()=>{const h=ur.value.trim();return!h||h==="."||h===".."?!1:!/[\\/]/u.test(h)}),tu=ie(()=>Js.value&&fl.value.trim().length>0&&!W.value),nu=ie(()=>ye.value?"Creating…":"Create"),ru=ie(()=>{const h=S.value.trim(),y=x.value.trim();return!!(h&&y&&h!==y)}),pl=ie(()=>{const h=[];ru.value&&h.push({key:`parent:${x.value}`,name:"..",path:x.value,kind:"parent"});for(const y of L.value)h.push({key:`directory:${y.path}`,name:y.name,path:y.path,kind:"directory"});return h}),Ki=ie(()=>{const h=be.value.trim().toLowerCase();return h?pl.value.filter(y=>y.kind==="parent"||y.name.toLowerCase().includes(h)):pl.value}),Ho=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,ou=ie(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]),su=ie(()=>a[St.value].label),iu=ie(()=>{const h=a[St.value];return{"--chat-column-max":h.columnMax,"--chat-card-max":h.cardMax}}),vs=ie(()=>{if(!tt.value.configured)return"Not configured";const h=tt.value.active?"Online":"Configured (offline)",y=tt.value.allowAllUsers?"allow all users":`${tt.value.allowedUsers} allowed user(s)`,I=`${tt.value.mappedChats} chat(s), ${tt.value.mappedThreads} thread(s), ${y}`,se=tt.value.lastError?`, error: ${tt.value.lastError}`:"";return`${h}, ${I}${se}`});ds(()=>{document.addEventListener("pointerdown",gt),window.addEventListener("keydown",ct),document.addEventListener("visibilitychange",ys),window.addEventListener("pageshow",_s),window.addEventListener("focus",ea),bl(),Ho==null||Ho.addEventListener("change",bl),rw(),Rb(),ri(),zo(),Xs(),Yi(),Au(),vn.value&&ku()}),Ac(()=>{document.removeEventListener("pointerdown",gt),window.removeEventListener("keydown",ct),document.removeEventListener("visibilitychange",ys),window.removeEventListener("pageshow",_s),window.removeEventListener("focus",ea),Ho==null||Ho.removeEventListener("change",bl),Ft!==null&&(window.clearInterval(Ft),Ft=null),bn&&(clearTimeout(bn),bn=null),Le()}),ut(pn,h=>{const y=h.trim();if(bn&&(clearTimeout(bn),bn=null),!y){zr.value=null;return}bn=setTimeout(()=>{$M(y,1e3).then(I=>{pn.value.trim()===y&&(zr.value=I.threadIds)}).catch(()=>{pn.value.trim()===y&&(zr.value=null)})},220)}),ut(mn,()=>{if(typeof window>"u")return;if(!mn.value.some(y=>y.quotaStatus==="loading")){Ft!==null&&(window.clearInterval(Ft),Ft=null);return}Ft===null&&(Ft=window.setInterval(()=>{Xr||(Xr=!0,ti({silent:!0}).finally(()=>{Xr=!1}))},1500))},{deep:!0});function Qr(){le()}async function Yi(){try{tt.value=await LM()}catch(h){const y=h instanceof Error?h.message:"Failed to load Telegram status";tt.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:y}}}async function Xs(){try{const h=await OM();Mr.value=h.botToken,br.value=h.allowedUserIds.map(y=>String(y)).join(`
|
|
85
|
-
`),yn.value=""}catch(h){yn.value=h instanceof Error?h.message:"Failed to load Telegram configuration"}}function au(h){const y=h.split(/[\n,]/).map(Ie=>Ie.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),I=y.includes("*"),se=Array.from(new Set(y.filter(Ie=>/^-?\d+$/.test(Ie)).map(Ie=>Number.parseInt(Ie,10))));return I?["*",...se]:se}async function lu(){const h=Mr.value.trim(),y=au(br.value);if(!h){yn.value="Telegram bot token is required.";return}if(y.length===0){yn.value="At least one allowed Telegram user ID or * is required.";return}Jr.value=!0,yn.value="";try{await NM(h,y),br.value=y.map(I=>String(I)).join(`
|
|
86
|
-
`),await Promise.all([Xs(),Yi()]),window.alert("Telegram bot configured. Only allowlisted Telegram users can use the bridge.")}catch(I){yn.value=I instanceof Error?I.message:"Failed to connect Telegram bot",Yi()}finally{Jr.value=!1}}function cu(){Ut.value=!Ut.value,Ut.value?Jt(()=>{var h;return(h=uo.value)==null?void 0:h.focus()}):pn.value=""}function uu(){var h;pn.value="",(h=uo.value)==null||h.focus()}function hl(h){h.key==="Escape"&&(Ut.value=!1,pn.value="")}function du(h){h&&(xe.name==="thread"&&po.value===h||(R.push({name:"thread",params:{threadId:h}}),$.value&&Be(!0)))}async function fu(h){h&&(M.value!==h&&(await Ee(h),await R.push({name:"thread",params:{threadId:h}})),await Jt(),$b())}function pu(h){return h.length>8?h.slice(-8):h}function Ji(h){const y=[h.planType||"unknown"];return h.authMode&&y.unshift(h.authMode),y.join(" · ")}function hu(h){if(!h)return!1;const y=h.toLowerCase();return y.includes("payment required")||/\b402\b/.test(y)}function Zr(h){return h.unavailableReason==="payment_required"||hu(h.quotaError)}function Xi(h){return Ht.value||It.value||Sn.value.length>0||h.isActive&&Sn.value!==h.accountId&&Vi.value}function Qs(h){return Cn.value===h.accountId}function ml(h){return An.value===h.accountId||Qs(h)}function Zs(h){return Zr(h)?"Unavailable":h.isActive?"Active":It.value?"Switching…":"Switch"}function mu(h){return Sn.value===h.accountId?"Removing…":Qs(h)?"Click again to remove":"Remove"}function gu(h){An.value=h}function vu(h){An.value===h&&(An.value=""),Sn.value!==h&&Cn.value===h&&(Cn.value="")}function yu(h){const y=h.quotaSnapshot;if(!y)return null;const I=[y==null?void 0:y.primary,y==null?void 0:y.secondary].filter(Ae=>Ae!==null),se=I.find(Ae=>Ae.windowMinutes===10080);if(se)return se;const Ie=I.filter(Ae=>typeof Ae.windowMinutes=="number"&&Ae.windowMinutes>=10080).sort((Ae,at)=>(Ae.windowMinutes??0)-(at.windowMinutes??0))[0]??null;return Ie||(y.secondary??null)}function _u(h){if(typeof h!="number"||!Number.isFinite(h))return"";const y=new Date(h*1e3);return`${y.getMonth()+1}月${y.getDate()}日`}function ei(h){var Ae,at;if(Zr(h))return h.quotaError||"402 Payment Required";const y=h.quotaSnapshot,I=yu(h),se=(y==null?void 0:y.primary)??(y==null?void 0:y.secondary)??null,Ie=I??se;if(Ie){const Mn=Math.max(0,Math.min(100,100-Math.round(Ie.usedPercent))),eo=_u(Ie.resetsAt);return eo?`${Mn}% weekly remaining · ${eo}`:`${Mn}% weekly remaining`}return(Ae=y==null?void 0:y.credits)!=null&&Ae.unlimited?"Unlimited credits":(at=y==null?void 0:y.credits)!=null&&at.hasCredits&&y.credits.balance?`${y.credits.balance} credits`:h.quotaStatus==="loading"?"Loading quota…":h.quotaStatus==="error"?h.quotaError||"Quota unavailable":h.quotaStatus==="ready"||h.quotaStatus==="idle"?"Quota unavailable":"Fetching account details…"}function Nr(h){return[h.email||"Account",Ji(h),Zr(h)?"Unavailable account":null,ei(h),`Workspace ${h.accountId}`].filter(Boolean).join(`
|
|
87
|
-
`)}async function ti(h={}){try{const y=await lM();mn.value=y.accounts,y.accounts.some(I=>I.accountId===An.value)||(An.value=""),y.accounts.some(I=>I.accountId===Cn.value)||(Cn.value="")}catch(y){if(h.silent===!0)return;gn.value=y instanceof Error?y.message:"Failed to load accounts"}}async function bu(){if(!(Ht.value||It.value)){gn.value="",An.value="",Cn.value="",Ht.value=!0;try{const h=await cM();mn.value=h.accounts,Le(),ne(),Te({includeSelectedThreadMessages:!0})}catch(h){gn.value=h instanceof Error?h.message:"Failed to refresh accounts"}finally{Ht.value=!1}}}async function gl(h){if(!(It.value||Ht.value)){if(Vi.value){gn.value="Finish the current turn and pending requests before switching accounts.";return}gn.value="",An.value="",Cn.value="",It.value=!0;try{const y=await uM(h);mn.value=mn.value.map(I=>I.accountId===h?y:{...I,isActive:!1}),Le(),ne(),Te({includeSelectedThreadMessages:!0}),ti({silent:!0})}catch(y){gn.value=y instanceof Error?y.message:"Failed to switch account"}finally{It.value=!1}}}async function vl(h){if(Ht.value||It.value||Sn.value.length>0)return;const y=mn.value.find(se=>se.accountId===h)??null;if(!y)return;if(Cn.value!==h){Cn.value=h;return}if(y.isActive&&Vi.value){gn.value="Finish the current turn and pending requests before removing the active account.";return}const I=y.isActive;gn.value="",Cn.value="",Sn.value=h;try{const se=await dM(h);mn.value=se.accounts,Le(),ne(),I&&Te({includeSelectedThreadMessages:!0}),ti({silent:!0})}catch(se){gn.value=se instanceof Error?se.message:"Failed to remove account"}finally{Sn.value=""}}function wu(h){Ge(h)}async function Su(h){const y=await Ke(h);y&&(Rn.value?await R.replace({name:"thread",params:{threadId:y}}):await R.push({name:"thread",params:{threadId:y}}),$.value&&Be(!0))}function Qi(h){const y=h.trim().replace(/\\/gu,"/");return y?y.includes("/.codex/worktrees/")||y.includes("/.git/worktrees/"):!1}function Zi(h,y=""){var Ae,at,Mn;const I=u.value.find(eo=>eo.projectName===h);if(!I)return y.trim();const se=I.threads.find(eo=>!Qi(eo.cwd));return(((Ae=se==null?void 0:se.cwd)==null?void 0:Ae.trim())??((Mn=(at=I.threads[0])==null?void 0:at.cwd)==null?void 0:Mn.trim())??"")||y.trim()}function Tu(h){var se,Ie;const y=u.value.find(Ae=>Ae.projectName===h),I=Zi(h,((Ie=(se=y==null?void 0:y.threads[0])==null?void 0:se.cwd)==null?void 0:Ie.trim())??"");I&&(ot.value=I),$.value&&Be(!0),!Rn.value&&R.push({name:"home"})}function c(h){var I;let y="";for(const se of u.value){const Ie=se.threads.find(Ae=>Ae.id===h);if((I=Ie==null?void 0:Ie.cwd)!=null&&I.trim()){y=Ie.cwd.trim();break}}!y||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(y)}`,"_blank","noopener,noreferrer")}function p(){var I;const h=f.value,y=h?Zi(h.projectName,((I=h.cwd)==null?void 0:I.trim())??""):"";y&&(ot.value=y),$.value&&Be(!0),!Rn.value&&R.push({name:"home"})}function g(h){X(h.projectName,h.displayName)}function b(h){Ye(h.threadId,h.title)}async function j(h){await ae(h),await ri(),zo()}function B(h){me(h.projectName,h.toIndex)}function U(h){Ne(h.threadId,h.state)}function G(h){re(h)}async function re(h){var se;const y=await Z(h),I=((se=h.followUpMessageText)==null?void 0:se.trim())??"";if(!(!y||!I||Rn.value))try{await Xe(I,[],[],"steer",[])}catch{}}async function je(h){const y=await lt(h.threadId,h.turnIndex);y&&(await R.push({name:"thread",params:{threadId:y}}),M.value!==y&&await Ee(y),$.value&&Be(!0))}function Be(h){kt.value!==h&&(kt.value=h,Zb(h))}function ct(h){if(!h.defaultPrevented){if(h.key==="Escape"&&wn.value){wn.value=!1;return}!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),Be(!kt.value))}}function gt(h){var I,se;if(!wn.value)return;const y=h.target;y instanceof Node&&((I=fo.value)!=null&&I.contains(y)||(se=gr.value)!=null&&se.contains(y)||(wn.value=!1))}function nn(h){var I,se;if(!wn.value)return;const y=h.target;y instanceof Node&&((I=fo.value)!=null&&I.contains(y)||(se=gr.value)!=null&&se.contains(y)||(wn.value=!1))}function ys(){if(!(typeof document>"u")&&$.value){if(document.visibilityState==="hidden"){Pt.value=Date.now(),Gt.value=!1;return}ho()}}function _s(h){h.persisted&&ho()}function ea(){xe.name==="home"&&(ri(),zo()),ho()}function ho(){typeof window>"u"||typeof document>"u"||!$.value||document.visibilityState!=="visible"||Gt.value||Pt.value===null||Date.now()-Pt.value<YF||(Gt.value=!0,Pt.value=null,bs())}async function bs(){if(!Ot.value){Ot.value=!0;try{await Te({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await Ru()}finally{Ot.value=!1}}}function Wo(h){const y=h.text;ta();const I=it.value,se=h.mode==="queue"&&I&&I.threadId===M.value?I.queueIndex:void 0;if(it.value=null,Rn.value){ow(y,h.imageUrls,h.skills,h.fileAttachments);return}Xe(y,h.imageUrls,h.skills,h.mode,h.fileAttachments,se)}function ws(h){const y=new Intl.NumberFormat().format(h.stars);return h.language?`${h.language} · ★ ${y}`:`★ ${y}`}function Vo(h){const I=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(h)?h:"trending-daily";st.value!==I&&(st.value=I)}function Ss(h){const y=F.value;y&&y.hydrateDraft({text:`Clone this GitHub project and run it: ${h.url}
|
|
88
|
-
Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function ni(h){const y=he.value.findIndex(Ae=>Ae.id===h),I=y>=0?he.value[y]:void 0,se=J.value;if(!I||!se||se.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;it.value=M.value?{threadId:M.value,queueIndex:y}:null;const Ie={text:I.text,imageUrls:[...I.imageUrls],fileAttachments:I.fileAttachments.map(Ae=>({...Ae})),skills:I.skills.map(Ae=>({...Ae}))};se.hydrateDraft(Ie),Ue(h)}function ta(){if(!$.value||Rn.value)return;const h=()=>{var y;(y=ce.value)==null||y.jumpToLatest()};h(),Jt(()=>{h(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{h(),window.requestAnimationFrame(h)})})}function yl(h){ot.value=h.trim(),$e.value=""}function et(h){Qt.value=h.trim()}async function Wn(h){const y=h.trim();if(!y||xe.name!=="thread"){ar.value=[],Fn.value=null;return}qt.value=!0;try{const I=await CM(y);ar.value=I.options,Fn.value=I.currentBranch}catch{ar.value=[],Fn.value=null}finally{qt.value=!1}}function mo(h){if(h==="__review__"){jn.value=!jn.value;return}if(h==="__detached_head__"||vr.value)return;const y=h.trim();if(!y||y===(Fn.value??""))return;const I=$r.value.trim();I&&(vr.value=!0,AM(I,y).then(se=>(Fn.value=se||y,jn.value=!1,Wn(I))).catch(se=>{const Ie=se instanceof Error?se.message:"Failed to switch branch";window.alert(Ie)}).finally(()=>{vr.value=!1}))}async function Tb(){const h=await Eu();if(!h)return;await zo();const y=sn.value.trim()||"New Project (1)",I=window.prompt(`Create project in ${h}`,y);if(I===null)return;const se=I.trim();if(!se)return;const Ie=xp(Ap(h,se));if(Ie)try{const Ae=await _d(Ie,{createIfMissing:!0,label:""});if(!Ae)return;ot.value=Ae,fe(Rs(Ae)),await ri(),await zo()}catch(Ae){const at=Ae instanceof Error?Ae.message:"Failed to create the project.";window.alert(at)}}async function Eb(){const h=ot.value.trim()||await Eu();h&&(er.value=!1,Dt.value=!0,be.value="",await oi(h),W.value||Jt(()=>{var y;return(y=Uo.value)==null?void 0:y.focus()}))}function na(){Pr+=1,Dt.value=!1,w.value=!1,W.value="",be.value="",ra()}async function kb(h){!h||w.value||(be.value="",await oi(h))}function Ib(){const h=S.value.trim();!Dt.value||!h||oi(h)}function Cb(){const h=S.value.trim();!Dt.value||!h||w.value||oi(h)}async function kp(h=S.value){const y=h.trim();if(y){W.value="",P.value=!0;try{const I=await _d(y,{createIfMissing:!1,label:""});if(!I){W.value="Failed to open the selected folder.";return}ot.value=I,fe(Rs(I)),await ri(),await zo(),na()}catch(I){W.value=I instanceof Error?I.message:"Failed to open the selected folder."}finally{P.value=!1}}}async function Ab(){if($e.value="",er.value){ra();return}if(!Dt.value){const h=ot.value.trim()||await Eu();if(!h||(Dt.value=!0,be.value="",await oi(h),W.value))return}W.value||(ur.value=sn.value,er.value=!0,Jt(()=>{var h;return(h=lr.value)==null?void 0:h.focus()}))}function ra(){$e.value="",ur.value="",er.value=!1}async function Ip(){const h=ur.value.trim();if(!h)return;if($e.value="",W.value){$e.value="Reload the current folder before creating a new one.";return}ye.value=!0;const y=fl.value.trim(),I=xp(Ap(y,h));if(!I){$e.value="Unable to determine where the new folder should be created.",ye.value=!1;return}if(!Js.value){$e.value="Enter a single folder name.",ye.value=!1;return}try{const se=await RM(I);if(!se){$e.value="Failed to create the folder.";return}$e.value="",be.value="",await oi(se),ra()}catch(se){$e.value=se instanceof Error?se.message:"Failed to create folder."}finally{ye.value=!1}}async function xb(){var y;if(typeof window>"u")return!1;const h=((y=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:y.trim())??"";if(!h)return!1;try{const I=await _d(h,{createIfMissing:!1,label:""});if(!I)return!1;ot.value=I,fe(Rs(I)),await R.replace({name:"home"}),await ri();const se=new URL(window.location.href);return se.searchParams.delete("openProjectPath"),window.history.replaceState({},"",se.toString()),!0}catch{return!1}}async function Eu(){const h=Cp();if(h)return h;try{const y=await hg();if(y)return Gr.value=y,y}catch{}return""}async function zo(){const h=Cp();if(!h){sn.value="New Project (1)";return}try{const y=await MM(h);sn.value=y.name||"New Project (1)"}catch{sn.value="New Project (1)"}}function Cp(){var I,se;const h=ot.value.trim();if(h)return fd(h);const y=((se=(I=zi.value[0])==null?void 0:I.value)==null?void 0:se.trim())??"";return y?fd(y):Gr.value.trim()}async function Rb(){try{Gr.value=await hg()}catch{Gr.value=""}}async function ri(){try{const h=await Ms();Xn.value={order:[...h.order],labels:{...h.labels}}}catch{Xn.value={order:[],labels:{}}}}async function oi(h){const y=++Pr;S.value=en(h).trim(),W.value="",w.value=!0;try{const I=await xM(h,{showHidden:z.value});if(y!==Pr)return;S.value=I.path,x.value=I.parentPath,L.value=I.entries}catch(I){if(y!==Pr)return;W.value=I instanceof Error?I.message:"Failed to load local folders.",x.value=fd(S.value),L.value=[],ra()}finally{y===Pr&&(w.value=!1)}}async function ku(){We.value=!0;try{Oe.value=await jM(st.value,6)}catch{Oe.value=[]}finally{We.value=!1}}function Ap(h,y){const I=en(h).trim(),se=en(y).trim().replace(/^[\\/]+/u,"");if(!I||!se)return"";const Ie=I.includes("\\")&&!I.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(I))return`${I.slice(0,2)}${Ie}${se}`;if(/^\/+$/u.test(I))return`/${se}`;const Ae=I.replace(/[\\/]+$/u,"");return Ae?`${Ae}${Ie}${se}`:""}function xp(h){const y=en(h).trim();if(!y)return"";const I=y.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(I){const[,Ie,Ae,at=""]=I,Mn=Iu(at.split(/[\\/]+/u));return Mn.length>0?`\\\\${Ie}\\${Ae}\\${Mn.join("\\")}`:`\\\\${Ie}\\${Ae}`}const se=y.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(se){const[,Ie,Ae=""]=se,at=y.includes("\\")&&!y.includes("/")?"\\":"/",Mn=Iu(Ae.split(/[\\/]+/u));return Mn.length>0?`${Ie}${at}${Mn.join(at)}`:`${Ie}${at}`}if(y.startsWith("/")){const Ie=Iu(y.split("/"));return Ie.length>0?`/${Ie.join("/")}`:"/"}return y}function Iu(h){const y=[];for(const I of h){const se=I.trim();if(!(!se||se===".")){if(se===".."){y.length>0&&y.pop();continue}y.push(se)}}return y}function Rp(h){k(h)}function Mp(h){q(h)}function Pp(h){te(h)}function Mb(){Se()}function Pb(h){const y=h.turnId.trim();if(y.length>0){const I=[...gs.value].reverse().find(se=>{var Ie;return se.role==="user"&&(((Ie=se.turnId)==null?void 0:Ie.trim())??"")===y&&se.text.trim().length>0});I!=null&&I.text&&J.value&&J.value.appendTextToDraft(I.text)}we(h.turnId)}function $b(){if(Rn.value||qo.value||typeof document>"u"||!f.value||gs.value.length===0)return;const h=Nb(),y=Ob(),I=new Blob([h],{type:"text/markdown;charset=utf-8"}),se=URL.createObjectURL(I),Ie=document.createElement("a");Ie.href=se,Ie.download=y,document.body.appendChild(Ie),Ie.click(),document.body.removeChild(Ie),window.setTimeout(()=>URL.revokeObjectURL(se),0)}function Nb(){var I,se,Ie;const h=[],y=((se=(I=f.value)==null?void 0:I.title)==null?void 0:se.trim())||"Untitled thread";h.push(`# ${Lb(y)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((Ie=f.value)==null?void 0:Ie.id)??""}`),h.push(""),h.push("---"),h.push("");for(const Ae of gs.value){const at=Ae.role?Ae.role.toUpperCase():"MESSAGE";h.push(`## ${at}`),h.push("");const Mn=Ae.text.trim();if(Mn&&(h.push(Mn),h.push("")),Ae.commandExecution&&(h.push("```text"),h.push(`command: ${Ae.commandExecution.command}`),h.push(`status: ${Ae.commandExecution.status}`),Ae.commandExecution.cwd&&h.push(`cwd: ${Ae.commandExecution.cwd}`),Ae.commandExecution.exitCode!==null&&h.push(`exitCode: ${Ae.commandExecution.exitCode}`),h.push(Ae.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),Ae.fileAttachments&&Ae.fileAttachments.length>0){h.push("Attachments:");for(const eo of Ae.fileAttachments)h.push(`- ${eo.path}`);h.push("")}if(Ae.images&&Ae.images.length>0){h.push("Images:");for(const eo of Ae.images)h.push(`- ${eo}`);h.push("")}}return`${h.join(`
|
|
89
|
-
`).trimEnd()}
|
|
90
|
-
`}function Ob(){var Ie,Ae;const I=(((Ae=(Ie=f.value)==null?void 0:Ie.title)==null?void 0:Ae.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",se=new Date().toISOString().replace(/[:.]/g,"-");return`${I}-${se}.md`}function Lb(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function _l(h,y){if(typeof window>"u")return y;const I=window.localStorage.getItem(h);return I===null?y:I==="1"}function Db(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(Lg);return h==="light"||h==="dark"?h:"system"}function jb(){return typeof window>"u"?"steer":window.localStorage.getItem(Og)==="queue"?"queue":"steer"}function Fb(){if(typeof window>"u")return"standard";const h=window.localStorage.getItem(Ug);return h==="standard"||h==="wide"||h==="extra-wide"?h:"standard"}function Bb(){Bn.value=!Bn.value,window.localStorage.setItem(Ng,Bn.value?"1":"0")}function Ub(){xn.value=xn.value==="steer"?"queue":"steer",window.localStorage.setItem(Og,xn.value)}function qb(){const h=["system","light","dark"],y=h.indexOf(yt.value);yt.value=h[(y+1)%h.length],window.localStorage.setItem(Lg,yt.value),bl()}function Hb(){const h=["standard","wide","extra-wide"],y=h.indexOf(St.value);St.value=h[(y+1)%h.length],window.localStorage.setItem(Ug,St.value)}function Wb(){yr.value=!yr.value,window.localStorage.setItem(Dg,yr.value?"1":"0")}function Vb(){Un.value=!Un.value,window.localStorage.setItem(jg,Un.value?"1":"0")}function zb(){vn.value=!vn.value,window.localStorage.setItem(Bg,vn.value?"1":"0")}async function Gb(h){if(!Kr.value){Kr.value=!0;try{if(h==="codex"){Tn.value="codex";const y=await fg(!1);Qn.value=y.enabled}else if(h==="openrouter"){Tn.value="openrouter";const y=await fg(!0);Qn.value=y.enabled}else h==="custom"&&(Tn.value="custom");await Te({includeSelectedThreadMessages:!1})}catch{}finally{Kr.value=!1}}}async function Cu(){if(Wt.value)return;const h=_r.value.trim();if(h){Wt.value=!0;try{await wM(h,Hn.value.trim()),Qn.value=!0,await Te({includeSelectedThreadMessages:!1})}catch{}finally{Wt.value=!1}}}async function $p(){if(!Wt.value){Wt.value=!0;try{const h=Zn.value.trim();await pg(h),Zn.value="",await Au(),await Te({includeSelectedThreadMessages:!1})}catch{}finally{Wt.value=!1}}}async function Kb(){if(!Wt.value){Wt.value=!0;try{await pg(""),Zn.value="",await Au(),await Te({includeSelectedThreadMessages:!1})}catch{}finally{Wt.value=!1}}}async function Au(){try{const h=await bM();Qn.value=h.enabled,Yr.value=h.customKey??!1,qn.value=h.maskedKey??null,h.enabled?h.provider==="custom"?(Tn.value="custom",_r.value=h.customBaseUrl??""):Tn.value="openrouter":Tn.value="codex"}catch{}}function Yb(h){const I=xu(h.trim())||"auto";cr.value=I,window.localStorage.setItem(Fg,I)}function Jb(){var I;if(typeof window>"u")return"auto";const h=((I=window.localStorage.getItem(Fg))==null?void 0:I.trim())||"auto";return xu(h)||"auto"}function Xb(){const h=[{value:"auto",label:"Auto-detect"}],y=new Set(["auto"]);function I(Ie){const Ae=l[Ie]||Ie;return`${Ae.charAt(0).toUpperCase()+Ae.slice(1)} (${Ie})`}for(const Ie of typeof navigator<"u"?navigator.languages??[]:[]){const Ae=xu(Ie);!Ae||y.has(Ae)||(y.add(Ae),h.push({value:Ae,label:`Preferred: ${I(Ae)}`}))}for(const Ie of Object.keys(l))y.has(Ie)||(y.add(Ie),h.push({value:Ie,label:I(Ie)}));const se=cr.value.trim();return se&&!y.has(se)&&h.push({value:se,label:I(se)}),h}function xu(h){const y=h.trim().toLowerCase();if(!y||y==="auto")return"";if(y in l)return y;const I=y.split("-")[0]??y;return I in l?I:""}function bl(){const h=document.documentElement;if(yt.value==="dark")h.classList.add("dark");else if(yt.value==="light")h.classList.remove("dark");else{const y=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",y)}}function Qb(){return typeof window>"u"?!1:window.localStorage.getItem(Pg)==="1"}function Zb(h){typeof window>"u"||window.localStorage.setItem(Pg,h?"1":"0")}function ew(){if(typeof window>"u")return!0;const h=window.localStorage.getItem($g);return h===null?!0:h==="1"}function tw(){hn.value=!hn.value,!(typeof window>"u")&&window.localStorage.setItem($g,hn.value?"1":"0")}function nw(h,y){const I=(h??"").trim();return I.length>0?I:y.trim()||"message"}function Np(h){T(h)}async function rw(){await R.isReady(),xe.name==="thread"&&po.value&&ke(po.value),ne(),await Te({includeSelectedThreadMessages:!0}),ti({silent:!0}),await xb(),on.value=!0,await Ru()}async function Ru(){if($t.value){_t=!0;return}$t.value=!0;try{do{if(_t=!1,xe.name==="home"||xe.name==="skills"){M.value!==""&&await Ee("");continue}if(xe.name==="thread"){const h=po.value;if(!h)continue;if(!al.value.has(h)){await R.replace({name:"home"});continue}M.value!==h?await Ee(h):Fe(h,{silent:!0})}}while(_t)}finally{$t.value=!1}}ut(()=>[xe.name,po.value,De.value,al.value.has(po.value),M.value],async()=>{on.value&&await Ru()}),ut(()=>M.value,async h=>{if(on.value&&!$t.value&&!(Rn.value||qo.value)){if(!h){xe.name!=="home"&&await R.replace({name:"home"});return}xe.name==="thread"&&po.value===h||await R.replace({name:"thread",params:{threadId:h}})}}),ut(()=>st.value,()=>{vn.value&&ku()}),ut(()=>vn.value,h=>{if(!h){Oe.value=[];return}ku()}),ut(()=>[on.value,xe.name,M.value],([h,y,I])=>{h&&y==="thread"&&I&&Fe(I,{silent:!0})}),ut(()=>zi.value,h=>{if(h.length===0){ot.value="";return}h.some(I=>I.value===ot.value)||(ot.value=h[0].value),zo()},{immediate:!0}),ut(()=>ot.value,()=>{zt.value={phase:"idle",title:"",message:""},zo()}),ut(()=>[fn.value,ot.value],([h,y])=>{h==="worktree"&&Op(y)},{immediate:!0}),ut(()=>fn.value,h=>{var y;if(h==="local"){zt.value={phase:"idle",title:"",message:""};const I=ot.value.trim();if(I&&Qi(I)){const se=((y=f.value)==null?void 0:y.projectName)??Rs(I),Ie=Zi(se,"");Ie&&(ot.value=Ie)}return}Op(ot.value)}),ut(()=>xe.name,h=>{h!=="home"&&(zt.value={phase:"idle",title:"",message:""}),h!=="thread"&&(jn.value=!1)}),ut(()=>M.value,()=>{zt.value={phase:"idle",title:"",message:""}}),ut(()=>[xe.name,$r.value],([h,y])=>{if(h!=="thread"){ar.value=[],Fn.value=null;return}Wn(y)},{immediate:!0}),ut(zc,h=>{typeof document>"u"||(document.title=h)},{immediate:!0}),ut($,h=>{h&&!kt.value&&Be(!0)});async function ow(h,y=[],I=[],se=[]){try{zt.value={phase:"idle",title:"",message:""};let Ie=ot.value;if(fn.value==="worktree"){zt.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const at=await kM(ot.value,Qt.value);Ie=at.cwd,ot.value=at.cwd,zt.value={phase:"idle",title:"",message:""}}catch{zt.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ae=await Y(h,Ie,y,I,se);if(!Ae)return;await R.replace({name:"thread",params:{threadId:Ae}}),ta()}catch{}}async function Op(h){var I;const y=h.trim();if(!y){mr.value=[],Qt.value="";return}ir.value=!0;try{const se=await IM(y);mr.value=se;const Ie=Qt.value.trim();if(!(Ie.length>0&&se.some(at=>at.value===Ie))){const at=se.find(Mn=>Mn.value.trim()==="main");Qt.value=(at==null?void 0:at.value)??((I=se[0])==null?void 0:I.value)??""}}catch{mr.value=[],Qt.value=""}finally{ir.value=!1}}return(h,y)=>(A(),ht(vR,{"is-sidebar-collapsed":kt.value,onCloseSidebar:y[19]||(y[19]=I=>Be(!0))},{sidebar:Ct(()=>[_("section",ZD,[_("div",ej,[kt.value?ge("",!0):(A(),ht(Sg,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":kt.value,"show-new-thread-button":!0,onToggleSidebar:y[0]||(y[0]=I=>Be(!kt.value)),onStartNewThread:p},{default:Ct(()=>[_("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Ut.value,"aria-label":"Search threads",title:"Search threads",onClick:cu},[ze(Tg,{class:"sidebar-search-toggle-icon"})],8,tj)]),_:1},8,["is-sidebar-collapsed"])),!kt.value&&Ut.value?(A(),D("div",nj,[ze(Tg,{class:"sidebar-search-bar-icon"}),Kn(_("input",{ref_key:"sidebarSearchInputRef",ref:uo,"onUpdate:modelValue":y[1]||(y[1]=I=>pn.value=I),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:hl},null,544),[[rr,pn.value]]),pn.value.length>0?(A(),D("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:uu},[ze(vD,{class:"sidebar-search-clear-icon"})])):ge("",!0)])):ge("",!0),kt.value?ge("",!0):(A(),D("button",{key:2,class:pt(["sidebar-skills-link",{"is-active":qo.value}]),type:"button",onClick:y[2]||(y[2]=I=>{He(R).push({name:"skills"}),He($)&&Be(!0)})}," Skills Hub ",2)),kt.value?ge("",!0):(A(),ht(O$,{key:3,groups:He(u),"project-display-name-by-id":He(d),"selected-thread-id":He(M),"is-loading":He(De),"search-query":pn.value,"search-matched-thread-ids":zr.value,onSelect:du,onArchive:wu,onStartNewThread:Tu,onRenameProject:g,onBrowseThreadFiles:c,onRenameThread:b,onForkThread:Su,onRemoveProject:j,onReorderProject:B,onExportThread:fu},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),kt.value?ge("",!0):(A(),D("div",{key:0,ref_key:"settingsAreaRef",ref:ms,class:"sidebar-settings-area",onClick:nn},[ze(ey,{name:"settings-panel"},{default:Ct(()=>[wn.value?(A(),D("div",{key:0,ref_key:"settingsPanelRef",ref:fo,class:"sidebar-settings-panel",onClick:y[10]||(y[10]=ft(()=>{},["stop"]))},[_("div",rj,[_("div",oj,[_("div",sj,[_("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!hn.value,title:hn.value?"Expand accounts":"Collapse accounts",onClick:tw},[_("span",aj,ue(hn.value?"▸":"▾"),1)],8,ij),y[20]||(y[20]=_("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),_("span",lj,ue(mn.value.length),1)]),_("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:Ht.value||It.value,onClick:bu},ue(Ht.value?"Reloading…":"Reload"),9,cj)]),hn.value?ge("",!0):(A(),D(Qe,{key:0},[gn.value?(A(),D("p",uj,ue(gn.value),1)):ge("",!0),mn.value.length===0?(A(),D("p",dj," Run `codex login`, then click reload. ")):(A(),D("div",fj,[(A(!0),D(Qe,null,Bt(mn.value,I=>(A(),D("article",{key:I.accountId,class:pt(["sidebar-settings-account-item",{"is-active":I.isActive,"is-unavailable":Zr(I),"is-confirming-remove":Qs(I),"is-remove-visible":ml(I)}]),title:Nr(I),onMouseenter:se=>gu(I.accountId),onMouseleave:se=>vu(I.accountId)},[_("div",hj,[_("p",mj,ue(I.email||"Account"),1),_("p",gj,ue(Ji(I)),1),_("p",vj,ue(ei(I)),1),_("p",yj," Workspace "+ue(pu(I.accountId)),1)]),_("div",_j,[_("button",{class:"sidebar-settings-account-switch",type:"button",disabled:Xi(I)||I.isActive||Zr(I),onClick:se=>gl(I.accountId)},ue(Zs(I)),9,bj),_("button",{class:pt(["sidebar-settings-account-remove",{"is-visible":ml(I),"is-confirming":Qs(I)}]),type:"button",disabled:Xi(I),onClick:se=>vl(I.accountId)},ue(mu(I)),11,wj)])],42,pj))),128))]))],64))]),_("button",{class:"sidebar-settings-row",type:"button",title:i.sendWithEnter,onClick:Bb},[y[21]||(y[21]=_("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),_("span",{class:pt(["sidebar-settings-toggle",{"is-on":!Bn.value}])},null,2)],8,Sj),_("button",{class:"sidebar-settings-row",type:"button",title:i.inProgressSendMode,onClick:Ub},[y[22]||(y[22]=_("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),_("span",Ej,ue(xn.value==="steer"?"Steer":"Queue"),1)],8,Tj),_("button",{class:"sidebar-settings-row",type:"button",title:i.appearance,onClick:qb},[y[23]||(y[23]=_("span",{class:"sidebar-settings-label"},"Appearance",-1)),_("span",Ij,ue(yt.value==="system"?"System":yt.value==="dark"?"Dark":"Light"),1)],8,kj),_("button",{class:"sidebar-settings-row",type:"button",title:i.chatWidth,onClick:Hb},[y[24]||(y[24]=_("span",{class:"sidebar-settings-label"},"Chat width",-1)),_("span",Aj,ue(su.value),1)],8,Cj),_("button",{class:"sidebar-settings-row",type:"button",title:i.dictationClickToToggle,onClick:Wb},[y[25]||(y[25]=_("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),_("span",{class:pt(["sidebar-settings-toggle",{"is-on":yr.value}])},null,2)],8,xj),_("button",{class:"sidebar-settings-row",type:"button",title:i.dictationAutoSend,onClick:Vb},[y[26]||(y[26]=_("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),_("span",{class:pt(["sidebar-settings-toggle",{"is-on":Un.value}])},null,2)],8,Rj),_("button",{class:"sidebar-settings-row",type:"button",title:i.githubTrendingProjects,onClick:zb},[y[27]||(y[27]=_("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),_("span",{class:pt(["sidebar-settings-toggle",{"is-on":vn.value}])},null,2)],8,Mj),_("div",Pj,[y[29]||(y[29]=_("span",{class:"sidebar-settings-label"},"Provider",-1)),_("select",{class:"sidebar-settings-provider-select",value:Tn.value,disabled:Kr.value,onChange:y[3]||(y[3]=I=>Gb(I.target.value))},[...y[28]||(y[28]=[_("option",{value:"codex"},"Codex",-1),_("option",{value:"openrouter"},"OpenRouter",-1),_("option",{value:"custom"},"Custom endpoint",-1)])],40,$j)]),Tn.value==="openrouter"?(A(),D("div",Nj,[y[30]||(y[30]=_("div",{class:"sidebar-settings-provider-info"},[_("span",{class:"sidebar-settings-label"},"OpenRouter API key"),_("a",{class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},"Get API key")],-1)),_("div",Oj,[Yr.value&&!Zn.value?(A(),D(Qe,{key:0},[_("span",Lj,ue(qn.value),1),_("button",{class:"sidebar-settings-key-clear",type:"button",disabled:Wt.value,title:"Remove custom key, use community keys",onClick:Kb},"✕",8,Dj)],64)):(A(),D(Qe,{key:1},[Kn(_("input",{"onUpdate:modelValue":y[4]||(y[4]=I=>Zn.value=I),class:"sidebar-settings-key-input",type:"password",placeholder:"sk-or-v1-... (optional, uses free keys if empty)",onKeydown:Zt($p,["enter"])},null,544),[[rr,Zn.value]]),_("button",{class:"sidebar-settings-key-save",type:"button",disabled:Wt.value||!Zn.value.trim(),onClick:$p},ue(Wt.value?"...":"Set"),9,jj)],64))])])):ge("",!0),Tn.value==="custom"?(A(),D("div",Fj,[y[31]||(y[31]=_("span",{class:"sidebar-settings-label"},"Custom endpoint URL",-1)),_("div",Bj,[Kn(_("input",{"onUpdate:modelValue":y[5]||(y[5]=I=>_r.value=I),class:"sidebar-settings-key-input",type:"url",placeholder:"https://api.example.com/v1",onKeydown:Zt(Cu,["enter"])},null,544),[[rr,_r.value]])]),y[32]||(y[32]=_("span",{class:"sidebar-settings-label",style:{"margin-top":"4px"}},"API key",-1)),_("div",Uj,[Kn(_("input",{"onUpdate:modelValue":y[6]||(y[6]=I=>Hn.value=I),class:"sidebar-settings-key-input",type:"password",placeholder:"Bearer token (optional)",onKeydown:Zt(Cu,["enter"])},null,544),[[rr,Hn.value]]),_("button",{class:"sidebar-settings-key-save",type:"button",disabled:Wt.value||!_r.value.trim(),onClick:Cu},ue(Wt.value?"...":"Save"),9,qj)])])):ge("",!0),_("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:i.dictationLanguage},[y[33]||(y[33]=_("span",{class:"sidebar-settings-label"},"Dictation language",-1)),ze(Os,{class:"sidebar-settings-language-dropdown","model-value":cr.value,options:Bo.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Yb},null,8,["model-value","options"])],8,Hj),_("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:y[7]||(y[7]=I=>an.value=!an.value)},[y[34]||(y[34]=_("span",{class:"sidebar-settings-label"},"Telegram",-1)),_("span",Wj,ue(vs.value),1)]),an.value?(A(),D("div",Vj,[_("label",zj,[y[35]||(y[35]=_("span",{class:"sidebar-settings-field-label"},"Bot token",-1)),Kn(_("input",{"onUpdate:modelValue":y[8]||(y[8]=I=>Mr.value=I),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[rr,Mr.value]])]),_("label",Gj,[y[36]||(y[36]=_("span",{class:"sidebar-settings-field-label"},"Allowed Telegram user IDs",-1)),Kn(_("textarea",{"onUpdate:modelValue":y[9]||(y[9]=I=>br.value=I),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
|
|
91
|
-
987654321`,spellcheck:"false"},null,512),[[rr,br.value]])]),y[37]||(y[37]=_("div",{class:"sidebar-settings-field-help"}," Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here. ",-1)),yn.value?(A(),D("div",Kj,ue(yn.value),1)):ge("",!0),_("div",Yj,[_("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:Jr.value,onClick:lu},ue(Jr.value?"Saving…":"Save Telegram config"),9,Jj)])])):ge("",!0),Kc.value?(A(),D("div",{key:3,class:"sidebar-settings-row sidebar-settings-context-row","data-state":ul.value,title:Qc.value},[y[38]||(y[38]=_("span",{class:"sidebar-settings-label"},"Context",-1)),_("span",{class:"sidebar-settings-context-value","data-state":ul.value},[Fs(ue(Jc.value)+" ",1),_("span",Zj,ue(Xc.value),1)],8,Qj)],8,Xj)):ge("",!0),_("div",eF,[ze(WL,{snapshots:He(Pe)},null,8,["snapshots"])]),_("div",tF," WT "+ue(He(o))+" · v"+ue(He(s)),1)],512)):ge("",!0)]),_:1}),_("button",{ref_key:"settingsButtonRef",ref:gr,class:"sidebar-settings-button",type:"button",onClick:y[11]||(y[11]=ft(I=>wn.value=!wn.value,["stop"]))},[ze(pD,{class:"sidebar-settings-icon"}),y[39]||(y[39]=_("span",null,"Settings",-1)),_("span",nF,ue(He(o))+" · v"+ue(He(s)),1)],512)],512))])]),content:Ct(()=>[_("section",{class:"content-root",style:ko(iu.value)},[ze(U$,{title:ll.value},{leading:Ct(()=>[kt.value||He($)?(A(),ht(Sg,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":kt.value,"show-new-thread-button":!0,onToggleSidebar:y[12]||(y[12]=I=>Be(!kt.value)),onStartNewThread:p},null,8,["is-sidebar-collapsed"])):ge("",!0)]),actions:Ct(()=>[He(xe).name==="thread"&&He(M)?(A(),ht(Os,{key:0,class:pt(["content-header-branch-dropdown",{"is-review-open":jn.value}]),"model-value":Zc.value,options:eu.value,disabled:qt.value||vr.value,"enable-search":!0,"search-placeholder":"Search branches...","onUpdate:modelValue":mo},null,8,["class","model-value","options","disabled"])):ge("",!0)]),_:1},8,["title"]),_("section",rF,[qo.value?(A(),ht(He(r),{key:0,onSkillsChanged:Qr})):Rn.value?(A(),D("div",oF,[_("div",sF,[y[46]||(y[46]=_("p",{class:"new-thread-hero"},"Let's build",-1)),ze(Os,{class:"new-thread-folder-dropdown","model-value":ot.value,options:zi.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project",disabled:!1,"onUpdate:modelValue":yl},null,8,["model-value","options"]),ot.value?(A(),D("p",{key:0,class:"new-thread-folder-selected",title:ot.value}," Selected folder: "+ue(ot.value),9,iF)):ge("",!0),_("div",{class:"new-thread-folder-actions"},[_("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Eb}," Select folder "),_("button",{class:"new-thread-folder-action",type:"button",onClick:Tb}," Create Project ")]),(A(),ht(ma,{to:"body"},[Dt.value?(A(),D("div",{key:0,class:"new-thread-open-folder-overlay",onClick:ft(na,["self"])},[_("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":"Select folder",onKeydown:Zt(ft(na,["prevent"]),["esc"])},[_("div",{class:"new-thread-open-folder-header"},[y[40]||(y[40]=_("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),_("button",{class:"new-thread-open-folder-close",type:"button",onClick:na}," Cancel ")]),y[42]||(y[42]=_("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),_("div",lF,[_("p",{class:"new-thread-open-folder-path",title:S.value||"Unavailable"},ue(S.value||"Unavailable"),9,cF),_("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!S.value||!!W.value||w.value||P.value,onClick:y[13]||(y[13]=I=>kp())},ue(P.value?"Opening…":"Open"),9,uF)]),_("div",dF,[_("label",fF,[Kn(_("input",{"onUpdate:modelValue":y[14]||(y[14]=I=>z.value=I),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:Ib},null,544),[[AT,z.value]]),y[41]||(y[41]=_("span",null,"Show hidden folders",-1))]),_("button",{class:pt(["new-thread-folder-action",{"new-thread-folder-action-primary":er.value}]),type:"button","aria-pressed":er.value,disabled:!S.value||w.value||P.value||ye.value||!!W.value&&!er.value,onClick:Ab}," New folder ",10,pF)]),er.value?(A(),D("div",hF,[_("div",mF,[Kn(_("input",{ref_key:"createFolderInputRef",ref:lr,"onUpdate:modelValue":y[15]||(y[15]=I=>ur.value=I),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[Zt(ft(Ip,["prevent"]),["enter"]),Zt(ft(ra,["prevent"]),["esc"])]},null,40,gF),[[rr,ur.value]]),_("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!tu.value||ye.value,onClick:Ip},ue(nu.value),9,vF)]),$e.value?(A(),D("p",yF,ue($e.value),1)):ge("",!0)])):ge("",!0),Kn(_("input",{ref_key:"existingFolderFilterInputRef",ref:Uo,"onUpdate:modelValue":y[16]||(y[16]=I=>be.value=I),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders...",onKeydown:Zt(ft(na,["prevent"]),["esc"])},null,40,_F),[[rr,be.value]]),W.value?(A(),D("div",bF,[_("p",wF,ue(W.value),1),_("button",{class:"new-thread-folder-action",type:"button",disabled:w.value||P.value,onClick:Cb}," Retry ",8,SF)])):ge("",!0),w.value?(A(),D("p",TF,"Loading folders…")):!W.value&&Ki.value.length===0?(A(),D("p",EF,ue(be.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Ki.value.length>0?(A(),D("ul",kF,[(A(!0),D(Qe,null,Bt(Ki.value,I=>(A(),D("li",{key:I.key,class:"new-thread-open-folder-item"},[_("button",{class:"new-thread-open-folder-item-main",type:"button",title:I.path,disabled:w.value||P.value,onClick:se=>kb(I.path)},[_("span",CF,ue(I.name),1)],8,IF),I.kind==="directory"?(A(),D("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:w.value||P.value,onClick:se=>kp(I.path)}," Open ",8,AF)):ge("",!0)]))),128))])):ge("",!0)],40,aF)])):ge("",!0)])),ze(YL,{class:"new-thread-runtime-dropdown",modelValue:fn.value,"onUpdate:modelValue":y[17]||(y[17]=I=>fn.value=I)},null,8,["modelValue"]),fn.value==="worktree"?(A(),D("div",xF,[y[43]||(y[43]=_("p",{class:"new-thread-branch-select-label"},"Base branch",-1)),ze(Os,{class:"new-thread-branch-dropdown","model-value":Qt.value,options:Gi.value,placeholder:"Select branch","enable-search":!0,"search-placeholder":"Search branches...",disabled:ir.value||Gi.value.length===0,"onUpdate:modelValue":et},null,8,["model-value","options","disabled"]),_("p",RF,ue(ir.value?"Loading branches…":dl.value?`New worktree branch will start from ${dl.value}.`:"No Git branches found for this folder."),1)])):ge("",!0),y[47]||(y[47]=_("p",{class:"new-thread-runtime-help"},[_("code",null,"Local project"),Fs(" uses the selected folder directly. "),_("code",null,"New worktree"),Fs(" creates an isolated Git worktree before the first prompt. ")],-1)),zt.value.phase!=="idle"?(A(),D("div",{key:2,class:pt(["worktree-init-status",{"is-running":zt.value.phase==="running","is-error":zt.value.phase==="error"}])},[_("strong",MF,ue(zt.value.title),1),_("span",PF,ue(zt.value.message),1)],2)):ge("",!0),vn.value?(A(),D("div",$F,[_("div",NF,[y[44]||(y[44]=_("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),ze(Os,{class:"new-thread-trending-scope-dropdown","model-value":st.value,options:ou.value,"onUpdate:modelValue":Vo},null,8,["model-value","options"])]),We.value?(A(),D("p",OF,"Loading trending projects...")):Oe.value.length===0?(A(),D("p",LF," Trending repos are unavailable right now. ")):(A(),D("div",DF,[(A(!0),D(Qe,null,Bt(Oe.value,I=>(A(),D("button",{key:I.id,type:"button",class:"new-thread-trending-tip",onClick:se=>Ss(I)},[_("span",{class:"new-thread-trending-tip-name",title:I.fullName},[I.owner&&I.repo?(A(),D(Qe,{key:0},[_("span",BF,ue(I.owner),1),y[45]||(y[45]=_("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),_("span",UF,ue(I.repo),1)],64)):(A(),D("span",qF,ue(I.fullName),1))],8,FF),_("span",HF,ue(ws(I)),1),_("span",WF,ue(I.description||"No description available."),1)],8,jF))),128))]))])):ge("",!0)]),_("div",VF,[ze(wg,{ref_key:"homeThreadComposerRef",ref:F,"active-thread-id":Hi.value,cwd:$r.value,"collaboration-modes":He(O),"selected-collaboration-mode":He(K),models:He(V),"selected-model":He(de),"selected-reasoning-effort":He(oe),"selected-speed-mode":He(ee),"is-updating-speed-mode":He(_e),skills:He(ve),"thread-token-usage":He(m),"codex-quota":He(H),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":Bn.value,"in-progress-submit-mode":xn.value,"dictation-click-to-toggle":yr.value,"dictation-auto-send":Un.value,"dictation-language":cr.value,onSubmit:Wo,"onUpdate:selectedCollaborationMode":Np,"onUpdate:selectedModel":Rp,"onUpdate:selectedReasoningEffort":Mp,"onUpdate:selectedSpeedMode":Pp},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(A(),D("div",zF,[jn.value&&He(M)&&$r.value?(A(),ht(He(n),{key:0,"thread-id":He(M),cwd:$r.value,"is-thread-in-progress":Wi.value,onClose:y[18]||(y[18]=I=>jn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(A(),D(Qe,{key:1},[_("div",GF,[ze(He(t),{ref_key:"threadConversationRef",ref:ce,messages:gs.value,"is-loading":He(Q),"active-thread-id":Hi.value,cwd:$r.value,"scroll-state":He(v),"live-overlay":Gc.value,"pending-requests":He(E),onUpdateScrollState:U,onForkThread:je,onRollback:Pb,onRespondServerRequest:G},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),_("div",KF,[ze(OL,{messages:He(he),onEdit:ni,onSteer:He(Ze),onDelete:He(Ue)},null,8,["messages","onSteer","onDelete"]),cl.value?(A(),ht(IL,{key:0,request:cl.value,"request-count":He(E).length,"has-queue-above":He(he).length>0,onRespondServerRequest:G},null,8,["request","request-count","has-queue-above"])):(A(),ht(wg,{key:1,ref_key:"threadComposerRef",ref:J,"active-thread-id":Hi.value,cwd:$r.value,"collaboration-modes":He(O),"selected-collaboration-mode":He(K),models:He(V),"selected-model":He(de),"selected-reasoning-effort":He(oe),"selected-speed-mode":He(ee),"is-updating-speed-mode":He(_e),skills:He(ve),"thread-token-usage":He(m),"codex-quota":He(H),"is-turn-in-progress":Wi.value,"is-stop-pending":He(qe),"is-interrupting-turn":He(Me),"has-queue-above":He(he).length>0,"send-with-enter":Bn.value,"in-progress-submit-mode":xn.value,"dictation-click-to-toggle":yr.value,"dictation-auto-send":Un.value,"dictation-language":cr.value,"onUpdate:selectedCollaborationMode":Np,onSubmit:Wo,"onUpdate:selectedModel":Rp,"onUpdate:selectedReasoningEffort":Mp,"onUpdate:selectedSpeedMode":Pp,onInterrupt:Mb},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","is-turn-in-progress","is-stop-pending","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"]))])],64))]))])],4)]),_:1},8,["is-sidebar-collapsed"]))}}),XF=Et(JF,[["__scopeId","data-v-8f736898"]]),Rd={render:()=>null},wb=cR({history:U1(),routes:[{path:"/",name:"home",component:Rd},{path:"/thread/:threadId",name:"thread",component:Rd},{path:"/skills",name:"skills",component:Rd},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. npm: https://www.npmjs.com/package/@nervmor/codexui");const Sb=NT(XF);async function QF(){{ZF();return}}function ZF(e){Xx({app:Sb,dsn:"https://9b1c6357d134c512f8171518ec2cb18e@o4511194738982912.ingest.us.sentry.io/4511201728200704",release:"codexui@0.1.83",environment:"production",integrations:[e1({router:wb})],tracesSampleRate:.05,sendDefaultPii:!0,beforeSendTransaction(t){const n=t.transaction??"";return n.includes("/health")||n.includes("/favicon")||n.match(/\.(js|css|map|png|svg|ico|woff2?)$/)?null:t}})}QF();Sb.use(wb).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{sM as A,Kn as B,e2 as C,n2 as D,o2 as E,Qe as F,s2 as G,t2 as H,Xl as I,r2 as J,Ep as K,ma as L,XM as M,Tg as N,rr as O,Zt as P,ey as T,Et as _,_ as a,ds as b,D as c,In as d,Vs as e,ge as f,Bt as g,pt as h,ht as i,Ct as j,Bf as k,ko as l,ze as m,Jt as n,A as o,G$ as p,vD as q,N as r,ft as s,ue as t,_p as u,He as v,ut as w,Fs as x,ie as y,ad as z};
|
|
92
|
-
//# sourceMappingURL=index-BEf3759i.js.map
|