webmux 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,49 @@
1
- var Jl=Object.defineProperty;var lo=t=>{throw TypeError(t)};var Zl=(t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var qt=(t,e,i)=>Zl(t,typeof e!="symbol"?e+"":e,i),As=(t,e,i)=>e.has(t)||lo("Cannot "+i);var G=(t,e,i)=>(As(t,e,"read from private field"),i?i.call(t):e.get(t)),we=(t,e,i)=>e.has(t)?lo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),De=(t,e,i,r)=>(As(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),ze=(t,e,i)=>(As(t,e,"access private method"),i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))r(S);new MutationObserver(S=>{for(const E of S)if(E.type==="childList")for(const C of E.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&r(C)}).observe(document,{childList:!0,subtree:!0});function i(S){const E={};return S.integrity&&(E.integrity=S.integrity),S.referrerPolicy&&(E.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?E.credentials="include":S.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function r(S){if(S.ep)return;S.ep=!0;const E=i(S);fetch(S.href,E)}})();const Ql="5";var qo;typeof window<"u"&&((qo=window.__svelte??(window.__svelte={})).v??(qo.v=new Set)).add(Ql);const ec=1,tc=2,Xo=4,rc=8,ic=16,sc=1,nc=4,oc=8,ac=16,lc=1,cc=2,lt=Symbol(),Yo="http://www.w3.org/1999/xhtml",hc="http://www.w3.org/2000/svg",uc="http://www.w3.org/1998/Math/MathML",dc="@attach",fc=!1;var _n=Array.isArray,_c=Array.prototype.indexOf,pi=Array.prototype.includes,fs=Array.from,vc=Object.defineProperty,li=Object.getOwnPropertyDescriptor,Jo=Object.getOwnPropertyDescriptors,pc=Object.prototype,gc=Array.prototype,vn=Object.getPrototypeOf,co=Object.isExtensible;const mc=()=>{};function bc(t){for(var e=0;e<t.length;e++)t[e]()}function Zo(){var t,e,i=new Promise((r,S)=>{t=r,e=S});return{promise:i,resolve:t,reject:e}}const ct=2,gi=4,_s=8,pn=1<<24,kr=16,Zt=32,Zr=64,Vs=128,jt=512,nt=1024,dt=2048,ur=4096,Tt=8192,Nt=16384,ii=32768,qs=1<<25,Qr=65536,$s=1<<17,Sc=1<<18,yi=1<<19,wc=1<<20,lr=1<<25,ei=65536,Gs=1<<21,vs=1<<22,Ir=1<<23,yr=Symbol("$state"),yc=Symbol("legacy props"),Cc=Symbol(""),pr=new class extends Error{constructor(){super(...arguments);qt(this,"name","StaleReactionError");qt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var $o;const gn=!!(($o=globalThis.document)!=null&&$o.contentType)&&globalThis.document.contentType.includes("xml");function Qo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ec(t,e,i){throw new Error("https://svelte.dev/e/each_key_duplicate")}function kc(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Lc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Dc(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Tc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rc(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ac(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Bc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Mc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Oc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Pc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ic(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ea(t){return t===this.v}function ta(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function ra(t){return!ta(t,this.v)}let Hc=!1,xt=null;function mi(t){xt=t}function qe(t,e=!1,i){xt={p:xt,i:!1,c:null,e:null,s:t,x:null,r:Te,l:null}}function $e(t){var e=xt,i=e.e;if(i!==null){e.e=null;for(var r of i)ka(r)}return t!==void 0&&(e.x=t),e.i=!0,xt=e.p,t??{}}function ia(){return!0}let zr=[];function sa(){var t=zr;zr=[],bc(t)}function Cr(t){if(zr.length===0&&!Ti){var e=zr;queueMicrotask(()=>{e===zr&&sa()})}zr.push(t)}function Nc(){for(;zr.length>0;)sa()}function na(t){var e=Te;if(e===null)return Le.f|=Ir,t;if((e.f&ii)===0&&(e.f&gi)===0)throw t;Pr(t,e)}function Pr(t,e){for(;e!==null;){if((e.f&Vs)!==0){if((e.f&ii)===0)throw t;try{e.b.error(t);return}catch(i){t=i}}e=e.parent}throw t}const Fc=-7169;function Qe(t,e){t.f=t.f&Fc|e}function mn(t){(t.f&jt)!==0||t.deps===null?Qe(t,nt):Qe(t,ur)}function oa(t){if(t!==null)for(const e of t)(e.f&ct)===0||(e.f&ei)===0||(e.f^=ei,oa(e.deps))}function aa(t,e,i){(t.f&dt)!==0?e.add(t):(t.f&ur)!==0&&i.add(t),oa(t.deps),Qe(t,nt)}let Gi=!1;function Wc(t){var e=Gi;try{return Gi=!1,[t(),Gi]}finally{Gi=e}}const Tr=new Set;let be=null,ut=null,Xs=null,Ti=!1,Bs=!1,ai=null,Zi=null;var ho=0;let Uc=1;var ui,di,gr,ir,Pi,Ot,Ii,Br,mr,sr,fi,qr,it,Qi,la,es,Ys,Js,ca;const ls=class ls{constructor(){we(this,it);qt(this,"id",Uc++);qt(this,"current",new Map);qt(this,"previous",new Map);we(this,ui,new Set);we(this,di,new Set);we(this,gr,new Map);we(this,ir,new Map);we(this,Pi,null);we(this,Ot,[]);we(this,Ii,[]);we(this,Br,new Set);we(this,mr,new Set);we(this,sr,new Map);qt(this,"is_fork",!1);we(this,fi,!1);we(this,qr,new Set)}skip_effect(e){G(this,sr).has(e)||G(this,sr).set(e,{d:[],m:[]})}unskip_effect(e){var i=G(this,sr).get(e);if(i){G(this,sr).delete(e);for(var r of i.d)Qe(r,dt),this.schedule(r);for(r of i.m)Qe(r,ur),this.schedule(r)}}capture(e,i,r=!1){i!==lt&&!this.previous.has(e)&&this.previous.set(e,i),(e.f&Ir)===0&&(this.current.set(e,[e.v,r]),ut==null||ut.set(e,e.v))}activate(){be=this}deactivate(){be=null,ut=null}flush(){try{Bs=!0,be=this,ze(this,it,es).call(this)}finally{ho=0,Xs=null,ai=null,Zi=null,Bs=!1,be=null,ut=null,Hr.clear()}}discard(){for(const e of G(this,di))e(this);G(this,di).clear(),Tr.delete(this)}register_created_effect(e){G(this,Ii).push(e)}increment(e,i){let r=G(this,gr).get(i)??0;if(G(this,gr).set(i,r+1),e){let S=G(this,ir).get(i)??0;G(this,ir).set(i,S+1)}}decrement(e,i,r){let S=G(this,gr).get(i)??0;if(S===1?G(this,gr).delete(i):G(this,gr).set(i,S-1),e){let E=G(this,ir).get(i)??0;E===1?G(this,ir).delete(i):G(this,ir).set(i,E-1)}G(this,fi)||r||(De(this,fi,!0),Cr(()=>{De(this,fi,!1),this.flush()}))}transfer_effects(e,i){for(const r of e)G(this,Br).add(r);for(const r of i)G(this,mr).add(r);e.clear(),i.clear()}oncommit(e){G(this,ui).add(e)}ondiscard(e){G(this,di).add(e)}settled(){return(G(this,Pi)??De(this,Pi,Zo())).promise}static ensure(){if(be===null){const e=be=new ls;Bs||(Tr.add(be),Ti||Cr(()=>{be===e&&e.flush()}))}return be}apply(){{ut=null;return}}schedule(e){var S;if(Xs=e,(S=e.b)!=null&&S.is_pending&&(e.f&(gi|_s|pn))!==0&&(e.f&ii)===0){e.b.defer_effect(e);return}for(var i=e;i.parent!==null;){i=i.parent;var r=i.f;if(ai!==null&&i===Te&&(Le===null||(Le.f&ct)===0))return;if((r&(Zr|Zt))!==0){if((r&nt)===0)return;i.f^=nt}}G(this,Ot).push(i)}};ui=new WeakMap,di=new WeakMap,gr=new WeakMap,ir=new WeakMap,Pi=new WeakMap,Ot=new WeakMap,Ii=new WeakMap,Br=new WeakMap,mr=new WeakMap,sr=new WeakMap,fi=new WeakMap,qr=new WeakMap,it=new WeakSet,Qi=function(){return this.is_fork||G(this,ir).size>0},la=function(){for(const r of G(this,qr))for(const S of G(r,ir).keys()){for(var e=!1,i=S;i.parent!==null;){if(G(this,sr).has(i)){e=!0;break}i=i.parent}if(!e)return!0}return!1},es=function(){var o,l;if(ho++>1e3&&(Tr.delete(this),zc()),!ze(this,it,Qi).call(this)){for(const h of G(this,Br))G(this,mr).delete(h),Qe(h,dt),this.schedule(h);for(const h of G(this,mr))Qe(h,ur),this.schedule(h)}const e=G(this,Ot);De(this,Ot,[]),this.apply();var i=ai=[],r=[],S=Zi=[];for(const h of e)try{ze(this,it,Ys).call(this,h,i,r)}catch(f){throw da(h),f}if(be=null,S.length>0){var E=ls.ensure();for(const h of S)E.schedule(h)}if(ai=null,Zi=null,ze(this,it,Qi).call(this)||ze(this,it,la).call(this)){ze(this,it,Js).call(this,r),ze(this,it,Js).call(this,i);for(const[h,f]of G(this,sr))ua(h,f)}else{G(this,gr).size===0&&Tr.delete(this),G(this,Br).clear(),G(this,mr).clear();for(const h of G(this,ui))h(this);G(this,ui).clear(),uo(r),uo(i),(o=G(this,Pi))==null||o.resolve()}var C=be;if(G(this,Ot).length>0){const h=C??(C=this);G(h,Ot).push(...G(this,Ot).filter(f=>!G(h,Ot).includes(f)))}C!==null&&(Tr.add(C),ze(l=C,it,es).call(l)),Tr.has(this)||ze(this,it,ca).call(this)},Ys=function(e,i,r){e.f^=nt;for(var S=e.first;S!==null;){var E=S.f,C=(E&(Zt|Zr))!==0,o=C&&(E&nt)!==0,l=o||(E&Tt)!==0||G(this,sr).has(S);if(!l&&S.fn!==null){C?S.f^=nt:(E&gi)!==0?i.push(S):Vi(S)&&((E&kr)!==0&&G(this,mr).add(S),Si(S));var h=S.first;if(h!==null){S=h;continue}}for(;S!==null;){var f=S.next;if(f!==null){S=f;break}S=S.parent}}},Js=function(e){for(var i=0;i<e.length;i+=1)aa(e[i],G(this,Br),G(this,mr))},ca=function(){var f,u,v;for(const d of Tr){var e=d.id<this.id,i=[];for(const[m,[_,n]]of this.current){if(d.current.has(m)){var r=d.current.get(m)[0];if(e&&_!==r)d.current.set(m,[_,n]);else continue}i.push(m)}var S=[...d.current.keys()].filter(m=>!this.current.has(m));if(S.length===0)e&&d.discard();else if(i.length>0){d.activate();var E=new Set,C=new Map;for(var o of i)ha(o,S,E,C);C=new Map;var l=[...d.current.keys()].filter(m=>this.current.has(m)?this.current.get(m)[0]!==m:!0);for(const m of G(this,Ii))(m.f&(Nt|Tt|$s))===0&&bn(m,l,C)&&((m.f&(vs|kr))!==0?(Qe(m,dt),d.schedule(m)):G(d,Br).add(m));if(G(d,Ot).length>0){d.apply();for(var h of G(d,Ot))ze(f=d,it,Ys).call(f,h,[],[]);De(d,Ot,[])}d.deactivate()}}for(const d of Tr)G(d,qr).has(this)&&(G(d,qr).delete(this),G(d,qr).size===0&&!ze(u=d,it,Qi).call(u)&&(d.activate(),ze(v=d,it,es).call(v)))};let ti=ls;function jc(t){var e=Ti;Ti=!0;try{for(var i;;){if(Nc(),be===null)return i;be.flush()}}finally{Ti=e}}function zc(){try{Tc()}catch(t){Pr(t,Xs)}}let $t=null;function uo(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var r=t[i++];if((r.f&(Nt|Tt))===0&&Vi(r)&&($t=new Set,Si(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Ra(r),($t==null?void 0:$t.size)>0)){Hr.clear();for(const S of $t){if((S.f&(Nt|Tt))!==0)continue;const E=[S];let C=S.parent;for(;C!==null;)$t.has(C)&&($t.delete(C),E.push(C)),C=C.parent;for(let o=E.length-1;o>=0;o--){const l=E[o];(l.f&(Nt|Tt))===0&&Si(l)}}$t.clear()}}$t=null}}function ha(t,e,i,r){if(!i.has(t)&&(i.add(t),t.reactions!==null))for(const S of t.reactions){const E=S.f;(E&ct)!==0?ha(S,e,i,r):(E&(vs|kr))!==0&&(E&dt)===0&&bn(S,e,r)&&(Qe(S,dt),Sn(S))}}function bn(t,e,i){const r=i.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const S of t.deps){if(pi.call(e,S))return!0;if((S.f&ct)!==0&&bn(S,e,i))return i.set(S,!0),!0}return i.set(t,!1),!1}function Sn(t){be.schedule(t)}function ua(t,e){if(!((t.f&Zt)!==0&&(t.f&nt)!==0)){(t.f&dt)!==0?e.d.push(t):(t.f&ur)!==0&&e.m.push(t),Qe(t,nt);for(var i=t.first;i!==null;)ua(i,e),i=i.next}}function da(t){Qe(t,nt);for(var e=t.first;e!==null;)da(e),e=e.next}function Kc(t){let e=0,i=Fr(0),r;return()=>{yn()&&(b(i),zi(()=>(e===0&&(r=Lr(()=>t(()=>Nr(i)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,Nr(i))})})))}}var Vc=Qr|yi;function qc(t,e,i,r){new $c(t,e,i,r)}var Ut,fn,nr,$r,kt,or,Pt,Gt,br,Gr,Mr,_i,Hi,Ni,Sr,cs,ot,Gc,Xc,Yc,Zs,ts,rs,Qs;class $c{constructor(e,i,r,S){we(this,ot);qt(this,"parent");qt(this,"is_pending",!1);qt(this,"transform_error");we(this,Ut);we(this,fn,null);we(this,nr);we(this,$r);we(this,kt);we(this,or,null);we(this,Pt,null);we(this,Gt,null);we(this,br,null);we(this,Gr,0);we(this,Mr,0);we(this,_i,!1);we(this,Hi,new Set);we(this,Ni,new Set);we(this,Sr,null);we(this,cs,Kc(()=>(De(this,Sr,Fr(G(this,Gr))),()=>{De(this,Sr,null)})));var E;De(this,Ut,e),De(this,nr,i),De(this,$r,C=>{var o=Te;o.b=this,o.f|=Vs,r(C)}),this.parent=Te.b,this.transform_error=S??((E=this.parent)==null?void 0:E.transform_error)??(C=>C),De(this,kt,Ki(()=>{ze(this,ot,Zs).call(this)},Vc))}defer_effect(e){aa(e,G(this,Hi),G(this,Ni))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!G(this,nr).pending}update_pending_count(e,i){ze(this,ot,Qs).call(this,e,i),De(this,Gr,G(this,Gr)+e),!(!G(this,Sr)||G(this,_i))&&(De(this,_i,!0),Cr(()=>{De(this,_i,!1),G(this,Sr)&&bi(G(this,Sr),G(this,Gr))}))}get_effect_pending(){return G(this,cs).call(this),b(G(this,Sr))}error(e){var i=G(this,nr).onerror;let r=G(this,nr).failed;if(!i&&!r)throw e;G(this,or)&&(ft(G(this,or)),De(this,or,null)),G(this,Pt)&&(ft(G(this,Pt)),De(this,Pt,null)),G(this,Gt)&&(ft(G(this,Gt)),De(this,Gt,null));var S=!1,E=!1;const C=()=>{if(S){Ic();return}S=!0,E&&Oc(),G(this,Gt)!==null&&Yr(G(this,Gt),()=>{De(this,Gt,null)}),ze(this,ot,rs).call(this,()=>{ze(this,ot,Zs).call(this)})},o=l=>{try{E=!0,i==null||i(l,C),E=!1}catch(h){Pr(h,G(this,kt)&&G(this,kt).parent)}r&&De(this,Gt,ze(this,ot,rs).call(this,()=>{try{return Dt(()=>{var h=Te;h.b=this,h.f|=Vs,r(G(this,Ut),()=>l,()=>C)})}catch(h){return Pr(h,G(this,kt).parent),null}}))};Cr(()=>{var l;try{l=this.transform_error(e)}catch(h){Pr(h,G(this,kt)&&G(this,kt).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,h=>Pr(h,G(this,kt)&&G(this,kt).parent)):o(l)})}}Ut=new WeakMap,fn=new WeakMap,nr=new WeakMap,$r=new WeakMap,kt=new WeakMap,or=new WeakMap,Pt=new WeakMap,Gt=new WeakMap,br=new WeakMap,Gr=new WeakMap,Mr=new WeakMap,_i=new WeakMap,Hi=new WeakMap,Ni=new WeakMap,Sr=new WeakMap,cs=new WeakMap,ot=new WeakSet,Gc=function(){try{De(this,or,Dt(()=>G(this,$r).call(this,G(this,Ut))))}catch(e){this.error(e)}},Xc=function(e){const i=G(this,nr).failed;i&&De(this,Gt,Dt(()=>{i(G(this,Ut),()=>e,()=>()=>{})}))},Yc=function(){const e=G(this,nr).pending;e&&(this.is_pending=!0,De(this,Pt,Dt(()=>e(G(this,Ut)))),Cr(()=>{var i=De(this,br,document.createDocumentFragment()),r=xr();i.append(r),De(this,or,ze(this,ot,rs).call(this,()=>Dt(()=>G(this,$r).call(this,r)))),G(this,Mr)===0&&(G(this,Ut).before(i),De(this,br,null),Yr(G(this,Pt),()=>{De(this,Pt,null)}),ze(this,ot,ts).call(this,be))}))},Zs=function(){try{if(this.is_pending=this.has_pending_snippet(),De(this,Mr,0),De(this,Gr,0),De(this,or,Dt(()=>{G(this,$r).call(this,G(this,Ut))})),G(this,Mr)>0){var e=De(this,br,document.createDocumentFragment());kn(G(this,or),e);const i=G(this,nr).pending;De(this,Pt,Dt(()=>i(G(this,Ut))))}else ze(this,ot,ts).call(this,be)}catch(i){this.error(i)}},ts=function(e){this.is_pending=!1,e.transfer_effects(G(this,Hi),G(this,Ni))},rs=function(e){var i=Te,r=Le,S=xt;dr(G(this,kt)),Kt(G(this,kt)),mi(G(this,kt).ctx);try{return ti.ensure(),e()}catch(E){return na(E),null}finally{dr(i),Kt(r),mi(S)}},Qs=function(e,i){var r;if(!this.has_pending_snippet()){this.parent&&ze(r=this.parent,ot,Qs).call(r,e,i);return}De(this,Mr,G(this,Mr)+e),G(this,Mr)===0&&(ze(this,ot,ts).call(this,i),G(this,Pt)&&Yr(G(this,Pt),()=>{De(this,Pt,null)}),G(this,br)&&(G(this,Ut).before(G(this,br)),De(this,br,null)))};function fa(t,e,i,r){const S=ps;var E=t.filter(v=>!v.settled);if(i.length===0&&E.length===0){r(e.map(S));return}var C=Te,o=Jc(),l=E.length===1?E[0].promise:E.length>1?Promise.all(E.map(v=>v.promise)):null;function h(v){o();try{r(v)}catch(d){(C.f&Nt)===0&&Pr(d,C)}os()}if(i.length===0){l.then(()=>h(e.map(S)));return}var f=_a();function u(){Promise.all(i.map(v=>Zc(v))).then(v=>h([...e.map(S),...v])).catch(v=>Pr(v,C)).finally(()=>f())}l?l.then(()=>{o(),u(),os()}):u()}function Jc(){var t=Te,e=Le,i=xt,r=be;return function(E=!0){dr(t),Kt(e),mi(i),E&&(t.f&Nt)===0&&(r==null||r.activate(),r==null||r.apply())}}function os(t=!0){dr(null),Kt(null),mi(null),t&&(be==null||be.deactivate())}function _a(){var t=Te,e=t.b,i=be,r=e.is_rendered();return e.update_pending_count(1,i),i.increment(r,t),(S=!1)=>{e.update_pending_count(-1,i),i.decrement(r,t,S)}}function ps(t){var e=ct|dt,i=Le!==null&&(Le.f&ct)!==0?Le:null;return Te!==null&&(Te.f|=yi),{ctx:xt,deps:null,effects:null,equals:ea,f:e,fn:t,reactions:null,rv:0,v:lt,wv:0,parent:i??Te,ac:null}}function Zc(t,e,i){let r=Te;r===null&&xc();var S=void 0,E=Fr(lt),C=!Le,o=new Map;return fh(()=>{var d;var l=Te,h=Zo();S=h.promise;try{Promise.resolve(t()).then(h.resolve,h.reject).finally(os)}catch(m){h.reject(m),os()}var f=be;if(C){if((l.f&ii)!==0)var u=_a();if(r.b.is_rendered())(d=o.get(f))==null||d.reject(pr),o.delete(f);else{for(const m of o.values())m.reject(pr);o.clear()}o.set(f,h)}const v=(m,_=void 0)=>{if(u){var n=_===pr;u(n)}if(!(_===pr||(l.f&Nt)!==0)){if(f.activate(),_)E.f|=Ir,bi(E,_);else{(E.f&Ir)!==0&&(E.f^=Ir),bi(E,m);for(const[a,s]of o){if(o.delete(a),a===f)break;s.reject(pr)}}f.deactivate()}};h.promise.then(v,m=>v(null,m||"unknown"))}),Cn(()=>{for(const l of o.values())l.reject(pr)}),new Promise(l=>{function h(f){function u(){f===S?l(E):h(S)}f.then(u,u)}h(S)})}function he(t){const e=ps(t);return Ma(e),e}function va(t){const e=ps(t);return e.equals=ra,e}function Qc(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)ft(e[i])}}function eh(t){for(var e=t.parent;e!==null;){if((e.f&ct)===0)return(e.f&Nt)===0?e:null;e=e.parent}return null}function wn(t){var e,i=Te;dr(eh(t));try{t.f&=~ei,Qc(t),e=Ha(t)}finally{dr(i)}return e}function pa(t){var e=t.v,i=wn(t);if(!t.equals(i)&&(t.wv=Pa(),(!(be!=null&&be.is_fork)||t.deps===null)&&(t.v=i,be==null||be.capture(t,e,!0),t.deps===null))){Qe(t,nt);return}Wr||(ut!==null?(yn()||be!=null&&be.is_fork)&&ut.set(t,i):mn(t))}function th(t){var e,i;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(i=r.ac)==null||i.abort(pr),r.teardown=mc,r.ac=null,Ai(r,0),xn(r))}function ga(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&Si(e)}let en=new Set;const Hr=new Map;let ma=!1;function Fr(t,e){var i={f:0,v:t,reactions:null,equals:ea,rv:0,wv:0};return i}function se(t,e){const i=Fr(t);return Ma(i),i}function rh(t,e=!1,i=!0){const r=Fr(t);return e||(r.equals=ra),r}function F(t,e,i=!1){Le!==null&&(!Jt||(Le.f&$s)!==0)&&ia()&&(Le.f&(ct|kr|vs|$s))!==0&&(zt===null||!pi.call(zt,t))&&Mc();let r=i?Oe(e):e;return bi(t,r,Zi)}function bi(t,e,i=null){if(!t.equals(e)){var r=t.v;Wr?Hr.set(t,e):Hr.set(t,r),t.v=e;var S=ti.ensure();if(S.capture(t,r),(t.f&ct)!==0){const E=t;(t.f&dt)!==0&&wn(E),ut===null&&mn(E)}t.wv=Pa(),ba(t,dt,i),Te!==null&&(Te.f&nt)!==0&&(Te.f&(Zt|Zr))===0&&(Wt===null?vh([t]):Wt.push(t)),!S.is_fork&&en.size>0&&!ma&&ih()}return e}function ih(){ma=!1;for(const t of en)(t.f&nt)!==0&&Qe(t,ur),Vi(t)&&Si(t);en.clear()}function sh(t,e=1){var i=b(t),r=e===1?i++:i--;return F(t,i),r}function Nr(t){F(t,t.v+1)}function ba(t,e,i){var r=t.reactions;if(r!==null)for(var S=r.length,E=0;E<S;E++){var C=r[E],o=C.f,l=(o&dt)===0;if(l&&Qe(C,e),(o&ct)!==0){var h=C;ut==null||ut.delete(h),(o&ei)===0&&(o&jt&&(C.f|=ei),ba(h,ur,i))}else if(l){var f=C;(o&kr)!==0&&$t!==null&&$t.add(f),i!==null?i.push(f):Sn(f)}}}function Oe(t){if(typeof t!="object"||t===null||yr in t)return t;const e=vn(t);if(e!==pc&&e!==gc)return t;var i=new Map,r=_n(t),S=se(0),E=Er,C=o=>{if(Er===E)return o();var l=Le,h=Er;Kt(null),po(E);var f=o();return Kt(l),po(h),f};return r&&i.set("length",se(t.length)),new Proxy(t,{defineProperty(o,l,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&Ac();var f=i.get(l);return f===void 0?C(()=>{var u=se(h.value);return i.set(l,u),u}):F(f,h.value,!0),!0},deleteProperty(o,l){var h=i.get(l);if(h===void 0){if(l in o){const f=C(()=>se(lt));i.set(l,f),Nr(S)}}else F(h,lt),Nr(S);return!0},get(o,l,h){var d;if(l===yr)return t;var f=i.get(l),u=l in o;if(f===void 0&&(!u||(d=li(o,l))!=null&&d.writable)&&(f=C(()=>{var m=Oe(u?o[l]:lt),_=se(m);return _}),i.set(l,f)),f!==void 0){var v=b(f);return v===lt?void 0:v}return Reflect.get(o,l,h)},getOwnPropertyDescriptor(o,l){var h=Reflect.getOwnPropertyDescriptor(o,l);if(h&&"value"in h){var f=i.get(l);f&&(h.value=b(f))}else if(h===void 0){var u=i.get(l),v=u==null?void 0:u.v;if(u!==void 0&&v!==lt)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return h},has(o,l){var v;if(l===yr)return!0;var h=i.get(l),f=h!==void 0&&h.v!==lt||Reflect.has(o,l);if(h!==void 0||Te!==null&&(!f||(v=li(o,l))!=null&&v.writable)){h===void 0&&(h=C(()=>{var d=f?Oe(o[l]):lt,m=se(d);return m}),i.set(l,h));var u=b(h);if(u===lt)return!1}return f},set(o,l,h,f){var c;var u=i.get(l),v=l in o;if(r&&l==="length")for(var d=h;d<u.v;d+=1){var m=i.get(d+"");m!==void 0?F(m,lt):d in o&&(m=C(()=>se(lt)),i.set(d+"",m))}if(u===void 0)(!v||(c=li(o,l))!=null&&c.writable)&&(u=C(()=>se(void 0)),F(u,Oe(h)),i.set(l,u));else{v=u.v!==lt;var _=C(()=>Oe(h));F(u,_)}var n=Reflect.getOwnPropertyDescriptor(o,l);if(n!=null&&n.set&&n.set.call(f,h),!v){if(r&&typeof l=="string"){var a=i.get("length"),s=Number(l);Number.isInteger(s)&&s>=a.v&&F(a,s+1)}Nr(S)}return!0},ownKeys(o){b(S);var l=Reflect.ownKeys(o).filter(u=>{var v=i.get(u);return v===void 0||v.v!==lt});for(var[h,f]of i)f.v!==lt&&!(h in o)&&l.push(h);return l},setPrototypeOf(){Bc()}})}function fo(t){try{if(t!==null&&typeof t=="object"&&yr in t)return t[yr]}catch{}return t}function nh(t,e){return Object.is(fo(t),fo(e))}var tn,Sa,wa,ya;function oh(){if(tn===void 0){tn=window,Sa=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;wa=li(e,"firstChild").get,ya=li(e,"nextSibling").get,co(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),co(i)&&(i.__t=void 0)}}function xr(t=""){return document.createTextNode(t)}function cr(t){return wa.call(t)}function Ui(t){return ya.call(t)}function z(t,e){return cr(t)}function Fe(t,e=!1){{var i=cr(t);return i instanceof Comment&&i.data===""?Ui(i):i}}function $(t,e=1,i=!1){let r=t;for(;e--;)r=Ui(r);return r}function ah(t){t.textContent=""}function Ca(){return!1}function xa(t,e,i){return document.createElementNS(e??Yo,t,void 0)}function lh(t,e){if(e){const i=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===i&&t.focus()})}}let _o=!1;function ch(){_o||(_o=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const i of t.target.elements)(e=i.__on_r)==null||e.call(i)})},{capture:!0}))}function gs(t){var e=Le,i=Te;Kt(null),dr(null);try{return t()}finally{Kt(e),dr(i)}}function Ea(t,e,i,r=i){t.addEventListener(e,()=>gs(i));const S=t.__on_r;S?t.__on_r=()=>{S(),r(!0)}:t.__on_r=()=>r(!0),ch()}function hh(t){Te===null&&(Le===null&&Dc(),Lc()),Wr&&kc()}function uh(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function fr(t,e){var i=Te;i!==null&&(i.f&Tt)!==0&&(t|=Tt);var r={ctx:xt,deps:null,nodes:null,f:t|dt|jt,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};be==null||be.register_created_effect(r);var S=r;if((t&gi)!==0)ai!==null?ai.push(r):ti.ensure().schedule(r);else if(e!==null){try{Si(r)}catch(C){throw ft(r),C}S.deps===null&&S.teardown===null&&S.nodes===null&&S.first===S.last&&(S.f&yi)===0&&(S=S.first,(t&kr)!==0&&(t&Qr)!==0&&S!==null&&(S.f|=Qr))}if(S!==null&&(S.parent=i,i!==null&&uh(S,i),Le!==null&&(Le.f&ct)!==0&&(t&Zr)===0)){var E=Le;(E.effects??(E.effects=[])).push(S)}return r}function yn(){return Le!==null&&!Jt}function Cn(t){const e=fr(_s,null);return Qe(e,nt),e.teardown=t,e}function tt(t){hh();var e=Te.f,i=!Le&&(e&Zt)!==0&&(e&ii)===0;if(i){var r=xt;(r.e??(r.e=[])).push(t)}else return ka(t)}function ka(t){return fr(gi|wc,t)}function dh(t){ti.ensure();const e=fr(Zr|yi,t);return(i={})=>new Promise(r=>{i.outro?Yr(e,()=>{ft(e),r(void 0)}):(ft(e),r(void 0))})}function ji(t){return fr(gi,t)}function fh(t){return fr(vs|yi,t)}function zi(t,e=0){return fr(_s|e,t)}function le(t,e=[],i=[],r=[]){fa(r,e,i,S=>{fr(_s,()=>t(...S.map(b)))})}function Ki(t,e=0){var i=fr(kr|e,t);return i}function La(t,e=0){var i=fr(pn|e,t);return i}function Dt(t){return fr(Zt|yi,t)}function Da(t){var e=t.teardown;if(e!==null){const i=Wr,r=Le;vo(!0),Kt(null);try{e.call(null)}finally{vo(i),Kt(r)}}}function xn(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const S=i.ac;S!==null&&gs(()=>{S.abort(pr)});var r=i.next;(i.f&Zr)!==0?i.parent=null:ft(i,e),i=r}}function _h(t){for(var e=t.first;e!==null;){var i=e.next;(e.f&Zt)===0&&ft(e),e=i}}function ft(t,e=!0){var i=!1;(e||(t.f&Sc)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Ta(t.nodes.start,t.nodes.end),i=!0),Qe(t,qs),xn(t,e&&!i),Ai(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const E of r)E.stop();Da(t),t.f^=qs,t.f|=Nt;var S=t.parent;S!==null&&S.first!==null&&Ra(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Ta(t,e){for(;t!==null;){var i=t===e?null:Ui(t);t.remove(),t=i}}function Ra(t){var e=t.parent,i=t.prev,r=t.next;i!==null&&(i.next=r),r!==null&&(r.prev=i),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=i))}function Yr(t,e,i=!0){var r=[];Aa(t,r,!0);var S=()=>{i&&ft(t),e&&e()},E=r.length;if(E>0){var C=()=>--E||S();for(var o of r)o.out(C)}else S()}function Aa(t,e,i){if((t.f&Tt)===0){t.f^=Tt;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||i)&&e.push(o);for(var S=t.first;S!==null;){var E=S.next,C=(S.f&Qr)!==0||(S.f&Zt)!==0&&(t.f&kr)!==0;Aa(S,e,C?i:!1),S=E}}}function En(t){Ba(t,!0)}function Ba(t,e){if((t.f&Tt)!==0){t.f^=Tt,(t.f&nt)===0&&(Qe(t,dt),ti.ensure().schedule(t));for(var i=t.first;i!==null;){var r=i.next,S=(i.f&Qr)!==0||(i.f&Zt)!==0;Ba(i,S?e:!1),i=r}var E=t.nodes&&t.nodes.t;if(E!==null)for(const C of E)(C.is_global||e)&&C.in()}}function kn(t,e){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end;i!==null;){var S=i===r?null:Ui(i);e.append(i),i=S}}let is=!1,Wr=!1;function vo(t){Wr=t}let Le=null,Jt=!1;function Kt(t){Le=t}let Te=null;function dr(t){Te=t}let zt=null;function Ma(t){Le!==null&&(zt===null?zt=[t]:zt.push(t))}let Lt=null,Mt=0,Wt=null;function vh(t){Wt=t}let Oa=1,Kr=0,Er=Kr;function po(t){Er=t}function Pa(){return++Oa}function Vi(t){var e=t.f;if((e&dt)!==0)return!0;if(e&ct&&(t.f&=~ei),(e&ur)!==0){for(var i=t.deps,r=i.length,S=0;S<r;S++){var E=i[S];if(Vi(E)&&pa(E),E.wv>t.wv)return!0}(e&jt)!==0&&ut===null&&Qe(t,nt)}return!1}function Ia(t,e,i=!0){var r=t.reactions;if(r!==null&&!(zt!==null&&pi.call(zt,t)))for(var S=0;S<r.length;S++){var E=r[S];(E.f&ct)!==0?Ia(E,e,!1):e===E&&(i?Qe(E,dt):(E.f&nt)!==0&&Qe(E,ur),Sn(E))}}function Ha(t){var _;var e=Lt,i=Mt,r=Wt,S=Le,E=zt,C=xt,o=Jt,l=Er,h=t.f;Lt=null,Mt=0,Wt=null,Le=(h&(Zt|Zr))===0?t:null,zt=null,mi(t.ctx),Jt=!1,Er=++Kr,t.ac!==null&&(gs(()=>{t.ac.abort(pr)}),t.ac=null);try{t.f|=Gs;var f=t.fn,u=f();t.f|=ii;var v=t.deps,d=be==null?void 0:be.is_fork;if(Lt!==null){var m;if(d||Ai(t,Mt),v!==null&&Mt>0)for(v.length=Mt+Lt.length,m=0;m<Lt.length;m++)v[Mt+m]=Lt[m];else t.deps=v=Lt;if(yn()&&(t.f&jt)!==0)for(m=Mt;m<v.length;m++)((_=v[m]).reactions??(_.reactions=[])).push(t)}else!d&&v!==null&&Mt<v.length&&(Ai(t,Mt),v.length=Mt);if(ia()&&Wt!==null&&!Jt&&v!==null&&(t.f&(ct|ur|dt))===0)for(m=0;m<Wt.length;m++)Ia(Wt[m],t);if(S!==null&&S!==t){if(Kr++,S.deps!==null)for(let n=0;n<i;n+=1)S.deps[n].rv=Kr;if(e!==null)for(const n of e)n.rv=Kr;Wt!==null&&(r===null?r=Wt:r.push(...Wt))}return(t.f&Ir)!==0&&(t.f^=Ir),u}catch(n){return na(n)}finally{t.f^=Gs,Lt=e,Mt=i,Wt=r,Le=S,zt=E,mi(C),Jt=o,Er=l}}function ph(t,e){let i=e.reactions;if(i!==null){var r=_c.call(i,t);if(r!==-1){var S=i.length-1;S===0?i=e.reactions=null:(i[r]=i[S],i.pop())}}if(i===null&&(e.f&ct)!==0&&(Lt===null||!pi.call(Lt,e))){var E=e;(E.f&jt)!==0&&(E.f^=jt,E.f&=~ei),mn(E),th(E),Ai(E,0)}}function Ai(t,e){var i=t.deps;if(i!==null)for(var r=e;r<i.length;r++)ph(t,i[r])}function Si(t){var e=t.f;if((e&Nt)===0){Qe(t,nt);var i=Te,r=is;Te=t,is=!0;try{(e&(kr|pn))!==0?_h(t):xn(t),Da(t);var S=Ha(t);t.teardown=typeof S=="function"?S:null,t.wv=Oa;var E;fc&&Hc&&(t.f&dt)!==0&&t.deps}finally{is=r,Te=i}}}async function gh(){await Promise.resolve(),jc()}function b(t){var e=t.f,i=(e&ct)!==0;if(Le!==null&&!Jt){var r=Te!==null&&(Te.f&Nt)!==0;if(!r&&(zt===null||!pi.call(zt,t))){var S=Le.deps;if((Le.f&Gs)!==0)t.rv<Kr&&(t.rv=Kr,Lt===null&&S!==null&&S[Mt]===t?Mt++:Lt===null?Lt=[t]:Lt.push(t));else{(Le.deps??(Le.deps=[])).push(t);var E=t.reactions;E===null?t.reactions=[Le]:pi.call(E,Le)||E.push(Le)}}}if(Wr&&Hr.has(t))return Hr.get(t);if(i){var C=t;if(Wr){var o=C.v;return((C.f&nt)===0&&C.reactions!==null||Fa(C))&&(o=wn(C)),Hr.set(C,o),o}var l=(C.f&jt)===0&&!Jt&&Le!==null&&(is||(Le.f&jt)!==0),h=(C.f&ii)===0;Vi(C)&&(l&&(C.f|=jt),pa(C)),l&&!h&&(ga(C),Na(C))}if(ut!=null&&ut.has(t))return ut.get(t);if((t.f&Ir)!==0)throw t.v;return t.v}function Na(t){if(t.f|=jt,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&ct)!==0&&(e.f&jt)===0&&(ga(e),Na(e))}function Fa(t){if(t.v===lt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Hr.has(e)||(e.f&ct)!==0&&Fa(e))return!0;return!1}function Lr(t){var e=Jt;try{return Jt=!0,t()}finally{Jt=e}}function mh(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(yr in t)rn(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&yr in i&&rn(i)}}}function rn(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{rn(t[r],e)}catch{}const i=vn(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const r=Jo(i);for(let S in r){const E=r[S].get;if(E)try{E.call(t)}catch{}}}}}const Vr=Symbol("events"),Wa=new Set,sn=new Set;function Ua(t,e,i,r={}){function S(E){if(r.capture||nn.call(e,E),!E.cancelBubble)return gs(()=>i==null?void 0:i.call(this,E))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Cr(()=>{e.addEventListener(t,S,r)}):e.addEventListener(t,S,r),S}function wr(t,e,i,r,S){var E={capture:r,passive:S},C=Ua(t,e,i,E);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Cn(()=>{e.removeEventListener(t,C,E)})}function ge(t,e,i){(e[Vr]??(e[Vr]={}))[t]=i}function bt(t){for(var e=0;e<t.length;e++)Wa.add(t[e]);for(var i of sn)i(t)}let go=null;function nn(t){var n,a;var e=this,i=e.ownerDocument,r=t.type,S=((n=t.composedPath)==null?void 0:n.call(t))||[],E=S[0]||t.target;go=t;var C=0,o=go===t&&t[Vr];if(o){var l=S.indexOf(o);if(l!==-1&&(e===document||e===window)){t[Vr]=e;return}var h=S.indexOf(e);if(h===-1)return;l<=h&&(C=l)}if(E=S[C]||t.target,E!==e){vc(t,"currentTarget",{configurable:!0,get(){return E||i}});var f=Le,u=Te;Kt(null),dr(null);try{for(var v,d=[];E!==null;){var m=E.assignedSlot||E.parentNode||E.host||null;try{var _=(a=E[Vr])==null?void 0:a[r];_!=null&&(!E.disabled||t.target===E)&&_.call(E,t)}catch(s){v?d.push(s):v=s}if(t.cancelBubble||m===e||m===null)break;E=m}if(v){for(let s of d)queueMicrotask(()=>{throw s});throw v}}finally{t[Vr]=e,delete t.currentTarget,Kt(f),dr(u)}}}var Go;const Ms=((Go=globalThis==null?void 0:globalThis.window)==null?void 0:Go.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function bh(t){return(Ms==null?void 0:Ms.createHTML(t))??t}function ja(t){var e=xa("template");return e.innerHTML=bh(t.replaceAll("<!>","<!---->")),e.content}function ri(t,e){var i=Te;i.nodes===null&&(i.nodes={start:t,end:e,a:null,t:null})}function ee(t,e){var i=(e&lc)!==0,r=(e&cc)!==0,S,E=!t.startsWith("<!>");return()=>{S===void 0&&(S=ja(E?t:"<!>"+t),i||(S=cr(S)));var C=r||Sa?document.importNode(S,!0):S.cloneNode(!0);if(i){var o=cr(C),l=C.lastChild;ri(o,l)}else ri(C,C);return C}}function Sh(t,e,i="svg"){var r=!t.startsWith("<!>"),S=`<${i}>${r?t:"<!>"+t}</${i}>`,E;return()=>{if(!E){var C=ja(S),o=cr(C);E=cr(o)}var l=E.cloneNode(!0);return ri(l,l),l}}function ms(t,e){return Sh(t,e,"svg")}function Ye(t=""){{var e=xr(t+"");return ri(e,e),e}}function Et(){var t=document.createDocumentFragment(),e=document.createComment(""),i=xr();return t.append(e,i),ri(e,i),t}function q(t,e){t!==null&&t.before(e)}function wh(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const yh=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ch(t){return yh.includes(t)}const xh={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Eh(t){return t=t.toLowerCase(),xh[t]??t}const kh=["touchstart","touchmove"];function Lh(t){return kh.includes(t)}function oe(t,e){var i=e==null?"":typeof e=="object"?`${e}`:e;i!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=i,t.nodeValue=`${i}`)}function Dh(t,e){return Th(t,e)}const Xi=new Map;function Th(t,{target:e,anchor:i,props:r={},events:S,context:E,intro:C=!0,transformError:o}){oh();var l=void 0,h=dh(()=>{var f=i??e.appendChild(xr());qc(f,{pending:()=>{}},d=>{qe({});var m=xt;E&&(m.c=E),S&&(r.$$events=S),l=t(d,r)||{},$e()},o);var u=new Set,v=d=>{for(var m=0;m<d.length;m++){var _=d[m];if(!u.has(_)){u.add(_);var n=Lh(_);for(const c of[e,document]){var a=Xi.get(c);a===void 0&&(a=new Map,Xi.set(c,a));var s=a.get(_);s===void 0?(c.addEventListener(_,nn,{passive:n}),a.set(_,1)):a.set(_,s+1)}}}};return v(fs(Wa)),sn.add(v),()=>{var n;for(var d of u)for(const a of[e,document]){var m=Xi.get(a),_=m.get(d);--_==0?(a.removeEventListener(d,nn),m.delete(d),m.size===0&&Xi.delete(a)):m.set(d,_)}sn.delete(v),f!==i&&((n=f.parentNode)==null||n.removeChild(f))}});return Rh.set(l,h),l}let Rh=new WeakMap;var Xt,ar,It,Xr,Fi,Wi,hs;class Ln{constructor(e,i=!0){qt(this,"anchor");we(this,Xt,new Map);we(this,ar,new Map);we(this,It,new Map);we(this,Xr,new Set);we(this,Fi,!0);we(this,Wi,e=>{if(G(this,Xt).has(e)){var i=G(this,Xt).get(e),r=G(this,ar).get(i);if(r)En(r),G(this,Xr).delete(i);else{var S=G(this,It).get(i);S&&(G(this,ar).set(i,S.effect),G(this,It).delete(i),S.fragment.lastChild.remove(),this.anchor.before(S.fragment),r=S.effect)}for(const[E,C]of G(this,Xt)){if(G(this,Xt).delete(E),E===e)break;const o=G(this,It).get(C);o&&(ft(o.effect),G(this,It).delete(C))}for(const[E,C]of G(this,ar)){if(E===i||G(this,Xr).has(E))continue;const o=()=>{if(Array.from(G(this,Xt).values()).includes(E)){var h=document.createDocumentFragment();kn(C,h),h.append(xr()),G(this,It).set(E,{effect:C,fragment:h})}else ft(C);G(this,Xr).delete(E),G(this,ar).delete(E)};G(this,Fi)||!r?(G(this,Xr).add(E),Yr(C,o,!1)):o()}}});we(this,hs,e=>{G(this,Xt).delete(e);const i=Array.from(G(this,Xt).values());for(const[r,S]of G(this,It))i.includes(r)||(ft(S.effect),G(this,It).delete(r))});this.anchor=e,De(this,Fi,i)}ensure(e,i){var r=be,S=Ca();if(i&&!G(this,ar).has(e)&&!G(this,It).has(e))if(S){var E=document.createDocumentFragment(),C=xr();E.append(C),G(this,It).set(e,{effect:Dt(()=>i(C)),fragment:E})}else G(this,ar).set(e,Dt(()=>i(this.anchor)));if(G(this,Xt).set(r,e),S){for(const[o,l]of G(this,ar))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of G(this,It))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(G(this,Wi)),r.ondiscard(G(this,hs))}else G(this,Wi).call(this,r)}}Xt=new WeakMap,ar=new WeakMap,It=new WeakMap,Xr=new WeakMap,Fi=new WeakMap,Wi=new WeakMap,hs=new WeakMap;function Dn(t,e,...i){var r=new Ln(t);Ki(()=>{const S=e()??null;r.ensure(S,S&&(E=>S(E,...i)))},Qr)}function Tn(t){xt===null&&Qo(),tt(()=>{const e=Lr(t);if(typeof e=="function")return e})}function Ah(t){xt===null&&Qo(),Tn(()=>()=>Lr(t))}function ne(t,e,i=!1){var r=new Ln(t),S=i?Qr:0;function E(C,o){r.ensure(C,o)}Ki(()=>{var C=!1;e((o,l=0)=>{C=!0,E(l,o)}),C||E(-1,null)},S)}const Bh=Symbol("NaN");function Mh(t,e,i){var r=new Ln(t);Ki(()=>{var S=e();S!==S&&(S=Bh),r.ensure(S,i)})}function Bi(t,e){return e}function Oh(t,e,i){for(var r=[],S=e.length,E,C=e.length,o=0;o<S;o++){let u=e[o];Yr(u,()=>{if(E){if(E.pending.delete(u),E.done.add(u),E.pending.size===0){var v=t.outrogroups;on(t,fs(E.done)),v.delete(E),v.size===0&&(t.outrogroups=null)}}else C-=1},!1)}if(C===0){var l=r.length===0&&i!==null;if(l){var h=i,f=h.parentNode;ah(f),f.append(h),t.items.clear()}on(t,e,!l)}else E={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(E)}function on(t,e,i=!0){var r;if(t.pending.size>0){r=new Set;for(const C of t.pending.values())for(const o of C)r.add(t.items.get(o).e)}for(var S=0;S<e.length;S++){var E=e[S];if(r!=null&&r.has(E)){E.f|=lr;const C=document.createDocumentFragment();kn(E,C)}else ft(e[S],i)}}var mo;function Je(t,e,i,r,S,E=null){var C=t,o=new Map,l=(e&Xo)!==0;if(l){var h=t;C=h.appendChild(xr())}var f=null,u=va(()=>{var c=i();return _n(c)?c:c==null?[]:fs(c)}),v,d=new Map,m=!0;function _(c){(s.effect.f&Nt)===0&&(s.pending.delete(c),s.fallback=f,Ph(s,v,C,e,r),f!==null&&(v.length===0?(f.f&lr)===0?En(f):(f.f^=lr,Di(f,null,C)):Yr(f,()=>{f=null})))}function n(c){s.pending.delete(c)}var a=Ki(()=>{v=b(u);for(var c=v.length,p=new Set,w=be,y=Ca(),k=0;k<c;k+=1){var g=v[k],x=r(g,k),T=m?null:o.get(x);T?(T.v&&bi(T.v,g),T.i&&bi(T.i,k),y&&w.unskip_effect(T.e)):(T=Ih(o,m?C:mo??(mo=xr()),g,x,k,S,e,i),m||(T.e.f|=lr),o.set(x,T)),p.add(x)}if(c===0&&E&&!f&&(m?f=Dt(()=>E(C)):(f=Dt(()=>E(mo??(mo=xr()))),f.f|=lr)),c>p.size&&Ec(),!m)if(d.set(w,p),y){for(const[A,P]of o)p.has(A)||w.skip_effect(P.e);w.oncommit(_),w.ondiscard(n)}else _(w);b(u)}),s={effect:a,items:o,pending:d,outrogroups:null,fallback:f};m=!1}function Ci(t){for(;t!==null&&(t.f&Zt)===0;)t=t.next;return t}function Ph(t,e,i,r,S){var T,A,P,B,H,W,Y,J,Z;var E=(r&rc)!==0,C=e.length,o=t.items,l=Ci(t.effect.first),h,f=null,u,v=[],d=[],m,_,n,a;if(E)for(a=0;a<C;a+=1)m=e[a],_=S(m,a),n=o.get(_).e,(n.f&lr)===0&&((A=(T=n.nodes)==null?void 0:T.a)==null||A.measure(),(u??(u=new Set)).add(n));for(a=0;a<C;a+=1){if(m=e[a],_=S(m,a),n=o.get(_).e,t.outrogroups!==null)for(const L of t.outrogroups)L.pending.delete(n),L.done.delete(n);if((n.f&Tt)!==0&&(En(n),E&&((B=(P=n.nodes)==null?void 0:P.a)==null||B.unfix(),(u??(u=new Set)).delete(n))),(n.f&lr)!==0)if(n.f^=lr,n===l)Di(n,null,i);else{var s=f?f.next:l;n===t.effect.last&&(t.effect.last=n.prev),n.prev&&(n.prev.next=n.next),n.next&&(n.next.prev=n.prev),Rr(t,f,n),Rr(t,n,s),Di(n,s,i),f=n,v=[],d=[],l=Ci(f.next);continue}if(n!==l){if(h!==void 0&&h.has(n)){if(v.length<d.length){var c=d[0],p;f=c.prev;var w=v[0],y=v[v.length-1];for(p=0;p<v.length;p+=1)Di(v[p],c,i);for(p=0;p<d.length;p+=1)h.delete(d[p]);Rr(t,w.prev,y.next),Rr(t,f,w),Rr(t,y,c),l=c,f=y,a-=1,v=[],d=[]}else h.delete(n),Di(n,l,i),Rr(t,n.prev,n.next),Rr(t,n,f===null?t.effect.first:f.next),Rr(t,f,n),f=n;continue}for(v=[],d=[];l!==null&&l!==n;)(h??(h=new Set)).add(l),d.push(l),l=Ci(l.next);if(l===null)continue}(n.f&lr)===0&&v.push(n),f=n,l=Ci(n.next)}if(t.outrogroups!==null){for(const L of t.outrogroups)L.pending.size===0&&(on(t,fs(L.done)),(H=t.outrogroups)==null||H.delete(L));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||h!==void 0){var k=[];if(h!==void 0)for(n of h)(n.f&Tt)===0&&k.push(n);for(;l!==null;)(l.f&Tt)===0&&l!==t.fallback&&k.push(l),l=Ci(l.next);var g=k.length;if(g>0){var x=(r&Xo)!==0&&C===0?i:null;if(E){for(a=0;a<g;a+=1)(Y=(W=k[a].nodes)==null?void 0:W.a)==null||Y.measure();for(a=0;a<g;a+=1)(Z=(J=k[a].nodes)==null?void 0:J.a)==null||Z.fix()}Oh(t,k,x)}}E&&Cr(()=>{var L,O;if(u!==void 0)for(n of u)(O=(L=n.nodes)==null?void 0:L.a)==null||O.apply()})}function Ih(t,e,i,r,S,E,C,o){var l=(C&ec)!==0?(C&ic)===0?rh(i,!1,!1):Fr(i):null,h=(C&tc)!==0?Fr(S):null;return{v:l,i:h,e:Dt(()=>(E(e,l??i,h??S,o),()=>{t.delete(r)}))}}function Di(t,e,i){if(t.nodes)for(var r=t.nodes.start,S=t.nodes.end,E=e&&(e.f&lr)===0?e.nodes.start:i;r!==null;){var C=Ui(r);if(E.before(r),r===S)return;r=C}}function Rr(t,e,i){e===null?t.effect.first=i:e.next=i,i===null?t.effect.last=e:i.prev=e}function Hh(t,e,i=!1,r=!1,S=!1,E=!1){var C=t,o="";if(i)var l=t;le(()=>{var h=Te;if(o!==(o=e()??"")){if(i){h.nodes=null,l.innerHTML=o,o!==""&&ri(cr(l),l.lastChild);return}if(h.nodes!==null&&(Ta(h.nodes.start,h.nodes.end),h.nodes=null),o!==""){var f=r?hc:S?uc:void 0,u=xa(r?"svg":S?"math":"template",f);u.innerHTML=o;var v=r||S?u:u.content;if(ri(cr(v),v.lastChild),r||S)for(;cr(v);)C.before(cr(v));else C.before(v)}}})}function za(t,e,i){ji(()=>{var r=Lr(()=>e(t,i==null?void 0:i())||{});if(i&&(r!=null&&r.update)){var S=!1,E={};zi(()=>{var C=i();mh(C),S&&ta(E,C)&&(E=C,r.update(C))}),S=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function Nh(t,e){var i=void 0,r;La(()=>{i!==(i=e())&&(r&&(ft(r),r=null),i&&(r=Dt(()=>{ji(()=>i(t))})))})}function Ka(t){var e,i,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var S=t.length;for(e=0;e<S;e++)t[e]&&(i=Ka(t[e]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}function Fh(){for(var t,e,i=0,r="",S=arguments.length;i<S;i++)(t=arguments[i])&&(e=Ka(t))&&(r&&(r+=" "),r+=e);return r}function bs(t){return typeof t=="object"?Fh(t):t??""}const bo=[...`
2
- \r\f \v\uFEFF`];function Wh(t,e,i){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),i){for(var S of Object.keys(i))if(i[S])r=r?r+" "+S:S;else if(r.length)for(var E=S.length,C=0;(C=r.indexOf(S,C))>=0;){var o=C+E;(C===0||bo.includes(r[C-1]))&&(o===r.length||bo.includes(r[o]))?r=(C===0?"":r.substring(0,C))+r.substring(o+1):C=o}}return r===""?null:r}function So(t,e=!1){var i=e?" !important;":";",r="";for(var S of Object.keys(t)){var E=t[S];E!=null&&E!==""&&(r+=" "+S+": "+E+i)}return r}function Os(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Uh(t,e){if(e){var i="",r,S;if(Array.isArray(e)?(r=e[0],S=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var E=!1,C=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Os)),S&&l.push(...Object.keys(S).map(Os));var h=0,f=-1;const _=t.length;for(var u=0;u<_;u++){var v=t[u];if(o?v==="/"&&t[u-1]==="*"&&(o=!1):E?E===v&&(E=!1):v==="/"&&t[u+1]==="*"?o=!0:v==='"'||v==="'"?E=v:v==="("?C++:v===")"&&C--,!o&&E===!1&&C===0){if(v===":"&&f===-1)f=u;else if(v===";"||u===_-1){if(f!==-1){var d=Os(t.substring(h,f).trim());if(!l.includes(d)){v!==";"&&u++;var m=t.substring(h,u).trim();i+=" "+m+";"}}h=u+1,f=-1}}}}return r&&(i+=So(r)),S&&(i+=So(S,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function Re(t,e,i,r,S,E){var C=t.__className;if(C!==i||C===void 0){var o=Wh(i,r,E);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t.__className=i}else if(E&&S!==E)for(var l in E){var h=!!E[l];(S==null||h!==!!S[l])&&t.classList.toggle(l,h)}return E}function Ps(t,e={},i,r){for(var S in i){var E=i[S];e[S]!==E&&(i[S]==null?t.style.removeProperty(S):t.style.setProperty(S,E,r))}}function Qt(t,e,i,r){var S=t.__style;if(S!==e){var E=Uh(e,r);E==null?t.removeAttribute("style"):t.style.cssText=E,t.__style=e}else r&&(Array.isArray(r)?(Ps(t,i==null?void 0:i[0],r[0]),Ps(t,i==null?void 0:i[1],r[1],"important")):Ps(t,i,r));return r}function an(t,e,i=!1){if(t.multiple){if(e==null)return;if(!_n(e))return Pc();for(var r of t.options)r.selected=e.includes(wo(r));return}for(r of t.options){var S=wo(r);if(nh(S,e)){r.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function jh(t){var e=new MutationObserver(()=>{an(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Cn(()=>{e.disconnect()})}function wo(t){return"__value"in t?t.__value:t.value}const xi=Symbol("class"),Ei=Symbol("style"),Va=Symbol("is custom element"),qa=Symbol("is html"),zh=gn?"option":"OPTION",Kh=gn?"select":"SELECT",Vh=gn?"progress":"PROGRESS";function yo(t,e){var i=Ss(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Vh)||(t.value=e??"")}function ln(t,e){var i=Ss(t);i.checked!==(i.checked=e??void 0)&&(t.checked=e)}function qh(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function xe(t,e,i,r){var S=Ss(t);S[e]!==(S[e]=i)&&(e==="loading"&&(t[Cc]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ga(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function $h(t,e,i,r,S=!1,E=!1){var C=Ss(t),o=C[Va],l=!C[qa],h=e||{},f=t.nodeName===zh;for(var u in e)u in i||(i[u]=null);i.class?i.class=bs(i.class):i[xi]&&(i.class=null),i[Ei]&&(i.style??(i.style=null));var v=Ga(t);for(const p in i){let w=i[p];if(f&&p==="value"&&w==null){t.value=t.__value="",h[p]=w;continue}if(p==="class"){var d=t.namespaceURI==="http://www.w3.org/1999/xhtml";Re(t,d,w,r,e==null?void 0:e[xi],i[xi]),h[p]=w,h[xi]=i[xi];continue}if(p==="style"){Qt(t,w,e==null?void 0:e[Ei],i[Ei]),h[p]=w,h[Ei]=i[Ei];continue}var m=h[p];if(!(w===m&&!(w===void 0&&t.hasAttribute(p)))){h[p]=w;var _=p[0]+p[1];if(_!=="$$")if(_==="on"){const y={},k="$$"+p;let g=p.slice(2);var n=Ch(g);if(wh(g)&&(g=g.slice(0,-7),y.capture=!0),!n&&m){if(w!=null)continue;t.removeEventListener(g,h[k],y),h[k]=null}if(n)ge(g,t,w),bt([g]);else if(w!=null){let x=function(T){h[p].call(this,T)};var c=x;h[k]=Ua(g,t,x,y)}}else if(p==="style")xe(t,p,w);else if(p==="autofocus")lh(t,!!w);else if(!o&&(p==="__value"||p==="value"&&w!=null))t.value=t.__value=w;else if(p==="selected"&&f)qh(t,w);else{var a=p;l||(a=Eh(a));var s=a==="defaultValue"||a==="defaultChecked";if(w==null&&!o&&!s)if(C[p]=null,a==="value"||a==="checked"){let y=t;const k=e===void 0;if(a==="value"){let g=y.defaultValue;y.removeAttribute(a),y.defaultValue=g,y.value=y.__value=k?g:null}else{let g=y.defaultChecked;y.removeAttribute(a),y.defaultChecked=g,y.checked=k?g:!1}}else t.removeAttribute(p);else s||v.includes(a)&&(o||typeof w!="string")?(t[a]=w,a in C&&(C[a]=lt)):typeof w!="function"&&xe(t,a,w)}}}return h}function $a(t,e,i=[],r=[],S=[],E,C=!1,o=!1){fa(S,i,r,l=>{var h=void 0,f={},u=t.nodeName===Kh,v=!1;if(La(()=>{var m=e(...l.map(b)),_=$h(t,h,m,E,C,o);v&&u&&"value"in m&&an(t,m.value);for(let a of Object.getOwnPropertySymbols(f))m[a]||ft(f[a]);for(let a of Object.getOwnPropertySymbols(m)){var n=m[a];a.description===dc&&(!h||n!==h[a])&&(f[a]&&ft(f[a]),f[a]=Dt(()=>Nh(t,()=>n))),_[a]=n}h=_}),u){var d=t;ji(()=>{an(d,h.value,!0),jh(d)})}v=!0})}function Ss(t){return t.__attributes??(t.__attributes={[Va]:t.nodeName.includes("-"),[qa]:t.namespaceURI===Yo})}var Co=new Map;function Ga(t){var e=t.getAttribute("is")||t.nodeName,i=Co.get(e);if(i)return i;Co.set(e,i=[]);for(var r,S=t,E=Element.prototype;E!==S;){r=Jo(S);for(var C in r)r[C].set&&i.push(C);S=vn(S)}return i}function Jr(t,e,i=e){var r=new WeakSet;Ea(t,"input",async S=>{var E=S?t.defaultValue:t.value;if(E=Is(t)?Hs(E):E,i(E),be!==null&&r.add(be),await gh(),E!==(E=e())){var C=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=E??"",o!==null){var h=t.value.length;C===o&&o===l&&h>l?(t.selectionStart=h,t.selectionEnd=h):(t.selectionStart=C,t.selectionEnd=Math.min(o,h))}}}),Lr(e)==null&&t.value&&(i(Is(t)?Hs(t.value):t.value),be!==null&&r.add(be)),zi(()=>{var S=e();if(t===document.activeElement){var E=be;if(r.has(E))return}Is(t)&&S===Hs(t.value)||t.type==="date"&&!S&&!t.value||S!==t.value&&(t.value=S??"")})}function Gh(t,e,i=e){Ea(t,"change",r=>{var S=r?t.defaultChecked:t.checked;i(S)}),Lr(e)==null&&i(t.checked),zi(()=>{var r=e();t.checked=!!r})}function Is(t){var e=t.type;return e==="number"||e==="range"}function Hs(t){return t===""?null:+t}function xo(t,e){return t===e||(t==null?void 0:t[yr])===e}function Mi(t={},e,i,r){var S=xt.r,E=Te;return ji(()=>{var C,o;return zi(()=>{C=o,o=[],Lr(()=>{t!==i(...o)&&(e(t,...o),C&&xo(i(...C),t)&&e(null,...C))})}),()=>{let l=E;for(;l!==S&&l.parent!==null&&l.parent.f&qs;)l=l.parent;const h=()=>{o&&xo(i(...o),t)&&e(null,...o)},f=l.teardown;l.teardown=()=>{h(),f==null||f()}}}),t}const Xh={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Xa(t,e,i){return new Proxy({props:t,exclude:e},Xh)}function pe(t,e,i,r){var s;var S=(i&oc)!==0,E=(i&ac)!==0,C=r,o=!0,l=()=>(o&&(o=!1,C=E?Lr(r):r),C);let h;if(S){var f=yr in t||yc in t;h=((s=li(t,e))==null?void 0:s.set)??(f&&e in t?c=>t[e]=c:void 0)}var u,v=!1;S?[u,v]=Wc(()=>t[e]):u=t[e],u===void 0&&r!==void 0&&(u=l(),h&&(Rc(),h(u)));var d;if(d=()=>{var c=t[e];return c===void 0?l():(o=!0,c)},(i&nc)===0)return d;if(h){var m=t.$$legacy;return(function(c,p){return arguments.length>0?((!p||m||v)&&h(p?d():c),c):d()})}var _=!1,n=((i&sc)!==0?ps:va)(()=>(_=!1,d()));S&&b(n);var a=Te;return(function(c,p){if(arguments.length>0){const w=p?b(n):S?Oe(c):c;return F(n,w),_=!0,C!==void 0&&(C=w),c}return Wr&&_||(a.f&Nt)!==0?n.v:b(n)})}const Yh=["github-dark","dracula","nord","solarized-dark","one-dark"],cn=[{key:"github-dark",label:"GitHub Dark",colors:{surface:"#0d1117",sidebar:"#161b22",topbar:"#1c2128",hover:"#21262d",active:"#1f6feb33",edge:"#30363d",primary:"#e6edf3",muted:"#8b949e",accent:"#58a6ff",danger:"#f85149",success:"#3fb950",warning:"#d29922"},terminal:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"}},{key:"dracula",label:"Dracula",colors:{surface:"#282a36",sidebar:"#21222c",topbar:"#2d2f3f",hover:"#343746",active:"#bd93f933",edge:"#44475a",primary:"#f8f8f2",muted:"#6272a4",accent:"#bd93f9",danger:"#ff5555",success:"#50fa7b",warning:"#f1fa8c"},terminal:{background:"#282a36",foreground:"#f8f8f2",cursor:"#bd93f9",selectionBackground:"#44475a"}},{key:"nord",label:"Nord",colors:{surface:"#2e3440",sidebar:"#272c36",topbar:"#353b49",hover:"#3b4252",active:"#88c0d033",edge:"#4c566a",primary:"#eceff4",muted:"#81a1c1",accent:"#88c0d0",danger:"#bf616a",success:"#a3be8c",warning:"#ebcb8b"},terminal:{background:"#2e3440",foreground:"#eceff4",cursor:"#88c0d0",selectionBackground:"#434c5e"}},{key:"solarized-dark",label:"Solarized Dark",colors:{surface:"#002b36",sidebar:"#00222b",topbar:"#073642",hover:"#0a4050",active:"#268bd233",edge:"#2e5e6a",primary:"#fdf6e3",muted:"#839496",accent:"#268bd2",danger:"#dc322f",success:"#859900",warning:"#b58900"},terminal:{background:"#002b36",foreground:"#fdf6e3",cursor:"#268bd2",selectionBackground:"#073642"}},{key:"one-dark",label:"One Dark",colors:{surface:"#282c34",sidebar:"#21252b",topbar:"#2c323c",hover:"#333842",active:"#61afef33",edge:"#3e4452",primary:"#abb2bf",muted:"#636d83",accent:"#61afef",danger:"#e06c75",success:"#98c379",warning:"#e5c07b"},terminal:{background:"#282c34",foreground:"#abb2bf",cursor:"#61afef",selectionBackground:"#3e4452"}}];function Ya(t){return cn.find(e=>e.key===t)??cn[0]}const ss="wt-ssh-host",Ja="wt-theme",hn="wt-last-selected-worktree",Za="wt-sidebar-width",Jh=220;function ws(t){return t.repo?`${t.repo} #${t.number}`:`PR #${t.number}`}function Zh(t){return t==="merged"?"text-merged":t==="closed"?"text-danger":"text-primary"}function Eo(t){return t==="merged"?"bg-merged/20 text-merged":t==="closed"?"bg-danger/20 text-danger":t==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}function Qh(t){return t==="failed"?"text-danger":t==="success"?"text-success":t==="pending"?"text-warning":"text-muted"}function eu(t){return t==="failed"?"bg-danger":t==="success"?"bg-success":t==="pending"?"bg-warning animate-pulse":"bg-muted"}function tu(t){if(t.ciChecks.length>0){if(t.ciStatus==="failed")return"border-danger/40 bg-danger/5";if(t.ciStatus==="pending")return"border-warning/40 bg-warning/5";if(t.ciStatus==="success")return"border-success/30 bg-success/5"}return t.state==="merged"?"border-merged/35 bg-merged/8":t.state==="closed"?"border-danger/35 bg-danger/5":"border-edge bg-surface"}function Ri(t,e){return t?e?`cursor://vscode-remote/ssh-remote+${e}${t}`:`cursor://file${t}`:null}function Ht(t){return t instanceof Error?t.message:String(t)}function un(t,e){return e.toLowerCase().includes(t.toLowerCase())}function ru(){const t=localStorage.getItem(Ja);return t&&Yh.includes(t)?t:"github-dark"}function iu(){var e;const t=(e=localStorage.getItem(hn))==null?void 0:e.trim();return t||null}function ko(t){if(t){localStorage.setItem(hn,t);return}localStorage.removeItem(hn)}function Qa(t){const e=Ya(t),i=document.documentElement;for(const[r,S]of Object.entries(e.colors))i.style.setProperty(`--color-${r}`,S);localStorage.setItem(Ja,t)}function su(){const t=localStorage.getItem(Za);if(t){const e=parseInt(t,10);if(!Number.isNaN(e)&&e>0)return e}return Jh}function Lo(t){localStorage.setItem(Za,String(Math.round(t)))}function el(t){switch(t){case"creating_worktree":return"Creating worktree";case"preparing_runtime":return"Preparing runtime";case"running_post_create_hook":return"Running post-create hook";case"starting_session":return"Starting session";case"reconciling":return"Reconciling";default:return"Creating"}}function nu(t,e,i,r){return t&&e||!r?t:i.length===0?null:(i.find(E=>E.mux==="✓")??i[0]).branch}var ou=ee('<a target="_blank" rel="noopener"> </a>'),au=ee("<span> </span>");function lu(t,e){qe(e,!0);let i=pe(e,"clickable",3,!1),r=he(()=>ws(e.pr));var S=Et(),E=Fe(S);{var C=l=>{var h=ou(),f=z(h);le(u=>{xe(h,"href",e.pr.url),Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),oe(f,b(r))},[()=>Eo(e.pr.state)]),q(l,h)},o=l=>{var h=au(),f=z(h);le(u=>{Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),oe(f,b(r))},[()=>Eo(e.pr.state)]),q(l,h)};ne(E,l=>{i()&&e.pr.url?l(C):l(o,-1)})}q(t,S),$e()}var cu=ee('<a target="_blank" rel="noopener noreferrer"> </a>'),hu=ee("<span> </span>");function tl(t,e){qe(e,!0);const i="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full";let r=pe(e,"clickable",3,!1),S=he(()=>`color: ${e.issue.state.color}; background: ${e.issue.state.color}20;`),E=he(()=>`${e.issue.identifier} (${e.issue.state.name})`);var C=Et(),o=Fe(C);{var l=f=>{var u=cu();Re(u,1,"shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80");var v=z(u);le(()=>{xe(u,"href",e.issue.url),Qt(u,b(S)),xe(u,"title",b(E)),oe(v,e.issue.identifier)}),q(f,u)},h=f=>{var u=hu();Re(u,1,bs(i));var v=z(u);le(()=>{Qt(u,b(S)),xe(u,"title",b(E)),oe(v,e.issue.identifier)}),q(f,u)};ne(o,f=>{r()?f(l):f(h,-1)})}q(t,C),$e()}var uu=ms('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="19" cy="12" r="1.5"></circle></svg>'),du=ms('<svg class="text-warning" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M12 7v2"></path><path d="M12 13h.01"></path></svg>'),fu=ms('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'),_u=ms('<svg class="text-danger" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'),vu=ee("<span><!> </span>");function pu(t,e){const i=f=>{var u=Et(),v=Fe(u);{var d=a=>{var s=uu();le(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},m=a=>{var s=du();le(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},_=a=>{var s=fu();le(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},n=a=>{var s=_u();le(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)};ne(v,a=>{e.status==="working"?a(d):e.status==="waiting"?a(m,1):e.status==="done"?a(_,2):e.status==="error"&&a(n,3)})}q(f,u)};let r=pe(e,"size",3,10),S=pe(e,"pill",3,!1);function E(f){return f==="working"?"bg-success/15 text-success":f==="waiting"?"bg-warning/15 text-warning":f==="done"?"bg-success/15 text-success":f==="error"?"bg-danger/15 text-danger":"bg-hover text-muted"}var C=Et(),o=Fe(C);{var l=f=>{var u=vu(),v=z(u);i(v);var d=$(v);le(m=>{Re(u,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${m??""}`),oe(d,` ${(e.status||"idle")??""}`)},[()=>E(e.status)]),q(f,u)},h=f=>{i(f)};ne(o,f=>{S()?f(l):f(h,-1)})}q(t,C)}var gu=ee('<span class="shrink-0 text-muted/60">↳</span>'),mu=ee('<span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </span>'),bu=ee('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),Su=ee('<span class="shrink-0 text-[10px] text-muted">closed</span>'),wu=ee('<span class="shrink-0"><!></span>'),yu=ee('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),Cu=ee("<span> </span>"),xu=ee("<span> </span>"),Eu=ee("<span> </span>"),ku=ee('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),Lu=ee('<li><button type="button"><span class="flex items-center gap-1.5 pr-5 flex-wrap"><div class="flex items-center gap-2 max-w-[90%] min-w-0"><!> <span class="font-medium truncate"> </span> <!> <!></div> <!> <!></span> <span class="flex gap-2 text-[11px] text-muted items-center flex-wrap"><!> <!></span> <!></button> <button type="button" class="absolute top-2 right-2 w-5 h-5 rounded flex items-center justify-center text-muted hover:text-danger hover:bg-hover opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer" title="Remove worktree">&times;</button></li>'),Du=ee('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function Tu(t,e){qe(e,!0);var i=Du();Je(i,21,()=>e.rows,r=>r.worktree.branch,(r,S)=>{const E=he(()=>b(S).worktree),C=he(()=>b(E).branch===e.selected),o=he(()=>e.removing.has(b(E).branch)),l=he(()=>b(E).mux!=="✓"),h=he(()=>e.initializing.has(b(E).branch)),f=he(()=>b(E).creating),u=he(()=>b(o)||b(h));var v=Lu(),d=z(v),m=z(d),_=z(m),n=z(_);{var a=N=>{var Q=gu();q(N,Q)};ne(n,N=>{b(S).depth>0&&N(a)})}var s=$(n,2),c=z(s),p=$(s,2);{var w=N=>{var Q=mu(),ie=$(z(Q));le(ue=>oe(ie,` ${ue??""}...`),[()=>el(b(E).creationPhase)]),q(N,Q)},y=N=>{var Q=bu();q(N,Q)},k=N=>{var Q=Su();q(N,Q)},g=N=>{var Q=wu(),ie=z(Q);pu(ie,{get status(){return b(E).agent},size:14}),q(N,Q)};ne(p,N=>{b(f)?N(w):b(h)?N(y,1):b(l)?N(k,2):N(g,-1)})}var x=$(p,2);{var T=N=>{var Q=yu();q(N,Q)},A=he(()=>e.notifiedBranches.has(b(E).branch));ne(x,N=>{b(A)&&N(T)})}var P=$(_,2);Je(P,17,()=>b(E).prs,N=>N.repo,(N,Q)=>{lu(N,{get pr(){return b(Q)}})});var B=$(P,2);{var H=N=>{tl(N,{get issue(){return b(E).linearIssue},clickable:!1})};ne(B,N=>{b(E).linearIssue&&N(H)})}var W=$(m,2),Y=z(W);{var J=N=>{var Q=Cu(),ie=z(Q);le(()=>oe(ie,b(E).agentName)),q(N,Q)};ne(Y,N=>{b(E).agentName&&N(J)})}var Z=$(Y,2);{var L=N=>{var Q=xu(),ie=z(Q);le(()=>oe(ie,b(E).profile)),q(N,Q)};ne(Z,N=>{b(E).profile&&N(L)})}var O=$(W,2);{var R=N=>{var Q=ku();Je(Q,21,()=>b(E).services,Bi,(ie,ue)=>{var j=Et(),D=Fe(j);{var V=M=>{var K=Eu(),X=z(K);le(()=>{Re(K,1,bs(b(ue).running?"text-success":"")),oe(X,`${b(ue).name??""}:${b(ue).port??""}`)}),q(M,K)};ne(D,M=>{b(ue).port&&M(V)})}q(ie,j)}),q(N,Q)};ne(O,N=>{b(E).services.length>0&&N(R)})}var I=$(d,2);le(()=>{Re(v,1,`mb-0.5 group relative ${b(u)?"opacity-40 pointer-events-none":""}`),d.disabled=b(u),Re(d,1,`w-full py-2.5 rounded-md border cursor-pointer flex flex-col gap-1 text-left text-inherit text-sm bg-transparent hover:bg-hover ${b(C)?"bg-active border-accent":"border-transparent"} ${b(l)&&!b(h)&&!b(f)?"opacity-50":""}`),Qt(d,`padding-left:${12+b(S).depth*18}px; padding-right:12px;`),oe(c,b(E).branch),I.disabled=b(u)}),ge("click",d,()=>e.onselect(b(E).branch)),ge("click",I,N=>{N.stopPropagation(),e.onremove(b(E).branch)}),q(r,v)}),q(t,i),$e()}bt(["click"]);var Ru=ee('<a class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-medium no-underline hover:opacity-80" title="Open in Cursor">Cursor</a>');function Rn(t,e){var i=Ru();le(()=>xe(i,"href",e.url)),q(t,i)}var Au=ee('<button type="button" title="View CI checks"><span></span> <span class="uppercase tracking-[0.08em] text-[9px]">CI</span></button>'),Bu=ee('<button type="button" title="Review PR comments"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg> <span> </span></button>'),Mu=ee('<div><a target="_blank" rel="noopener" title="Open PR"><span class="truncate"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17 17 7"></path><path d="M7 7h10v10"></path></svg></a> <!> <!></div>');function Ou(t,e){qe(e,!0);let i=he(()=>ws(e.pr)),r=he(()=>e.pr.ciChecks.length>0),S=he(()=>e.pr.comments.length>0);var E=Mu(),C=z(E),o=z(C),l=z(o),h=$(C,2);{var f=d=>{var m=Au(),_=z(m);le((n,a)=>{Re(m,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge ${n??""}`),xe(m,"aria-label",`View CI checks for ${b(i)}`),Re(_,1,`inline-block h-1.5 w-1.5 rounded-full ${a??""}`)},[()=>Qh(e.pr.ciStatus),()=>eu(e.pr.ciStatus)]),ge("click",m,n=>{n.stopPropagation(),e.onCiClick(e.pr)}),q(d,m)};ne(h,d=>{b(r)&&d(f)})}var u=$(h,2);{var v=d=>{var m=Bu();Re(m,1,"relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge text-accent");var _=$(z(m),2),n=z(_);le(()=>{xe(m,"aria-label",`Review ${e.pr.comments.length} comments for ${b(i)}`),oe(n,e.pr.comments.length)}),ge("click",m,a=>{a.stopPropagation(),e.onReviewsClick(e.pr)}),q(d,m)};ne(u,d=>{b(S)&&d(v)})}le((d,m)=>{Re(E,1,`shrink-0 inline-flex min-w-0 items-stretch overflow-hidden rounded-full border text-[10px] font-medium leading-none ${d??""}`),xe(C,"href",e.pr.url),Re(C,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent min-w-0 no-underline ${m??""}`),oe(l,b(i))},[()=>tu(e.pr),()=>Zh(e.pr.state)]),q(t,E),$e()}bt(["click"]);var Pu=ee('<span class="shrink-0 text-[10px] font-medium text-muted"> </span>'),Iu=ee('<a target="_blank" rel="noopener"> </a>'),Hu=ee('<div class="repo-group flex flex-wrap items-center gap-x-2 gap-y-1.5 min-w-0"><!> <!> <!> <!></div>');function Yi(t,e){let i=pe(e,"services",19,()=>[]),r=pe(e,"cursorUrl",3,null);var S=Hu(),E=z(S);{var C=u=>{var v=Pu(),d=z(v);le(()=>oe(d,`${e.label??""}:`)),q(u,v)};ne(E,u=>{e.label&&u(C)})}var o=$(E,2);Je(o,17,()=>e.prs,u=>`${u.repo}#${u.number}`,(u,v)=>{Ou(u,{get pr(){return b(v)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})});var l=$(o,2);Je(l,17,i,Bi,(u,v)=>{var d=Et(),m=Fe(d);{var _=n=>{var a=Iu(),s=z(a);le(()=>{xe(a,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${b(v).port??""}`),Re(a,1,`shrink-0 text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${b(v).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),oe(s,`${b(v).name??""} :${b(v).port??""}`)}),q(n,a)};ne(m,n=>{b(v).port&&n(_)})}q(u,d)});var h=$(l,2);{var f=u=>{Rn(u,{get url(){return r()}})};ne(h,u=>{r()&&u(f)})}q(t,S)}var Nu=ee("<button><!></button>");function _t(t,e){let i=pe(e,"variant",3,"default"),r=pe(e,"small",3,!1),S=pe(e,"class",3,""),E=Xa(e,["$$slots","$$events","$$legacy","variant","small","class","children"]);const C={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},o={default:"border-edge bg-surface text-primary hover:bg-hover",cta:"border-accent bg-accent text-white hover:opacity-90",danger:"border-danger bg-danger text-white hover:opacity-90","accent-outline":"border-accent text-accent bg-surface hover:bg-accent/10","danger-outline":"border-danger text-danger bg-surface hover:bg-danger/10"};var l=Nu();$a(l,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${C[r()?"small":"normal"]??""} ${o[i()]??""} ${S()??""}`,...E}));var h=z(l);Dn(h,()=>e.children),q(t,l)}var Fu=ee('<span class="text-success">&#10003;</span>'),Wu=ee('<span class="text-accent">&#9741;</span>'),Uu=ee('<span class="text-[10px] text-muted"> </span>'),ju=ee("<span> </span>"),zu=ee('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function rl(t,e){qe(e,!0);let i=pe(e,"showTimestamp",3,!1),r=pe(e,"large",3,!1),S=pe(e,"wrap",3,!1);var E=zu(),C=Fe(E),o=z(C);{var l=n=>{var a=Fu();q(n,a)},h=n=>{var a=Wu();q(n,a)};ne(o,n=>{e.notification.type==="agent_stopped"||e.notification.type==="worktree_auto_removed"?n(l):n(h,-1)})}var f=$(C,2),u=z(f),v=z(u),d=$(u,2);{var m=n=>{var a=Uu(),s=z(a);le(c=>oe(s,c),[()=>new Date(e.notification.timestamp).toLocaleTimeString()]),q(n,a)},_=n=>{var a=ju(),s=z(a);le(()=>{Re(a,1,`text-xs text-accent ${S()?"whitespace-normal break-all":"truncate"}`),oe(s,e.notification.url)}),q(n,a)};ne(d,n=>{i()?n(m):e.notification.url&&n(_,1)})}le(()=>{Re(C,1,`shrink-0 ${r()?"text-base":"text-sm"}`),Re(u,1,`${r()?"text-sm":"text-xs"} text-primary ${S()?"whitespace-normal break-words":"truncate"}`),oe(v,e.notification.message)}),q(t,E),$e()}var Ku=ee('<button type="button" class="p-1 -ml-1 cursor-pointer bg-transparent border-none text-muted hover:text-primary" title="Toggle sidebar"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>'),Vu=ee('<button type="button" class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning bg-transparent cursor-pointer hover:bg-warning/10"> </button>'),qu=ee('<div class="topbar-main-prs min-w-0 flex-1"><!></div>'),$u=ee("<!> <!> <!>",1),Gu=ee('<div class="more-dropdown svelte-gwjq7z"><div class="flex flex-col gap-2 p-3"><!> <!></div></div>'),Xu=ee('<div class="more-container relative"><button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="More info"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg></button> <!></div>'),Yu=ee('<span class="absolute -top-0.5 -right-0.5 w-4 h-4 rounded-full bg-accent text-white text-[10px] flex items-center justify-center leading-none"> </span>'),Ju=ee('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),Zu=ee('<li><button type="button" class="w-full px-3 py-2 text-left bg-transparent border-none text-inherit cursor-pointer hover:bg-hover flex items-center gap-2"><!></button></li>'),Qu=ee('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),ed=ee('<div class="bell-dropdown svelte-gwjq7z"><div class="text-xs font-semibold text-muted px-3 py-2 border-b border-edge">Notifications</div> <!></div>'),td=ee('<div class="flex items-stretch bg-topbar border-b border-edge min-h-12"><div class="flex-1 min-w-0 flex flex-col justify-center px-4 py-2.5 gap-1.5"><div class="topbar-main-row flex items-start gap-3 min-w-0"><div class="topbar-main-meta flex items-center gap-3 min-w-0"><!> <span class="min-w-0 text-sm font-semibold truncate"> </span> <!> <!></div> <!></div> <!></div> <div class="shrink-0 flex gap-2 items-center px-4"><!> <!> <div class="bell-container relative ml-3"><button type="button" class="relative p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Notifications"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"></path><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"></path></svg> <!></button> <!></div> <button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Settings"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button></div></div>');function rd(t,e){qe(e,!0);let i=pe(e,"linkedRepos",19,()=>[]),r=pe(e,"isMobile",3,!1),S=pe(e,"notificationHistory",19,()=>[]),E=pe(e,"unreadCount",3,0),C=se(!1),o=se(!1);function l(){var D;F(C,!b(C)),b(C)&&((D=e.onbellopen)==null||D.call(e))}function h(D){const V=D.target;V.closest(".bell-container")||F(C,!1),V.closest(".more-container")||F(o,!1)}function f(D,V){return!D||D.length<=V?D:`${D.slice(0,V-3)}...`}let u=he(()=>{var D;return Ri((D=e.worktree)==null?void 0:D.dir,e.sshHost)}),v=he(()=>f(e.name,30)),d=he(()=>{var D;return(((D=e.worktree)==null?void 0:D.prs)??[]).filter(V=>!V.repo||!i().some(M=>M.alias===V.repo))}),m=he(()=>i().map(D=>{var V;return{alias:D.alias,dir:D.dir,cursorUrl:Ri(D.dir&&e.name?`${D.dir}/${e.name}`:null,e.sshHost),prs:(((V=e.worktree)==null?void 0:V.prs)??[]).filter(M=>M.repo===D.alias)}}).filter(D=>D.prs.length>0||D.cursorUrl)),_=he(()=>b(d).length>0||b(m).length>0);var n=td();wr("click",tn,h);var a=z(n),s=z(a),c=z(s),p=z(c);{var w=D=>{var V=Ku();ge("click",V,function(...M){var K;(K=e.ontogglesidebar)==null||K.apply(this,M)}),q(D,V)};ne(p,D=>{r()&&e.ontogglesidebar&&D(w)})}var y=$(p,2),k=z(y),g=$(y,2);{var x=D=>{var V=Vu(),M=z(V);le(()=>oe(M,e.worktree.dirty?"dirty":"unpushed")),ge("click",V,function(...K){var X;(X=e.ondirtyclick)==null||X.apply(this,K)}),q(D,V)};ne(g,D=>{var V,M;((V=e.worktree)!=null&&V.dirty||(M=e.worktree)!=null&&M.unpushed)&&D(x)})}var T=$(g,2);{var A=D=>{tl(D,{get issue(){return e.worktree.linearIssue},clickable:!0})};ne(T,D=>{var V;(V=e.worktree)!=null&&V.linearIssue&&D(A)})}var P=$(c,2);{var B=D=>{var V=qu(),M=z(V);{let K=he(()=>{var X;return((X=e.worktree)==null?void 0:X.services)??[]});Yi(M,{get prs(){return b(d)},get services(){return b(K)},get cursorUrl(){return b(u)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}q(D,V)};ne(P,D=>{r()||D(B)})}var H=$(s,2);{var W=D=>{var V=Et(),M=Fe(V);Je(M,17,()=>b(m),K=>K.alias,(K,X)=>{Yi(K,{get label(){return b(X).alias},get prs(){return b(X).prs},get cursorUrl(){return b(X).cursorUrl},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(D,V)};ne(H,D=>{r()||D(W)})}var Y=$(a,2),J=z(Y);{var Z=D=>{var V=$u(),M=Fe(V);{var K=ae=>{_t(ae,{variant:"default",get onclick(){return e.onclose},title:"Close worktree window",children:(de,ve)=>{var te=Ye();le(()=>oe(te,r()?"C":"Close")),q(de,te)},$$slots:{default:!0}})};ne(M,ae=>{e.worktree.mux==="✓"&&ae(K)})}var X=$(M,2);_t(X,{variant:"accent-outline",get onclick(){return e.onmerge},title:"Merge worktree",children:(ae,de)=>{var ve=Ye();le(()=>oe(ve,r()?"M":"Merge")),q(ae,ve)},$$slots:{default:!0}});var ce=$(X,2);_t(ce,{variant:"danger-outline",get onclick(){return e.onremove},title:"Remove worktree",children:(ae,de)=>{var ve=Ye();le(()=>oe(ve,r()?"R":"Remove")),q(ae,ve)},$$slots:{default:!0}}),q(D,V)};ne(J,D=>{e.worktree&&D(Z)})}var L=$(J,2);{var O=D=>{var V=Xu(),M=z(V),K=$(M,2);{var X=ce=>{var ae=Gu(),de=z(ae),ve=z(de);Yi(ve,{get prs(){return b(d)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}});var te=$(ve,2);Je(te,17,()=>b(m),fe=>fe.alias,(fe,ye)=>{Yi(fe,{get label(){return b(ye).alias},get prs(){return b(ye).prs},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(ce,ae)};ne(K,ce=>{b(o)&&ce(X)})}ge("keydown",V,()=>{}),ge("click",M,()=>{F(o,!b(o))}),q(D,V)};ne(L,D=>{r()&&e.worktree&&b(_)&&D(O)})}var R=$(L,2),I=z(R),N=$(z(I),2);{var Q=D=>{var V=Yu(),M=z(V);le(()=>oe(M,E()>9?"9+":E())),q(D,V)};ne(N,D=>{E()>0&&D(Q)})}var ie=$(I,2);{var ue=D=>{var V=ed(),M=$(z(V),2);{var K=ce=>{var ae=Ju();q(ce,ae)},X=ce=>{var ae=Qu();Je(ae,21,S,de=>de.id,(de,ve)=>{var te=Zu(),fe=z(te),ye=z(fe);rl(ye,{get notification(){return b(ve)},showTimestamp:!0}),ge("click",fe,()=>{var Ee;(Ee=e.onnotificationselect)==null||Ee.call(e,b(ve).branch),F(C,!1)}),q(de,te)}),q(ce,ae)};ne(M,ce=>{S().length===0?ce(K):ce(X,-1)})}q(D,V)};ne(ie,D=>{b(C)&&D(ue)})}var j=$(R,2);le(()=>{xe(y,"title",e.name??void 0),oe(k,b(v)??"Select a worktree")}),ge("keydown",R,()=>{}),ge("click",I,l),ge("click",j,function(...D){var V;(V=e.onsettings)==null||V.apply(this,D)}),q(t,n),$e()}bt(["click","keydown"]);var Ns={exports:{}},Do;function id(){return Do||(Do=1,(function(t,e){(function(i,r){t.exports=r()})(globalThis,(()=>(()=>{var i={4567:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=l(9042),v=l(9924),d=l(844),m=l(4725),_=l(2585),n=l(3656);let a=o.AccessibilityManager=class extends d.Disposable{constructor(s,c,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
1
+ var Jl=Object.defineProperty;var lo=t=>{throw TypeError(t)};var Zl=(t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var qt=(t,e,i)=>Zl(t,typeof e!="symbol"?e+"":e,i),As=(t,e,i)=>e.has(t)||lo("Cannot "+i);var G=(t,e,i)=>(As(t,e,"read from private field"),i?i.call(t):e.get(t)),we=(t,e,i)=>e.has(t)?lo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),De=(t,e,i,r)=>(As(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),ze=(t,e,i)=>(As(t,e,"access private method"),i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))r(S);new MutationObserver(S=>{for(const E of S)if(E.type==="childList")for(const C of E.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&r(C)}).observe(document,{childList:!0,subtree:!0});function i(S){const E={};return S.integrity&&(E.integrity=S.integrity),S.referrerPolicy&&(E.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?E.credentials="include":S.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function r(S){if(S.ep)return;S.ep=!0;const E=i(S);fetch(S.href,E)}})();const Ql="5";var qo;typeof window<"u"&&((qo=window.__svelte??(window.__svelte={})).v??(qo.v=new Set)).add(Ql);const ec=1,tc=2,Xo=4,rc=8,ic=16,sc=1,nc=4,oc=8,ac=16,lc=1,cc=2,at=Symbol(),Yo="http://www.w3.org/1999/xhtml",hc="http://www.w3.org/2000/svg",uc="http://www.w3.org/1998/Math/MathML",dc="@attach",fc=!1;var _n=Array.isArray,_c=Array.prototype.indexOf,pi=Array.prototype.includes,fs=Array.from,vc=Object.defineProperty,li=Object.getOwnPropertyDescriptor,Jo=Object.getOwnPropertyDescriptors,pc=Object.prototype,gc=Array.prototype,vn=Object.getPrototypeOf,co=Object.isExtensible;const mc=()=>{};function bc(t){for(var e=0;e<t.length;e++)t[e]()}function Zo(){var t,e,i=new Promise((r,S)=>{t=r,e=S});return{promise:i,resolve:t,reject:e}}const ct=2,gi=4,_s=8,pn=1<<24,kr=16,Zt=32,Zr=64,Vs=128,jt=512,st=1024,dt=2048,ur=4096,Tt=8192,Nt=16384,ii=32768,qs=1<<25,Qr=65536,$s=1<<17,Sc=1<<18,yi=1<<19,wc=1<<20,lr=1<<25,ei=65536,Gs=1<<21,vs=1<<22,Ir=1<<23,yr=Symbol("$state"),yc=Symbol("legacy props"),Cc=Symbol(""),pr=new class extends Error{constructor(){super(...arguments);qt(this,"name","StaleReactionError");qt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var $o;const gn=!!(($o=globalThis.document)!=null&&$o.contentType)&&globalThis.document.contentType.includes("xml");function Qo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ec(t,e,i){throw new Error("https://svelte.dev/e/each_key_duplicate")}function kc(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Lc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Dc(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Tc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rc(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ac(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Bc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Mc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Oc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Pc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ic(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ea(t){return t===this.v}function ta(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function ra(t){return!ta(t,this.v)}let Hc=!1,xt=null;function mi(t){xt=t}function qe(t,e=!1,i){xt={p:xt,i:!1,c:null,e:null,s:t,x:null,r:Te,l:null}}function $e(t){var e=xt,i=e.e;if(i!==null){e.e=null;for(var r of i)ka(r)}return t!==void 0&&(e.x=t),e.i=!0,xt=e.p,t??{}}function ia(){return!0}let zr=[];function sa(){var t=zr;zr=[],bc(t)}function Cr(t){if(zr.length===0&&!Ti){var e=zr;queueMicrotask(()=>{e===zr&&sa()})}zr.push(t)}function Nc(){for(;zr.length>0;)sa()}function na(t){var e=Te;if(e===null)return Le.f|=Ir,t;if((e.f&ii)===0&&(e.f&gi)===0)throw t;Pr(t,e)}function Pr(t,e){for(;e!==null;){if((e.f&Vs)!==0){if((e.f&ii)===0)throw t;try{e.b.error(t);return}catch(i){t=i}}e=e.parent}throw t}const Fc=-7169;function Qe(t,e){t.f=t.f&Fc|e}function mn(t){(t.f&jt)!==0||t.deps===null?Qe(t,st):Qe(t,ur)}function oa(t){if(t!==null)for(const e of t)(e.f&ct)===0||(e.f&ei)===0||(e.f^=ei,oa(e.deps))}function aa(t,e,i){(t.f&dt)!==0?e.add(t):(t.f&ur)!==0&&i.add(t),oa(t.deps),Qe(t,st)}let Gi=!1;function Wc(t){var e=Gi;try{return Gi=!1,[t(),Gi]}finally{Gi=e}}const Tr=new Set;let be=null,ut=null,Xs=null,Ti=!1,Bs=!1,ai=null,Zi=null;var ho=0;let Uc=1;var ui,di,gr,ir,Pi,Ot,Ii,Br,mr,sr,fi,qr,rt,Qi,la,es,Ys,Js,ca;const ls=class ls{constructor(){we(this,rt);qt(this,"id",Uc++);qt(this,"current",new Map);qt(this,"previous",new Map);we(this,ui,new Set);we(this,di,new Set);we(this,gr,new Map);we(this,ir,new Map);we(this,Pi,null);we(this,Ot,[]);we(this,Ii,[]);we(this,Br,new Set);we(this,mr,new Set);we(this,sr,new Map);qt(this,"is_fork",!1);we(this,fi,!1);we(this,qr,new Set)}skip_effect(e){G(this,sr).has(e)||G(this,sr).set(e,{d:[],m:[]})}unskip_effect(e){var i=G(this,sr).get(e);if(i){G(this,sr).delete(e);for(var r of i.d)Qe(r,dt),this.schedule(r);for(r of i.m)Qe(r,ur),this.schedule(r)}}capture(e,i,r=!1){i!==at&&!this.previous.has(e)&&this.previous.set(e,i),(e.f&Ir)===0&&(this.current.set(e,[e.v,r]),ut==null||ut.set(e,e.v))}activate(){be=this}deactivate(){be=null,ut=null}flush(){try{Bs=!0,be=this,ze(this,rt,es).call(this)}finally{ho=0,Xs=null,ai=null,Zi=null,Bs=!1,be=null,ut=null,Hr.clear()}}discard(){for(const e of G(this,di))e(this);G(this,di).clear(),Tr.delete(this)}register_created_effect(e){G(this,Ii).push(e)}increment(e,i){let r=G(this,gr).get(i)??0;if(G(this,gr).set(i,r+1),e){let S=G(this,ir).get(i)??0;G(this,ir).set(i,S+1)}}decrement(e,i,r){let S=G(this,gr).get(i)??0;if(S===1?G(this,gr).delete(i):G(this,gr).set(i,S-1),e){let E=G(this,ir).get(i)??0;E===1?G(this,ir).delete(i):G(this,ir).set(i,E-1)}G(this,fi)||r||(De(this,fi,!0),Cr(()=>{De(this,fi,!1),this.flush()}))}transfer_effects(e,i){for(const r of e)G(this,Br).add(r);for(const r of i)G(this,mr).add(r);e.clear(),i.clear()}oncommit(e){G(this,ui).add(e)}ondiscard(e){G(this,di).add(e)}settled(){return(G(this,Pi)??De(this,Pi,Zo())).promise}static ensure(){if(be===null){const e=be=new ls;Bs||(Tr.add(be),Ti||Cr(()=>{be===e&&e.flush()}))}return be}apply(){{ut=null;return}}schedule(e){var S;if(Xs=e,(S=e.b)!=null&&S.is_pending&&(e.f&(gi|_s|pn))!==0&&(e.f&ii)===0){e.b.defer_effect(e);return}for(var i=e;i.parent!==null;){i=i.parent;var r=i.f;if(ai!==null&&i===Te&&(Le===null||(Le.f&ct)===0))return;if((r&(Zr|Zt))!==0){if((r&st)===0)return;i.f^=st}}G(this,Ot).push(i)}};ui=new WeakMap,di=new WeakMap,gr=new WeakMap,ir=new WeakMap,Pi=new WeakMap,Ot=new WeakMap,Ii=new WeakMap,Br=new WeakMap,mr=new WeakMap,sr=new WeakMap,fi=new WeakMap,qr=new WeakMap,rt=new WeakSet,Qi=function(){return this.is_fork||G(this,ir).size>0},la=function(){for(const r of G(this,qr))for(const S of G(r,ir).keys()){for(var e=!1,i=S;i.parent!==null;){if(G(this,sr).has(i)){e=!0;break}i=i.parent}if(!e)return!0}return!1},es=function(){var o,l;if(ho++>1e3&&(Tr.delete(this),zc()),!ze(this,rt,Qi).call(this)){for(const h of G(this,Br))G(this,mr).delete(h),Qe(h,dt),this.schedule(h);for(const h of G(this,mr))Qe(h,ur),this.schedule(h)}const e=G(this,Ot);De(this,Ot,[]),this.apply();var i=ai=[],r=[],S=Zi=[];for(const h of e)try{ze(this,rt,Ys).call(this,h,i,r)}catch(f){throw da(h),f}if(be=null,S.length>0){var E=ls.ensure();for(const h of S)E.schedule(h)}if(ai=null,Zi=null,ze(this,rt,Qi).call(this)||ze(this,rt,la).call(this)){ze(this,rt,Js).call(this,r),ze(this,rt,Js).call(this,i);for(const[h,f]of G(this,sr))ua(h,f)}else{G(this,gr).size===0&&Tr.delete(this),G(this,Br).clear(),G(this,mr).clear();for(const h of G(this,ui))h(this);G(this,ui).clear(),uo(r),uo(i),(o=G(this,Pi))==null||o.resolve()}var C=be;if(G(this,Ot).length>0){const h=C??(C=this);G(h,Ot).push(...G(this,Ot).filter(f=>!G(h,Ot).includes(f)))}C!==null&&(Tr.add(C),ze(l=C,rt,es).call(l)),Tr.has(this)||ze(this,rt,ca).call(this)},Ys=function(e,i,r){e.f^=st;for(var S=e.first;S!==null;){var E=S.f,C=(E&(Zt|Zr))!==0,o=C&&(E&st)!==0,l=o||(E&Tt)!==0||G(this,sr).has(S);if(!l&&S.fn!==null){C?S.f^=st:(E&gi)!==0?i.push(S):Vi(S)&&((E&kr)!==0&&G(this,mr).add(S),Si(S));var h=S.first;if(h!==null){S=h;continue}}for(;S!==null;){var f=S.next;if(f!==null){S=f;break}S=S.parent}}},Js=function(e){for(var i=0;i<e.length;i+=1)aa(e[i],G(this,Br),G(this,mr))},ca=function(){var f,u,v;for(const d of Tr){var e=d.id<this.id,i=[];for(const[m,[_,n]]of this.current){if(d.current.has(m)){var r=d.current.get(m)[0];if(e&&_!==r)d.current.set(m,[_,n]);else continue}i.push(m)}var S=[...d.current.keys()].filter(m=>!this.current.has(m));if(S.length===0)e&&d.discard();else if(i.length>0){d.activate();var E=new Set,C=new Map;for(var o of i)ha(o,S,E,C);C=new Map;var l=[...d.current.keys()].filter(m=>this.current.has(m)?this.current.get(m)[0]!==m:!0);for(const m of G(this,Ii))(m.f&(Nt|Tt|$s))===0&&bn(m,l,C)&&((m.f&(vs|kr))!==0?(Qe(m,dt),d.schedule(m)):G(d,Br).add(m));if(G(d,Ot).length>0){d.apply();for(var h of G(d,Ot))ze(f=d,rt,Ys).call(f,h,[],[]);De(d,Ot,[])}d.deactivate()}}for(const d of Tr)G(d,qr).has(this)&&(G(d,qr).delete(this),G(d,qr).size===0&&!ze(u=d,rt,Qi).call(u)&&(d.activate(),ze(v=d,rt,es).call(v)))};let ti=ls;function jc(t){var e=Ti;Ti=!0;try{for(var i;;){if(Nc(),be===null)return i;be.flush()}}finally{Ti=e}}function zc(){try{Tc()}catch(t){Pr(t,Xs)}}let $t=null;function uo(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var r=t[i++];if((r.f&(Nt|Tt))===0&&Vi(r)&&($t=new Set,Si(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Ra(r),($t==null?void 0:$t.size)>0)){Hr.clear();for(const S of $t){if((S.f&(Nt|Tt))!==0)continue;const E=[S];let C=S.parent;for(;C!==null;)$t.has(C)&&($t.delete(C),E.push(C)),C=C.parent;for(let o=E.length-1;o>=0;o--){const l=E[o];(l.f&(Nt|Tt))===0&&Si(l)}}$t.clear()}}$t=null}}function ha(t,e,i,r){if(!i.has(t)&&(i.add(t),t.reactions!==null))for(const S of t.reactions){const E=S.f;(E&ct)!==0?ha(S,e,i,r):(E&(vs|kr))!==0&&(E&dt)===0&&bn(S,e,r)&&(Qe(S,dt),Sn(S))}}function bn(t,e,i){const r=i.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const S of t.deps){if(pi.call(e,S))return!0;if((S.f&ct)!==0&&bn(S,e,i))return i.set(S,!0),!0}return i.set(t,!1),!1}function Sn(t){be.schedule(t)}function ua(t,e){if(!((t.f&Zt)!==0&&(t.f&st)!==0)){(t.f&dt)!==0?e.d.push(t):(t.f&ur)!==0&&e.m.push(t),Qe(t,st);for(var i=t.first;i!==null;)ua(i,e),i=i.next}}function da(t){Qe(t,st);for(var e=t.first;e!==null;)da(e),e=e.next}function Kc(t){let e=0,i=Fr(0),r;return()=>{yn()&&(b(i),zi(()=>(e===0&&(r=Lr(()=>t(()=>Nr(i)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,Nr(i))})})))}}var Vc=Qr|yi;function qc(t,e,i,r){new $c(t,e,i,r)}var Ut,fn,nr,$r,kt,or,Pt,Gt,br,Gr,Mr,_i,Hi,Ni,Sr,cs,nt,Gc,Xc,Yc,Zs,ts,rs,Qs;class $c{constructor(e,i,r,S){we(this,nt);qt(this,"parent");qt(this,"is_pending",!1);qt(this,"transform_error");we(this,Ut);we(this,fn,null);we(this,nr);we(this,$r);we(this,kt);we(this,or,null);we(this,Pt,null);we(this,Gt,null);we(this,br,null);we(this,Gr,0);we(this,Mr,0);we(this,_i,!1);we(this,Hi,new Set);we(this,Ni,new Set);we(this,Sr,null);we(this,cs,Kc(()=>(De(this,Sr,Fr(G(this,Gr))),()=>{De(this,Sr,null)})));var E;De(this,Ut,e),De(this,nr,i),De(this,$r,C=>{var o=Te;o.b=this,o.f|=Vs,r(C)}),this.parent=Te.b,this.transform_error=S??((E=this.parent)==null?void 0:E.transform_error)??(C=>C),De(this,kt,Ki(()=>{ze(this,nt,Zs).call(this)},Vc))}defer_effect(e){aa(e,G(this,Hi),G(this,Ni))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!G(this,nr).pending}update_pending_count(e,i){ze(this,nt,Qs).call(this,e,i),De(this,Gr,G(this,Gr)+e),!(!G(this,Sr)||G(this,_i))&&(De(this,_i,!0),Cr(()=>{De(this,_i,!1),G(this,Sr)&&bi(G(this,Sr),G(this,Gr))}))}get_effect_pending(){return G(this,cs).call(this),b(G(this,Sr))}error(e){var i=G(this,nr).onerror;let r=G(this,nr).failed;if(!i&&!r)throw e;G(this,or)&&(ft(G(this,or)),De(this,or,null)),G(this,Pt)&&(ft(G(this,Pt)),De(this,Pt,null)),G(this,Gt)&&(ft(G(this,Gt)),De(this,Gt,null));var S=!1,E=!1;const C=()=>{if(S){Ic();return}S=!0,E&&Oc(),G(this,Gt)!==null&&Yr(G(this,Gt),()=>{De(this,Gt,null)}),ze(this,nt,rs).call(this,()=>{ze(this,nt,Zs).call(this)})},o=l=>{try{E=!0,i==null||i(l,C),E=!1}catch(h){Pr(h,G(this,kt)&&G(this,kt).parent)}r&&De(this,Gt,ze(this,nt,rs).call(this,()=>{try{return Dt(()=>{var h=Te;h.b=this,h.f|=Vs,r(G(this,Ut),()=>l,()=>C)})}catch(h){return Pr(h,G(this,kt).parent),null}}))};Cr(()=>{var l;try{l=this.transform_error(e)}catch(h){Pr(h,G(this,kt)&&G(this,kt).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,h=>Pr(h,G(this,kt)&&G(this,kt).parent)):o(l)})}}Ut=new WeakMap,fn=new WeakMap,nr=new WeakMap,$r=new WeakMap,kt=new WeakMap,or=new WeakMap,Pt=new WeakMap,Gt=new WeakMap,br=new WeakMap,Gr=new WeakMap,Mr=new WeakMap,_i=new WeakMap,Hi=new WeakMap,Ni=new WeakMap,Sr=new WeakMap,cs=new WeakMap,nt=new WeakSet,Gc=function(){try{De(this,or,Dt(()=>G(this,$r).call(this,G(this,Ut))))}catch(e){this.error(e)}},Xc=function(e){const i=G(this,nr).failed;i&&De(this,Gt,Dt(()=>{i(G(this,Ut),()=>e,()=>()=>{})}))},Yc=function(){const e=G(this,nr).pending;e&&(this.is_pending=!0,De(this,Pt,Dt(()=>e(G(this,Ut)))),Cr(()=>{var i=De(this,br,document.createDocumentFragment()),r=xr();i.append(r),De(this,or,ze(this,nt,rs).call(this,()=>Dt(()=>G(this,$r).call(this,r)))),G(this,Mr)===0&&(G(this,Ut).before(i),De(this,br,null),Yr(G(this,Pt),()=>{De(this,Pt,null)}),ze(this,nt,ts).call(this,be))}))},Zs=function(){try{if(this.is_pending=this.has_pending_snippet(),De(this,Mr,0),De(this,Gr,0),De(this,or,Dt(()=>{G(this,$r).call(this,G(this,Ut))})),G(this,Mr)>0){var e=De(this,br,document.createDocumentFragment());kn(G(this,or),e);const i=G(this,nr).pending;De(this,Pt,Dt(()=>i(G(this,Ut))))}else ze(this,nt,ts).call(this,be)}catch(i){this.error(i)}},ts=function(e){this.is_pending=!1,e.transfer_effects(G(this,Hi),G(this,Ni))},rs=function(e){var i=Te,r=Le,S=xt;dr(G(this,kt)),Kt(G(this,kt)),mi(G(this,kt).ctx);try{return ti.ensure(),e()}catch(E){return na(E),null}finally{dr(i),Kt(r),mi(S)}},Qs=function(e,i){var r;if(!this.has_pending_snippet()){this.parent&&ze(r=this.parent,nt,Qs).call(r,e,i);return}De(this,Mr,G(this,Mr)+e),G(this,Mr)===0&&(ze(this,nt,ts).call(this,i),G(this,Pt)&&Yr(G(this,Pt),()=>{De(this,Pt,null)}),G(this,br)&&(G(this,Ut).before(G(this,br)),De(this,br,null)))};function fa(t,e,i,r){const S=ps;var E=t.filter(v=>!v.settled);if(i.length===0&&E.length===0){r(e.map(S));return}var C=Te,o=Jc(),l=E.length===1?E[0].promise:E.length>1?Promise.all(E.map(v=>v.promise)):null;function h(v){o();try{r(v)}catch(d){(C.f&Nt)===0&&Pr(d,C)}os()}if(i.length===0){l.then(()=>h(e.map(S)));return}var f=_a();function u(){Promise.all(i.map(v=>Zc(v))).then(v=>h([...e.map(S),...v])).catch(v=>Pr(v,C)).finally(()=>f())}l?l.then(()=>{o(),u(),os()}):u()}function Jc(){var t=Te,e=Le,i=xt,r=be;return function(E=!0){dr(t),Kt(e),mi(i),E&&(t.f&Nt)===0&&(r==null||r.activate(),r==null||r.apply())}}function os(t=!0){dr(null),Kt(null),mi(null),t&&(be==null||be.deactivate())}function _a(){var t=Te,e=t.b,i=be,r=e.is_rendered();return e.update_pending_count(1,i),i.increment(r,t),(S=!1)=>{e.update_pending_count(-1,i),i.decrement(r,t,S)}}function ps(t){var e=ct|dt,i=Le!==null&&(Le.f&ct)!==0?Le:null;return Te!==null&&(Te.f|=yi),{ctx:xt,deps:null,effects:null,equals:ea,f:e,fn:t,reactions:null,rv:0,v:at,wv:0,parent:i??Te,ac:null}}function Zc(t,e,i){let r=Te;r===null&&xc();var S=void 0,E=Fr(at),C=!Le,o=new Map;return fh(()=>{var d;var l=Te,h=Zo();S=h.promise;try{Promise.resolve(t()).then(h.resolve,h.reject).finally(os)}catch(m){h.reject(m),os()}var f=be;if(C){if((l.f&ii)!==0)var u=_a();if(r.b.is_rendered())(d=o.get(f))==null||d.reject(pr),o.delete(f);else{for(const m of o.values())m.reject(pr);o.clear()}o.set(f,h)}const v=(m,_=void 0)=>{if(u){var n=_===pr;u(n)}if(!(_===pr||(l.f&Nt)!==0)){if(f.activate(),_)E.f|=Ir,bi(E,_);else{(E.f&Ir)!==0&&(E.f^=Ir),bi(E,m);for(const[a,s]of o){if(o.delete(a),a===f)break;s.reject(pr)}}f.deactivate()}};h.promise.then(v,m=>v(null,m||"unknown"))}),Cn(()=>{for(const l of o.values())l.reject(pr)}),new Promise(l=>{function h(f){function u(){f===S?l(E):h(S)}f.then(u,u)}h(S)})}function le(t){const e=ps(t);return Ma(e),e}function va(t){const e=ps(t);return e.equals=ra,e}function Qc(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)ft(e[i])}}function eh(t){for(var e=t.parent;e!==null;){if((e.f&ct)===0)return(e.f&Nt)===0?e:null;e=e.parent}return null}function wn(t){var e,i=Te;dr(eh(t));try{t.f&=~ei,Qc(t),e=Ha(t)}finally{dr(i)}return e}function pa(t){var e=t.v,i=wn(t);if(!t.equals(i)&&(t.wv=Pa(),(!(be!=null&&be.is_fork)||t.deps===null)&&(t.v=i,be==null||be.capture(t,e,!0),t.deps===null))){Qe(t,st);return}Wr||(ut!==null?(yn()||be!=null&&be.is_fork)&&ut.set(t,i):mn(t))}function th(t){var e,i;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(i=r.ac)==null||i.abort(pr),r.teardown=mc,r.ac=null,Ai(r,0),xn(r))}function ga(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&Si(e)}let en=new Set;const Hr=new Map;let ma=!1;function Fr(t,e){var i={f:0,v:t,reactions:null,equals:ea,rv:0,wv:0};return i}function se(t,e){const i=Fr(t);return Ma(i),i}function rh(t,e=!1,i=!0){const r=Fr(t);return e||(r.equals=ra),r}function W(t,e,i=!1){Le!==null&&(!Jt||(Le.f&$s)!==0)&&ia()&&(Le.f&(ct|kr|vs|$s))!==0&&(zt===null||!pi.call(zt,t))&&Mc();let r=i?Pe(e):e;return bi(t,r,Zi)}function bi(t,e,i=null){if(!t.equals(e)){var r=t.v;Wr?Hr.set(t,e):Hr.set(t,r),t.v=e;var S=ti.ensure();if(S.capture(t,r),(t.f&ct)!==0){const E=t;(t.f&dt)!==0&&wn(E),ut===null&&mn(E)}t.wv=Pa(),ba(t,dt,i),Te!==null&&(Te.f&st)!==0&&(Te.f&(Zt|Zr))===0&&(Wt===null?vh([t]):Wt.push(t)),!S.is_fork&&en.size>0&&!ma&&ih()}return e}function ih(){ma=!1;for(const t of en)(t.f&st)!==0&&Qe(t,ur),Vi(t)&&Si(t);en.clear()}function sh(t,e=1){var i=b(t),r=e===1?i++:i--;return W(t,i),r}function Nr(t){W(t,t.v+1)}function ba(t,e,i){var r=t.reactions;if(r!==null)for(var S=r.length,E=0;E<S;E++){var C=r[E],o=C.f,l=(o&dt)===0;if(l&&Qe(C,e),(o&ct)!==0){var h=C;ut==null||ut.delete(h),(o&ei)===0&&(o&jt&&(C.f|=ei),ba(h,ur,i))}else if(l){var f=C;(o&kr)!==0&&$t!==null&&$t.add(f),i!==null?i.push(f):Sn(f)}}}function Pe(t){if(typeof t!="object"||t===null||yr in t)return t;const e=vn(t);if(e!==pc&&e!==gc)return t;var i=new Map,r=_n(t),S=se(0),E=Er,C=o=>{if(Er===E)return o();var l=Le,h=Er;Kt(null),po(E);var f=o();return Kt(l),po(h),f};return r&&i.set("length",se(t.length)),new Proxy(t,{defineProperty(o,l,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&Ac();var f=i.get(l);return f===void 0?C(()=>{var u=se(h.value);return i.set(l,u),u}):W(f,h.value,!0),!0},deleteProperty(o,l){var h=i.get(l);if(h===void 0){if(l in o){const f=C(()=>se(at));i.set(l,f),Nr(S)}}else W(h,at),Nr(S);return!0},get(o,l,h){var d;if(l===yr)return t;var f=i.get(l),u=l in o;if(f===void 0&&(!u||(d=li(o,l))!=null&&d.writable)&&(f=C(()=>{var m=Pe(u?o[l]:at),_=se(m);return _}),i.set(l,f)),f!==void 0){var v=b(f);return v===at?void 0:v}return Reflect.get(o,l,h)},getOwnPropertyDescriptor(o,l){var h=Reflect.getOwnPropertyDescriptor(o,l);if(h&&"value"in h){var f=i.get(l);f&&(h.value=b(f))}else if(h===void 0){var u=i.get(l),v=u==null?void 0:u.v;if(u!==void 0&&v!==at)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return h},has(o,l){var v;if(l===yr)return!0;var h=i.get(l),f=h!==void 0&&h.v!==at||Reflect.has(o,l);if(h!==void 0||Te!==null&&(!f||(v=li(o,l))!=null&&v.writable)){h===void 0&&(h=C(()=>{var d=f?Pe(o[l]):at,m=se(d);return m}),i.set(l,h));var u=b(h);if(u===at)return!1}return f},set(o,l,h,f){var c;var u=i.get(l),v=l in o;if(r&&l==="length")for(var d=h;d<u.v;d+=1){var m=i.get(d+"");m!==void 0?W(m,at):d in o&&(m=C(()=>se(at)),i.set(d+"",m))}if(u===void 0)(!v||(c=li(o,l))!=null&&c.writable)&&(u=C(()=>se(void 0)),W(u,Pe(h)),i.set(l,u));else{v=u.v!==at;var _=C(()=>Pe(h));W(u,_)}var n=Reflect.getOwnPropertyDescriptor(o,l);if(n!=null&&n.set&&n.set.call(f,h),!v){if(r&&typeof l=="string"){var a=i.get("length"),s=Number(l);Number.isInteger(s)&&s>=a.v&&W(a,s+1)}Nr(S)}return!0},ownKeys(o){b(S);var l=Reflect.ownKeys(o).filter(u=>{var v=i.get(u);return v===void 0||v.v!==at});for(var[h,f]of i)f.v!==at&&!(h in o)&&l.push(h);return l},setPrototypeOf(){Bc()}})}function fo(t){try{if(t!==null&&typeof t=="object"&&yr in t)return t[yr]}catch{}return t}function nh(t,e){return Object.is(fo(t),fo(e))}var tn,Sa,wa,ya;function oh(){if(tn===void 0){tn=window,Sa=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;wa=li(e,"firstChild").get,ya=li(e,"nextSibling").get,co(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),co(i)&&(i.__t=void 0)}}function xr(t=""){return document.createTextNode(t)}function cr(t){return wa.call(t)}function Ui(t){return ya.call(t)}function z(t,e){return cr(t)}function Fe(t,e=!1){{var i=cr(t);return i instanceof Comment&&i.data===""?Ui(i):i}}function $(t,e=1,i=!1){let r=t;for(;e--;)r=Ui(r);return r}function ah(t){t.textContent=""}function Ca(){return!1}function xa(t,e,i){return document.createElementNS(e??Yo,t,void 0)}function lh(t,e){if(e){const i=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===i&&t.focus()})}}let _o=!1;function ch(){_o||(_o=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const i of t.target.elements)(e=i.__on_r)==null||e.call(i)})},{capture:!0}))}function gs(t){var e=Le,i=Te;Kt(null),dr(null);try{return t()}finally{Kt(e),dr(i)}}function Ea(t,e,i,r=i){t.addEventListener(e,()=>gs(i));const S=t.__on_r;S?t.__on_r=()=>{S(),r(!0)}:t.__on_r=()=>r(!0),ch()}function hh(t){Te===null&&(Le===null&&Dc(),Lc()),Wr&&kc()}function uh(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function fr(t,e){var i=Te;i!==null&&(i.f&Tt)!==0&&(t|=Tt);var r={ctx:xt,deps:null,nodes:null,f:t|dt|jt,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};be==null||be.register_created_effect(r);var S=r;if((t&gi)!==0)ai!==null?ai.push(r):ti.ensure().schedule(r);else if(e!==null){try{Si(r)}catch(C){throw ft(r),C}S.deps===null&&S.teardown===null&&S.nodes===null&&S.first===S.last&&(S.f&yi)===0&&(S=S.first,(t&kr)!==0&&(t&Qr)!==0&&S!==null&&(S.f|=Qr))}if(S!==null&&(S.parent=i,i!==null&&uh(S,i),Le!==null&&(Le.f&ct)!==0&&(t&Zr)===0)){var E=Le;(E.effects??(E.effects=[])).push(S)}return r}function yn(){return Le!==null&&!Jt}function Cn(t){const e=fr(_s,null);return Qe(e,st),e.teardown=t,e}function lt(t){hh();var e=Te.f,i=!Le&&(e&Zt)!==0&&(e&ii)===0;if(i){var r=xt;(r.e??(r.e=[])).push(t)}else return ka(t)}function ka(t){return fr(gi|wc,t)}function dh(t){ti.ensure();const e=fr(Zr|yi,t);return(i={})=>new Promise(r=>{i.outro?Yr(e,()=>{ft(e),r(void 0)}):(ft(e),r(void 0))})}function ji(t){return fr(gi,t)}function fh(t){return fr(vs|yi,t)}function zi(t,e=0){return fr(_s|e,t)}function ce(t,e=[],i=[],r=[]){fa(r,e,i,S=>{fr(_s,()=>t(...S.map(b)))})}function Ki(t,e=0){var i=fr(kr|e,t);return i}function La(t,e=0){var i=fr(pn|e,t);return i}function Dt(t){return fr(Zt|yi,t)}function Da(t){var e=t.teardown;if(e!==null){const i=Wr,r=Le;vo(!0),Kt(null);try{e.call(null)}finally{vo(i),Kt(r)}}}function xn(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const S=i.ac;S!==null&&gs(()=>{S.abort(pr)});var r=i.next;(i.f&Zr)!==0?i.parent=null:ft(i,e),i=r}}function _h(t){for(var e=t.first;e!==null;){var i=e.next;(e.f&Zt)===0&&ft(e),e=i}}function ft(t,e=!0){var i=!1;(e||(t.f&Sc)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Ta(t.nodes.start,t.nodes.end),i=!0),Qe(t,qs),xn(t,e&&!i),Ai(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const E of r)E.stop();Da(t),t.f^=qs,t.f|=Nt;var S=t.parent;S!==null&&S.first!==null&&Ra(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Ta(t,e){for(;t!==null;){var i=t===e?null:Ui(t);t.remove(),t=i}}function Ra(t){var e=t.parent,i=t.prev,r=t.next;i!==null&&(i.next=r),r!==null&&(r.prev=i),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=i))}function Yr(t,e,i=!0){var r=[];Aa(t,r,!0);var S=()=>{i&&ft(t),e&&e()},E=r.length;if(E>0){var C=()=>--E||S();for(var o of r)o.out(C)}else S()}function Aa(t,e,i){if((t.f&Tt)===0){t.f^=Tt;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||i)&&e.push(o);for(var S=t.first;S!==null;){var E=S.next,C=(S.f&Qr)!==0||(S.f&Zt)!==0&&(t.f&kr)!==0;Aa(S,e,C?i:!1),S=E}}}function En(t){Ba(t,!0)}function Ba(t,e){if((t.f&Tt)!==0){t.f^=Tt,(t.f&st)===0&&(Qe(t,dt),ti.ensure().schedule(t));for(var i=t.first;i!==null;){var r=i.next,S=(i.f&Qr)!==0||(i.f&Zt)!==0;Ba(i,S?e:!1),i=r}var E=t.nodes&&t.nodes.t;if(E!==null)for(const C of E)(C.is_global||e)&&C.in()}}function kn(t,e){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end;i!==null;){var S=i===r?null:Ui(i);e.append(i),i=S}}let is=!1,Wr=!1;function vo(t){Wr=t}let Le=null,Jt=!1;function Kt(t){Le=t}let Te=null;function dr(t){Te=t}let zt=null;function Ma(t){Le!==null&&(zt===null?zt=[t]:zt.push(t))}let Lt=null,Mt=0,Wt=null;function vh(t){Wt=t}let Oa=1,Kr=0,Er=Kr;function po(t){Er=t}function Pa(){return++Oa}function Vi(t){var e=t.f;if((e&dt)!==0)return!0;if(e&ct&&(t.f&=~ei),(e&ur)!==0){for(var i=t.deps,r=i.length,S=0;S<r;S++){var E=i[S];if(Vi(E)&&pa(E),E.wv>t.wv)return!0}(e&jt)!==0&&ut===null&&Qe(t,st)}return!1}function Ia(t,e,i=!0){var r=t.reactions;if(r!==null&&!(zt!==null&&pi.call(zt,t)))for(var S=0;S<r.length;S++){var E=r[S];(E.f&ct)!==0?Ia(E,e,!1):e===E&&(i?Qe(E,dt):(E.f&st)!==0&&Qe(E,ur),Sn(E))}}function Ha(t){var _;var e=Lt,i=Mt,r=Wt,S=Le,E=zt,C=xt,o=Jt,l=Er,h=t.f;Lt=null,Mt=0,Wt=null,Le=(h&(Zt|Zr))===0?t:null,zt=null,mi(t.ctx),Jt=!1,Er=++Kr,t.ac!==null&&(gs(()=>{t.ac.abort(pr)}),t.ac=null);try{t.f|=Gs;var f=t.fn,u=f();t.f|=ii;var v=t.deps,d=be==null?void 0:be.is_fork;if(Lt!==null){var m;if(d||Ai(t,Mt),v!==null&&Mt>0)for(v.length=Mt+Lt.length,m=0;m<Lt.length;m++)v[Mt+m]=Lt[m];else t.deps=v=Lt;if(yn()&&(t.f&jt)!==0)for(m=Mt;m<v.length;m++)((_=v[m]).reactions??(_.reactions=[])).push(t)}else!d&&v!==null&&Mt<v.length&&(Ai(t,Mt),v.length=Mt);if(ia()&&Wt!==null&&!Jt&&v!==null&&(t.f&(ct|ur|dt))===0)for(m=0;m<Wt.length;m++)Ia(Wt[m],t);if(S!==null&&S!==t){if(Kr++,S.deps!==null)for(let n=0;n<i;n+=1)S.deps[n].rv=Kr;if(e!==null)for(const n of e)n.rv=Kr;Wt!==null&&(r===null?r=Wt:r.push(...Wt))}return(t.f&Ir)!==0&&(t.f^=Ir),u}catch(n){return na(n)}finally{t.f^=Gs,Lt=e,Mt=i,Wt=r,Le=S,zt=E,mi(C),Jt=o,Er=l}}function ph(t,e){let i=e.reactions;if(i!==null){var r=_c.call(i,t);if(r!==-1){var S=i.length-1;S===0?i=e.reactions=null:(i[r]=i[S],i.pop())}}if(i===null&&(e.f&ct)!==0&&(Lt===null||!pi.call(Lt,e))){var E=e;(E.f&jt)!==0&&(E.f^=jt,E.f&=~ei),mn(E),th(E),Ai(E,0)}}function Ai(t,e){var i=t.deps;if(i!==null)for(var r=e;r<i.length;r++)ph(t,i[r])}function Si(t){var e=t.f;if((e&Nt)===0){Qe(t,st);var i=Te,r=is;Te=t,is=!0;try{(e&(kr|pn))!==0?_h(t):xn(t),Da(t);var S=Ha(t);t.teardown=typeof S=="function"?S:null,t.wv=Oa;var E;fc&&Hc&&(t.f&dt)!==0&&t.deps}finally{is=r,Te=i}}}async function gh(){await Promise.resolve(),jc()}function b(t){var e=t.f,i=(e&ct)!==0;if(Le!==null&&!Jt){var r=Te!==null&&(Te.f&Nt)!==0;if(!r&&(zt===null||!pi.call(zt,t))){var S=Le.deps;if((Le.f&Gs)!==0)t.rv<Kr&&(t.rv=Kr,Lt===null&&S!==null&&S[Mt]===t?Mt++:Lt===null?Lt=[t]:Lt.push(t));else{(Le.deps??(Le.deps=[])).push(t);var E=t.reactions;E===null?t.reactions=[Le]:pi.call(E,Le)||E.push(Le)}}}if(Wr&&Hr.has(t))return Hr.get(t);if(i){var C=t;if(Wr){var o=C.v;return((C.f&st)===0&&C.reactions!==null||Fa(C))&&(o=wn(C)),Hr.set(C,o),o}var l=(C.f&jt)===0&&!Jt&&Le!==null&&(is||(Le.f&jt)!==0),h=(C.f&ii)===0;Vi(C)&&(l&&(C.f|=jt),pa(C)),l&&!h&&(ga(C),Na(C))}if(ut!=null&&ut.has(t))return ut.get(t);if((t.f&Ir)!==0)throw t.v;return t.v}function Na(t){if(t.f|=jt,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&ct)!==0&&(e.f&jt)===0&&(ga(e),Na(e))}function Fa(t){if(t.v===at)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Hr.has(e)||(e.f&ct)!==0&&Fa(e))return!0;return!1}function Lr(t){var e=Jt;try{return Jt=!0,t()}finally{Jt=e}}function mh(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(yr in t)rn(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&yr in i&&rn(i)}}}function rn(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{rn(t[r],e)}catch{}const i=vn(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const r=Jo(i);for(let S in r){const E=r[S].get;if(E)try{E.call(t)}catch{}}}}}const Vr=Symbol("events"),Wa=new Set,sn=new Set;function Ua(t,e,i,r={}){function S(E){if(r.capture||nn.call(e,E),!E.cancelBubble)return gs(()=>i==null?void 0:i.call(this,E))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Cr(()=>{e.addEventListener(t,S,r)}):e.addEventListener(t,S,r),S}function wr(t,e,i,r,S){var E={capture:r,passive:S},C=Ua(t,e,i,E);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Cn(()=>{e.removeEventListener(t,C,E)})}function ge(t,e,i){(e[Vr]??(e[Vr]={}))[t]=i}function bt(t){for(var e=0;e<t.length;e++)Wa.add(t[e]);for(var i of sn)i(t)}let go=null;function nn(t){var n,a;var e=this,i=e.ownerDocument,r=t.type,S=((n=t.composedPath)==null?void 0:n.call(t))||[],E=S[0]||t.target;go=t;var C=0,o=go===t&&t[Vr];if(o){var l=S.indexOf(o);if(l!==-1&&(e===document||e===window)){t[Vr]=e;return}var h=S.indexOf(e);if(h===-1)return;l<=h&&(C=l)}if(E=S[C]||t.target,E!==e){vc(t,"currentTarget",{configurable:!0,get(){return E||i}});var f=Le,u=Te;Kt(null),dr(null);try{for(var v,d=[];E!==null;){var m=E.assignedSlot||E.parentNode||E.host||null;try{var _=(a=E[Vr])==null?void 0:a[r];_!=null&&(!E.disabled||t.target===E)&&_.call(E,t)}catch(s){v?d.push(s):v=s}if(t.cancelBubble||m===e||m===null)break;E=m}if(v){for(let s of d)queueMicrotask(()=>{throw s});throw v}}finally{t[Vr]=e,delete t.currentTarget,Kt(f),dr(u)}}}var Go;const Ms=((Go=globalThis==null?void 0:globalThis.window)==null?void 0:Go.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function bh(t){return(Ms==null?void 0:Ms.createHTML(t))??t}function ja(t){var e=xa("template");return e.innerHTML=bh(t.replaceAll("<!>","<!---->")),e.content}function ri(t,e){var i=Te;i.nodes===null&&(i.nodes={start:t,end:e,a:null,t:null})}function ee(t,e){var i=(e&lc)!==0,r=(e&cc)!==0,S,E=!t.startsWith("<!>");return()=>{S===void 0&&(S=ja(E?t:"<!>"+t),i||(S=cr(S)));var C=r||Sa?document.importNode(S,!0):S.cloneNode(!0);if(i){var o=cr(C),l=C.lastChild;ri(o,l)}else ri(C,C);return C}}function Sh(t,e,i="svg"){var r=!t.startsWith("<!>"),S=`<${i}>${r?t:"<!>"+t}</${i}>`,E;return()=>{if(!E){var C=ja(S),o=cr(C);E=cr(o)}var l=E.cloneNode(!0);return ri(l,l),l}}function ms(t,e){return Sh(t,e,"svg")}function Ye(t=""){{var e=xr(t+"");return ri(e,e),e}}function Et(){var t=document.createDocumentFragment(),e=document.createComment(""),i=xr();return t.append(e,i),ri(e,i),t}function q(t,e){t!==null&&t.before(e)}function wh(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const yh=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ch(t){return yh.includes(t)}const xh={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Eh(t){return t=t.toLowerCase(),xh[t]??t}const kh=["touchstart","touchmove"];function Lh(t){return kh.includes(t)}function oe(t,e){var i=e==null?"":typeof e=="object"?`${e}`:e;i!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=i,t.nodeValue=`${i}`)}function Dh(t,e){return Th(t,e)}const Xi=new Map;function Th(t,{target:e,anchor:i,props:r={},events:S,context:E,intro:C=!0,transformError:o}){oh();var l=void 0,h=dh(()=>{var f=i??e.appendChild(xr());qc(f,{pending:()=>{}},d=>{qe({});var m=xt;E&&(m.c=E),S&&(r.$$events=S),l=t(d,r)||{},$e()},o);var u=new Set,v=d=>{for(var m=0;m<d.length;m++){var _=d[m];if(!u.has(_)){u.add(_);var n=Lh(_);for(const c of[e,document]){var a=Xi.get(c);a===void 0&&(a=new Map,Xi.set(c,a));var s=a.get(_);s===void 0?(c.addEventListener(_,nn,{passive:n}),a.set(_,1)):a.set(_,s+1)}}}};return v(fs(Wa)),sn.add(v),()=>{var n;for(var d of u)for(const a of[e,document]){var m=Xi.get(a),_=m.get(d);--_==0?(a.removeEventListener(d,nn),m.delete(d),m.size===0&&Xi.delete(a)):m.set(d,_)}sn.delete(v),f!==i&&((n=f.parentNode)==null||n.removeChild(f))}});return Rh.set(l,h),l}let Rh=new WeakMap;var Xt,ar,It,Xr,Fi,Wi,hs;class Ln{constructor(e,i=!0){qt(this,"anchor");we(this,Xt,new Map);we(this,ar,new Map);we(this,It,new Map);we(this,Xr,new Set);we(this,Fi,!0);we(this,Wi,e=>{if(G(this,Xt).has(e)){var i=G(this,Xt).get(e),r=G(this,ar).get(i);if(r)En(r),G(this,Xr).delete(i);else{var S=G(this,It).get(i);S&&(G(this,ar).set(i,S.effect),G(this,It).delete(i),S.fragment.lastChild.remove(),this.anchor.before(S.fragment),r=S.effect)}for(const[E,C]of G(this,Xt)){if(G(this,Xt).delete(E),E===e)break;const o=G(this,It).get(C);o&&(ft(o.effect),G(this,It).delete(C))}for(const[E,C]of G(this,ar)){if(E===i||G(this,Xr).has(E))continue;const o=()=>{if(Array.from(G(this,Xt).values()).includes(E)){var h=document.createDocumentFragment();kn(C,h),h.append(xr()),G(this,It).set(E,{effect:C,fragment:h})}else ft(C);G(this,Xr).delete(E),G(this,ar).delete(E)};G(this,Fi)||!r?(G(this,Xr).add(E),Yr(C,o,!1)):o()}}});we(this,hs,e=>{G(this,Xt).delete(e);const i=Array.from(G(this,Xt).values());for(const[r,S]of G(this,It))i.includes(r)||(ft(S.effect),G(this,It).delete(r))});this.anchor=e,De(this,Fi,i)}ensure(e,i){var r=be,S=Ca();if(i&&!G(this,ar).has(e)&&!G(this,It).has(e))if(S){var E=document.createDocumentFragment(),C=xr();E.append(C),G(this,It).set(e,{effect:Dt(()=>i(C)),fragment:E})}else G(this,ar).set(e,Dt(()=>i(this.anchor)));if(G(this,Xt).set(r,e),S){for(const[o,l]of G(this,ar))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of G(this,It))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(G(this,Wi)),r.ondiscard(G(this,hs))}else G(this,Wi).call(this,r)}}Xt=new WeakMap,ar=new WeakMap,It=new WeakMap,Xr=new WeakMap,Fi=new WeakMap,Wi=new WeakMap,hs=new WeakMap;function Dn(t,e,...i){var r=new Ln(t);Ki(()=>{const S=e()??null;r.ensure(S,S&&(E=>S(E,...i)))},Qr)}function Tn(t){xt===null&&Qo(),lt(()=>{const e=Lr(t);if(typeof e=="function")return e})}function Ah(t){xt===null&&Qo(),Tn(()=>()=>Lr(t))}function ne(t,e,i=!1){var r=new Ln(t),S=i?Qr:0;function E(C,o){r.ensure(C,o)}Ki(()=>{var C=!1;e((o,l=0)=>{C=!0,E(l,o)}),C||E(-1,null)},S)}const Bh=Symbol("NaN");function Mh(t,e,i){var r=new Ln(t);Ki(()=>{var S=e();S!==S&&(S=Bh),r.ensure(S,i)})}function Bi(t,e){return e}function Oh(t,e,i){for(var r=[],S=e.length,E,C=e.length,o=0;o<S;o++){let u=e[o];Yr(u,()=>{if(E){if(E.pending.delete(u),E.done.add(u),E.pending.size===0){var v=t.outrogroups;on(t,fs(E.done)),v.delete(E),v.size===0&&(t.outrogroups=null)}}else C-=1},!1)}if(C===0){var l=r.length===0&&i!==null;if(l){var h=i,f=h.parentNode;ah(f),f.append(h),t.items.clear()}on(t,e,!l)}else E={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(E)}function on(t,e,i=!0){var r;if(t.pending.size>0){r=new Set;for(const C of t.pending.values())for(const o of C)r.add(t.items.get(o).e)}for(var S=0;S<e.length;S++){var E=e[S];if(r!=null&&r.has(E)){E.f|=lr;const C=document.createDocumentFragment();kn(E,C)}else ft(e[S],i)}}var mo;function Je(t,e,i,r,S,E=null){var C=t,o=new Map,l=(e&Xo)!==0;if(l){var h=t;C=h.appendChild(xr())}var f=null,u=va(()=>{var c=i();return _n(c)?c:c==null?[]:fs(c)}),v,d=new Map,m=!0;function _(c){(s.effect.f&Nt)===0&&(s.pending.delete(c),s.fallback=f,Ph(s,v,C,e,r),f!==null&&(v.length===0?(f.f&lr)===0?En(f):(f.f^=lr,Di(f,null,C)):Yr(f,()=>{f=null})))}function n(c){s.pending.delete(c)}var a=Ki(()=>{v=b(u);for(var c=v.length,p=new Set,w=be,y=Ca(),k=0;k<c;k+=1){var g=v[k],x=r(g,k),T=m?null:o.get(x);T?(T.v&&bi(T.v,g),T.i&&bi(T.i,k),y&&w.unskip_effect(T.e)):(T=Ih(o,m?C:mo??(mo=xr()),g,x,k,S,e,i),m||(T.e.f|=lr),o.set(x,T)),p.add(x)}if(c===0&&E&&!f&&(m?f=Dt(()=>E(C)):(f=Dt(()=>E(mo??(mo=xr()))),f.f|=lr)),c>p.size&&Ec(),!m)if(d.set(w,p),y){for(const[A,P]of o)p.has(A)||w.skip_effect(P.e);w.oncommit(_),w.ondiscard(n)}else _(w);b(u)}),s={effect:a,items:o,pending:d,outrogroups:null,fallback:f};m=!1}function Ci(t){for(;t!==null&&(t.f&Zt)===0;)t=t.next;return t}function Ph(t,e,i,r,S){var T,A,P,M,H,F,Y,J,Z;var E=(r&rc)!==0,C=e.length,o=t.items,l=Ci(t.effect.first),h,f=null,u,v=[],d=[],m,_,n,a;if(E)for(a=0;a<C;a+=1)m=e[a],_=S(m,a),n=o.get(_).e,(n.f&lr)===0&&((A=(T=n.nodes)==null?void 0:T.a)==null||A.measure(),(u??(u=new Set)).add(n));for(a=0;a<C;a+=1){if(m=e[a],_=S(m,a),n=o.get(_).e,t.outrogroups!==null)for(const L of t.outrogroups)L.pending.delete(n),L.done.delete(n);if((n.f&Tt)!==0&&(En(n),E&&((M=(P=n.nodes)==null?void 0:P.a)==null||M.unfix(),(u??(u=new Set)).delete(n))),(n.f&lr)!==0)if(n.f^=lr,n===l)Di(n,null,i);else{var s=f?f.next:l;n===t.effect.last&&(t.effect.last=n.prev),n.prev&&(n.prev.next=n.next),n.next&&(n.next.prev=n.prev),Rr(t,f,n),Rr(t,n,s),Di(n,s,i),f=n,v=[],d=[],l=Ci(f.next);continue}if(n!==l){if(h!==void 0&&h.has(n)){if(v.length<d.length){var c=d[0],p;f=c.prev;var w=v[0],y=v[v.length-1];for(p=0;p<v.length;p+=1)Di(v[p],c,i);for(p=0;p<d.length;p+=1)h.delete(d[p]);Rr(t,w.prev,y.next),Rr(t,f,w),Rr(t,y,c),l=c,f=y,a-=1,v=[],d=[]}else h.delete(n),Di(n,l,i),Rr(t,n.prev,n.next),Rr(t,n,f===null?t.effect.first:f.next),Rr(t,f,n),f=n;continue}for(v=[],d=[];l!==null&&l!==n;)(h??(h=new Set)).add(l),d.push(l),l=Ci(l.next);if(l===null)continue}(n.f&lr)===0&&v.push(n),f=n,l=Ci(n.next)}if(t.outrogroups!==null){for(const L of t.outrogroups)L.pending.size===0&&(on(t,fs(L.done)),(H=t.outrogroups)==null||H.delete(L));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||h!==void 0){var k=[];if(h!==void 0)for(n of h)(n.f&Tt)===0&&k.push(n);for(;l!==null;)(l.f&Tt)===0&&l!==t.fallback&&k.push(l),l=Ci(l.next);var g=k.length;if(g>0){var x=(r&Xo)!==0&&C===0?i:null;if(E){for(a=0;a<g;a+=1)(Y=(F=k[a].nodes)==null?void 0:F.a)==null||Y.measure();for(a=0;a<g;a+=1)(Z=(J=k[a].nodes)==null?void 0:J.a)==null||Z.fix()}Oh(t,k,x)}}E&&Cr(()=>{var L,O;if(u!==void 0)for(n of u)(O=(L=n.nodes)==null?void 0:L.a)==null||O.apply()})}function Ih(t,e,i,r,S,E,C,o){var l=(C&ec)!==0?(C&ic)===0?rh(i,!1,!1):Fr(i):null,h=(C&tc)!==0?Fr(S):null;return{v:l,i:h,e:Dt(()=>(E(e,l??i,h??S,o),()=>{t.delete(r)}))}}function Di(t,e,i){if(t.nodes)for(var r=t.nodes.start,S=t.nodes.end,E=e&&(e.f&lr)===0?e.nodes.start:i;r!==null;){var C=Ui(r);if(E.before(r),r===S)return;r=C}}function Rr(t,e,i){e===null?t.effect.first=i:e.next=i,i===null?t.effect.last=e:i.prev=e}function Hh(t,e,i=!1,r=!1,S=!1,E=!1){var C=t,o="";if(i)var l=t;ce(()=>{var h=Te;if(o!==(o=e()??"")){if(i){h.nodes=null,l.innerHTML=o,o!==""&&ri(cr(l),l.lastChild);return}if(h.nodes!==null&&(Ta(h.nodes.start,h.nodes.end),h.nodes=null),o!==""){var f=r?hc:S?uc:void 0,u=xa(r?"svg":S?"math":"template",f);u.innerHTML=o;var v=r||S?u:u.content;if(ri(cr(v),v.lastChild),r||S)for(;cr(v);)C.before(cr(v));else C.before(v)}}})}function za(t,e,i){ji(()=>{var r=Lr(()=>e(t,i==null?void 0:i())||{});if(i&&(r!=null&&r.update)){var S=!1,E={};zi(()=>{var C=i();mh(C),S&&ta(E,C)&&(E=C,r.update(C))}),S=!0}if(r!=null&&r.destroy)return()=>r.destroy()})}function Nh(t,e){var i=void 0,r;La(()=>{i!==(i=e())&&(r&&(ft(r),r=null),i&&(r=Dt(()=>{ji(()=>i(t))})))})}function Ka(t){var e,i,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var S=t.length;for(e=0;e<S;e++)t[e]&&(i=Ka(t[e]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}function Fh(){for(var t,e,i=0,r="",S=arguments.length;i<S;i++)(t=arguments[i])&&(e=Ka(t))&&(r&&(r+=" "),r+=e);return r}function bs(t){return typeof t=="object"?Fh(t):t??""}const bo=[...`
2
+ \r\f \v\uFEFF`];function Wh(t,e,i){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),i){for(var S of Object.keys(i))if(i[S])r=r?r+" "+S:S;else if(r.length)for(var E=S.length,C=0;(C=r.indexOf(S,C))>=0;){var o=C+E;(C===0||bo.includes(r[C-1]))&&(o===r.length||bo.includes(r[o]))?r=(C===0?"":r.substring(0,C))+r.substring(o+1):C=o}}return r===""?null:r}function So(t,e=!1){var i=e?" !important;":";",r="";for(var S of Object.keys(t)){var E=t[S];E!=null&&E!==""&&(r+=" "+S+": "+E+i)}return r}function Os(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Uh(t,e){if(e){var i="",r,S;if(Array.isArray(e)?(r=e[0],S=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var E=!1,C=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Os)),S&&l.push(...Object.keys(S).map(Os));var h=0,f=-1;const _=t.length;for(var u=0;u<_;u++){var v=t[u];if(o?v==="/"&&t[u-1]==="*"&&(o=!1):E?E===v&&(E=!1):v==="/"&&t[u+1]==="*"?o=!0:v==='"'||v==="'"?E=v:v==="("?C++:v===")"&&C--,!o&&E===!1&&C===0){if(v===":"&&f===-1)f=u;else if(v===";"||u===_-1){if(f!==-1){var d=Os(t.substring(h,f).trim());if(!l.includes(d)){v!==";"&&u++;var m=t.substring(h,u).trim();i+=" "+m+";"}}h=u+1,f=-1}}}}return r&&(i+=So(r)),S&&(i+=So(S,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function Re(t,e,i,r,S,E){var C=t.__className;if(C!==i||C===void 0){var o=Wh(i,r,E);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t.__className=i}else if(E&&S!==E)for(var l in E){var h=!!E[l];(S==null||h!==!!S[l])&&t.classList.toggle(l,h)}return E}function Ps(t,e={},i,r){for(var S in i){var E=i[S];e[S]!==E&&(i[S]==null?t.style.removeProperty(S):t.style.setProperty(S,E,r))}}function Qt(t,e,i,r){var S=t.__style;if(S!==e){var E=Uh(e,r);E==null?t.removeAttribute("style"):t.style.cssText=E,t.__style=e}else r&&(Array.isArray(r)?(Ps(t,i==null?void 0:i[0],r[0]),Ps(t,i==null?void 0:i[1],r[1],"important")):Ps(t,i,r));return r}function an(t,e,i=!1){if(t.multiple){if(e==null)return;if(!_n(e))return Pc();for(var r of t.options)r.selected=e.includes(wo(r));return}for(r of t.options){var S=wo(r);if(nh(S,e)){r.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function jh(t){var e=new MutationObserver(()=>{an(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Cn(()=>{e.disconnect()})}function wo(t){return"__value"in t?t.__value:t.value}const xi=Symbol("class"),Ei=Symbol("style"),Va=Symbol("is custom element"),qa=Symbol("is html"),zh=gn?"option":"OPTION",Kh=gn?"select":"SELECT",Vh=gn?"progress":"PROGRESS";function yo(t,e){var i=Ss(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Vh)||(t.value=e??"")}function ln(t,e){var i=Ss(t);i.checked!==(i.checked=e??void 0)&&(t.checked=e)}function qh(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function xe(t,e,i,r){var S=Ss(t);S[e]!==(S[e]=i)&&(e==="loading"&&(t[Cc]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ga(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function $h(t,e,i,r,S=!1,E=!1){var C=Ss(t),o=C[Va],l=!C[qa],h=e||{},f=t.nodeName===zh;for(var u in e)u in i||(i[u]=null);i.class?i.class=bs(i.class):i[xi]&&(i.class=null),i[Ei]&&(i.style??(i.style=null));var v=Ga(t);for(const p in i){let w=i[p];if(f&&p==="value"&&w==null){t.value=t.__value="",h[p]=w;continue}if(p==="class"){var d=t.namespaceURI==="http://www.w3.org/1999/xhtml";Re(t,d,w,r,e==null?void 0:e[xi],i[xi]),h[p]=w,h[xi]=i[xi];continue}if(p==="style"){Qt(t,w,e==null?void 0:e[Ei],i[Ei]),h[p]=w,h[Ei]=i[Ei];continue}var m=h[p];if(!(w===m&&!(w===void 0&&t.hasAttribute(p)))){h[p]=w;var _=p[0]+p[1];if(_!=="$$")if(_==="on"){const y={},k="$$"+p;let g=p.slice(2);var n=Ch(g);if(wh(g)&&(g=g.slice(0,-7),y.capture=!0),!n&&m){if(w!=null)continue;t.removeEventListener(g,h[k],y),h[k]=null}if(n)ge(g,t,w),bt([g]);else if(w!=null){let x=function(T){h[p].call(this,T)};var c=x;h[k]=Ua(g,t,x,y)}}else if(p==="style")xe(t,p,w);else if(p==="autofocus")lh(t,!!w);else if(!o&&(p==="__value"||p==="value"&&w!=null))t.value=t.__value=w;else if(p==="selected"&&f)qh(t,w);else{var a=p;l||(a=Eh(a));var s=a==="defaultValue"||a==="defaultChecked";if(w==null&&!o&&!s)if(C[p]=null,a==="value"||a==="checked"){let y=t;const k=e===void 0;if(a==="value"){let g=y.defaultValue;y.removeAttribute(a),y.defaultValue=g,y.value=y.__value=k?g:null}else{let g=y.defaultChecked;y.removeAttribute(a),y.defaultChecked=g,y.checked=k?g:!1}}else t.removeAttribute(p);else s||v.includes(a)&&(o||typeof w!="string")?(t[a]=w,a in C&&(C[a]=at)):typeof w!="function"&&xe(t,a,w)}}}return h}function $a(t,e,i=[],r=[],S=[],E,C=!1,o=!1){fa(S,i,r,l=>{var h=void 0,f={},u=t.nodeName===Kh,v=!1;if(La(()=>{var m=e(...l.map(b)),_=$h(t,h,m,E,C,o);v&&u&&"value"in m&&an(t,m.value);for(let a of Object.getOwnPropertySymbols(f))m[a]||ft(f[a]);for(let a of Object.getOwnPropertySymbols(m)){var n=m[a];a.description===dc&&(!h||n!==h[a])&&(f[a]&&ft(f[a]),f[a]=Dt(()=>Nh(t,()=>n))),_[a]=n}h=_}),u){var d=t;ji(()=>{an(d,h.value,!0),jh(d)})}v=!0})}function Ss(t){return t.__attributes??(t.__attributes={[Va]:t.nodeName.includes("-"),[qa]:t.namespaceURI===Yo})}var Co=new Map;function Ga(t){var e=t.getAttribute("is")||t.nodeName,i=Co.get(e);if(i)return i;Co.set(e,i=[]);for(var r,S=t,E=Element.prototype;E!==S;){r=Jo(S);for(var C in r)r[C].set&&i.push(C);S=vn(S)}return i}function Jr(t,e,i=e){var r=new WeakSet;Ea(t,"input",async S=>{var E=S?t.defaultValue:t.value;if(E=Is(t)?Hs(E):E,i(E),be!==null&&r.add(be),await gh(),E!==(E=e())){var C=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=E??"",o!==null){var h=t.value.length;C===o&&o===l&&h>l?(t.selectionStart=h,t.selectionEnd=h):(t.selectionStart=C,t.selectionEnd=Math.min(o,h))}}}),Lr(e)==null&&t.value&&(i(Is(t)?Hs(t.value):t.value),be!==null&&r.add(be)),zi(()=>{var S=e();if(t===document.activeElement){var E=be;if(r.has(E))return}Is(t)&&S===Hs(t.value)||t.type==="date"&&!S&&!t.value||S!==t.value&&(t.value=S??"")})}function Gh(t,e,i=e){Ea(t,"change",r=>{var S=r?t.defaultChecked:t.checked;i(S)}),Lr(e)==null&&i(t.checked),zi(()=>{var r=e();t.checked=!!r})}function Is(t){var e=t.type;return e==="number"||e==="range"}function Hs(t){return t===""?null:+t}function xo(t,e){return t===e||(t==null?void 0:t[yr])===e}function Mi(t={},e,i,r){var S=xt.r,E=Te;return ji(()=>{var C,o;return zi(()=>{C=o,o=[],Lr(()=>{t!==i(...o)&&(e(t,...o),C&&xo(i(...C),t)&&e(null,...C))})}),()=>{let l=E;for(;l!==S&&l.parent!==null&&l.parent.f&qs;)l=l.parent;const h=()=>{o&&xo(i(...o),t)&&e(null,...o)},f=l.teardown;l.teardown=()=>{h(),f==null||f()}}}),t}const Xh={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Xa(t,e,i){return new Proxy({props:t,exclude:e},Xh)}function pe(t,e,i,r){var s;var S=(i&oc)!==0,E=(i&ac)!==0,C=r,o=!0,l=()=>(o&&(o=!1,C=E?Lr(r):r),C);let h;if(S){var f=yr in t||yc in t;h=((s=li(t,e))==null?void 0:s.set)??(f&&e in t?c=>t[e]=c:void 0)}var u,v=!1;S?[u,v]=Wc(()=>t[e]):u=t[e],u===void 0&&r!==void 0&&(u=l(),h&&(Rc(),h(u)));var d;if(d=()=>{var c=t[e];return c===void 0?l():(o=!0,c)},(i&nc)===0)return d;if(h){var m=t.$$legacy;return(function(c,p){return arguments.length>0?((!p||m||v)&&h(p?d():c),c):d()})}var _=!1,n=((i&sc)!==0?ps:va)(()=>(_=!1,d()));S&&b(n);var a=Te;return(function(c,p){if(arguments.length>0){const w=p?b(n):S?Pe(c):c;return W(n,w),_=!0,C!==void 0&&(C=w),c}return Wr&&_||(a.f&Nt)!==0?n.v:b(n)})}const Yh=["github-dark","dracula","nord","solarized-dark","one-dark"],cn=[{key:"github-dark",label:"GitHub Dark",colors:{surface:"#0d1117",sidebar:"#161b22",topbar:"#1c2128",hover:"#21262d",active:"#1f6feb33",edge:"#30363d",primary:"#e6edf3",muted:"#8b949e",accent:"#58a6ff",danger:"#f85149",success:"#3fb950",warning:"#d29922"},terminal:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"}},{key:"dracula",label:"Dracula",colors:{surface:"#282a36",sidebar:"#21222c",topbar:"#2d2f3f",hover:"#343746",active:"#bd93f933",edge:"#44475a",primary:"#f8f8f2",muted:"#6272a4",accent:"#bd93f9",danger:"#ff5555",success:"#50fa7b",warning:"#f1fa8c"},terminal:{background:"#282a36",foreground:"#f8f8f2",cursor:"#bd93f9",selectionBackground:"#44475a"}},{key:"nord",label:"Nord",colors:{surface:"#2e3440",sidebar:"#272c36",topbar:"#353b49",hover:"#3b4252",active:"#88c0d033",edge:"#4c566a",primary:"#eceff4",muted:"#81a1c1",accent:"#88c0d0",danger:"#bf616a",success:"#a3be8c",warning:"#ebcb8b"},terminal:{background:"#2e3440",foreground:"#eceff4",cursor:"#88c0d0",selectionBackground:"#434c5e"}},{key:"solarized-dark",label:"Solarized Dark",colors:{surface:"#002b36",sidebar:"#00222b",topbar:"#073642",hover:"#0a4050",active:"#268bd233",edge:"#2e5e6a",primary:"#fdf6e3",muted:"#839496",accent:"#268bd2",danger:"#dc322f",success:"#859900",warning:"#b58900"},terminal:{background:"#002b36",foreground:"#fdf6e3",cursor:"#268bd2",selectionBackground:"#073642"}},{key:"one-dark",label:"One Dark",colors:{surface:"#282c34",sidebar:"#21252b",topbar:"#2c323c",hover:"#333842",active:"#61afef33",edge:"#3e4452",primary:"#abb2bf",muted:"#636d83",accent:"#61afef",danger:"#e06c75",success:"#98c379",warning:"#e5c07b"},terminal:{background:"#282c34",foreground:"#abb2bf",cursor:"#61afef",selectionBackground:"#3e4452"}}];function Ya(t){return cn.find(e=>e.key===t)??cn[0]}const ss="wt-ssh-host",Ja="wt-theme",hn="wt-last-selected-worktree",Za="wt-sidebar-width",Jh=220;function ws(t){return t.repo?`${t.repo} #${t.number}`:`PR #${t.number}`}function Zh(t){return t==="merged"?"text-merged":t==="closed"?"text-danger":"text-primary"}function Eo(t){return t==="merged"?"bg-merged/20 text-merged":t==="closed"?"bg-danger/20 text-danger":t==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}function Qh(t){return t==="failed"?"text-danger":t==="success"?"text-success":t==="pending"?"text-warning":"text-muted"}function eu(t){return t==="failed"?"bg-danger":t==="success"?"bg-success":t==="pending"?"bg-warning animate-pulse":"bg-muted"}function tu(t){if(t.ciChecks.length>0){if(t.ciStatus==="failed")return"border-danger/40 bg-danger/5";if(t.ciStatus==="pending")return"border-warning/40 bg-warning/5";if(t.ciStatus==="success")return"border-success/30 bg-success/5"}return t.state==="merged"?"border-merged/35 bg-merged/8":t.state==="closed"?"border-danger/35 bg-danger/5":"border-edge bg-surface"}function Ri(t,e){return t?e?`cursor://vscode-remote/ssh-remote+${e}${t}`:`cursor://file${t}`:null}function Ht(t){return t instanceof Error?t.message:String(t)}function un(t,e){return e.toLowerCase().includes(t.toLowerCase())}function ru(){const t=localStorage.getItem(Ja);return t&&Yh.includes(t)?t:"github-dark"}function iu(){var e;const t=(e=localStorage.getItem(hn))==null?void 0:e.trim();return t||null}function ko(t){if(t){localStorage.setItem(hn,t);return}localStorage.removeItem(hn)}function Qa(t){const e=Ya(t),i=document.documentElement;for(const[r,S]of Object.entries(e.colors))i.style.setProperty(`--color-${r}`,S);localStorage.setItem(Ja,t)}function su(){const t=localStorage.getItem(Za);if(t){const e=parseInt(t,10);if(!Number.isNaN(e)&&e>0)return e}return Jh}function Lo(t){localStorage.setItem(Za,String(Math.round(t)))}function el(t){switch(t){case"creating_worktree":return"Creating worktree";case"preparing_runtime":return"Preparing runtime";case"running_post_create_hook":return"Running post-create hook";case"starting_session":return"Starting session";case"reconciling":return"Reconciling";default:return"Creating"}}function nu(t,e,i,r){return t&&e||!r?t:i.length===0?null:(i.find(E=>E.mux==="✓")??i[0]).branch}var ou=ee('<a target="_blank" rel="noopener"> </a>'),au=ee("<span> </span>");function lu(t,e){qe(e,!0);let i=pe(e,"clickable",3,!1),r=le(()=>ws(e.pr));var S=Et(),E=Fe(S);{var C=l=>{var h=ou(),f=z(h);ce(u=>{xe(h,"href",e.pr.url),Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),oe(f,b(r))},[()=>Eo(e.pr.state)]),q(l,h)},o=l=>{var h=au(),f=z(h);ce(u=>{Re(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),oe(f,b(r))},[()=>Eo(e.pr.state)]),q(l,h)};ne(E,l=>{i()&&e.pr.url?l(C):l(o,-1)})}q(t,S),$e()}var cu=ee('<a target="_blank" rel="noopener noreferrer"> </a>'),hu=ee("<span> </span>");function tl(t,e){qe(e,!0);const i="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full";let r=pe(e,"clickable",3,!1),S=le(()=>`color: ${e.issue.state.color}; background: ${e.issue.state.color}20;`),E=le(()=>`${e.issue.identifier} (${e.issue.state.name})`);var C=Et(),o=Fe(C);{var l=f=>{var u=cu();Re(u,1,"shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80");var v=z(u);ce(()=>{xe(u,"href",e.issue.url),Qt(u,b(S)),xe(u,"title",b(E)),oe(v,e.issue.identifier)}),q(f,u)},h=f=>{var u=hu();Re(u,1,bs(i));var v=z(u);ce(()=>{Qt(u,b(S)),xe(u,"title",b(E)),oe(v,e.issue.identifier)}),q(f,u)};ne(o,f=>{r()?f(l):f(h,-1)})}q(t,C),$e()}var uu=ms('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="19" cy="12" r="1.5"></circle></svg>'),du=ms('<svg class="text-warning" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M12 7v2"></path><path d="M12 13h.01"></path></svg>'),fu=ms('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'),_u=ms('<svg class="text-danger" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'),vu=ee("<span><!> </span>");function pu(t,e){const i=f=>{var u=Et(),v=Fe(u);{var d=a=>{var s=uu();ce(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},m=a=>{var s=du();ce(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},_=a=>{var s=fu();ce(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)},n=a=>{var s=_u();ce(()=>{xe(s,"width",r()),xe(s,"height",r())}),q(a,s)};ne(v,a=>{e.status==="working"?a(d):e.status==="waiting"?a(m,1):e.status==="done"?a(_,2):e.status==="error"&&a(n,3)})}q(f,u)};let r=pe(e,"size",3,10),S=pe(e,"pill",3,!1);function E(f){return f==="working"?"bg-success/15 text-success":f==="waiting"?"bg-warning/15 text-warning":f==="done"?"bg-success/15 text-success":f==="error"?"bg-danger/15 text-danger":"bg-hover text-muted"}var C=Et(),o=Fe(C);{var l=f=>{var u=vu(),v=z(u);i(v);var d=$(v);ce(m=>{Re(u,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${m??""}`),oe(d,` ${(e.status||"idle")??""}`)},[()=>E(e.status)]),q(f,u)},h=f=>{i(f)};ne(o,f=>{S()?f(l):f(h,-1)})}q(t,C)}var gu=ee('<span class="shrink-0 text-muted/60">↳</span>'),mu=ee('<span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </span>'),bu=ee('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),Su=ee('<span class="shrink-0 text-[10px] text-muted">closed</span>'),wu=ee('<span class="shrink-0"><!></span>'),yu=ee('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),Cu=ee("<span> </span>"),xu=ee("<span> </span>"),Eu=ee("<span> </span>"),ku=ee('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),Lu=ee('<li><button type="button"><span class="flex items-center gap-1.5 pr-5 flex-wrap"><div class="flex items-center gap-2 max-w-[90%] min-w-0"><!> <span class="font-medium truncate"> </span> <!> <!></div> <!> <!></span> <span class="flex gap-2 text-[11px] text-muted items-center flex-wrap"><!> <!></span> <!></button> <button type="button" class="absolute top-2 right-2 w-5 h-5 rounded flex items-center justify-center text-muted hover:text-danger hover:bg-hover opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer" title="Remove worktree">&times;</button></li>'),Du=ee('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function Tu(t,e){qe(e,!0);var i=Du();Je(i,21,()=>e.rows,r=>r.worktree.branch,(r,S)=>{const E=le(()=>b(S).worktree),C=le(()=>b(E).branch===e.selected),o=le(()=>e.removing.has(b(E).branch)),l=le(()=>b(E).mux!=="✓"),h=le(()=>e.initializing.has(b(E).branch)),f=le(()=>b(E).creating),u=le(()=>b(o)||b(h));var v=Lu(),d=z(v),m=z(d),_=z(m),n=z(_);{var a=N=>{var Q=gu();q(N,Q)};ne(n,N=>{b(S).depth>0&&N(a)})}var s=$(n,2),c=z(s),p=$(s,2);{var w=N=>{var Q=mu(),ie=$(z(Q));ce(ue=>oe(ie,` ${ue??""}...`),[()=>el(b(E).creationPhase)]),q(N,Q)},y=N=>{var Q=bu();q(N,Q)},k=N=>{var Q=Su();q(N,Q)},g=N=>{var Q=wu(),ie=z(Q);pu(ie,{get status(){return b(E).agent},size:14}),q(N,Q)};ne(p,N=>{b(f)?N(w):b(h)?N(y,1):b(l)?N(k,2):N(g,-1)})}var x=$(p,2);{var T=N=>{var Q=yu();q(N,Q)},A=le(()=>e.notifiedBranches.has(b(E).branch));ne(x,N=>{b(A)&&N(T)})}var P=$(_,2);Je(P,17,()=>b(E).prs,N=>N.repo,(N,Q)=>{lu(N,{get pr(){return b(Q)}})});var M=$(P,2);{var H=N=>{tl(N,{get issue(){return b(E).linearIssue},clickable:!1})};ne(M,N=>{b(E).linearIssue&&N(H)})}var F=$(m,2),Y=z(F);{var J=N=>{var Q=Cu(),ie=z(Q);ce(()=>oe(ie,b(E).agentName)),q(N,Q)};ne(Y,N=>{b(E).agentName&&N(J)})}var Z=$(Y,2);{var L=N=>{var Q=xu(),ie=z(Q);ce(()=>oe(ie,b(E).profile)),q(N,Q)};ne(Z,N=>{b(E).profile&&N(L)})}var O=$(F,2);{var R=N=>{var Q=ku();Je(Q,21,()=>b(E).services,Bi,(ie,ue)=>{var j=Et(),D=Fe(j);{var V=B=>{var K=Eu(),X=z(K);ce(()=>{Re(K,1,bs(b(ue).running?"text-success":"")),oe(X,`${b(ue).name??""}:${b(ue).port??""}`)}),q(B,K)};ne(D,B=>{b(ue).port&&B(V)})}q(ie,j)}),q(N,Q)};ne(O,N=>{b(E).services.length>0&&N(R)})}var I=$(d,2);ce(()=>{Re(v,1,`mb-0.5 group relative ${b(u)?"opacity-40 pointer-events-none":""}`),d.disabled=b(u),Re(d,1,`w-full py-2.5 rounded-md border cursor-pointer flex flex-col gap-1 text-left text-inherit text-sm bg-transparent hover:bg-hover ${b(C)?"bg-active border-accent":"border-transparent"} ${b(l)&&!b(h)&&!b(f)?"opacity-50":""}`),Qt(d,`padding-left:${12+b(S).depth*18}px; padding-right:12px;`),oe(c,b(E).branch),I.disabled=b(u)}),ge("click",d,()=>e.onselect(b(E).branch)),ge("click",I,N=>{N.stopPropagation(),e.onremove(b(E).branch)}),q(r,v)}),q(t,i),$e()}bt(["click"]);var Ru=ee('<a class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-medium no-underline hover:opacity-80" title="Open in Cursor">Cursor</a>');function Rn(t,e){var i=Ru();ce(()=>xe(i,"href",e.url)),q(t,i)}var Au=ee('<button type="button" title="View CI checks"><span></span> <span class="uppercase tracking-[0.08em] text-[9px]">CI</span></button>'),Bu=ee('<button type="button" title="Review PR comments"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg> <span> </span></button>'),Mu=ee('<div><a target="_blank" rel="noopener" title="Open PR"><span class="truncate"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17 17 7"></path><path d="M7 7h10v10"></path></svg></a> <!> <!></div>');function Ou(t,e){qe(e,!0);let i=le(()=>ws(e.pr)),r=le(()=>e.pr.ciChecks.length>0),S=le(()=>e.pr.comments.length>0);var E=Mu(),C=z(E),o=z(C),l=z(o),h=$(C,2);{var f=d=>{var m=Au(),_=z(m);ce((n,a)=>{Re(m,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge ${n??""}`),xe(m,"aria-label",`View CI checks for ${b(i)}`),Re(_,1,`inline-block h-1.5 w-1.5 rounded-full ${a??""}`)},[()=>Qh(e.pr.ciStatus),()=>eu(e.pr.ciStatus)]),ge("click",m,n=>{n.stopPropagation(),e.onCiClick(e.pr)}),q(d,m)};ne(h,d=>{b(r)&&d(f)})}var u=$(h,2);{var v=d=>{var m=Bu();Re(m,1,"relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge text-accent");var _=$(z(m),2),n=z(_);ce(()=>{xe(m,"aria-label",`Review ${e.pr.comments.length} comments for ${b(i)}`),oe(n,e.pr.comments.length)}),ge("click",m,a=>{a.stopPropagation(),e.onReviewsClick(e.pr)}),q(d,m)};ne(u,d=>{b(S)&&d(v)})}ce((d,m)=>{Re(E,1,`shrink-0 inline-flex min-w-0 items-stretch overflow-hidden rounded-full border text-[10px] font-medium leading-none ${d??""}`),xe(C,"href",e.pr.url),Re(C,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent min-w-0 no-underline ${m??""}`),oe(l,b(i))},[()=>tu(e.pr),()=>Zh(e.pr.state)]),q(t,E),$e()}bt(["click"]);var Pu=ee('<span class="shrink-0 text-[10px] font-medium text-muted"> </span>'),Iu=ee('<a target="_blank" rel="noopener"> </a>'),Hu=ee('<div class="repo-group flex flex-wrap items-center gap-x-2 gap-y-1.5 min-w-0"><!> <!> <!> <!></div>');function Yi(t,e){let i=pe(e,"services",19,()=>[]),r=pe(e,"cursorUrl",3,null);var S=Hu(),E=z(S);{var C=u=>{var v=Pu(),d=z(v);ce(()=>oe(d,`${e.label??""}:`)),q(u,v)};ne(E,u=>{e.label&&u(C)})}var o=$(E,2);Je(o,17,()=>e.prs,u=>`${u.repo}#${u.number}`,(u,v)=>{Ou(u,{get pr(){return b(v)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})});var l=$(o,2);Je(l,17,i,Bi,(u,v)=>{var d=Et(),m=Fe(d);{var _=n=>{var a=Iu(),s=z(a);ce(()=>{xe(a,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${b(v).port??""}`),Re(a,1,`shrink-0 text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${b(v).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),oe(s,`${b(v).name??""} :${b(v).port??""}`)}),q(n,a)};ne(m,n=>{b(v).port&&n(_)})}q(u,d)});var h=$(l,2);{var f=u=>{Rn(u,{get url(){return r()}})};ne(h,u=>{r()&&u(f)})}q(t,S)}var Nu=ee("<button><!></button>");function _t(t,e){let i=pe(e,"variant",3,"default"),r=pe(e,"small",3,!1),S=pe(e,"class",3,""),E=Xa(e,["$$slots","$$events","$$legacy","variant","small","class","children"]);const C={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},o={default:"border-edge bg-surface text-primary hover:bg-hover",cta:"border-accent bg-accent text-white hover:opacity-90",danger:"border-danger bg-danger text-white hover:opacity-90","accent-outline":"border-accent text-accent bg-surface hover:bg-accent/10","danger-outline":"border-danger text-danger bg-surface hover:bg-danger/10"};var l=Nu();$a(l,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${C[r()?"small":"normal"]??""} ${o[i()]??""} ${S()??""}`,...E}));var h=z(l);Dn(h,()=>e.children),q(t,l)}var Fu=ee('<span class="text-success">&#10003;</span>'),Wu=ee('<span class="text-accent">&#9741;</span>'),Uu=ee('<span class="text-[10px] text-muted"> </span>'),ju=ee("<span> </span>"),zu=ee('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function rl(t,e){qe(e,!0);let i=pe(e,"showTimestamp",3,!1),r=pe(e,"large",3,!1),S=pe(e,"wrap",3,!1);var E=zu(),C=Fe(E),o=z(C);{var l=n=>{var a=Fu();q(n,a)},h=n=>{var a=Wu();q(n,a)};ne(o,n=>{e.notification.type==="agent_stopped"||e.notification.type==="worktree_auto_removed"?n(l):n(h,-1)})}var f=$(C,2),u=z(f),v=z(u),d=$(u,2);{var m=n=>{var a=Uu(),s=z(a);ce(c=>oe(s,c),[()=>new Date(e.notification.timestamp).toLocaleTimeString()]),q(n,a)},_=n=>{var a=ju(),s=z(a);ce(()=>{Re(a,1,`text-xs text-accent ${S()?"whitespace-normal break-all":"truncate"}`),oe(s,e.notification.url)}),q(n,a)};ne(d,n=>{i()?n(m):e.notification.url&&n(_,1)})}ce(()=>{Re(C,1,`shrink-0 ${r()?"text-base":"text-sm"}`),Re(u,1,`${r()?"text-sm":"text-xs"} text-primary ${S()?"whitespace-normal break-words":"truncate"}`),oe(v,e.notification.message)}),q(t,E),$e()}var Ku=ee('<button type="button" class="p-1 -ml-1 cursor-pointer bg-transparent border-none text-muted hover:text-primary" title="Toggle sidebar"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>'),Vu=ee('<button type="button" class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning bg-transparent cursor-pointer hover:bg-warning/10"> </button>'),qu=ee('<div class="topbar-main-prs min-w-0 flex-1"><!></div>'),$u=ee("<!> <!> <!>",1),Gu=ee('<div class="more-dropdown svelte-gwjq7z"><div class="flex flex-col gap-2 p-3"><!> <!></div></div>'),Xu=ee('<div class="more-container relative"><button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="More info"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg></button> <!></div>'),Yu=ee('<span class="absolute -top-0.5 -right-0.5 w-4 h-4 rounded-full bg-accent text-white text-[10px] flex items-center justify-center leading-none"> </span>'),Ju=ee('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),Zu=ee('<li><button type="button" class="w-full px-3 py-2 text-left bg-transparent border-none text-inherit cursor-pointer hover:bg-hover flex items-center gap-2"><!></button></li>'),Qu=ee('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),ed=ee('<div class="bell-dropdown svelte-gwjq7z"><div class="text-xs font-semibold text-muted px-3 py-2 border-b border-edge">Notifications</div> <!></div>'),td=ee('<div class="flex items-stretch bg-topbar border-b border-edge min-h-12"><div class="flex-1 min-w-0 flex flex-col justify-center px-4 py-2.5 gap-1.5"><div class="topbar-main-row flex items-start gap-3 min-w-0"><div class="topbar-main-meta flex items-center gap-3 min-w-0"><!> <span class="min-w-0 text-sm font-semibold truncate"> </span> <!> <!></div> <!></div> <!></div> <div class="shrink-0 flex gap-2 items-center px-4"><!> <!> <div class="bell-container relative ml-3"><button type="button" class="relative p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Notifications"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"></path><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"></path></svg> <!></button> <!></div> <button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Settings"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button></div></div>');function rd(t,e){qe(e,!0);let i=pe(e,"linkedRepos",19,()=>[]),r=pe(e,"isMobile",3,!1),S=pe(e,"notificationHistory",19,()=>[]),E=pe(e,"unreadCount",3,0),C=se(!1),o=se(!1);function l(){var D;W(C,!b(C)),b(C)&&((D=e.onbellopen)==null||D.call(e))}function h(D){const V=D.target;V.closest(".bell-container")||W(C,!1),V.closest(".more-container")||W(o,!1)}function f(D,V){return!D||D.length<=V?D:`${D.slice(0,V-3)}...`}let u=le(()=>{var D;return Ri((D=e.worktree)==null?void 0:D.dir,e.sshHost)}),v=le(()=>f(e.name,30)),d=le(()=>{var D;return(((D=e.worktree)==null?void 0:D.prs)??[]).filter(V=>!V.repo||!i().some(B=>B.alias===V.repo))}),m=le(()=>i().map(D=>{var V;return{alias:D.alias,dir:D.dir,cursorUrl:Ri(D.dir&&e.name?`${D.dir}/${e.name}`:null,e.sshHost),prs:(((V=e.worktree)==null?void 0:V.prs)??[]).filter(B=>B.repo===D.alias)}}).filter(D=>D.prs.length>0||D.cursorUrl)),_=le(()=>b(d).length>0||b(m).length>0);var n=td();wr("click",tn,h);var a=z(n),s=z(a),c=z(s),p=z(c);{var w=D=>{var V=Ku();ge("click",V,function(...B){var K;(K=e.ontogglesidebar)==null||K.apply(this,B)}),q(D,V)};ne(p,D=>{r()&&e.ontogglesidebar&&D(w)})}var y=$(p,2),k=z(y),g=$(y,2);{var x=D=>{var V=Vu(),B=z(V);ce(()=>oe(B,e.worktree.dirty?"dirty":"unpushed")),ge("click",V,function(...K){var X;(X=e.ondirtyclick)==null||X.apply(this,K)}),q(D,V)};ne(g,D=>{var V,B;((V=e.worktree)!=null&&V.dirty||(B=e.worktree)!=null&&B.unpushed)&&D(x)})}var T=$(g,2);{var A=D=>{tl(D,{get issue(){return e.worktree.linearIssue},clickable:!0})};ne(T,D=>{var V;(V=e.worktree)!=null&&V.linearIssue&&D(A)})}var P=$(c,2);{var M=D=>{var V=qu(),B=z(V);{let K=le(()=>{var X;return((X=e.worktree)==null?void 0:X.services)??[]});Yi(B,{get prs(){return b(d)},get services(){return b(K)},get cursorUrl(){return b(u)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}q(D,V)};ne(P,D=>{r()||D(M)})}var H=$(s,2);{var F=D=>{var V=Et(),B=Fe(V);Je(B,17,()=>b(m),K=>K.alias,(K,X)=>{Yi(K,{get label(){return b(X).alias},get prs(){return b(X).prs},get cursorUrl(){return b(X).cursorUrl},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(D,V)};ne(H,D=>{r()||D(F)})}var Y=$(a,2),J=z(Y);{var Z=D=>{var V=$u(),B=Fe(V);{var K=ae=>{_t(ae,{variant:"default",get onclick(){return e.onclose},title:"Close worktree window",children:(de,ve)=>{var te=Ye();ce(()=>oe(te,r()?"C":"Close")),q(de,te)},$$slots:{default:!0}})};ne(B,ae=>{e.worktree.mux==="✓"&&ae(K)})}var X=$(B,2);_t(X,{variant:"accent-outline",get onclick(){return e.onmerge},title:"Merge worktree",children:(ae,de)=>{var ve=Ye();ce(()=>oe(ve,r()?"M":"Merge")),q(ae,ve)},$$slots:{default:!0}});var he=$(X,2);_t(he,{variant:"danger-outline",get onclick(){return e.onremove},title:"Remove worktree",children:(ae,de)=>{var ve=Ye();ce(()=>oe(ve,r()?"R":"Remove")),q(ae,ve)},$$slots:{default:!0}}),q(D,V)};ne(J,D=>{e.worktree&&D(Z)})}var L=$(J,2);{var O=D=>{var V=Xu(),B=z(V),K=$(B,2);{var X=he=>{var ae=Gu(),de=z(ae),ve=z(de);Yi(ve,{get prs(){return b(d)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}});var te=$(ve,2);Je(te,17,()=>b(m),fe=>fe.alias,(fe,ye)=>{Yi(fe,{get label(){return b(ye).alias},get prs(){return b(ye).prs},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),q(he,ae)};ne(K,he=>{b(o)&&he(X)})}ge("keydown",V,()=>{}),ge("click",B,()=>{W(o,!b(o))}),q(D,V)};ne(L,D=>{r()&&e.worktree&&b(_)&&D(O)})}var R=$(L,2),I=z(R),N=$(z(I),2);{var Q=D=>{var V=Yu(),B=z(V);ce(()=>oe(B,E()>9?"9+":E())),q(D,V)};ne(N,D=>{E()>0&&D(Q)})}var ie=$(I,2);{var ue=D=>{var V=ed(),B=$(z(V),2);{var K=he=>{var ae=Ju();q(he,ae)},X=he=>{var ae=Qu();Je(ae,21,S,de=>de.id,(de,ve)=>{var te=Zu(),fe=z(te),ye=z(fe);rl(ye,{get notification(){return b(ve)},showTimestamp:!0}),ge("click",fe,()=>{var Ee;(Ee=e.onnotificationselect)==null||Ee.call(e,b(ve).branch),W(C,!1)}),q(de,te)}),q(he,ae)};ne(B,he=>{S().length===0?he(K):he(X,-1)})}q(D,V)};ne(ie,D=>{b(C)&&D(ue)})}var j=$(R,2);ce(()=>{xe(y,"title",e.name??void 0),oe(k,b(v)??"Select a worktree")}),ge("keydown",R,()=>{}),ge("click",I,l),ge("click",j,function(...D){var V;(V=e.onsettings)==null||V.apply(this,D)}),q(t,n),$e()}bt(["click","keydown"]);var Ns={exports:{}},Do;function id(){return Do||(Do=1,(function(t,e){(function(i,r){t.exports=r()})(globalThis,(()=>(()=>{var i={4567:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=l(9042),v=l(9924),d=l(844),m=l(4725),_=l(2585),n=l(3656);let a=o.AccessibilityManager=class extends d.Disposable{constructor(s,c,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
3
3
  `)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,d.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let c=0;c<s;c++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
4
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,c){this._liveRegionDebouncer.refresh(s,c,this._terminal.rows)}_renderRows(s,c){const p=this._terminal.buffer,w=p.lines.length.toString();for(let y=s;y<=c;y++){const k=p.lines.get(p.ydisp+y),g=[],x=(k==null?void 0:k.translateToString(!0,void 0,void 0,g))||"",T=(p.ydisp+y+1).toString(),A=this._rowElements[y];A&&(x.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=x,this._rowColumns.set(A,g)),A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,c){const p=s.target,w=this._rowElements[c===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,k;if(c===0?(y=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(y=this._rowElements.shift(),k=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((c.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===p.node&&c.offset>p.offset)&&([c,p]=[p,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const w=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:w,offset:((x=w.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:A})=>{const P=T instanceof Text?T.parentNode:T;let B=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(P);if(!H)return console.warn("columns is null. Race condition?"),null;let W=A<H.length?H[A]:H.slice(-1)[0]+1;return W>=this._terminal.cols&&(++B,W=0),{row:B,column:W}},k=y(c),g=y(p);if(k&&g){if(k.row>g.row||k.row===g.row&&k.column>=g.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(g.row-k.row)*this._terminal.cols-k.column+g.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=a=h([f(1,_.IInstantiationService),f(2,m.ICoreBrowserService),f(3,m.IRenderService)],a)},3614:(C,o)=>{function l(v){return v.replace(/\r?\n/g,"\r")}function h(v,d){return d?"\x1B[200~"+v+"\x1B[201~":v}function f(v,d,m,_){v=h(v=l(v),m.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),m.triggerDataEvent(v,!0),d.value=""}function u(v,d,m){const _=m.getBoundingClientRect(),n=v.clientX-_.left-10,a=v.clientY-_.top-10;d.style.width="20px",d.style.height="20px",d.style.left=`${n}px`,d.style.top=`${a}px`,d.style.zIndex="1000",d.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=h,o.copyHandler=function(v,d){v.clipboardData&&v.clipboardData.setData("text/plain",d.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,d,m,_){v.stopPropagation(),v.clipboardData&&f(v.clipboardData.getData("text/plain"),d,m,_)},o.paste=f,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(v,d,m,_,n){u(v,d,m),n&&_.rightClickSelect(v),d.value=_.selectionText,d.select()}},7239:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=l(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,u,v){this._css.set(f,u,v)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,v){this._color.set(f,u,v)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,h,f,u){l.addEventListener(h,f,u);let v=!1;return{dispose:()=>{v||(v=!0,l.removeEventListener(h,f,u))}}}},3551:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=l(3656),v=l(8460),d=l(844),m=l(2585),_=l(4725);let n=o.Linkifier=class extends d.Disposable{get currentLink(){return this._currentLink}constructor(a,s,c,p,w){super(),this._element=a,this._mouseService=s,this._renderService=c,this._bufferService=p,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,d.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,d.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const c=a.composedPath();for(let p=0;p<c.length;p++){const w=c[p];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,s){var p,w;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach((y=>{y==null||y.forEach((k=>{k.link.dispose&&k.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let c=!1;for(const[y,k]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(c=this._checkLinkProviderResult(y,a,c)):k.provideLinks(a.y,(g=>{var T,A;if(this._isMouseOut)return;const x=g==null?void 0:g.map((P=>({link:P})));(T=this._activeProviderReplies)==null||T.set(y,x),c=this._checkLinkProviderResult(y,a,c),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,s){const c=new Set;for(let p=0;p<s.size;p++){const w=s.get(p);if(w)for(let y=0;y<w.length;y++){const k=w[y],g=k.link.range.start.y<a?0:k.link.range.start.x,x=k.link.range.end.y>a?this._bufferService.cols:k.link.range.end.x;for(let T=g;T<=x;T++){if(c.has(T)){w.splice(y--,1);break}c.add(T)}}}}_checkLinkProviderResult(a,s,c){var y;if(!this._activeProviderReplies)return c;const p=this._activeProviderReplies.get(a);let w=!1;for(let k=0;k<a;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&p){const k=p.find((g=>this._linkAtPosition(g.link,s)));k&&(c=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let k=0;k<this._activeProviderReplies.size;k++){const g=(y=this._activeProviderReplies.get(k))==null?void 0:y.find((x=>this._linkAtPosition(x.link,s)));if(g){c=!0,this._handleNewLink(g);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,s){this._currentLink&&this._lastMouseEvent&&(!a||!s||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,d.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(a.link,s)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var c,p;return(p=(c=this._currentLink)==null?void 0:c.state)==null?void 0:p.decorations.pointerCursor},set:c=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>{var c,p;return(p=(c=this._currentLink)==null?void 0:c.state)==null?void 0:p.decorations.underline},set:c=>{var p,w,y;(p=this._currentLink)!=null&&p.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const p=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(p,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(a,s,c){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(c,s.text)}_fireUnderlineEvent(a,s){const c=a.range,p=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-p-1,c.end.x,c.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(a,s,c){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(c,s.text)}_linkAtPosition(a,s){const c=a.range.start.y*this._bufferService.cols+a.range.start.x,p=a.range.end.y*this._bufferService.cols+a.range.end.x,w=s.y*this._bufferService.cols+s.x;return c<=w&&w<=p}_positionFromMouseEvent(a,s,c){const p=c.getCoords(a,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,s,c,p,w){return{x1:a,y1:s,x2:c,y2:p,cols:this._bufferService.cols,fg:w}}};o.Linkifier=n=h([f(1,_.IMouseService),f(2,_.IRenderService),f(3,m.IBufferService),f(4,_.ILinkProviderService)],n)},9042:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=l(511),v=l(2585);let d=o.OscLinkProvider=class{constructor(_,n,a){this._bufferService=_,this._optionsService=n,this._oscLinkService=a}provideLinks(_,n){var x;const a=this._bufferService.buffer.lines.get(_-1);if(!a)return void n(void 0);const s=[],c=this._optionsService.rawOptions.linkHandler,p=new u.CellData,w=a.getTrimmedLength();let y=-1,k=-1,g=!1;for(let T=0;T<w;T++)if(k!==-1||a.hasContent(T)){if(a.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=T,y=p.extended.urlId;continue}g=p.extended.urlId!==y}else k!==-1&&(g=!0);if(g||k!==-1&&T===w-1){const A=(x=this._oscLinkService.getLinkData(y))==null?void 0:x.uri;if(A){const P={start:{x:k+1,y:_},end:{x:T+(g||T!==w-1?0:1),y:_}};let B=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const H=new URL(A);["http:","https:"].includes(H.protocol)||(B=!0)}catch{B=!0}B||s.push({text:A,range:P,activate:(H,W)=>c?c.activate(H,W,P):m(0,W),hover:(H,W)=>{var Y;return(Y=c==null?void 0:c.hover)==null?void 0:Y.call(c,H,W,P)},leave:(H,W)=>{var Y;return(Y=c==null?void 0:c.leave)==null?void 0:Y.call(c,H,W,P)}})}g=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=T,y=p.extended.urlId):(k=-1,y=-1)}}n(s)}};function m(_,n){if(confirm(`Do you want to navigate to ${n}?
4
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,c){this._liveRegionDebouncer.refresh(s,c,this._terminal.rows)}_renderRows(s,c){const p=this._terminal.buffer,w=p.lines.length.toString();for(let y=s;y<=c;y++){const k=p.lines.get(p.ydisp+y),g=[],x=(k==null?void 0:k.translateToString(!0,void 0,void 0,g))||"",T=(p.ydisp+y+1).toString(),A=this._rowElements[y];A&&(x.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=x,this._rowColumns.set(A,g)),A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,c){const p=s.target,w=this._rowElements[c===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,k;if(c===0?(y=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(y=this._rowElements.shift(),k=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((c.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===p.node&&c.offset>p.offset)&&([c,p]=[p,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const w=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:w,offset:((x=w.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:A})=>{const P=T instanceof Text?T.parentNode:T;let M=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(P);if(!H)return console.warn("columns is null. Race condition?"),null;let F=A<H.length?H[A]:H.slice(-1)[0]+1;return F>=this._terminal.cols&&(++M,F=0),{row:M,column:F}},k=y(c),g=y(p);if(k&&g){if(k.row>g.row||k.row===g.row&&k.column>=g.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(g.row-k.row)*this._terminal.cols-k.column+g.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=a=h([f(1,_.IInstantiationService),f(2,m.ICoreBrowserService),f(3,m.IRenderService)],a)},3614:(C,o)=>{function l(v){return v.replace(/\r?\n/g,"\r")}function h(v,d){return d?"\x1B[200~"+v+"\x1B[201~":v}function f(v,d,m,_){v=h(v=l(v),m.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),m.triggerDataEvent(v,!0),d.value=""}function u(v,d,m){const _=m.getBoundingClientRect(),n=v.clientX-_.left-10,a=v.clientY-_.top-10;d.style.width="20px",d.style.height="20px",d.style.left=`${n}px`,d.style.top=`${a}px`,d.style.zIndex="1000",d.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=h,o.copyHandler=function(v,d){v.clipboardData&&v.clipboardData.setData("text/plain",d.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,d,m,_){v.stopPropagation(),v.clipboardData&&f(v.clipboardData.getData("text/plain"),d,m,_)},o.paste=f,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(v,d,m,_,n){u(v,d,m),n&&_.rightClickSelect(v),d.value=_.selectionText,d.select()}},7239:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=l(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,u,v){this._css.set(f,u,v)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,v){this._color.set(f,u,v)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,h,f,u){l.addEventListener(h,f,u);let v=!1;return{dispose:()=>{v||(v=!0,l.removeEventListener(h,f,u))}}}},3551:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=l(3656),v=l(8460),d=l(844),m=l(2585),_=l(4725);let n=o.Linkifier=class extends d.Disposable{get currentLink(){return this._currentLink}constructor(a,s,c,p,w){super(),this._element=a,this._mouseService=s,this._renderService=c,this._bufferService=p,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,d.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,d.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const c=a.composedPath();for(let p=0;p<c.length;p++){const w=c[p];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,s){var p,w;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach((y=>{y==null||y.forEach((k=>{k.link.dispose&&k.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let c=!1;for(const[y,k]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(c=this._checkLinkProviderResult(y,a,c)):k.provideLinks(a.y,(g=>{var T,A;if(this._isMouseOut)return;const x=g==null?void 0:g.map((P=>({link:P})));(T=this._activeProviderReplies)==null||T.set(y,x),c=this._checkLinkProviderResult(y,a,c),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,s){const c=new Set;for(let p=0;p<s.size;p++){const w=s.get(p);if(w)for(let y=0;y<w.length;y++){const k=w[y],g=k.link.range.start.y<a?0:k.link.range.start.x,x=k.link.range.end.y>a?this._bufferService.cols:k.link.range.end.x;for(let T=g;T<=x;T++){if(c.has(T)){w.splice(y--,1);break}c.add(T)}}}}_checkLinkProviderResult(a,s,c){var y;if(!this._activeProviderReplies)return c;const p=this._activeProviderReplies.get(a);let w=!1;for(let k=0;k<a;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&p){const k=p.find((g=>this._linkAtPosition(g.link,s)));k&&(c=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let k=0;k<this._activeProviderReplies.size;k++){const g=(y=this._activeProviderReplies.get(k))==null?void 0:y.find((x=>this._linkAtPosition(x.link,s)));if(g){c=!0,this._handleNewLink(g);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,s){this._currentLink&&this._lastMouseEvent&&(!a||!s||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,d.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(a.link,s)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var c,p;return(p=(c=this._currentLink)==null?void 0:c.state)==null?void 0:p.decorations.pointerCursor},set:c=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>{var c,p;return(p=(c=this._currentLink)==null?void 0:c.state)==null?void 0:p.decorations.underline},set:c=>{var p,w,y;(p=this._currentLink)!=null&&p.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const p=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(p,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(a,s,c){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(c,s.text)}_fireUnderlineEvent(a,s){const c=a.range,p=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-p-1,c.end.x,c.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(a,s,c){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(c,s.text)}_linkAtPosition(a,s){const c=a.range.start.y*this._bufferService.cols+a.range.start.x,p=a.range.end.y*this._bufferService.cols+a.range.end.x,w=s.y*this._bufferService.cols+s.x;return c<=w&&w<=p}_positionFromMouseEvent(a,s,c){const p=c.getCoords(a,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,s,c,p,w){return{x1:a,y1:s,x2:c,y2:p,cols:this._bufferService.cols,fg:w}}};o.Linkifier=n=h([f(1,_.IMouseService),f(2,_.IRenderService),f(3,m.IBufferService),f(4,_.ILinkProviderService)],n)},9042:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=l(511),v=l(2585);let d=o.OscLinkProvider=class{constructor(_,n,a){this._bufferService=_,this._optionsService=n,this._oscLinkService=a}provideLinks(_,n){var x;const a=this._bufferService.buffer.lines.get(_-1);if(!a)return void n(void 0);const s=[],c=this._optionsService.rawOptions.linkHandler,p=new u.CellData,w=a.getTrimmedLength();let y=-1,k=-1,g=!1;for(let T=0;T<w;T++)if(k!==-1||a.hasContent(T)){if(a.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=T,y=p.extended.urlId;continue}g=p.extended.urlId!==y}else k!==-1&&(g=!0);if(g||k!==-1&&T===w-1){const A=(x=this._oscLinkService.getLinkData(y))==null?void 0:x.uri;if(A){const P={start:{x:k+1,y:_},end:{x:T+(g||T!==w-1?0:1),y:_}};let M=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const H=new URL(A);["http:","https:"].includes(H.protocol)||(M=!0)}catch{M=!0}M||s.push({text:A,range:P,activate:(H,F)=>c?c.activate(H,F,P):m(0,F),hover:(H,F)=>{var Y;return(Y=c==null?void 0:c.hover)==null?void 0:Y.call(c,H,F,P)},leave:(H,F)=>{var Y;return(Y=c==null?void 0:c.leave)==null?void 0:Y.call(c,H,F,P)}})}g=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=T,y=p.extended.urlId):(k=-1,y=-1)}}n(s)}};function m(_,n){if(confirm(`Do you want to navigate to ${n}?
5
5
 
6
- WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=d=h([f(0,v.IBufferService),f(1,v.IOptionsService),f(2,v.IOscLinkService)],d)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,h){this._renderCallback=l,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=l(3614),f=l(3656),u=l(3551),v=l(9042),d=l(3730),m=l(1680),_=l(3107),n=l(5744),a=l(2950),s=l(1296),c=l(428),p=l(4269),w=l(5114),y=l(8934),k=l(3230),g=l(9312),x=l(4725),T=l(6731),A=l(8055),P=l(8969),B=l(8460),H=l(844),W=l(6114),Y=l(8437),J=l(2584),Z=l(7399),L=l(5941),O=l(9074),R=l(2585),I=l(5435),N=l(4567),Q=l(779);class ie extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(j={}){super(j),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,V)=>this.refresh(D,V)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((D=>this._reportWindowsOptions(D)))),this.register(this._inputHandler.onColor((D=>this._handleColorEvent(D)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((D=>this._afterResize(D.cols,D.rows)))),this.register((0,H.toDisposable)((()=>{var D,V;this._customKeyEventHandler=void 0,(V=(D=this.element)==null?void 0:D.parentNode)==null||V.removeChild(this.element)})))}_handleColorEvent(j){if(this._themeService)for(const D of j){let V,M="";switch(D.index){case 256:V="foreground",M="10";break;case 257:V="background",M="11";break;case 258:V="cursor",M="12";break;default:V="ansi",M="4;"+D.index}switch(D.type){case 0:const K=A.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${M};${(0,L.toRgbString)(K)}${J.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors((X=>X.ansi[D.index]=A.channels.toColor(...D.color)));else{const X=V;this._themeService.modifyColors((ce=>ce[X]=A.channels.toColor(...D.color)))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(j){j?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(j){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var j;return(j=this.textarea)==null?void 0:j.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const j=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(j);if(!D)return;const V=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,K=D.getWidth(V),X=this._renderService.dimensions.css.cell.width*K,ce=this.buffer.y*this._renderService.dimensions.css.cell.height,ae=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ae+"px",this.textarea.style.top=ce+"px",this.textarea.style.width=X+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,h.copyHandler)(D,this._selectionService)})));const j=D=>(0,h.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",j)),this.register((0,f.addDisposableDomListener)(this.element,"paste",j)),W.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,h.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(j=>this._keyUp(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(j=>this._keyDown(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(j=>this._keyPress(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(j=>this._compositionHelper.compositionupdate(j)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(j=>this._inputEvent(j)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(j){var V;if(!j)throw new Error("Terminal requires a parent element.");if(j.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((V=this.element)==null?void 0:V.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=j.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),j.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,f.addDisposableDomListener)(this.screenElement,"mousemove",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,j.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(m.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const j=this,D=this.element;function V(X){const ce=j._mouseService.getMouseReportCoords(X,j.screenElement);if(!ce)return!1;let ae,de;switch(X.overrideType||X.type){case"mousemove":de=32,X.buttons===void 0?(ae=3,X.button!==void 0&&(ae=X.button<3?X.button:3)):ae=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":de=0,ae=X.button<3?X.button:3;break;case"mousedown":de=1,ae=X.button<3?X.button:3;break;case"wheel":if(j._customWheelEventHandler&&j._customWheelEventHandler(X)===!1||j.viewport.getLinesScrolled(X)===0)return!1;de=X.deltaY<0?0:1,ae=4;break;default:return!1}return!(de===void 0||ae===void 0||ae>4)&&j.coreMouseService.triggerMouseEvent({col:ce.col,row:ce.row,x:ce.x,y:ce.y,button:ae,action:de,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:X=>(V(X),X.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(X)),wheel:X=>(V(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&V(X)},mousemove:X=>{X.buttons||V(X)}};this.register(this.coreMouseService.onProtocolChange((X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&X?M.mousemove||(D.addEventListener("mousemove",K.mousemove),M.mousemove=K.mousemove):(D.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&X?M.wheel||(D.addEventListener("wheel",K.wheel,{passive:!1}),M.wheel=K.wheel):(D.removeEventListener("wheel",M.wheel),M.wheel=null),2&X?M.mouseup||(M.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&X?M.mousedrag||(M.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(D,"mousedown",(X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return V(X),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(X)}))),this.register((0,f.addDisposableDomListener)(D,"wheel",(X=>{if(!M.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const ce=this.viewport.getLinesScrolled(X);if(ce===0)return;const ae=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let de="";for(let ve=0;ve<Math.abs(ce);ve++)de+=ae;return this.coreService.triggerDataEvent(de,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(D,"touchstart",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(D,"touchmove",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)}),{passive:!1}))}refresh(j,D){var V;(V=this._renderService)==null||V.refreshRows(j,D)}updateCursorStyle(j){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(j)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(j,D,V=0){var M;V===1?(super.scrollLines(j,D,V),this.refresh(0,this.rows-1)):(M=this.viewport)==null||M.scrollLines(j)}paste(j){(0,h.paste)(j,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(j){this._customKeyEventHandler=j}attachCustomWheelEventHandler(j){this._customWheelEventHandler=j}registerLinkProvider(j){return this._linkProviderService.registerLinkProvider(j)}registerCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(j);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(j)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(j){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+j)}registerDecoration(j){return this._decorationService.registerDecoration(j)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(j,D,V){this._selectionService.setSelection(j,D,V)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var j;(j=this._selectionService)==null||j.clearSelection()}selectAll(){var j;(j=this._selectionService)==null||j.selectAll()}selectLines(j,D){var V;(V=this._selectionService)==null||V.selectLines(j,D)}_keyDown(j){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&j.altKey;if(!D&&!this._compositionHelper.keydown(j))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||j.key!=="Dead"&&j.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,Z.evaluateKeyboardEvent)(j,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(j),V.type===3||V.type===2){const M=this.rows-1;return this.scrollLines(V.type===2?-M:M),this.cancel(j,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,j)||(V.cancel&&this.cancel(j,!0),!V.key||!!(j.key&&!j.ctrlKey&&!j.altKey&&!j.metaKey&&j.key.length===1&&j.key.charCodeAt(0)>=65&&j.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==J.C0.ETX&&V.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||j.altKey||j.ctrlKey?this.cancel(j,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(j,D){const V=j.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||j.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||j.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?V:V&&(!D.keyCode||D.keyCode>47)}_keyUp(j){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(j)||this.focus(),this.updateCursorStyle(j),this._keyPressHandled=!1)}_keyPress(j){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;if(this.cancel(j),j.charCode)D=j.charCode;else if(j.which===null||j.which===void 0)D=j.keyCode;else{if(j.which===0||j.charCode===0)return!1;D=j.which}return!(!D||(j.altKey||j.ctrlKey||j.metaKey)&&!this._isThirdLevelShift(this.browser,j)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(j){if(j.data&&j.inputType==="insertText"&&(!j.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=j.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(j),!0}return!1}resize(j,D){j!==this.cols||D!==this.rows?super.resize(j,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(j,D){var V,M;(V=this._charSizeService)==null||V.measure(),(M=this.viewport)==null||M.syncScrollArea(!0)}clear(){var j;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(j=this.viewport)==null||j.reset(),this.refresh(0,this.rows-1)}}reset(){var D,V;this.options.rows=this.rows,this.options.cols=this.cols;const j=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(V=this.viewport)==null||V.reset(),this._customKeyEventHandler=j,this.refresh(0,this.rows-1)}clearTextureAtlas(){var j;(j=this._renderService)==null||j.clearTextureAtlas()}_reportFocus(){var j;(j=this.element)!=null&&j.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(j){if(this._renderService)switch(j){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${V};${D}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${K};${M}t`)}}cancel(j,D){if(this.options.cancelEvents||D)return j.preventDefault(),j.stopPropagation(),!1}}o.Terminal=ie},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,h=1e3){this._renderCallback=l,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,d=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),d)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h)}}},1680:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=l(3656),v=l(4725),d=l(8460),m=l(844),_=l(2585);let n=o.Viewport=class extends m.Disposable{constructor(a,s,c,p,w,y,k,g){super(),this._viewportElement=a,this._scrollArea=s,this._bufferService=c,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(g.colors),this.register(g.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,s){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const s=this._getPixelsScrolled(a);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(a,s){var g;let c,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let x=a;x<y;x++){const T=k.get(x);if(!T)continue;const A=(g=k.get(x+1))==null?void 0:g.isWrapped;if(p+=T.translateToString(!A),!A||x===k.length-1){const P=document.createElement("div");P.textContent=p,w.push(P),p.length>0&&(c=P),p=""}}return{bufferElements:w,cursorElement:c}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(a,s){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&s.altKey||c==="ctrl"&&s.ctrlKey||c==="shift"&&s.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const s=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}};o.Viewport=n=h([f(2,_.IBufferService),f(3,_.IOptionsService),f(4,v.ICharSizeService),f(5,v.IRenderService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],n)},3107:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=l(4725),v=l(844),d=l(2585);let m=o.BufferDecorationRenderer=class extends v.Disposable{constructor(_,n,a,s,c){super(),this._screenElement=_,this._bufferService=n,this._coreBrowserService=a,this._decorationService=s,this._renderService=c,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((p=>this._removeDecoration(p)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var s;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((s=_==null?void 0:_.options)==null?void 0:s.layer)==="top"),n.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=_.options.x??0;return a&&a>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(_,n),n}_refreshStyle(_){const n=_.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let a=this._decorationElements.get(_);a||(a=this._createElement(_),_.element=a,this._decorationElements.set(_,a),this._container.appendChild(a),_.onDispose((()=>{this._decorationElements.delete(_),a.remove()}))),a.style.top=n*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(a)}}_refreshXPosition(_,n=_.element){if(!n)return;const a=_.options.x??0;(_.options.anchor||"left")==="right"?n.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var n;(n=this._decorationElements.get(_))==null||n.remove(),this._decorationElements.delete(_),_.dispose()}};o.BufferDecorationRenderer=m=h([f(1,d.IBufferService),f(2,u.ICoreBrowserService),f(3,d.IDecorationService),f(4,u.IRenderService)],m)},5871:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const h of this._zones)if(h.color===l.options.overviewRulerOptions.color&&h.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,l.marker.line))return;if(this._lineAdjacentToZone(h,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(h,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,h){return h>=l.startBufferLine&&h<=l.endBufferLine}_lineAdjacentToZone(l,h,f){return h>=l.startBufferLine-this._linePadding[f||"full"]&&h<=l.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(l,h){l.startBufferLine=Math.min(l.startBufferLine,h),l.endBufferLine=Math.max(l.endBufferLine,h)}}},5744:function(C,o,l){var h=this&&this.__decorate||function(c,p,w,y){var k,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,p,w,y);else for(var T=c.length-1;T>=0;T--)(k=c[T])&&(x=(g<3?k(x):g>3?k(p,w,x):k(p,w))||x);return g>3&&x&&Object.defineProperty(p,w,x),x},f=this&&this.__param||function(c,p){return function(w,y){p(w,y,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=l(5871),v=l(4725),d=l(844),m=l(2585),_={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends d.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,p,w,y,k,g,x){var A;super(),this._viewportElement=c,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=g,this._coreBrowserService=x,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,d.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=p,n.right=c,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=n.left,a.right=n.left+n.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);_.left=p,_.center=p,_.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const p of c)p.position!=="full"&&this._renderColorZone(p);for(const p of c)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(a[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-_[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[c.position||"full"]))}_queueRefresh(c,p){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=s=h([f(2,m.IBufferService),f(3,m.IDecorationService),f(4,v.IRenderService),f(5,m.IOptionsService),f(6,v.ICoreBrowserService)],s)},2950:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=l(4725),v=l(2585),d=l(2584);let m=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,n,a,s,c,p){this._textarea=_,this._compositionView=n,this._bufferService=a,this._optionsService=s,this._coreService=c,this._renderService=p,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,a=n.replace(_,"");this._dataAlreadySent=a,n.length>_.length?this._coreService.triggerDataEvent(a,!0):n.length<_.length?this._coreService.triggerDataEvent(`${d.C0.DEL}`,!0):n.length===_.length&&n!==_&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=m=h([f(2,v.IBufferService),f(3,v.IOptionsService),f(4,v.ICoreService),f(5,u.IRenderService)],m)},9806:(C,o)=>{function l(h,f,u){const v=u.getBoundingClientRect(),d=h.getComputedStyle(u),m=parseInt(d.getPropertyValue("padding-left")),_=parseInt(d.getPropertyValue("padding-top"));return[f.clientX-v.left-m,f.clientY-v.top-_]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(h,f,u,v,d,m,_,n,a){if(!m)return;const s=l(h,f,u);return s?(s[0]=Math.ceil((s[0]+(a?_/2:0))/_),s[1]=Math.ceil(s[1]/n),s[0]=Math.min(Math.max(s[0],1),v+(a?1:0)),s[1]=Math.min(Math.max(s[1],1),d),s):void 0}},9504:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=l(2584);function f(n,a,s,c){const p=n-u(n,s),w=a-u(a,s),y=Math.abs(p-w)-(function(k,g,x){let T=0;const A=k-u(k,x),P=g-u(g,x);for(let B=0;B<Math.abs(A-P);B++){const H=v(k,g)==="A"?-1:1,W=x.buffer.lines.get(A+H*B);W!=null&&W.isWrapped&&T++}return T})(n,a,s);return _(y,m(v(n,a),c))}function u(n,a){let s=0,c=a.buffer.lines.get(n),p=c==null?void 0:c.isWrapped;for(;p&&n>=0&&n<a.rows;)s++,c=a.buffer.lines.get(--n),p=c==null?void 0:c.isWrapped;return s}function v(n,a){return n>a?"A":"B"}function d(n,a,s,c,p,w){let y=n,k=a,g="";for(;y!==s||k!==c;)y+=p?1:-1,p&&y>w.cols-1?(g+=w.buffer.translateBufferLineToString(k,!1,n,y),y=0,n=0,k++):!p&&y<0&&(g+=w.buffer.translateBufferLineToString(k,!1,0,n+1),y=w.cols-1,n=y,k--);return g+w.buffer.translateBufferLineToString(k,!1,n,y)}function m(n,a){const s=a?"O":"[";return h.C0.ESC+s+n}function _(n,a){n=Math.floor(n);let s="";for(let c=0;c<n;c++)s+=a;return s}o.moveToCellSequence=function(n,a,s,c){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return(function(g,x,T,A,P,B){return f(x,A,P,B).length===0?"":_(d(g,x,g,x-u(x,P),!1,P).length,m("D",B))})(p,w,0,a,s,c)+f(w,a,s,c)+(function(g,x,T,A,P,B){let H;H=f(x,A,P,B).length>0?A-u(A,P):x;const W=A,Y=(function(J,Z,L,O,R,I){let N;return N=f(L,O,R,I).length>0?O-u(O,R):Z,J<L&&N<=O||J>=L&&N<O?"C":"D"})(g,x,T,A,P,B);return _(d(g,H,T,W,Y==="C",P).length,m(Y,B))})(p,w,n,a,s,c);let y;if(w===a)return y=p>n?"D":"C",_(Math.abs(p-n),m(y,c));y=w>a?"D":"C";const k=Math.abs(w-a);return _((function(g,x){return x.cols-g})(w>a?n:p,s)+(k-1)*s.cols+1+((w>a?p:n)-1),m(y,c))}},1296:function(C,o,l){var h=this&&this.__decorate||function(B,H,W,Y){var J,Z=arguments.length,L=Z<3?H:Y===null?Y=Object.getOwnPropertyDescriptor(H,W):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(B,H,W,Y);else for(var O=B.length-1;O>=0;O--)(J=B[O])&&(L=(Z<3?J(L):Z>3?J(H,W,L):J(H,W))||L);return Z>3&&L&&Object.defineProperty(H,W,L),L},f=this&&this.__param||function(B,H){return function(W,Y){H(W,Y,B)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=l(3787),v=l(2550),d=l(2223),m=l(6171),_=l(6052),n=l(4725),a=l(8055),s=l(8460),c=l(844),p=l(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",g="xterm-bg-",x="xterm-focus",T="xterm-selection";let A=1,P=o.DomRenderer=class extends c.Disposable{constructor(B,H,W,Y,J,Z,L,O,R,I,N,Q,ie){super(),this._terminal=B,this._document=H,this._element=W,this._screenElement=Y,this._viewportElement=J,this._helperContainer=Z,this._linkifier2=L,this._charSizeService=R,this._optionsService=I,this._bufferService=N,this._coreBrowserService=Q,this._themeService=ie,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,m.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${y} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${y} .xterm-dim { color: ${a.color.multiplyOpacity(B.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;H+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,H+=`@keyframes ${J} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,H+=`${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,L]of B.ansi.entries())H+=`${this._terminalSelector} .${k}${Z} { color: ${L.css}; }${this._terminalSelector} .${k}${Z}.xterm-dim { color: ${a.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${g}${Z} { background-color: ${L.css}; }`;H+=`${this._terminalSelector} .${k}${d.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(B.background).css}; }${this._terminalSelector} .${k}${d.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${g}${d.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,H){for(let W=this._rowElements.length;W<=H;W++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,H){this._refreshRowElements(B,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,H,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,H,W),this.renderRows(0,this._bufferService.rows-1),!B||!H)return;this._selectionRenderModel.update(this._terminal,B,H,W);const Y=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||L<0)return;const O=this._document.createDocumentFragment();if(W){const R=B[0]>H[0];O.appendChild(this._createSelectionElement(Z,R?H[0]:B[0],R?B[0]:H[0],L-Z+1))}else{const R=Y===Z?B[0]:0,I=Z===J?H[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(Z,R,I));const N=L-Z-1;if(O.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,N)),Z!==L){const Q=J===L?H[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(O)}_createSelectionElement(B,H,W,Y=1){const J=this._document.createElement("div"),Z=H*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(W-H);return Z+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-Z),J.style.height=Y*this.dimensions.css.cell.height+"px",J.style.top=B*this.dimensions.css.cell.height+"px",J.style.left=`${Z}px`,J.style.width=`${L}px`,J}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const B of this._rowElements)B.replaceChildren()}renderRows(B,H){const W=this._bufferService.buffer,Y=W.ybase+W.y,J=Math.min(W.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=B;R<=H;R++){const I=R+W.ydisp,N=this._rowElements[R],Q=W.lines.get(I);if(!N||!Q)break;N.replaceChildren(...this._rowFactory.createRow(Q,I,I===Y,L,O,J,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,H,W,Y,J,Z){W<0&&(B=0),Y<0&&(H=0);const L=this._bufferService.rows-1;W=Math.max(Math.min(W,L),0),Y=Math.max(Math.min(Y,L),0),J=Math.min(J,this._bufferService.cols);const O=this._bufferService.buffer,R=O.ybase+O.y,I=Math.min(O.x,J-1),N=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=W;ue<=Y;++ue){const j=ue+O.ydisp,D=this._rowElements[ue],V=O.lines.get(j);if(!D||!V)break;D.replaceChildren(...this._rowFactory.createRow(V,j,j===R,Q,ie,I,N,this.dimensions.css.cell.width,this._widthCache,Z?ue===W?B:0:-1,Z?(ue===Y?H:J)-1:-1))}}};o.DomRenderer=P=h([f(7,p.IInstantiationService),f(8,n.ICharSizeService),f(9,p.IOptionsService),f(10,p.IBufferService),f(11,n.ICoreBrowserService),f(12,n.IThemeService)],P)},3787:function(C,o,l){var h=this&&this.__decorate||function(y,k,g,x){var T,A=arguments.length,P=A<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,g):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,k,g,x);else for(var B=y.length-1;B>=0;B--)(T=y[B])&&(P=(A<3?T(P):A>3?T(k,g,P):T(k,g))||P);return A>3&&P&&Object.defineProperty(k,g,P),P},f=this&&this.__param||function(y,k){return function(g,x){k(g,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=l(2223),v=l(643),d=l(511),m=l(2585),_=l(8055),n=l(4725),a=l(4269),s=l(6171),c=l(3734);let p=o.DomRendererRowFactory=class{constructor(y,k,g,x,T,A,P){this._document=y,this._characterJoinerService=k,this._optionsService=g,this._coreBrowserService=x,this._coreService=T,this._decorationService=A,this._themeService=P,this._workCell=new d.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,g){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=g}createRow(y,k,g,x,T,A,P,B,H,W,Y){const J=[],Z=this._characterJoinerService.getJoinedCharacters(k),L=this._themeService.colors;let O,R=y.getNoBgTrimmedLength();g&&R<A+1&&(R=A+1);let I=0,N="",Q=0,ie=0,ue=0,j=!1,D=0,V=!1,M=0;const K=[],X=W!==-1&&Y!==-1;for(let ce=0;ce<R;ce++){y.loadCell(ce,this._workCell);let ae=this._workCell.getWidth();if(ae===0)continue;let de=!1,ve=ce,te=this._workCell;if(Z.length>0&&ce===Z[0][0]){de=!0;const Ne=Z.shift();te=new a.JoinedCellData(this._workCell,y.translateToString(!0,Ne[0],Ne[1]),Ne[1]-Ne[0]),ve=Ne[1]-1,ae=te.getWidth()}const fe=this._isCellInSelection(ce,k),ye=g&&ce===A,Ee=X&&ce>=W&&ce<=Y;let Ge=!1;this._decorationService.forEachDecorationAtCell(ce,k,void 0,(Ne=>{Ge=!0}));let Pe=te.getChars()||v.WHITESPACE_CELL_CHAR;if(Pe===" "&&(te.isUnderline()||te.isOverline())&&(Pe=" "),M=ae*B-H.get(Pe,te.isBold(),te.isItalic()),O){if(I&&(fe&&V||!fe&&!V&&te.bg===Q)&&(fe&&V&&L.selectionForeground||te.fg===ie)&&te.extended.ext===ue&&Ee===j&&M===D&&!ye&&!de&&!Ge){te.isInvisible()?N+=v.WHITESPACE_CELL_CHAR:N+=Pe,I++;continue}I&&(O.textContent=N),O=this._document.createElement("span"),I=0,N=""}else O=this._document.createElement("span");if(Q=te.bg,ie=te.fg,ue=te.extended.ext,j=Ee,D=M,V=fe,de&&A>=ce&&A<=ve&&(A=ce),!this._coreService.isCursorHidden&&ye&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&K.push("xterm-cursor-blink"),K.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline")}}if(te.isBold()&&K.push("xterm-bold"),te.isItalic()&&K.push("xterm-italic"),te.isDim()&&K.push("xterm-dim"),N=te.isInvisible()?v.WHITESPACE_CELL_CHAR:te.getChars()||v.WHITESPACE_CELL_CHAR,te.isUnderline()&&(K.push(`xterm-underline-${te.extended.underlineStyle}`),N===" "&&(N=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let Ne=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&Ne<8&&(Ne+=8),O.style.textDecorationColor=L.ansi[Ne].css}te.isOverline()&&(K.push("xterm-overline"),N===" "&&(N=" ")),te.isStrikethrough()&&K.push("xterm-strikethrough"),Ee&&(O.style.textDecoration="underline");let Ae=te.getFgColor(),Xe=te.getFgColorMode(),je=te.getBgColor(),pt=te.getBgColorMode();const gt=!!te.isInverse();if(gt){const Ne=Ae;Ae=je,je=Ne;const Rt=Xe;Xe=pt,pt=Rt}let St,Dr,wt,Vt=!1;switch(this._decorationService.forEachDecorationAtCell(ce,k,void 0,(Ne=>{Ne.options.layer!=="top"&&Vt||(Ne.backgroundColorRGB&&(pt=50331648,je=Ne.backgroundColorRGB.rgba>>8&16777215,St=Ne.backgroundColorRGB),Ne.foregroundColorRGB&&(Xe=50331648,Ae=Ne.foregroundColorRGB.rgba>>8&16777215,Dr=Ne.foregroundColorRGB),Vt=Ne.options.layer==="top")})),!Vt&&fe&&(St=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,je=St.rgba>>8&16777215,pt=50331648,Vt=!0,L.selectionForeground&&(Xe=50331648,Ae=L.selectionForeground.rgba>>8&16777215,Dr=L.selectionForeground)),Vt&&K.push("xterm-decoration-top"),pt){case 16777216:case 33554432:wt=L.ansi[je],K.push(`xterm-bg-${je}`);break;case 50331648:wt=_.channels.toColor(je>>16,je>>8&255,255&je),this._addStyle(O,`background-color:#${w((je>>>0).toString(16),"0",6)}`);break;default:gt?(wt=L.foreground,K.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):wt=L.background}switch(St||te.isDim()&&(St=_.color.multiplyOpacity(wt,.5)),Xe){case 16777216:case 33554432:te.isBold()&&Ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ae+=8),this._applyMinimumContrast(O,wt,L.ansi[Ae],te,St,void 0)||K.push(`xterm-fg-${Ae}`);break;case 50331648:const Ne=_.channels.toColor(Ae>>16&255,Ae>>8&255,255&Ae);this._applyMinimumContrast(O,wt,Ne,te,St,Dr)||this._addStyle(O,`color:#${w(Ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,wt,L.foreground,te,St,Dr)||gt&&K.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}K.length&&(O.className=K.join(" "),K.length=0),ye||de||Ge?O.textContent=N:I++,M!==this.defaultSpacing&&(O.style.letterSpacing=`${M}px`),J.push(O),ce=ve}return O&&I&&(O.textContent=N),J}_applyMinimumContrast(y,k,g,x,T,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const P=this._getContrastCache(x);let B;if(T||A||(B=P.getColor(k.rgba,g.rgba)),B===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);B=_.color.ensureContrastRatio(T||k,A||g,H),P.setColor((T||k).rgba,(A||g).rgba,B??null)}return!!B&&(this._addStyle(y,`color:${B.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const g=this._selectionStart,x=this._selectionEnd;return!(!g||!x)&&(this._columnSelectMode?g[0]<=x[0]?y>=g[0]&&k>=g[1]&&y<x[0]&&k<=x[1]:y<g[0]&&k>=g[1]&&y>=x[0]&&k<=x[1]:k>g[1]&&k<x[1]||g[1]===x[1]&&k===g[1]&&y>=g[0]&&y<x[0]||g[1]<x[1]&&k===x[1]&&y<x[0]||g[1]<x[1]&&k===g[1]&&y>=g[0])}};function w(y,k,g){for(;y.length<g;)y=k+y;return y}o.DomRendererRowFactory=p=h([f(1,n.ICharacterJoinerService),f(2,m.IOptionsService),f(3,n.ICoreBrowserService),f(4,m.ICoreService),f(5,m.IDecorationService),f(6,n.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=l.createElement("span");f.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const v=l.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[f,u,v,d],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(v),this._container.appendChild(d),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,h,f,u){l===this._font&&h===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=h,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,h,f){let u=0;if(!h&&!f&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const m=this._measure(l,0);return m>0&&(this._flat[u]=m),m}let v=l;h&&(v+="B"),f&&(v+="I");let d=this._holey.get(v);if(d===void 0){let m=0;h&&(m|=1),f&&(m|=2),d=this._measure(l,m),d>0&&this._holey.set(v,d)}return d}_measure(l,h){const f=this._measureElements[h];return f.textContent=l.repeat(32),f.offsetWidth/32}}},2223:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function l(f){return 57508<=f&&f<=57558}function h(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},o.isEmoji=h,o.allowRescaling=function(f,u,v,d){return u===1&&v>Math.ceil(1.5*d)&&f!==void 0&&f>255&&!h(f)&&!l(f)&&!(function(m){return 57344<=m&&m<=63743})(f)},o.treatGlyphAsBackgroundColor=function(f){return l(f)||(function(u){return 9472<=u&&u<=9631})(f)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(f,u,v=0){return(f-(2*Math.round(u)-v))%(2*Math.round(u))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(f,u,v,d=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const m=f.buffers.active.ydisp,_=u[1]-m,n=v[1]-m,a=Math.max(_,0),s=Math.min(n,f.rows-1);a>=f.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=d,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=s,this.startCol=u[0],this.endCol=v[0])}isCellSelected(f,u,v){return!!this.hasSelection&&(v-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,h=this.selectionEnd;return!(!l||!h)&&(l[1]>h[1]||l[1]===h[1]&&l[0]>h[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=l(2585),v=l(8460),d=l(844);let m=o.CharSizeService=class extends d.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,c,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new n(s,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};o.CharSizeService=m=h([f(2,u.IOptionsService)],m);class _ extends d.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,p){c!==void 0&&c>0&&p!==void 0&&p>0&&(this._result.width=c,this._result.height=p)}}class n extends _{constructor(c,p,w){super(),this._document=c,this._parentElement=p,this._optionsService=w,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends _{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(3734),v=l(643),d=l(511),m=l(2585);class _ extends u.AttributeData{constructor(s,c,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=_;let n=o.CharacterJoinerService=class il{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}register(s){const c={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(c),c.id}deregister(s){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===s)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(s);if(!c||c.length===0)return[];const p=[],w=c.translateToString(!0);let y=0,k=0,g=0,x=c.getFg(0),T=c.getBg(0);for(let A=0;A<c.getTrimmedLength();A++)if(c.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==T){if(A-y>1){const P=this._getJoinedRanges(w,g,k,c,y);for(let B=0;B<P.length;B++)p.push(P[B])}y=A,g=k,x=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const A=this._getJoinedRanges(w,g,k,c,y);for(let P=0;P<A.length;P++)p.push(A[P])}return p}_getJoinedRanges(s,c,p,w,y){const k=s.substring(c,p);let g=[];try{g=this._characterJoiners[0].handler(k)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const T=this._characterJoiners[x].handler(k);for(let A=0;A<T.length;A++)il._mergeRanges(g,T[A])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,w,y),g}_stringRangesToCellRanges(s,c,p){let w=0,y=!1,k=0,g=s[w];if(g){for(let x=p;x<this._bufferService.cols;x++){const T=c.getWidth(x),A=c.getString(x).length||v.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&g[0]<=k&&(g[0]=x,y=!0),g[1]<=k){if(g[1]=x,g=s[++w],!g)break;g[0]<=k?(g[0]=x,y=!0):y=!1}k+=A}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(s,c){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(c[1]<=y[0])return s[w-1][1]=c[1],s;if(c[1]<=y[1])return s[w-1][1]=Math.max(c[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(c[1]<=y[0])return s.splice(w,0,c),s;if(c[1]<=y[1])return y[0]=Math.min(c[0],y[0]),s;c[0]<y[1]&&(y[0]=Math.min(c[0],y[0]),p=!0)}}return p?s[s.length-1][1]=c[1]:s.push(c),s}};o.CharacterJoinerService=n=h([f(0,m.IBufferService)],n)},5114:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=l(844),f=l(8460),u=l(3656);class v extends h.Disposable{constructor(_,n,a){super(),this._textarea=_,this._window=n,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new d(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this.register((0,f.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class d extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=l(844);class f extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const d=this.linkProviders.indexOf(v);d!==-1&&this.linkProviders.splice(d,1)}}}}o.LinkProviderService=f},8934:function(C,o,l){var h=this&&this.__decorate||function(m,_,n,a){var s,c=arguments.length,p=c<3?_:a===null?a=Object.getOwnPropertyDescriptor(_,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(m,_,n,a);else for(var w=m.length-1;w>=0;w--)(s=m[w])&&(p=(c<3?s(p):c>3?s(_,n,p):s(_,n))||p);return c>3&&p&&Object.defineProperty(_,n,p),p},f=this&&this.__param||function(m,_){return function(n,a){_(n,a,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=l(4725),v=l(9806);let d=o.MouseService=class{constructor(m,_){this._renderService=m,this._charSizeService=_}getCoords(m,_,n,a,s){return(0,v.getCoords)(window,m,_,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(m,_){const n=(0,v.getCoordsRelativeToElement)(window,m,_);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};o.MouseService=d=h([f(0,u.IRenderService),f(1,u.ICharSizeService)],d)},3230:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=l(6193),v=l(4725),d=l(8460),m=l(844),_=l(7226),n=l(2585);let a=o.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,c,p,w,y,k,g,x){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new m.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new d.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new d.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new d.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new d.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((T,A)=>this._renderRows(T,A)),g),this.register(this._renderDebouncer),this.register(g.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(k.onResize((()=>this._fullRefresh()))),this.register(k.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(p.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()}))),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(k.buffer.y,k.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(g.window,c),this.register(g.onWindowChange((T=>this._registerIntersectionObserver(T,c))))}_registerIntersectionObserver(s,c){if("IntersectionObserver"in s){const p=new s.IntersectionObserver((w=>this._handleIntersectionChange(w[w.length-1])),{threshold:0});p.observe(c),this._observerDisposable.value=(0,m.toDisposable)((()=>p.disconnect()))}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,c,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,c,this._rowCount))}_renderRows(s,c){this._renderer.value&&(s=Math.min(s,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(s,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:c}),this._onRender.fire({start:s,end:c}),this._isNextRenderRedrawOnly=!0)}resize(s,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,c;this._renderer.value&&((c=(s=this._renderer.value).clearTextureAtlas)==null||c.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,c)})):this._renderer.value.handleResize(s,c),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,c,p){var w;this._selectionState.start=s,this._selectionState.end=c,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,c,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};o.RenderService=a=h([f(2,n.IOptionsService),f(3,v.ICharSizeService),f(4,n.IDecorationService),f(5,n.IBufferService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],a)},9312:function(C,o,l){var h=this&&this.__decorate||function(g,x,T,A){var P,B=arguments.length,H=B<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(g,x,T,A);else for(var W=g.length-1;W>=0;W--)(P=g[W])&&(H=(B<3?P(H):B>3?P(x,T,H):P(x,T))||H);return B>3&&H&&Object.defineProperty(x,T,H),H},f=this&&this.__param||function(g,x){return function(T,A){x(T,A,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=l(9806),v=l(9504),d=l(456),m=l(4725),_=l(8460),n=l(844),a=l(6114),s=l(4841),c=l(511),p=l(2585),w=" ",y=new RegExp(w,"g");let k=o.SelectionService=class extends n.Disposable{constructor(g,x,T,A,P,B,H,W,Y){super(),this._element=g,this._screenElement=x,this._linkifier=T,this._bufferService=A,this._coreService=P,this._mouseService=B,this._optionsService=H,this._renderService=W,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new d.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!g||!x||g[0]===x[0]&&g[1]===x[1])}get selectionText(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!g||!x)return"";const T=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(g[0]===x[0])return"";const P=g[0]<x[0]?g[0]:x[0],B=g[0]<x[0]?x[0]:g[0];for(let H=g[1];H<=x[1];H++){const W=T.translateBufferLineToString(H,!0,P,B);A.push(W)}}else{const P=g[1]===x[1]?x[0]:void 0;A.push(T.translateBufferLineToString(g[1],!0,g[0],P));for(let B=g[1]+1;B<=x[1]-1;B++){const H=T.lines.get(B),W=T.translateBufferLineToString(B,!0);H!=null&&H.isWrapped?A[A.length-1]+=W:A.push(W)}if(g[1]!==x[1]){const B=T.lines.get(x[1]),H=T.translateBufferLineToString(x[1],!0,0,x[0]);B&&B.isWrapped?A[A.length-1]+=H:A.push(H)}}return A.map((P=>P.replace(y," "))).join(a.isWindows?`\r
6
+ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=d=h([f(0,v.IBufferService),f(1,v.IOptionsService),f(2,v.IOscLinkService)],d)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,h){this._renderCallback=l,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=l(3614),f=l(3656),u=l(3551),v=l(9042),d=l(3730),m=l(1680),_=l(3107),n=l(5744),a=l(2950),s=l(1296),c=l(428),p=l(4269),w=l(5114),y=l(8934),k=l(3230),g=l(9312),x=l(4725),T=l(6731),A=l(8055),P=l(8969),M=l(8460),H=l(844),F=l(6114),Y=l(8437),J=l(2584),Z=l(7399),L=l(5941),O=l(9074),R=l(2585),I=l(5435),N=l(4567),Q=l(779);class ie extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(j={}){super(j),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,V)=>this.refresh(D,V)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((D=>this._reportWindowsOptions(D)))),this.register(this._inputHandler.onColor((D=>this._handleColorEvent(D)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((D=>this._afterResize(D.cols,D.rows)))),this.register((0,H.toDisposable)((()=>{var D,V;this._customKeyEventHandler=void 0,(V=(D=this.element)==null?void 0:D.parentNode)==null||V.removeChild(this.element)})))}_handleColorEvent(j){if(this._themeService)for(const D of j){let V,B="";switch(D.index){case 256:V="foreground",B="10";break;case 257:V="background",B="11";break;case 258:V="cursor",B="12";break;default:V="ansi",B="4;"+D.index}switch(D.type){case 0:const K=A.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${B};${(0,L.toRgbString)(K)}${J.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors((X=>X.ansi[D.index]=A.channels.toColor(...D.color)));else{const X=V;this._themeService.modifyColors((he=>he[X]=A.channels.toColor(...D.color)))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(j){j?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(j){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var j;return(j=this.textarea)==null?void 0:j.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const j=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(j);if(!D)return;const V=Math.min(this.buffer.x,this.cols-1),B=this._renderService.dimensions.css.cell.height,K=D.getWidth(V),X=this._renderService.dimensions.css.cell.width*K,he=this.buffer.y*this._renderService.dimensions.css.cell.height,ae=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ae+"px",this.textarea.style.top=he+"px",this.textarea.style.width=X+"px",this.textarea.style.height=B+"px",this.textarea.style.lineHeight=B+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,h.copyHandler)(D,this._selectionService)})));const j=D=>(0,h.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",j)),this.register((0,f.addDisposableDomListener)(this.element,"paste",j)),F.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),F.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,h.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(j=>this._keyUp(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(j=>this._keyDown(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(j=>this._keyPress(j)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(j=>this._compositionHelper.compositionupdate(j)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(j=>this._inputEvent(j)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(j){var V;if(!j)throw new Error("Terminal requires a parent element.");if(j.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((V=this.element)==null?void 0:V.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=j.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),j.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,f.addDisposableDomListener)(this.screenElement,"mousemove",(B=>this.updateCursorStyle(B)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),F.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,j.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(B=>this._handleTextAreaFocus(B)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((B=>this._onRender.fire(B)))),this.onResize((B=>this._renderService.resize(B.cols,B.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(m.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((B=>this.scrollLines(B.amount,B.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((B=>this.scrollLines(B.amount,B.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((B=>this._renderService.handleSelectionChanged(B.start,B.end,B.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((B=>{this.textarea.value=B,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((B=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(B=>this._selectionService.handleMouseDown(B)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(B=>this._handleScreenReaderModeOptionChange(B)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(B=>{!this._overviewRulerRenderer&&B&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const j=this,D=this.element;function V(X){const he=j._mouseService.getMouseReportCoords(X,j.screenElement);if(!he)return!1;let ae,de;switch(X.overrideType||X.type){case"mousemove":de=32,X.buttons===void 0?(ae=3,X.button!==void 0&&(ae=X.button<3?X.button:3)):ae=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":de=0,ae=X.button<3?X.button:3;break;case"mousedown":de=1,ae=X.button<3?X.button:3;break;case"wheel":if(j._customWheelEventHandler&&j._customWheelEventHandler(X)===!1||j.viewport.getLinesScrolled(X)===0)return!1;de=X.deltaY<0?0:1,ae=4;break;default:return!1}return!(de===void 0||ae===void 0||ae>4)&&j.coreMouseService.triggerMouseEvent({col:he.col,row:he.row,x:he.x,y:he.y,button:ae,action:de,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const B={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:X=>(V(X),X.buttons||(this._document.removeEventListener("mouseup",B.mouseup),B.mousedrag&&this._document.removeEventListener("mousemove",B.mousedrag)),this.cancel(X)),wheel:X=>(V(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&V(X)},mousemove:X=>{X.buttons||V(X)}};this.register(this.coreMouseService.onProtocolChange((X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&X?B.mousemove||(D.addEventListener("mousemove",K.mousemove),B.mousemove=K.mousemove):(D.removeEventListener("mousemove",B.mousemove),B.mousemove=null),16&X?B.wheel||(D.addEventListener("wheel",K.wheel,{passive:!1}),B.wheel=K.wheel):(D.removeEventListener("wheel",B.wheel),B.wheel=null),2&X?B.mouseup||(B.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",B.mouseup),B.mouseup=null),4&X?B.mousedrag||(B.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",B.mousedrag),B.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(D,"mousedown",(X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return V(X),B.mouseup&&this._document.addEventListener("mouseup",B.mouseup),B.mousedrag&&this._document.addEventListener("mousemove",B.mousedrag),this.cancel(X)}))),this.register((0,f.addDisposableDomListener)(D,"wheel",(X=>{if(!B.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const he=this.viewport.getLinesScrolled(X);if(he===0)return;const ae=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let de="";for(let ve=0;ve<Math.abs(he);ve++)de+=ae;return this.coreService.triggerDataEvent(de,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(D,"touchstart",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(D,"touchmove",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)}),{passive:!1}))}refresh(j,D){var V;(V=this._renderService)==null||V.refreshRows(j,D)}updateCursorStyle(j){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(j)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(j,D,V=0){var B;V===1?(super.scrollLines(j,D,V),this.refresh(0,this.rows-1)):(B=this.viewport)==null||B.scrollLines(j)}paste(j){(0,h.paste)(j,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(j){this._customKeyEventHandler=j}attachCustomWheelEventHandler(j){this._customWheelEventHandler=j}registerLinkProvider(j){return this._linkProviderService.registerLinkProvider(j)}registerCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(j);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(j)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(j){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+j)}registerDecoration(j){return this._decorationService.registerDecoration(j)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(j,D,V){this._selectionService.setSelection(j,D,V)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var j;(j=this._selectionService)==null||j.clearSelection()}selectAll(){var j;(j=this._selectionService)==null||j.selectAll()}selectLines(j,D){var V;(V=this._selectionService)==null||V.selectLines(j,D)}_keyDown(j){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&j.altKey;if(!D&&!this._compositionHelper.keydown(j))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||j.key!=="Dead"&&j.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,Z.evaluateKeyboardEvent)(j,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(j),V.type===3||V.type===2){const B=this.rows-1;return this.scrollLines(V.type===2?-B:B),this.cancel(j,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,j)||(V.cancel&&this.cancel(j,!0),!V.key||!!(j.key&&!j.ctrlKey&&!j.altKey&&!j.metaKey&&j.key.length===1&&j.key.charCodeAt(0)>=65&&j.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==J.C0.ETX&&V.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||j.altKey||j.ctrlKey?this.cancel(j,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(j,D){const V=j.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||j.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||j.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?V:V&&(!D.keyCode||D.keyCode>47)}_keyUp(j){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(j)||this.focus(),this.updateCursorStyle(j),this._keyPressHandled=!1)}_keyPress(j){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;if(this.cancel(j),j.charCode)D=j.charCode;else if(j.which===null||j.which===void 0)D=j.keyCode;else{if(j.which===0||j.charCode===0)return!1;D=j.which}return!(!D||(j.altKey||j.ctrlKey||j.metaKey)&&!this._isThirdLevelShift(this.browser,j)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(j){if(j.data&&j.inputType==="insertText"&&(!j.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=j.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(j),!0}return!1}resize(j,D){j!==this.cols||D!==this.rows?super.resize(j,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(j,D){var V,B;(V=this._charSizeService)==null||V.measure(),(B=this.viewport)==null||B.syncScrollArea(!0)}clear(){var j;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(j=this.viewport)==null||j.reset(),this.refresh(0,this.rows-1)}}reset(){var D,V;this.options.rows=this.rows,this.options.cols=this.cols;const j=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(V=this.viewport)==null||V.reset(),this._customKeyEventHandler=j,this.refresh(0,this.rows-1)}clearTextureAtlas(){var j;(j=this._renderService)==null||j.clearTextureAtlas()}_reportFocus(){var j;(j=this.element)!=null&&j.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(j){if(this._renderService)switch(j){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${V};${D}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const B=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${K};${B}t`)}}cancel(j,D){if(this.options.cancelEvents||D)return j.preventDefault(),j.stopPropagation(),!1}}o.Terminal=ie},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,h=1e3){this._renderCallback=l,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,d=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),d)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h)}}},1680:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=l(3656),v=l(4725),d=l(8460),m=l(844),_=l(2585);let n=o.Viewport=class extends m.Disposable{constructor(a,s,c,p,w,y,k,g){super(),this._viewportElement=a,this._scrollArea=s,this._bufferService=c,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(g.colors),this.register(g.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,s){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const s=this._getPixelsScrolled(a);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(a,s){var g;let c,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let x=a;x<y;x++){const T=k.get(x);if(!T)continue;const A=(g=k.get(x+1))==null?void 0:g.isWrapped;if(p+=T.translateToString(!A),!A||x===k.length-1){const P=document.createElement("div");P.textContent=p,w.push(P),p.length>0&&(c=P),p=""}}return{bufferElements:w,cursorElement:c}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(a,s){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&s.altKey||c==="ctrl"&&s.ctrlKey||c==="shift"&&s.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const s=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}};o.Viewport=n=h([f(2,_.IBufferService),f(3,_.IOptionsService),f(4,v.ICharSizeService),f(5,v.IRenderService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],n)},3107:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=l(4725),v=l(844),d=l(2585);let m=o.BufferDecorationRenderer=class extends v.Disposable{constructor(_,n,a,s,c){super(),this._screenElement=_,this._bufferService=n,this._coreBrowserService=a,this._decorationService=s,this._renderService=c,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((p=>this._removeDecoration(p)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var s;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((s=_==null?void 0:_.options)==null?void 0:s.layer)==="top"),n.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=_.options.x??0;return a&&a>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(_,n),n}_refreshStyle(_){const n=_.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let a=this._decorationElements.get(_);a||(a=this._createElement(_),_.element=a,this._decorationElements.set(_,a),this._container.appendChild(a),_.onDispose((()=>{this._decorationElements.delete(_),a.remove()}))),a.style.top=n*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(a)}}_refreshXPosition(_,n=_.element){if(!n)return;const a=_.options.x??0;(_.options.anchor||"left")==="right"?n.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var n;(n=this._decorationElements.get(_))==null||n.remove(),this._decorationElements.delete(_),_.dispose()}};o.BufferDecorationRenderer=m=h([f(1,d.IBufferService),f(2,u.ICoreBrowserService),f(3,d.IDecorationService),f(4,u.IRenderService)],m)},5871:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const h of this._zones)if(h.color===l.options.overviewRulerOptions.color&&h.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,l.marker.line))return;if(this._lineAdjacentToZone(h,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(h,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,h){return h>=l.startBufferLine&&h<=l.endBufferLine}_lineAdjacentToZone(l,h,f){return h>=l.startBufferLine-this._linePadding[f||"full"]&&h<=l.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(l,h){l.startBufferLine=Math.min(l.startBufferLine,h),l.endBufferLine=Math.max(l.endBufferLine,h)}}},5744:function(C,o,l){var h=this&&this.__decorate||function(c,p,w,y){var k,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,p,w,y);else for(var T=c.length-1;T>=0;T--)(k=c[T])&&(x=(g<3?k(x):g>3?k(p,w,x):k(p,w))||x);return g>3&&x&&Object.defineProperty(p,w,x),x},f=this&&this.__param||function(c,p){return function(w,y){p(w,y,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=l(5871),v=l(4725),d=l(844),m=l(2585),_={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends d.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,p,w,y,k,g,x){var A;super(),this._viewportElement=c,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=g,this._coreBrowserService=x,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,d.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=p,n.right=c,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=n.left,a.right=n.left+n.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);_.left=p,_.center=p,_.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const p of c)p.position!=="full"&&this._renderColorZone(p);for(const p of c)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(a[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-_[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[c.position||"full"]))}_queueRefresh(c,p){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=s=h([f(2,m.IBufferService),f(3,m.IDecorationService),f(4,v.IRenderService),f(5,m.IOptionsService),f(6,v.ICoreBrowserService)],s)},2950:function(C,o,l){var h=this&&this.__decorate||function(_,n,a,s){var c,p=arguments.length,w=p<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,a,s);else for(var y=_.length-1;y>=0;y--)(c=_[y])&&(w=(p<3?c(w):p>3?c(n,a,w):c(n,a))||w);return p>3&&w&&Object.defineProperty(n,a,w),w},f=this&&this.__param||function(_,n){return function(a,s){n(a,s,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=l(4725),v=l(2585),d=l(2584);let m=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,n,a,s,c,p){this._textarea=_,this._compositionView=n,this._bufferService=a,this._optionsService=s,this._coreService=c,this._renderService=p,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,a=n.replace(_,"");this._dataAlreadySent=a,n.length>_.length?this._coreService.triggerDataEvent(a,!0):n.length<_.length?this._coreService.triggerDataEvent(`${d.C0.DEL}`,!0):n.length===_.length&&n!==_&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=m=h([f(2,v.IBufferService),f(3,v.IOptionsService),f(4,v.ICoreService),f(5,u.IRenderService)],m)},9806:(C,o)=>{function l(h,f,u){const v=u.getBoundingClientRect(),d=h.getComputedStyle(u),m=parseInt(d.getPropertyValue("padding-left")),_=parseInt(d.getPropertyValue("padding-top"));return[f.clientX-v.left-m,f.clientY-v.top-_]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(h,f,u,v,d,m,_,n,a){if(!m)return;const s=l(h,f,u);return s?(s[0]=Math.ceil((s[0]+(a?_/2:0))/_),s[1]=Math.ceil(s[1]/n),s[0]=Math.min(Math.max(s[0],1),v+(a?1:0)),s[1]=Math.min(Math.max(s[1],1),d),s):void 0}},9504:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=l(2584);function f(n,a,s,c){const p=n-u(n,s),w=a-u(a,s),y=Math.abs(p-w)-(function(k,g,x){let T=0;const A=k-u(k,x),P=g-u(g,x);for(let M=0;M<Math.abs(A-P);M++){const H=v(k,g)==="A"?-1:1,F=x.buffer.lines.get(A+H*M);F!=null&&F.isWrapped&&T++}return T})(n,a,s);return _(y,m(v(n,a),c))}function u(n,a){let s=0,c=a.buffer.lines.get(n),p=c==null?void 0:c.isWrapped;for(;p&&n>=0&&n<a.rows;)s++,c=a.buffer.lines.get(--n),p=c==null?void 0:c.isWrapped;return s}function v(n,a){return n>a?"A":"B"}function d(n,a,s,c,p,w){let y=n,k=a,g="";for(;y!==s||k!==c;)y+=p?1:-1,p&&y>w.cols-1?(g+=w.buffer.translateBufferLineToString(k,!1,n,y),y=0,n=0,k++):!p&&y<0&&(g+=w.buffer.translateBufferLineToString(k,!1,0,n+1),y=w.cols-1,n=y,k--);return g+w.buffer.translateBufferLineToString(k,!1,n,y)}function m(n,a){const s=a?"O":"[";return h.C0.ESC+s+n}function _(n,a){n=Math.floor(n);let s="";for(let c=0;c<n;c++)s+=a;return s}o.moveToCellSequence=function(n,a,s,c){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return(function(g,x,T,A,P,M){return f(x,A,P,M).length===0?"":_(d(g,x,g,x-u(x,P),!1,P).length,m("D",M))})(p,w,0,a,s,c)+f(w,a,s,c)+(function(g,x,T,A,P,M){let H;H=f(x,A,P,M).length>0?A-u(A,P):x;const F=A,Y=(function(J,Z,L,O,R,I){let N;return N=f(L,O,R,I).length>0?O-u(O,R):Z,J<L&&N<=O||J>=L&&N<O?"C":"D"})(g,x,T,A,P,M);return _(d(g,H,T,F,Y==="C",P).length,m(Y,M))})(p,w,n,a,s,c);let y;if(w===a)return y=p>n?"D":"C",_(Math.abs(p-n),m(y,c));y=w>a?"D":"C";const k=Math.abs(w-a);return _((function(g,x){return x.cols-g})(w>a?n:p,s)+(k-1)*s.cols+1+((w>a?p:n)-1),m(y,c))}},1296:function(C,o,l){var h=this&&this.__decorate||function(M,H,F,Y){var J,Z=arguments.length,L=Z<3?H:Y===null?Y=Object.getOwnPropertyDescriptor(H,F):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(M,H,F,Y);else for(var O=M.length-1;O>=0;O--)(J=M[O])&&(L=(Z<3?J(L):Z>3?J(H,F,L):J(H,F))||L);return Z>3&&L&&Object.defineProperty(H,F,L),L},f=this&&this.__param||function(M,H){return function(F,Y){H(F,Y,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=l(3787),v=l(2550),d=l(2223),m=l(6171),_=l(6052),n=l(4725),a=l(8055),s=l(8460),c=l(844),p=l(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",g="xterm-bg-",x="xterm-focus",T="xterm-selection";let A=1,P=o.DomRenderer=class extends c.Disposable{constructor(M,H,F,Y,J,Z,L,O,R,I,N,Q,ie){super(),this._terminal=M,this._document=H,this._element=F,this._screenElement=Y,this._viewportElement=J,this._helperContainer=Z,this._linkifier2=L,this._charSizeService=R,this._optionsService=I,this._bufferService=N,this._coreBrowserService=Q,this._themeService=ie,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,m.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${y} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${y} .xterm-dim { color: ${a.color.multiplyOpacity(M.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;H+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,H+=`@keyframes ${J} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,H+=`${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${y}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,L]of M.ansi.entries())H+=`${this._terminalSelector} .${k}${Z} { color: ${L.css}; }${this._terminalSelector} .${k}${Z}.xterm-dim { color: ${a.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${g}${Z} { background-color: ${L.css}; }`;H+=`${this._terminalSelector} .${k}${d.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(M.background).css}; }${this._terminalSelector} .${k}${d.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${g}${d.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,H){for(let F=this._rowElements.length;F<=H;F++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,H){this._refreshRowElements(M,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(M,H,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,H,F),this.renderRows(0,this._bufferService.rows-1),!M||!H)return;this._selectionRenderModel.update(this._terminal,M,H,F);const Y=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||L<0)return;const O=this._document.createDocumentFragment();if(F){const R=M[0]>H[0];O.appendChild(this._createSelectionElement(Z,R?H[0]:M[0],R?M[0]:H[0],L-Z+1))}else{const R=Y===Z?M[0]:0,I=Z===J?H[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(Z,R,I));const N=L-Z-1;if(O.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,N)),Z!==L){const Q=J===L?H[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(O)}_createSelectionElement(M,H,F,Y=1){const J=this._document.createElement("div"),Z=H*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(F-H);return Z+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-Z),J.style.height=Y*this.dimensions.css.cell.height+"px",J.style.top=M*this.dimensions.css.cell.height+"px",J.style.left=`${Z}px`,J.style.width=`${L}px`,J}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const M of this._rowElements)M.replaceChildren()}renderRows(M,H){const F=this._bufferService.buffer,Y=F.ybase+F.y,J=Math.min(F.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=M;R<=H;R++){const I=R+F.ydisp,N=this._rowElements[R],Q=F.lines.get(I);if(!N||!Q)break;N.replaceChildren(...this._rowFactory.createRow(Q,I,I===Y,L,O,J,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,H,F,Y,J,Z){F<0&&(M=0),Y<0&&(H=0);const L=this._bufferService.rows-1;F=Math.max(Math.min(F,L),0),Y=Math.max(Math.min(Y,L),0),J=Math.min(J,this._bufferService.cols);const O=this._bufferService.buffer,R=O.ybase+O.y,I=Math.min(O.x,J-1),N=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=F;ue<=Y;++ue){const j=ue+O.ydisp,D=this._rowElements[ue],V=O.lines.get(j);if(!D||!V)break;D.replaceChildren(...this._rowFactory.createRow(V,j,j===R,Q,ie,I,N,this.dimensions.css.cell.width,this._widthCache,Z?ue===F?M:0:-1,Z?(ue===Y?H:J)-1:-1))}}};o.DomRenderer=P=h([f(7,p.IInstantiationService),f(8,n.ICharSizeService),f(9,p.IOptionsService),f(10,p.IBufferService),f(11,n.ICoreBrowserService),f(12,n.IThemeService)],P)},3787:function(C,o,l){var h=this&&this.__decorate||function(y,k,g,x){var T,A=arguments.length,P=A<3?k:x===null?x=Object.getOwnPropertyDescriptor(k,g):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,k,g,x);else for(var M=y.length-1;M>=0;M--)(T=y[M])&&(P=(A<3?T(P):A>3?T(k,g,P):T(k,g))||P);return A>3&&P&&Object.defineProperty(k,g,P),P},f=this&&this.__param||function(y,k){return function(g,x){k(g,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=l(2223),v=l(643),d=l(511),m=l(2585),_=l(8055),n=l(4725),a=l(4269),s=l(6171),c=l(3734);let p=o.DomRendererRowFactory=class{constructor(y,k,g,x,T,A,P){this._document=y,this._characterJoinerService=k,this._optionsService=g,this._coreBrowserService=x,this._coreService=T,this._decorationService=A,this._themeService=P,this._workCell=new d.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,g){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=g}createRow(y,k,g,x,T,A,P,M,H,F,Y){const J=[],Z=this._characterJoinerService.getJoinedCharacters(k),L=this._themeService.colors;let O,R=y.getNoBgTrimmedLength();g&&R<A+1&&(R=A+1);let I=0,N="",Q=0,ie=0,ue=0,j=!1,D=0,V=!1,B=0;const K=[],X=F!==-1&&Y!==-1;for(let he=0;he<R;he++){y.loadCell(he,this._workCell);let ae=this._workCell.getWidth();if(ae===0)continue;let de=!1,ve=he,te=this._workCell;if(Z.length>0&&he===Z[0][0]){de=!0;const Ne=Z.shift();te=new a.JoinedCellData(this._workCell,y.translateToString(!0,Ne[0],Ne[1]),Ne[1]-Ne[0]),ve=Ne[1]-1,ae=te.getWidth()}const fe=this._isCellInSelection(he,k),ye=g&&he===A,Ee=X&&he>=F&&he<=Y;let Ge=!1;this._decorationService.forEachDecorationAtCell(he,k,void 0,(Ne=>{Ge=!0}));let Oe=te.getChars()||v.WHITESPACE_CELL_CHAR;if(Oe===" "&&(te.isUnderline()||te.isOverline())&&(Oe=" "),B=ae*M-H.get(Oe,te.isBold(),te.isItalic()),O){if(I&&(fe&&V||!fe&&!V&&te.bg===Q)&&(fe&&V&&L.selectionForeground||te.fg===ie)&&te.extended.ext===ue&&Ee===j&&B===D&&!ye&&!de&&!Ge){te.isInvisible()?N+=v.WHITESPACE_CELL_CHAR:N+=Oe,I++;continue}I&&(O.textContent=N),O=this._document.createElement("span"),I=0,N=""}else O=this._document.createElement("span");if(Q=te.bg,ie=te.fg,ue=te.extended.ext,j=Ee,D=B,V=fe,de&&A>=he&&A<=ve&&(A=he),!this._coreService.isCursorHidden&&ye&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&K.push("xterm-cursor-blink"),K.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline")}}if(te.isBold()&&K.push("xterm-bold"),te.isItalic()&&K.push("xterm-italic"),te.isDim()&&K.push("xterm-dim"),N=te.isInvisible()?v.WHITESPACE_CELL_CHAR:te.getChars()||v.WHITESPACE_CELL_CHAR,te.isUnderline()&&(K.push(`xterm-underline-${te.extended.underlineStyle}`),N===" "&&(N=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let Ne=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&Ne<8&&(Ne+=8),O.style.textDecorationColor=L.ansi[Ne].css}te.isOverline()&&(K.push("xterm-overline"),N===" "&&(N=" ")),te.isStrikethrough()&&K.push("xterm-strikethrough"),Ee&&(O.style.textDecoration="underline");let Ae=te.getFgColor(),Xe=te.getFgColorMode(),je=te.getBgColor(),pt=te.getBgColorMode();const gt=!!te.isInverse();if(gt){const Ne=Ae;Ae=je,je=Ne;const Rt=Xe;Xe=pt,pt=Rt}let St,Dr,wt,Vt=!1;switch(this._decorationService.forEachDecorationAtCell(he,k,void 0,(Ne=>{Ne.options.layer!=="top"&&Vt||(Ne.backgroundColorRGB&&(pt=50331648,je=Ne.backgroundColorRGB.rgba>>8&16777215,St=Ne.backgroundColorRGB),Ne.foregroundColorRGB&&(Xe=50331648,Ae=Ne.foregroundColorRGB.rgba>>8&16777215,Dr=Ne.foregroundColorRGB),Vt=Ne.options.layer==="top")})),!Vt&&fe&&(St=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,je=St.rgba>>8&16777215,pt=50331648,Vt=!0,L.selectionForeground&&(Xe=50331648,Ae=L.selectionForeground.rgba>>8&16777215,Dr=L.selectionForeground)),Vt&&K.push("xterm-decoration-top"),pt){case 16777216:case 33554432:wt=L.ansi[je],K.push(`xterm-bg-${je}`);break;case 50331648:wt=_.channels.toColor(je>>16,je>>8&255,255&je),this._addStyle(O,`background-color:#${w((je>>>0).toString(16),"0",6)}`);break;default:gt?(wt=L.foreground,K.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):wt=L.background}switch(St||te.isDim()&&(St=_.color.multiplyOpacity(wt,.5)),Xe){case 16777216:case 33554432:te.isBold()&&Ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ae+=8),this._applyMinimumContrast(O,wt,L.ansi[Ae],te,St,void 0)||K.push(`xterm-fg-${Ae}`);break;case 50331648:const Ne=_.channels.toColor(Ae>>16&255,Ae>>8&255,255&Ae);this._applyMinimumContrast(O,wt,Ne,te,St,Dr)||this._addStyle(O,`color:#${w(Ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,wt,L.foreground,te,St,Dr)||gt&&K.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}K.length&&(O.className=K.join(" "),K.length=0),ye||de||Ge?O.textContent=N:I++,B!==this.defaultSpacing&&(O.style.letterSpacing=`${B}px`),J.push(O),he=ve}return O&&I&&(O.textContent=N),J}_applyMinimumContrast(y,k,g,x,T,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const P=this._getContrastCache(x);let M;if(T||A||(M=P.getColor(k.rgba,g.rgba)),M===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=_.color.ensureContrastRatio(T||k,A||g,H),P.setColor((T||k).rgba,(A||g).rgba,M??null)}return!!M&&(this._addStyle(y,`color:${M.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const g=this._selectionStart,x=this._selectionEnd;return!(!g||!x)&&(this._columnSelectMode?g[0]<=x[0]?y>=g[0]&&k>=g[1]&&y<x[0]&&k<=x[1]:y<g[0]&&k>=g[1]&&y>=x[0]&&k<=x[1]:k>g[1]&&k<x[1]||g[1]===x[1]&&k===g[1]&&y>=g[0]&&y<x[0]||g[1]<x[1]&&k===x[1]&&y<x[0]||g[1]<x[1]&&k===g[1]&&y>=g[0])}};function w(y,k,g){for(;y.length<g;)y=k+y;return y}o.DomRendererRowFactory=p=h([f(1,n.ICharacterJoinerService),f(2,m.IOptionsService),f(3,n.ICoreBrowserService),f(4,m.ICoreService),f(5,m.IDecorationService),f(6,n.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=l.createElement("span");f.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const v=l.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[f,u,v,d],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(v),this._container.appendChild(d),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,h,f,u){l===this._font&&h===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=h,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,h,f){let u=0;if(!h&&!f&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const m=this._measure(l,0);return m>0&&(this._flat[u]=m),m}let v=l;h&&(v+="B"),f&&(v+="I");let d=this._holey.get(v);if(d===void 0){let m=0;h&&(m|=1),f&&(m|=2),d=this._measure(l,m),d>0&&this._holey.set(v,d)}return d}_measure(l,h){const f=this._measureElements[h];return f.textContent=l.repeat(32),f.offsetWidth/32}}},2223:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function l(f){return 57508<=f&&f<=57558}function h(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},o.isEmoji=h,o.allowRescaling=function(f,u,v,d){return u===1&&v>Math.ceil(1.5*d)&&f!==void 0&&f>255&&!h(f)&&!l(f)&&!(function(m){return 57344<=m&&m<=63743})(f)},o.treatGlyphAsBackgroundColor=function(f){return l(f)||(function(u){return 9472<=u&&u<=9631})(f)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(f,u,v=0){return(f-(2*Math.round(u)-v))%(2*Math.round(u))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(f,u,v,d=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const m=f.buffers.active.ydisp,_=u[1]-m,n=v[1]-m,a=Math.max(_,0),s=Math.min(n,f.rows-1);a>=f.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=d,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=s,this.startCol=u[0],this.endCol=v[0])}isCellSelected(f,u,v){return!!this.hasSelection&&(v-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,h=this.selectionEnd;return!(!l||!h)&&(l[1]>h[1]||l[1]===h[1]&&l[0]>h[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=l(2585),v=l(8460),d=l(844);let m=o.CharSizeService=class extends d.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,c,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new n(s,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};o.CharSizeService=m=h([f(2,u.IOptionsService)],m);class _ extends d.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,p){c!==void 0&&c>0&&p!==void 0&&p>0&&(this._result.width=c,this._result.height=p)}}class n extends _{constructor(c,p,w){super(),this._document=c,this._parentElement=p,this._optionsService=w,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends _{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(C,o,l){var h=this&&this.__decorate||function(a,s,c,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,s,c,p);else for(var g=a.length-1;g>=0;g--)(w=a[g])&&(k=(y<3?w(k):y>3?w(s,c,k):w(s,c))||k);return y>3&&k&&Object.defineProperty(s,c,k),k},f=this&&this.__param||function(a,s){return function(c,p){s(c,p,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(3734),v=l(643),d=l(511),m=l(2585);class _ extends u.AttributeData{constructor(s,c,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=_;let n=o.CharacterJoinerService=class il{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}register(s){const c={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(c),c.id}deregister(s){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===s)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(s);if(!c||c.length===0)return[];const p=[],w=c.translateToString(!0);let y=0,k=0,g=0,x=c.getFg(0),T=c.getBg(0);for(let A=0;A<c.getTrimmedLength();A++)if(c.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==T){if(A-y>1){const P=this._getJoinedRanges(w,g,k,c,y);for(let M=0;M<P.length;M++)p.push(P[M])}y=A,g=k,x=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const A=this._getJoinedRanges(w,g,k,c,y);for(let P=0;P<A.length;P++)p.push(A[P])}return p}_getJoinedRanges(s,c,p,w,y){const k=s.substring(c,p);let g=[];try{g=this._characterJoiners[0].handler(k)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const T=this._characterJoiners[x].handler(k);for(let A=0;A<T.length;A++)il._mergeRanges(g,T[A])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,w,y),g}_stringRangesToCellRanges(s,c,p){let w=0,y=!1,k=0,g=s[w];if(g){for(let x=p;x<this._bufferService.cols;x++){const T=c.getWidth(x),A=c.getString(x).length||v.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&g[0]<=k&&(g[0]=x,y=!0),g[1]<=k){if(g[1]=x,g=s[++w],!g)break;g[0]<=k?(g[0]=x,y=!0):y=!1}k+=A}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(s,c){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(c[1]<=y[0])return s[w-1][1]=c[1],s;if(c[1]<=y[1])return s[w-1][1]=Math.max(c[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(c[1]<=y[0])return s.splice(w,0,c),s;if(c[1]<=y[1])return y[0]=Math.min(c[0],y[0]),s;c[0]<y[1]&&(y[0]=Math.min(c[0],y[0]),p=!0)}}return p?s[s.length-1][1]=c[1]:s.push(c),s}};o.CharacterJoinerService=n=h([f(0,m.IBufferService)],n)},5114:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=l(844),f=l(8460),u=l(3656);class v extends h.Disposable{constructor(_,n,a){super(),this._textarea=_,this._window=n,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new d(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this.register((0,f.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class d extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=l(844);class f extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const d=this.linkProviders.indexOf(v);d!==-1&&this.linkProviders.splice(d,1)}}}}o.LinkProviderService=f},8934:function(C,o,l){var h=this&&this.__decorate||function(m,_,n,a){var s,c=arguments.length,p=c<3?_:a===null?a=Object.getOwnPropertyDescriptor(_,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(m,_,n,a);else for(var w=m.length-1;w>=0;w--)(s=m[w])&&(p=(c<3?s(p):c>3?s(_,n,p):s(_,n))||p);return c>3&&p&&Object.defineProperty(_,n,p),p},f=this&&this.__param||function(m,_){return function(n,a){_(n,a,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=l(4725),v=l(9806);let d=o.MouseService=class{constructor(m,_){this._renderService=m,this._charSizeService=_}getCoords(m,_,n,a,s){return(0,v.getCoords)(window,m,_,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(m,_){const n=(0,v.getCoordsRelativeToElement)(window,m,_);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};o.MouseService=d=h([f(0,u.IRenderService),f(1,u.ICharSizeService)],d)},3230:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=l(6193),v=l(4725),d=l(8460),m=l(844),_=l(7226),n=l(2585);let a=o.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,c,p,w,y,k,g,x){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new m.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new d.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new d.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new d.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new d.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((T,A)=>this._renderRows(T,A)),g),this.register(this._renderDebouncer),this.register(g.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(k.onResize((()=>this._fullRefresh()))),this.register(k.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(p.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()}))),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(k.buffer.y,k.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(g.window,c),this.register(g.onWindowChange((T=>this._registerIntersectionObserver(T,c))))}_registerIntersectionObserver(s,c){if("IntersectionObserver"in s){const p=new s.IntersectionObserver((w=>this._handleIntersectionChange(w[w.length-1])),{threshold:0});p.observe(c),this._observerDisposable.value=(0,m.toDisposable)((()=>p.disconnect()))}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,c,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,c,this._rowCount))}_renderRows(s,c){this._renderer.value&&(s=Math.min(s,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(s,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:c}),this._onRender.fire({start:s,end:c}),this._isNextRenderRedrawOnly=!0)}resize(s,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,c;this._renderer.value&&((c=(s=this._renderer.value).clearTextureAtlas)==null||c.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,c)})):this._renderer.value.handleResize(s,c),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,c,p){var w;this._selectionState.start=s,this._selectionState.end=c,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,c,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};o.RenderService=a=h([f(2,n.IOptionsService),f(3,v.ICharSizeService),f(4,n.IDecorationService),f(5,n.IBufferService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],a)},9312:function(C,o,l){var h=this&&this.__decorate||function(g,x,T,A){var P,M=arguments.length,H=M<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(g,x,T,A);else for(var F=g.length-1;F>=0;F--)(P=g[F])&&(H=(M<3?P(H):M>3?P(x,T,H):P(x,T))||H);return M>3&&H&&Object.defineProperty(x,T,H),H},f=this&&this.__param||function(g,x){return function(T,A){x(T,A,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=l(9806),v=l(9504),d=l(456),m=l(4725),_=l(8460),n=l(844),a=l(6114),s=l(4841),c=l(511),p=l(2585),w=" ",y=new RegExp(w,"g");let k=o.SelectionService=class extends n.Disposable{constructor(g,x,T,A,P,M,H,F,Y){super(),this._element=g,this._screenElement=x,this._linkifier=T,this._bufferService=A,this._coreService=P,this._mouseService=M,this._optionsService=H,this._renderService=F,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new d.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!g||!x||g[0]===x[0]&&g[1]===x[1])}get selectionText(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!g||!x)return"";const T=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(g[0]===x[0])return"";const P=g[0]<x[0]?g[0]:x[0],M=g[0]<x[0]?x[0]:g[0];for(let H=g[1];H<=x[1];H++){const F=T.translateBufferLineToString(H,!0,P,M);A.push(F)}}else{const P=g[1]===x[1]?x[0]:void 0;A.push(T.translateBufferLineToString(g[1],!0,g[0],P));for(let M=g[1]+1;M<=x[1]-1;M++){const H=T.lines.get(M),F=T.translateBufferLineToString(M,!0);H!=null&&H.isWrapped?A[A.length-1]+=F:A.push(F)}if(g[1]!==x[1]){const M=T.lines.get(x[1]),H=T.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?A[A.length-1]+=H:A.push(H)}}return A.map((P=>P.replace(y," "))).join(a.isWindows?`\r
7
7
  `:`
8
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&g&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(g){const x=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(T&&A&&x)&&this._areCoordsInSelection(x,T,A)}isCellInSelection(g,x){const T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!T||!A)&&this._areCoordsInSelection([g,x],T,A)}_areCoordsInSelection(g,x,T){return g[1]>x[1]&&g[1]<T[1]||x[1]===T[1]&&g[1]===x[1]&&g[0]>=x[0]&&g[0]<T[0]||x[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||x[1]<T[1]&&g[1]===x[1]&&g[0]>=x[0]}_selectWordAtCursor(g,x){var P,B;const T=(B=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:B.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(g);return!!A&&(this._selectWordAt(A,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,x){this._model.clearSelection(),g=Math.max(g,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const x=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(g){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=T?0:(x>T&&(x-=T),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(g){return a.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}handleMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._handleIncrementalClick(g):g.detail===1?this._handleSingleClick(g):g.detail===2?this._handleDoubleClick(g):g.detail===3&&this._handleTripleClick(g),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_handleSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const x=this._getMouseBufferCoords(g);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(g){return g.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(g),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const A=T.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_handleMouseUp(g){const x=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const A=(0,v.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,T=!(!g||!x||g[0]===x[0]&&g[1]===x[1]);T?g&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,x,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,x,T)}_fireOnSelectionChange(g,x,T){this._oldSelectionStart=g,this._oldSelectionEnd=x,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(g,x){let T=x;for(let A=0;x>=A;A++){const P=g.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&x!==A&&(T+=P-1)}return T}setSelection(g,x,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,x],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,x,T=!0,A=!0){if(g[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,B=P.lines.get(g[1]);if(!B)return;const H=P.translateBufferLineToString(g[1],!1);let W=this._convertViewportColToCharacterIndex(B,g[0]),Y=W;const J=g[0]-W;let Z=0,L=0,O=0,R=0;if(H.charAt(W)===" "){for(;W>0&&H.charAt(W-1)===" ";)W--;for(;Y<H.length&&H.charAt(Y+1)===" ";)Y++}else{let Q=g[0],ie=g[0];B.getWidth(Q)===0&&(Z++,Q--),B.getWidth(ie)===2&&(L++,ie++);const ue=B.getString(ie).length;for(ue>1&&(R+=ue-1,Y+=ue-1);Q>0&&W>0&&!this._isCharWordSeparator(B.loadCell(Q-1,this._workCell));){B.loadCell(Q-1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,Q--):j>1&&(O+=j-1,W-=j-1),W--,Q--}for(;ie<B.length&&Y+1<H.length&&!this._isCharWordSeparator(B.loadCell(ie+1,this._workCell));){B.loadCell(ie+1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,ie++):j>1&&(R+=j-1,Y+=j-1),Y++,ie++}}Y++;let I=W+J-Z+O,N=Math.min(this._bufferService.cols,Y-W+Z+L-O-R);if(x||H.slice(W,Y).trim()!==""){if(T&&I===0&&B.getCodePoint(0)!==32){const Q=P.lines.get(g[1]-1);if(Q&&B.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(ie){const ue=this._bufferService.cols-ie.start;I-=ue,N+=ue}}}if(A&&I+N===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const Q=P.lines.get(g[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const ie=this._getWordAt([0,g[1]+1],!1,!1,!0);ie&&(N+=ie.length)}}return{start:I,length:N}}}_selectWordAt(g,x){const T=this._getWordAt(g,x);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[T.start,g[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(g){const x=this._getWordAt(g,!0);if(x){let T=g[1];for(;x.start<0;)x.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const x=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=k=h([f(3,p.IBufferService),f(4,p.ICoreService),f(5,m.IMouseService),f(6,p.IOptionsService),f(7,m.IRenderService),f(8,m.ICoreBrowserService)],k)},4725:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=l(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(C,o,l){var h=this&&this.__decorate||function(k,g,x,T){var A,P=arguments.length,B=P<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,x):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(k,g,x,T);else for(var H=k.length-1;H>=0;H--)(A=k[H])&&(B=(P<3?A(B):P>3?A(g,x,B):A(g,x))||B);return P>3&&B&&Object.defineProperty(g,x,B),B},f=this&&this.__param||function(k,g){return function(x,T){g(x,T,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),v=l(8055),d=l(8460),m=l(844),_=l(2585),n=v.css.toColor("#ffffff"),a=v.css.toColor("#000000"),s=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let x=0;x<216;x++){const T=g[x/36%6|0],A=g[x/6%6|0],P=g[x%6];k.push({css:v.channels.toCss(T,A,P),rgba:v.channels.toRgba(T,A,P)})}for(let x=0;x<24;x++){const T=8+10*x;k.push({css:v.channels.toCss(T,T,T),rgba:v.channels.toRgba(T,T,T)})}return k})());let w=o.ThemeService=class extends m.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new d.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:a,cursor:s,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:v.color.blend(a,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:v.color.blend(a,p),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(k={}){const g=this._colors;if(g.foreground=y(k.foreground,n),g.background=y(k.background,a),g.cursor=y(k.cursor,s),g.cursorAccent=y(k.cursorAccent,c),g.selectionBackgroundTransparent=y(k.selectionBackground,p),g.selectionBackgroundOpaque=v.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=v.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=k.selectionForeground?y(k.selectionForeground,v.NULL_COLOR):void 0,g.selectionForeground===v.NULL_COLOR&&(g.selectionForeground=void 0),v.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=v.color.opacity(g.selectionBackgroundTransparent,.3)),v.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=v.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=o.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=y(k.black,o.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=y(k.red,o.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=y(k.green,o.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=y(k.yellow,o.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=y(k.blue,o.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=y(k.magenta,o.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=y(k.cyan,o.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=y(k.white,o.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=y(k.brightBlack,o.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=y(k.brightRed,o.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=y(k.brightGreen,o.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=y(k.brightYellow,o.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=y(k.brightBlue,o.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=y(k.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=y(k.brightCyan,o.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=y(k.brightWhite,o.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const x=Math.min(g.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<x;T++)g.ansi[T+16]=y(k.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[k]=this._restoreColors.ansi[k]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(k,g){if(k!==void 0)try{return v.css.toColor(k)}catch{}return g}o.ThemeService=w=h([f(0,_.IOptionsService)],w)},6349:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=l(8460),f=l(844);class u extends f.Disposable{constructor(d){super(),this._maxLength=d,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;const m=new Array(d);for(let _=0;_<Math.min(d,this.length);_++)m[_]=this._array[this._getCyclicIndex(_)];this._array=m,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let m=this._length;m<d;m++)this._array[m]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,m){this._array[this._getCyclicIndex(d)]=m}push(d){this._array[this._getCyclicIndex(this._length)]=d,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(d,m,..._){if(m){for(let n=d;n<this._length-m;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+m)];this._length-=m,this.onDeleteEmitter.fire({index:d,amount:m})}for(let n=this._length-1;n>=d;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<_.length;n++)this._array[this._getCyclicIndex(d+n)]=_[n];if(_.length&&this.onInsertEmitter.fire({index:d,amount:_.length}),this._length+_.length>this._maxLength){const n=this._length+_.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=_.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,m,_){if(!(m<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let a=m-1;a>=0;a--)this.set(d+a+_,this.get(d+a));const n=d+m+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<m;n++)this.set(d+n+_,this.get(d+n))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}o.CircularList=u},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(h,f=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const v in h)u[v]=f<=1?h[v]:h[v]&&l(h[v],f-1);return u}},8055:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,h=0,f=0,u=0;var v,d,m,_,n;function a(c){const p=c.toString(16);return p.length<2?"0"+p:p}function s(c,p){return c<p?(p+.05)/(c+.05):(c+.05)/(p+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(p,w,y,k){return k!==void 0?`#${a(p)}${a(w)}${a(y)}${a(k)}`:`#${a(p)}${a(w)}${a(y)}`},c.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},c.toColor=function(p,w,y,k){return{css:c.toCss(p,w,y,k),rgba:c.toRgba(p,w,y,k)}}})(v||(o.channels=v={})),(function(c){function p(w,y){return u=Math.round(255*y),[l,h,f]=n.toChannels(w.rgba),{css:v.toCss(l,h,f,u),rgba:v.toRgba(l,h,f,u)}}c.blend=function(w,y){if(u=(255&y.rgba)/255,u===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,g=y.rgba>>16&255,x=y.rgba>>8&255,T=w.rgba>>24&255,A=w.rgba>>16&255,P=w.rgba>>8&255;return l=T+Math.round((k-T)*u),h=A+Math.round((g-A)*u),f=P+Math.round((x-P)*u),{css:v.toCss(l,h,f),rgba:v.toRgba(l,h,f)}},c.isOpaque=function(w){return(255&w.rgba)==255},c.ensureContrastRatio=function(w,y,k){const g=n.ensureContrastRatio(w.rgba,y.rgba,k);if(g)return v.toColor(g>>24&255,g>>16&255,g>>8&255)},c.opaque=function(w){const y=(255|w.rgba)>>>0;return[l,h,f]=n.toChannels(y),{css:v.toCss(l,h,f),rgba:y}},c.opacity=p,c.multiplyOpacity=function(w,y){return u=255&w.rgba,p(w,u*y/255)},c.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}})(d||(o.color=d={})),(function(c){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return l=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),f=parseInt(y.slice(3,4).repeat(2),16),v.toColor(l,h,f);case 5:return l=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),f=parseInt(y.slice(3,4).repeat(2),16),u=parseInt(y.slice(4,5).repeat(2),16),v.toColor(l,h,f,u);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return l=parseInt(k[1]),h=parseInt(k[2]),f=parseInt(k[3]),u=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),v.toColor(l,h,f,u);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[l,h,f,u]=p.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(l,h,f,u),css:y}}})(m||(o.css=m={})),(function(c){function p(w,y,k){const g=w/255,x=y/255,T=k/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},c.relativeLuminance2=p})(_||(o.rgb=_={})),(function(c){function p(y,k,g){const x=y>>24&255,T=y>>16&255,A=y>>8&255;let P=k>>24&255,B=k>>16&255,H=k>>8&255,W=s(_.relativeLuminance2(P,B,H),_.relativeLuminance2(x,T,A));for(;W<g&&(P>0||B>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),B-=Math.max(0,Math.ceil(.1*B)),H-=Math.max(0,Math.ceil(.1*H)),W=s(_.relativeLuminance2(P,B,H),_.relativeLuminance2(x,T,A));return(P<<24|B<<16|H<<8|255)>>>0}function w(y,k,g){const x=y>>24&255,T=y>>16&255,A=y>>8&255;let P=k>>24&255,B=k>>16&255,H=k>>8&255,W=s(_.relativeLuminance2(P,B,H),_.relativeLuminance2(x,T,A));for(;W<g&&(P<255||B<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),B=Math.min(255,B+Math.ceil(.1*(255-B))),H=Math.min(255,H+Math.ceil(.1*(255-H))),W=s(_.relativeLuminance2(P,B,H),_.relativeLuminance2(x,T,A));return(P<<24|B<<16|H<<8|255)>>>0}c.blend=function(y,k){if(u=(255&k)/255,u===1)return k;const g=k>>24&255,x=k>>16&255,T=k>>8&255,A=y>>24&255,P=y>>16&255,B=y>>8&255;return l=A+Math.round((g-A)*u),h=P+Math.round((x-P)*u),f=B+Math.round((T-B)*u),v.toRgba(l,h,f)},c.ensureContrastRatio=function(y,k,g){const x=_.relativeLuminance(y>>8),T=_.relativeLuminance(k>>8);if(s(x,T)<g){if(T<x){const B=p(y,k,g),H=s(x,_.relativeLuminance(B>>8));if(H<g){const W=w(y,k,g);return H>s(x,_.relativeLuminance(W>>8))?B:W}return B}const A=w(y,k,g),P=s(x,_.relativeLuminance(A>>8));if(P<g){const B=p(y,k,g);return P>s(x,_.relativeLuminance(B>>8))?A:B}return A}},c.reduceLuminance=p,c.increaseLuminance=w,c.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(o.rgba=n={})),o.toPaddedHex=a,o.contrastRatio=s},8969:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=l(844),f=l(2585),u=l(4348),v=l(7866),d=l(744),m=l(7302),_=l(6975),n=l(8460),a=l(1753),s=l(1480),c=l(7994),p=l(9282),w=l(5435),y=l(5981),k=l(2660);let g=!1;class x extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((A=>{var P;(P=this._onScrollApi)==null||P.fire(A.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(A){for(const P in A)this.optionsService.options[P]=A[P]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new m.OptionsService(A)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(d.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((P,B)=>this._inputHandler.parse(P,B)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,P){this._writeBuffer.write(A,P)}writeSync(A,P){this._logService.logLevel<=f.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(A,P)}input(A,P=!0){this.coreService.triggerDataEvent(A,P)}resize(A,P){isNaN(A)||isNaN(P)||(A=Math.max(A,d.MINIMUM_COLS),P=Math.max(P,d.MINIMUM_ROWS),this._bufferService.resize(A,P))}scroll(A,P=!1){this._bufferService.scroll(A,P)}scrollLines(A,P,B){this._bufferService.scrollLines(A,P,B)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const P=A-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(A,P){return this._inputHandler.registerEscHandler(A,P)}registerDcsHandler(A,P){return this._inputHandler.registerDcsHandler(A,P)}registerCsiHandler(A,P){return this._inputHandler.registerCsiHandler(A,P)}registerOscHandler(A,P){return this._inputHandler.registerOscHandler(A,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?A=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},(()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const P of A)P.dispose()}))}}}o.CoreTerminal=x},8460:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===l)return void this._listeners.splice(h,1)}}})),this._event}fire(l,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,l,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,h){return l((f=>h.fire(f)))},o.runAndSubscribe=function(l,h){return h(void 0),l((f=>h(f)))}},5435:function(C,o,l){var h=this&&this.__decorate||function(Z,L,O,R){var I,N=arguments.length,Q=N<3?L:R===null?R=Object.getOwnPropertyDescriptor(L,O):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Z,L,O,R);else for(var ie=Z.length-1;ie>=0;ie--)(I=Z[ie])&&(Q=(N<3?I(Q):N>3?I(L,O,Q):I(L,O))||Q);return N>3&&Q&&Object.defineProperty(L,O,Q),Q},f=this&&this.__param||function(Z,L){return function(O,R){L(O,R,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=l(2584),v=l(7116),d=l(2015),m=l(844),_=l(482),n=l(8437),a=l(8460),s=l(643),c=l(511),p=l(3734),w=l(2585),y=l(1480),k=l(6242),g=l(6351),x=l(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function P(Z,L){if(Z>24)return L.setWinLines||!1;switch(Z){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var B;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(o.WindowsOptionsReportType=B={}));let H=0;class W extends m.Disposable{getAttrData(){return this._curAttrData}constructor(L,O,R,I,N,Q,ie,ue,j=new d.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=O,this._coreService=R,this._logService=I,this._optionsService=N,this._oscLinkService=Q,this._coreMouseService=ie,this._unicodeService=ue,this._parser=j,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:V.toArray()})})),this._parser.setEscHandlerFallback((D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})})),this._parser.setExecuteHandlerFallback((D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})})),this._parser.setOscHandlerFallback(((D,V,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:V,data:M})})),this._parser.setDcsHandlerFallback(((D,V,M)=>{V==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:V,payload:M})})),this._parser.setPrintHandler(((D,V,M)=>this.print(D,V,M))),this._parser.registerCsiHandler({final:"@"},(D=>this.insertChars(D))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(D=>this.scrollLeft(D))),this._parser.registerCsiHandler({final:"A"},(D=>this.cursorUp(D))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(D=>this.scrollRight(D))),this._parser.registerCsiHandler({final:"B"},(D=>this.cursorDown(D))),this._parser.registerCsiHandler({final:"C"},(D=>this.cursorForward(D))),this._parser.registerCsiHandler({final:"D"},(D=>this.cursorBackward(D))),this._parser.registerCsiHandler({final:"E"},(D=>this.cursorNextLine(D))),this._parser.registerCsiHandler({final:"F"},(D=>this.cursorPrecedingLine(D))),this._parser.registerCsiHandler({final:"G"},(D=>this.cursorCharAbsolute(D))),this._parser.registerCsiHandler({final:"H"},(D=>this.cursorPosition(D))),this._parser.registerCsiHandler({final:"I"},(D=>this.cursorForwardTab(D))),this._parser.registerCsiHandler({final:"J"},(D=>this.eraseInDisplay(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(D=>this.eraseInDisplay(D,!0))),this._parser.registerCsiHandler({final:"K"},(D=>this.eraseInLine(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(D=>this.eraseInLine(D,!0))),this._parser.registerCsiHandler({final:"L"},(D=>this.insertLines(D))),this._parser.registerCsiHandler({final:"M"},(D=>this.deleteLines(D))),this._parser.registerCsiHandler({final:"P"},(D=>this.deleteChars(D))),this._parser.registerCsiHandler({final:"S"},(D=>this.scrollUp(D))),this._parser.registerCsiHandler({final:"T"},(D=>this.scrollDown(D))),this._parser.registerCsiHandler({final:"X"},(D=>this.eraseChars(D))),this._parser.registerCsiHandler({final:"Z"},(D=>this.cursorBackwardTab(D))),this._parser.registerCsiHandler({final:"`"},(D=>this.charPosAbsolute(D))),this._parser.registerCsiHandler({final:"a"},(D=>this.hPositionRelative(D))),this._parser.registerCsiHandler({final:"b"},(D=>this.repeatPrecedingCharacter(D))),this._parser.registerCsiHandler({final:"c"},(D=>this.sendDeviceAttributesPrimary(D))),this._parser.registerCsiHandler({prefix:">",final:"c"},(D=>this.sendDeviceAttributesSecondary(D))),this._parser.registerCsiHandler({final:"d"},(D=>this.linePosAbsolute(D))),this._parser.registerCsiHandler({final:"e"},(D=>this.vPositionRelative(D))),this._parser.registerCsiHandler({final:"f"},(D=>this.hVPosition(D))),this._parser.registerCsiHandler({final:"g"},(D=>this.tabClear(D))),this._parser.registerCsiHandler({final:"h"},(D=>this.setMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(D=>this.setModePrivate(D))),this._parser.registerCsiHandler({final:"l"},(D=>this.resetMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(D=>this.resetModePrivate(D))),this._parser.registerCsiHandler({final:"m"},(D=>this.charAttributes(D))),this._parser.registerCsiHandler({final:"n"},(D=>this.deviceStatus(D))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(D=>this.deviceStatusPrivate(D))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(D=>this.softReset(D))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(D=>this.setCursorStyle(D))),this._parser.registerCsiHandler({final:"r"},(D=>this.setScrollRegion(D))),this._parser.registerCsiHandler({final:"s"},(D=>this.saveCursor(D))),this._parser.registerCsiHandler({final:"t"},(D=>this.windowOptions(D))),this._parser.registerCsiHandler({final:"u"},(D=>this.restoreCursor(D))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(D=>this.insertColumns(D))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(D=>this.deleteColumns(D))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(D=>this.selectProtected(D))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(D=>this.requestMode(D,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(D=>this.requestMode(D,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new k.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new k.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new k.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new k.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new k.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new k.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new k.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new k.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new k.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new k.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new k.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new k.OscHandler((D=>this.restoreCursorColor(D)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const D in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},(()=>this.selectCharset("("+D))),this._parser.registerEscHandler({intermediates:")",final:D},(()=>this.selectCharset(")"+D))),this._parser.registerEscHandler({intermediates:"*",final:D},(()=>this.selectCharset("*"+D))),this._parser.registerEscHandler({intermediates:"+",final:D},(()=>this.selectCharset("+"+D))),this._parser.registerEscHandler({intermediates:"-",final:D},(()=>this.selectCharset("-"+D))),this._parser.registerEscHandler({intermediates:".",final:D},(()=>this.selectCharset("."+D))),this._parser.registerEscHandler({intermediates:"/",final:D},(()=>this.selectCharset("/"+D)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((D=>(this._logService.error("Parsing error: ",D),D))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((D,V)=>this.requestStatusString(D,V))))}_preserveStack(L,O,R,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=R,this._parseStack.position=I}_logSlowResolvingAsync(L){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([L,new Promise(((O,R)=>setTimeout((()=>R("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,O){let R,I=this._activeBuffer.x,N=this._activeBuffer.y,Q=0;const ie=this._parseStack.paused;if(ie){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(R),R;I=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>A&&(Q=this._parseStack.position+A)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(D=>String.fromCharCode(D))).join("")}"`),typeof L=="string"?L.split("").map((D=>D.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(L.length,A))),ie||this._dirtyRowTracker.clearRange(),L.length>A)for(let D=Q;D<L.length;D+=A){const V=D+A<L.length?D+A:L.length,M=typeof L=="string"?this._stringDecoder.decode(L.substring(D,V),this._parseBuffer):this._utf8Decoder.decode(L.subarray(D,V),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,M))return this._preserveStack(I,N,M,D),this._logSlowResolvingAsync(R),R}else if(!ie){const D=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,D))return this._preserveStack(I,N,D,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===I&&this._activeBuffer.y===N||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),j=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);j<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(j,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(L,O,R){let I,N;const Q=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,j=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,V=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-O>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let K=this._parser.precedingJoinState;for(let X=O;X<R;++X){if(I=L[X],I<127&&Q){const ve=Q[String.fromCharCode(I)];ve&&(I=ve.charCodeAt(0))}const ce=this._unicodeService.charProperties(I,K);N=y.UnicodeService.extractWidth(ce);const ae=y.UnicodeService.extractShouldJoin(ce),de=ae?y.UnicodeService.extractWidth(K):0;if(K=ce,ie&&this._onA11yChar.fire((0,_.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-de>ue){if(j){const ve=M;let te=this._activeBuffer.x-de;for(this._activeBuffer.x=de,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),de>0&&M instanceof n.BufferLine&&M.copyCellsFrom(ve,te,0,de,!1);te<ue;)ve.setCellFromCodepoint(te++,0,1,V)}else if(this._activeBuffer.x=ue-1,N===2)continue}if(ae&&this._activeBuffer.x){const ve=M.getWidth(this._activeBuffer.x-1)?1:2;M.addCodepointToCell(this._activeBuffer.x-ve,I,N);for(let te=N-de;--te>=0;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if(D&&(M.insertCells(this._activeBuffer.x,N-de,this._activeBuffer.getNullCell(V)),M.getWidth(ue-1)===2&&M.setCellFromCodepoint(ue-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,V)),M.setCellFromCodepoint(this._activeBuffer.x++,I,N,V),N>0)for(;--N;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=K,this._activeBuffer.x<ue&&R-O>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,O){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,O):this._parser.registerCsiHandler(L,(R=>!P(R.params[0],this._optionsService.rawOptions.windowOptions)||O(R)))}registerDcsHandler(L,O){return this._parser.registerDcsHandler(L,new g.DcsHandler(O))}registerEscHandler(L,O){return this._parser.registerEscHandler(L,O)}registerOscHandler(L,O){return this._parser.registerOscHandler(L,new k.OscHandler(O))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=L,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+O)}cursorUp(L){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const O=L.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const O=L.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,O,R,I=!1,N=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(O,R,this._activeBuffer.getNullCell(this._eraseAttrData()),N),I&&(Q.isWrapped=!1)}_resetBufferLine(L,O=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),R.isWrapped=!1)}eraseInDisplay(L,O=!1){let R;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);R<this._bufferService.rows;R++)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(L,O=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;O--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;O--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let O=L.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let O=L.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const O=this._parser.precedingJoinState;if(!O)return!0;const R=L.params[0]||1,I=y.UnicodeService.extractWidth(O),N=this._activeBuffer.x-I,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),ie=new Uint32Array(Q.length*R);let ue=0;for(let D=0;D<Q.length;){const V=Q.codePointAt(D)||0;ie[ue++]=V,D+=V>65535?2:1}let j=ue;for(let D=1;D<R;++D)ie.copyWithin(j,0,ue),j+=ue;return this.print(ie,0,j),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,O){const R=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:N}=this._coreMouseService,Q=this._coreService,{buffers:ie,cols:ue}=this._bufferService,{active:j,alt:D}=ie,V=this._optionsService.rawOptions,M=ae=>ae?1:2,K=L.params[0];return X=K,ce=O?K===2?4:K===4?M(Q.modes.insertMode):K===12?3:K===20?M(V.convertEol):0:K===1?M(R.applicationCursorKeys):K===3?V.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:K===6?M(R.origin):K===7?M(R.wraparound):K===8?3:K===9?M(I==="X10"):K===12?M(V.cursorBlink):K===25?M(!Q.isCursorHidden):K===45?M(R.reverseWraparound):K===66?M(R.applicationKeypad):K===67?4:K===1e3?M(I==="VT200"):K===1002?M(I==="DRAG"):K===1003?M(I==="ANY"):K===1004?M(R.sendFocus):K===1005?4:K===1006?M(N==="SGR"):K===1015?4:K===1016?M(N==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?M(j===D):K===2004?M(R.bracketedPasteMode):0,Q.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${X};${ce}$y`),!0;var X,ce}_updateAttrColor(L,O,R,I,N){return O===2?(L|=50331648,L&=-16777216,L|=p.AttributeData.fromColorRGB([R,I,N])):O===5&&(L&=-50331904,L|=33554432|255&R),L}_extractColor(L,O,R){const I=[0,0,-1,0,0,0];let N=0,Q=0;do{if(I[Q+N]=L.params[O+Q],L.hasSubParams(O+Q)){const ie=L.getSubParams(O+Q);let ue=0;do I[1]===5&&(N=1),I[Q+ue+1+N]=ie[ue];while(++ue<ie.length&&ue+Q+1+N<I.length);break}if(I[1]===5&&Q+N>=2||I[1]===2&&Q+N>=5)break;I[1]&&(N=1)}while(++Q+O<L.length&&Q+N<I.length);for(let ie=2;ie<I.length;++ie)I[ie]===-1&&(I[ie]=0);switch(I[0]){case 38:R.fg=this._updateAttrColor(R.fg,I[1],I[3],I[4],I[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,I[1],I[3],I[4],I[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,I[1],I[3],I[4],I[5])}return Q}_processUnderline(L,O){O.extended=O.extended.clone(),(!~L||L>5)&&(L=1),O.extended.underlineStyle=L,O.fg|=268435456,L===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(L){L.fg=n.DEFAULT_ATTR_DATA.fg,L.bg=n.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=L.length;let R;const I=this._curAttrData;for(let N=0;N<O;N++)R=L.params[N],R>=30&&R<=37?(I.fg&=-50331904,I.fg|=16777216|R-30):R>=40&&R<=47?(I.bg&=-50331904,I.bg|=16777216|R-40):R>=90&&R<=97?(I.fg&=-50331904,I.fg|=16777224|R-90):R>=100&&R<=107?(I.bg&=-50331904,I.bg|=16777224|R-100):R===0?this._processSGR0(I):R===1?I.fg|=134217728:R===3?I.bg|=67108864:R===4?(I.fg|=268435456,this._processUnderline(L.hasSubParams(N)?L.getSubParams(N)[0]:1,I)):R===5?I.fg|=536870912:R===7?I.fg|=67108864:R===8?I.fg|=1073741824:R===9?I.fg|=2147483648:R===2?I.bg|=134217728:R===21?this._processUnderline(2,I):R===22?(I.fg&=-134217729,I.bg&=-134217729):R===23?I.bg&=-67108865:R===24?(I.fg&=-268435457,this._processUnderline(0,I)):R===25?I.fg&=-536870913:R===27?I.fg&=-67108865:R===28?I.fg&=-1073741825:R===29?I.fg&=2147483647:R===39?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):R===49?(I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?N+=this._extractColor(L,N,I):R===53?I.bg|=1073741824:R===55?I.bg&=-1073741825:R===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):R===100?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${R}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const O=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${R}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const O=L.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const R=O%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(L){const O=L.params[0]||1;let R;return(L.length<2||(R=L.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(L){if(!P(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const O=[],R=L.split(";");for(;R.length>1;){const I=R.shift(),N=R.shift();if(/^\d+$/.exec(I)){const Q=parseInt(I);if(J(Q))if(N==="?")O.push({type:0,index:Q});else{const ie=(0,x.parseColor)(N);ie&&O.push({type:1,index:Q,color:ie})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(L){const O=L.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(L,O){this._getCurrentLinkId()&&this._finishHyperlink();const R=L.split(":");let I;const N=R.findIndex((Q=>Q.startsWith("id=")));return N!==-1&&(I=R[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,O){const R=L.split(";");for(let I=0;I<R.length&&!(O>=this._specialColors.length);++I,++O)if(R[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const N=(0,x.parseColor)(R[I]);N&&this._onColor.fire([{type:1,index:this._specialColors[O],color:N}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const O=[],R=L.split(";");for(let I=0;I<R.length;++I)if(/^\d+$/.exec(R[I])){const N=parseInt(R[I]);J(N)&&O.push({type:2,index:N})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(T[L[0]],v.CHARSETS[L[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new c.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const R=this._activeBuffer.ybase+this._activeBuffer.y+O,I=this._activeBuffer.lines.get(R);I&&(I.fill(L),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,O){const R=this._bufferService.buffer,I=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,O){this._dirtyRowTracker.markRangeDirty(L,O)}}o.InputHandler=W;let Y=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,L){Z>L&&(H=Z,Z=L,L=H),Z<this.start&&(this.start=Z),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(Z){return 0<=Z&&Z<256}Y=h([f(0,w.IBufferService)],Y)},844:(C,o)=>{function l(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=l,o.getDisposeArrayDisposable=function(h){return{dispose:()=>l(h)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,u,v){this._data[f]||(this._data[f]={}),this._data[f][u]=v}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(h,f,u,v,d){this._data.get(h,f)||this._data.set(h,f,new l),this._data.get(h,f).set(u,v,d)}get(h,f,u,v){var d;return(d=this._data.get(h,f))==null?void 0:d.get(u,v)}clear(){this._data.clear()}}},6114:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const f=l.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(l=this._search(this._getKey(h)),this._array.splice(l,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(l=this._search(f),l===-1)||this._getKey(this._array[l])!==f)return!1;do if(this._array[l]===h)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===h)}forEachByKey(h,f){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do f(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===h)}values(){return[...this._array].values()}_search(h){let f=0,u=this._array.length-1;for(;u>=f;){let v=f+u>>1;const d=this._getKey(this._array[v]);if(d>h)u=v-1;else{if(!(d<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}f=v+1}}return f}}},7226:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=l(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(d){this._tasks.push(d),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(d){this._idleCallback=void 0;let m=0,_=0,n=d.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(m=Date.now(),this._tasks[this._i]()||this._i++,m=Math.max(1,Date.now()-m),_=Math.max(m,_),a=d.timeRemaining(),1.5*_>a)return n-m<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-m))}ms`),void this._start();n=a}this.clear()}}class u extends f{_requestCallback(d){return setTimeout((()=>d(this._createDeadline(16))))}_cancelCallback(d){clearTimeout(d)}_createDeadline(d){const m=Date.now()+d;return{timeRemaining:()=>Math.max(0,m-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=l(643);o.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),v=u==null?void 0:u.get(f.cols-1),d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);d&&v&&(d.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=l(6349),f=l(7226),u=l(3734),v=l(8437),d=l(4634),m=l(511),_=l(643),n=l(4863),a=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(s,c,p){this._hasScrollback=s,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=m.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=m.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(s),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const c=s+this._optionsService.rawOptions.scrollback;return c>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:c}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,c){const p=this.getNullCell(v.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(c);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let g=0;g<this.lines.length;g++)w+=+this.lines.get(g).resize(s,p);let k=0;if(this._rows<c)for(let g=this._rows;g<c;g++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(s,p)));else for(let g=this._rows;g>c;g--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const g=this.lines.length-y;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,c-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(s,c),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=c,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,c){this._cols!==s&&(s>this._cols?this._reflowLarger(s,c):this._reflowSmaller(s,c))}_reflowLarger(s,c){const p=(0,d.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,d.reflowLargerCreateNewLayout)(this.lines,p);(0,d.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,c,w.countRemoved)}}_reflowLargerAdjustViewport(s,c,p){const w=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,c){const p=this.getNullCell(v.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let g=this.lines.get(k);if(!g||!g.isWrapped&&g.getTrimmedLength()<=s)continue;const x=[g];for(;g.isWrapped&&k>0;)g=this.lines.get(--k),x.unshift(g);const T=this.ybase+this.y;if(T>=k&&T<k+x.length)continue;const A=x[x.length-1].getTrimmedLength(),P=(0,d.reflowSmallerGetNewLineLengths)(x,this._cols,s),B=P.length-x.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const W=[];for(let R=0;R<B;R++){const I=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);W.push(I)}W.length>0&&(w.push({start:k+x.length+y,newLines:W}),y+=W.length),x.push(...W);let Y=P.length-1,J=P[Y];J===0&&(Y--,J=P[Y]);let Z=x.length-B-1,L=A;for(;Z>=0;){const R=Math.min(L,J);if(x[Y]===void 0)break;if(x[Y].copyCellsFrom(x[Z],L-R,J-R,R,!0),J-=R,J===0&&(Y--,J=P[Y]),L-=R,L===0){Z--;const I=Math.max(Z,0);L=(0,d.getWrappedLineTrimmedLength)(x,I,this._cols)}}for(let R=0;R<x.length;R++)P[R]<s&&x[R].setCell(P[R],p);let O=B-H;for(;O-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+c-1)}if(w.length>0){const k=[],g=[];for(let Y=0;Y<this.lines.length;Y++)g.push(this.lines.get(Y));const x=this.lines.length;let T=x-1,A=0,P=w[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let B=0;for(let Y=Math.min(this.lines.maxLength-1,x+y-1);Y>=0;Y--)if(P&&P.start>T+B){for(let J=P.newLines.length-1;J>=0;J--)this.lines.set(Y--,P.newLines[J]);Y++,k.push({index:T+1,amount:P.newLines.length}),B+=P.newLines.length,P=w[++A]}else this.lines.set(Y,g[T--]);let H=0;for(let Y=k.length-1;Y>=0;Y--)k[Y].index+=H,this.lines.onInsertEmitter.fire(k[Y]),H+=k[Y].amount;const W=Math.max(0,x+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(s,c,p=0,w){const y=this.lines.get(s);return y?y.translateToString(c,p,w):""}getWrappedRangeForLine(s){let c=s,p=s;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===s&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const c=new n.Marker(s);return this.markers.push(c),c.register(this.lines.onTrim((p=>{c.line-=p,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((p=>{c.line>=p.index&&(c.line+=p.amount)}))),c.register(this.lines.onDelete((p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=l(3734),f=l(511),u=l(643),v=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let d=0;class m{constructor(n,a,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=a||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let p=0;p<n;++p)this.setCell(p,c);this.length=n}get(n){const a=this._data[3*n+0],s=2097151&a;return[this._data[3*n+1],2097152&a?this._combined[n]:s?(0,v.stringFromCodePoint)(s):"",a>>22,2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):s]}set(n,a){this._data[3*n+1]=a[u.CHAR_DATA_ATTR_INDEX],a[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=a[1],this._data[3*n+0]=2097152|n|a[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&a}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n]:2097151&a?(0,v.stringFromCodePoint)(2097151&a):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,a){return d=3*n,a.content=this._data[d+0],a.fg=this._data[d+1],a.bg=this._data[d+2],2097152&a.content&&(a.combinedData=this._combined[n]),268435456&a.bg&&(a.extended=this._extendedAttrs[n]),a}setCell(n,a){2097152&a.content&&(this._combined[n]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=a.content,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}setCellFromCodepoint(n,a,s,c){268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=a|s<<22,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}addCodepointToCell(n,a,s){let c=this._data[3*n+0];2097152&c?this._combined[n]+=(0,v.stringFromCodePoint)(a):2097151&c?(this._combined[n]=(0,v.stringFromCodePoint)(2097151&c)+(0,v.stringFromCodePoint)(a),c&=-2097152,c|=2097152):c=a|4194304,s&&(c&=-12582913,c|=s<<22),this._data[3*n+0]=c}insertCells(n,a,s){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length-n){const c=new f.CellData;for(let p=this.length-n-a-1;p>=0;--p)this.setCell(n+a+p,this.loadCell(n+p,c));for(let p=0;p<a;++p)this.setCell(n+p,s)}else for(let c=n;c<this.length;++c)this.setCell(c,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(n,a,s){if(n%=this.length,a<this.length-n){const c=new f.CellData;for(let p=0;p<this.length-n-a;++p)this.setCell(n+p,this.loadCell(n+a+p,c));for(let p=this.length-a;p<this.length;++p)this.setCell(p,s)}else for(let c=n;c<this.length;++c)this.setCell(c,s);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,s)}replaceCells(n,a,s,c=!1){if(c)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,s);n<a&&n<this.length;)this.isProtected(n)||this.setCell(n,s),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,s);n<a&&n<this.length;)this.setCell(n++,s)}resize(n,a){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const c=new Uint32Array(s);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,a)}else{this._data=this._data.subarray(0,s);const c=Object.keys(this._combined);for(let w=0;w<c.length;w++){const y=parseInt(c[w],10);y>=n&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=n&&delete this._extendedAttrs[y]}}return this.length=n,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,a=!1){if(a)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,n);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const a in n._combined)this._combined[a]=n._combined[a];this._extendedAttrs={};for(const a in n._extendedAttrs)this._extendedAttrs[a]=n._extendedAttrs[a];this.isWrapped=n.isWrapped}clone(){const n=new m(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const a in this._combined)n._combined[a]=this._combined[a];for(const a in this._extendedAttrs)n._extendedAttrs[a]=this._extendedAttrs[a];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,a,s,c,p){const w=n._data;if(p)for(let k=c-1;k>=0;k--){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(a+k)+g];268435456&w[3*(a+k)+2]&&(this._extendedAttrs[s+k]=n._extendedAttrs[a+k])}else for(let k=0;k<c;k++){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(a+k)+g];268435456&w[3*(a+k)+2]&&(this._extendedAttrs[s+k]=n._extendedAttrs[a+k])}const y=Object.keys(n._combined);for(let k=0;k<y.length;k++){const g=parseInt(y[k],10);g>=a&&(this._combined[g-a+s]=n._combined[g])}}translateToString(n,a,s,c){a=a??0,s=s??this.length,n&&(s=Math.min(s,this.getTrimmedLength())),c&&(c.length=0);let p="";for(;a<s;){const w=this._data[3*a+0],y=2097151&w,k=2097152&w?this._combined[a]:y?(0,v.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR;if(p+=k,c)for(let g=0;g<k.length;++g)c.push(a);a+=w>>22||1}return c&&c.push(a),p}}o.BufferLine=m},4841:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,h){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return h*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(C,o)=>{function l(h,f,u){if(f===h.length-1)return h[f].getTrimmedLength();const v=!h[f].hasContent(u-1)&&h[f].getWidth(u-1)===1,d=h[f+1].getWidth(0)===2;return v&&d?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,f,u,v,d){const m=[];for(let _=0;_<h.length-1;_++){let n=_,a=h.get(++n);if(!a.isWrapped)continue;const s=[h.get(_)];for(;n<h.length&&a.isWrapped;)s.push(a),a=h.get(++n);if(v>=_&&v<n){_+=s.length-1;continue}let c=0,p=l(s,c,f),w=1,y=0;for(;w<s.length;){const g=l(s,w,f),x=g-y,T=u-p,A=Math.min(x,T);s[c].copyCellsFrom(s[w],y,p,A,!1),p+=A,p===u&&(c++,p=0),y+=A,y===g&&(w++,y=0),p===0&&c!==0&&s[c-1].getWidth(u-1)===2&&(s[c].copyCellsFrom(s[c-1],u-1,p++,1,!1),s[c-1].setCell(u-1,d))}s[c].replaceCells(p,u,d);let k=0;for(let g=s.length-1;g>0&&(g>c||s[g].getTrimmedLength()===0);g--)k++;k>0&&(m.push(_+s.length-k),m.push(k)),_+=s.length-1}return m},o.reflowLargerCreateNewLayout=function(h,f){const u=[];let v=0,d=f[v],m=0;for(let _=0;_<h.length;_++)if(d===_){const n=f[++v];h.onDeleteEmitter.fire({index:_-m,amount:n}),_+=n-1,m+=n,d=f[++v]}else u.push(_);return{layout:u,countRemoved:m}},o.reflowLargerApplyNewLayout=function(h,f){const u=[];for(let v=0;v<f.length;v++)u.push(h.get(f[v]));for(let v=0;v<u.length;v++)h.set(v,u[v]);h.length=f.length},o.reflowSmallerGetNewLineLengths=function(h,f,u){const v=[],d=h.map(((a,s)=>l(h,s,f))).reduce(((a,s)=>a+s));let m=0,_=0,n=0;for(;n<d;){if(d-n<u){v.push(d-n);break}m+=u;const a=l(h,_,f);m>a&&(m-=a,_++);const s=h[_].getWidth(m-1)===2;s&&m--;const c=s?u-1:u;v.push(c),n+=c}return v},o.getWrappedLineTrimmedLength=l},5295:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=l(8460),f=l(844),u=l(9092);class v extends f.Disposable{constructor(m,_){super(),this._optionsService=m,this._bufferService=_,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(m){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(m),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(m,_){this._normal.resize(m,_),this._alt.resize(m,_),this.setupTabStops(m)}setupTabStops(m){this._normal.setupTabStops(m),this._alt.setupTabStops(m)}}o.BufferSet=v},511:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=l(482),f=l(643),u=l(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(m){const _=new v;return _.setFromCharData(m),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(m){this.fg=m[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(m[f.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(m[f.CHAR_DATA_CHAR_INDEX].length===2){const n=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|m[f.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[f.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=m[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|m[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=l(8460),f=l(844);class u{get id(){return this._id}constructor(d){this.line=d,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(d){return this._disposables.push(d),d}}o.Marker=u,u._nextId=1},7116:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,o)=>{var l,h,f;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
9
- `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(l||(o.C0=l={})),(function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"})(h||(o.C1=h={})),(function(u){u.ST=`${l.ESC}\\`})(f||(o.C1_ESCAPED=f={}))},7399:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=l(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(u,v,d,m){const _={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,u.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(d?"b":"[1;5D"))):_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(d?"f":"[1;5C"))):_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"A",d||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"B",d||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=n?h.C0.ESC+"[3;"+(n+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=n?h.C0.ESC+"[1;"+(n+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=n?h.C0.ESC+"[1;"+(n+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=h.C0.ESC+"[5;"+(n+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=h.C0.ESC+"[6;"+(n+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=n?h.C0.ESC+"[1;"+(n+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=n?h.C0.ESC+"[1;"+(n+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=n?h.C0.ESC+"[1;"+(n+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=n?h.C0.ESC+"[1;"+(n+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=n?h.C0.ESC+"[15;"+(n+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=n?h.C0.ESC+"[17;"+(n+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=n?h.C0.ESC+"[18;"+(n+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=n?h.C0.ESC+"[19;"+(n+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=n?h.C0.ESC+"[20;"+(n+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=n?h.C0.ESC+"[21;"+(n+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=n?h.C0.ESC+"[23;"+(n+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=n?h.C0.ESC+"[24;"+(n+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(d&&!m||!u.altKey||u.metaKey)!d||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=h.C0.US),u.key==="@"&&(_.key=h.C0.NUL)):u.keyCode===65&&(_.type=1);else{const a=f[u.keyCode],s=a==null?void 0:a[u.shiftKey?1:0];if(s)_.key=h.C0.ESC+s;else if(u.keyCode>=65&&u.keyCode<=90){const c=u.ctrlKey?u.keyCode-64:u.keyCode+32;let p=String.fromCharCode(c);u.shiftKey&&(p=p.toUpperCase()),_.key=h.C0.ESC+p}else if(u.keyCode===32)_.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let c=u.code.slice(3,4);u.shiftKey||(c=c.toLowerCase()),_.key=h.C0.ESC+c,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=h.C0.DEL:u.keyCode===219?_.key=h.C0.ESC:u.keyCode===220?_.key=h.C0.FS:u.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,h=0,f=l.length){let u="";for(let v=h;v<f;++v){let d=l[v];d>65535?(d-=65536,u+=String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):u+=String.fromCharCode(d)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,h){const f=l.length;if(!f)return 0;let u=0,v=0;if(this._interim){const d=l.charCodeAt(v++);56320<=d&&d<=57343?h[u++]=1024*(this._interim-55296)+d-56320+65536:(h[u++]=this._interim,h[u++]=d),this._interim=0}for(let d=v;d<f;++d){const m=l.charCodeAt(d);if(55296<=m&&m<=56319){if(++d>=f)return this._interim=m,u;const _=l.charCodeAt(d);56320<=_&&_<=57343?h[u++]=1024*(m-55296)+_-56320+65536:(h[u++]=m,h[u++]=_)}else m!==65279&&(h[u++]=m)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,h){const f=l.length;if(!f)return 0;let u,v,d,m,_=0,n=0,a=0;if(this.interim[0]){let p=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,k=0;for(;(y=63&this.interim[++k])&&k<4;)w<<=6,w|=y;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=g-k;for(;a<x;){if(a>=f)return 0;if(y=l[a++],(192&y)!=128){a--,p=!0;break}this.interim[k++]=y,w<<=6,w|=63&y}p||(g===2?w<128?a--:h[_++]=w:g===3?w<2048||w>=55296&&w<=57343||w===65279||(h[_++]=w):w<65536||w>1114111||(h[_++]=w)),this.interim.fill(0)}const s=f-4;let c=a;for(;c<f;){for(;!(!(c<s)||128&(u=l[c])||128&(v=l[c+1])||128&(d=l[c+2])||128&(m=l[c+3]));)h[_++]=u,h[_++]=v,h[_++]=d,h[_++]=m,c+=4;if(u=l[c++],u<128)h[_++]=u;else if((224&u)==192){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}h[_++]=n}else if((240&u)==224){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,_;if(d=l[c++],(192&d)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&d,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&u)==240){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,_;if(d=l[c++],(192&d)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=d,_;if(m=l[c++],(192&m)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&d)<<6|63&m,n<65536||n>1114111)continue;h[_++]=n}}return _}}},225:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=l(1480),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let d=0;d<f.length;++d)v.fill(0,f[d][0],f[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?v[d]:(function(m,_){let n,a=0,s=_.length-1;if(m<_[0][0]||m>_[s][1])return!1;for(;s>=a;)if(n=a+s>>1,m>_[n][1])a=n+1;else{if(!(m<_[n][0]))return!0;s=n-1}return!1})(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}charProperties(d,m){let _=this.wcwidth(d),n=_===0&&m!==0;if(n){const a=h.UnicodeService.extractWidth(m);a===0?n=!1:a>_&&(_=a)}return h.UnicodeService.createPropertyValue(0,_,n)}}},5981:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=l(8460),f=l(844);class u extends f.Disposable{constructor(d){super(),this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(d,m){if(m!==void 0&&this._syncCalls>m)return void(this._syncCalls=0);if(this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(d,m){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(m),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(m)}_innerWrite(d=0,m=!0){const _=d||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],a=this._action(n,m);if(a){const c=p=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,p))):this._innerWrite(_,p);return void a.catch((p=>(queueMicrotask((()=>{throw p})),Promise.resolve(!1)))).then(c)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=u},5941:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function f(u,v){const d=u.toString(16),m=d.length<2?"0"+d:d;switch(v){case 4:return d[0];case 8:return m;case 12:return(m+m).slice(0,3);default:return m+m}}o.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const d=l.exec(v);if(d){const m=d[1]?15:d[4]?255:d[7]?4095:65535;return[Math.round(parseInt(d[1]||d[4]||d[7]||d[10],16)/m*255),Math.round(parseInt(d[2]||d[5]||d[8]||d[11],16)/m*255),Math.round(parseInt(d[3]||d[6]||d[9]||d[12],16)/m*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const d=v.length/3,m=[0,0,0];for(let _=0;_<3;++_){const n=parseInt(v.slice(d*_,d*_+d),16);m[_]=d===1?n<<4:d===2?n:d===3?n>>4:n>>8}return m}},o.toRgbString=function(u,v=16){const[d,m,_]=u;return`rgb:${f(d,v)}/${f(m,v)}/${f(_,v)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=l(482),f=l(8742),u=l(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(m,_){this._handlers[m]===void 0&&(this._handlers[m]=[]);const n=this._handlers[m];return n.push(_),{dispose:()=>{const a=n.indexOf(_);a!==-1&&n.splice(a,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}reset(){if(this._active.length)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(m,_){if(this.reset(),this._ident=m,this._active=this._handlers[m]||v,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(m,_,n){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(m,_,n);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(m,_,n))}unhook(m,_=!0){if(this._active.length){let n=!1,a=this._active.length-1,s=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;a>=0&&(n=this._active[a].unhook(m),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",m);this._active=v,this._ident=0}};const d=new f.Params;d.addParam(0),o.DcsHandler=class{constructor(m){this._handler=m,this._data="",this._params=d,this._hitLimit=!1}hook(m){this._params=m.length>1||m.params[0]?m.clone():d,this._data="",this._hitLimit=!1}put(m,_,n){this._hitLimit||(this._data+=(0,h.utf32ToString)(m,_,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(m){let _=!1;if(this._hitLimit)_=!1;else if(m&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((n=>(this._params=d,this._data="",this._hitLimit=!1,n)));return this._params=d,this._data="",this._hitLimit=!1,_}}},2015:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=l(844),f=l(8742),u=l(6242),v=l(6351);class d{constructor(a){this.table=new Uint8Array(a)}setDefault(a,s){this.table.fill(a<<4|s)}add(a,s,c,p){this.table[s<<8|a]=c<<4|p}addMany(a,s,c,p){for(let w=0;w<a.length;w++)this.table[s<<8|a[w]]=c<<4|p}}o.TransitionTable=d;const m=160;o.VT500_TRANSITION_TABLE=(function(){const n=new d(4095),a=Array.apply(null,Array(256)).map(((k,g)=>g)),s=(k,g)=>a.slice(k,g),c=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const w=s(0,14);let y;for(y in n.setDefault(1,0),n.addMany(c,0,2,0),w)n.addMany([24,26,153,154],y,3,0),n.addMany(s(128,144),y,3,0),n.addMany(s(144,152),y,3,0),n.add(156,y,0,0),n.add(27,y,11,1),n.add(157,y,4,8),n.addMany([152,158,159],y,0,7),n.add(155,y,11,3),n.add(144,y,11,9);return n.addMany(p,0,3,0),n.addMany(p,1,3,1),n.add(127,1,0,1),n.addMany(p,8,0,8),n.addMany(p,3,3,3),n.add(127,3,0,3),n.addMany(p,4,3,4),n.add(127,4,0,4),n.addMany(p,6,3,6),n.addMany(p,5,3,5),n.add(127,5,0,5),n.addMany(p,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(s(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(p,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(s(64,127),3,7,0),n.addMany(s(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(s(48,60),4,8,4),n.addMany(s(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(s(32,64),6,0,6),n.add(127,6,0,6),n.addMany(s(64,127),6,0,0),n.addMany(s(32,48),3,9,5),n.addMany(s(32,48),5,9,5),n.addMany(s(48,64),5,0,6),n.addMany(s(64,127),5,7,0),n.addMany(s(32,48),4,9,5),n.addMany(s(32,48),1,9,2),n.addMany(s(32,48),2,9,2),n.addMany(s(48,127),2,10,0),n.addMany(s(48,80),1,10,0),n.addMany(s(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(s(96,127),1,10,0),n.add(80,1,11,9),n.addMany(p,9,0,9),n.add(127,9,0,9),n.addMany(s(28,32),9,0,9),n.addMany(s(32,48),9,9,12),n.addMany(s(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(p,11,0,11),n.addMany(s(32,128),11,0,11),n.addMany(s(28,32),11,0,11),n.addMany(p,10,0,10),n.add(127,10,0,10),n.addMany(s(28,32),10,0,10),n.addMany(s(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(s(32,48),10,9,12),n.addMany(p,12,0,12),n.add(127,12,0,12),n.addMany(s(28,32),12,0,12),n.addMany(s(32,48),12,9,12),n.addMany(s(48,64),12,0,11),n.addMany(s(64,127),12,12,13),n.addMany(s(64,127),10,12,13),n.addMany(s(64,127),9,12,13),n.addMany(p,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(m,0,2,0),n.add(m,8,5,8),n.add(m,6,0,6),n.add(m,11,0,11),n.add(m,13,13,13),n})();class _ extends h.Disposable{constructor(a=o.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,c,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,c)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,s=[64,126]){let c=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=a.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<a.intermediates.length;++w){const y=a.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=y}}if(a.final.length!==1)throw new Error("final must be a single byte");const p=a.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return c<<=8,c|=p,c}identToString(a){const s=[];for(;a;)s.push(String.fromCharCode(255&a)),a>>=8;return s.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,s){const c=this._identifier(a,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,s){this._executeHandlers[a.charCodeAt(0)]=s}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,s){const c=this._identifier(a);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,s){return this._dcsParser.registerHandler(this._identifier(a),s)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,s){return this._oscParser.registerHandler(a,s)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(a,s,c,p,w){this._parseStack.state=a,this._parseStack.handlers=s,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=w}parse(a,s,c){let p,w=0,y=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&x>-1){for(;x>=0&&(p=g[x](this._params),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&x>-1){for(;x>=0&&(p=g[x](),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 6:if(w=a[this._parseStack.chunkPos],p=this._dcsParser.unhook(w!==24&&w!==26,c),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=a[this._parseStack.chunkPos],p=this._oscParser.end(w!==24&&w!==26,c),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=k;g<s;++g){switch(w=a[g],y=this._transitions.table[this.currentState<<8|(w<160?w:m)],y>>4){case 2:for(let B=g+1;;++B){if(B>=s||(w=a[B])<32||w>126&&w<m){this._printHandler(a,g,B),g=B-1;break}if(++B>=s||(w=a[B])<32||w>126&&w<m){this._printHandler(a,g,B),g=B-1;break}if(++B>=s||(w=a[B])<32||w>126&&w<m){this._printHandler(a,g,B),g=B-1;break}if(++B>=s||(w=a[B])<32||w>126&&w<m){this._printHandler(a,g,B),g=B-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|w];let T=x?x.length-1:-1;for(;T>=0&&(p=x[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,x,T,y,g),p;T<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++g<s&&(w=a[g])>47&&w<60);g--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const A=this._escHandlers[this._collect<<8|w];let P=A?A.length-1:-1;for(;P>=0&&(p=A[P](),p!==!0);P--)if(p instanceof Promise)return this._preserveStack(4,A,P,y,g),p;P<0&&this._escHandlerFb(this._collect<<8|w),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let B=g+1;;++B)if(B>=s||(w=a[B])===24||w===26||w===27||w>127&&w<m){this._dcsParser.put(a,g,B),g=B-1;break}break;case 14:if(p=this._dcsParser.unhook(w!==24&&w!==26),p)return this._preserveStack(6,[],0,y,g),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let B=g+1;;B++)if(B>=s||(w=a[B])<32||w>127&&w<m){this._oscParser.put(a,g,B),g=B-1;break}break;case 6:if(p=this._oscParser.end(w!==24&&w!==26),p)return this._preserveStack(5,[],0,y,g),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}o.EscapeSequenceParser=_},6242:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=l(5770),f=l(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,d){this._handlers[v]===void 0&&(this._handlers[v]=[]);const m=this._handlers[v];return m.push(d),{dispose:()=>{const _=m.indexOf(d);_!==-1&&m.splice(_,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,d,m){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(v,d,m);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(v,d,m))}start(){this.reset(),this._state=1}put(v,d,m){if(this._state!==3){if(this._state===1)for(;d<m;){const _=v[d++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&m-d>0&&this._put(v,d,m)}}end(v,d=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let m=!1,_=this._active.length-1,n=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,m=d,n=this._stack.fallThrough,this._stack.paused=!1),!n&&m===!1){for(;_>=0&&(m=this._active[_].end(v),m!==!0);_--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,m;_--}for(;_>=0;_--)if(m=this._active[_].end(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,m}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,d,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(v,d,m),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let d=!1;if(this._hitLimit)d=!1;else if(v&&(d=this._handler(this._data),d instanceof Promise))return d.then((m=>(this._data="",this._hitLimit=!1,m)));return this._data="",this._hitLimit=!1,d}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class h{static fromArray(u){const v=new h;if(!u.length)return v;for(let d=Array.isArray(u[0])?1:0;d<u.length;++d){const m=u[d];if(Array.isArray(m))for(let _=0;_<m.length;++_)v.addSubParam(m[_]);else v.addParam(m)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const d=this._subParamsIdx[v]>>8,m=255&this._subParamsIdx[v];m-d>0&&u.push(Array.prototype.slice.call(this._subParams,d,m))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,d=255&this._subParamsIdx[u];return d-v>0?this._subParams.subarray(v,d):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const d=this._subParamsIdx[v]>>8,m=255&this._subParamsIdx[v];m-d>0&&(u[v]=this._subParams.slice(d,m))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const d=this._digitIsSub?this._subParams:this.params,m=d[v-1];d[v-1]=~m?Math.min(10*m+u,l):u}}o.Params=h},5741:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===l){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(h,1)}}},8771:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=l(3785),f=l(511);o.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const v=this._buffer.lines.get(u);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new f.CellData}}},3785:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=l(511);o.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new h.CellData)}translateToString(f,u,v){return this._line.translateToString(f,u,v)}}},8285:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=l(8771),f=l(8460),u=l(844);class v extends u.Disposable{constructor(m){super(),this._core=m,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,h){return this._core.registerCsiHandler(l,(f=>h(f.toArray())))}addCsiHandler(l,h){return this.registerCsiHandler(l,h)}registerDcsHandler(l,h){return this._core.registerDcsHandler(l,((f,u)=>h(f,u.toArray())))}addDcsHandler(l,h){return this.registerDcsHandler(l,h)}registerEscHandler(l,h){return this._core.registerEscHandler(l,h)}addEscHandler(l,h){return this.registerEscHandler(l,h)}registerOscHandler(l,h){return this._core.registerOscHandler(l,h)}addOscHandler(l,h){return this.registerOscHandler(l,h)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(C,o,l){var h=this&&this.__decorate||function(n,a,s,c){var p,w=arguments.length,y=w<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,a,s,c);else for(var k=n.length-1;k>=0;k--)(p=n[k])&&(y=(w<3?p(y):w>3?p(a,s,y):p(a,s))||y);return w>3&&y&&Object.defineProperty(a,s,y),y},f=this&&this.__param||function(n,a){return function(s,c){a(s,c,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=l(8460),v=l(844),d=l(5295),m=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let _=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new d.BufferSet(n,this))}resize(n,a){this.cols=n,this.rows=a,this.buffers.resize(n,a),this._onResize.fire({cols:n,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,a=!1){const s=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=s.getBlankLine(n,a),this._cachedBlankLine=c),c.isWrapped=a;const p=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(c):s.lines.push(c.clone()):s.lines.splice(w+1,0,c.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-p+1;s.lines.shiftElements(p+1,y-1,-1),s.lines.set(w,c.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(n,a,s){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),p!==c.ydisp&&(a||this._onScroll.fire(c.ydisp))}};o.BufferService=_=h([f(0,m.IOptionsService)],_)},7994:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,h){this._charsets[l]=h,this.glevel===l&&(this.charset=h)}}},1753:function(C,o,l){var h=this&&this.__decorate||function(c,p,w,y){var k,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,p,w,y);else for(var T=c.length-1;T>=0;T--)(k=c[T])&&(x=(g<3?k(x):g>3?k(p,w,x):k(p,w))||x);return g>3&&x&&Object.defineProperty(p,w,x),x},f=this&&this.__param||function(c,p){return function(w,y){p(w,y,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=l(2585),v=l(8460),d=l(844),m={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function _(c,p){let w=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(w|=64,w|=c.action):(w|=3&c.button,4&c.button&&(w|=64),8&c.button&&(w|=128),c.action===32?w|=32:c.action!==0||p||(w|=3)),w}const n=String.fromCharCode,a={DEFAULT:c=>{const p=[_(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${n(p[0])}${n(p[1])}${n(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.x};${c.y}${p}`}};let s=o.CoreMouseService=class extends d.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(m))this.addProtocol(w,m[w]);for(const w of Object.keys(a))this.addEncoding(w,a[w]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,w){if(w){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};o.CoreMouseService=s=h([f(0,u.IBufferService),f(1,u.ICoreService)],s)},6975:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=l(1439),v=l(8460),d=l(844),m=l(2585),_=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=o.CoreService=class extends d.Disposable{constructor(s,c,p){super(),this._bufferService=s,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(s,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((w=>w.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(s))}};o.CoreService=a=h([f(0,m.IBufferService),f(1,m.ILogService),f(2,m.IOptionsService)],a)},9074:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=l(8055),f=l(8460),u=l(844),v=l(6106);let d=0,m=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const c=new n(s);if(c){const p=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,c,p){let w=0,y=0;for(const k of this._decorations.getKeyIterator(c))w=k.options.x??0,y=w+(k.options.width??1),s>=w&&s<y&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,c,p,w){this._decorations.forEachByKey(c,(y=>{d=y.options.x??0,m=d+(y.options.width??1),s>=d&&s<m&&(!p||(y.options.layer??"bottom")===p)&&w(y)}))}}o.DecorationService=_;class n extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=l(2585),f=l(8343);class u{constructor(...d){this._entries=new Map;for(const[m,_]of d)this.set(m,_)}set(d,m){const _=this._entries.get(d);return this._entries.set(d,m),_}forEach(d){for(const[m,_]of this._entries.entries())d(m,_)}has(d){return this._entries.has(d)}get(d){return this._entries.get(d)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(v,d){this._services.set(v,d)}getService(v){return this._services.get(v)}createInstance(v,...d){const m=(0,f.getServiceDependencies)(v).sort(((a,s)=>a.index-s.index)),_=[];for(const a of m){const s=this._services.get(a.id);if(!s)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${a.id}.`);_.push(s)}const n=m.length>0?m[0].index:d.length;if(d.length!==n)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${n+1} conflicts with ${d.length} static arguments`);return new v(...d,..._)}}},7866:function(C,o,l){var h=this&&this.__decorate||function(n,a,s,c){var p,w=arguments.length,y=w<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,a,s,c);else for(var k=n.length-1;k>=0;k--)(p=n[k])&&(y=(w<3?p(y):w>3?p(a,s,y):p(a,s))||y);return w>3&&y&&Object.defineProperty(a,s,y),y},f=this&&this.__param||function(n,a){return function(s,c){a(s,c,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=l(844),v=l(2585),d={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let m,_=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),m=this}_updateLogLevel(){this._logLevel=d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,s){this._evalLazyOptionalParams(s),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...s)}trace(n,...a){var s;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,n,a)}debug(n,...a){var s;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,n,a)}info(n,...a){var s;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,n,a)}warn(n,...a){var s;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,n,a)}error(n,...a){var s;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,n,a)}};o.LogService=_=h([f(0,v.IOptionsService)],_),o.setTraceLogger=function(n){m=n},o.traceCall=function(n,a,s){if(typeof s.value!="function")throw new Error("not supported");const c=s.value;s.value=function(...p){if(m.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,p);m.trace(`GlyphRenderer#${c.name}(${p.map((y=>JSON.stringify(y))).join(", ")})`);const w=c.apply(this,p);return m.trace(`GlyphRenderer#${c.name} return`,w),w}}},7302:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=l(8460),f=l(844),u=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class d extends f.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...o.DEFAULT_OPTIONS};for(const a in _)if(a in n)try{const s=_[a];n[a]=this._sanitizeAndValidateOption(a,s)}catch(s){console.error(s)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,n){return this.onOptionChange((a=>{a===_&&n(this.rawOptions[_])}))}onMultipleOptionChange(_,n){return this.onOptionChange((a=>{_.indexOf(a)!==-1&&n()}))}_setupOptions(){const _=a=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},n=(a,s)=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);s=this._sanitizeAndValidateOption(a,s),this.rawOptions[a]!==s&&(this.rawOptions[a]=s,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const s={get:_.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this.options,a,s)}}_sanitizeAndValidateOption(_,n){switch(_){case"cursorStyle":if(n||(n=o.DEFAULT_OPTIONS[_]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${_}`);break;case"wordSeparator":n||(n=o.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=v.includes(n)?n:o.DEFAULT_OPTIONS[_];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${_} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${_} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}o.OptionsService=d},2660:function(C,o,l){var h=this&&this.__decorate||function(d,m,_,n){var a,s=arguments.length,c=s<3?m:n===null?n=Object.getOwnPropertyDescriptor(m,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(d,m,_,n);else for(var p=d.length-1;p>=0;p--)(a=d[p])&&(c=(s<3?a(c):s>3?a(m,_,c):a(m,_))||c);return s>3&&c&&Object.defineProperty(m,_,c),c},f=this&&this.__param||function(d,m){return function(_,n){m(_,n,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=l(2585);let v=o.OscLinkService=class{constructor(d){this._bufferService=d,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(d){const m=this._bufferService.buffer;if(d.id===void 0){const p=m.addMarker(m.ybase+m.y),w={data:d,id:this._nextId++,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(w,p))),this._dataByLinkId.set(w.id,w),w.id}const _=d,n=this._getEntryIdKey(_),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,m.ybase+m.y),a.id;const s=m.addMarker(m.ybase+m.y),c={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(c,s))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(d,m){const _=this._dataByLinkId.get(d);if(_&&_.lines.every((n=>n.line!==m))){const n=this._bufferService.buffer.addMarker(m);_.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(_,n)))}}getLinkData(d){var m;return(m=this._dataByLinkId.get(d))==null?void 0:m.data}_getEntryIdKey(d){return`${d.id};;${d.uri}`}_removeMarkerFromLink(d,m){const _=d.lines.indexOf(m);_!==-1&&(d.lines.splice(_,1),d.lines.length===0&&(d.data.id!==void 0&&this._entriesWithId.delete(d.key),this._dataByLinkId.delete(d.id)))}};o.OscLinkService=v=h([f(0,u.IBufferService)],v)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(f){return f[h]||[]},o.createDecorator=function(f){if(o.serviceRegistry.has(f))return o.serviceRegistry.get(f);const u=function(v,d,m){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,a){n[l]===n?n[h].push({id:_,index:a}):(n[h]=[{id:_,index:a}],n[l]=n)})(u,v,m)};return u.toString=()=>f,o.serviceRegistry.set(f,u),u}},2585:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=l(8343);var f;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(o.LogLevelEnum=f={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=l(8460),f=l(225);class u{static extractShouldJoin(d){return(1&d)!=0}static extractWidth(d){return d>>1&3}static extractCharKind(d){return d>>3}static createPropertyValue(d,m,_=!1){return(16777215&d)<<3|(3&m)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new f.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let m=0,_=0;const n=d.length;for(let a=0;a<n;++a){let s=d.charCodeAt(a);if(55296<=s&&s<=56319){if(++a>=n)return m+this.wcwidth(s);const w=d.charCodeAt(a);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:m+=this.wcwidth(w)}const c=this.charProperties(s,_);let p=u.extractWidth(c);u.extractShouldJoin(c)&&(p-=u.extractWidth(_)),m+=p,_=c}return m}charProperties(d,m){return this._activeProvider.charProperties(d,m)}}o.UnicodeService=u}},r={};function S(C){var o=r[C];if(o!==void 0)return o.exports;var l=r[C]={exports:{}};return i[C].call(l.exports,l,l.exports,S),l.exports}var E={};return(()=>{var C=E;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=S(9042),l=S(3236),h=S(844),f=S(5741),u=S(8285),v=S(7975),d=S(7090),m=["cols","rows"];class _ extends h.Disposable{constructor(a){super(),this._core=this.register(new l.Terminal(a)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],c=(p,w)=>{this._checkReadonlyOptions(p),this._core.options[p]=w};for(const p in this._core.options){const w={get:s.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,w)}}_checkReadonlyOptions(a){if(m.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const s in a)this._publicOptions[s]=a[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,s=!0){this._core.input(a,s)}resize(a,s){this._verifyIntegers(a,s),this._core.resize(a,s)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,s,c){this._verifyIntegers(a,s,c),this._core.select(a,s,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,s){this._verifyIntegers(a,s),this._core.selectLines(a,s)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,s){this._core.write(a,s)}writeln(a,s){this._core.write(a),this._core.write(`\r
8
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&g&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(g){const x=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(T&&A&&x)&&this._areCoordsInSelection(x,T,A)}isCellInSelection(g,x){const T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!T||!A)&&this._areCoordsInSelection([g,x],T,A)}_areCoordsInSelection(g,x,T){return g[1]>x[1]&&g[1]<T[1]||x[1]===T[1]&&g[1]===x[1]&&g[0]>=x[0]&&g[0]<T[0]||x[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||x[1]<T[1]&&g[1]===x[1]&&g[0]>=x[0]}_selectWordAtCursor(g,x){var P,M;const T=(M=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(g);return!!A&&(this._selectWordAt(A,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,x){this._model.clearSelection(),g=Math.max(g,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const x=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(g){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=T?0:(x>T&&(x-=T),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(g){return a.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}handleMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._handleIncrementalClick(g):g.detail===1?this._handleSingleClick(g):g.detail===2?this._handleDoubleClick(g):g.detail===3&&this._handleTripleClick(g),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_handleSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const x=this._getMouseBufferCoords(g);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(g){return g.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(g),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const A=T.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_handleMouseUp(g){const x=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const A=(0,v.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,T=!(!g||!x||g[0]===x[0]&&g[1]===x[1]);T?g&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,x,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,x,T)}_fireOnSelectionChange(g,x,T){this._oldSelectionStart=g,this._oldSelectionEnd=x,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(g,x){let T=x;for(let A=0;x>=A;A++){const P=g.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&x!==A&&(T+=P-1)}return T}setSelection(g,x,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,x],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,x,T=!0,A=!0){if(g[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,M=P.lines.get(g[1]);if(!M)return;const H=P.translateBufferLineToString(g[1],!1);let F=this._convertViewportColToCharacterIndex(M,g[0]),Y=F;const J=g[0]-F;let Z=0,L=0,O=0,R=0;if(H.charAt(F)===" "){for(;F>0&&H.charAt(F-1)===" ";)F--;for(;Y<H.length&&H.charAt(Y+1)===" ";)Y++}else{let Q=g[0],ie=g[0];M.getWidth(Q)===0&&(Z++,Q--),M.getWidth(ie)===2&&(L++,ie++);const ue=M.getString(ie).length;for(ue>1&&(R+=ue-1,Y+=ue-1);Q>0&&F>0&&!this._isCharWordSeparator(M.loadCell(Q-1,this._workCell));){M.loadCell(Q-1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,Q--):j>1&&(O+=j-1,F-=j-1),F--,Q--}for(;ie<M.length&&Y+1<H.length&&!this._isCharWordSeparator(M.loadCell(ie+1,this._workCell));){M.loadCell(ie+1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,ie++):j>1&&(R+=j-1,Y+=j-1),Y++,ie++}}Y++;let I=F+J-Z+O,N=Math.min(this._bufferService.cols,Y-F+Z+L-O-R);if(x||H.slice(F,Y).trim()!==""){if(T&&I===0&&M.getCodePoint(0)!==32){const Q=P.lines.get(g[1]-1);if(Q&&M.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(ie){const ue=this._bufferService.cols-ie.start;I-=ue,N+=ue}}}if(A&&I+N===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const Q=P.lines.get(g[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const ie=this._getWordAt([0,g[1]+1],!1,!1,!0);ie&&(N+=ie.length)}}return{start:I,length:N}}}_selectWordAt(g,x){const T=this._getWordAt(g,x);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[T.start,g[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(g){const x=this._getWordAt(g,!0);if(x){let T=g[1];for(;x.start<0;)x.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const x=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=k=h([f(3,p.IBufferService),f(4,p.ICoreService),f(5,m.IMouseService),f(6,p.IOptionsService),f(7,m.IRenderService),f(8,m.ICoreBrowserService)],k)},4725:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=l(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(C,o,l){var h=this&&this.__decorate||function(k,g,x,T){var A,P=arguments.length,M=P<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,x):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(k,g,x,T);else for(var H=k.length-1;H>=0;H--)(A=k[H])&&(M=(P<3?A(M):P>3?A(g,x,M):A(g,x))||M);return P>3&&M&&Object.defineProperty(g,x,M),M},f=this&&this.__param||function(k,g){return function(x,T){g(x,T,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),v=l(8055),d=l(8460),m=l(844),_=l(2585),n=v.css.toColor("#ffffff"),a=v.css.toColor("#000000"),s=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let x=0;x<216;x++){const T=g[x/36%6|0],A=g[x/6%6|0],P=g[x%6];k.push({css:v.channels.toCss(T,A,P),rgba:v.channels.toRgba(T,A,P)})}for(let x=0;x<24;x++){const T=8+10*x;k.push({css:v.channels.toCss(T,T,T),rgba:v.channels.toRgba(T,T,T)})}return k})());let w=o.ThemeService=class extends m.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new d.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:a,cursor:s,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:v.color.blend(a,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:v.color.blend(a,p),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(k={}){const g=this._colors;if(g.foreground=y(k.foreground,n),g.background=y(k.background,a),g.cursor=y(k.cursor,s),g.cursorAccent=y(k.cursorAccent,c),g.selectionBackgroundTransparent=y(k.selectionBackground,p),g.selectionBackgroundOpaque=v.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=v.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=k.selectionForeground?y(k.selectionForeground,v.NULL_COLOR):void 0,g.selectionForeground===v.NULL_COLOR&&(g.selectionForeground=void 0),v.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=v.color.opacity(g.selectionBackgroundTransparent,.3)),v.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=v.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=o.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=y(k.black,o.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=y(k.red,o.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=y(k.green,o.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=y(k.yellow,o.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=y(k.blue,o.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=y(k.magenta,o.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=y(k.cyan,o.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=y(k.white,o.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=y(k.brightBlack,o.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=y(k.brightRed,o.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=y(k.brightGreen,o.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=y(k.brightYellow,o.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=y(k.brightBlue,o.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=y(k.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=y(k.brightCyan,o.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=y(k.brightWhite,o.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const x=Math.min(g.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<x;T++)g.ansi[T+16]=y(k.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[k]=this._restoreColors.ansi[k]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(k,g){if(k!==void 0)try{return v.css.toColor(k)}catch{}return g}o.ThemeService=w=h([f(0,_.IOptionsService)],w)},6349:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=l(8460),f=l(844);class u extends f.Disposable{constructor(d){super(),this._maxLength=d,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;const m=new Array(d);for(let _=0;_<Math.min(d,this.length);_++)m[_]=this._array[this._getCyclicIndex(_)];this._array=m,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let m=this._length;m<d;m++)this._array[m]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,m){this._array[this._getCyclicIndex(d)]=m}push(d){this._array[this._getCyclicIndex(this._length)]=d,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(d,m,..._){if(m){for(let n=d;n<this._length-m;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+m)];this._length-=m,this.onDeleteEmitter.fire({index:d,amount:m})}for(let n=this._length-1;n>=d;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<_.length;n++)this._array[this._getCyclicIndex(d+n)]=_[n];if(_.length&&this.onInsertEmitter.fire({index:d,amount:_.length}),this._length+_.length>this._maxLength){const n=this._length+_.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=_.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,m,_){if(!(m<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let a=m-1;a>=0;a--)this.set(d+a+_,this.get(d+a));const n=d+m+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<m;n++)this.set(d+n+_,this.get(d+n))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}o.CircularList=u},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(h,f=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const v in h)u[v]=f<=1?h[v]:h[v]&&l(h[v],f-1);return u}},8055:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,h=0,f=0,u=0;var v,d,m,_,n;function a(c){const p=c.toString(16);return p.length<2?"0"+p:p}function s(c,p){return c<p?(p+.05)/(c+.05):(c+.05)/(p+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(p,w,y,k){return k!==void 0?`#${a(p)}${a(w)}${a(y)}${a(k)}`:`#${a(p)}${a(w)}${a(y)}`},c.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},c.toColor=function(p,w,y,k){return{css:c.toCss(p,w,y,k),rgba:c.toRgba(p,w,y,k)}}})(v||(o.channels=v={})),(function(c){function p(w,y){return u=Math.round(255*y),[l,h,f]=n.toChannels(w.rgba),{css:v.toCss(l,h,f,u),rgba:v.toRgba(l,h,f,u)}}c.blend=function(w,y){if(u=(255&y.rgba)/255,u===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,g=y.rgba>>16&255,x=y.rgba>>8&255,T=w.rgba>>24&255,A=w.rgba>>16&255,P=w.rgba>>8&255;return l=T+Math.round((k-T)*u),h=A+Math.round((g-A)*u),f=P+Math.round((x-P)*u),{css:v.toCss(l,h,f),rgba:v.toRgba(l,h,f)}},c.isOpaque=function(w){return(255&w.rgba)==255},c.ensureContrastRatio=function(w,y,k){const g=n.ensureContrastRatio(w.rgba,y.rgba,k);if(g)return v.toColor(g>>24&255,g>>16&255,g>>8&255)},c.opaque=function(w){const y=(255|w.rgba)>>>0;return[l,h,f]=n.toChannels(y),{css:v.toCss(l,h,f),rgba:y}},c.opacity=p,c.multiplyOpacity=function(w,y){return u=255&w.rgba,p(w,u*y/255)},c.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}})(d||(o.color=d={})),(function(c){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return l=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),f=parseInt(y.slice(3,4).repeat(2),16),v.toColor(l,h,f);case 5:return l=parseInt(y.slice(1,2).repeat(2),16),h=parseInt(y.slice(2,3).repeat(2),16),f=parseInt(y.slice(3,4).repeat(2),16),u=parseInt(y.slice(4,5).repeat(2),16),v.toColor(l,h,f,u);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return l=parseInt(k[1]),h=parseInt(k[2]),f=parseInt(k[3]),u=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),v.toColor(l,h,f,u);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[l,h,f,u]=p.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(l,h,f,u),css:y}}})(m||(o.css=m={})),(function(c){function p(w,y,k){const g=w/255,x=y/255,T=k/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},c.relativeLuminance2=p})(_||(o.rgb=_={})),(function(c){function p(y,k,g){const x=y>>24&255,T=y>>16&255,A=y>>8&255;let P=k>>24&255,M=k>>16&255,H=k>>8&255,F=s(_.relativeLuminance2(P,M,H),_.relativeLuminance2(x,T,A));for(;F<g&&(P>0||M>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),M-=Math.max(0,Math.ceil(.1*M)),H-=Math.max(0,Math.ceil(.1*H)),F=s(_.relativeLuminance2(P,M,H),_.relativeLuminance2(x,T,A));return(P<<24|M<<16|H<<8|255)>>>0}function w(y,k,g){const x=y>>24&255,T=y>>16&255,A=y>>8&255;let P=k>>24&255,M=k>>16&255,H=k>>8&255,F=s(_.relativeLuminance2(P,M,H),_.relativeLuminance2(x,T,A));for(;F<g&&(P<255||M<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),M=Math.min(255,M+Math.ceil(.1*(255-M))),H=Math.min(255,H+Math.ceil(.1*(255-H))),F=s(_.relativeLuminance2(P,M,H),_.relativeLuminance2(x,T,A));return(P<<24|M<<16|H<<8|255)>>>0}c.blend=function(y,k){if(u=(255&k)/255,u===1)return k;const g=k>>24&255,x=k>>16&255,T=k>>8&255,A=y>>24&255,P=y>>16&255,M=y>>8&255;return l=A+Math.round((g-A)*u),h=P+Math.round((x-P)*u),f=M+Math.round((T-M)*u),v.toRgba(l,h,f)},c.ensureContrastRatio=function(y,k,g){const x=_.relativeLuminance(y>>8),T=_.relativeLuminance(k>>8);if(s(x,T)<g){if(T<x){const M=p(y,k,g),H=s(x,_.relativeLuminance(M>>8));if(H<g){const F=w(y,k,g);return H>s(x,_.relativeLuminance(F>>8))?M:F}return M}const A=w(y,k,g),P=s(x,_.relativeLuminance(A>>8));if(P<g){const M=p(y,k,g);return P>s(x,_.relativeLuminance(M>>8))?A:M}return A}},c.reduceLuminance=p,c.increaseLuminance=w,c.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(o.rgba=n={})),o.toPaddedHex=a,o.contrastRatio=s},8969:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=l(844),f=l(2585),u=l(4348),v=l(7866),d=l(744),m=l(7302),_=l(6975),n=l(8460),a=l(1753),s=l(1480),c=l(7994),p=l(9282),w=l(5435),y=l(5981),k=l(2660);let g=!1;class x extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((A=>{var P;(P=this._onScrollApi)==null||P.fire(A.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(A){for(const P in A)this.optionsService.options[P]=A[P]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new m.OptionsService(A)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(d.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((P,M)=>this._inputHandler.parse(P,M)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,P){this._writeBuffer.write(A,P)}writeSync(A,P){this._logService.logLevel<=f.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(A,P)}input(A,P=!0){this.coreService.triggerDataEvent(A,P)}resize(A,P){isNaN(A)||isNaN(P)||(A=Math.max(A,d.MINIMUM_COLS),P=Math.max(P,d.MINIMUM_ROWS),this._bufferService.resize(A,P))}scroll(A,P=!1){this._bufferService.scroll(A,P)}scrollLines(A,P,M){this._bufferService.scrollLines(A,P,M)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const P=A-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(A,P){return this._inputHandler.registerEscHandler(A,P)}registerDcsHandler(A,P){return this._inputHandler.registerDcsHandler(A,P)}registerCsiHandler(A,P){return this._inputHandler.registerCsiHandler(A,P)}registerOscHandler(A,P){return this._inputHandler.registerOscHandler(A,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?A=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},(()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const P of A)P.dispose()}))}}}o.CoreTerminal=x},8460:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===l)return void this._listeners.splice(h,1)}}})),this._event}fire(l,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,l,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,h){return l((f=>h.fire(f)))},o.runAndSubscribe=function(l,h){return h(void 0),l((f=>h(f)))}},5435:function(C,o,l){var h=this&&this.__decorate||function(Z,L,O,R){var I,N=arguments.length,Q=N<3?L:R===null?R=Object.getOwnPropertyDescriptor(L,O):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(Z,L,O,R);else for(var ie=Z.length-1;ie>=0;ie--)(I=Z[ie])&&(Q=(N<3?I(Q):N>3?I(L,O,Q):I(L,O))||Q);return N>3&&Q&&Object.defineProperty(L,O,Q),Q},f=this&&this.__param||function(Z,L){return function(O,R){L(O,R,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=l(2584),v=l(7116),d=l(2015),m=l(844),_=l(482),n=l(8437),a=l(8460),s=l(643),c=l(511),p=l(3734),w=l(2585),y=l(1480),k=l(6242),g=l(6351),x=l(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function P(Z,L){if(Z>24)return L.setWinLines||!1;switch(Z){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var M;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(o.WindowsOptionsReportType=M={}));let H=0;class F extends m.Disposable{getAttrData(){return this._curAttrData}constructor(L,O,R,I,N,Q,ie,ue,j=new d.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=O,this._coreService=R,this._logService=I,this._optionsService=N,this._oscLinkService=Q,this._coreMouseService=ie,this._unicodeService=ue,this._parser=j,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:V.toArray()})})),this._parser.setEscHandlerFallback((D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})})),this._parser.setExecuteHandlerFallback((D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})})),this._parser.setOscHandlerFallback(((D,V,B)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:V,data:B})})),this._parser.setDcsHandlerFallback(((D,V,B)=>{V==="HOOK"&&(B=B.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:V,payload:B})})),this._parser.setPrintHandler(((D,V,B)=>this.print(D,V,B))),this._parser.registerCsiHandler({final:"@"},(D=>this.insertChars(D))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(D=>this.scrollLeft(D))),this._parser.registerCsiHandler({final:"A"},(D=>this.cursorUp(D))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(D=>this.scrollRight(D))),this._parser.registerCsiHandler({final:"B"},(D=>this.cursorDown(D))),this._parser.registerCsiHandler({final:"C"},(D=>this.cursorForward(D))),this._parser.registerCsiHandler({final:"D"},(D=>this.cursorBackward(D))),this._parser.registerCsiHandler({final:"E"},(D=>this.cursorNextLine(D))),this._parser.registerCsiHandler({final:"F"},(D=>this.cursorPrecedingLine(D))),this._parser.registerCsiHandler({final:"G"},(D=>this.cursorCharAbsolute(D))),this._parser.registerCsiHandler({final:"H"},(D=>this.cursorPosition(D))),this._parser.registerCsiHandler({final:"I"},(D=>this.cursorForwardTab(D))),this._parser.registerCsiHandler({final:"J"},(D=>this.eraseInDisplay(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(D=>this.eraseInDisplay(D,!0))),this._parser.registerCsiHandler({final:"K"},(D=>this.eraseInLine(D,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(D=>this.eraseInLine(D,!0))),this._parser.registerCsiHandler({final:"L"},(D=>this.insertLines(D))),this._parser.registerCsiHandler({final:"M"},(D=>this.deleteLines(D))),this._parser.registerCsiHandler({final:"P"},(D=>this.deleteChars(D))),this._parser.registerCsiHandler({final:"S"},(D=>this.scrollUp(D))),this._parser.registerCsiHandler({final:"T"},(D=>this.scrollDown(D))),this._parser.registerCsiHandler({final:"X"},(D=>this.eraseChars(D))),this._parser.registerCsiHandler({final:"Z"},(D=>this.cursorBackwardTab(D))),this._parser.registerCsiHandler({final:"`"},(D=>this.charPosAbsolute(D))),this._parser.registerCsiHandler({final:"a"},(D=>this.hPositionRelative(D))),this._parser.registerCsiHandler({final:"b"},(D=>this.repeatPrecedingCharacter(D))),this._parser.registerCsiHandler({final:"c"},(D=>this.sendDeviceAttributesPrimary(D))),this._parser.registerCsiHandler({prefix:">",final:"c"},(D=>this.sendDeviceAttributesSecondary(D))),this._parser.registerCsiHandler({final:"d"},(D=>this.linePosAbsolute(D))),this._parser.registerCsiHandler({final:"e"},(D=>this.vPositionRelative(D))),this._parser.registerCsiHandler({final:"f"},(D=>this.hVPosition(D))),this._parser.registerCsiHandler({final:"g"},(D=>this.tabClear(D))),this._parser.registerCsiHandler({final:"h"},(D=>this.setMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(D=>this.setModePrivate(D))),this._parser.registerCsiHandler({final:"l"},(D=>this.resetMode(D))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(D=>this.resetModePrivate(D))),this._parser.registerCsiHandler({final:"m"},(D=>this.charAttributes(D))),this._parser.registerCsiHandler({final:"n"},(D=>this.deviceStatus(D))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(D=>this.deviceStatusPrivate(D))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(D=>this.softReset(D))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(D=>this.setCursorStyle(D))),this._parser.registerCsiHandler({final:"r"},(D=>this.setScrollRegion(D))),this._parser.registerCsiHandler({final:"s"},(D=>this.saveCursor(D))),this._parser.registerCsiHandler({final:"t"},(D=>this.windowOptions(D))),this._parser.registerCsiHandler({final:"u"},(D=>this.restoreCursor(D))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(D=>this.insertColumns(D))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(D=>this.deleteColumns(D))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(D=>this.selectProtected(D))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(D=>this.requestMode(D,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(D=>this.requestMode(D,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new k.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new k.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new k.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new k.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new k.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new k.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new k.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new k.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new k.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new k.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new k.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new k.OscHandler((D=>this.restoreCursorColor(D)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const D in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},(()=>this.selectCharset("("+D))),this._parser.registerEscHandler({intermediates:")",final:D},(()=>this.selectCharset(")"+D))),this._parser.registerEscHandler({intermediates:"*",final:D},(()=>this.selectCharset("*"+D))),this._parser.registerEscHandler({intermediates:"+",final:D},(()=>this.selectCharset("+"+D))),this._parser.registerEscHandler({intermediates:"-",final:D},(()=>this.selectCharset("-"+D))),this._parser.registerEscHandler({intermediates:".",final:D},(()=>this.selectCharset("."+D))),this._parser.registerEscHandler({intermediates:"/",final:D},(()=>this.selectCharset("/"+D)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((D=>(this._logService.error("Parsing error: ",D),D))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((D,V)=>this.requestStatusString(D,V))))}_preserveStack(L,O,R,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=R,this._parseStack.position=I}_logSlowResolvingAsync(L){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([L,new Promise(((O,R)=>setTimeout((()=>R("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,O){let R,I=this._activeBuffer.x,N=this._activeBuffer.y,Q=0;const ie=this._parseStack.paused;if(ie){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(R),R;I=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>A&&(Q=this._parseStack.position+A)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(D=>String.fromCharCode(D))).join("")}"`),typeof L=="string"?L.split("").map((D=>D.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(L.length,A))),ie||this._dirtyRowTracker.clearRange(),L.length>A)for(let D=Q;D<L.length;D+=A){const V=D+A<L.length?D+A:L.length,B=typeof L=="string"?this._stringDecoder.decode(L.substring(D,V),this._parseBuffer):this._utf8Decoder.decode(L.subarray(D,V),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,B))return this._preserveStack(I,N,B,D),this._logSlowResolvingAsync(R),R}else if(!ie){const D=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,D))return this._preserveStack(I,N,D,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===I&&this._activeBuffer.y===N||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),j=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);j<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(j,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(L,O,R){let I,N;const Q=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,j=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,V=this._curAttrData;let B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-O>0&&B.getWidth(this._activeBuffer.x-1)===2&&B.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let K=this._parser.precedingJoinState;for(let X=O;X<R;++X){if(I=L[X],I<127&&Q){const ve=Q[String.fromCharCode(I)];ve&&(I=ve.charCodeAt(0))}const he=this._unicodeService.charProperties(I,K);N=y.UnicodeService.extractWidth(he);const ae=y.UnicodeService.extractShouldJoin(he),de=ae?y.UnicodeService.extractWidth(K):0;if(K=he,ie&&this._onA11yChar.fire((0,_.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-de>ue){if(j){const ve=B;let te=this._activeBuffer.x-de;for(this._activeBuffer.x=de,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),de>0&&B instanceof n.BufferLine&&B.copyCellsFrom(ve,te,0,de,!1);te<ue;)ve.setCellFromCodepoint(te++,0,1,V)}else if(this._activeBuffer.x=ue-1,N===2)continue}if(ae&&this._activeBuffer.x){const ve=B.getWidth(this._activeBuffer.x-1)?1:2;B.addCodepointToCell(this._activeBuffer.x-ve,I,N);for(let te=N-de;--te>=0;)B.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if(D&&(B.insertCells(this._activeBuffer.x,N-de,this._activeBuffer.getNullCell(V)),B.getWidth(ue-1)===2&&B.setCellFromCodepoint(ue-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,V)),B.setCellFromCodepoint(this._activeBuffer.x++,I,N,V),N>0)for(;--N;)B.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=K,this._activeBuffer.x<ue&&R-O>0&&B.getWidth(this._activeBuffer.x)===0&&!B.hasContent(this._activeBuffer.x)&&B.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,O){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,O):this._parser.registerCsiHandler(L,(R=>!P(R.params[0],this._optionsService.rawOptions.windowOptions)||O(R)))}registerDcsHandler(L,O){return this._parser.registerDcsHandler(L,new g.DcsHandler(O))}registerEscHandler(L,O){return this._parser.registerEscHandler(L,O)}registerOscHandler(L,O){return this._parser.registerOscHandler(L,new k.OscHandler(O))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=L,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+O)}cursorUp(L){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const O=L.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const O=L.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,O,R,I=!1,N=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(O,R,this._activeBuffer.getNullCell(this._eraseAttrData()),N),I&&(Q.isWrapped=!1)}_resetBufferLine(L,O=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),R.isWrapped=!1)}eraseInDisplay(L,O=!1){let R;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);R<this._bufferService.rows;R++)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,O);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(L,O=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;O--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;O--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let O=L.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let O=L.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);I.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const O=this._parser.precedingJoinState;if(!O)return!0;const R=L.params[0]||1,I=y.UnicodeService.extractWidth(O),N=this._activeBuffer.x-I,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),ie=new Uint32Array(Q.length*R);let ue=0;for(let D=0;D<Q.length;){const V=Q.codePointAt(D)||0;ie[ue++]=V,D+=V>65535?2:1}let j=ue;for(let D=1;D<R;++D)ie.copyWithin(j,0,ue),j+=ue;return this.print(ie,0,j),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,O){const R=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:N}=this._coreMouseService,Q=this._coreService,{buffers:ie,cols:ue}=this._bufferService,{active:j,alt:D}=ie,V=this._optionsService.rawOptions,B=ae=>ae?1:2,K=L.params[0];return X=K,he=O?K===2?4:K===4?B(Q.modes.insertMode):K===12?3:K===20?B(V.convertEol):0:K===1?B(R.applicationCursorKeys):K===3?V.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:K===6?B(R.origin):K===7?B(R.wraparound):K===8?3:K===9?B(I==="X10"):K===12?B(V.cursorBlink):K===25?B(!Q.isCursorHidden):K===45?B(R.reverseWraparound):K===66?B(R.applicationKeypad):K===67?4:K===1e3?B(I==="VT200"):K===1002?B(I==="DRAG"):K===1003?B(I==="ANY"):K===1004?B(R.sendFocus):K===1005?4:K===1006?B(N==="SGR"):K===1015?4:K===1016?B(N==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?B(j===D):K===2004?B(R.bracketedPasteMode):0,Q.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${X};${he}$y`),!0;var X,he}_updateAttrColor(L,O,R,I,N){return O===2?(L|=50331648,L&=-16777216,L|=p.AttributeData.fromColorRGB([R,I,N])):O===5&&(L&=-50331904,L|=33554432|255&R),L}_extractColor(L,O,R){const I=[0,0,-1,0,0,0];let N=0,Q=0;do{if(I[Q+N]=L.params[O+Q],L.hasSubParams(O+Q)){const ie=L.getSubParams(O+Q);let ue=0;do I[1]===5&&(N=1),I[Q+ue+1+N]=ie[ue];while(++ue<ie.length&&ue+Q+1+N<I.length);break}if(I[1]===5&&Q+N>=2||I[1]===2&&Q+N>=5)break;I[1]&&(N=1)}while(++Q+O<L.length&&Q+N<I.length);for(let ie=2;ie<I.length;++ie)I[ie]===-1&&(I[ie]=0);switch(I[0]){case 38:R.fg=this._updateAttrColor(R.fg,I[1],I[3],I[4],I[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,I[1],I[3],I[4],I[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,I[1],I[3],I[4],I[5])}return Q}_processUnderline(L,O){O.extended=O.extended.clone(),(!~L||L>5)&&(L=1),O.extended.underlineStyle=L,O.fg|=268435456,L===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(L){L.fg=n.DEFAULT_ATTR_DATA.fg,L.bg=n.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=L.length;let R;const I=this._curAttrData;for(let N=0;N<O;N++)R=L.params[N],R>=30&&R<=37?(I.fg&=-50331904,I.fg|=16777216|R-30):R>=40&&R<=47?(I.bg&=-50331904,I.bg|=16777216|R-40):R>=90&&R<=97?(I.fg&=-50331904,I.fg|=16777224|R-90):R>=100&&R<=107?(I.bg&=-50331904,I.bg|=16777224|R-100):R===0?this._processSGR0(I):R===1?I.fg|=134217728:R===3?I.bg|=67108864:R===4?(I.fg|=268435456,this._processUnderline(L.hasSubParams(N)?L.getSubParams(N)[0]:1,I)):R===5?I.fg|=536870912:R===7?I.fg|=67108864:R===8?I.fg|=1073741824:R===9?I.fg|=2147483648:R===2?I.bg|=134217728:R===21?this._processUnderline(2,I):R===22?(I.fg&=-134217729,I.bg&=-134217729):R===23?I.bg&=-67108865:R===24?(I.fg&=-268435457,this._processUnderline(0,I)):R===25?I.fg&=-536870913:R===27?I.fg&=-67108865:R===28?I.fg&=-1073741825:R===29?I.fg&=2147483647:R===39?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):R===49?(I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?N+=this._extractColor(L,N,I):R===53?I.bg|=1073741824:R===55?I.bg&=-1073741825:R===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):R===100?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${R}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const O=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${R}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const O=L.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const R=O%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(L){const O=L.params[0]||1;let R;return(L.length<2||(R=L.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(L){if(!P(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const O=[],R=L.split(";");for(;R.length>1;){const I=R.shift(),N=R.shift();if(/^\d+$/.exec(I)){const Q=parseInt(I);if(J(Q))if(N==="?")O.push({type:0,index:Q});else{const ie=(0,x.parseColor)(N);ie&&O.push({type:1,index:Q,color:ie})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(L){const O=L.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(L,O){this._getCurrentLinkId()&&this._finishHyperlink();const R=L.split(":");let I;const N=R.findIndex((Q=>Q.startsWith("id=")));return N!==-1&&(I=R[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,O){const R=L.split(";");for(let I=0;I<R.length&&!(O>=this._specialColors.length);++I,++O)if(R[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const N=(0,x.parseColor)(R[I]);N&&this._onColor.fire([{type:1,index:this._specialColors[O],color:N}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const O=[],R=L.split(";");for(let I=0;I<R.length;++I)if(/^\d+$/.exec(R[I])){const N=parseInt(R[I]);J(N)&&O.push({type:2,index:N})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(T[L[0]],v.CHARSETS[L[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new c.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const R=this._activeBuffer.ybase+this._activeBuffer.y+O,I=this._activeBuffer.lines.get(R);I&&(I.fill(L),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,O){const R=this._bufferService.buffer,I=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,O){this._dirtyRowTracker.markRangeDirty(L,O)}}o.InputHandler=F;let Y=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,L){Z>L&&(H=Z,Z=L,L=H),Z<this.start&&(this.start=Z),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(Z){return 0<=Z&&Z<256}Y=h([f(0,w.IBufferService)],Y)},844:(C,o)=>{function l(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=l,o.getDisposeArrayDisposable=function(h){return{dispose:()=>l(h)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,u,v){this._data[f]||(this._data[f]={}),this._data[f][u]=v}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(h,f,u,v,d){this._data.get(h,f)||this._data.set(h,f,new l),this._data.get(h,f).set(u,v,d)}get(h,f,u,v){var d;return(d=this._data.get(h,f))==null?void 0:d.get(u,v)}clear(){this._data.clear()}}},6114:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const f=l.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(l=this._search(this._getKey(h)),this._array.splice(l,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(l=this._search(f),l===-1)||this._getKey(this._array[l])!==f)return!1;do if(this._array[l]===h)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===h)}forEachByKey(h,f){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do f(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===h)}values(){return[...this._array].values()}_search(h){let f=0,u=this._array.length-1;for(;u>=f;){let v=f+u>>1;const d=this._getKey(this._array[v]);if(d>h)u=v-1;else{if(!(d<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}f=v+1}}return f}}},7226:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=l(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(d){this._tasks.push(d),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(d){this._idleCallback=void 0;let m=0,_=0,n=d.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(m=Date.now(),this._tasks[this._i]()||this._i++,m=Math.max(1,Date.now()-m),_=Math.max(m,_),a=d.timeRemaining(),1.5*_>a)return n-m<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-m))}ms`),void this._start();n=a}this.clear()}}class u extends f{_requestCallback(d){return setTimeout((()=>d(this._createDeadline(16))))}_cancelCallback(d){clearTimeout(d)}_createDeadline(d){const m=Date.now()+d;return{timeRemaining:()=>Math.max(0,m-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=l(643);o.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),v=u==null?void 0:u.get(f.cols-1),d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);d&&v&&(d.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=l(6349),f=l(7226),u=l(3734),v=l(8437),d=l(4634),m=l(511),_=l(643),n=l(4863),a=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(s,c,p){this._hasScrollback=s,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=m.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=m.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(s),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const c=s+this._optionsService.rawOptions.scrollback;return c>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:c}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,c){const p=this.getNullCell(v.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(c);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let g=0;g<this.lines.length;g++)w+=+this.lines.get(g).resize(s,p);let k=0;if(this._rows<c)for(let g=this._rows;g<c;g++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(s,p)));else for(let g=this._rows;g>c;g--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const g=this.lines.length-y;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,c-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(s,c),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=c,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,c){this._cols!==s&&(s>this._cols?this._reflowLarger(s,c):this._reflowSmaller(s,c))}_reflowLarger(s,c){const p=(0,d.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,d.reflowLargerCreateNewLayout)(this.lines,p);(0,d.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,c,w.countRemoved)}}_reflowLargerAdjustViewport(s,c,p){const w=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,c){const p=this.getNullCell(v.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let g=this.lines.get(k);if(!g||!g.isWrapped&&g.getTrimmedLength()<=s)continue;const x=[g];for(;g.isWrapped&&k>0;)g=this.lines.get(--k),x.unshift(g);const T=this.ybase+this.y;if(T>=k&&T<k+x.length)continue;const A=x[x.length-1].getTrimmedLength(),P=(0,d.reflowSmallerGetNewLineLengths)(x,this._cols,s),M=P.length-x.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const F=[];for(let R=0;R<M;R++){const I=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);F.push(I)}F.length>0&&(w.push({start:k+x.length+y,newLines:F}),y+=F.length),x.push(...F);let Y=P.length-1,J=P[Y];J===0&&(Y--,J=P[Y]);let Z=x.length-M-1,L=A;for(;Z>=0;){const R=Math.min(L,J);if(x[Y]===void 0)break;if(x[Y].copyCellsFrom(x[Z],L-R,J-R,R,!0),J-=R,J===0&&(Y--,J=P[Y]),L-=R,L===0){Z--;const I=Math.max(Z,0);L=(0,d.getWrappedLineTrimmedLength)(x,I,this._cols)}}for(let R=0;R<x.length;R++)P[R]<s&&x[R].setCell(P[R],p);let O=M-H;for(;O-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+c-1)}if(w.length>0){const k=[],g=[];for(let Y=0;Y<this.lines.length;Y++)g.push(this.lines.get(Y));const x=this.lines.length;let T=x-1,A=0,P=w[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let M=0;for(let Y=Math.min(this.lines.maxLength-1,x+y-1);Y>=0;Y--)if(P&&P.start>T+M){for(let J=P.newLines.length-1;J>=0;J--)this.lines.set(Y--,P.newLines[J]);Y++,k.push({index:T+1,amount:P.newLines.length}),M+=P.newLines.length,P=w[++A]}else this.lines.set(Y,g[T--]);let H=0;for(let Y=k.length-1;Y>=0;Y--)k[Y].index+=H,this.lines.onInsertEmitter.fire(k[Y]),H+=k[Y].amount;const F=Math.max(0,x+y-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(s,c,p=0,w){const y=this.lines.get(s);return y?y.translateToString(c,p,w):""}getWrappedRangeForLine(s){let c=s,p=s;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===s&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const c=new n.Marker(s);return this.markers.push(c),c.register(this.lines.onTrim((p=>{c.line-=p,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((p=>{c.line>=p.index&&(c.line+=p.amount)}))),c.register(this.lines.onDelete((p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=l(3734),f=l(511),u=l(643),v=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let d=0;class m{constructor(n,a,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=a||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let p=0;p<n;++p)this.setCell(p,c);this.length=n}get(n){const a=this._data[3*n+0],s=2097151&a;return[this._data[3*n+1],2097152&a?this._combined[n]:s?(0,v.stringFromCodePoint)(s):"",a>>22,2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):s]}set(n,a){this._data[3*n+1]=a[u.CHAR_DATA_ATTR_INDEX],a[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=a[1],this._data[3*n+0]=2097152|n|a[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&a}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n]:2097151&a?(0,v.stringFromCodePoint)(2097151&a):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,a){return d=3*n,a.content=this._data[d+0],a.fg=this._data[d+1],a.bg=this._data[d+2],2097152&a.content&&(a.combinedData=this._combined[n]),268435456&a.bg&&(a.extended=this._extendedAttrs[n]),a}setCell(n,a){2097152&a.content&&(this._combined[n]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=a.content,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}setCellFromCodepoint(n,a,s,c){268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=a|s<<22,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}addCodepointToCell(n,a,s){let c=this._data[3*n+0];2097152&c?this._combined[n]+=(0,v.stringFromCodePoint)(a):2097151&c?(this._combined[n]=(0,v.stringFromCodePoint)(2097151&c)+(0,v.stringFromCodePoint)(a),c&=-2097152,c|=2097152):c=a|4194304,s&&(c&=-12582913,c|=s<<22),this._data[3*n+0]=c}insertCells(n,a,s){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length-n){const c=new f.CellData;for(let p=this.length-n-a-1;p>=0;--p)this.setCell(n+a+p,this.loadCell(n+p,c));for(let p=0;p<a;++p)this.setCell(n+p,s)}else for(let c=n;c<this.length;++c)this.setCell(c,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(n,a,s){if(n%=this.length,a<this.length-n){const c=new f.CellData;for(let p=0;p<this.length-n-a;++p)this.setCell(n+p,this.loadCell(n+a+p,c));for(let p=this.length-a;p<this.length;++p)this.setCell(p,s)}else for(let c=n;c<this.length;++c)this.setCell(c,s);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,s)}replaceCells(n,a,s,c=!1){if(c)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,s);n<a&&n<this.length;)this.isProtected(n)||this.setCell(n,s),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,s);n<a&&n<this.length;)this.setCell(n++,s)}resize(n,a){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const c=new Uint32Array(s);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,a)}else{this._data=this._data.subarray(0,s);const c=Object.keys(this._combined);for(let w=0;w<c.length;w++){const y=parseInt(c[w],10);y>=n&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=n&&delete this._extendedAttrs[y]}}return this.length=n,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,a=!1){if(a)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,n);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const a in n._combined)this._combined[a]=n._combined[a];this._extendedAttrs={};for(const a in n._extendedAttrs)this._extendedAttrs[a]=n._extendedAttrs[a];this.isWrapped=n.isWrapped}clone(){const n=new m(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const a in this._combined)n._combined[a]=this._combined[a];for(const a in this._extendedAttrs)n._extendedAttrs[a]=this._extendedAttrs[a];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,a,s,c,p){const w=n._data;if(p)for(let k=c-1;k>=0;k--){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(a+k)+g];268435456&w[3*(a+k)+2]&&(this._extendedAttrs[s+k]=n._extendedAttrs[a+k])}else for(let k=0;k<c;k++){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(a+k)+g];268435456&w[3*(a+k)+2]&&(this._extendedAttrs[s+k]=n._extendedAttrs[a+k])}const y=Object.keys(n._combined);for(let k=0;k<y.length;k++){const g=parseInt(y[k],10);g>=a&&(this._combined[g-a+s]=n._combined[g])}}translateToString(n,a,s,c){a=a??0,s=s??this.length,n&&(s=Math.min(s,this.getTrimmedLength())),c&&(c.length=0);let p="";for(;a<s;){const w=this._data[3*a+0],y=2097151&w,k=2097152&w?this._combined[a]:y?(0,v.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR;if(p+=k,c)for(let g=0;g<k.length;++g)c.push(a);a+=w>>22||1}return c&&c.push(a),p}}o.BufferLine=m},4841:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,h){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return h*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(C,o)=>{function l(h,f,u){if(f===h.length-1)return h[f].getTrimmedLength();const v=!h[f].hasContent(u-1)&&h[f].getWidth(u-1)===1,d=h[f+1].getWidth(0)===2;return v&&d?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,f,u,v,d){const m=[];for(let _=0;_<h.length-1;_++){let n=_,a=h.get(++n);if(!a.isWrapped)continue;const s=[h.get(_)];for(;n<h.length&&a.isWrapped;)s.push(a),a=h.get(++n);if(v>=_&&v<n){_+=s.length-1;continue}let c=0,p=l(s,c,f),w=1,y=0;for(;w<s.length;){const g=l(s,w,f),x=g-y,T=u-p,A=Math.min(x,T);s[c].copyCellsFrom(s[w],y,p,A,!1),p+=A,p===u&&(c++,p=0),y+=A,y===g&&(w++,y=0),p===0&&c!==0&&s[c-1].getWidth(u-1)===2&&(s[c].copyCellsFrom(s[c-1],u-1,p++,1,!1),s[c-1].setCell(u-1,d))}s[c].replaceCells(p,u,d);let k=0;for(let g=s.length-1;g>0&&(g>c||s[g].getTrimmedLength()===0);g--)k++;k>0&&(m.push(_+s.length-k),m.push(k)),_+=s.length-1}return m},o.reflowLargerCreateNewLayout=function(h,f){const u=[];let v=0,d=f[v],m=0;for(let _=0;_<h.length;_++)if(d===_){const n=f[++v];h.onDeleteEmitter.fire({index:_-m,amount:n}),_+=n-1,m+=n,d=f[++v]}else u.push(_);return{layout:u,countRemoved:m}},o.reflowLargerApplyNewLayout=function(h,f){const u=[];for(let v=0;v<f.length;v++)u.push(h.get(f[v]));for(let v=0;v<u.length;v++)h.set(v,u[v]);h.length=f.length},o.reflowSmallerGetNewLineLengths=function(h,f,u){const v=[],d=h.map(((a,s)=>l(h,s,f))).reduce(((a,s)=>a+s));let m=0,_=0,n=0;for(;n<d;){if(d-n<u){v.push(d-n);break}m+=u;const a=l(h,_,f);m>a&&(m-=a,_++);const s=h[_].getWidth(m-1)===2;s&&m--;const c=s?u-1:u;v.push(c),n+=c}return v},o.getWrappedLineTrimmedLength=l},5295:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=l(8460),f=l(844),u=l(9092);class v extends f.Disposable{constructor(m,_){super(),this._optionsService=m,this._bufferService=_,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(m){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(m),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(m,_){this._normal.resize(m,_),this._alt.resize(m,_),this.setupTabStops(m)}setupTabStops(m){this._normal.setupTabStops(m),this._alt.setupTabStops(m)}}o.BufferSet=v},511:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=l(482),f=l(643),u=l(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(m){const _=new v;return _.setFromCharData(m),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(m){this.fg=m[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(m[f.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(m[f.CHAR_DATA_CHAR_INDEX].length===2){const n=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|m[f.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[f.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=m[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|m[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=l(8460),f=l(844);class u{get id(){return this._id}constructor(d){this.line=d,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(d){return this._disposables.push(d),d}}o.Marker=u,u._nextId=1},7116:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,o)=>{var l,h,f;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
9
+ `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(l||(o.C0=l={})),(function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"})(h||(o.C1=h={})),(function(u){u.ST=`${l.ESC}\\`})(f||(o.C1_ESCAPED=f={}))},7399:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=l(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(u,v,d,m){const _={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,u.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(d?"b":"[1;5D"))):_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(d?"f":"[1;5C"))):_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"A",d||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"B",d||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=n?h.C0.ESC+"[3;"+(n+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=n?h.C0.ESC+"[1;"+(n+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=n?h.C0.ESC+"[1;"+(n+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=h.C0.ESC+"[5;"+(n+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=h.C0.ESC+"[6;"+(n+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=n?h.C0.ESC+"[1;"+(n+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=n?h.C0.ESC+"[1;"+(n+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=n?h.C0.ESC+"[1;"+(n+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=n?h.C0.ESC+"[1;"+(n+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=n?h.C0.ESC+"[15;"+(n+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=n?h.C0.ESC+"[17;"+(n+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=n?h.C0.ESC+"[18;"+(n+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=n?h.C0.ESC+"[19;"+(n+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=n?h.C0.ESC+"[20;"+(n+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=n?h.C0.ESC+"[21;"+(n+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=n?h.C0.ESC+"[23;"+(n+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=n?h.C0.ESC+"[24;"+(n+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(d&&!m||!u.altKey||u.metaKey)!d||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=h.C0.US),u.key==="@"&&(_.key=h.C0.NUL)):u.keyCode===65&&(_.type=1);else{const a=f[u.keyCode],s=a==null?void 0:a[u.shiftKey?1:0];if(s)_.key=h.C0.ESC+s;else if(u.keyCode>=65&&u.keyCode<=90){const c=u.ctrlKey?u.keyCode-64:u.keyCode+32;let p=String.fromCharCode(c);u.shiftKey&&(p=p.toUpperCase()),_.key=h.C0.ESC+p}else if(u.keyCode===32)_.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let c=u.code.slice(3,4);u.shiftKey||(c=c.toLowerCase()),_.key=h.C0.ESC+c,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=h.C0.DEL:u.keyCode===219?_.key=h.C0.ESC:u.keyCode===220?_.key=h.C0.FS:u.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,h=0,f=l.length){let u="";for(let v=h;v<f;++v){let d=l[v];d>65535?(d-=65536,u+=String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):u+=String.fromCharCode(d)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,h){const f=l.length;if(!f)return 0;let u=0,v=0;if(this._interim){const d=l.charCodeAt(v++);56320<=d&&d<=57343?h[u++]=1024*(this._interim-55296)+d-56320+65536:(h[u++]=this._interim,h[u++]=d),this._interim=0}for(let d=v;d<f;++d){const m=l.charCodeAt(d);if(55296<=m&&m<=56319){if(++d>=f)return this._interim=m,u;const _=l.charCodeAt(d);56320<=_&&_<=57343?h[u++]=1024*(m-55296)+_-56320+65536:(h[u++]=m,h[u++]=_)}else m!==65279&&(h[u++]=m)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,h){const f=l.length;if(!f)return 0;let u,v,d,m,_=0,n=0,a=0;if(this.interim[0]){let p=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,k=0;for(;(y=63&this.interim[++k])&&k<4;)w<<=6,w|=y;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=g-k;for(;a<x;){if(a>=f)return 0;if(y=l[a++],(192&y)!=128){a--,p=!0;break}this.interim[k++]=y,w<<=6,w|=63&y}p||(g===2?w<128?a--:h[_++]=w:g===3?w<2048||w>=55296&&w<=57343||w===65279||(h[_++]=w):w<65536||w>1114111||(h[_++]=w)),this.interim.fill(0)}const s=f-4;let c=a;for(;c<f;){for(;!(!(c<s)||128&(u=l[c])||128&(v=l[c+1])||128&(d=l[c+2])||128&(m=l[c+3]));)h[_++]=u,h[_++]=v,h[_++]=d,h[_++]=m,c+=4;if(u=l[c++],u<128)h[_++]=u;else if((224&u)==192){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}h[_++]=n}else if((240&u)==224){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,_;if(d=l[c++],(192&d)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&d,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&u)==240){if(c>=f)return this.interim[0]=u,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,_;if(d=l[c++],(192&d)!=128){c--;continue}if(c>=f)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=d,_;if(m=l[c++],(192&m)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&d)<<6|63&m,n<65536||n>1114111)continue;h[_++]=n}}return _}}},225:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=l(1480),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let d=0;d<f.length;++d)v.fill(0,f[d][0],f[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?v[d]:(function(m,_){let n,a=0,s=_.length-1;if(m<_[0][0]||m>_[s][1])return!1;for(;s>=a;)if(n=a+s>>1,m>_[n][1])a=n+1;else{if(!(m<_[n][0]))return!0;s=n-1}return!1})(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}charProperties(d,m){let _=this.wcwidth(d),n=_===0&&m!==0;if(n){const a=h.UnicodeService.extractWidth(m);a===0?n=!1:a>_&&(_=a)}return h.UnicodeService.createPropertyValue(0,_,n)}}},5981:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=l(8460),f=l(844);class u extends f.Disposable{constructor(d){super(),this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(d,m){if(m!==void 0&&this._syncCalls>m)return void(this._syncCalls=0);if(this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(d,m){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(m),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(m)}_innerWrite(d=0,m=!0){const _=d||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],a=this._action(n,m);if(a){const c=p=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,p))):this._innerWrite(_,p);return void a.catch((p=>(queueMicrotask((()=>{throw p})),Promise.resolve(!1)))).then(c)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=u},5941:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function f(u,v){const d=u.toString(16),m=d.length<2?"0"+d:d;switch(v){case 4:return d[0];case 8:return m;case 12:return(m+m).slice(0,3);default:return m+m}}o.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const d=l.exec(v);if(d){const m=d[1]?15:d[4]?255:d[7]?4095:65535;return[Math.round(parseInt(d[1]||d[4]||d[7]||d[10],16)/m*255),Math.round(parseInt(d[2]||d[5]||d[8]||d[11],16)/m*255),Math.round(parseInt(d[3]||d[6]||d[9]||d[12],16)/m*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const d=v.length/3,m=[0,0,0];for(let _=0;_<3;++_){const n=parseInt(v.slice(d*_,d*_+d),16);m[_]=d===1?n<<4:d===2?n:d===3?n>>4:n>>8}return m}},o.toRgbString=function(u,v=16){const[d,m,_]=u;return`rgb:${f(d,v)}/${f(m,v)}/${f(_,v)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=l(482),f=l(8742),u=l(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(m,_){this._handlers[m]===void 0&&(this._handlers[m]=[]);const n=this._handlers[m];return n.push(_),{dispose:()=>{const a=n.indexOf(_);a!==-1&&n.splice(a,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}reset(){if(this._active.length)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(m,_){if(this.reset(),this._ident=m,this._active=this._handlers[m]||v,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(m,_,n){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(m,_,n);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(m,_,n))}unhook(m,_=!0){if(this._active.length){let n=!1,a=this._active.length-1,s=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;a>=0&&(n=this._active[a].unhook(m),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",m);this._active=v,this._ident=0}};const d=new f.Params;d.addParam(0),o.DcsHandler=class{constructor(m){this._handler=m,this._data="",this._params=d,this._hitLimit=!1}hook(m){this._params=m.length>1||m.params[0]?m.clone():d,this._data="",this._hitLimit=!1}put(m,_,n){this._hitLimit||(this._data+=(0,h.utf32ToString)(m,_,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(m){let _=!1;if(this._hitLimit)_=!1;else if(m&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((n=>(this._params=d,this._data="",this._hitLimit=!1,n)));return this._params=d,this._data="",this._hitLimit=!1,_}}},2015:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=l(844),f=l(8742),u=l(6242),v=l(6351);class d{constructor(a){this.table=new Uint8Array(a)}setDefault(a,s){this.table.fill(a<<4|s)}add(a,s,c,p){this.table[s<<8|a]=c<<4|p}addMany(a,s,c,p){for(let w=0;w<a.length;w++)this.table[s<<8|a[w]]=c<<4|p}}o.TransitionTable=d;const m=160;o.VT500_TRANSITION_TABLE=(function(){const n=new d(4095),a=Array.apply(null,Array(256)).map(((k,g)=>g)),s=(k,g)=>a.slice(k,g),c=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const w=s(0,14);let y;for(y in n.setDefault(1,0),n.addMany(c,0,2,0),w)n.addMany([24,26,153,154],y,3,0),n.addMany(s(128,144),y,3,0),n.addMany(s(144,152),y,3,0),n.add(156,y,0,0),n.add(27,y,11,1),n.add(157,y,4,8),n.addMany([152,158,159],y,0,7),n.add(155,y,11,3),n.add(144,y,11,9);return n.addMany(p,0,3,0),n.addMany(p,1,3,1),n.add(127,1,0,1),n.addMany(p,8,0,8),n.addMany(p,3,3,3),n.add(127,3,0,3),n.addMany(p,4,3,4),n.add(127,4,0,4),n.addMany(p,6,3,6),n.addMany(p,5,3,5),n.add(127,5,0,5),n.addMany(p,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(s(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(p,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(s(64,127),3,7,0),n.addMany(s(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(s(48,60),4,8,4),n.addMany(s(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(s(32,64),6,0,6),n.add(127,6,0,6),n.addMany(s(64,127),6,0,0),n.addMany(s(32,48),3,9,5),n.addMany(s(32,48),5,9,5),n.addMany(s(48,64),5,0,6),n.addMany(s(64,127),5,7,0),n.addMany(s(32,48),4,9,5),n.addMany(s(32,48),1,9,2),n.addMany(s(32,48),2,9,2),n.addMany(s(48,127),2,10,0),n.addMany(s(48,80),1,10,0),n.addMany(s(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(s(96,127),1,10,0),n.add(80,1,11,9),n.addMany(p,9,0,9),n.add(127,9,0,9),n.addMany(s(28,32),9,0,9),n.addMany(s(32,48),9,9,12),n.addMany(s(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(p,11,0,11),n.addMany(s(32,128),11,0,11),n.addMany(s(28,32),11,0,11),n.addMany(p,10,0,10),n.add(127,10,0,10),n.addMany(s(28,32),10,0,10),n.addMany(s(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(s(32,48),10,9,12),n.addMany(p,12,0,12),n.add(127,12,0,12),n.addMany(s(28,32),12,0,12),n.addMany(s(32,48),12,9,12),n.addMany(s(48,64),12,0,11),n.addMany(s(64,127),12,12,13),n.addMany(s(64,127),10,12,13),n.addMany(s(64,127),9,12,13),n.addMany(p,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(m,0,2,0),n.add(m,8,5,8),n.add(m,6,0,6),n.add(m,11,0,11),n.add(m,13,13,13),n})();class _ extends h.Disposable{constructor(a=o.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,c,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,c)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,s=[64,126]){let c=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=a.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<a.intermediates.length;++w){const y=a.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=y}}if(a.final.length!==1)throw new Error("final must be a single byte");const p=a.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return c<<=8,c|=p,c}identToString(a){const s=[];for(;a;)s.push(String.fromCharCode(255&a)),a>>=8;return s.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,s){const c=this._identifier(a,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,s){this._executeHandlers[a.charCodeAt(0)]=s}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,s){const c=this._identifier(a);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,s){return this._dcsParser.registerHandler(this._identifier(a),s)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,s){return this._oscParser.registerHandler(a,s)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(a,s,c,p,w){this._parseStack.state=a,this._parseStack.handlers=s,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=w}parse(a,s,c){let p,w=0,y=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&x>-1){for(;x>=0&&(p=g[x](this._params),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&x>-1){for(;x>=0&&(p=g[x](),p!==!0);x--)if(p instanceof Promise)return this._parseStack.handlerPos=x,p}this._parseStack.handlers=[];break;case 6:if(w=a[this._parseStack.chunkPos],p=this._dcsParser.unhook(w!==24&&w!==26,c),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=a[this._parseStack.chunkPos],p=this._oscParser.end(w!==24&&w!==26,c),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=k;g<s;++g){switch(w=a[g],y=this._transitions.table[this.currentState<<8|(w<160?w:m)],y>>4){case 2:for(let M=g+1;;++M){if(M>=s||(w=a[M])<32||w>126&&w<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=s||(w=a[M])<32||w>126&&w<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=s||(w=a[M])<32||w>126&&w<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=s||(w=a[M])<32||w>126&&w<m){this._printHandler(a,g,M),g=M-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|w];let T=x?x.length-1:-1;for(;T>=0&&(p=x[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,x,T,y,g),p;T<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++g<s&&(w=a[g])>47&&w<60);g--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const A=this._escHandlers[this._collect<<8|w];let P=A?A.length-1:-1;for(;P>=0&&(p=A[P](),p!==!0);P--)if(p instanceof Promise)return this._preserveStack(4,A,P,y,g),p;P<0&&this._escHandlerFb(this._collect<<8|w),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let M=g+1;;++M)if(M>=s||(w=a[M])===24||w===26||w===27||w>127&&w<m){this._dcsParser.put(a,g,M),g=M-1;break}break;case 14:if(p=this._dcsParser.unhook(w!==24&&w!==26),p)return this._preserveStack(6,[],0,y,g),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let M=g+1;;M++)if(M>=s||(w=a[M])<32||w>127&&w<m){this._oscParser.put(a,g,M),g=M-1;break}break;case 6:if(p=this._oscParser.end(w!==24&&w!==26),p)return this._preserveStack(5,[],0,y,g),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}o.EscapeSequenceParser=_},6242:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=l(5770),f=l(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,d){this._handlers[v]===void 0&&(this._handlers[v]=[]);const m=this._handlers[v];return m.push(d),{dispose:()=>{const _=m.indexOf(d);_!==-1&&m.splice(_,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,d,m){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(v,d,m);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(v,d,m))}start(){this.reset(),this._state=1}put(v,d,m){if(this._state!==3){if(this._state===1)for(;d<m;){const _=v[d++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&m-d>0&&this._put(v,d,m)}}end(v,d=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let m=!1,_=this._active.length-1,n=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,m=d,n=this._stack.fallThrough,this._stack.paused=!1),!n&&m===!1){for(;_>=0&&(m=this._active[_].end(v),m!==!0);_--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,m;_--}for(;_>=0;_--)if(m=this._active[_].end(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,m}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,d,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(v,d,m),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let d=!1;if(this._hitLimit)d=!1;else if(v&&(d=this._handler(this._data),d instanceof Promise))return d.then((m=>(this._data="",this._hitLimit=!1,m)));return this._data="",this._hitLimit=!1,d}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class h{static fromArray(u){const v=new h;if(!u.length)return v;for(let d=Array.isArray(u[0])?1:0;d<u.length;++d){const m=u[d];if(Array.isArray(m))for(let _=0;_<m.length;++_)v.addSubParam(m[_]);else v.addParam(m)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const d=this._subParamsIdx[v]>>8,m=255&this._subParamsIdx[v];m-d>0&&u.push(Array.prototype.slice.call(this._subParams,d,m))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,d=255&this._subParamsIdx[u];return d-v>0?this._subParams.subarray(v,d):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const d=this._subParamsIdx[v]>>8,m=255&this._subParamsIdx[v];m-d>0&&(u[v]=this._subParams.slice(d,m))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const d=this._digitIsSub?this._subParams:this.params,m=d[v-1];d[v-1]=~m?Math.min(10*m+u,l):u}}o.Params=h},5741:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===l){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(h,1)}}},8771:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=l(3785),f=l(511);o.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const v=this._buffer.lines.get(u);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new f.CellData}}},3785:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=l(511);o.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new h.CellData)}translateToString(f,u,v){return this._line.translateToString(f,u,v)}}},8285:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=l(8771),f=l(8460),u=l(844);class v extends u.Disposable{constructor(m){super(),this._core=m,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,h){return this._core.registerCsiHandler(l,(f=>h(f.toArray())))}addCsiHandler(l,h){return this.registerCsiHandler(l,h)}registerDcsHandler(l,h){return this._core.registerDcsHandler(l,((f,u)=>h(f,u.toArray())))}addDcsHandler(l,h){return this.registerDcsHandler(l,h)}registerEscHandler(l,h){return this._core.registerEscHandler(l,h)}addEscHandler(l,h){return this.registerEscHandler(l,h)}registerOscHandler(l,h){return this._core.registerOscHandler(l,h)}addOscHandler(l,h){return this.registerOscHandler(l,h)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(C,o,l){var h=this&&this.__decorate||function(n,a,s,c){var p,w=arguments.length,y=w<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,a,s,c);else for(var k=n.length-1;k>=0;k--)(p=n[k])&&(y=(w<3?p(y):w>3?p(a,s,y):p(a,s))||y);return w>3&&y&&Object.defineProperty(a,s,y),y},f=this&&this.__param||function(n,a){return function(s,c){a(s,c,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=l(8460),v=l(844),d=l(5295),m=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let _=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new d.BufferSet(n,this))}resize(n,a){this.cols=n,this.rows=a,this.buffers.resize(n,a),this._onResize.fire({cols:n,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,a=!1){const s=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=s.getBlankLine(n,a),this._cachedBlankLine=c),c.isWrapped=a;const p=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(c):s.lines.push(c.clone()):s.lines.splice(w+1,0,c.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-p+1;s.lines.shiftElements(p+1,y-1,-1),s.lines.set(w,c.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(n,a,s){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),p!==c.ydisp&&(a||this._onScroll.fire(c.ydisp))}};o.BufferService=_=h([f(0,m.IOptionsService)],_)},7994:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,h){this._charsets[l]=h,this.glevel===l&&(this.charset=h)}}},1753:function(C,o,l){var h=this&&this.__decorate||function(c,p,w,y){var k,g=arguments.length,x=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,p,w,y);else for(var T=c.length-1;T>=0;T--)(k=c[T])&&(x=(g<3?k(x):g>3?k(p,w,x):k(p,w))||x);return g>3&&x&&Object.defineProperty(p,w,x),x},f=this&&this.__param||function(c,p){return function(w,y){p(w,y,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=l(2585),v=l(8460),d=l(844),m={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function _(c,p){let w=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(w|=64,w|=c.action):(w|=3&c.button,4&c.button&&(w|=64),8&c.button&&(w|=128),c.action===32?w|=32:c.action!==0||p||(w|=3)),w}const n=String.fromCharCode,a={DEFAULT:c=>{const p=[_(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${n(p[0])}${n(p[1])}${n(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.x};${c.y}${p}`}};let s=o.CoreMouseService=class extends d.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(m))this.addProtocol(w,m[w]);for(const w of Object.keys(a))this.addEncoding(w,a[w]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,w){if(w){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};o.CoreMouseService=s=h([f(0,u.IBufferService),f(1,u.ICoreService)],s)},6975:function(C,o,l){var h=this&&this.__decorate||function(s,c,p,w){var y,k=arguments.length,g=k<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,c,p,w);else for(var x=s.length-1;x>=0;x--)(y=s[x])&&(g=(k<3?y(g):k>3?y(c,p,g):y(c,p))||g);return k>3&&g&&Object.defineProperty(c,p,g),g},f=this&&this.__param||function(s,c){return function(p,w){c(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=l(1439),v=l(8460),d=l(844),m=l(2585),_=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=o.CoreService=class extends d.Disposable{constructor(s,c,p){super(),this._bufferService=s,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(s,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((w=>w.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(s))}};o.CoreService=a=h([f(0,m.IBufferService),f(1,m.ILogService),f(2,m.IOptionsService)],a)},9074:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=l(8055),f=l(8460),u=l(844),v=l(6106);let d=0,m=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const c=new n(s);if(c){const p=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,c,p){let w=0,y=0;for(const k of this._decorations.getKeyIterator(c))w=k.options.x??0,y=w+(k.options.width??1),s>=w&&s<y&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,c,p,w){this._decorations.forEachByKey(c,(y=>{d=y.options.x??0,m=d+(y.options.width??1),s>=d&&s<m&&(!p||(y.options.layer??"bottom")===p)&&w(y)}))}}o.DecorationService=_;class n extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=l(2585),f=l(8343);class u{constructor(...d){this._entries=new Map;for(const[m,_]of d)this.set(m,_)}set(d,m){const _=this._entries.get(d);return this._entries.set(d,m),_}forEach(d){for(const[m,_]of this._entries.entries())d(m,_)}has(d){return this._entries.has(d)}get(d){return this._entries.get(d)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(v,d){this._services.set(v,d)}getService(v){return this._services.get(v)}createInstance(v,...d){const m=(0,f.getServiceDependencies)(v).sort(((a,s)=>a.index-s.index)),_=[];for(const a of m){const s=this._services.get(a.id);if(!s)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${a.id}.`);_.push(s)}const n=m.length>0?m[0].index:d.length;if(d.length!==n)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${n+1} conflicts with ${d.length} static arguments`);return new v(...d,..._)}}},7866:function(C,o,l){var h=this&&this.__decorate||function(n,a,s,c){var p,w=arguments.length,y=w<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,a,s,c);else for(var k=n.length-1;k>=0;k--)(p=n[k])&&(y=(w<3?p(y):w>3?p(a,s,y):p(a,s))||y);return w>3&&y&&Object.defineProperty(a,s,y),y},f=this&&this.__param||function(n,a){return function(s,c){a(s,c,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=l(844),v=l(2585),d={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let m,_=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),m=this}_updateLogLevel(){this._logLevel=d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,s){this._evalLazyOptionalParams(s),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...s)}trace(n,...a){var s;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,n,a)}debug(n,...a){var s;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,n,a)}info(n,...a){var s;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,n,a)}warn(n,...a){var s;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,n,a)}error(n,...a){var s;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,n,a)}};o.LogService=_=h([f(0,v.IOptionsService)],_),o.setTraceLogger=function(n){m=n},o.traceCall=function(n,a,s){if(typeof s.value!="function")throw new Error("not supported");const c=s.value;s.value=function(...p){if(m.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,p);m.trace(`GlyphRenderer#${c.name}(${p.map((y=>JSON.stringify(y))).join(", ")})`);const w=c.apply(this,p);return m.trace(`GlyphRenderer#${c.name} return`,w),w}}},7302:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=l(8460),f=l(844),u=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class d extends f.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...o.DEFAULT_OPTIONS};for(const a in _)if(a in n)try{const s=_[a];n[a]=this._sanitizeAndValidateOption(a,s)}catch(s){console.error(s)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,n){return this.onOptionChange((a=>{a===_&&n(this.rawOptions[_])}))}onMultipleOptionChange(_,n){return this.onOptionChange((a=>{_.indexOf(a)!==-1&&n()}))}_setupOptions(){const _=a=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},n=(a,s)=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);s=this._sanitizeAndValidateOption(a,s),this.rawOptions[a]!==s&&(this.rawOptions[a]=s,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const s={get:_.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this.options,a,s)}}_sanitizeAndValidateOption(_,n){switch(_){case"cursorStyle":if(n||(n=o.DEFAULT_OPTIONS[_]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${_}`);break;case"wordSeparator":n||(n=o.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=v.includes(n)?n:o.DEFAULT_OPTIONS[_];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${_} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${_} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}o.OptionsService=d},2660:function(C,o,l){var h=this&&this.__decorate||function(d,m,_,n){var a,s=arguments.length,c=s<3?m:n===null?n=Object.getOwnPropertyDescriptor(m,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(d,m,_,n);else for(var p=d.length-1;p>=0;p--)(a=d[p])&&(c=(s<3?a(c):s>3?a(m,_,c):a(m,_))||c);return s>3&&c&&Object.defineProperty(m,_,c),c},f=this&&this.__param||function(d,m){return function(_,n){m(_,n,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=l(2585);let v=o.OscLinkService=class{constructor(d){this._bufferService=d,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(d){const m=this._bufferService.buffer;if(d.id===void 0){const p=m.addMarker(m.ybase+m.y),w={data:d,id:this._nextId++,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(w,p))),this._dataByLinkId.set(w.id,w),w.id}const _=d,n=this._getEntryIdKey(_),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,m.ybase+m.y),a.id;const s=m.addMarker(m.ybase+m.y),c={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(c,s))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(d,m){const _=this._dataByLinkId.get(d);if(_&&_.lines.every((n=>n.line!==m))){const n=this._bufferService.buffer.addMarker(m);_.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(_,n)))}}getLinkData(d){var m;return(m=this._dataByLinkId.get(d))==null?void 0:m.data}_getEntryIdKey(d){return`${d.id};;${d.uri}`}_removeMarkerFromLink(d,m){const _=d.lines.indexOf(m);_!==-1&&(d.lines.splice(_,1),d.lines.length===0&&(d.data.id!==void 0&&this._entriesWithId.delete(d.key),this._dataByLinkId.delete(d.id)))}};o.OscLinkService=v=h([f(0,u.IBufferService)],v)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(f){return f[h]||[]},o.createDecorator=function(f){if(o.serviceRegistry.has(f))return o.serviceRegistry.get(f);const u=function(v,d,m){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,a){n[l]===n?n[h].push({id:_,index:a}):(n[h]=[{id:_,index:a}],n[l]=n)})(u,v,m)};return u.toString=()=>f,o.serviceRegistry.set(f,u),u}},2585:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=l(8343);var f;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(o.LogLevelEnum=f={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(C,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=l(8460),f=l(225);class u{static extractShouldJoin(d){return(1&d)!=0}static extractWidth(d){return d>>1&3}static extractCharKind(d){return d>>3}static createPropertyValue(d,m,_=!1){return(16777215&d)<<3|(3&m)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new f.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let m=0,_=0;const n=d.length;for(let a=0;a<n;++a){let s=d.charCodeAt(a);if(55296<=s&&s<=56319){if(++a>=n)return m+this.wcwidth(s);const w=d.charCodeAt(a);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:m+=this.wcwidth(w)}const c=this.charProperties(s,_);let p=u.extractWidth(c);u.extractShouldJoin(c)&&(p-=u.extractWidth(_)),m+=p,_=c}return m}charProperties(d,m){return this._activeProvider.charProperties(d,m)}}o.UnicodeService=u}},r={};function S(C){var o=r[C];if(o!==void 0)return o.exports;var l=r[C]={exports:{}};return i[C].call(l.exports,l,l.exports,S),l.exports}var E={};return(()=>{var C=E;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=S(9042),l=S(3236),h=S(844),f=S(5741),u=S(8285),v=S(7975),d=S(7090),m=["cols","rows"];class _ extends h.Disposable{constructor(a){super(),this._core=this.register(new l.Terminal(a)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],c=(p,w)=>{this._checkReadonlyOptions(p),this._core.options[p]=w};for(const p in this._core.options){const w={get:s.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,w)}}_checkReadonlyOptions(a){if(m.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const s in a)this._publicOptions[s]=a[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,s=!0){this._core.input(a,s)}resize(a,s){this._verifyIntegers(a,s),this._core.resize(a,s)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,s,c){this._verifyIntegers(a,s,c),this._core.select(a,s,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,s){this._verifyIntegers(a,s),this._core.selectLines(a,s)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,s){this._core.write(a,s)}writeln(a,s){this._core.write(a),this._core.write(`\r
10
10
  `,s)}paste(a){this._core.paste(a)}refresh(a,s){this._verifyIntegers(a,s),this._core.refresh(a,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return o}_verifyIntegers(...a){for(const s of a)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const s of a)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}C.Terminal=_})(),E})()))})(Ns)),Ns.exports}var sd=id(),Fs={exports:{}},To;function nd(){return To||(To=1,(function(t,e){(function(i,r){t.exports=r()})(self,(()=>(()=>{var i={};return(()=>{var r=i;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(S){this._terminal=S}dispose(){}fit(){const S=this.proposeDimensions();if(!S||!this._terminal||isNaN(S.cols)||isNaN(S.rows))return;const E=this._terminal._core;this._terminal.rows===S.rows&&this._terminal.cols===S.cols||(E._renderService.clear(),this._terminal.resize(S.cols,S.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const S=this._terminal._core,E=S._renderService.dimensions;if(E.css.cell.width===0||E.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:S.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),u=l-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),v=h-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(v/E.css.cell.width)),rows:Math.max(1,Math.floor(u/E.css.cell.height))}}}})(),i})()))})(Fs)),Fs.exports}var od=nd(),Ws={exports:{}},Ro;function ad(){return Ro||(Ro=1,(function(t,e){(function(i,r){t.exports=r()})(self,(()=>(()=>{var i={6:(C,o)=>{function l(f){try{const u=new URL(f),v=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return f.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(f,u,v,d={}){this._terminal=f,this._regex=u,this._handler=v,this._options=d}provideLinks(f,u){const v=h.computeLink(f,this._regex,this._terminal,this._handler);u(this._addCallbacks(v))}_addCallbacks(f){return f.map((u=>(u.leave=this._options.leave,u.hover=(v,d)=>{if(this._options.hover){const{range:m}=u;this._options.hover(v,d,m)}},u)))}};class h{static computeLink(u,v,d,m){const _=new RegExp(v.source,(v.flags||"")+"g"),[n,a]=h._getWindowedLineStrings(u-1,d),s=n.join("");let c;const p=[];for(;c=_.exec(s);){const w=c[0];if(!l(w))continue;const[y,k]=h._mapStrIdx(d,a,0,c.index),[g,x]=h._mapStrIdx(d,y,k,w.length);if(y===-1||k===-1||g===-1||x===-1)continue;const T={start:{x:k+1,y:y+1},end:{x,y:g+1}};p.push({range:T,text:w,activate:m})}return p}static _getWindowedLineStrings(u,v){let d,m=u,_=u,n=0,a="";const s=[];if(d=v.buffer.active.getLine(u)){const c=d.translateToString(!0);if(d.isWrapped&&c[0]!==" "){for(n=0;(d=v.buffer.active.getLine(--m))&&n<2048&&(a=d.translateToString(!0),n+=a.length,s.push(a),d.isWrapped&&a.indexOf(" ")===-1););s.reverse()}for(s.push(c),n=0;(d=v.buffer.active.getLine(++_))&&d.isWrapped&&n<2048&&(a=d.translateToString(!0),n+=a.length,s.push(a),a.indexOf(" ")===-1););}return[s,m]}static _mapStrIdx(u,v,d,m){const _=u.buffer.active,n=_.getNullCell();let a=d;for(;m;){const s=_.getLine(v);if(!s)return[-1,-1];for(let c=a;c<s.length;++c){s.getCell(c,n);const p=n.getChars();if(n.getWidth()&&(m-=p.length||1,c===s.length-1&&p==="")){const w=_.getLine(v+1);w&&w.isWrapped&&(w.getCell(0,n),n.getWidth()===2&&(m+=1))}if(m<0)return[v,c]}v++,a=0}return[v,a]}}o.LinkComputer=h}},r={};function S(C){var o=r[C];if(o!==void 0)return o.exports;var l=r[C]={exports:{}};return i[C](l,l.exports,S),l.exports}var E={};return(()=>{var C=E;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const o=S(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(f,u){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(f=h,u={}){this._handler=f,this._options=u}activate(f){this._terminal=f;const u=this._options,v=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),E})()))})(Ws)),Ws.exports}var ld=ad();async function vt(t,e){const i=await fetch(`/api/${t}`,{headers:{"Content-Type":"application/json"},...e}),r=await i.json();if(!i.ok)throw new Error(r.error||`HTTP ${i.status}`);return r}function cd(){return vt("config")}function hd(t){switch(t){case"creating":case"running":case"starting":return"working";case"idle":return"waiting";case"stopped":return"done";case"error":return"error";default:return"idle"}}function ud(t){return{...t,ciChecks:t.ciChecks.map(e=>({...e})),comments:t.comments.map(e=>({...e}))}}function dd(t){var e;return{branch:t.branch,...t.baseBranch?{baseBranch:t.baseBranch}:{},agent:hd(t.status),mux:t.mux?"✓":"",path:t.path,dir:t.dir,dirty:t.dirty,unpushed:t.unpushed,status:t.status,elapsed:t.elapsed,profile:t.profile,agentName:t.agentName,services:t.services.map(i=>({...i})),paneCount:t.paneCount,prs:t.prs.map(i=>ud(i)),linearIssue:t.linearIssue,creating:t.creation!==null,creationPhase:((e=t.creation)==null?void 0:e.phase)??null}}async function fd(){return(await vt("project")).worktrees.map(e=>dd(e))}async function _d(t={}){const e=new URLSearchParams;t.includeRemote&&e.set("includeRemote","true");const i=e.size>0?`branches?${e.toString()}`:"branches";return(await vt(i)).branches}async function vd(){return(await vt("base-branches")).branches}function pd(t){return vt("worktrees",{method:"POST",body:JSON.stringify({mode:t.mode,...t.branch?{branch:t.branch}:{},...t.baseBranch?{baseBranch:t.baseBranch}:{},profile:t.profile,agent:t.agent,...t.prompt?{prompt:t.prompt}:{},...t.envOverrides&&Object.keys(t.envOverrides).length>0?{envOverrides:t.envOverrides}:{},...t.createLinearTicket?{createLinearTicket:!0}:{},...t.linearTitle?{linearTitle:t.linearTitle}:{}})})}function gd(t){return vt(`worktrees/${encodeURIComponent(t)}`,{method:"DELETE"})}function md(t){return vt(`worktrees/${encodeURIComponent(t)}/open`,{method:"POST"})}function bd(t){return vt(`worktrees/${encodeURIComponent(t)}/close`,{method:"POST"})}function Sd(t){return vt(`worktrees/${encodeURIComponent(t)}/merge`,{method:"POST"})}function wd(){return vt("linear/issues")}function yd(t){return vt("linear/auto-create",{method:"PUT",body:JSON.stringify({enabled:t})})}function Ao(t=!1,e){return vt("pull-main",{method:"POST",body:JSON.stringify({...t?{force:!0}:{},...e?{repo:e}:{}})})}function Cd(t){return vt("github/auto-remove-on-merge",{method:"PUT",body:JSON.stringify({enabled:t})})}async function xd(t){return(await vt(`ci-logs/${t}`)).logs}async function sl(t,e,i){await vt(`worktrees/${encodeURIComponent(t)}/send`,{method:"POST",body:JSON.stringify({text:e,...i?{preamble:i}:{}})})}function Ed(t,e,i){const r=new EventSource("/api/notifications/stream");return r.addEventListener("initial",S=>{try{const E=JSON.parse(S.data);i==null||i(E)}catch{}}),r.addEventListener("notification",S=>{try{const E=JSON.parse(S.data);t(E)}catch{}}),r.addEventListener("dismiss",S=>{try{const{id:E}=JSON.parse(S.data);e(E)}catch{}}),()=>r.close()}async function kd(t){await vt(`notifications/${t}/dismiss`,{method:"POST"})}async function Ld(t,e){const i=new FormData;for(const E of e)i.append("files",E);const r=await fetch(`/api/worktrees/${encodeURIComponent(t)}/upload`,{method:"POST",body:i}),S=await r.json();if(!r.ok)throw new Error(S.error||`HTTP ${r.status}`);return S}function Dd(t){return vt(`worktrees/${encodeURIComponent(t)}/diff`)}var Td=ee('<div class="absolute inset-0 z-10 flex items-center justify-center bg-black/50 border-2 border-dashed border-[var(--color-accent)] rounded pointer-events-none"><span class="text-white text-sm font-medium">Drop image(s) to upload</span></div>'),Rd=ee('<div class="flex-1 min-h-0 w-full p-1 overflow-hidden relative"><!></div>');function Ad(t,e){qe(e,!0);let i=pe(e,"isMobile",3,!1);const r=`\r
11
11
  \x1B[90m[Disconnected]\x1B[0m`,S=`\r
12
- \x1B[32m[Reconnected]\x1B[0m`;let E,C,o=!1,l,h=null,f,u,v=null,d=null,m=null,_=0,n=0,a=!1,s=!1,c=!0,p=se(!1),w=0;function y(M){var X;if((X=navigator.clipboard)!=null&&X.writeText){navigator.clipboard.writeText(M).catch(()=>{});return}const K=document.createElement("textarea");K.value=M,K.style.position="fixed",K.style.opacity="0",document.body.appendChild(K),K.select(),document.execCommand("copy"),document.body.removeChild(K)}function k(M){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"selectPane",pane:M}))}function g(M){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:M}))}function x(){a=!1}function T(){return i()&&!!d&&C.modes.mouseTrackingMode!=="none"}function A(M){if(!T())return;const K=M.touches[0];K&&(_=K.pageX,n=K.pageY,a=!1)}function P(M){const K=M.touches[0];if(!T()||!d||!K)return;const X=_-K.pageX,ce=n-K.pageY;if(_=K.pageX,n=K.pageY,!a){if(Math.abs(ce)<=Math.abs(X))return;a=!0}if(ce===0)return;if(!(d.scrollHeight>d.clientHeight)){B(ce,K),M.preventDefault();return}d.scrollTop+=ce,M.preventDefault()}function B(M,K){if(!v)return;const X=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:K.clientX,clientY:K.clientY,deltaMode:WheelEvent.DOM_DELTA_PIXEL,deltaY:M});v.dispatchEvent(X)}function H(){const M=E.querySelector(".xterm"),K=E.querySelector(".xterm-viewport");!(M instanceof HTMLElement)||!(K instanceof HTMLElement)||(v=M,d=K,M.addEventListener("touchstart",A,{passive:!0}),M.addEventListener("touchmove",P,{passive:!1}),M.addEventListener("touchend",x),M.addEventListener("touchcancel",x),m=()=>{M.removeEventListener("touchstart",A),M.removeEventListener("touchmove",P),M.removeEventListener("touchend",x),M.removeEventListener("touchcancel",x),v=null,d=null})}function W(M){return M?M.types.includes("Files")||M.types.includes("text/uri-list"):!1}function Y(M){W(M.dataTransfer)&&(M.preventDefault(),w++,F(p,!0))}function J(M){b(p)&&(M.preventDefault(),M.dataTransfer&&(M.dataTransfer.dropEffect="copy"))}function Z(M){w--,w<=0&&(w=0,F(p,!1))}function L(M){const K=M.match(/<img[^>]+src=["']([^"']+)["']/i);return K?K[1]:null}async function O(M){var ce,ae,de;M.preventDefault(),M.stopPropagation(),w=0,F(p,!1);const K=M.dataTransfer;if(!K)return;let X=Array.from(K.files).filter(ve=>ve.type.startsWith("image/"));if(X.length===0){const ve=K.getData("text/html"),te=K.getData("text/uri-list"),fe=(ve?L(ve):null)??te;if(fe)try{const ye=fe.match(/^data:(image\/[^;]+);base64,(.+)/);if(ye){const Ee=atob(ye[2]),Ge=new Uint8Array(Ee.length);for(let Ae=0;Ae<Ee.length;Ae++)Ge[Ae]=Ee.charCodeAt(Ae);const Pe=((ce=ye[1].split("/")[1])==null?void 0:ce.replace("+xml",""))||"png";X=[new File([Ge],`image.${Pe}`,{type:ye[1]})]}else if(/^https?:\/\//i.test(fe)){const Ee=await fetch(fe),Ge=Ee.headers.get("content-type")??"",Pe=parseInt(Ee.headers.get("content-length")??"0",10);if(Ee.ok&&Ge.startsWith("image/")&&Pe<=10*1024*1024){const Ae=await Ee.blob(),Xe=((de=(ae=fe.split("/").pop())==null?void 0:ae.split("?")[0])==null?void 0:de.split("#")[0])||"image.png";X=[new File([Ae],Xe,{type:Ae.type})]}}}catch{}}X.length!==0&&await R(X)}async function R(M){try{const X=(await Ld(e.worktree,M)).files.map(ce=>ce.path).join(" ");g(X)}catch(K){const X=K instanceof Error?K.message:String(K);C.writeln(`\r
13
- \x1B[31m[Upload error: ${X}]\x1B[0m`)}}function I(M){const K=M.clipboardData;if(!K)return;const X=[];for(const ce of K.items)if(ce.kind==="file"&&ce.type.startsWith("image/")){const ae=ce.getAsFile();ae&&X.push(ae)}X.length!==0&&(M.preventDefault(),M.stopPropagation(),R(X))}function N(){const M={type:"resize",cols:C.cols,rows:C.rows,...i()&&e.initialPane!==void 0?{initialPane:e.initialPane}:{}};return JSON.stringify(M)}function Q(M=!1){if(s||(h==null?void 0:h.readyState)===WebSocket.OPEN||(h==null?void 0:h.readyState)===WebSocket.CONNECTING)return;const K=location.protocol==="https:"?"wss:":"ws:",X=new WebSocket(`${K}//${location.host}/ws/${encodeURIComponent(e.worktree)}`);h=X,X.onmessage=ce=>{const ae=ce.data,de=ae[0];if(de==="o"||de==="s"){C.write(ae.slice(1));return}try{const ve=JSON.parse(ae);switch(ve.type){case"exit":C.writeln(`\r
12
+ \x1B[32m[Reconnected]\x1B[0m`;let E,C,o=!1,l,h=null,f,u,v=null,d=null,m=null,_=0,n=0,a=!1,s=!1,c=!0,p=se(!1),w=0;function y(B){var X;if((X=navigator.clipboard)!=null&&X.writeText){navigator.clipboard.writeText(B).catch(()=>{});return}const K=document.createElement("textarea");K.value=B,K.style.position="fixed",K.style.opacity="0",document.body.appendChild(K),K.select(),document.execCommand("copy"),document.body.removeChild(K)}function k(B){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"selectPane",pane:B}))}function g(B){(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:B}))}function x(){a=!1}function T(){return i()&&!!d&&C.modes.mouseTrackingMode!=="none"}function A(B){if(!T())return;const K=B.touches[0];K&&(_=K.pageX,n=K.pageY,a=!1)}function P(B){const K=B.touches[0];if(!T()||!d||!K)return;const X=_-K.pageX,he=n-K.pageY;if(_=K.pageX,n=K.pageY,!a){if(Math.abs(he)<=Math.abs(X))return;a=!0}if(he===0)return;if(!(d.scrollHeight>d.clientHeight)){M(he,K),B.preventDefault();return}d.scrollTop+=he,B.preventDefault()}function M(B,K){if(!v)return;const X=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:K.clientX,clientY:K.clientY,deltaMode:WheelEvent.DOM_DELTA_PIXEL,deltaY:B});v.dispatchEvent(X)}function H(){const B=E.querySelector(".xterm"),K=E.querySelector(".xterm-viewport");!(B instanceof HTMLElement)||!(K instanceof HTMLElement)||(v=B,d=K,B.addEventListener("touchstart",A,{passive:!0}),B.addEventListener("touchmove",P,{passive:!1}),B.addEventListener("touchend",x),B.addEventListener("touchcancel",x),m=()=>{B.removeEventListener("touchstart",A),B.removeEventListener("touchmove",P),B.removeEventListener("touchend",x),B.removeEventListener("touchcancel",x),v=null,d=null})}function F(B){return B?B.types.includes("Files")||B.types.includes("text/uri-list"):!1}function Y(B){F(B.dataTransfer)&&(B.preventDefault(),w++,W(p,!0))}function J(B){b(p)&&(B.preventDefault(),B.dataTransfer&&(B.dataTransfer.dropEffect="copy"))}function Z(B){w--,w<=0&&(w=0,W(p,!1))}function L(B){const K=B.match(/<img[^>]+src=["']([^"']+)["']/i);return K?K[1]:null}async function O(B){var he,ae,de;B.preventDefault(),B.stopPropagation(),w=0,W(p,!1);const K=B.dataTransfer;if(!K)return;let X=Array.from(K.files).filter(ve=>ve.type.startsWith("image/"));if(X.length===0){const ve=K.getData("text/html"),te=K.getData("text/uri-list"),fe=(ve?L(ve):null)??te;if(fe)try{const ye=fe.match(/^data:(image\/[^;]+);base64,(.+)/);if(ye){const Ee=atob(ye[2]),Ge=new Uint8Array(Ee.length);for(let Ae=0;Ae<Ee.length;Ae++)Ge[Ae]=Ee.charCodeAt(Ae);const Oe=((he=ye[1].split("/")[1])==null?void 0:he.replace("+xml",""))||"png";X=[new File([Ge],`image.${Oe}`,{type:ye[1]})]}else if(/^https?:\/\//i.test(fe)){const Ee=await fetch(fe),Ge=Ee.headers.get("content-type")??"",Oe=parseInt(Ee.headers.get("content-length")??"0",10);if(Ee.ok&&Ge.startsWith("image/")&&Oe<=10*1024*1024){const Ae=await Ee.blob(),Xe=((de=(ae=fe.split("/").pop())==null?void 0:ae.split("?")[0])==null?void 0:de.split("#")[0])||"image.png";X=[new File([Ae],Xe,{type:Ae.type})]}}}catch{}}X.length!==0&&await R(X)}async function R(B){try{const X=(await Ld(e.worktree,B)).files.map(he=>he.path).join(" ");g(X)}catch(K){const X=K instanceof Error?K.message:String(K);C.writeln(`\r
13
+ \x1B[31m[Upload error: ${X}]\x1B[0m`)}}function I(B){const K=B.clipboardData;if(!K)return;const X=[];for(const he of K.items)if(he.kind==="file"&&he.type.startsWith("image/")){const ae=he.getAsFile();ae&&X.push(ae)}X.length!==0&&(B.preventDefault(),B.stopPropagation(),R(X))}function N(){const B={type:"resize",cols:C.cols,rows:C.rows,...i()&&e.initialPane!==void 0?{initialPane:e.initialPane}:{}};return JSON.stringify(B)}function Q(B=!1){if(s||(h==null?void 0:h.readyState)===WebSocket.OPEN||(h==null?void 0:h.readyState)===WebSocket.CONNECTING)return;const K=location.protocol==="https:"?"wss:":"ws:",X=new WebSocket(`${K}//${location.host}/ws/${encodeURIComponent(e.worktree)}`);h=X,X.onmessage=he=>{const ae=he.data,de=ae[0];if(de==="o"||de==="s"){C.write(ae.slice(1));return}try{const ve=JSON.parse(ae);switch(ve.type){case"exit":C.writeln(`\r
14
14
  \x1B[33m[Process exited with code ${ve.exitCode}]\x1B[0m`);break;case"error":C.writeln(`\r
15
- \x1B[31m[Error: ${ve.message}]\x1B[0m`);break}}catch{}},X.onerror=()=>{},X.onopen=()=>{h===X&&(c=!0,l.fit(),M&&C.writeln(S),requestAnimationFrame(()=>{l.fit(),C.focus()}),X.send(N()))},X.onclose=()=>{h===X&&(h=null,!s&&(C.writeln(r),!document.hidden&&c&&(c=!1,Q(!0))))}}function ie(){document.hidden||Q(!0)}Tn(()=>{C=new sd.Terminal({cursorBlink:!0,theme:e.terminalTheme,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:i()?13:11,scrollback:1e4}),l=new od.FitAddon,C.loadAddon(l),C.loadAddon(new ld.WebLinksAddon),C.open(E),H(),E.addEventListener("contextmenu",M=>M.preventDefault()),E.addEventListener("paste",I,!0),C.parser.registerOscHandler(52,M=>{const K=M.indexOf(";");if(K!==-1){const X=M.slice(K+1);try{y(atob(X))}catch{}}return!0}),C.onSelectionChange(()=>{const M=C.getSelection();M&&y(M)}),C.attachCustomKeyEventHandler(M=>{if(M.key==="Enter"&&M.shiftKey&&!M.ctrlKey&&!M.metaKey&&!M.altKey)return M.type==="keydown"&&(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(M.type!=="keydown")return!0;const K=M.metaKey||M.ctrlKey;return K&&(M.key==="c"||M.key==="C")?C.hasSelection()?(y(C.getSelection()),C.clearSelection(),!1):!0:!(K&&(M.key==="ArrowUp"||M.key==="ArrowDown")||K&&(M.key==="k"||M.key==="K")||K&&(M.key==="m"||M.key==="M")||K&&(M.key==="d"||M.key==="D"))}),requestAnimationFrame(()=>{l.fit(),C.focus()}),Q(),C.onData(M=>{(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:M}))}),f=new ResizeObserver(()=>{clearTimeout(u),u=setTimeout(()=>{l.fit(),(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},150)}),f.observe(E),document.addEventListener("visibilitychange",ie),window.addEventListener("focus",ie),window.addEventListener("online",ie),o=!0}),tt(()=>{o&&e.terminalTheme&&C.options&&(C.options.theme=e.terminalTheme)}),Ah(()=>{s=!0,clearTimeout(u),m==null||m(),f==null||f.disconnect(),E==null||E.removeEventListener("paste",I,!0),document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",ie),window.removeEventListener("online",ie),h==null||h.close(),C==null||C.dispose()});var ue={sendSelectPane:k,sendInput:g},j=Rd(),D=z(j);{var V=M=>{var K=Td();q(M,K)};ne(D,M=>{b(p)&&M(V)})}return Mi(j,M=>E=M,()=>E),wr("dragenter",j,Y),wr("dragover",j,J),wr("dragleave",j,Z),wr("drop",j,O),q(t,j),$e(ue)}var Bd=ee('<dialog><div class="p-6"><!></div></dialog>');function si(t,e){qe(e,!0);let i=pe(e,"wide",3,!1),r=pe(e,"maxWidth",3,""),S=pe(e,"className",3,""),E;tt(()=>{E==null||E.showModal()});var C=Bd();let o;var l=z(C),h=z(l);Dn(h,()=>e.children),Mi(C,f=>E=f,()=>E),le(()=>{Re(C,1,`bg-sidebar text-primary border border-edge rounded-xl w-[90%] ${r()?"":i()?"max-w-[560px]":"max-w-[380px]"} ${S()??""}`),o=Qt(C,"",o,{"max-width":r()||void 0})}),wr("close",C,function(...f){var u;(u=e.onclose)==null||u.apply(this,f)}),ge("click",C,f=>{f.target===E&&E.close()}),q(t,C),$e()}bt(["click"]);var Md=ee('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),Od=ee('<span class="spinner"></span>'),Pd=ee("<!> ",1),Id=ee('<form><h2 class="text-base mb-4">Confirm</h2> <p class="text-[13px] text-muted mb-6"> </p> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function Ji(t,e){qe(e,!0);let i=pe(e,"loading",3,!1),r=pe(e,"error",3,""),S=pe(e,"confirmLabel",3,"Remove"),E=pe(e,"variant",3,"danger");si(t,{get onclose(){return e.oncancel},children:(C,o)=>{var l=Id(),h=$(z(l),2),f=z(h),u=$(h,2);{var v=n=>{var a=Md(),s=z(a);le(()=>oe(s,r())),q(n,a)};ne(u,n=>{r()&&n(v)})}var d=$(u,2),m=z(d);_t(m,{type:"button",get onclick(){return e.oncancel},get disabled(){return i()},children:(n,a)=>{var s=Ye("Cancel");q(n,s)},$$slots:{default:!0}});var _=$(m,2);{let n=he(()=>E()==="accent"?"cta":"danger");_t(_,{type:"submit",get variant(){return b(n)},class:"flex items-center gap-1.5",get disabled(){return i()},autofocus:!0,children:(a,s)=>{var c=Pd(),p=Fe(c);{var w=k=>{var g=Od();q(k,g)};ne(p,k=>{i()&&k(w)})}var y=$(p);le(()=>oe(y,` ${S()??""}`)),q(a,c)},$$slots:{default:!0}})}le(()=>oe(f,e.message)),wr("submit",l,n=>{n.preventDefault(),e.onconfirm()}),q(C,l)},$$slots:{default:!0}}),$e()}var Hd=ee('<button type="button" role="switch"><span class="knob svelte-1ljwtyv"></span></button>');function Oi(t,e){qe(e,!0);let i=pe(e,"checked",15,!1),r=pe(e,"disabled",3,!1),S=pe(e,"size",3,"default"),E=pe(e,"preventMouseFocus",3,!1);var C=Hd();let o;le(()=>{xe(C,"aria-checked",i()),xe(C,"aria-label",e["aria-label"]),xe(C,"id",e.id),C.disabled=r(),o=Re(C,1,"toggle svelte-1ljwtyv",null,o,{on:i(),sm:S()==="sm"})}),ge("mousedown",C,l=>{E()&&l.preventDefault()}),ge("click",C,()=>{var l;i(!i()),(l=e.ontoggle)==null||l.call(e,i())}),q(t,C),$e()}bt(["mousedown","click"]);var Nd=ee("<span>Loading...</span>"),Fd=ee("<span>Load failed</span>"),Wd=ee("<span> </span>"),Ud=ee('<span class="shrink-0 text-[10px] text-warning">Updating...</span>'),jd=ee('<span class="shrink-0 text-[10px] text-danger">Update failed</span>'),zd=ee('<div class="flex items-center gap-1.5 shrink-0"><button type="button" class="text-[10px] text-muted hover:text-primary transition-colors"> </button> <!></div>'),Kd=ee('<p class="px-3 py-2 text-xs text-muted">Loading branches...</p>'),Vd=ee('<p class="px-3 py-2 text-xs text-muted"> </p>'),qd=ee('<p class="px-3 py-2 text-xs text-muted">No matching branches</p>'),$d=ee('<span class="text-[10px] text-accent">Selected</span>'),Gd=ee('<li><button type="button"><span class="font-mono text-primary"> </span> <!></button></li>'),Xd=ee('<ul class="max-h-48 overflow-y-auto py-1"></ul>'),Yd=ee('<div class="mt-2 rounded-lg border border-edge bg-surface/60"><div class="border-b border-edge p-2"><input type="text" class="w-full rounded-md border border-edge bg-surface px-2.5 py-1.5 text-[12px] text-primary placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Search branches..."/></div> <div class="border-b border-edge px-3 py-2 text-[11px] text-muted flex items-center justify-between gap-3"><div class="min-w-0 flex items-center gap-2"><!> <!></div> <!></div> <!></div>'),Jd=ee('<div><span class="block text-xs text-muted mb-1.5"> </span> <button type="button" class="flex w-full items-center justify-between gap-3 rounded-md border border-edge bg-surface px-2.5 py-1.5 text-left text-[13px] text-primary outline-none transition-colors hover:bg-hover focus:border-accent"><span> </span> <span class="text-[11px] text-muted"> </span></button> <!></div>');function Bo(t,e){qe(e,!0);let i=pe(e,"selected",3,""),r=pe(e,"branches",19,()=>[]),S=pe(e,"loading",3,!1),E=pe(e,"error",3,null),C=pe(e,"placeholder",3,"Select a branch"),o=pe(e,"initialOpen",3,!1),l=pe(e,"inlineToggleChecked",3,!1),h=se(!1),f=se(""),u=se(void 0),v=se(void 0),d=se(!1),m=se(!1),_=he(()=>b(f).trim()?r().filter(J=>un(b(f),J.name)):r());tt(()=>{!o()||b(d)||(F(d,!0),F(h,!0))}),tt(()=>{!b(h)||b(m)||(F(m,!0),n())});function n(){queueMicrotask(()=>{var J;return(J=b(v))==null?void 0:J.focus()})}function a(){F(h,!1),F(f,""),F(m,!1)}function s(){if(b(h)){a();return}F(h,!0)}function c(J){e.onselect(J),a()}function p(J){var L;const Z=J.relatedTarget;Z instanceof Node&&((L=b(u))!=null&&L.contains(Z))||a()}function w(){var J;(J=e.oninlinetoggle)==null||J.call(e)}function y(J,Z){function L(O){Z&&O.preventDefault()}return J.addEventListener("mousedown",L),{update(O){Z=O},destroy(){J.removeEventListener("mousedown",L)}}}var k=Jd(),g=z(k),x=z(g),T=$(g,2),A=z(T),P=z(A),B=$(A,2),H=z(B),W=$(T,2);{var Y=J=>{var Z=Yd(),L=z(Z),O=z(L);Mi(O,te=>F(v,te),()=>b(v));var R=$(L,2),I=z(R),N=z(I);{var Q=te=>{var fe=Nd();q(te,fe)},ie=te=>{var fe=Fd();q(te,fe)},ue=te=>{var fe=Wd(),ye=z(fe);le(()=>oe(ye,`${(b(_).length!==r().length?`${b(_).length}/${r().length}`:r().length)??""}
16
- available`)),q(te,fe)};ne(N,te=>{S()&&b(_).length===0?te(Q):E()&&b(_).length===0?te(ie,1):te(ue,-1)})}var j=$(N,2);{var D=te=>{var fe=Ud();q(te,fe)},V=te=>{var fe=jd();q(te,fe)};ne(j,te=>{S()&&b(_).length>0?te(D):E()&&b(_).length>0&&te(V,1)})}var M=$(I,2);{var K=te=>{var fe=zd(),ye=z(fe),Ee=z(ye),Ge=$(ye,2);{let Pe=he(()=>e.inlineToggleAriaLabel??e.inlineToggleLabel);Oi(Ge,{get checked(){return l()},size:"sm",preventMouseFocus:!0,get"aria-label"(){return b(Pe)},ontoggle:w})}le(()=>oe(Ee,e.inlineToggleLabel)),ge("mousedown",ye,Pe=>Pe.preventDefault()),ge("click",ye,w),q(te,fe)};ne(M,te=>{e.inlineToggleLabel&&e.oninlinetoggle&&te(K)})}za(R,(te,fe)=>y==null?void 0:y(te,fe),()=>!!e.oninlinetoggle);var X=$(R,2);{var ce=te=>{var fe=Kd();q(te,fe)},ae=te=>{var fe=Vd(),ye=z(fe);le(()=>oe(ye,`Failed to load branches: ${E()??""}`)),q(te,fe)},de=te=>{var fe=qd();q(te,fe)},ve=te=>{var fe=Xd();Je(fe,21,()=>b(_),ye=>ye.name,(ye,Ee)=>{var Ge=Gd(),Pe=z(Ge),Ae=z(Pe),Xe=z(Ae),je=$(Ae,2);{var pt=gt=>{var St=$d();q(gt,St)};ne(je,gt=>{i()===b(Ee).name&&gt(pt)})}le(()=>{Re(Pe,1,`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-[12px] transition-colors hover:bg-hover
17
- ${i()===b(Ee).name?"bg-accent/10":""}`),oe(Xe,b(Ee).name)}),ge("mousedown",Pe,gt=>gt.preventDefault()),ge("click",Pe,()=>c(b(Ee).name)),q(ye,Ge)}),q(te,fe)};ne(X,te=>{S()&&b(_).length===0?te(ce):E()&&b(_).length===0?te(ae,1):b(_).length===0?te(de,2):te(ve,-1)})}le(()=>xe(O,"aria-label",`${e.label} search`)),ge("keydown",O,te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),b(_)[0]&&c(b(_)[0].name)),te.key==="Escape"&&(te.preventDefault(),a())}),Jr(O,()=>b(f),te=>F(f,te)),q(J,Z)};ne(W,J=>{b(h)&&J(Y)})}Mi(k,J=>F(u,J),()=>b(u)),le(()=>{oe(x,e.label),xe(T,"aria-label",e.label),xe(T,"aria-expanded",b(h)),Re(A,1,bs(i()?"font-mono":"text-muted/50")),oe(P,i()||C()),oe(H,b(h)?"▴":"▾")}),ge("focusout",k,p),ge("click",T,s),q(t,k),$e()}bt(["focusout","click","keydown","mousedown"]);var Zd=ee('<div class="mb-3"><label class="flex items-center gap-2 text-xs text-muted cursor-pointer"><!> </label></div>'),Qd=ee('<div class="mb-3"><label class="block text-xs text-muted mb-1.5"> </label> <input type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/></div>'),ef=ee('<div class="mb-4"><p class="text-xs text-muted mb-2">Startup Environment <span class="opacity-60">(optional)</span></p> <div class="pl-3 border-l border-edge"></div></div>');function tf(t,e){qe(e,!0);let i=pe(e,"startupEnvs",19,()=>({})),r=pe(e,"envValues",31,()=>Oe({})),S=he(()=>Object.keys(i()));var E=Et(),C=Fe(E);{var o=l=>{var h=ef(),f=$(z(h),2);Je(f,20,()=>b(S),u=>u,(u,v)=>{var d=Et(),m=Fe(d);{var _=a=>{var s=Zd(),c=z(s),p=z(c),w=()=>r()[v],y=g=>r(r()[v]=g,!0);Oi(p,{get"aria-label"(){return v},get checked(){return w()},set checked(g){y(g)}});var k=$(p);le(()=>oe(k,` ${v??""}`)),q(a,s)},n=a=>{var s=Qd(),c=z(s),p=z(c),w=$(c,2);le(()=>{xe(c,"for",`wt-env-${v??""}`),oe(p,v),xe(w,"id",`wt-env-${v??""}`)}),Jr(w,()=>r()[v],y=>r(r()[v]=y,!0)),q(a,s)};ne(m,a=>{typeof i()[v]=="boolean"?a(_):a(n,-1)})}q(u,d)}),q(l,h)};ne(C,l=>{b(S).length>0&&l(o)})}q(t,E),$e()}var rf=ee('<p class="mt-2 text-[11px] text-muted">The worktree branch will use the Linear ticket branch name.</p>'),sf=ee('<p class="mt-2 text-[11px] text-muted">Creates paired <span class="font-mono">claude-...</span> and <span class="font-mono">codex-...</span> branches from this task name.</p>'),nf=ee('<button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use existing branch</button>'),of=ee('<label class="block text-xs text-muted mb-1.5" for="wt-name">Branch name <span class="opacity-60">(optional)</span></label> <input id="wt-name" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/> <!>',1),af=ee('<!> <button type="button" class="mt-2 text-[11px] text-accent hover:underline">Create new branch instead</button> <p class="mt-2 text-[11px] text-muted">Removing this worktree will also delete the branch.</p>',1),lf=ee('<button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use project default branch instead</button>'),cf=ee('<div class="mb-4"><!> <!></div>'),hf=ee('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),uf=ee('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),df=ee('<div class="flex flex-col gap-2 mb-6"></div>'),ff=ee('<div class="mt-3"><label class="block text-xs text-muted mb-1.5" for="wt-linear-title">Linear ticket title <span class="opacity-60">(optional)</span></label> <input id="wt-linear-title" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Defaults to the first non-empty line of the prompt"/></div>'),_f=ee('<div class="mb-4 rounded-lg border border-edge bg-surface/40 p-3"><div class="flex items-start justify-between gap-3"><div><p class="text-[13px] text-primary">Create Linear ticket</p> <p class="mt-1 text-[11px] text-muted">Creates the ticket first, uses the prompt as the ticket description, and uses the ticket branch name for the worktree.</p></div> <!></div> <!></div>'),vf=ee('<form><h2 class="text-base mb-4">New Worktree</h2> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-prompt">Prompt <span class="opacity-60"> </span></label> <textarea id="wt-prompt" rows="4" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent resize-y"></textarea></div> <div class="mb-4"><!></div> <!> <!> <div class="flex gap-2 mb-4"></div> <!> <label class="flex items-center gap-2 mb-4 text-[13px] text-muted cursor-pointer"><input type="checkbox" class="accent-[var(--accent)]"/> Save as default</label> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function pf(t,e){qe(e,!0);let i=pe(e,"profiles",19,()=>[]),r=pe(e,"defaultProfileName",3,""),S=pe(e,"autoNameEnabled",3,!1),E=pe(e,"initialBranch",3,""),C=pe(e,"initialPrompt",3,""),o=pe(e,"availableBranches",19,()=>[]),l=pe(e,"availableBranchesLoading",3,!1),h=pe(e,"availableBranchesError",3,null),f=pe(e,"baseBranches",19,()=>[]),u=pe(e,"baseBranchesLoading",3,!1),v=pe(e,"baseBranchesError",3,null),d=pe(e,"includeRemoteBranches",15,!1),m=pe(e,"startupEnvs",19,()=>({})),_=pe(e,"linearCreateTicketOption",3,!1),n=pe(e,"openedFromLinearIssue",3,!1);const a=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"both",label:"Both"}],s="wt-default-profile",c="wt-default-agent",p="wt-default-envs",w=localStorage.getItem(s),y=localStorage.getItem(c),k=localStorage.getItem(p);let g=he(()=>{var M;return r()||((M=i()[0])==null?void 0:M.name)||"default"}),x=se("new"),T=se(Oe(E())),A=se(Oe(C())),P=se(""),B=se(""),H=se(Oe(y==="codex"||y==="both"?y:"claude")),W=se(Oe(w??"")),Y=se(!1),J=se("");const Z=w!=null||y!=null||k!=null;let L=se(Oe(Z));function O(){if(!k)return{...m()};try{const M=JSON.parse(k),K=Object.fromEntries(Object.entries(M).filter(([X])=>X in m()));return{...m(),...K}}catch{return{...m()}}}let R=se(Oe(O()));function I(M){M.focus()}let N=he(()=>_()&&!n()&&b(x)==="new"),Q=he(()=>b(H)==="both"),ie=he(()=>b(N)&&b(Y)),ue=he(()=>(b(x)==="new"||b(P).length>0)&&(!b(ie)||b(A).trim().length>0));tt(()=>{i().some(M=>M.name===b(W))||F(W,b(g),!0)}),tt(()=>{b(N)||(F(Y,!1),F(J,""))}),tt(()=>{b(Q)&&b(x)==="existing"&&(F(x,"new"),F(P,""))});function j(M){F(P,M,!0)}function D(){F(x,"existing"),!b(P)&&E().trim().length>0&&F(P,E().trim(),!0)}function V(){F(x,"new")}si(t,{get onclose(){return e.oncancel},className:"md:max-w-[440px]",children:(M,K)=>{var X=vf(),ce=$(z(X),2),ae=z(ce),de=$(z(ae)),ve=z(de),te=$(ae,2);za(te,Ce=>I==null?void 0:I(Ce)),ji(()=>Jr(te,()=>b(A),Ce=>F(A,Ce)));var fe=$(ce,2),ye=z(fe);{var Ee=Ce=>{var Be=of(),We=$(Fe(Be),2),Se=$(We,2);{var Ue=ht=>{var yt=rf();q(ht,yt)},Ve=ht=>{var yt=sf();q(ht,yt)},at=ht=>{var yt=nf();ge("click",yt,D),q(ht,yt)};ne(Se,ht=>{b(Y)?ht(Ue):b(Q)?ht(Ve,1):ht(at,-1)})}le(()=>{xe(We,"placeholder",b(Y)?"Generated from the Linear ticket":S()?"generated from prompt if empty":"auto-generated if empty"),We.disabled=b(Y)}),Jr(We,()=>b(T),ht=>F(T,ht)),q(Ce,Be)},Ge=Ce=>{var Be=af(),We=Fe(Be);Bo(We,{label:"Existing branch",get selected(){return b(P)},get branches(){return o()},get loading(){return l()},get error(){return h()},placeholder:"Select a branch",initialOpen:!0,inlineToggleLabel:"include remote",inlineToggleAriaLabel:"Include remote branches",get inlineToggleChecked(){return d()},oninlinetoggle:()=>d(!d()),onselect:j});var Se=$(We,2);ge("click",Se,V),q(Ce,Be)};ne(ye,Ce=>{b(x)==="new"?Ce(Ee):Ce(Ge,-1)})}var Pe=$(fe,2);{var Ae=Ce=>{var Be=cf(),We=z(Be);Bo(We,{label:"Base branch",get selected(){return b(B)},get branches(){return f()},get loading(){return u()},get error(){return v()},placeholder:"Project main branch (default)",onselect:Ve=>F(B,Ve,!0)});var Se=$(We,2);{var Ue=Ve=>{var at=lf();ge("click",at,()=>F(B,"")),q(Ve,at)};ne(Se,Ve=>{b(B)&&Ve(Ue)})}q(Ce,Be)};ne(Pe,Ce=>{b(x)==="new"&&Ce(Ae)})}var Xe=$(Pe,2);tf(Xe,{get startupEnvs(){return m()},get envValues(){return b(R)},set envValues(Ce){F(R,Ce,!0)}});var je=$(Xe,2);Je(je,21,()=>a,Bi,(Ce,Be)=>{var We=hf(),Se=z(We),Ue=$(Se);le(()=>{Re(We,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
18
- ${b(H)===b(Be).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),yo(Se,b(Be).value),ln(Se,b(H)===b(Be).value),oe(Ue,` ${b(Be).label??""}`)}),ge("change",Se,()=>F(H,b(Be).value,!0)),q(Ce,We)});var pt=$(je,2);{var gt=Ce=>{var Be=df();Je(Be,21,i,Bi,(We,Se)=>{var Ue=uf(),Ve=z(Ue),at=$(Ve);le(()=>{Re(Ue,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
19
- ${b(W)===b(Se).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),yo(Ve,b(Se).name),ln(Ve,b(W)===b(Se).name),oe(at,` ${b(Se).name??""}`)}),ge("change",Ve,()=>F(W,b(Se).name,!0)),q(We,Ue)}),q(Ce,Be)};ne(pt,Ce=>{i().length>1&&Ce(gt)})}var St=$(pt,2),Dr=z(St),wt=$(St,2);{var Vt=Ce=>{var Be=_f(),We=z(Be),Se=$(z(We),2);Oi(Se,{"aria-label":"Create Linear ticket",get checked(){return b(Y)},set checked(at){F(Y,at,!0)}});var Ue=$(We,2);{var Ve=at=>{var ht=ff(),yt=$(z(ht),2);Jr(yt,()=>b(J),_r=>F(J,_r)),q(at,ht)};ne(Ue,at=>{b(Y)&&at(Ve)})}q(Ce,Be)};ne(wt,Ce=>{b(N)&&Ce(Vt)})}var Ne=$(wt,2),Rt=z(Ne);_t(Rt,{type:"button",get onclick(){return e.oncancel},children:(Ce,Be)=>{var We=Ye("Cancel");q(Ce,We)},$$slots:{default:!0}});var Ur=$(Rt,2);{let Ce=he(()=>!b(ue));_t(Ur,{type:"submit",variant:"cta",get disabled(){return b(Ce)},children:(Be,We)=>{var Se=Ye("Create");q(Be,Se)},$$slots:{default:!0}})}le(()=>{oe(ve,`(${b(ie)?"required":"optional"})`),xe(te,"placeholder",b(Y)?"Describe the task for the agent. This will also be used as the Linear ticket description...":"Describe the task for the agent...")}),wr("submit",X,Ce=>{if(Ce.preventDefault(),!b(ue))return;b(L)?(localStorage.setItem(s,b(W)),localStorage.setItem(c,b(H)),localStorage.setItem(p,JSON.stringify(b(R)))):(localStorage.removeItem(s),localStorage.removeItem(c),localStorage.removeItem(p));const Be={};for(const[Ue,Ve]of Object.entries(b(R)))typeof Ve=="boolean"?Ve&&(Be[Ue]="true"):Ve&&(Be[Ue]=Ve);const We=b(A).trim(),Se=b(x)==="existing"?b(P):b(T).trim();e.oncreate({mode:b(x),...Se&&!(b(x)==="new"&&b(Y))?{branch:Se}:{},...b(x)==="new"&&b(B)?{baseBranch:b(B)}:{},profile:b(W),agent:b(H),...We?{prompt:We}:{},...Object.keys(Be).length>0?{envOverrides:Be}:{},...b(Y)?{createLinearTicket:!0}:{},...b(Y)&&b(J).trim()?{linearTitle:b(J).trim()}:{}})}),ge("keydown",te,Ce=>{var Be;Ce.key==="Enter"&&!Ce.shiftKey&&(Ce.preventDefault(),(Be=Ce.currentTarget.form)==null||Be.requestSubmit())}),Gh(Dr,()=>b(L),Ce=>F(L,Ce)),q(M,X)},$$slots:{default:!0}}),$e()}bt(["keydown","click","change"]);var gf=ee('<span class="w-3 h-3 rounded-full border border-edge"></span>'),mf=ee('<button type="button"><span class="shrink-0 flex gap-0.5"></span> <span> </span></button>'),bf=ee('<form><h2 class="text-base mb-4">Settings</h2> <div class="mb-5"><span class="block text-xs text-muted mb-2">Theme</span> <div class="grid grid-cols-2 gap-2"></div></div> <div class="mb-5"><span class="block text-xs text-muted mb-2">Linear</span> <div class="flex items-center justify-between gap-3 px-3 py-2 rounded-md border border-edge bg-surface"><div><span class="text-[13px] text-primary">Auto-create worktrees</span> <p class="text-[11px] text-muted mt-0.5">Automatically create worktrees for Todo Linear tickets with the "webmux" label.</p></div> <!></div></div> <div class="mb-5"><span class="block text-xs text-muted mb-2">GitHub</span> <div class="flex items-center justify-between gap-3 px-3 py-2 rounded-md border border-edge bg-surface"><div><span class="text-[13px] text-primary">Auto-remove on merge</span> <p class="text-[11px] text-muted mt-0.5">Automatically remove worktrees when their PR is merged on GitHub.</p></div> <!></div></div> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="ssh-host">SSH Host <span class="opacity-60">(for "Open in Cursor")</span></label> <input id="ssh-host" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="e.g. devbox or 10.0.0.5"/> <p class="text-[11px] text-muted mt-1.5">Must match an entry in your local <code class="text-accent/80">~/.ssh/config</code>. Leave empty for local mode.</p></div> <div class="flex justify-end gap-2"><!> <!></div></form>');function Sf(t,e){qe(e,!0);const i=e.linearAutoCreate;let r=se(Oe(localStorage.getItem(ss)??"")),S=se(Oe(i)),E=se(!1),C=i;const o=e.autoRemoveOnMerge;let l=se(Oe(o)),h=se(!1),f=o;tt(()=>{if(b(S)===C)return;const d=b(S);C=d,F(E,!0),yd(d).then(m=>{F(S,m.enabled,!0),C=m.enabled,e.onlinearautocreatechange(m.enabled)}).catch(()=>{F(S,!d),C=!d}).finally(()=>{F(E,!1)})}),tt(()=>{if(b(l)===f)return;const d=b(l);f=d,F(h,!0),Cd(d).then(m=>{F(l,m.enabled,!0),f=m.enabled,e.onautoremovechange(m.enabled)}).catch(()=>{F(l,!d),f=!d}).finally(()=>{F(h,!1)})});function u(){const d=b(r).trim();d?localStorage.setItem(ss,d):localStorage.removeItem(ss),e.onsave(d)}function v(d){Qa(d),e.onthemechange(d)}si(t,{get onclose(){return e.onclose},wide:!0,children:(d,m)=>{var _=bf(),n=$(z(_),2),a=$(z(n),2);Je(a,21,()=>cn,B=>B.key,(B,H)=>{var W=mf(),Y=z(W);Je(Y,21,()=>[b(H).colors.surface,b(H).colors.accent,b(H).colors.success,b(H).colors.warning],Bi,(L,O)=>{var R=gf();le(()=>Qt(R,`background:${b(O)??""}`)),q(L,R)});var J=$(Y,2),Z=z(J);le(()=>{Re(W,1,`flex items-center gap-2.5 px-3 py-2 rounded-md border cursor-pointer text-left text-[13px] transition-colors ${e.currentTheme===b(H).key?"border-accent bg-active text-primary":"border-edge bg-surface text-muted hover:bg-hover hover:text-primary"}`),oe(Z,b(H).label)}),ge("click",W,()=>v(b(H).key)),q(B,W)});var s=$(n,2),c=$(z(s),2),p=$(z(c),2);Oi(p,{get disabled(){return b(E)},"aria-label":"Auto-create worktrees for Linear tickets",get checked(){return b(S)},set checked(B){F(S,B,!0)}});var w=$(s,2),y=$(z(w),2),k=$(z(y),2);Oi(k,{get disabled(){return b(h)},"aria-label":"Auto-remove worktrees on PR merge",get checked(){return b(l)},set checked(B){F(l,B,!0)}});var g=$(w,2),x=$(z(g),2),T=$(g,2),A=z(T);_t(A,{type:"button",get onclick(){return e.onclose},children:(B,H)=>{var W=Ye("Cancel");q(B,W)},$$slots:{default:!0}});var P=$(A,2);_t(P,{type:"submit",variant:"cta",children:(B,H)=>{var W=Ye("Save");q(B,W)},$$slots:{default:!0}}),wr("submit",_,B=>{B.preventDefault(),u()}),Jr(x,()=>b(r),B=>F(r,B)),q(d,_)},$$slots:{default:!0}}),$e()}bt(["click"]);function wf(t){return t.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function nl(t,e=3e4){const r=wf(t).replace(/\r\n/g,`
15
+ \x1B[31m[Error: ${ve.message}]\x1B[0m`);break}}catch{}},X.onerror=()=>{},X.onopen=()=>{h===X&&(c=!0,l.fit(),B&&C.writeln(S),requestAnimationFrame(()=>{l.fit(),C.focus()}),X.send(N()))},X.onclose=()=>{h===X&&(h=null,!s&&(C.writeln(r),!document.hidden&&c&&(c=!1,Q(!0))))}}function ie(){document.hidden||Q(!0)}Tn(()=>{C=new sd.Terminal({cursorBlink:!0,theme:e.terminalTheme,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:i()?13:11,scrollback:1e4}),l=new od.FitAddon,C.loadAddon(l),C.loadAddon(new ld.WebLinksAddon),C.open(E),H(),E.addEventListener("contextmenu",B=>B.preventDefault()),E.addEventListener("paste",I,!0),C.parser.registerOscHandler(52,B=>{const K=B.indexOf(";");if(K!==-1){const X=B.slice(K+1);try{y(atob(X))}catch{}}return!0}),C.onSelectionChange(()=>{const B=C.getSelection();B&&y(B)}),C.attachCustomKeyEventHandler(B=>{if(B.key==="Enter"&&B.shiftKey&&!B.ctrlKey&&!B.metaKey&&!B.altKey)return B.type==="keydown"&&(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(B.type!=="keydown")return!0;const K=B.metaKey||B.ctrlKey;return K&&(B.key==="c"||B.key==="C")?C.hasSelection()?(y(C.getSelection()),C.clearSelection(),!1):!0:!(K&&(B.key==="ArrowUp"||B.key==="ArrowDown")||K&&(B.key==="k"||B.key==="K")||K&&(B.key==="m"||B.key==="M")||K&&(B.key==="d"||B.key==="D"))}),requestAnimationFrame(()=>{l.fit(),C.focus()}),Q(),C.onData(B=>{(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"input",data:B}))}),f=new ResizeObserver(()=>{clearTimeout(u),u=setTimeout(()=>{l.fit(),(h==null?void 0:h.readyState)===WebSocket.OPEN&&h.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},150)}),f.observe(E),document.addEventListener("visibilitychange",ie),window.addEventListener("focus",ie),window.addEventListener("online",ie),o=!0}),lt(()=>{o&&e.terminalTheme&&C.options&&(C.options.theme=e.terminalTheme)}),Ah(()=>{s=!0,clearTimeout(u),m==null||m(),f==null||f.disconnect(),E==null||E.removeEventListener("paste",I,!0),document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",ie),window.removeEventListener("online",ie),h==null||h.close(),C==null||C.dispose()});var ue={sendSelectPane:k,sendInput:g},j=Rd(),D=z(j);{var V=B=>{var K=Td();q(B,K)};ne(D,B=>{b(p)&&B(V)})}return Mi(j,B=>E=B,()=>E),wr("dragenter",j,Y),wr("dragover",j,J),wr("dragleave",j,Z),wr("drop",j,O),q(t,j),$e(ue)}var Bd=ee('<dialog><div class="p-6"><!></div></dialog>');function si(t,e){qe(e,!0);let i=pe(e,"wide",3,!1),r=pe(e,"maxWidth",3,""),S=pe(e,"className",3,""),E;lt(()=>{E==null||E.showModal()});var C=Bd();let o;var l=z(C),h=z(l);Dn(h,()=>e.children),Mi(C,f=>E=f,()=>E),ce(()=>{Re(C,1,`bg-sidebar text-primary border border-edge rounded-xl w-[90%] ${r()?"":i()?"max-w-[560px]":"max-w-[380px]"} ${S()??""}`),o=Qt(C,"",o,{"max-width":r()||void 0})}),wr("close",C,function(...f){var u;(u=e.onclose)==null||u.apply(this,f)}),ge("click",C,f=>{f.target===E&&E.close()}),q(t,C),$e()}bt(["click"]);var Md=ee('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),Od=ee('<span class="spinner"></span>'),Pd=ee("<!> ",1),Id=ee('<form><h2 class="text-base mb-4">Confirm</h2> <p class="text-[13px] text-muted mb-6"> </p> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function Ji(t,e){qe(e,!0);let i=pe(e,"loading",3,!1),r=pe(e,"error",3,""),S=pe(e,"confirmLabel",3,"Remove"),E=pe(e,"variant",3,"danger");si(t,{get onclose(){return e.oncancel},children:(C,o)=>{var l=Id(),h=$(z(l),2),f=z(h),u=$(h,2);{var v=n=>{var a=Md(),s=z(a);ce(()=>oe(s,r())),q(n,a)};ne(u,n=>{r()&&n(v)})}var d=$(u,2),m=z(d);_t(m,{type:"button",get onclick(){return e.oncancel},get disabled(){return i()},children:(n,a)=>{var s=Ye("Cancel");q(n,s)},$$slots:{default:!0}});var _=$(m,2);{let n=le(()=>E()==="accent"?"cta":"danger");_t(_,{type:"submit",get variant(){return b(n)},class:"flex items-center gap-1.5",get disabled(){return i()},autofocus:!0,children:(a,s)=>{var c=Pd(),p=Fe(c);{var w=k=>{var g=Od();q(k,g)};ne(p,k=>{i()&&k(w)})}var y=$(p);ce(()=>oe(y,` ${S()??""}`)),q(a,c)},$$slots:{default:!0}})}ce(()=>oe(f,e.message)),wr("submit",l,n=>{n.preventDefault(),e.onconfirm()}),q(C,l)},$$slots:{default:!0}}),$e()}var Hd=ee('<button type="button" role="switch"><span class="knob svelte-1ljwtyv"></span></button>');function Oi(t,e){qe(e,!0);let i=pe(e,"checked",15,!1),r=pe(e,"disabled",3,!1),S=pe(e,"size",3,"default"),E=pe(e,"preventMouseFocus",3,!1);var C=Hd();let o;ce(()=>{xe(C,"aria-checked",i()),xe(C,"aria-label",e["aria-label"]),xe(C,"id",e.id),C.disabled=r(),o=Re(C,1,"toggle svelte-1ljwtyv",null,o,{on:i(),sm:S()==="sm"})}),ge("mousedown",C,l=>{E()&&l.preventDefault()}),ge("click",C,()=>{var l;i(!i()),(l=e.ontoggle)==null||l.call(e,i())}),q(t,C),$e()}bt(["mousedown","click"]);var Nd=ee("<span>Loading...</span>"),Fd=ee("<span>Load failed</span>"),Wd=ee("<span> </span>"),Ud=ee('<span class="shrink-0 text-[10px] text-warning">Updating...</span>'),jd=ee('<span class="shrink-0 text-[10px] text-danger">Update failed</span>'),zd=ee('<div class="flex items-center gap-1.5 shrink-0"><button type="button" class="text-[10px] text-muted hover:text-primary transition-colors"> </button> <!></div>'),Kd=ee('<p class="px-3 py-2 text-xs text-muted">Loading branches...</p>'),Vd=ee('<p class="px-3 py-2 text-xs text-muted"> </p>'),qd=ee('<p class="px-3 py-2 text-xs text-muted">No matching branches</p>'),$d=ee('<span class="text-[10px] text-accent">Selected</span>'),Gd=ee('<li><button type="button"><span class="font-mono text-primary"> </span> <!></button></li>'),Xd=ee('<ul class="max-h-48 overflow-y-auto py-1"></ul>'),Yd=ee('<div class="mt-2 rounded-lg border border-edge bg-surface/60"><div class="border-b border-edge p-2"><input type="text" class="w-full rounded-md border border-edge bg-surface px-2.5 py-1.5 text-[12px] text-primary placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Search branches..."/></div> <div class="border-b border-edge px-3 py-2 text-[11px] text-muted flex items-center justify-between gap-3"><div class="min-w-0 flex items-center gap-2"><!> <!></div> <!></div> <!></div>'),Jd=ee('<div><span class="block text-xs text-muted mb-1.5"> </span> <button type="button" class="flex w-full items-center justify-between gap-3 rounded-md border border-edge bg-surface px-2.5 py-1.5 text-left text-[13px] text-primary outline-none transition-colors hover:bg-hover focus:border-accent"><span> </span> <span class="text-[11px] text-muted"> </span></button> <!></div>');function Bo(t,e){qe(e,!0);let i=pe(e,"selected",3,""),r=pe(e,"branches",19,()=>[]),S=pe(e,"loading",3,!1),E=pe(e,"error",3,null),C=pe(e,"placeholder",3,"Select a branch"),o=pe(e,"initialOpen",3,!1),l=pe(e,"inlineToggleChecked",3,!1),h=se(!1),f=se(""),u=se(void 0),v=se(void 0),d=se(!1),m=se(!1),_=le(()=>b(f).trim()?r().filter(J=>un(b(f),J.name)):r());lt(()=>{!o()||b(d)||(W(d,!0),W(h,!0))}),lt(()=>{!b(h)||b(m)||(W(m,!0),n())});function n(){queueMicrotask(()=>{var J;return(J=b(v))==null?void 0:J.focus()})}function a(){W(h,!1),W(f,""),W(m,!1)}function s(){if(b(h)){a();return}W(h,!0)}function c(J){e.onselect(J),a()}function p(J){var L;const Z=J.relatedTarget;Z instanceof Node&&((L=b(u))!=null&&L.contains(Z))||a()}function w(){var J;(J=e.oninlinetoggle)==null||J.call(e)}function y(J,Z){function L(O){Z&&O.preventDefault()}return J.addEventListener("mousedown",L),{update(O){Z=O},destroy(){J.removeEventListener("mousedown",L)}}}var k=Jd(),g=z(k),x=z(g),T=$(g,2),A=z(T),P=z(A),M=$(A,2),H=z(M),F=$(T,2);{var Y=J=>{var Z=Yd(),L=z(Z),O=z(L);Mi(O,te=>W(v,te),()=>b(v));var R=$(L,2),I=z(R),N=z(I);{var Q=te=>{var fe=Nd();q(te,fe)},ie=te=>{var fe=Fd();q(te,fe)},ue=te=>{var fe=Wd(),ye=z(fe);ce(()=>oe(ye,`${(b(_).length!==r().length?`${b(_).length}/${r().length}`:r().length)??""}
16
+ available`)),q(te,fe)};ne(N,te=>{S()&&b(_).length===0?te(Q):E()&&b(_).length===0?te(ie,1):te(ue,-1)})}var j=$(N,2);{var D=te=>{var fe=Ud();q(te,fe)},V=te=>{var fe=jd();q(te,fe)};ne(j,te=>{S()&&b(_).length>0?te(D):E()&&b(_).length>0&&te(V,1)})}var B=$(I,2);{var K=te=>{var fe=zd(),ye=z(fe),Ee=z(ye),Ge=$(ye,2);{let Oe=le(()=>e.inlineToggleAriaLabel??e.inlineToggleLabel);Oi(Ge,{get checked(){return l()},size:"sm",preventMouseFocus:!0,get"aria-label"(){return b(Oe)},ontoggle:w})}ce(()=>oe(Ee,e.inlineToggleLabel)),ge("mousedown",ye,Oe=>Oe.preventDefault()),ge("click",ye,w),q(te,fe)};ne(B,te=>{e.inlineToggleLabel&&e.oninlinetoggle&&te(K)})}za(R,(te,fe)=>y==null?void 0:y(te,fe),()=>!!e.oninlinetoggle);var X=$(R,2);{var he=te=>{var fe=Kd();q(te,fe)},ae=te=>{var fe=Vd(),ye=z(fe);ce(()=>oe(ye,`Failed to load branches: ${E()??""}`)),q(te,fe)},de=te=>{var fe=qd();q(te,fe)},ve=te=>{var fe=Xd();Je(fe,21,()=>b(_),ye=>ye.name,(ye,Ee)=>{var Ge=Gd(),Oe=z(Ge),Ae=z(Oe),Xe=z(Ae),je=$(Ae,2);{var pt=gt=>{var St=$d();q(gt,St)};ne(je,gt=>{i()===b(Ee).name&&gt(pt)})}ce(()=>{Re(Oe,1,`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-[12px] transition-colors hover:bg-hover
17
+ ${i()===b(Ee).name?"bg-accent/10":""}`),oe(Xe,b(Ee).name)}),ge("mousedown",Oe,gt=>gt.preventDefault()),ge("click",Oe,()=>c(b(Ee).name)),q(ye,Ge)}),q(te,fe)};ne(X,te=>{S()&&b(_).length===0?te(he):E()&&b(_).length===0?te(ae,1):b(_).length===0?te(de,2):te(ve,-1)})}ce(()=>xe(O,"aria-label",`${e.label} search`)),ge("keydown",O,te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),b(_)[0]&&c(b(_)[0].name)),te.key==="Escape"&&(te.preventDefault(),a())}),Jr(O,()=>b(f),te=>W(f,te)),q(J,Z)};ne(F,J=>{b(h)&&J(Y)})}Mi(k,J=>W(u,J),()=>b(u)),ce(()=>{oe(x,e.label),xe(T,"aria-label",e.label),xe(T,"aria-expanded",b(h)),Re(A,1,bs(i()?"font-mono":"text-muted/50")),oe(P,i()||C()),oe(H,b(h)?"▴":"▾")}),ge("focusout",k,p),ge("click",T,s),q(t,k),$e()}bt(["focusout","click","keydown","mousedown"]);var Zd=ee('<div class="mb-3"><label class="flex items-center gap-2 text-xs text-muted cursor-pointer"><!> </label></div>'),Qd=ee('<div class="mb-3"><label class="block text-xs text-muted mb-1.5"> </label> <input type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/></div>'),ef=ee('<div class="mb-4"><p class="text-xs text-muted mb-2">Startup Environment <span class="opacity-60">(optional)</span></p> <div class="pl-3 border-l border-edge"></div></div>');function tf(t,e){qe(e,!0);let i=pe(e,"startupEnvs",19,()=>({})),r=pe(e,"envValues",31,()=>Pe({})),S=le(()=>Object.keys(i()));var E=Et(),C=Fe(E);{var o=l=>{var h=ef(),f=$(z(h),2);Je(f,20,()=>b(S),u=>u,(u,v)=>{var d=Et(),m=Fe(d);{var _=a=>{var s=Zd(),c=z(s),p=z(c),w=()=>r()[v],y=g=>r(r()[v]=g,!0);Oi(p,{get"aria-label"(){return v},get checked(){return w()},set checked(g){y(g)}});var k=$(p);ce(()=>oe(k,` ${v??""}`)),q(a,s)},n=a=>{var s=Qd(),c=z(s),p=z(c),w=$(c,2);ce(()=>{xe(c,"for",`wt-env-${v??""}`),oe(p,v),xe(w,"id",`wt-env-${v??""}`)}),Jr(w,()=>r()[v],y=>r(r()[v]=y,!0)),q(a,s)};ne(m,a=>{typeof i()[v]=="boolean"?a(_):a(n,-1)})}q(u,d)}),q(l,h)};ne(C,l=>{b(S).length>0&&l(o)})}q(t,E),$e()}var rf=ee('<p class="mt-2 text-[11px] text-muted">The worktree branch will use the Linear ticket branch name.</p>'),sf=ee('<p class="mt-2 text-[11px] text-muted">Creates paired <span class="font-mono">claude-...</span> and <span class="font-mono">codex-...</span> branches from this task name.</p>'),nf=ee('<button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use existing branch</button>'),of=ee('<label class="block text-xs text-muted mb-1.5" for="wt-name">Branch name <span class="opacity-60">(optional)</span></label> <input id="wt-name" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/> <!>',1),af=ee('<!> <button type="button" class="mt-2 text-[11px] text-accent hover:underline">Create new branch instead</button> <p class="mt-2 text-[11px] text-muted">Removing this worktree will also delete the branch.</p>',1),lf=ee('<button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use project default branch instead</button>'),cf=ee('<div class="mb-4"><!> <!></div>'),hf=ee('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),uf=ee('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),df=ee('<div class="flex flex-col gap-2 mb-6"></div>'),ff=ee('<div class="mt-3"><label class="block text-xs text-muted mb-1.5" for="wt-linear-title">Linear ticket title <span class="opacity-60">(optional)</span></label> <input id="wt-linear-title" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Defaults to the first non-empty line of the prompt"/></div>'),_f=ee('<div class="mb-4 rounded-lg border border-edge bg-surface/40 p-3"><div class="flex items-start justify-between gap-3"><div><p class="text-[13px] text-primary">Create Linear ticket</p> <p class="mt-1 text-[11px] text-muted">Creates the ticket first, uses the prompt as the ticket description, and uses the ticket branch name for the worktree.</p></div> <!></div> <!></div>'),vf=ee('<form><h2 class="text-base mb-4">New Worktree</h2> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-prompt">Prompt <span class="opacity-60"> </span></label> <textarea id="wt-prompt" rows="4" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent resize-y"></textarea></div> <div class="mb-4"><!></div> <!> <!> <div class="flex gap-2 mb-4"></div> <!> <label class="flex items-center gap-2 mb-4 text-[13px] text-muted cursor-pointer"><input type="checkbox" class="accent-[var(--accent)]"/> Save as default</label> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function pf(t,e){qe(e,!0);let i=pe(e,"profiles",19,()=>[]),r=pe(e,"defaultProfileName",3,""),S=pe(e,"autoNameEnabled",3,!1),E=pe(e,"initialBranch",3,""),C=pe(e,"initialPrompt",3,""),o=pe(e,"availableBranches",19,()=>[]),l=pe(e,"availableBranchesLoading",3,!1),h=pe(e,"availableBranchesError",3,null),f=pe(e,"baseBranches",19,()=>[]),u=pe(e,"baseBranchesLoading",3,!1),v=pe(e,"baseBranchesError",3,null),d=pe(e,"includeRemoteBranches",15,!1),m=pe(e,"startupEnvs",19,()=>({})),_=pe(e,"linearCreateTicketOption",3,!1),n=pe(e,"openedFromLinearIssue",3,!1);const a=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"both",label:"Both"}],s="wt-default-profile",c="wt-default-agent",p="wt-default-envs",w=localStorage.getItem(s),y=localStorage.getItem(c),k=localStorage.getItem(p);let g=le(()=>{var B;return r()||((B=i()[0])==null?void 0:B.name)||"default"}),x=se("new"),T=se(Pe(E())),A=se(Pe(C())),P=se(""),M=se(""),H=se(Pe(y==="codex"||y==="both"?y:"claude")),F=se(Pe(w??"")),Y=se(!1),J=se("");const Z=w!=null||y!=null||k!=null;let L=se(Pe(Z));function O(){if(!k)return{...m()};try{const B=JSON.parse(k),K=Object.fromEntries(Object.entries(B).filter(([X])=>X in m()));return{...m(),...K}}catch{return{...m()}}}let R=se(Pe(O()));function I(B){B.focus()}let N=le(()=>_()&&!n()&&b(x)==="new"),Q=le(()=>b(H)==="both"),ie=le(()=>b(N)&&b(Y)),ue=le(()=>(b(x)==="new"||b(P).length>0)&&(!b(ie)||b(A).trim().length>0));lt(()=>{i().some(B=>B.name===b(F))||W(F,b(g),!0)}),lt(()=>{b(N)||(W(Y,!1),W(J,""))}),lt(()=>{b(Q)&&b(x)==="existing"&&(W(x,"new"),W(P,""))});function j(B){W(P,B,!0)}function D(){W(x,"existing"),!b(P)&&E().trim().length>0&&W(P,E().trim(),!0)}function V(){W(x,"new")}si(t,{get onclose(){return e.oncancel},className:"md:max-w-[440px]",children:(B,K)=>{var X=vf(),he=$(z(X),2),ae=z(he),de=$(z(ae)),ve=z(de),te=$(ae,2);za(te,Ce=>I==null?void 0:I(Ce)),ji(()=>Jr(te,()=>b(A),Ce=>W(A,Ce)));var fe=$(he,2),ye=z(fe);{var Ee=Ce=>{var Be=of(),We=$(Fe(Be),2),Se=$(We,2);{var Ue=ht=>{var yt=rf();q(ht,yt)},Ve=ht=>{var yt=sf();q(ht,yt)},ot=ht=>{var yt=nf();ge("click",yt,D),q(ht,yt)};ne(Se,ht=>{b(Y)?ht(Ue):b(Q)?ht(Ve,1):ht(ot,-1)})}ce(()=>{xe(We,"placeholder",b(Y)?"Generated from the Linear ticket":S()?"generated from prompt if empty":"auto-generated if empty"),We.disabled=b(Y)}),Jr(We,()=>b(T),ht=>W(T,ht)),q(Ce,Be)},Ge=Ce=>{var Be=af(),We=Fe(Be);Bo(We,{label:"Existing branch",get selected(){return b(P)},get branches(){return o()},get loading(){return l()},get error(){return h()},placeholder:"Select a branch",initialOpen:!0,inlineToggleLabel:"include remote",inlineToggleAriaLabel:"Include remote branches",get inlineToggleChecked(){return d()},oninlinetoggle:()=>d(!d()),onselect:j});var Se=$(We,2);ge("click",Se,V),q(Ce,Be)};ne(ye,Ce=>{b(x)==="new"?Ce(Ee):Ce(Ge,-1)})}var Oe=$(fe,2);{var Ae=Ce=>{var Be=cf(),We=z(Be);Bo(We,{label:"Base branch",get selected(){return b(M)},get branches(){return f()},get loading(){return u()},get error(){return v()},placeholder:"Project main branch (default)",onselect:Ve=>W(M,Ve,!0)});var Se=$(We,2);{var Ue=Ve=>{var ot=lf();ge("click",ot,()=>W(M,"")),q(Ve,ot)};ne(Se,Ve=>{b(M)&&Ve(Ue)})}q(Ce,Be)};ne(Oe,Ce=>{b(x)==="new"&&Ce(Ae)})}var Xe=$(Oe,2);tf(Xe,{get startupEnvs(){return m()},get envValues(){return b(R)},set envValues(Ce){W(R,Ce,!0)}});var je=$(Xe,2);Je(je,21,()=>a,Bi,(Ce,Be)=>{var We=hf(),Se=z(We),Ue=$(Se);ce(()=>{Re(We,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
18
+ ${b(H)===b(Be).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),yo(Se,b(Be).value),ln(Se,b(H)===b(Be).value),oe(Ue,` ${b(Be).label??""}`)}),ge("change",Se,()=>W(H,b(Be).value,!0)),q(Ce,We)});var pt=$(je,2);{var gt=Ce=>{var Be=df();Je(Be,21,i,Bi,(We,Se)=>{var Ue=uf(),Ve=z(Ue),ot=$(Ve);ce(()=>{Re(Ue,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
19
+ ${b(F)===b(Se).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),yo(Ve,b(Se).name),ln(Ve,b(F)===b(Se).name),oe(ot,` ${b(Se).name??""}`)}),ge("change",Ve,()=>W(F,b(Se).name,!0)),q(We,Ue)}),q(Ce,Be)};ne(pt,Ce=>{i().length>1&&Ce(gt)})}var St=$(pt,2),Dr=z(St),wt=$(St,2);{var Vt=Ce=>{var Be=_f(),We=z(Be),Se=$(z(We),2);Oi(Se,{"aria-label":"Create Linear ticket",get checked(){return b(Y)},set checked(ot){W(Y,ot,!0)}});var Ue=$(We,2);{var Ve=ot=>{var ht=ff(),yt=$(z(ht),2);Jr(yt,()=>b(J),_r=>W(J,_r)),q(ot,ht)};ne(Ue,ot=>{b(Y)&&ot(Ve)})}q(Ce,Be)};ne(wt,Ce=>{b(N)&&Ce(Vt)})}var Ne=$(wt,2),Rt=z(Ne);_t(Rt,{type:"button",get onclick(){return e.oncancel},children:(Ce,Be)=>{var We=Ye("Cancel");q(Ce,We)},$$slots:{default:!0}});var Ur=$(Rt,2);{let Ce=le(()=>!b(ue));_t(Ur,{type:"submit",variant:"cta",get disabled(){return b(Ce)},children:(Be,We)=>{var Se=Ye("Create");q(Be,Se)},$$slots:{default:!0}})}ce(()=>{oe(ve,`(${b(ie)?"required":"optional"})`),xe(te,"placeholder",b(Y)?"Describe the task for the agent. This will also be used as the Linear ticket description...":"Describe the task for the agent...")}),wr("submit",X,Ce=>{if(Ce.preventDefault(),!b(ue))return;b(L)?(localStorage.setItem(s,b(F)),localStorage.setItem(c,b(H)),localStorage.setItem(p,JSON.stringify(b(R)))):(localStorage.removeItem(s),localStorage.removeItem(c),localStorage.removeItem(p));const Be={};for(const[Ue,Ve]of Object.entries(b(R)))typeof Ve=="boolean"?Ve&&(Be[Ue]="true"):Ve&&(Be[Ue]=Ve);const We=b(A).trim(),Se=b(x)==="existing"?b(P):b(T).trim();e.oncreate({mode:b(x),...Se&&!(b(x)==="new"&&b(Y))?{branch:Se}:{},...b(x)==="new"&&b(M)?{baseBranch:b(M)}:{},profile:b(F),agent:b(H),...We?{prompt:We}:{},...Object.keys(Be).length>0?{envOverrides:Be}:{},...b(Y)?{createLinearTicket:!0}:{},...b(Y)&&b(J).trim()?{linearTitle:b(J).trim()}:{}})}),ge("keydown",te,Ce=>{var Be;Ce.key==="Enter"&&!Ce.shiftKey&&(Ce.preventDefault(),(Be=Ce.currentTarget.form)==null||Be.requestSubmit())}),Gh(Dr,()=>b(L),Ce=>W(L,Ce)),q(B,X)},$$slots:{default:!0}}),$e()}bt(["keydown","click","change"]);var gf=ee('<span class="w-3 h-3 rounded-full border border-edge"></span>'),mf=ee('<button type="button"><span class="shrink-0 flex gap-0.5"></span> <span> </span></button>'),bf=ee('<form><h2 class="text-base mb-4">Settings</h2> <div class="mb-5"><span class="block text-xs text-muted mb-2">Theme</span> <div class="grid grid-cols-2 gap-2"></div></div> <div class="mb-5"><span class="block text-xs text-muted mb-2">Linear</span> <div class="flex items-center justify-between gap-3 px-3 py-2 rounded-md border border-edge bg-surface"><div><span class="text-[13px] text-primary">Auto-create worktrees</span> <p class="text-[11px] text-muted mt-0.5">Automatically create worktrees for Todo Linear tickets with the "webmux" label.</p></div> <!></div></div> <div class="mb-5"><span class="block text-xs text-muted mb-2">GitHub</span> <div class="flex items-center justify-between gap-3 px-3 py-2 rounded-md border border-edge bg-surface"><div><span class="text-[13px] text-primary">Auto-remove on merge</span> <p class="text-[11px] text-muted mt-0.5">Automatically remove worktrees when their PR is merged on GitHub.</p></div> <!></div></div> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="ssh-host">SSH Host <span class="opacity-60">(for "Open in Cursor")</span></label> <input id="ssh-host" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="e.g. devbox or 10.0.0.5"/> <p class="text-[11px] text-muted mt-1.5">Must match an entry in your local <code class="text-accent/80">~/.ssh/config</code>. Leave empty for local mode.</p></div> <div class="flex justify-end gap-2"><!> <!></div></form>');function Sf(t,e){qe(e,!0);let i=se(Pe(localStorage.getItem(ss)??"")),r=se(null),S=le(()=>b(r)??e.linearAutoCreate),E=se(!1),C=se(null),o=le(()=>b(C)??e.autoRemoveOnMerge),l=se(!1);function h(d){W(r,d,!0),W(E,!0),yd(d).then(m=>{e.onlinearautocreatechange(m.enabled)}).finally(()=>{W(r,null),W(E,!1)})}function f(d){W(C,d,!0),W(l,!0),Cd(d).then(m=>{e.onautoremovechange(m.enabled)}).finally(()=>{W(C,null),W(l,!1)})}function u(){const d=b(i).trim();d?localStorage.setItem(ss,d):localStorage.removeItem(ss),e.onsave(d)}function v(d){Qa(d),e.onthemechange(d)}si(t,{get onclose(){return e.onclose},wide:!0,children:(d,m)=>{var _=bf(),n=$(z(_),2),a=$(z(n),2);Je(a,21,()=>cn,M=>M.key,(M,H)=>{var F=mf(),Y=z(F);Je(Y,21,()=>[b(H).colors.surface,b(H).colors.accent,b(H).colors.success,b(H).colors.warning],Bi,(L,O)=>{var R=gf();ce(()=>Qt(R,`background:${b(O)??""}`)),q(L,R)});var J=$(Y,2),Z=z(J);ce(()=>{Re(F,1,`flex items-center gap-2.5 px-3 py-2 rounded-md border cursor-pointer text-left text-[13px] transition-colors ${e.currentTheme===b(H).key?"border-accent bg-active text-primary":"border-edge bg-surface text-muted hover:bg-hover hover:text-primary"}`),oe(Z,b(H).label)}),ge("click",F,()=>v(b(H).key)),q(M,F)});var s=$(n,2),c=$(z(s),2),p=$(z(c),2);Oi(p,{get checked(){return b(S)},get disabled(){return b(E)},ontoggle:h,"aria-label":"Auto-create worktrees for Linear tickets"});var w=$(s,2),y=$(z(w),2),k=$(z(y),2);Oi(k,{get checked(){return b(o)},get disabled(){return b(l)},ontoggle:f,"aria-label":"Auto-remove worktrees on PR merge"});var g=$(w,2),x=$(z(g),2),T=$(g,2),A=z(T);_t(A,{type:"button",get onclick(){return e.onclose},children:(M,H)=>{var F=Ye("Cancel");q(M,F)},$$slots:{default:!0}});var P=$(A,2);_t(P,{type:"submit",variant:"cta",children:(M,H)=>{var F=Ye("Save");q(M,F)},$$slots:{default:!0}}),wr("submit",_,M=>{M.preventDefault(),u()}),Jr(x,()=>b(i),M=>W(i,M)),q(d,_)},$$slots:{default:!0}}),$e()}bt(["click"]);function wf(t){return t.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function nl(t,e=3e4){const r=wf(t).replace(/\r\n/g,`
20
20
  `).replace(/\r/g,`
21
21
  `).replace(/[^\x09\x0A\x20-\x7E]/g,"");return r.length>e?`[... truncated]
22
- `+r.slice(-e):r}var yf=ee("<button><!></button>");function ns(t,e){let i=Xa(e,["$$slots","$$events","$$legacy","children"]);var r=yf();$a(r,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",...i}));var S=z(r);Dn(S,()=>e.children),q(t,r)}var Cf=ee('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub &nearr;</a>'),xf=ee('<div class="text-[12px] text-muted py-2 mt-2">Loading logs...</div>'),Ef=ee('<div class="mt-2"><pre class="bg-surface border border-edge rounded-md p-3 text-[11px] font-mono overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap m-0"> </pre> <div class="flex justify-end items-center gap-2 mt-1.5"><!> <!></div></div>'),kf=ee('<div class="text-[12px] text-danger py-2 mt-2"> </div>'),Lf=ee('<div class="text-[12px] text-danger py-1.5"> </div>'),Df=ee('<li class="rounded-md border border-edge bg-surface p-3"><div class="flex items-center gap-2"><span> </span> <span class="text-[13px] font-medium flex-1 truncate"> </span> <span> </span></div> <div class="flex items-center gap-2 mt-1.5"><!> <!></div> <!> <!> <!></li>'),Tf=ee('<h2 class="text-base mb-4"> </h2> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4"></ul> <div class="flex justify-end"><!></div>',1);function Rf(t,e){qe(e,!0);let i=se(Oe(new Map)),r=se(Oe(new Set)),S=se(null),E=se(""),C=se(!1),o=se(!1),l=se(""),h=he(()=>ws(e.pr));function f(s){return`${s.name}:${s.runId}`}function u(s){if(s.runId===null)return"";const c=b(i).get(s.runId);if(!c)return"";const p=s.name+" ";return c.split(`
22
+ `+r.slice(-e):r}var yf=ee("<button><!></button>");function ns(t,e){let i=Xa(e,["$$slots","$$events","$$legacy","children"]);var r=yf();$a(r,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",...i}));var S=z(r);Dn(S,()=>e.children),q(t,r)}var Cf=ee('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub &nearr;</a>'),xf=ee('<div class="text-[12px] text-muted py-2 mt-2">Loading logs...</div>'),Ef=ee('<div class="mt-2"><pre class="bg-surface border border-edge rounded-md p-3 text-[11px] font-mono overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap m-0"> </pre> <div class="flex justify-end items-center gap-2 mt-1.5"><!> <!></div></div>'),kf=ee('<div class="text-[12px] text-danger py-2 mt-2"> </div>'),Lf=ee('<div class="text-[12px] text-danger py-1.5"> </div>'),Df=ee('<li class="rounded-md border border-edge bg-surface p-3"><div class="flex items-center gap-2"><span> </span> <span class="text-[13px] font-medium flex-1 truncate"> </span> <span> </span></div> <div class="flex items-center gap-2 mt-1.5"><!> <!></div> <!> <!> <!></li>'),Tf=ee('<h2 class="text-base mb-4"> </h2> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4"></ul> <div class="flex justify-end"><!></div>',1);function Rf(t,e){qe(e,!0);let i=se(Pe(new Map)),r=se(Pe(new Set)),S=se(null),E=se(""),C=se(!1),o=se(!1),l=se(""),h=le(()=>ws(e.pr));function f(s){return`${s.name}:${s.runId}`}function u(s){if(s.runId===null)return"";const c=b(i).get(s.runId);if(!c)return"";const p=s.name+" ";return c.split(`
23
23
  `).filter(w=>w.startsWith(p)).map(w=>w.slice(p.length)).join(`
24
- `)}function v(s){b(r).has(s)?b(r).delete(s):b(r).add(s),F(r,new Set(b(r)),!0)}async function d(s){const c=f(s);if(b(i).has(s.runId)){v(c);return}b(r).add(c),F(r,new Set(b(r)),!0),F(E,""),F(S,s.runId,!0);try{const p=await xd(s.runId);b(i).set(s.runId,p),F(i,new Map(b(i)),!0)}catch(p){F(E,Ht(p),!0),b(r).delete(c),F(r,new Set(b(r)),!0)}finally{F(S,null)}}async function m(s,c){if(!e.branch)return;F(l,""),F(o,!0);const p=["Fix the failing CI check.",`PR: ${b(h)}`,`Check: ${s}`,"","Logs:"].join(`
24
+ `)}function v(s){b(r).has(s)?b(r).delete(s):b(r).add(s),W(r,new Set(b(r)),!0)}async function d(s){const c=f(s);if(b(i).has(s.runId)){v(c);return}b(r).add(c),W(r,new Set(b(r)),!0),W(E,""),W(S,s.runId,!0);try{const p=await xd(s.runId);b(i).set(s.runId,p),W(i,new Map(b(i)),!0)}catch(p){W(E,Ht(p),!0),b(r).delete(c),W(r,new Set(b(r)),!0)}finally{W(S,null)}}async function m(s,c){if(!e.branch)return;W(l,""),W(o,!0);const p=["Fix the failing CI check.",`PR: ${b(h)}`,`Check: ${s}`,"","Logs:"].join(`
25
25
  `)+`
26
- `,w=nl(c);try{await sl(e.branch,w,p),e.onfixsuccess()}catch(y){F(l,Ht(y),!0)}finally{F(o,!1)}}async function _(s){await navigator.clipboard.writeText(s),F(C,!0),setTimeout(()=>{F(C,!1)},2e3)}function n(s){return s==="success"?"✓":s==="failed"?"✗":s==="skipped"?"—":"○"}function a(s){return s==="success"?"text-success":s==="failed"?"text-danger":s==="pending"?"text-warning":"text-muted"}si(t,{get onclose(){return e.onclose},wide:!0,children:(s,c)=>{var p=Tf(),w=Fe(p),y=z(w),k=$(w,2);Je(k,21,()=>e.pr.ciChecks,T=>T.name+T.runId,(T,A)=>{const P=he(()=>f(b(A))),B=he(()=>b(A).runId!==null&&b(i).has(b(A).runId)),H=he(()=>b(r).has(b(P))),W=he(()=>b(H)?u(b(A)):"");var Y=Df(),J=z(Y),Z=z(J),L=z(Z),O=$(Z,2),R=z(O),I=$(O,2),N=z(I),Q=$(J,2),ie=z(Q);{var ue=te=>{var fe=Et(),ye=Fe(fe);{var Ee=Pe=>{ns(Pe,{onclick:()=>v(b(P)),children:(Ae,Xe)=>{var je=Ye();le(()=>oe(je,b(H)?"Hide logs":"Show logs")),q(Ae,je)},$$slots:{default:!0}})},Ge=Pe=>{ns(Pe,{onclick:()=>d({runId:b(A).runId,name:b(A).name}),children:(Ae,Xe)=>{var je=Ye("View logs");q(Ae,je)},$$slots:{default:!0}})};ne(ye,Pe=>{b(B)?Pe(Ee):Pe(Ge,-1)})}q(te,fe)};ne(ie,te=>{b(A).status==="failed"&&b(A).runId!==null&&te(ue)})}var j=$(ie,2);{var D=te=>{var fe=Cf();le(()=>xe(fe,"href",b(A).url)),q(te,fe)};ne(j,te=>{b(A).url&&te(D)})}var V=$(Q,2);{var M=te=>{var fe=xf();q(te,fe)},K=te=>{var fe=Ef(),ye=z(fe),Ee=z(ye),Ge=$(ye,2),Pe=z(Ge);ns(Pe,{onclick:()=>_(b(W)),children:(Xe,je)=>{var pt=Ye();le(()=>oe(pt,b(C)?"Copied!":"Copy logs")),q(Xe,pt)},$$slots:{default:!0}});var Ae=$(Pe,2);{let Xe=he(()=>!e.branch||b(o));_t(Ae,{variant:"cta",small:!0,get disabled(){return b(Xe)},onclick:()=>m(b(A).name,b(W)),children:(je,pt)=>{var gt=Ye();le(()=>oe(gt,b(o)?"Asking agent...":"Ask agent to fix")),q(je,gt)},$$slots:{default:!0}})}le(()=>oe(Ee,b(W))),q(te,fe)};ne(V,te=>{b(A).runId!==null&&b(S)===b(A).runId&&b(H)?te(M):b(H)&&b(W)&&te(K,1)})}var X=$(V,2);{var ce=te=>{var fe=kf(),ye=z(fe);le(()=>oe(ye,b(E))),q(te,fe)},ae=he(()=>b(E)&&b(S)===null&&b(A).runId!==null&&!b(i).has(b(A).runId));ne(X,te=>{b(ae)&&te(ce)})}var de=$(X,2);{var ve=te=>{var fe=Lf(),ye=z(fe);le(()=>oe(ye,b(l))),q(te,fe)};ne(de,te=>{b(l)&&te(ve)})}le((te,fe,ye)=>{Re(Z,1,`text-sm font-bold ${te??""}`),oe(L,fe),oe(R,b(A).name),Re(I,1,`text-[11px] ${ye??""}`),oe(N,b(A).status)},[()=>a(b(A).status),()=>n(b(A).status),()=>a(b(A).status)]),q(T,Y)});var g=$(k,2),x=z(g);_t(x,{type:"button",get onclick(){return e.onclose},children:(T,A)=>{var P=Ye("Close");q(T,P)},$$slots:{default:!0}}),le(()=>oe(y,`CI Checks — ${b(h)??""}`)),q(s,p)},$$slots:{default:!0}}),$e()}var Af=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],Bf=["difference","intersection","symmetricDifference","union"],Mo=!1,vi,Yt,Or,us,wi,ol,al;const ds=class ds extends Set{constructor(i){super();we(this,wi);we(this,vi,new Map);we(this,Yt,se(0));we(this,Or,se(0));we(this,us,Er||-1);if(i){for(var r of i)super.add(r);G(this,Or).v=super.size}Mo||ze(this,wi,al).call(this)}has(i){var r=super.has(i),S=G(this,vi),E=S.get(i);if(E===void 0){if(!r)return b(G(this,Yt)),!1;E=ze(this,wi,ol).call(this,!0),S.set(i,E)}return b(E),r}add(i){return super.has(i)||(super.add(i),F(G(this,Or),super.size),Nr(G(this,Yt))),this}delete(i){var r=super.delete(i),S=G(this,vi),E=S.get(i);return E!==void 0&&(S.delete(i),F(E,!1)),r&&(F(G(this,Or),super.size),Nr(G(this,Yt))),r}clear(){if(super.size!==0){super.clear();var i=G(this,vi);for(var r of i.values())F(r,!1);i.clear(),F(G(this,Or),0),Nr(G(this,Yt))}}keys(){return this.values()}values(){return b(G(this,Yt)),super.values()}entries(){return b(G(this,Yt)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return b(G(this,Or))}};vi=new WeakMap,Yt=new WeakMap,Or=new WeakMap,us=new WeakMap,wi=new WeakSet,ol=function(i){return Er===G(this,us)?se(i):Fr(i)},al=function(){Mo=!0;var i=ds.prototype,r=Set.prototype;for(const S of Af)i[S]=function(...E){return b(G(this,Yt)),r[S].apply(this,E)};for(const S of Bf)i[S]=function(...E){b(G(this,Yt));var C=r[S].apply(this,E);return new ds(C)}};let dn=ds;var Mf=ee('<span class="text-muted ml-1">(reply)</span>'),Of=ee('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),Pf=ee('<span class="text-accent/60 ml-1">review</span>'),If=ee('<li class="rounded-md border border-edge bg-surface p-3"><label class="flex items-start gap-2 cursor-pointer"><input type="checkbox" class="mt-0.5 accent-accent"/> <div class="flex-1 min-w-0"><!> <div class="text-[12px] text-muted mb-1"><span class="font-medium text-primary"> </span> <!></div> <pre class="text-[11px] font-mono whitespace-pre-wrap m-0 text-primary/80"> </pre></div></label></li>'),Hf=ee('<div class="text-[12px] text-danger mb-3"> </div>'),Nf=ee('<h2 class="text-base mb-4"> </h2> <div class="flex items-center justify-between mb-3"><!> <span class="text-[11px] text-muted"> </span></div> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4 max-h-[400px] overflow-y-auto"></ul> <!> <div class="flex justify-end gap-2"><!> <!></div>',1);function Ff(t,e){qe(e,!0);let i=se(!1),r=se("");const S=new dn;tt(()=>{const d=e.pr.comments.length;Lr(()=>{S.clear();for(let m=0;m<d;m++)S.add(m)})});let E=he(()=>ws(e.pr)),C=he(()=>e.pr.comments.map((d,m)=>({comment:d,originalIndex:m})).sort((d,m)=>m.comment.createdAt.localeCompare(d.comment.createdAt))),o=he(()=>S.size===e.pr.comments.length),l=he(()=>S.size===0);function h(){if(b(o))S.clear();else for(let d=0;d<e.pr.comments.length;d++)S.add(d)}function f(d){S.has(d)?S.delete(d):S.add(d)}function u(d,m){if(d.type==="inline"){const _=d.line?`${d.path}:${d.line}`:d.path,n=d.diffHunk?`
26
+ `,w=nl(c);try{await sl(e.branch,w,p),e.onfixsuccess()}catch(y){W(l,Ht(y),!0)}finally{W(o,!1)}}async function _(s){await navigator.clipboard.writeText(s),W(C,!0),setTimeout(()=>{W(C,!1)},2e3)}function n(s){return s==="success"?"✓":s==="failed"?"✗":s==="skipped"?"—":"○"}function a(s){return s==="success"?"text-success":s==="failed"?"text-danger":s==="pending"?"text-warning":"text-muted"}si(t,{get onclose(){return e.onclose},wide:!0,children:(s,c)=>{var p=Tf(),w=Fe(p),y=z(w),k=$(w,2);Je(k,21,()=>e.pr.ciChecks,T=>T.name+T.runId,(T,A)=>{const P=le(()=>f(b(A))),M=le(()=>b(A).runId!==null&&b(i).has(b(A).runId)),H=le(()=>b(r).has(b(P))),F=le(()=>b(H)?u(b(A)):"");var Y=Df(),J=z(Y),Z=z(J),L=z(Z),O=$(Z,2),R=z(O),I=$(O,2),N=z(I),Q=$(J,2),ie=z(Q);{var ue=te=>{var fe=Et(),ye=Fe(fe);{var Ee=Oe=>{ns(Oe,{onclick:()=>v(b(P)),children:(Ae,Xe)=>{var je=Ye();ce(()=>oe(je,b(H)?"Hide logs":"Show logs")),q(Ae,je)},$$slots:{default:!0}})},Ge=Oe=>{ns(Oe,{onclick:()=>d({runId:b(A).runId,name:b(A).name}),children:(Ae,Xe)=>{var je=Ye("View logs");q(Ae,je)},$$slots:{default:!0}})};ne(ye,Oe=>{b(M)?Oe(Ee):Oe(Ge,-1)})}q(te,fe)};ne(ie,te=>{b(A).status==="failed"&&b(A).runId!==null&&te(ue)})}var j=$(ie,2);{var D=te=>{var fe=Cf();ce(()=>xe(fe,"href",b(A).url)),q(te,fe)};ne(j,te=>{b(A).url&&te(D)})}var V=$(Q,2);{var B=te=>{var fe=xf();q(te,fe)},K=te=>{var fe=Ef(),ye=z(fe),Ee=z(ye),Ge=$(ye,2),Oe=z(Ge);ns(Oe,{onclick:()=>_(b(F)),children:(Xe,je)=>{var pt=Ye();ce(()=>oe(pt,b(C)?"Copied!":"Copy logs")),q(Xe,pt)},$$slots:{default:!0}});var Ae=$(Oe,2);{let Xe=le(()=>!e.branch||b(o));_t(Ae,{variant:"cta",small:!0,get disabled(){return b(Xe)},onclick:()=>m(b(A).name,b(F)),children:(je,pt)=>{var gt=Ye();ce(()=>oe(gt,b(o)?"Asking agent...":"Ask agent to fix")),q(je,gt)},$$slots:{default:!0}})}ce(()=>oe(Ee,b(F))),q(te,fe)};ne(V,te=>{b(A).runId!==null&&b(S)===b(A).runId&&b(H)?te(B):b(H)&&b(F)&&te(K,1)})}var X=$(V,2);{var he=te=>{var fe=kf(),ye=z(fe);ce(()=>oe(ye,b(E))),q(te,fe)},ae=le(()=>b(E)&&b(S)===null&&b(A).runId!==null&&!b(i).has(b(A).runId));ne(X,te=>{b(ae)&&te(he)})}var de=$(X,2);{var ve=te=>{var fe=Lf(),ye=z(fe);ce(()=>oe(ye,b(l))),q(te,fe)};ne(de,te=>{b(l)&&te(ve)})}ce((te,fe,ye)=>{Re(Z,1,`text-sm font-bold ${te??""}`),oe(L,fe),oe(R,b(A).name),Re(I,1,`text-[11px] ${ye??""}`),oe(N,b(A).status)},[()=>a(b(A).status),()=>n(b(A).status),()=>a(b(A).status)]),q(T,Y)});var g=$(k,2),x=z(g);_t(x,{type:"button",get onclick(){return e.onclose},children:(T,A)=>{var P=Ye("Close");q(T,P)},$$slots:{default:!0}}),ce(()=>oe(y,`CI Checks — ${b(h)??""}`)),q(s,p)},$$slots:{default:!0}}),$e()}var Af=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],Bf=["difference","intersection","symmetricDifference","union"],Mo=!1,vi,Yt,Or,us,wi,ol,al;const ds=class ds extends Set{constructor(i){super();we(this,wi);we(this,vi,new Map);we(this,Yt,se(0));we(this,Or,se(0));we(this,us,Er||-1);if(i){for(var r of i)super.add(r);G(this,Or).v=super.size}Mo||ze(this,wi,al).call(this)}has(i){var r=super.has(i),S=G(this,vi),E=S.get(i);if(E===void 0){if(!r)return b(G(this,Yt)),!1;E=ze(this,wi,ol).call(this,!0),S.set(i,E)}return b(E),r}add(i){return super.has(i)||(super.add(i),W(G(this,Or),super.size),Nr(G(this,Yt))),this}delete(i){var r=super.delete(i),S=G(this,vi),E=S.get(i);return E!==void 0&&(S.delete(i),W(E,!1)),r&&(W(G(this,Or),super.size),Nr(G(this,Yt))),r}clear(){if(super.size!==0){super.clear();var i=G(this,vi);for(var r of i.values())W(r,!1);i.clear(),W(G(this,Or),0),Nr(G(this,Yt))}}keys(){return this.values()}values(){return b(G(this,Yt)),super.values()}entries(){return b(G(this,Yt)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return b(G(this,Or))}};vi=new WeakMap,Yt=new WeakMap,Or=new WeakMap,us=new WeakMap,wi=new WeakSet,ol=function(i){return Er===G(this,us)?se(i):Fr(i)},al=function(){Mo=!0;var i=ds.prototype,r=Set.prototype;for(const S of Af)i[S]=function(...E){return b(G(this,Yt)),r[S].apply(this,E)};for(const S of Bf)i[S]=function(...E){b(G(this,Yt));var C=r[S].apply(this,E);return new ds(C)}};let dn=ds;var Mf=ee('<span class="text-muted ml-1">(reply)</span>'),Of=ee('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),Pf=ee('<span class="text-accent/60 ml-1">review</span>'),If=ee('<li class="rounded-md border border-edge bg-surface p-3"><label class="flex items-start gap-2 cursor-pointer"><input type="checkbox" class="mt-0.5 accent-accent"/> <div class="flex-1 min-w-0"><!> <div class="text-[12px] text-muted mb-1"><span class="font-medium text-primary"> </span> <!></div> <pre class="text-[11px] font-mono whitespace-pre-wrap m-0 text-primary/80"> </pre></div></label></li>'),Hf=ee('<div class="text-[12px] text-danger mb-3"> </div>'),Nf=ee('<h2 class="text-base mb-4"> </h2> <div class="flex items-center justify-between mb-3"><!> <span class="text-[11px] text-muted"> </span></div> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4 max-h-[400px] overflow-y-auto"></ul> <!> <div class="flex justify-end gap-2"><!> <!></div>',1);function Ff(t,e){qe(e,!0);let i=se(!1),r=se("");const S=new dn;lt(()=>{const d=e.pr.comments.length;Lr(()=>{S.clear();for(let m=0;m<d;m++)S.add(m)})});let E=le(()=>ws(e.pr)),C=le(()=>e.pr.comments.map((d,m)=>({comment:d,originalIndex:m})).sort((d,m)=>m.comment.createdAt.localeCompare(d.comment.createdAt))),o=le(()=>S.size===e.pr.comments.length),l=le(()=>S.size===0);function h(){if(b(o))S.clear();else for(let d=0;d<e.pr.comments.length;d++)S.add(d)}function f(d){S.has(d)?S.delete(d):S.add(d)}function u(d,m){if(d.type==="inline"){const _=d.line?`${d.path}:${d.line}`:d.path,n=d.diffHunk?`
27
27
  \`\`\`diff
28
28
  ${d.diffHunk}
29
29
  \`\`\`
30
30
  `:`
31
31
  `;return`[${m}] @${d.author} (${d.createdAt.slice(0,10)}) on ${_}:${n}${d.body}`}return`[${m}] @${d.author} (${d.createdAt.slice(0,10)}):
32
- ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=["Review these comments and elaborate a plan to address the ones you find relevant.",`PR: ${b(E)}`,"","Comments:"].join(`
32
+ ${d.body}`}async function v(){if(!e.branch||b(l))return;W(i,!0),W(r,"");const d=["Review these comments and elaborate a plan to address the ones you find relevant.",`PR: ${b(E)}`,"","Comments:"].join(`
33
33
  `)+`
34
34
  `,m=e.pr.comments.filter((_,n)=>S.has(n)).map((_,n)=>u(_,n+1)).join(`
35
35
 
36
- `);try{await sl(e.branch,nl(m,2e4),d),e.onsendsuccess()}catch(_){F(r,Ht(_),!0)}finally{F(i,!1)}}si(t,{get onclose(){return e.onclose},wide:!0,children:(d,m)=>{var _=Nf(),n=Fe(_),a=z(n),s=$(n,2),c=z(s);ns(c,{onclick:h,children:(P,B)=>{var H=Ye();le(()=>oe(H,b(o)?"Deselect all":"Select all")),q(P,H)},$$slots:{default:!0}});var p=$(c,2),w=z(p),y=$(s,2);Je(y,21,()=>b(C),({comment:P,originalIndex:B})=>B,(P,B)=>{let H=()=>b(B).comment,W=()=>b(B).originalIndex;var Y=If(),J=z(Y),Z=z(J),L=$(Z,2),O=z(L);{var R=M=>{var K=Of(),X=z(K),ce=$(X);{var ae=de=>{var ve=Mf();q(de,ve)};ne(ce,de=>{H().isReply&&de(ae)})}le(()=>{xe(K,"title",H().path),oe(X,`${H().path??""}${H().line?`:${H().line}`:""} `)}),q(M,K)};ne(O,M=>{H().type==="inline"&&M(R)})}var I=$(O,2),N=z(I),Q=z(N),ie=$(N),ue=$(ie);{var j=M=>{var K=Pf();q(M,K)};ne(ue,M=>{H().type==="inline"&&M(j)})}var D=$(I,2),V=z(D);le((M,K)=>{ln(Z,M),oe(Q,`@${H().author??""}`),oe(ie,` · ${K??""} `),oe(V,H().body)},[()=>S.has(W()),()=>H().createdAt.slice(0,10)]),ge("change",Z,()=>f(W())),q(P,Y)});var k=$(y,2);{var g=P=>{var B=Hf(),H=z(B);le(()=>oe(H,b(r))),q(P,B)};ne(k,P=>{b(r)&&P(g)})}var x=$(k,2),T=z(x);_t(T,{type:"button",get onclick(){return e.onclose},children:(P,B)=>{var H=Ye("Cancel");q(P,H)},$$slots:{default:!0}});var A=$(T,2);{let P=he(()=>b(l)||b(i));_t(A,{variant:"cta",small:!0,get disabled(){return b(P)},onclick:v,children:(B,H)=>{var W=Ye();le(()=>oe(W,b(i)?"Sending...":`Send ${S.size} to agent`)),q(B,W)},$$slots:{default:!0}})}le(()=>{oe(a,`PR Comments — ${b(E)??""}`),oe(w,`${S.size??""} of ${e.pr.comments.length??""} selected`)}),q(d,_)},$$slots:{default:!0}}),$e()}bt(["change"]);var rt;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(rt||(rt={}));const Wf={LINE_BY_LINE:"line-by-line"},Uf={NONE:"none"},jf={WORD:"word"};var ci;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(ci||(ci={}));const zf=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],Kf=RegExp("["+zf.join("\\")+"]","g");function Vf(t){return t.replace(Kf,"\\$&")}function Oo(t){return t&&t.replace(/\\/g,"/")}function qf(t){let e,i,r,S=0;for(e=0,r=t.length;e<r;e++)i=t.charCodeAt(e),S=(S<<5)-S+i,S|=0;return S}function ll(t){const e=t.length;let i=-1/0;for(let r=0;r<e;r++)i=Math.max(i,t[r]);return i}function Po(t,e){const i=t.split(".");return i.length>1?i[i.length-1]:e}function Io(t,e){return e.reduce((i,r)=>i||t.startsWith(r),!1)}const Ho=["a/","b/","i/","w/","c/","o/"];function Ar(t,e,i){const r=i!==void 0?[...Ho,i]:Ho,S=e?new RegExp(`^${Vf(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,E=""]=S.exec(t)||[],C=r.find(l=>E.indexOf(l)===0);return(C?E.slice(C.length):E).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function $f(t,e){return Ar(t,"---",e)}function Gf(t,e){return Ar(t,"+++",e)}function Xf(t,e={}){const i=[];let r=null,S=null,E=null,C=null,o=null,l=null,h=null;const f="--- ",u="+++ ",v="@@",d=/^old mode (\d{6})/,m=/^new mode (\d{6})/,_=/^deleted file mode (\d{6})/,n=/^new file mode (\d{6})/,a=/^copy from "?(.+)"?/,s=/^copy to "?(.+)"?/,c=/^rename from "?(.+)"?/,p=/^rename to "?(.+)"?/,w=/^similarity index (\d+)%/,y=/^dissimilarity index (\d+)%/,k=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,g=/^Binary files (.*) and (.*) differ/,x=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,A=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,P=/^new file mode (\d{6})/,B=/^deleted file mode (\d{6}),(\d{6})/,H=t.replace(/\/g,"").replace(/\r\n?/g,`
36
+ `);try{await sl(e.branch,nl(m,2e4),d),e.onsendsuccess()}catch(_){W(r,Ht(_),!0)}finally{W(i,!1)}}si(t,{get onclose(){return e.onclose},wide:!0,children:(d,m)=>{var _=Nf(),n=Fe(_),a=z(n),s=$(n,2),c=z(s);ns(c,{onclick:h,children:(P,M)=>{var H=Ye();ce(()=>oe(H,b(o)?"Deselect all":"Select all")),q(P,H)},$$slots:{default:!0}});var p=$(c,2),w=z(p),y=$(s,2);Je(y,21,()=>b(C),({comment:P,originalIndex:M})=>M,(P,M)=>{let H=()=>b(M).comment,F=()=>b(M).originalIndex;var Y=If(),J=z(Y),Z=z(J),L=$(Z,2),O=z(L);{var R=B=>{var K=Of(),X=z(K),he=$(X);{var ae=de=>{var ve=Mf();q(de,ve)};ne(he,de=>{H().isReply&&de(ae)})}ce(()=>{xe(K,"title",H().path),oe(X,`${H().path??""}${H().line?`:${H().line}`:""} `)}),q(B,K)};ne(O,B=>{H().type==="inline"&&B(R)})}var I=$(O,2),N=z(I),Q=z(N),ie=$(N),ue=$(ie);{var j=B=>{var K=Pf();q(B,K)};ne(ue,B=>{H().type==="inline"&&B(j)})}var D=$(I,2),V=z(D);ce((B,K)=>{ln(Z,B),oe(Q,`@${H().author??""}`),oe(ie,` · ${K??""} `),oe(V,H().body)},[()=>S.has(F()),()=>H().createdAt.slice(0,10)]),ge("change",Z,()=>f(F())),q(P,Y)});var k=$(y,2);{var g=P=>{var M=Hf(),H=z(M);ce(()=>oe(H,b(r))),q(P,M)};ne(k,P=>{b(r)&&P(g)})}var x=$(k,2),T=z(x);_t(T,{type:"button",get onclick(){return e.onclose},children:(P,M)=>{var H=Ye("Cancel");q(P,H)},$$slots:{default:!0}});var A=$(T,2);{let P=le(()=>b(l)||b(i));_t(A,{variant:"cta",small:!0,get disabled(){return b(P)},onclick:v,children:(M,H)=>{var F=Ye();ce(()=>oe(F,b(i)?"Sending...":`Send ${S.size} to agent`)),q(M,F)},$$slots:{default:!0}})}ce(()=>{oe(a,`PR Comments — ${b(E)??""}`),oe(w,`${S.size??""} of ${e.pr.comments.length??""} selected`)}),q(d,_)},$$slots:{default:!0}}),$e()}bt(["change"]);var tt;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(tt||(tt={}));const Wf={LINE_BY_LINE:"line-by-line"},Uf={NONE:"none"},jf={WORD:"word"};var ci;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(ci||(ci={}));const zf=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],Kf=RegExp("["+zf.join("\\")+"]","g");function Vf(t){return t.replace(Kf,"\\$&")}function Oo(t){return t&&t.replace(/\\/g,"/")}function qf(t){let e,i,r,S=0;for(e=0,r=t.length;e<r;e++)i=t.charCodeAt(e),S=(S<<5)-S+i,S|=0;return S}function ll(t){const e=t.length;let i=-1/0;for(let r=0;r<e;r++)i=Math.max(i,t[r]);return i}function Po(t,e){const i=t.split(".");return i.length>1?i[i.length-1]:e}function Io(t,e){return e.reduce((i,r)=>i||t.startsWith(r),!1)}const Ho=["a/","b/","i/","w/","c/","o/"];function Ar(t,e,i){const r=i!==void 0?[...Ho,i]:Ho,S=e?new RegExp(`^${Vf(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,E=""]=S.exec(t)||[],C=r.find(l=>E.indexOf(l)===0);return(C?E.slice(C.length):E).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function $f(t,e){return Ar(t,"---",e)}function Gf(t,e){return Ar(t,"+++",e)}function Xf(t,e={}){const i=[];let r=null,S=null,E=null,C=null,o=null,l=null,h=null;const f="--- ",u="+++ ",v="@@",d=/^old mode (\d{6})/,m=/^new mode (\d{6})/,_=/^deleted file mode (\d{6})/,n=/^new file mode (\d{6})/,a=/^copy from "?(.+)"?/,s=/^copy to "?(.+)"?/,c=/^rename from "?(.+)"?/,p=/^rename to "?(.+)"?/,w=/^similarity index (\d+)%/,y=/^dissimilarity index (\d+)%/,k=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,g=/^Binary files (.*) and (.*) differ/,x=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,A=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,P=/^new file mode (\d{6})/,M=/^deleted file mode (\d{6}),(\d{6})/,H=t.replace(/\/g,"").replace(/\r\n?/g,`
37
37
  `).split(`
38
- `);function W(){S!==null&&r!==null&&(r.blocks.push(S),S=null)}function Y(){r!==null&&(!r.oldName&&l!==null&&(r.oldName=l),!r.newName&&h!==null&&(r.newName=h),r.newName&&(i.push(r),r=null)),l=null,h=null}function J(){W(),Y(),r={blocks:[],deletedLines:0,addedLines:0}}function Z(R){W();let I;r!==null&&((I=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(R))?(r.isCombined=!1,E=parseInt(I[1],10),o=parseInt(I[2],10)):(I=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(R))?(r.isCombined=!0,E=parseInt(I[1],10),C=parseInt(I[2],10),o=parseInt(I[3],10)):(R.startsWith(v)&&console.error("Failed to parse lines, starting in 0!"),E=0,o=0,r.isCombined=!1)),S={lines:[],oldStartLine:E,oldStartLine2:C,newStartLine:o,header:R}}function L(R){if(r===null||S===null||E===null||o===null)return;const I={content:R},N=r.isCombined?["+ "," +","++"]:["+"],Q=r.isCombined?["- "," -","--"]:["-"];Io(R,N)?(r.addedLines++,I.type=rt.INSERT,I.oldNumber=void 0,I.newNumber=o++):Io(R,Q)?(r.deletedLines++,I.type=rt.DELETE,I.oldNumber=E++,I.newNumber=void 0):(I.type=rt.CONTEXT,I.oldNumber=E++,I.newNumber=o++),S.lines.push(I)}function O(R,I){let N=I;for(;N<H.length-3;){if(R.startsWith("diff"))return!1;if(H[N].startsWith(f)&&H[N+1].startsWith(u)&&H[N+2].startsWith(v))return!0;N++}return!1}return H.forEach((R,I)=>{if(!R||R.startsWith("*"))return;let N;const Q=H[I-1],ie=H[I+1],ue=H[I+2];if(R.startsWith("diff --git")||R.startsWith("diff --combined")){if(J(),(N=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(R))&&(l=Ar(N[1],void 0,e.dstPrefix),h=Ar(N[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isGitDiff=!0;return}if(R.startsWith("Binary files")&&!(r!=null&&r.isGitDiff)){if(J(),(N=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(R))&&(l=Ar(N[1],void 0,e.dstPrefix),h=Ar(N[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isBinary=!0;return}if((!r||!r.isGitDiff&&r&&R.startsWith(f)&&ie.startsWith(u)&&ue.startsWith(v))&&J(),r!=null&&r.isTooBig)return;if(r&&(typeof e.diffMaxChanges=="number"&&r.addedLines+r.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&R.length>e.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],S=null;const D=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(i.length):"Diff too big to be displayed";Z(D);return}if(R.startsWith(f)&&ie.startsWith(u)||R.startsWith(u)&&Q.startsWith(f)){if(r&&!r.oldName&&R.startsWith("--- ")&&(N=$f(R,e.srcPrefix))){r.oldName=N,r.language=Po(r.oldName,r.language);return}if(r&&!r.newName&&R.startsWith("+++ ")&&(N=Gf(R,e.dstPrefix))){r.newName=N,r.language=Po(r.newName,r.language);return}}if(r&&(R.startsWith(v)||r.isGitDiff&&r.oldName&&r.newName&&!S)){Z(R);return}if(S&&(R.startsWith("+")||R.startsWith("-")||R.startsWith(" "))){L(R);return}const j=!O(R,I);if(r===null)throw new Error("Where is my file !!!");(N=d.exec(R))?r.oldMode=N[1]:(N=m.exec(R))?r.newMode=N[1]:(N=_.exec(R))?(r.deletedFileMode=N[1],r.isDeleted=!0):(N=n.exec(R))?(r.newFileMode=N[1],r.isNew=!0):(N=a.exec(R))?(j&&(r.oldName=N[1]),r.isCopy=!0):(N=s.exec(R))?(j&&(r.newName=N[1]),r.isCopy=!0):(N=c.exec(R))?(j&&(r.oldName=N[1]),r.isRename=!0):(N=p.exec(R))?(j&&(r.newName=N[1]),r.isRename=!0):(N=g.exec(R))?(r.isBinary=!0,r.oldName=Ar(N[1],void 0,e.srcPrefix),r.newName=Ar(N[2],void 0,e.dstPrefix),Z("Binary file")):x.test(R)?(r.isBinary=!0,Z(R)):(N=w.exec(R))?r.unchangedPercentage=parseInt(N[1],10):(N=y.exec(R))?r.changedPercentage=parseInt(N[1],10):(N=k.exec(R))?(r.checksumBefore=N[1],r.checksumAfter=N[2],N[3]&&(r.mode=N[3])):(N=T.exec(R))?(r.checksumBefore=[N[2],N[3]],r.checksumAfter=N[1]):(N=A.exec(R))?(r.oldMode=[N[2],N[3]],r.newMode=N[1]):(N=P.exec(R))?(r.newFileMode=N[1],r.isNew=!0):(N=B.exec(R))&&(r.deletedFileMode=N[1],r.isDeleted=!0)}),W(),Y(),i}class cl{diff(e,i,r={}){let S;typeof r=="function"?(S=r,r={}):"callback"in r&&(S=r.callback);const E=this.castInput(e,r),C=this.castInput(i,r),o=this.removeEmpty(this.tokenize(E,r)),l=this.removeEmpty(this.tokenize(C,r));return this.diffWithOptionsObj(o,l,r,S)}diffWithOptionsObj(e,i,r,S){var E;const C=s=>{if(s=this.postProcess(s,r),S){setTimeout(function(){S(s)},0);return}else return s},o=i.length,l=e.length;let h=1,f=o+l;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));const u=(E=r.timeout)!==null&&E!==void 0?E:1/0,v=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(d[0],i,e,0,r);if(d[0].oldPos+1>=l&&m+1>=o)return C(this.buildValues(d[0].lastComponent,i,e));let _=-1/0,n=1/0;const a=()=>{for(let s=Math.max(_,-h);s<=Math.min(n,h);s+=2){let c;const p=d[s-1],w=d[s+1];p&&(d[s-1]=void 0);let y=!1;if(w){const g=w.oldPos-s;y=w&&0<=g&&g<o}const k=p&&p.oldPos+1<l;if(!y&&!k){d[s]=void 0;continue}if(!k||y&&p.oldPos<w.oldPos?c=this.addToPath(w,!0,!1,0,r):c=this.addToPath(p,!1,!0,1,r),m=this.extractCommon(c,i,e,s,r),c.oldPos+1>=l&&m+1>=o)return C(this.buildValues(c.lastComponent,i,e))||!0;d[s]=c,c.oldPos+1>=l&&(n=Math.min(n,s-1)),m+1>=o&&(_=Math.max(_,s+1))}h++};if(S)(function s(){setTimeout(function(){if(h>f||Date.now()>v)return S(void 0);a()||s()},0)})();else for(;h<=f&&Date.now()<=v;){const s=a();if(s)return s}}addToPath(e,i,r,S,E){const C=e.lastComponent;return C&&!E.oneChangePerToken&&C.added===i&&C.removed===r?{oldPos:e.oldPos+S,lastComponent:{count:C.count+1,added:i,removed:r,previousComponent:C.previousComponent}}:{oldPos:e.oldPos+S,lastComponent:{count:1,added:i,removed:r,previousComponent:C}}}extractCommon(e,i,r,S,E){const C=i.length,o=r.length;let l=e.oldPos,h=l-S,f=0;for(;h+1<C&&l+1<o&&this.equals(r[l+1],i[h+1],E);)h++,l++,f++,E.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!E.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,h}equals(e,i,r){return r.comparator?r.comparator(e,i):e===i||!!r.ignoreCase&&e.toLowerCase()===i.toLowerCase()}removeEmpty(e){const i=[];for(let r=0;r<e.length;r++)e[r]&&i.push(e[r]);return i}castInput(e,i){return e}tokenize(e,i){return Array.from(e)}join(e){return e.join("")}postProcess(e,i){return e}get useLongestToken(){return!1}buildValues(e,i,r){const S=[];let E;for(;e;)S.push(e),E=e.previousComponent,delete e.previousComponent,e=E;S.reverse();const C=S.length;let o=0,l=0,h=0;for(;o<C;o++){const f=S[o];if(f.removed)f.value=this.join(r.slice(h,h+f.count)),h+=f.count;else{if(!f.added&&this.useLongestToken){let u=i.slice(l,l+f.count);u=u.map(function(v,d){const m=r[h+d];return m.length>v.length?m:v}),f.value=this.join(u)}else f.value=this.join(i.slice(l,l+f.count));l+=f.count,f.added||(h+=f.count)}}return S}}class Yf extends cl{}const Jf=new Yf;function Zf(t,e,i){return Jf.diff(t,e,i)}const No="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Qf extends cl{tokenize(e){const i=new RegExp(`(\\r?\\n)|[${No}]+|[^\\S\\n\\r]+|[^${No}]`,"ug");return e.match(i)||[]}}const e_=new Qf;function t_(t,e,i){return e_.diff(t,e,i)}function r_(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const i=[];let r;for(r=0;r<=e.length;r++)i[r]=[r];let S;for(S=0;S<=t.length;S++)i[0][S]=S;for(r=1;r<=e.length;r++)for(S=1;S<=t.length;S++)e.charAt(r-1)===t.charAt(S-1)?i[r][S]=i[r-1][S-1]:i[r][S]=Math.min(i[r-1][S-1]+1,Math.min(i[r][S-1]+1,i[r-1][S]+1));return i[e.length][t.length]}function An(t){return(e,i)=>{const r=t(e).trim(),S=t(i).trim();return r_(r,S)/(r.length+S.length)}}function Bn(t){function e(r,S,E=new Map){let C=1/0,o;for(let l=0;l<r.length;++l)for(let h=0;h<S.length;++h){const f=JSON.stringify([r[l],S[h]]);let u;E.has(f)&&(u=E.get(f))||(u=t(r[l],S[h]),E.set(f,u)),u<C&&(C=u,o={indexA:l,indexB:h,score:C})}return o}function i(r,S,E=0,C=new Map){const o=e(r,S,C);if(!o||r.length+S.length<3)return[[r,S]];const l=r.slice(0,o.indexA),h=S.slice(0,o.indexB),f=[r[o.indexA]],u=[S[o.indexB]],v=o.indexA+1,d=o.indexB+1,m=r.slice(v),_=S.slice(d),n=i(l,h,E+1,C),a=i(f,u,E+1,C),s=i(m,_,E+1,C);let c=a;return(o.indexA>0||o.indexB>0)&&(c=n.concat(c)),(r.length>v||S.length>d)&&(c=c.concat(s)),c}return i}const Ct={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ys={matching:Uf.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:jf.WORD,colorScheme:ci.LIGHT},rr="/",hl=An(t=>t.value),i_=Bn(hl);function Us(t){return t.indexOf("dev/null")!==-1}function s_(t){return t.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function n_(t){return t.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function as(t){switch(t){case rt.CONTEXT:return Ct.CONTEXT;case rt.INSERT:return Ct.INSERTS;case rt.DELETE:return Ct.DELETES}}function Mn(t){switch(t){case ci.DARK:return"d2h-dark-color-scheme";case ci.AUTO:return"d2h-auto-color-scheme";case ci.LIGHT:default:return"d2h-light-color-scheme"}}function o_(t){return t?2:1}function hi(t){return t.slice(0).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}function hr(t,e,i=!0){const r=o_(e);return{prefix:t.substring(0,r),content:i?hi(t.substring(r)):t.substring(r)}}function Cs(t){const e=Oo(t.oldName),i=Oo(t.newName);if(e!==i&&!Us(e)&&!Us(i)){const r=[],S=[],E=e.split(rr),C=i.split(rr),o=E.length,l=C.length;let h=0,f=o-1,u=l-1;for(;h<f&&h<u&&E[h]===C[h];)r.push(C[h]),h+=1;for(;f>h&&u>h&&E[f]===C[u];)S.unshift(C[u]),f-=1,u-=1;const v=r.join(rr),d=S.join(rr),m=E.slice(h,f+1).join(rr),_=C.slice(h,u+1).join(rr);return v.length&&d.length?v+rr+"{"+m+" → "+_+"}"+rr+d:v.length?v+rr+"{"+m+" → "+_+"}":d.length?"{"+m+" → "+_+"}"+rr+d:e+" → "+i}else return Us(i)?e:i}function On(t){return`d2h-${qf(Cs(t)).toString().slice(-6)}`}function Pn(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function ul(t,e,i,r={}){const{matching:S,maxLineLengthHighlight:E,matchWordsThreshold:C,diffStyle:o}=Object.assign(Object.assign({},ys),r),l=hr(t,i,!1),h=hr(e,i,!1);if(l.content.length>E||h.content.length>E)return{oldLine:{prefix:l.prefix,content:hi(l.content)},newLine:{prefix:h.prefix,content:hi(h.content)}};const f=o==="char"?Zf(l.content,h.content):t_(l.content,h.content),u=[];if(o==="word"&&S==="words"){const d=f.filter(n=>n.removed),m=f.filter(n=>n.added);i_(m,d).forEach(n=>{n[0].length===1&&n[1].length===1&&hl(n[0][0],n[1][0])<C&&(u.push(n[0][0]),u.push(n[1][0]))})}const v=f.reduce((d,m)=>{const _=m.added?"ins":m.removed?"del":null,n=u.indexOf(m)>-1?' class="d2h-change"':"",a=hi(m.value);return _!==null?`${d}<${_}${n}>${a}</${_}>`:`${d}${a}`},"");return{oldLine:{prefix:l.prefix,content:s_(v)},newLine:{prefix:h.prefix,content:n_(v)}}}const Fo="file-summary",a_="icon",l_={colorScheme:ys.colorScheme};class c_{constructor(e,i={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},l_),i)}render(e){const i=e.map(r=>this.hoganUtils.render(Fo,"line",{fileHtmlId:On(r),oldName:r.oldName,newName:r.newName,fileName:Cs(r),deletedLines:"-"+r.deletedLines,addedLines:"+"+r.addedLines},{fileIcon:this.hoganUtils.template(a_,Pn(r))})).join(`
38
+ `);function F(){S!==null&&r!==null&&(r.blocks.push(S),S=null)}function Y(){r!==null&&(!r.oldName&&l!==null&&(r.oldName=l),!r.newName&&h!==null&&(r.newName=h),r.newName&&(i.push(r),r=null)),l=null,h=null}function J(){F(),Y(),r={blocks:[],deletedLines:0,addedLines:0}}function Z(R){F();let I;r!==null&&((I=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(R))?(r.isCombined=!1,E=parseInt(I[1],10),o=parseInt(I[2],10)):(I=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(R))?(r.isCombined=!0,E=parseInt(I[1],10),C=parseInt(I[2],10),o=parseInt(I[3],10)):(R.startsWith(v)&&console.error("Failed to parse lines, starting in 0!"),E=0,o=0,r.isCombined=!1)),S={lines:[],oldStartLine:E,oldStartLine2:C,newStartLine:o,header:R}}function L(R){if(r===null||S===null||E===null||o===null)return;const I={content:R},N=r.isCombined?["+ "," +","++"]:["+"],Q=r.isCombined?["- "," -","--"]:["-"];Io(R,N)?(r.addedLines++,I.type=tt.INSERT,I.oldNumber=void 0,I.newNumber=o++):Io(R,Q)?(r.deletedLines++,I.type=tt.DELETE,I.oldNumber=E++,I.newNumber=void 0):(I.type=tt.CONTEXT,I.oldNumber=E++,I.newNumber=o++),S.lines.push(I)}function O(R,I){let N=I;for(;N<H.length-3;){if(R.startsWith("diff"))return!1;if(H[N].startsWith(f)&&H[N+1].startsWith(u)&&H[N+2].startsWith(v))return!0;N++}return!1}return H.forEach((R,I)=>{if(!R||R.startsWith("*"))return;let N;const Q=H[I-1],ie=H[I+1],ue=H[I+2];if(R.startsWith("diff --git")||R.startsWith("diff --combined")){if(J(),(N=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(R))&&(l=Ar(N[1],void 0,e.dstPrefix),h=Ar(N[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isGitDiff=!0;return}if(R.startsWith("Binary files")&&!(r!=null&&r.isGitDiff)){if(J(),(N=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(R))&&(l=Ar(N[1],void 0,e.dstPrefix),h=Ar(N[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isBinary=!0;return}if((!r||!r.isGitDiff&&r&&R.startsWith(f)&&ie.startsWith(u)&&ue.startsWith(v))&&J(),r!=null&&r.isTooBig)return;if(r&&(typeof e.diffMaxChanges=="number"&&r.addedLines+r.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&R.length>e.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],S=null;const D=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(i.length):"Diff too big to be displayed";Z(D);return}if(R.startsWith(f)&&ie.startsWith(u)||R.startsWith(u)&&Q.startsWith(f)){if(r&&!r.oldName&&R.startsWith("--- ")&&(N=$f(R,e.srcPrefix))){r.oldName=N,r.language=Po(r.oldName,r.language);return}if(r&&!r.newName&&R.startsWith("+++ ")&&(N=Gf(R,e.dstPrefix))){r.newName=N,r.language=Po(r.newName,r.language);return}}if(r&&(R.startsWith(v)||r.isGitDiff&&r.oldName&&r.newName&&!S)){Z(R);return}if(S&&(R.startsWith("+")||R.startsWith("-")||R.startsWith(" "))){L(R);return}const j=!O(R,I);if(r===null)throw new Error("Where is my file !!!");(N=d.exec(R))?r.oldMode=N[1]:(N=m.exec(R))?r.newMode=N[1]:(N=_.exec(R))?(r.deletedFileMode=N[1],r.isDeleted=!0):(N=n.exec(R))?(r.newFileMode=N[1],r.isNew=!0):(N=a.exec(R))?(j&&(r.oldName=N[1]),r.isCopy=!0):(N=s.exec(R))?(j&&(r.newName=N[1]),r.isCopy=!0):(N=c.exec(R))?(j&&(r.oldName=N[1]),r.isRename=!0):(N=p.exec(R))?(j&&(r.newName=N[1]),r.isRename=!0):(N=g.exec(R))?(r.isBinary=!0,r.oldName=Ar(N[1],void 0,e.srcPrefix),r.newName=Ar(N[2],void 0,e.dstPrefix),Z("Binary file")):x.test(R)?(r.isBinary=!0,Z(R)):(N=w.exec(R))?r.unchangedPercentage=parseInt(N[1],10):(N=y.exec(R))?r.changedPercentage=parseInt(N[1],10):(N=k.exec(R))?(r.checksumBefore=N[1],r.checksumAfter=N[2],N[3]&&(r.mode=N[3])):(N=T.exec(R))?(r.checksumBefore=[N[2],N[3]],r.checksumAfter=N[1]):(N=A.exec(R))?(r.oldMode=[N[2],N[3]],r.newMode=N[1]):(N=P.exec(R))?(r.newFileMode=N[1],r.isNew=!0):(N=M.exec(R))&&(r.deletedFileMode=N[1],r.isDeleted=!0)}),F(),Y(),i}class cl{diff(e,i,r={}){let S;typeof r=="function"?(S=r,r={}):"callback"in r&&(S=r.callback);const E=this.castInput(e,r),C=this.castInput(i,r),o=this.removeEmpty(this.tokenize(E,r)),l=this.removeEmpty(this.tokenize(C,r));return this.diffWithOptionsObj(o,l,r,S)}diffWithOptionsObj(e,i,r,S){var E;const C=s=>{if(s=this.postProcess(s,r),S){setTimeout(function(){S(s)},0);return}else return s},o=i.length,l=e.length;let h=1,f=o+l;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));const u=(E=r.timeout)!==null&&E!==void 0?E:1/0,v=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(d[0],i,e,0,r);if(d[0].oldPos+1>=l&&m+1>=o)return C(this.buildValues(d[0].lastComponent,i,e));let _=-1/0,n=1/0;const a=()=>{for(let s=Math.max(_,-h);s<=Math.min(n,h);s+=2){let c;const p=d[s-1],w=d[s+1];p&&(d[s-1]=void 0);let y=!1;if(w){const g=w.oldPos-s;y=w&&0<=g&&g<o}const k=p&&p.oldPos+1<l;if(!y&&!k){d[s]=void 0;continue}if(!k||y&&p.oldPos<w.oldPos?c=this.addToPath(w,!0,!1,0,r):c=this.addToPath(p,!1,!0,1,r),m=this.extractCommon(c,i,e,s,r),c.oldPos+1>=l&&m+1>=o)return C(this.buildValues(c.lastComponent,i,e))||!0;d[s]=c,c.oldPos+1>=l&&(n=Math.min(n,s-1)),m+1>=o&&(_=Math.max(_,s+1))}h++};if(S)(function s(){setTimeout(function(){if(h>f||Date.now()>v)return S(void 0);a()||s()},0)})();else for(;h<=f&&Date.now()<=v;){const s=a();if(s)return s}}addToPath(e,i,r,S,E){const C=e.lastComponent;return C&&!E.oneChangePerToken&&C.added===i&&C.removed===r?{oldPos:e.oldPos+S,lastComponent:{count:C.count+1,added:i,removed:r,previousComponent:C.previousComponent}}:{oldPos:e.oldPos+S,lastComponent:{count:1,added:i,removed:r,previousComponent:C}}}extractCommon(e,i,r,S,E){const C=i.length,o=r.length;let l=e.oldPos,h=l-S,f=0;for(;h+1<C&&l+1<o&&this.equals(r[l+1],i[h+1],E);)h++,l++,f++,E.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!E.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,h}equals(e,i,r){return r.comparator?r.comparator(e,i):e===i||!!r.ignoreCase&&e.toLowerCase()===i.toLowerCase()}removeEmpty(e){const i=[];for(let r=0;r<e.length;r++)e[r]&&i.push(e[r]);return i}castInput(e,i){return e}tokenize(e,i){return Array.from(e)}join(e){return e.join("")}postProcess(e,i){return e}get useLongestToken(){return!1}buildValues(e,i,r){const S=[];let E;for(;e;)S.push(e),E=e.previousComponent,delete e.previousComponent,e=E;S.reverse();const C=S.length;let o=0,l=0,h=0;for(;o<C;o++){const f=S[o];if(f.removed)f.value=this.join(r.slice(h,h+f.count)),h+=f.count;else{if(!f.added&&this.useLongestToken){let u=i.slice(l,l+f.count);u=u.map(function(v,d){const m=r[h+d];return m.length>v.length?m:v}),f.value=this.join(u)}else f.value=this.join(i.slice(l,l+f.count));l+=f.count,f.added||(h+=f.count)}}return S}}class Yf extends cl{}const Jf=new Yf;function Zf(t,e,i){return Jf.diff(t,e,i)}const No="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Qf extends cl{tokenize(e){const i=new RegExp(`(\\r?\\n)|[${No}]+|[^\\S\\n\\r]+|[^${No}]`,"ug");return e.match(i)||[]}}const e_=new Qf;function t_(t,e,i){return e_.diff(t,e,i)}function r_(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const i=[];let r;for(r=0;r<=e.length;r++)i[r]=[r];let S;for(S=0;S<=t.length;S++)i[0][S]=S;for(r=1;r<=e.length;r++)for(S=1;S<=t.length;S++)e.charAt(r-1)===t.charAt(S-1)?i[r][S]=i[r-1][S-1]:i[r][S]=Math.min(i[r-1][S-1]+1,Math.min(i[r][S-1]+1,i[r-1][S]+1));return i[e.length][t.length]}function An(t){return(e,i)=>{const r=t(e).trim(),S=t(i).trim();return r_(r,S)/(r.length+S.length)}}function Bn(t){function e(r,S,E=new Map){let C=1/0,o;for(let l=0;l<r.length;++l)for(let h=0;h<S.length;++h){const f=JSON.stringify([r[l],S[h]]);let u;E.has(f)&&(u=E.get(f))||(u=t(r[l],S[h]),E.set(f,u)),u<C&&(C=u,o={indexA:l,indexB:h,score:C})}return o}function i(r,S,E=0,C=new Map){const o=e(r,S,C);if(!o||r.length+S.length<3)return[[r,S]];const l=r.slice(0,o.indexA),h=S.slice(0,o.indexB),f=[r[o.indexA]],u=[S[o.indexB]],v=o.indexA+1,d=o.indexB+1,m=r.slice(v),_=S.slice(d),n=i(l,h,E+1,C),a=i(f,u,E+1,C),s=i(m,_,E+1,C);let c=a;return(o.indexA>0||o.indexB>0)&&(c=n.concat(c)),(r.length>v||S.length>d)&&(c=c.concat(s)),c}return i}const Ct={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ys={matching:Uf.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:jf.WORD,colorScheme:ci.LIGHT},rr="/",hl=An(t=>t.value),i_=Bn(hl);function Us(t){return t.indexOf("dev/null")!==-1}function s_(t){return t.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function n_(t){return t.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function as(t){switch(t){case tt.CONTEXT:return Ct.CONTEXT;case tt.INSERT:return Ct.INSERTS;case tt.DELETE:return Ct.DELETES}}function Mn(t){switch(t){case ci.DARK:return"d2h-dark-color-scheme";case ci.AUTO:return"d2h-auto-color-scheme";case ci.LIGHT:default:return"d2h-light-color-scheme"}}function o_(t){return t?2:1}function hi(t){return t.slice(0).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}function hr(t,e,i=!0){const r=o_(e);return{prefix:t.substring(0,r),content:i?hi(t.substring(r)):t.substring(r)}}function Cs(t){const e=Oo(t.oldName),i=Oo(t.newName);if(e!==i&&!Us(e)&&!Us(i)){const r=[],S=[],E=e.split(rr),C=i.split(rr),o=E.length,l=C.length;let h=0,f=o-1,u=l-1;for(;h<f&&h<u&&E[h]===C[h];)r.push(C[h]),h+=1;for(;f>h&&u>h&&E[f]===C[u];)S.unshift(C[u]),f-=1,u-=1;const v=r.join(rr),d=S.join(rr),m=E.slice(h,f+1).join(rr),_=C.slice(h,u+1).join(rr);return v.length&&d.length?v+rr+"{"+m+" → "+_+"}"+rr+d:v.length?v+rr+"{"+m+" → "+_+"}":d.length?"{"+m+" → "+_+"}"+rr+d:e+" → "+i}else return Us(i)?e:i}function On(t){return`d2h-${qf(Cs(t)).toString().slice(-6)}`}function Pn(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function ul(t,e,i,r={}){const{matching:S,maxLineLengthHighlight:E,matchWordsThreshold:C,diffStyle:o}=Object.assign(Object.assign({},ys),r),l=hr(t,i,!1),h=hr(e,i,!1);if(l.content.length>E||h.content.length>E)return{oldLine:{prefix:l.prefix,content:hi(l.content)},newLine:{prefix:h.prefix,content:hi(h.content)}};const f=o==="char"?Zf(l.content,h.content):t_(l.content,h.content),u=[];if(o==="word"&&S==="words"){const d=f.filter(n=>n.removed),m=f.filter(n=>n.added);i_(m,d).forEach(n=>{n[0].length===1&&n[1].length===1&&hl(n[0][0],n[1][0])<C&&(u.push(n[0][0]),u.push(n[1][0]))})}const v=f.reduce((d,m)=>{const _=m.added?"ins":m.removed?"del":null,n=u.indexOf(m)>-1?' class="d2h-change"':"",a=hi(m.value);return _!==null?`${d}<${_}${n}>${a}</${_}>`:`${d}${a}`},"");return{oldLine:{prefix:l.prefix,content:s_(v)},newLine:{prefix:h.prefix,content:n_(v)}}}const Fo="file-summary",a_="icon",l_={colorScheme:ys.colorScheme};class c_{constructor(e,i={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},l_),i)}render(e){const i=e.map(r=>this.hoganUtils.render(Fo,"line",{fileHtmlId:On(r),oldName:r.oldName,newName:r.newName,fileName:Cs(r),deletedLines:"-"+r.deletedLines,addedLines:"+"+r.addedLines},{fileIcon:this.hoganUtils.template(a_,Pn(r))})).join(`
39
39
  `);return this.hoganUtils.render(Fo,"wrapper",{colorScheme:Mn(this.config.colorScheme),filesNumber:e.length,files:i})}}const dl=Object.assign(Object.assign({},ys),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),ki="generic",Wo="line-by-line",h_="icon",u_="tag";class d_{constructor(e,i={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},dl),i)}render(e){const i=e.map(r=>{let S;return r.blocks.length?S=this.generateFileHtml(r):S=this.generateEmptyDiff(),this.makeFileDiffHtml(r,S)}).join(`
40
40
  `);return this.hoganUtils.render(ki,"wrapper",{colorScheme:Mn(this.config.colorScheme),content:i})}makeFileDiffHtml(e,i){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const r=this.hoganUtils.template(Wo,"file-diff"),S=this.hoganUtils.template(ki,"file-path"),E=this.hoganUtils.template(h_,"file"),C=this.hoganUtils.template(u_,Pn(e));return r.render({file:e,fileHtmlId:On(e),diffs:i,filePath:S.render({fileDiffName:Cs(e)},{fileIcon:E,fileTag:C})})}generateEmptyDiff(){return this.hoganUtils.render(ki,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Ct})}generateFileHtml(e){const i=Bn(An(r=>hr(r.content,e.isCombined).content));return e.blocks.map(r=>{let S=this.hoganUtils.render(ki,"block-header",{CSSLineClass:Ct,blockHeader:e.isTooBig?r.header:hi(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(r).forEach(([E,C,o])=>{if(C.length&&o.length&&!E.length)this.applyRematchMatching(C,o,i).map(([l,h])=>{const{left:f,right:u}=this.processChangedLines(e,e.isCombined,l,h);S+=f,S+=u});else if(E.length)E.forEach(l=>{const{prefix:h,content:f}=hr(l.content,e.isCombined);S+=this.generateSingleLineHtml(e,{type:Ct.CONTEXT,prefix:h,content:f,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(C.length||o.length){const{left:l,right:h}=this.processChangedLines(e,e.isCombined,C,o);S+=l,S+=h}else console.error("Unknown state reached while processing groups of lines",E,C,o)}),S}).join(`
41
- `)}applyLineGroupping(e){const i=[];let r=[],S=[];for(let E=0;E<e.lines.length;E++){const C=e.lines[E];(C.type!==rt.INSERT&&S.length||C.type===rt.CONTEXT&&r.length>0)&&(i.push([[],r,S]),r=[],S=[]),C.type===rt.CONTEXT?i.push([[C],[],[]]):C.type===rt.INSERT&&r.length===0?i.push([[],[],[C]]):C.type===rt.INSERT&&r.length>0?S.push(C):C.type===rt.DELETE&&r.push(C)}return(r.length||S.length)&&(i.push([[],r,S]),r=[],S=[]),i}applyRematchMatching(e,i,r){const S=e.length*i.length,E=ll(e.concat(i).map(o=>o.content.length));return S<this.config.matchingMaxComparisons&&E<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,i):[[e,i]]}processChangedLines(e,i,r,S){const E={right:"",left:""},C=Math.max(r.length,S.length);for(let o=0;o<C;o++){const l=r[o],h=S[o],f=l!==void 0&&h!==void 0?ul(l.content,h.content,i,this.config):void 0,u=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.oldLine.prefix,content:f.oldLine.content,type:Ct.DELETE_CHANGES}:Object.assign(Object.assign({},hr(l.content,i)),{type:as(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,v=h!==void 0&&h.newNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.newLine.prefix,content:f.newLine.content,type:Ct.INSERT_CHANGES}:Object.assign(Object.assign({},hr(h.content,i)),{type:as(h.type)})),{oldNumber:h.oldNumber,newNumber:h.newNumber}):void 0,{left:d,right:m}=this.generateLineHtml(e,u,v);E.left+=d,E.right+=m}return E}generateLineHtml(e,i,r){return{left:this.generateSingleLineHtml(e,i),right:this.generateSingleLineHtml(e,r)}}generateSingleLineHtml(e,i){if(i===void 0)return"";const r=this.hoganUtils.render(Wo,"numbers",{oldNumber:i.oldNumber||"",newNumber:i.newNumber||""});return this.hoganUtils.render(ki,"line",{type:i.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:i.prefix===" "?"&nbsp;":i.prefix,content:i.content,lineNumber:r,line:i,file:e})}}const fl=Object.assign(Object.assign({},ys),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Li="generic",f_="side-by-side",__="icon",v_="tag";class p_{constructor(e,i={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},fl),i)}render(e){const i=e.map(r=>{let S;return r.blocks.length?S=this.generateFileHtml(r):S=this.generateEmptyDiff(),this.makeFileDiffHtml(r,S)}).join(`
42
- `);return this.hoganUtils.render(Li,"wrapper",{colorScheme:Mn(this.config.colorScheme),content:i})}makeFileDiffHtml(e,i){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const r=this.hoganUtils.template(f_,"file-diff"),S=this.hoganUtils.template(Li,"file-path"),E=this.hoganUtils.template(__,"file"),C=this.hoganUtils.template(v_,Pn(e));return r.render({file:e,fileHtmlId:On(e),diffs:i,filePath:S.render({fileDiffName:Cs(e)},{fileIcon:E,fileTag:C})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Li,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Ct})}}generateFileHtml(e){const i=Bn(An(r=>hr(r.content,e.isCombined).content));return e.blocks.map(r=>{const S={left:this.makeHeaderHtml(r.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(r).forEach(([E,C,o])=>{if(C.length&&o.length&&!E.length)this.applyRematchMatching(C,o,i).map(([l,h])=>{const{left:f,right:u}=this.processChangedLines(e.isCombined,l,h);S.left+=f,S.right+=u});else if(E.length)E.forEach(l=>{const{prefix:h,content:f}=hr(l.content,e.isCombined),{left:u,right:v}=this.generateLineHtml({type:Ct.CONTEXT,prefix:h,content:f,number:l.oldNumber},{type:Ct.CONTEXT,prefix:h,content:f,number:l.newNumber});S.left+=u,S.right+=v});else if(C.length||o.length){const{left:l,right:h}=this.processChangedLines(e.isCombined,C,o);S.left+=l,S.right+=h}else console.error("Unknown state reached while processing groups of lines",E,C,o)}),S}).reduce((r,S)=>({left:r.left+S.left,right:r.right+S.right}),{left:"",right:""})}applyLineGroupping(e){const i=[];let r=[],S=[];for(let E=0;E<e.lines.length;E++){const C=e.lines[E];(C.type!==rt.INSERT&&S.length||C.type===rt.CONTEXT&&r.length>0)&&(i.push([[],r,S]),r=[],S=[]),C.type===rt.CONTEXT?i.push([[C],[],[]]):C.type===rt.INSERT&&r.length===0?i.push([[],[],[C]]):C.type===rt.INSERT&&r.length>0?S.push(C):C.type===rt.DELETE&&r.push(C)}return(r.length||S.length)&&(i.push([[],r,S]),r=[],S=[]),i}applyRematchMatching(e,i,r){const S=e.length*i.length,E=ll(e.concat(i).map(o=>o.content.length));return S<this.config.matchingMaxComparisons&&E<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,i):[[e,i]]}makeHeaderHtml(e,i){return this.hoganUtils.render(Li,"block-header",{CSSLineClass:Ct,blockHeader:i!=null&&i.isTooBig?e:hi(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,i,r){const S={right:"",left:""},E=Math.max(i.length,r.length);for(let C=0;C<E;C++){const o=i[C],l=r[C],h=o!==void 0&&l!==void 0?ul(o.content,l.content,e,this.config):void 0,f=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:Ct.DELETE_CHANGES}:Object.assign(Object.assign({},hr(o.content,e)),{type:as(o.type)})),{number:o.oldNumber}):void 0,u=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:Ct.INSERT_CHANGES}:Object.assign(Object.assign({},hr(l.content,e)),{type:as(l.type)})),{number:l.newNumber}):void 0,{left:v,right:d}=this.generateLineHtml(f,u);S.left+=v,S.right+=d}return S}generateLineHtml(e,i){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(i)}}generateSingleHtml(e){const i="d2h-code-side-linenumber",r="d2h-code-side-line";return this.hoganUtils.render(Li,"line",{type:(e==null?void 0:e.type)||`${Ct.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?i:`${i} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?"&nbsp;":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}}var js={},Uo;function g_(){return Uo||(Uo=1,(function(t){(function(e){var i=/\S/,r=/\"/g,S=/\n/g,E=/\r/g,C=/\\/g,o=/\u2028/,l=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(x,T){var A=x.length,P=0,B=1,H=2,W=P,Y=null,J=null,Z="",L=[],O=!1,R=0,I=0,N="{{",Q="}}";function ie(){Z.length>0&&(L.push({tag:"_t",text:new String(Z)}),Z="")}function ue(){for(var V=!0,M=I;M<L.length;M++)if(V=e.tags[L[M].tag]<e.tags._v||L[M].tag=="_t"&&L[M].text.match(i)===null,!V)return!1;return V}function j(V,M){if(ie(),V&&ue())for(var K=I,X;K<L.length;K++)L[K].text&&((X=L[K+1])&&X.tag==">"&&(X.indent=L[K].text.toString()),L.splice(K,1));else M||L.push({tag:`
43
- `});O=!1,I=L.length}function D(V,M){var K="="+Q,X=V.indexOf(K,M),ce=f(V.substring(V.indexOf("=",M)+1,X)).split(" ");return N=ce[0],Q=ce[ce.length-1],X+K.length-1}for(T&&(T=T.split(" "),N=T[0],Q=T[1]),R=0;R<A;R++)W==P?u(N,x,R)?(--R,ie(),W=B):x.charAt(R)==`
44
- `?j(O):Z+=x.charAt(R):W==B?(R+=N.length-1,J=e.tags[x.charAt(R+1)],Y=J?x.charAt(R+1):"_v",Y=="="?(R=D(x,R),W=P):(J&&R++,W=H),O=R):u(Q,x,R)?(L.push({tag:Y,n:f(Z),otag:N,ctag:Q,i:Y=="/"?O-N.length:R+Q.length}),Z="",R+=Q.length-1,W=P,Y=="{"&&(Q=="}}"?R++:h(L[L.length-1]))):Z+=x.charAt(R);return j(O,!0),L};function h(g){g.n.substr(g.n.length-1)==="}"&&(g.n=g.n.substring(0,g.n.length-1))}function f(g){return g.trim?g.trim():g.replace(/^\s*|\s*$/g,"")}function u(g,x,T){if(x.charAt(T)!=g.charAt(0))return!1;for(var A=1,P=g.length;A<P;A++)if(x.charAt(T+A)!=g.charAt(A))return!1;return!0}var v={_t:!0,"\n":!0,$:!0,"/":!0};function d(g,x,T,A){var P=[],B=null,H=null,W=null;for(H=T[T.length-1];g.length>0;){if(W=g.shift(),H&&H.tag=="<"&&!(W.tag in v))throw new Error("Illegal content in < super tag.");if(e.tags[W.tag]<=e.tags.$||m(W,A))T.push(W),W.nodes=d(g,W.tag,T,A);else if(W.tag=="/"){if(T.length===0)throw new Error("Closing tag without opener: /"+W.n);if(B=T.pop(),W.n!=B.n&&!_(W.n,B.n,A))throw new Error("Nesting error: "+B.n+" vs. "+W.n);return B.end=W.i,P}else W.tag==`
45
- `&&(W.last=g.length==0||g[0].tag==`
46
- `);P.push(W)}if(T.length>0)throw new Error("missing closing tag: "+T.pop().n);return P}function m(g,x){for(var T=0,A=x.length;T<A;T++)if(x[T].o==g.n)return g.tag="#",!0}function _(g,x,T){for(var A=0,P=T.length;A<P;A++)if(T[A].c==g&&T[A].o==x)return!0}function n(g){var x=[];for(var T in g)x.push('"'+c(T)+'": function(c,p,t,i) {'+g[T]+"}");return"{ "+x.join(",")+" }"}function a(g){var x=[];for(var T in g.partials)x.push('"'+c(T)+'":{name:"'+c(g.partials[T].name)+'", '+a(g.partials[T])+"}");return"partials: {"+x.join(",")+"}, subs: "+n(g.subs)}e.stringify=function(g,x,T){return"{code: function (c,p,i) { "+e.wrapMain(g.code)+" },"+a(g)+"}"};var s=0;e.generate=function(g,x,T){s=0;var A={code:"",subs:{},partials:{}};return e.walk(g,A),T.asString?this.stringify(A,x,T):this.makeTemplate(A,x,T)},e.wrapMain=function(g){return'var t=this;t.b(i=i||"");'+g+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(g,x,T){var A=this.makePartials(g);return A.code=new Function("c","p","i",this.wrapMain(g.code)),new this.template(A,x,this,T)},e.makePartials=function(g){var x,T={subs:{},partials:g.partials,name:g.name};for(x in T.partials)T.partials[x]=this.makePartials(T.partials[x]);for(x in g.subs)T.subs[x]=new Function("c","p","t","i",g.subs[x]);return T};function c(g){return g.replace(C,"\\\\").replace(r,'\\"').replace(S,"\\n").replace(E,"\\r").replace(o,"\\u2028").replace(l,"\\u2029")}function p(g){return~g.indexOf(".")?"d":"f"}function w(g,x){var T="<"+(x.prefix||""),A=T+g.n+s++;return x.partials[A]={name:g.n,partials:{}},x.code+='t.b(t.rp("'+c(A)+'",c,p,"'+(g.indent||"")+'"));',A}e.codegen={"#":function(g,x){x.code+="if(t.s(t."+p(g.n)+'("'+c(g.n)+'",c,p,1),c,p,0,'+g.i+","+g.end+',"'+g.otag+" "+g.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(g.nodes,x),x.code+="});c.pop();}"},"^":function(g,x){x.code+="if(!t.s(t."+p(g.n)+'("'+c(g.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(g.nodes,x),x.code+="};"},">":w,"<":function(g,x){var T={partials:{},code:"",subs:{},inPartial:!0};e.walk(g.nodes,T);var A=x.partials[w(g,x)];A.subs=T.subs,A.partials=T.partials},$:function(g,x){var T={subs:{},code:"",partials:x.partials,prefix:g.n};e.walk(g.nodes,T),x.subs[g.n]=T.code,x.inPartial||(x.code+='t.sub("'+c(g.n)+'",c,p,i);')},"\n":function(g,x){x.code+=k('"\\n"'+(g.last?"":" + i"))},_v:function(g,x){x.code+="t.b(t.v(t."+p(g.n)+'("'+c(g.n)+'",c,p,0)));'},_t:function(g,x){x.code+=k('"'+c(g.text)+'"')},"{":y,"&":y};function y(g,x){x.code+="t.b(t.t(t."+p(g.n)+'("'+c(g.n)+'",c,p,0)));'}function k(g){return"t.b("+g+");"}e.walk=function(g,x){for(var T,A=0,P=g.length;A<P;A++)T=e.codegen[g[A].tag],T&&T(g[A],x);return x},e.parse=function(g,x,T){return T=T||{},d(g,"",[],T.sectionTags||[])},e.cache={},e.cacheKey=function(g,x){return[g,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},e.compile=function(g,x){x=x||{};var T=e.cacheKey(g,x),A=this.cache[T];if(A){var P=A.partials;for(var B in P)delete P[B].instance;return A}return A=this.generate(this.parse(this.scan(g,x.delimiters),g,x),g,x),this.cache[T]=A}})(t)})(js)),js}var zs={},jo;function m_(){return jo||(jo=1,(function(t){(function(e){e.Template=function(d,m,_,n){d=d||{},this.r=d.code||this.r,this.c=_,this.options=n||{},this.text=m||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},e.Template.prototype={r:function(d,m,_){return""},v:u,t:f,render:function(m,_,n){return this.ri([m],_||{},n)},ri:function(d,m,_){return this.r(d,m,_)},ep:function(d,m){var _=this.partials[d],n=m[_.name];if(_.instance&&_.base==n)return _.instance;if(typeof n=="string"){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[d].base=n,_.subs){m.stackText||(m.stackText={});for(key in _.subs)m.stackText[key]||(m.stackText[key]=this.activeSub!==void 0&&m.stackText[this.activeSub]?m.stackText[this.activeSub]:this.text);n=r(n,_.subs,_.partials,this.stackSubs,this.stackPartials,m.stackText)}return this.partials[d].instance=n,n},rp:function(d,m,_,n){var a=this.ep(d,_);return a?a.ri(m,_,n):""},rs:function(d,m,_){var n=d[d.length-1];if(!v(n)){_(d,m,this);return}for(var a=0;a<n.length;a++)d.push(n[a]),_(d,m,this),d.pop()},s:function(d,m,_,n,a,s,c){var p;return v(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,m,_,n,a,s,c)),p=!!d,!n&&p&&m&&m.push(typeof d=="object"?d:m[m.length-1]),p)},d:function(d,m,_,n){var a,s=d.split("."),c=this.f(s[0],m,_,n),p=this.options.modelGet,w=null;if(d==="."&&v(m[m.length-2]))c=m[m.length-1];else for(var y=1;y<s.length;y++)a=i(s[y],c,p),a!==void 0?(w=c,c=a):c="";return n&&!c?!1:(!n&&typeof c=="function"&&(m.push(w),c=this.mv(c,m,_),m.pop()),c)},f:function(d,m,_,n){for(var a=!1,s=null,c=!1,p=this.options.modelGet,w=m.length-1;w>=0;w--)if(s=m[w],a=i(d,s,p),a!==void 0){c=!0;break}return c?(!n&&typeof a=="function"&&(a=this.mv(a,m,_)),a):n?!1:""},ls:function(d,m,_,n,a,s){var c=this.options.delimiters;return this.options.delimiters=s,this.b(this.ct(f(d.call(m,a,_)),m,n)),this.options.delimiters=c,!1},ct:function(d,m,_){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(m,_)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,m,_,n,a,s,c){var p,w=m[m.length-1],y=d.call(w);return typeof y=="function"?n?!0:(p=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(y,w,m,_,p.substring(a,s),c)):y},mv:function(d,m,_){var n=m[m.length-1],a=d.call(n);return typeof a=="function"?this.ct(f(a.call(n)),n,_):a},sub:function(d,m,_,n){var a=this.subs[d];a&&(this.activeSub=d,a(m,_,this,n),this.activeSub=!1)}};function i(d,m,_){var n;return m&&typeof m=="object"&&(m[d]!==void 0?n=m[d]:_&&m.get&&typeof m.get=="function"&&(n=m.get(d))),n}function r(d,m,_,n,a,s){function c(){}c.prototype=d;function p(){}p.prototype=d.subs;var w,y=new c;y.subs=new p,y.subsText={},y.buf="",n=n||{},y.stackSubs=n,y.subsText=s;for(w in m)n[w]||(n[w]=m[w]);for(w in n)y.subs[w]=n[w];a=a||{},y.stackPartials=a;for(w in _)a[w]||(a[w]=_[w]);for(w in a)y.partials[w]=a[w];return y}var S=/&/g,E=/</g,C=/>/g,o=/\'/g,l=/\"/g,h=/[&<>\"\']/;function f(d){return String(d??"")}function u(d){return d=f(d),h.test(d)?d.replace(S,"&amp;").replace(E,"&lt;").replace(C,"&gt;").replace(o,"&#39;").replace(l,"&quot;"):d}var v=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(t)})(zs)),zs}var Ks,zo;function b_(){if(zo)return Ks;zo=1;var t=g_();return t.Template=m_().Template,t.template=t.Template,Ks=t,Ks}var et=b_();const st={};st["file-summary-line"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<li class="d2h-file-list-line">'),r.b(`
41
+ `)}applyLineGroupping(e){const i=[];let r=[],S=[];for(let E=0;E<e.lines.length;E++){const C=e.lines[E];(C.type!==tt.INSERT&&S.length||C.type===tt.CONTEXT&&r.length>0)&&(i.push([[],r,S]),r=[],S=[]),C.type===tt.CONTEXT?i.push([[C],[],[]]):C.type===tt.INSERT&&r.length===0?i.push([[],[],[C]]):C.type===tt.INSERT&&r.length>0?S.push(C):C.type===tt.DELETE&&r.push(C)}return(r.length||S.length)&&(i.push([[],r,S]),r=[],S=[]),i}applyRematchMatching(e,i,r){const S=e.length*i.length,E=ll(e.concat(i).map(o=>o.content.length));return S<this.config.matchingMaxComparisons&&E<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,i):[[e,i]]}processChangedLines(e,i,r,S){const E={right:"",left:""},C=Math.max(r.length,S.length);for(let o=0;o<C;o++){const l=r[o],h=S[o],f=l!==void 0&&h!==void 0?ul(l.content,h.content,i,this.config):void 0,u=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.oldLine.prefix,content:f.oldLine.content,type:Ct.DELETE_CHANGES}:Object.assign(Object.assign({},hr(l.content,i)),{type:as(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,v=h!==void 0&&h.newNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.newLine.prefix,content:f.newLine.content,type:Ct.INSERT_CHANGES}:Object.assign(Object.assign({},hr(h.content,i)),{type:as(h.type)})),{oldNumber:h.oldNumber,newNumber:h.newNumber}):void 0,{left:d,right:m}=this.generateLineHtml(e,u,v);E.left+=d,E.right+=m}return E}generateLineHtml(e,i,r){return{left:this.generateSingleLineHtml(e,i),right:this.generateSingleLineHtml(e,r)}}generateSingleLineHtml(e,i){if(i===void 0)return"";const r=this.hoganUtils.render(Wo,"numbers",{oldNumber:i.oldNumber||"",newNumber:i.newNumber||""});return this.hoganUtils.render(ki,"line",{type:i.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:i.prefix===" "?"&nbsp;":i.prefix,content:i.content,lineNumber:r,line:i,file:e})}}const fl=Object.assign(Object.assign({},ys),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Li="generic",f_="side-by-side",__="icon",v_="tag";class p_{constructor(e,i={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},fl),i)}render(e){const i=e.map(r=>{let S;return r.blocks.length?S=this.generateFileHtml(r):S=this.generateEmptyDiff(),this.makeFileDiffHtml(r,S)}).join(`
42
+ `);return this.hoganUtils.render(Li,"wrapper",{colorScheme:Mn(this.config.colorScheme),content:i})}makeFileDiffHtml(e,i){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const r=this.hoganUtils.template(f_,"file-diff"),S=this.hoganUtils.template(Li,"file-path"),E=this.hoganUtils.template(__,"file"),C=this.hoganUtils.template(v_,Pn(e));return r.render({file:e,fileHtmlId:On(e),diffs:i,filePath:S.render({fileDiffName:Cs(e)},{fileIcon:E,fileTag:C})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Li,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Ct})}}generateFileHtml(e){const i=Bn(An(r=>hr(r.content,e.isCombined).content));return e.blocks.map(r=>{const S={left:this.makeHeaderHtml(r.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(r).forEach(([E,C,o])=>{if(C.length&&o.length&&!E.length)this.applyRematchMatching(C,o,i).map(([l,h])=>{const{left:f,right:u}=this.processChangedLines(e.isCombined,l,h);S.left+=f,S.right+=u});else if(E.length)E.forEach(l=>{const{prefix:h,content:f}=hr(l.content,e.isCombined),{left:u,right:v}=this.generateLineHtml({type:Ct.CONTEXT,prefix:h,content:f,number:l.oldNumber},{type:Ct.CONTEXT,prefix:h,content:f,number:l.newNumber});S.left+=u,S.right+=v});else if(C.length||o.length){const{left:l,right:h}=this.processChangedLines(e.isCombined,C,o);S.left+=l,S.right+=h}else console.error("Unknown state reached while processing groups of lines",E,C,o)}),S}).reduce((r,S)=>({left:r.left+S.left,right:r.right+S.right}),{left:"",right:""})}applyLineGroupping(e){const i=[];let r=[],S=[];for(let E=0;E<e.lines.length;E++){const C=e.lines[E];(C.type!==tt.INSERT&&S.length||C.type===tt.CONTEXT&&r.length>0)&&(i.push([[],r,S]),r=[],S=[]),C.type===tt.CONTEXT?i.push([[C],[],[]]):C.type===tt.INSERT&&r.length===0?i.push([[],[],[C]]):C.type===tt.INSERT&&r.length>0?S.push(C):C.type===tt.DELETE&&r.push(C)}return(r.length||S.length)&&(i.push([[],r,S]),r=[],S=[]),i}applyRematchMatching(e,i,r){const S=e.length*i.length,E=ll(e.concat(i).map(o=>o.content.length));return S<this.config.matchingMaxComparisons&&E<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?r(e,i):[[e,i]]}makeHeaderHtml(e,i){return this.hoganUtils.render(Li,"block-header",{CSSLineClass:Ct,blockHeader:i!=null&&i.isTooBig?e:hi(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,i,r){const S={right:"",left:""},E=Math.max(i.length,r.length);for(let C=0;C<E;C++){const o=i[C],l=r[C],h=o!==void 0&&l!==void 0?ul(o.content,l.content,e,this.config):void 0,f=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:Ct.DELETE_CHANGES}:Object.assign(Object.assign({},hr(o.content,e)),{type:as(o.type)})),{number:o.oldNumber}):void 0,u=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:Ct.INSERT_CHANGES}:Object.assign(Object.assign({},hr(l.content,e)),{type:as(l.type)})),{number:l.newNumber}):void 0,{left:v,right:d}=this.generateLineHtml(f,u);S.left+=v,S.right+=d}return S}generateLineHtml(e,i){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(i)}}generateSingleHtml(e){const i="d2h-code-side-linenumber",r="d2h-code-side-line";return this.hoganUtils.render(Li,"line",{type:(e==null?void 0:e.type)||`${Ct.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?i:`${i} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?"&nbsp;":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}}var js={},Uo;function g_(){return Uo||(Uo=1,(function(t){(function(e){var i=/\S/,r=/\"/g,S=/\n/g,E=/\r/g,C=/\\/g,o=/\u2028/,l=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(x,T){var A=x.length,P=0,M=1,H=2,F=P,Y=null,J=null,Z="",L=[],O=!1,R=0,I=0,N="{{",Q="}}";function ie(){Z.length>0&&(L.push({tag:"_t",text:new String(Z)}),Z="")}function ue(){for(var V=!0,B=I;B<L.length;B++)if(V=e.tags[L[B].tag]<e.tags._v||L[B].tag=="_t"&&L[B].text.match(i)===null,!V)return!1;return V}function j(V,B){if(ie(),V&&ue())for(var K=I,X;K<L.length;K++)L[K].text&&((X=L[K+1])&&X.tag==">"&&(X.indent=L[K].text.toString()),L.splice(K,1));else B||L.push({tag:`
43
+ `});O=!1,I=L.length}function D(V,B){var K="="+Q,X=V.indexOf(K,B),he=f(V.substring(V.indexOf("=",B)+1,X)).split(" ");return N=he[0],Q=he[he.length-1],X+K.length-1}for(T&&(T=T.split(" "),N=T[0],Q=T[1]),R=0;R<A;R++)F==P?u(N,x,R)?(--R,ie(),F=M):x.charAt(R)==`
44
+ `?j(O):Z+=x.charAt(R):F==M?(R+=N.length-1,J=e.tags[x.charAt(R+1)],Y=J?x.charAt(R+1):"_v",Y=="="?(R=D(x,R),F=P):(J&&R++,F=H),O=R):u(Q,x,R)?(L.push({tag:Y,n:f(Z),otag:N,ctag:Q,i:Y=="/"?O-N.length:R+Q.length}),Z="",R+=Q.length-1,F=P,Y=="{"&&(Q=="}}"?R++:h(L[L.length-1]))):Z+=x.charAt(R);return j(O,!0),L};function h(g){g.n.substr(g.n.length-1)==="}"&&(g.n=g.n.substring(0,g.n.length-1))}function f(g){return g.trim?g.trim():g.replace(/^\s*|\s*$/g,"")}function u(g,x,T){if(x.charAt(T)!=g.charAt(0))return!1;for(var A=1,P=g.length;A<P;A++)if(x.charAt(T+A)!=g.charAt(A))return!1;return!0}var v={_t:!0,"\n":!0,$:!0,"/":!0};function d(g,x,T,A){var P=[],M=null,H=null,F=null;for(H=T[T.length-1];g.length>0;){if(F=g.shift(),H&&H.tag=="<"&&!(F.tag in v))throw new Error("Illegal content in < super tag.");if(e.tags[F.tag]<=e.tags.$||m(F,A))T.push(F),F.nodes=d(g,F.tag,T,A);else if(F.tag=="/"){if(T.length===0)throw new Error("Closing tag without opener: /"+F.n);if(M=T.pop(),F.n!=M.n&&!_(F.n,M.n,A))throw new Error("Nesting error: "+M.n+" vs. "+F.n);return M.end=F.i,P}else F.tag==`
45
+ `&&(F.last=g.length==0||g[0].tag==`
46
+ `);P.push(F)}if(T.length>0)throw new Error("missing closing tag: "+T.pop().n);return P}function m(g,x){for(var T=0,A=x.length;T<A;T++)if(x[T].o==g.n)return g.tag="#",!0}function _(g,x,T){for(var A=0,P=T.length;A<P;A++)if(T[A].c==g&&T[A].o==x)return!0}function n(g){var x=[];for(var T in g)x.push('"'+c(T)+'": function(c,p,t,i) {'+g[T]+"}");return"{ "+x.join(",")+" }"}function a(g){var x=[];for(var T in g.partials)x.push('"'+c(T)+'":{name:"'+c(g.partials[T].name)+'", '+a(g.partials[T])+"}");return"partials: {"+x.join(",")+"}, subs: "+n(g.subs)}e.stringify=function(g,x,T){return"{code: function (c,p,i) { "+e.wrapMain(g.code)+" },"+a(g)+"}"};var s=0;e.generate=function(g,x,T){s=0;var A={code:"",subs:{},partials:{}};return e.walk(g,A),T.asString?this.stringify(A,x,T):this.makeTemplate(A,x,T)},e.wrapMain=function(g){return'var t=this;t.b(i=i||"");'+g+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(g,x,T){var A=this.makePartials(g);return A.code=new Function("c","p","i",this.wrapMain(g.code)),new this.template(A,x,this,T)},e.makePartials=function(g){var x,T={subs:{},partials:g.partials,name:g.name};for(x in T.partials)T.partials[x]=this.makePartials(T.partials[x]);for(x in g.subs)T.subs[x]=new Function("c","p","t","i",g.subs[x]);return T};function c(g){return g.replace(C,"\\\\").replace(r,'\\"').replace(S,"\\n").replace(E,"\\r").replace(o,"\\u2028").replace(l,"\\u2029")}function p(g){return~g.indexOf(".")?"d":"f"}function w(g,x){var T="<"+(x.prefix||""),A=T+g.n+s++;return x.partials[A]={name:g.n,partials:{}},x.code+='t.b(t.rp("'+c(A)+'",c,p,"'+(g.indent||"")+'"));',A}e.codegen={"#":function(g,x){x.code+="if(t.s(t."+p(g.n)+'("'+c(g.n)+'",c,p,1),c,p,0,'+g.i+","+g.end+',"'+g.otag+" "+g.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(g.nodes,x),x.code+="});c.pop();}"},"^":function(g,x){x.code+="if(!t.s(t."+p(g.n)+'("'+c(g.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(g.nodes,x),x.code+="};"},">":w,"<":function(g,x){var T={partials:{},code:"",subs:{},inPartial:!0};e.walk(g.nodes,T);var A=x.partials[w(g,x)];A.subs=T.subs,A.partials=T.partials},$:function(g,x){var T={subs:{},code:"",partials:x.partials,prefix:g.n};e.walk(g.nodes,T),x.subs[g.n]=T.code,x.inPartial||(x.code+='t.sub("'+c(g.n)+'",c,p,i);')},"\n":function(g,x){x.code+=k('"\\n"'+(g.last?"":" + i"))},_v:function(g,x){x.code+="t.b(t.v(t."+p(g.n)+'("'+c(g.n)+'",c,p,0)));'},_t:function(g,x){x.code+=k('"'+c(g.text)+'"')},"{":y,"&":y};function y(g,x){x.code+="t.b(t.t(t."+p(g.n)+'("'+c(g.n)+'",c,p,0)));'}function k(g){return"t.b("+g+");"}e.walk=function(g,x){for(var T,A=0,P=g.length;A<P;A++)T=e.codegen[g[A].tag],T&&T(g[A],x);return x},e.parse=function(g,x,T){return T=T||{},d(g,"",[],T.sectionTags||[])},e.cache={},e.cacheKey=function(g,x){return[g,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},e.compile=function(g,x){x=x||{};var T=e.cacheKey(g,x),A=this.cache[T];if(A){var P=A.partials;for(var M in P)delete P[M].instance;return A}return A=this.generate(this.parse(this.scan(g,x.delimiters),g,x),g,x),this.cache[T]=A}})(t)})(js)),js}var zs={},jo;function m_(){return jo||(jo=1,(function(t){(function(e){e.Template=function(d,m,_,n){d=d||{},this.r=d.code||this.r,this.c=_,this.options=n||{},this.text=m||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},e.Template.prototype={r:function(d,m,_){return""},v:u,t:f,render:function(m,_,n){return this.ri([m],_||{},n)},ri:function(d,m,_){return this.r(d,m,_)},ep:function(d,m){var _=this.partials[d],n=m[_.name];if(_.instance&&_.base==n)return _.instance;if(typeof n=="string"){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[d].base=n,_.subs){m.stackText||(m.stackText={});for(key in _.subs)m.stackText[key]||(m.stackText[key]=this.activeSub!==void 0&&m.stackText[this.activeSub]?m.stackText[this.activeSub]:this.text);n=r(n,_.subs,_.partials,this.stackSubs,this.stackPartials,m.stackText)}return this.partials[d].instance=n,n},rp:function(d,m,_,n){var a=this.ep(d,_);return a?a.ri(m,_,n):""},rs:function(d,m,_){var n=d[d.length-1];if(!v(n)){_(d,m,this);return}for(var a=0;a<n.length;a++)d.push(n[a]),_(d,m,this),d.pop()},s:function(d,m,_,n,a,s,c){var p;return v(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,m,_,n,a,s,c)),p=!!d,!n&&p&&m&&m.push(typeof d=="object"?d:m[m.length-1]),p)},d:function(d,m,_,n){var a,s=d.split("."),c=this.f(s[0],m,_,n),p=this.options.modelGet,w=null;if(d==="."&&v(m[m.length-2]))c=m[m.length-1];else for(var y=1;y<s.length;y++)a=i(s[y],c,p),a!==void 0?(w=c,c=a):c="";return n&&!c?!1:(!n&&typeof c=="function"&&(m.push(w),c=this.mv(c,m,_),m.pop()),c)},f:function(d,m,_,n){for(var a=!1,s=null,c=!1,p=this.options.modelGet,w=m.length-1;w>=0;w--)if(s=m[w],a=i(d,s,p),a!==void 0){c=!0;break}return c?(!n&&typeof a=="function"&&(a=this.mv(a,m,_)),a):n?!1:""},ls:function(d,m,_,n,a,s){var c=this.options.delimiters;return this.options.delimiters=s,this.b(this.ct(f(d.call(m,a,_)),m,n)),this.options.delimiters=c,!1},ct:function(d,m,_){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(m,_)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,m,_,n,a,s,c){var p,w=m[m.length-1],y=d.call(w);return typeof y=="function"?n?!0:(p=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(y,w,m,_,p.substring(a,s),c)):y},mv:function(d,m,_){var n=m[m.length-1],a=d.call(n);return typeof a=="function"?this.ct(f(a.call(n)),n,_):a},sub:function(d,m,_,n){var a=this.subs[d];a&&(this.activeSub=d,a(m,_,this,n),this.activeSub=!1)}};function i(d,m,_){var n;return m&&typeof m=="object"&&(m[d]!==void 0?n=m[d]:_&&m.get&&typeof m.get=="function"&&(n=m.get(d))),n}function r(d,m,_,n,a,s){function c(){}c.prototype=d;function p(){}p.prototype=d.subs;var w,y=new c;y.subs=new p,y.subsText={},y.buf="",n=n||{},y.stackSubs=n,y.subsText=s;for(w in m)n[w]||(n[w]=m[w]);for(w in n)y.subs[w]=n[w];a=a||{},y.stackPartials=a;for(w in _)a[w]||(a[w]=_[w]);for(w in a)y.partials[w]=a[w];return y}var S=/&/g,E=/</g,C=/>/g,o=/\'/g,l=/\"/g,h=/[&<>\"\']/;function f(d){return String(d??"")}function u(d){return d=f(d),h.test(d)?d.replace(S,"&amp;").replace(E,"&lt;").replace(C,"&gt;").replace(o,"&#39;").replace(l,"&quot;"):d}var v=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(t)})(zs)),zs}var Ks,zo;function b_(){if(zo)return Ks;zo=1;var t=g_();return t.Template=m_().Template,t.template=t.Template,Ks=t,Ks}var et=b_();const it={};it["file-summary-line"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<li class="d2h-file-list-line">'),r.b(`
47
47
  `+i),r.b(' <span class="d2h-file-name-wrapper">'),r.b(`
48
48
  `+i),r.b(r.rp("<fileIcon0",t,e," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",t,e,0))),r.b("</a>"),r.b(`
49
49
  `+i),r.b(' <span class="d2h-file-stats">'),r.b(`
@@ -51,7 +51,7 @@ ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=
51
51
  `+i),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",t,e,0))),r.b("</span>"),r.b(`
52
52
  `+i),r.b(" </span>"),r.b(`
53
53
  `+i),r.b(" </span>"),r.b(`
54
- `+i),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});st["file-summary-wrapper"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
54
+ `+i),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});it["file-summary-wrapper"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
55
55
  `+i),r.b(' <div class="d2h-file-list-header">'),r.b(`
56
56
  `+i),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",t,e,0))),r.b(")</span>"),r.b(`
57
57
  `+i),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b(`
@@ -60,24 +60,24 @@ ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=
60
60
  `+i),r.b(' <ol class="d2h-file-list">'),r.b(`
61
61
  `+i),r.b(" "),r.b(r.t(r.f("files",t,e,0))),r.b(`
62
62
  `+i),r.b(" </ol>"),r.b(`
63
- `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});st["generic-block-header"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
63
+ `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});it["generic-block-header"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
64
64
  `+i),r.b(' <td class="'),r.b(r.v(r.f("lineClass",t,e,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('"></td>'),r.b(`
65
65
  `+i),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('">'),r.b(`
66
66
  `+i),r.b(' <div class="'),r.b(r.v(r.f("contentClass",t,e,0))),r.b('">'),r.s(r.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(r.rs(t,e,function(S,E,C){C.b(C.t(C.f("blockHeader",S,E,0)))}),t.pop()),r.s(r.f("blockHeader",t,e,1),t,e,1,0,0,"")||r.b("&nbsp;"),r.b("</div>"),r.b(`
67
67
  `+i),r.b(" </td>"),r.b(`
68
- `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});st["generic-empty-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
68
+ `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});it["generic-empty-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
69
69
  `+i),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",t,e,0))),r.b('">'),r.b(`
70
70
  `+i),r.b(' <div class="'),r.b(r.v(r.f("contentClass",t,e,0))),r.b('">'),r.b(`
71
71
  `+i),r.b(" File without changes"),r.b(`
72
72
  `+i),r.b(" </div>"),r.b(`
73
73
  `+i),r.b(" </td>"),r.b(`
74
- `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});st["generic-file-path"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-file-name-wrapper">'),r.b(`
74
+ `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});it["generic-file-path"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-file-name-wrapper">'),r.b(`
75
75
  `+i),r.b(r.rp("<fileIcon0",t,e," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",t,e,0))),r.b("</span>"),r.b(`
76
76
  `+i),r.b(r.rp("<fileTag1",t,e," ")),r.b("</span>"),r.b(`
77
77
  `+i),r.b('<label class="d2h-file-collapse">'),r.b(`
78
78
  `+i),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b(`
79
79
  `+i),r.b(" Viewed"),r.b(`
80
- `+i),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});st["generic-line"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
80
+ `+i),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});it["generic-line"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b("<tr>"),r.b(`
81
81
  `+i),r.b(' <td class="'),r.b(r.v(r.f("lineClass",t,e,0))),r.b(" "),r.b(r.v(r.f("type",t,e,0))),r.b('">'),r.b(`
82
82
  `+i),r.b(" "),r.b(r.t(r.f("lineNumber",t,e,0))),r.b(`
83
83
  `+i),r.b(" </td>"),r.b(`
@@ -89,23 +89,23 @@ ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=
89
89
  `+i)}),t.pop()),r.s(r.f("content",t,e,1),t,e,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b(`
90
90
  `+i)),r.b(" </div>"),r.b(`
91
91
  `+i),r.b(" </td>"),r.b(`
92
- `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});st["generic-wrapper"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
92
+ `+i),r.b("</tr>"),r.fl()},partials:{},subs:{}});it["generic-wrapper"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",t,e,0))),r.b('">'),r.b(`
93
93
  `+i),r.b(" "),r.b(r.t(r.f("content",t,e,0))),r.b(`
94
- `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});st["icon-file-added"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b(`
94
+ `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});it["icon-file-added"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b(`
95
95
  `+i),r.b(' width="14">'),r.b(`
96
96
  `+i),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b(`
97
- `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});st["icon-file-changed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b(`
97
+ `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});it["icon-file-changed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b(`
98
98
  `+i),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
99
99
  `+i),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b(`
100
- `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});st["icon-file-deleted"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b(`
100
+ `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});it["icon-file-deleted"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b(`
101
101
  `+i),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
102
102
  `+i),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b(`
103
- `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});st["icon-file-renamed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b(`
103
+ `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});it["icon-file-renamed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b(`
104
104
  `+i),r.b(' viewBox="0 0 14 16" width="14">'),r.b(`
105
105
  `+i),r.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),r.b(`
106
- `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});st["icon-file"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b(`
106
+ `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});it["icon-file"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b(`
107
107
  `+i),r.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),r.b(`
108
- `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});st["line-by-line-file-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
108
+ `+i),r.b("</svg>"),r.fl()},partials:{},subs:{}});it["line-by-line-file-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
109
109
  `+i),r.b(' <div class="d2h-file-header">'),r.b(`
110
110
  `+i),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(`
111
111
  `+i),r.b(" </div>"),r.b(`
@@ -118,8 +118,8 @@ ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=
118
118
  `+i),r.b(" </table>"),r.b(`
119
119
  `+i),r.b(" </div>"),r.b(`
120
120
  `+i),r.b(" </div>"),r.b(`
121
- `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});st["line-by-line-numbers"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",t,e,0))),r.b("</div>"),r.b(`
122
- `+i),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",t,e,0))),r.b("</div>"),r.fl()},partials:{},subs:{}});st["side-by-side-file-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
121
+ `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});it["line-by-line-numbers"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",t,e,0))),r.b("</div>"),r.b(`
122
+ `+i),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",t,e,0))),r.b("</div>"),r.fl()},partials:{},subs:{}});it["side-by-side-file-diff"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",t,e,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",t,e,0))),r.b('">'),r.b(`
123
123
  `+i),r.b(' <div class="d2h-file-header">'),r.b(`
124
124
  `+i),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(`
125
125
  `+i),r.b(" </div>"),r.b(`
@@ -143,9 +143,9 @@ ${d.body}`}async function v(){if(!e.branch||b(l))return;F(i,!0),F(r,"");const d=
143
143
  `+i),r.b(" </div>"),r.b(`
144
144
  `+i),r.b(" </div>"),r.b(`
145
145
  `+i),r.b(" </div>"),r.b(`
146
- `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});st["tag-file-added"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}});st["tag-file-changed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}});st["tag-file-deleted"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}});st["tag-file-renamed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class S_{constructor({compiledTemplates:e={},rawTemplates:i={}}){const r=Object.entries(i).reduce((S,[E,C])=>{const o=et.compile(C,{asString:!1});return Object.assign(Object.assign({},S),{[E]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},st),e),r)}static compile(e){return et.compile(e,{asString:!1})}render(e,i,r,S,E){const C=this.templateKey(e,i);try{return this.preCompiledTemplates[C].render(r,S,E)}catch{throw new Error(`Could not find template to render '${C}'`)}}template(e,i){return this.preCompiledTemplates[this.templateKey(e,i)]}templateKey(e,i){return`${e}-${i}`}}const w_=Object.assign(Object.assign(Object.assign({},dl),fl),{outputFormat:Wf.LINE_BY_LINE,drawFileList:!0});function y_(t,e={}){const i=Object.assign(Object.assign({},w_),e),r=typeof t=="string"?Xf(t,i):t,S=new S_(i),{colorScheme:E}=i,C={colorScheme:E},o=i.drawFileList?new c_(S,C).render(r):"",l=i.outputFormat==="side-by-side"?new p_(S,i).render(r):new d_(S,i).render(r);return o+l}var Bt={},Ko;function C_(){if(Ko)return Bt;Ko=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ColorSchemeType=Bt.DiffStyleType=Bt.LineMatchingType=Bt.OutputFormatType=Bt.LineType=void 0;var t;(function(i){i.INSERT="insert",i.DELETE="delete",i.CONTEXT="context"})(t||(Bt.LineType=t={})),Bt.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},Bt.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},Bt.DiffStyleType={WORD:"word",CHAR:"char"};var e;return(function(i){i.AUTO="auto",i.DARK="dark",i.LIGHT="light"})(e||(Bt.ColorSchemeType=e={})),Bt}var x_=C_(),E_=ee('<div class="text-sm text-muted py-8 text-center">Loading diff...</div>'),k_=ee('<div class="text-sm text-danger py-8 text-center"> </div>'),L_=ee('<div class="text-sm text-muted py-8 text-center">No changes</div>'),D_=ee('<div class="text-[11px] text-warning px-3 py-1">Truncated (exceeded 200KB)</div>'),T_=ee('<div class="diff-container overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge svelte-12rjmc4"><!> <!></div>'),R_=ee('<div class="overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge"><div class="px-3 py-2 text-[11px] text-muted border-b border-edge bg-surface font-mono">git status --short</div> <pre class="git-status-output svelte-12rjmc4"> </pre></div>'),A_=ee('<li class="flex items-baseline gap-2 px-3 py-1.5 border-b border-edge last:border-b-0"><code class="text-[11px] text-accent shrink-0"> </code> <span class="text-[12px] text-primary"> </span></li>'),B_=ee('<ul class="commit-list overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge list-none m-0 p-0"></ul>'),M_=ee('<div class="flex gap-1 mb-3"><button type="button">Current diff</button> <button type="button"> </button> <button type="button"> </button></div> <!>',1),O_=ee('<div class="mb-4 flex flex-wrap items-center justify-between gap-3"><h2 class="text-base">Changes &mdash; <span class="font-mono text-sm"> </span></h2> <!></div> <!> <div class="flex justify-end mt-4"><!></div>',1);function P_(t,e){qe(e,!0);let i=pe(e,"cursorUrl",3,null),r=se(""),S=se(!1),E=se(""),C=se(Oe([])),o=se(!0),l=se("");tt(()=>{F(o,!0),F(l,""),Dd(e.branch).then(_=>{F(r,_.uncommitted,!0),F(S,_.uncommittedTruncated,!0),F(E,_.gitStatus,!0),F(C,_.unpushedCommits,!0)}).catch(_=>{F(l,Ht(_),!0)}).finally(()=>{F(o,!1)})});const h={outputFormat:"line-by-line",colorScheme:x_.ColorSchemeType.AUTO,drawFileList:!1};let f=he(()=>b(r)?y_(b(r),h):""),u=he(()=>b(E)?b(E).split(`
147
- `).filter(_=>_.length>0).length:0),v=he(()=>!!b(r)||b(u)>0||b(C).length>0),d=se("diff"),m=!1;tt(()=>{!b(o)&&!b(l)&&!m&&(m=!0,F(d,b(r)?"diff":b(u)>0?"status":"unpushed",!0))}),si(t,{get onclose(){return e.onclose},wide:!0,maxWidth:"90vw",className:"diff-dialog",children:(_,n)=>{var a=O_(),s=Fe(a),c=z(s),p=$(z(c)),w=z(p),y=$(c,2);{var k=W=>{Rn(W,{get url(){return i()}})};ne(y,W=>{i()&&W(k)})}var g=$(s,2);{var x=W=>{var Y=E_();q(W,Y)},T=W=>{var Y=k_(),J=z(Y);le(()=>oe(J,b(l))),q(W,Y)},A=W=>{var Y=L_();q(W,Y)},P=W=>{var Y=M_(),J=Fe(Y),Z=z(J);let L;var O=$(Z,2);let R;var I=z(O),N=$(O,2);let Q;var ie=z(N),ue=$(J,2);{var j=M=>{var K=T_(),X=z(K);{var ce=de=>{var ve=D_();q(de,ve)};ne(X,de=>{b(S)&&de(ce)})}var ae=$(X,2);Hh(ae,()=>b(f)),q(M,K)},D=M=>{var K=R_(),X=$(z(K),2),ce=z(X);le(()=>oe(ce,b(E))),q(M,K)},V=M=>{var K=B_();Je(K,21,()=>b(C),X=>X.hash,(X,ce)=>{var ae=A_(),de=z(ae),ve=z(de),te=$(de,2),fe=z(te);le(()=>{oe(ve,b(ce).hash),oe(fe,b(ce).message)}),q(X,ae)}),q(M,K)};ne(ue,M=>{b(d)==="diff"&&b(r)?M(j):b(d)==="status"&&b(u)>0?M(D,1):b(d)==="unpushed"&&b(C).length>0&&M(V,2)})}le(()=>{L=Re(Z,1,"tab-btn svelte-12rjmc4",null,L,{active:b(d)==="diff"}),Z.disabled=!b(r),R=Re(O,1,"tab-btn svelte-12rjmc4",null,R,{active:b(d)==="status"}),O.disabled=b(u)===0,oe(I,`Git status (${b(u)??""})`),Q=Re(N,1,"tab-btn svelte-12rjmc4",null,Q,{active:b(d)==="unpushed"}),N.disabled=b(C).length===0,oe(ie,`Unpushed commits (${b(C).length??""})`)}),ge("click",Z,()=>F(d,"diff")),ge("click",O,()=>F(d,"status")),ge("click",N,()=>F(d,"unpushed")),q(W,Y)};ne(g,W=>{b(o)?W(x):b(l)?W(T,1):b(v)?W(P,-1):W(A,2)})}var B=$(g,2),H=z(B);_t(H,{type:"button",get onclick(){return e.onclose},children:(W,Y)=>{var J=Ye("Close");q(W,J)},$$slots:{default:!0}}),le(()=>oe(w,e.branch)),q(_,a)},$$slots:{default:!0}}),$e()}bt(["click"]);var I_=ee('<button type="button"> </button>'),H_=ee('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function N_(t,e){qe(e,!0);var i=H_();Je(i,21,()=>e.panes,r=>r.index,(r,S)=>{var E=I_(),C=z(E);le(()=>{Re(E,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${e.activePane===b(S).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),oe(C,b(S).label)}),ge("click",E,()=>e.onselect(b(S).index)),q(r,E)}),q(t,i),$e()}bt(["click"]);var F_=ee('<div class="toast svelte-1974bvt" role="alert" style="inline-size: fit-content; max-inline-size: min(48ch, calc(100vw - 2rem));"><button type="button" class="min-w-0 flex items-start gap-2 text-left bg-transparent border-none text-inherit cursor-pointer p-0"><!></button> <button type="button" class="shrink-0 w-6 h-6 flex items-center justify-center text-muted hover:text-primary cursor-pointer bg-transparent border-none text-sm">&times;</button></div>'),W_=ee('<div class="fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2"></div>');function U_(t,e){qe(e,!0);var i=Et(),r=Fe(i);{var S=E=>{var C=W_();Je(C,21,()=>e.notifications,o=>o.id,(o,l)=>{var h=F_(),f=z(h),u=z(f);rl(u,{get notification(){return b(l)},large:!0,wrap:!0});var v=$(f,2);ge("click",f,()=>{e.ondismiss(b(l).id),e.onselect(b(l).branch)}),ge("click",v,()=>e.ondismiss(b(l).id)),q(o,h)}),q(E,C)};ne(r,E=>{e.notifications.length>0&&E(S)})}q(t,i),$e()}bt(["click"]);var j_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">Set <code>LINEAR_API_KEY</code> to show your assigned Linear issues here.</p>'),z_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">No assigned Linear issues right now.</p>'),K_=ee('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),V_=ee('<li class="mb-1 p-2 rounded-md border border-transparent hover:bg-hover text-[12px] cursor-pointer" role="button" tabindex="0"><div class="flex items-center gap-1.5 mb-0.5"><span class="shrink-0 w-2 h-2 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-[11px] text-accent no-underline hover:underline"> </a> <span class="text-[10px] text-muted"> </span></div> <p class="truncate text-primary mb-1 m-0"> </p> <!> <div class="flex items-center justify-between gap-2"><span class="text-[10px] text-muted truncate"> <!></span> <span role="none"><!></span></div></li>'),q_=ee('<div class="px-2 pb-1"><input type="text" placeholder="Search issues…" class="w-full px-2 py-1 text-xs rounded border border-edge bg-surface text-primary placeholder:text-muted outline-none focus:border-accent"/></div> <ul class="list-none overflow-y-auto max-h-64 px-2 pb-2"></ul>',1),$_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">Linear integration is disabled in this project.</p>'),G_=ee('<div class="border-t border-edge"><button type="button" class="w-full flex items-center justify-between px-4 py-2 text-xs text-muted cursor-pointer bg-transparent border-none hover:bg-hover"><span class="font-semibold"> </span> <span class="text-[10px]"> </span></button> <!></div>');function X_(t,e){qe(e,!0);let i=se(!0),r=se(""),S=he(()=>b(r)?e.issues.filter(m=>un(b(r),m.title)||(m.description?un(b(r),m.description):!1)):e.issues),E=he(()=>e.availability==="ready"?` (${b(S).length!==e.issues.length?`${b(S).length}/`:""}${e.issues.length})`:"");var C=G_(),o=z(C),l=z(o),h=z(l),f=$(l,2),u=z(f),v=$(o,2);{var d=m=>{var _=Et(),n=Fe(_);{var a=p=>{var w=j_();q(p,w)},s=p=>{var w=Et(),y=Fe(w);{var k=x=>{var T=z_();q(x,T)},g=x=>{var T=q_(),A=Fe(T),P=z(A),B=$(A,2);Je(B,21,()=>b(S),H=>H.id,(H,W)=>{var Y=V_(),J=z(Y),Z=z(J),L=$(Z,2),O=z(L),R=$(L,2),I=z(R),N=$(J,2),Q=z(N),ie=$(N,2);{var ue=ae=>{var de=K_(),ve=z(de);le(()=>oe(ve,b(W).description)),q(ae,de)};ne(ie,ae=>{b(W).description&&ae(ue)})}var j=$(ie,2),D=z(j),V=z(D),M=$(V);{var K=ae=>{var de=Ye();le(()=>oe(de,`· ${b(W).project??""}`)),q(ae,de)};ne(M,ae=>{b(W).project&&ae(K)})}var X=$(D,2),ce=z(X);_t(ce,{small:!0,variant:"accent-outline",onclick:()=>e.onassign(b(W)),children:(ae,de)=>{var ve=Ye("Implement");q(ae,ve)},$$slots:{default:!0}}),le(()=>{Qt(Z,`background: ${b(W).state.color??""};`),xe(Z,"title",b(W).state.name),xe(L,"href",b(W).url),oe(O,b(W).identifier),oe(I,b(W).priorityLabel),oe(Q,b(W).title),oe(V,b(W).team.key)}),ge("click",Y,()=>e.onselect(b(W))),ge("keydown",Y,ae=>{(ae.key==="Enter"||ae.key===" ")&&(ae.preventDefault(),e.onselect(b(W)))}),ge("click",L,ae=>ae.stopPropagation()),ge("keydown",L,ae=>ae.stopPropagation()),ge("click",X,ae=>ae.stopPropagation()),ge("keydown",X,ae=>{(ae.key==="Enter"||ae.key===" ")&&ae.stopPropagation()}),q(H,Y)}),Jr(P,()=>b(r),H=>F(r,H)),q(x,T)};ne(y,x=>{e.issues.length===0?x(k):x(g,-1)})}q(p,w)},c=p=>{var w=$_();q(p,w)};ne(n,p=>{e.availability==="missing_api_key"?p(a):e.availability==="ready"?p(s,1):p(c,-1)})}q(m,_)};ne(v,m=>{b(i)||m(d)})}le(()=>{oe(h,`Linear${b(E)??""}`),oe(u,b(i)?"▸":"▾")}),ge("click",o,()=>F(i,!b(i))),q(t,C),$e()}bt(["click","keydown"]);var Y_=ee('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),J_=ee('<p class="text-[13px] text-muted italic mb-4">No description</p>'),Z_=ee("<span> </span>"),Q_=ee('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),ev=ee("<span> </span>"),tv=ee('<div class="flex items-center gap-2 mb-1"><span class="shrink-0 w-2.5 h-2.5 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-xs text-accent no-underline hover:underline"> </a> <span class="text-[11px] text-muted"> </span> <span class="text-[11px] text-muted"> </span></div> <h2 class="text-base font-semibold mb-3"> </h2> <!> <div class="flex items-center gap-3 text-[11px] text-muted mb-4"><span> </span> <!> <!> <!></div> <div class="flex justify-end gap-2"><!> <!></div>',1);function rv(t,e){qe(e,!0),si(t,{get onclose(){return e.onclose},wide:!0,children:(i,r)=>{var S=tv(),E=Fe(S),C=z(E),o=$(C,2),l=z(o),h=$(o,2),f=z(h),u=$(h,2),v=z(u),d=$(E,2),m=z(d),_=$(d,2);{var n=H=>{var W=Y_(),Y=z(W);le(()=>oe(Y,e.issue.description)),q(H,W)},a=H=>{var W=J_();q(H,W)};ne(_,H=>{e.issue.description?H(n):H(a,-1)})}var s=$(_,2),c=z(s),p=z(c),w=$(c,2);{var y=H=>{var W=Z_(),Y=z(W);le(()=>oe(Y,`· ${e.issue.project??""}`)),q(H,W)};ne(w,H=>{e.issue.project&&H(y)})}var k=$(w,2);{var g=H=>{var W=Et(),Y=Fe(W);Je(Y,17,()=>e.issue.labels,J=>J.name,(J,Z)=>{var L=Q_(),O=z(L);le(()=>{Qt(L,`color: ${b(Z).color??""}; background: ${b(Z).color??""}20;`),oe(O,b(Z).name)}),q(J,L)}),q(H,W)};ne(k,H=>{e.issue.labels.length>0&&H(g)})}var x=$(k,2);{var T=H=>{var W=ev(),Y=z(W);le(()=>oe(Y,`Due ${e.issue.dueDate??""}`)),q(H,W)};ne(x,H=>{e.issue.dueDate&&H(T)})}var A=$(s,2),P=z(A);_t(P,{get onclick(){return e.onclose},children:(H,W)=>{var Y=Ye("Close");q(H,Y)},$$slots:{default:!0}});var B=$(P,2);_t(B,{variant:"accent-outline",onclick:()=>e.onassign(e.issue),children:(H,W)=>{var Y=Ye("Implement");q(H,Y)},$$slots:{default:!0}}),le(()=>{Qt(C,`background: ${e.issue.state.color??""};`),xe(C,"title",e.issue.state.name),xe(o,"href",e.issue.url),oe(l,e.issue.identifier),oe(f,e.issue.state.name),oe(v,`· ${e.issue.priorityLabel??""}`),oe(m,e.issue.title),oe(p,e.issue.team.key)}),q(i,S)},$$slots:{default:!0}}),$e()}var iv=ee('<div class="shrink-0 border-t border-edge px-3 py-2 flex items-center gap-2"><span class="text-[11px] text-muted font-medium truncate"> </span> <!> <button type="button" class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-edge text-muted font-medium cursor-pointer hover:bg-hover hover:text-primary" title="Pull latest from remote">Pull</button></div>');function Vo(t,e){var i=iv(),r=z(i),S=z(r),E=$(r,2);Rn(E,{get url(){return e.cursorUrl}});var C=$(E,2);le(()=>oe(S,e.label)),ge("click",C,function(...o){var l;(l=e.onpull)==null||l.apply(this,o)}),q(t,i)}bt(["click"]);function sv(t,e){return!t.baseBranch||t.baseBranch===t.branch?null:e.has(t.baseBranch)?t.baseBranch:null}function nv(t){const e=new Map(t.map(o=>[o.branch,o])),i=new Map,r=[];for(const o of t){const l=sv(o,e);if(!l){r.push(o);continue}const h=i.get(l)??[];h.push(o),i.set(l,h)}const S=[],E=new Set;function C(o,l){if(!E.has(o.branch)){E.add(o.branch),S.push({worktree:o,depth:l});for(const h of i.get(o.branch)??[])C(h,l+1)}}for(const o of r)C(o,0);for(const o of t)C(o,0);return S}var ov=ee('<div class="fixed inset-0 bg-black/50 z-40"></div>'),av=ee('<button class="h-8 w-8 rounded-md border border-edge bg-surface text-muted text-sm flex items-center justify-center cursor-pointer hover:bg-hover" title="Close sidebar">&times;</button>'),lv=ee('<div class="mt-2 flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </div>'),cv=ee('<div class="shrink-0 border-t border-edge px-4 py-3 text-[11px] text-muted flex flex-col gap-1"><div class="flex justify-between"><span>Navigate</span><kbd class="opacity-60">Cmd+Up/Down</kbd></div> <div class="flex justify-between"><span>New worktree</span><kbd class="opacity-60">Cmd+K</kbd></div> <div class="flex justify-between"><span>Merge</span><kbd class="opacity-60">Cmd+M</kbd></div> <div class="flex justify-between"><span>Remove</span><kbd class="opacity-60">Cmd+D</kbd></div></div>'),hv=ee('<div role="separator" aria-orientation="vertical" tabindex="0"></div>'),uv=ee('<!> <aside><div class="p-4 border-b border-edge"><div class="flex items-center justify-between"><h1 class="text-base font-semibold"> </h1> <div class="flex items-center gap-2"><button class="h-8 px-2 gap-1.5 rounded-md border border-edge bg-surface text-accent text-xs flex items-center justify-center cursor-pointer hover:bg-hover disabled:opacity-50 disabled:cursor-not-allowed" title="New Worktree (Cmd+K)"><span class="text-lg leading-none">+</span> New</button> <!></div></div> <!></div> <!> <!> <!> <!> <!></aside> <!>',1),dv=ee('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-3 text-center"><span class="spinner" style="width: 24px; height: 24px; border-width: 2px;"></span> <p class="text-sm text-primary font-medium"> </p> <p class="text-xs text-muted"> </p></div></div>'),fv=ee('<span class="text-xs text-muted"> </span>'),_v=ee('<span class="text-xs text-muted"> </span>'),vv=ee('<span class="spinner" style="width: 14px; height: 14px; border-width: 1.5px;"></span> Opening...',1),pv=ee('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-4 text-center"><p class="text-sm text-primary font-medium"> </p> <div class="flex flex-col items-center gap-1"><!> <!></div> <button class="mt-2 px-5 py-2 rounded-md bg-accent text-white text-sm font-medium cursor-pointer border-none hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"><!></button></div></div>'),gv=ee('<div class="flex-1 flex items-center justify-center text-muted text-sm"><p>Select a worktree from the sidebar to connect</p></div>'),mv=ee('<div><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>',1);function bv(t,e){qe(e,!0);let i=se(Oe({services:[],profiles:[],defaultProfileName:"",autoName:!1,linearCreateTicketOption:!1,linkedRepos:[]})),r=se(Oe([])),S=se(Oe(iu())),E=se(!1),C=se(null),o=se(null),l=se(Oe(new Set)),h=se(!1),f=se(!1),u=se(null),v=se(null),d=se(!1),m=se(!1),_=se(!1),n=se(""),a=se(!1),s=se(null),c=se(!1),p=se(""),w=se(!1),y=se(0),k=-1,g=0,x=0,T=0,A=se(Oe(localStorage.getItem(ss)??"")),P=se(Oe(ru())),B=he(()=>Ya(b(P)).terminal),H=null,W=se(null),Y=se(Oe([])),J=se(!1),Z=se(null),L=se(Oe([])),O=se(!1),R=se(null),I=se(!1),N={},Q={},ie=null,ue=null,j=se(Oe([])),D=se("disabled"),V=se(null),M=se(null),K=0;const X=3e5,ce=5e3,ae=1e3;let de=se(Oe([])),ve=se(Oe([])),te=se(0);const fe=4e3,ye=10;let Ee=se(Oe(new Set));function Ge(U){return U?"remote":"local"}function Pe(U){const re=Ge(U),_e=N[re];if(_e)return Promise.resolve(_e);const me=Q[re];if(me)return me;const Me=_d({includeRemote:U}).then(Ie=>(N[re]=Ie,Ie)).finally(()=>{delete Q[re]});return Q[re]=Me,Me}function Ae(){return ie?Promise.resolve(ie):ue||(ue=vd().then(U=>(ie=U,U)).finally(()=>{ue=null}),ue)}function Xe(){N={},Q={},ie=null,ue=null,F(Y,[],!0),F(Z,null),F(J,!1),F(L,[],!0),F(R,null),F(O,!1)}function je(U){F(de,[...b(de),U],!0),F(Ee,new Set([...b(Ee),U.branch]),!0),F(ve,[U,...b(ve)].slice(0,ye),!0),sh(te),setTimeout(()=>{F(de,b(de).filter(re=>re.id!==U.id),!0)},fe),document.hidden&&Notification.permission==="granted"&&new Notification(U.message,{body:U.url??U.branch,tag:`wm-${U.id}`})}function pt(U){b(ve).some(re=>re.id===U.id)||F(ve,[U,...b(ve)].slice(0,ye),!0)}function gt(U){F(de,b(de).filter(re=>re.id!==U),!0),kd(U).catch(()=>{})}function St(U){F(de,b(de).filter(re=>re.id!==U),!0)}function Dr(){F(te,0)}const wt=140,Vt=500,Ne=10;let Rt=se(Oe(Math.min(Vt,Math.max(wt,su())))),Ur=se(!1);function Ce(U){return Math.min(Vt,Math.max(wt,U))}function Be(U){U.preventDefault(),F(Ur,!0);const re=U.clientX,_e=b(Rt);function me(Ie){F(Rt,Ce(_e+Ie.clientX-re),!0)}function Me(){F(Ur,!1),Lo(b(Rt)),window.removeEventListener("pointermove",me),window.removeEventListener("pointerup",Me)}window.addEventListener("pointermove",me),window.addEventListener("pointerup",Me)}function We(U){if(U.key==="ArrowLeft"||U.key==="ArrowRight"){U.preventDefault();const re=U.key==="ArrowRight"?Ne:-Ne;F(Rt,Ce(b(Rt)+re),!0),Lo(b(Rt))}}let Se=se(!1),Ue=se(!1),Ve=se(0),at=se(void 0);const ht=200;let yt=se(Oe(new Set)),_r=he(()=>b(r)),In=he(()=>nv(b(_r))),Hn=he(()=>b(_r).filter(U=>U.creating)),_l=he(()=>b(_r).filter(U=>U.creating).length),qi=he(()=>Math.max(b(y),b(_l))),vl=he(()=>b(qi)>0),Nn=he(()=>b(_r).filter(U=>!b(l).has(U.branch))),pl=he(()=>b(qi)===1?"Creating...":`Creating ${b(qi)}...`),Ke=he(()=>b(S)&&!b(l).has(b(S))?b(_r).find(U=>U.branch===b(S)):void 0),Fn=he(()=>{var U,re;return!!b(S)&&((U=b(Ke))==null?void 0:U.mux)==="✓"&&!((re=b(Ke))!=null&&re.creating)}),xs=he(()=>b(S)?b(yt).has(b(S)):!1),Wn=he(()=>b(vl)?ae:ce),gl=he(()=>b(D)!=="disabled");tt(()=>{const U=nu(b(S),b(Ke),b(Nn),b(E));U!==b(S)&&F(S,U,!0)}),tt(()=>{if(b(y)===0||k===-1)return;const U=b(W)?b(_r).find(re=>re.branch===b(W)):b(Hn).length===1?b(Hn)[0]:void 0;U&&(F(S,U.branch,!0),b(Se)&&F(Ue,!1))}),tt(()=>{H==null||H(b(Wn))}),tt(()=>{if(b(E)){if(b(Ke)){ko(b(Ke).branch);return}b(Nn).length===0&&ko(null)}}),tt(()=>{if(!b(h))return;const U=N[Ge(b(I))];if(U){F(Y,U,!0),F(J,!1),F(Z,null);return}const re=++x;F(J,!0),F(Z,null),Pe(b(I)).then(_e=>{re===x&&F(Y,_e,!0)}).catch(_e=>{re===x&&F(Z,Ht(_e),!0)}).finally(()=>{re===x&&F(J,!1)})}),tt(()=>{if(!b(h))return;if(ie){F(L,ie,!0),F(O,!1),F(R,null);return}const U=++T;F(L,[],!0),F(O,!0),F(R,null),Ae().then(re=>{U===T&&F(L,re,!0)}).catch(re=>{U===T&&F(R,Ht(re),!0)}).finally(()=>{U===T&&F(O,!1)})}),tt(()=>{document.title=b(i).name?`${b(i).name} - Dashboard`:"Dev Dashboard"});let Un=he(()=>{var re;const U=((re=b(Ke))==null?void 0:re.paneCount)??0;return U<2?[]:Array.from({length:U},(_e,me)=>({index:me,label:String(me+1)}))}),ml=he(()=>b(Se)&&b(Fn)&&b(Un).length>0);function Es(){const U=Date.now();U-K<X||(K=U,wd().then(re=>{F(D,re.availability,!0),F(j,re.issues,!0)}).catch(re=>console.warn("[linear]",re)))}async function er(){try{F(r,await fd(),!0),F(E,!0)}catch(U){console.error("Failed to refresh:",U)}Es()}function ks(U=null){F(I,!1),F(V,U,!0),F(h,!0)}function jn(U){ks(U)}async function bl(U){const re=g++,_e=b(Ke)==null,me=U.agent==="both"?2:1;_e&&(k=re),F(y,b(y)+me),_e&&F(W,U.agent==="both"?null:U.branch??null,!0),F(h,!1),F(V,null);try{const Me=pd(U);er();const Ie=await Me;_e&&F(W,Ie.primaryBranch,!0),Xe(),await er(),U.createLinearTicket&&(K=0,Es()),_e&&re===k&&(F(S,Ie.primaryBranch,!0),b(Se)&&F(Ue,!1))}catch(Me){alert(`Failed to create: ${Ht(Me)}`)}finally{F(y,Math.max(0,b(y)-me),!0),_e&&re===k&&(F(W,null),k=-1)}}function Ls(U){if(b(S)!==U)return;const re=b(In).map(Ze=>Ze.worktree),_e=re.findIndex(Ze=>Ze.branch===U),me=re[_e-1],Me=re[_e+1],Ie=[me,Me].find(Ze=>Ze&&!b(l).has(Ze.branch));F(S,Ie?Ie.branch:null,!0)}async function Sl(){const U=b(C);if(U){F(C,null),Ls(U),F(l,new Set([...b(l),U]),!0);try{await gd(U),Xe(),await er()}catch(re){alert(`Failed to remove: ${Ht(re)}`)}finally{F(l,new Set([...b(l)].filter(re=>re!==U)),!0)}}}async function wl(){const U=b(o);if(U){F(o,null),Ls(U),F(l,new Set([...b(l),U]),!0);try{await Sd(U),Xe(),await er()}catch(re){alert(`Failed to merge: ${Ht(re)}`)}finally{F(l,new Set([...b(l)].filter(re=>re!==U)),!0)}}}async function yl(){F(_,!0),F(n,"");try{const U=await Ao(b(a));U.status==="updated"||U.status==="already_up_to_date"?(F(m,!1),F(a,!1)):U.status==="merge_failed"&&!b(a)?(F(a,!0),F(n,`Fast-forward failed: ${U.error??"unknown error"}.
148
- Force pull will reset main to match remote.`)):F(n,U.error??U.status,!0)}catch(U){F(n,Ht(U),!0)}finally{F(_,!1)}}async function Cl(){if(b(s)){F(c,!0),F(p,"");try{const U=await Ao(b(w),b(s));U.status==="updated"||U.status==="already_up_to_date"?(F(s,null),F(w,!1)):U.status==="merge_failed"&&!b(w)?(F(w,!0),F(p,`Fast-forward failed: ${U.error??"unknown error"}.
149
- Force pull will reset to match remote.`)):F(p,U.error??U.status,!0)}catch(U){F(p,Ht(U),!0)}finally{F(c,!1)}}}async function zn(){const U=b(S);if(U){F(yt,new Set([...b(yt),U]),!0);try{await md(U),await er()}catch(re){alert(`Failed to open worktree: ${Ht(re)}`)}finally{F(yt,new Set([...b(yt)].filter(re=>re!==U)),!0)}}}async function xl(){const U=b(S);if(U){Ls(U);try{await bd(U),await er()}catch(re){alert(`Failed to close worktree: ${Ht(re)}`)}}}function Kn(U){const re=b(_r).filter(Me=>!b(l).has(Me.branch));if(re.length===0)return;if(!b(S)){F(S,re[U===1?0:re.length-1].branch,!0);return}const me=re.findIndex(Me=>Me.branch===b(S))+U;me>=0&&me<re.length&&F(S,re[me].branch,!0)}function Vn(U){b(h)||b(C)||b(o)||b(m)||b(s)||!(U.metaKey||U.ctrlKey)||(U.key==="ArrowUp"?(U.preventDefault(),Kn(-1)):U.key==="ArrowDown"?(U.preventDefault(),Kn(1)):U.key==="k"||U.key==="K"?(U.preventDefault(),ks()):U.key==="m"||U.key==="M"?(U.preventDefault(),b(S)&&F(o,b(S),!0)):U.key==="d"||U.key==="D"?(U.preventDefault(),b(S)&&F(C,b(S),!0)):U.key==="Enter"&&b(Ke)&&b(Ke).mux!=="✓"&&!b(Ke).creating&&!b(xs)&&(U.preventDefault(),zn()))}function El(U){var re;F(Ve,U,!0),(re=b(at))==null||re.sendSelectPane(U)}Tn(()=>{Qa(b(P)),cd().then(At=>{F(i,At,!0)}).catch(()=>{}),er(),Es();let U=b(Wn),re;window.addEventListener("keydown",Vn);let _e=Ed(je,St,pt);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});let me,Me=!1;function Ie(){re&&clearInterval(re),!(document.hidden||Me)&&(re=setInterval(er,U))}H=At=>{U!==At&&(U=At,Ie())},Ie();function Ze(){Me&&(Me=!1,er(),Ie()),clearTimeout(me),me=setTimeout(()=>{Me=!0,re&&clearInterval(re)},6e4)}document.addEventListener("click",Ze),document.addEventListener("keydown",Ze),Ze();function vr(){document.hidden?re&&clearInterval(re):(Ze(),er(),Ie())}document.addEventListener("visibilitychange",vr);const jr=window.matchMedia("(max-width: 768px)");F(Se,jr.matches,!0),b(Se)&&F(Ue,!0);function ni(At){F(Se,At.matches,!0)}return jr.addEventListener("change",ni),()=>{re&&clearInterval(re),H=null,clearTimeout(me),document.removeEventListener("click",Ze),document.removeEventListener("keydown",Ze),window.removeEventListener("keydown",Vn),document.removeEventListener("visibilitychange",vr),jr.removeEventListener("change",ni),_e()}});var qn=mv(),$i=Fe(qn),$n=z($i);{var kl=U=>{var re=uv(),_e=Fe(re);{var me=ke=>{var He=ov();ge("click",He,()=>F(Ue,!1)),ge("keydown",He,tr=>{tr.key==="Escape"&&F(Ue,!1)}),q(ke,He)};ne(_e,ke=>{b(Se)&&ke(me)})}var Me=$(_e,2),Ie=z(Me),Ze=z(Ie),vr=z(Ze),jr=z(vr),ni=$(vr,2),At=z(ni),Ds=$(At,2);{var Ts=ke=>{var He=av();ge("click",He,()=>F(Ue,!1)),q(ke,He)};ne(Ds,ke=>{b(Se)&&ke(Ts)})}var Rs=$(Ze,2);{var mt=ke=>{var He=lv(),tr=$(z(He));le(()=>oe(tr,` ${b(pl)??""}`)),q(ke,He)};ne(Rs,ke=>{b(qi)>0&&ke(mt)})}var Ft=$(Ie,2);Tu(Ft,{get rows(){return b(In)},get selected(){return b(S)},get removing(){return b(l)},get initializing(){return b(yt)},get notifiedBranches(){return b(Ee)},onselect:ke=>{F(S,ke,!0),F(Ee,new Set([...b(Ee)].filter(He=>He!==ke)),!0),b(Se)&&F(Ue,!1)},onremove:ke=>F(C,ke,!0)});var oi=$(Ft,2);{var Vl=ke=>{{let He=he(()=>b(i).mainBranch??"main"),tr=he(()=>Ri(b(i).projectDir,b(A))??"");Vo(ke,{get label(){return b(He)},get cursorUrl(){return b(tr)},onpull:()=>{F(m,!0),F(a,!1),F(n,"")}})}};ne(oi,ke=>{b(i).projectDir&&ke(Vl)})}var oo=$(oi,2);Je(oo,17,()=>(b(i).linkedRepos??[]).filter(ke=>ke.dir),ke=>ke.alias,(ke,He)=>{{let tr=he(()=>Ri(b(He).dir,b(A))??"");Vo(ke,{get label(){return b(He).alias},get cursorUrl(){return b(tr)},onpull:()=>{F(s,b(He).alias,!0),F(w,!1),F(p,"")}})}});var ao=$(oo,2);{var ql=ke=>{X_(ke,{get issues(){return b(j)},get availability(){return b(D)},onassign:jn,onselect:He=>F(M,He,!0)})};ne(ao,ke=>{b(gl)&&ke(ql)})}var $l=$(ao,2);{var Gl=ke=>{var He=cv();q(ke,He)};ne($l,ke=>{b(Se)||ke(Gl)})}var Xl=$(Me,2);{var Yl=ke=>{var He=hv();let tr;xe(He,"aria-valuemin",wt),xe(He,"aria-valuemax",Vt),le(()=>{tr=Re(He,1,"w-1 shrink-0 cursor-col-resize hover:bg-accent/50 transition-colors",null,tr,{"bg-accent":b(Ur)}),xe(He,"aria-valuenow",b(Rt))}),ge("pointerdown",He,Be),ge("keydown",He,We),q(ke,He)};ne(Xl,ke=>{b(Se)||ke(Yl)})}le(()=>{Re(Me,1,`${b(Se)?"fixed inset-0 z-50 w-full":""} bg-sidebar border-r border-edge flex flex-col overflow-hidden shrink-0`),Qt(Me,b(Se)?"":`width: ${b(Rt)}px`),oe(jr,b(i).name??"Dashboard")}),ge("click",At,()=>ks()),q(U,re)};ne($n,U=>{(!b(Se)||b(Ue))&&U(kl)})}var Ll=$($n,2),Gn=z(Ll);{let U=he(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??null}),re=he(()=>b(i).linkedRepos??[]);rd(Gn,{get name(){return b(U)},get worktree(){return b(Ke)},get sshHost(){return b(A)},get linkedRepos(){return b(re)},get isMobile(){return b(Se)},get notificationHistory(){return b(ve)},get unreadCount(){return b(te)},ontogglesidebar:()=>F(Ue,!b(Ue)),onclose:xl,onmerge:()=>{b(S)&&F(o,b(S),!0)},onremove:()=>{b(S)&&F(C,b(S),!0)},onsettings:()=>F(f,!0),ondirtyclick:()=>F(d,!0),onCiClick:_e=>F(u,_e,!0),onReviewsClick:_e=>F(v,_e,!0),onbellopen:Dr,onnotificationselect:_e=>{F(S,_e,!0),F(Ee,new Set([...b(Ee)].filter(me=>me!==_e)),!0),b(Se)&&F(Ue,!1)}})}var Xn=$(Gn,2);{var Dl=U=>{var re=Et(),_e=Fe(re);Mh(_e,()=>b(S),me=>{{let Me=he(()=>b(Se)?b(Ve):void 0);Mi(Ad(me,{get worktree(){return b(S)},get isMobile(){return b(Se)},get initialPane(){return b(Me)},get terminalTheme(){return b(B)}}),Ie=>F(at,Ie,!0),()=>b(at))}}),q(U,re)},Tl=U=>{var re=dv(),_e=z(re),me=$(z(_e),2),Me=z(me),Ie=$(me,2),Ze=z(Ie);le(vr=>{oe(Me,b(Ke).branch),oe(Ze,vr)},[()=>el(b(Ke).creationPhase)]),q(U,re)},Rl=U=>{var re=pv(),_e=z(re),me=z(_e),Me=z(me),Ie=$(me,2),Ze=z(Ie);{var vr=mt=>{var Ft=fv(),oi=z(Ft);le(()=>oe(oi,`Profile: ${b(Ke).profile??""}`)),q(mt,Ft)};ne(Ze,mt=>{b(Ke).profile&&mt(vr)})}var jr=$(Ze,2);{var ni=mt=>{var Ft=_v(),oi=z(Ft);le(()=>oe(oi,`Agent: ${b(Ke).agentName??""}`)),q(mt,Ft)};ne(jr,mt=>{b(Ke).agentName&&mt(ni)})}var At=$(Ie,2),Ds=z(At);{var Ts=mt=>{var Ft=vv();q(mt,Ft)},Rs=mt=>{var Ft=Ye("Open Session");q(mt,Ft)};ne(Ds,mt=>{b(xs)?mt(Ts):mt(Rs,-1)})}le(()=>{oe(Me,b(Ke).branch),At.disabled=b(xs)}),ge("click",At,zn),q(U,re)},Al=U=>{var re=gv();q(U,re)};ne(Xn,U=>{var re;b(Fn)?U(Dl):(re=b(Ke))!=null&&re.creating?U(Tl,1):b(Ke)?U(Rl,2):U(Al,-1)})}var Bl=$(Xn,2);{var Ml=U=>{N_(U,{get activePane(){return b(Ve)},get panes(){return b(Un)},onselect:El})};ne(Bl,U=>{b(ml)&&U(Ml)})}var Yn=$($i,2);{var Ol=U=>{{let re=he(()=>{var Ie;return((Ie=b(V))==null?void 0:Ie.branchName)??""}),_e=he(()=>b(V)?`${b(V).title}${b(V).description?`
146
+ `+i),r.b("</div>"),r.fl()},partials:{},subs:{}});it["tag-file-added"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}});it["tag-file-changed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}});it["tag-file-deleted"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}});it["tag-file-renamed"]=new et.Template({code:function(t,e,i){var r=this;return r.b(i=i||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class S_{constructor({compiledTemplates:e={},rawTemplates:i={}}){const r=Object.entries(i).reduce((S,[E,C])=>{const o=et.compile(C,{asString:!1});return Object.assign(Object.assign({},S),{[E]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},it),e),r)}static compile(e){return et.compile(e,{asString:!1})}render(e,i,r,S,E){const C=this.templateKey(e,i);try{return this.preCompiledTemplates[C].render(r,S,E)}catch{throw new Error(`Could not find template to render '${C}'`)}}template(e,i){return this.preCompiledTemplates[this.templateKey(e,i)]}templateKey(e,i){return`${e}-${i}`}}const w_=Object.assign(Object.assign(Object.assign({},dl),fl),{outputFormat:Wf.LINE_BY_LINE,drawFileList:!0});function y_(t,e={}){const i=Object.assign(Object.assign({},w_),e),r=typeof t=="string"?Xf(t,i):t,S=new S_(i),{colorScheme:E}=i,C={colorScheme:E},o=i.drawFileList?new c_(S,C).render(r):"",l=i.outputFormat==="side-by-side"?new p_(S,i).render(r):new d_(S,i).render(r);return o+l}var Bt={},Ko;function C_(){if(Ko)return Bt;Ko=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ColorSchemeType=Bt.DiffStyleType=Bt.LineMatchingType=Bt.OutputFormatType=Bt.LineType=void 0;var t;(function(i){i.INSERT="insert",i.DELETE="delete",i.CONTEXT="context"})(t||(Bt.LineType=t={})),Bt.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},Bt.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},Bt.DiffStyleType={WORD:"word",CHAR:"char"};var e;return(function(i){i.AUTO="auto",i.DARK="dark",i.LIGHT="light"})(e||(Bt.ColorSchemeType=e={})),Bt}var x_=C_(),E_=ee('<div class="text-sm text-muted py-8 text-center">Loading diff...</div>'),k_=ee('<div class="text-sm text-danger py-8 text-center"> </div>'),L_=ee('<div class="text-sm text-muted py-8 text-center">No changes</div>'),D_=ee('<div class="text-[11px] text-warning px-3 py-1">Truncated (exceeded 200KB)</div>'),T_=ee('<div class="diff-container overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge svelte-12rjmc4"><!> <!></div>'),R_=ee('<div class="overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge"><div class="px-3 py-2 text-[11px] text-muted border-b border-edge bg-surface font-mono">git status --short</div> <pre class="git-status-output svelte-12rjmc4"> </pre></div>'),A_=ee('<li class="flex items-baseline gap-2 px-3 py-1.5 border-b border-edge last:border-b-0"><code class="text-[11px] text-accent shrink-0"> </code> <span class="text-[12px] text-primary"> </span></li>'),B_=ee('<ul class="commit-list overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge list-none m-0 p-0"></ul>'),M_=ee('<div class="flex gap-1 mb-3"><button type="button">Current diff</button> <button type="button"> </button> <button type="button"> </button></div> <!>',1),O_=ee('<div class="mb-4 flex flex-wrap items-center justify-between gap-3"><h2 class="text-base">Changes &mdash; <span class="font-mono text-sm"> </span></h2> <!></div> <!> <div class="flex justify-end mt-4"><!></div>',1);function P_(t,e){qe(e,!0);let i=pe(e,"cursorUrl",3,null),r=se(""),S=se(!1),E=se(""),C=se(Pe([])),o=se(!0),l=se("");lt(()=>{W(o,!0),W(l,""),Dd(e.branch).then(_=>{W(r,_.uncommitted,!0),W(S,_.uncommittedTruncated,!0),W(E,_.gitStatus,!0),W(C,_.unpushedCommits,!0)}).catch(_=>{W(l,Ht(_),!0)}).finally(()=>{W(o,!1)})});const h={outputFormat:"line-by-line",colorScheme:x_.ColorSchemeType.AUTO,drawFileList:!1};let f=le(()=>b(r)?y_(b(r),h):""),u=le(()=>b(E)?b(E).split(`
147
+ `).filter(_=>_.length>0).length:0),v=le(()=>!!b(r)||b(u)>0||b(C).length>0),d=se("diff"),m=!1;lt(()=>{!b(o)&&!b(l)&&!m&&(m=!0,W(d,b(r)?"diff":b(u)>0?"status":"unpushed",!0))}),si(t,{get onclose(){return e.onclose},wide:!0,maxWidth:"90vw",className:"diff-dialog",children:(_,n)=>{var a=O_(),s=Fe(a),c=z(s),p=$(z(c)),w=z(p),y=$(c,2);{var k=F=>{Rn(F,{get url(){return i()}})};ne(y,F=>{i()&&F(k)})}var g=$(s,2);{var x=F=>{var Y=E_();q(F,Y)},T=F=>{var Y=k_(),J=z(Y);ce(()=>oe(J,b(l))),q(F,Y)},A=F=>{var Y=L_();q(F,Y)},P=F=>{var Y=M_(),J=Fe(Y),Z=z(J);let L;var O=$(Z,2);let R;var I=z(O),N=$(O,2);let Q;var ie=z(N),ue=$(J,2);{var j=B=>{var K=T_(),X=z(K);{var he=de=>{var ve=D_();q(de,ve)};ne(X,de=>{b(S)&&de(he)})}var ae=$(X,2);Hh(ae,()=>b(f)),q(B,K)},D=B=>{var K=R_(),X=$(z(K),2),he=z(X);ce(()=>oe(he,b(E))),q(B,K)},V=B=>{var K=B_();Je(K,21,()=>b(C),X=>X.hash,(X,he)=>{var ae=A_(),de=z(ae),ve=z(de),te=$(de,2),fe=z(te);ce(()=>{oe(ve,b(he).hash),oe(fe,b(he).message)}),q(X,ae)}),q(B,K)};ne(ue,B=>{b(d)==="diff"&&b(r)?B(j):b(d)==="status"&&b(u)>0?B(D,1):b(d)==="unpushed"&&b(C).length>0&&B(V,2)})}ce(()=>{L=Re(Z,1,"tab-btn svelte-12rjmc4",null,L,{active:b(d)==="diff"}),Z.disabled=!b(r),R=Re(O,1,"tab-btn svelte-12rjmc4",null,R,{active:b(d)==="status"}),O.disabled=b(u)===0,oe(I,`Git status (${b(u)??""})`),Q=Re(N,1,"tab-btn svelte-12rjmc4",null,Q,{active:b(d)==="unpushed"}),N.disabled=b(C).length===0,oe(ie,`Unpushed commits (${b(C).length??""})`)}),ge("click",Z,()=>W(d,"diff")),ge("click",O,()=>W(d,"status")),ge("click",N,()=>W(d,"unpushed")),q(F,Y)};ne(g,F=>{b(o)?F(x):b(l)?F(T,1):b(v)?F(P,-1):F(A,2)})}var M=$(g,2),H=z(M);_t(H,{type:"button",get onclick(){return e.onclose},children:(F,Y)=>{var J=Ye("Close");q(F,J)},$$slots:{default:!0}}),ce(()=>oe(w,e.branch)),q(_,a)},$$slots:{default:!0}}),$e()}bt(["click"]);var I_=ee('<button type="button"> </button>'),H_=ee('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function N_(t,e){qe(e,!0);var i=H_();Je(i,21,()=>e.panes,r=>r.index,(r,S)=>{var E=I_(),C=z(E);ce(()=>{Re(E,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${e.activePane===b(S).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),oe(C,b(S).label)}),ge("click",E,()=>e.onselect(b(S).index)),q(r,E)}),q(t,i),$e()}bt(["click"]);var F_=ee('<div class="toast svelte-1974bvt" role="alert" style="inline-size: fit-content; max-inline-size: min(48ch, calc(100vw - 2rem));"><button type="button" class="min-w-0 flex items-start gap-2 text-left bg-transparent border-none text-inherit cursor-pointer p-0"><!></button> <button type="button" class="shrink-0 w-6 h-6 flex items-center justify-center text-muted hover:text-primary cursor-pointer bg-transparent border-none text-sm">&times;</button></div>'),W_=ee('<div class="fixed bottom-4 right-4 z-50 flex flex-col items-end gap-2"></div>');function U_(t,e){qe(e,!0);var i=Et(),r=Fe(i);{var S=E=>{var C=W_();Je(C,21,()=>e.notifications,o=>o.id,(o,l)=>{var h=F_(),f=z(h),u=z(f);rl(u,{get notification(){return b(l)},large:!0,wrap:!0});var v=$(f,2);ge("click",f,()=>{e.ondismiss(b(l).id),e.onselect(b(l).branch)}),ge("click",v,()=>e.ondismiss(b(l).id)),q(o,h)}),q(E,C)};ne(r,E=>{e.notifications.length>0&&E(S)})}q(t,i),$e()}bt(["click"]);var j_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">Set <code>LINEAR_API_KEY</code> to show your assigned Linear issues here.</p>'),z_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">No assigned Linear issues right now.</p>'),K_=ee('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),V_=ee('<li class="mb-1 p-2 rounded-md border border-transparent hover:bg-hover text-[12px] cursor-pointer" role="button" tabindex="0"><div class="flex items-center gap-1.5 mb-0.5"><span class="shrink-0 w-2 h-2 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-[11px] text-accent no-underline hover:underline"> </a> <span class="text-[10px] text-muted"> </span></div> <p class="truncate text-primary mb-1 m-0"> </p> <!> <div class="flex items-center justify-between gap-2"><span class="text-[10px] text-muted truncate"> <!></span> <span role="none"><!></span></div></li>'),q_=ee('<div class="px-2 pb-1"><input type="text" placeholder="Search issues…" class="w-full px-2 py-1 text-xs rounded border border-edge bg-surface text-primary placeholder:text-muted outline-none focus:border-accent"/></div> <ul class="list-none overflow-y-auto max-h-64 px-2 pb-2"></ul>',1),$_=ee('<p class="m-0 px-4 pb-3 text-xs text-muted">Linear integration is disabled in this project.</p>'),G_=ee('<div class="border-t border-edge"><button type="button" class="w-full flex items-center justify-between px-4 py-2 text-xs text-muted cursor-pointer bg-transparent border-none hover:bg-hover"><span class="font-semibold"> </span> <span class="text-[10px]"> </span></button> <!></div>');function X_(t,e){qe(e,!0);let i=se(!0),r=se(""),S=le(()=>b(r)?e.issues.filter(m=>un(b(r),m.title)||(m.description?un(b(r),m.description):!1)):e.issues),E=le(()=>e.availability==="ready"?` (${b(S).length!==e.issues.length?`${b(S).length}/`:""}${e.issues.length})`:"");var C=G_(),o=z(C),l=z(o),h=z(l),f=$(l,2),u=z(f),v=$(o,2);{var d=m=>{var _=Et(),n=Fe(_);{var a=p=>{var w=j_();q(p,w)},s=p=>{var w=Et(),y=Fe(w);{var k=x=>{var T=z_();q(x,T)},g=x=>{var T=q_(),A=Fe(T),P=z(A),M=$(A,2);Je(M,21,()=>b(S),H=>H.id,(H,F)=>{var Y=V_(),J=z(Y),Z=z(J),L=$(Z,2),O=z(L),R=$(L,2),I=z(R),N=$(J,2),Q=z(N),ie=$(N,2);{var ue=ae=>{var de=K_(),ve=z(de);ce(()=>oe(ve,b(F).description)),q(ae,de)};ne(ie,ae=>{b(F).description&&ae(ue)})}var j=$(ie,2),D=z(j),V=z(D),B=$(V);{var K=ae=>{var de=Ye();ce(()=>oe(de,`· ${b(F).project??""}`)),q(ae,de)};ne(B,ae=>{b(F).project&&ae(K)})}var X=$(D,2),he=z(X);_t(he,{small:!0,variant:"accent-outline",onclick:()=>e.onassign(b(F)),children:(ae,de)=>{var ve=Ye("Implement");q(ae,ve)},$$slots:{default:!0}}),ce(()=>{Qt(Z,`background: ${b(F).state.color??""};`),xe(Z,"title",b(F).state.name),xe(L,"href",b(F).url),oe(O,b(F).identifier),oe(I,b(F).priorityLabel),oe(Q,b(F).title),oe(V,b(F).team.key)}),ge("click",Y,()=>e.onselect(b(F))),ge("keydown",Y,ae=>{(ae.key==="Enter"||ae.key===" ")&&(ae.preventDefault(),e.onselect(b(F)))}),ge("click",L,ae=>ae.stopPropagation()),ge("keydown",L,ae=>ae.stopPropagation()),ge("click",X,ae=>ae.stopPropagation()),ge("keydown",X,ae=>{(ae.key==="Enter"||ae.key===" ")&&ae.stopPropagation()}),q(H,Y)}),Jr(P,()=>b(r),H=>W(r,H)),q(x,T)};ne(y,x=>{e.issues.length===0?x(k):x(g,-1)})}q(p,w)},c=p=>{var w=$_();q(p,w)};ne(n,p=>{e.availability==="missing_api_key"?p(a):e.availability==="ready"?p(s,1):p(c,-1)})}q(m,_)};ne(v,m=>{b(i)||m(d)})}ce(()=>{oe(h,`Linear${b(E)??""}`),oe(u,b(i)?"▸":"▾")}),ge("click",o,()=>W(i,!b(i))),q(t,C),$e()}bt(["click","keydown"]);var Y_=ee('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),J_=ee('<p class="text-[13px] text-muted italic mb-4">No description</p>'),Z_=ee("<span> </span>"),Q_=ee('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),ev=ee("<span> </span>"),tv=ee('<div class="flex items-center gap-2 mb-1"><span class="shrink-0 w-2.5 h-2.5 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-xs text-accent no-underline hover:underline"> </a> <span class="text-[11px] text-muted"> </span> <span class="text-[11px] text-muted"> </span></div> <h2 class="text-base font-semibold mb-3"> </h2> <!> <div class="flex items-center gap-3 text-[11px] text-muted mb-4"><span> </span> <!> <!> <!></div> <div class="flex justify-end gap-2"><!> <!></div>',1);function rv(t,e){qe(e,!0),si(t,{get onclose(){return e.onclose},wide:!0,children:(i,r)=>{var S=tv(),E=Fe(S),C=z(E),o=$(C,2),l=z(o),h=$(o,2),f=z(h),u=$(h,2),v=z(u),d=$(E,2),m=z(d),_=$(d,2);{var n=H=>{var F=Y_(),Y=z(F);ce(()=>oe(Y,e.issue.description)),q(H,F)},a=H=>{var F=J_();q(H,F)};ne(_,H=>{e.issue.description?H(n):H(a,-1)})}var s=$(_,2),c=z(s),p=z(c),w=$(c,2);{var y=H=>{var F=Z_(),Y=z(F);ce(()=>oe(Y,`· ${e.issue.project??""}`)),q(H,F)};ne(w,H=>{e.issue.project&&H(y)})}var k=$(w,2);{var g=H=>{var F=Et(),Y=Fe(F);Je(Y,17,()=>e.issue.labels,J=>J.name,(J,Z)=>{var L=Q_(),O=z(L);ce(()=>{Qt(L,`color: ${b(Z).color??""}; background: ${b(Z).color??""}20;`),oe(O,b(Z).name)}),q(J,L)}),q(H,F)};ne(k,H=>{e.issue.labels.length>0&&H(g)})}var x=$(k,2);{var T=H=>{var F=ev(),Y=z(F);ce(()=>oe(Y,`Due ${e.issue.dueDate??""}`)),q(H,F)};ne(x,H=>{e.issue.dueDate&&H(T)})}var A=$(s,2),P=z(A);_t(P,{get onclick(){return e.onclose},children:(H,F)=>{var Y=Ye("Close");q(H,Y)},$$slots:{default:!0}});var M=$(P,2);_t(M,{variant:"accent-outline",onclick:()=>e.onassign(e.issue),children:(H,F)=>{var Y=Ye("Implement");q(H,Y)},$$slots:{default:!0}}),ce(()=>{Qt(C,`background: ${e.issue.state.color??""};`),xe(C,"title",e.issue.state.name),xe(o,"href",e.issue.url),oe(l,e.issue.identifier),oe(f,e.issue.state.name),oe(v,`· ${e.issue.priorityLabel??""}`),oe(m,e.issue.title),oe(p,e.issue.team.key)}),q(i,S)},$$slots:{default:!0}}),$e()}var iv=ee('<div class="shrink-0 border-t border-edge px-3 py-2 flex items-center gap-2"><span class="text-[11px] text-muted font-medium truncate"> </span> <!> <button type="button" class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-edge text-muted font-medium cursor-pointer hover:bg-hover hover:text-primary" title="Pull latest from remote">Pull</button></div>');function Vo(t,e){var i=iv(),r=z(i),S=z(r),E=$(r,2);Rn(E,{get url(){return e.cursorUrl}});var C=$(E,2);ce(()=>oe(S,e.label)),ge("click",C,function(...o){var l;(l=e.onpull)==null||l.apply(this,o)}),q(t,i)}bt(["click"]);function sv(t,e){return!t.baseBranch||t.baseBranch===t.branch?null:e.has(t.baseBranch)?t.baseBranch:null}function nv(t){const e=new Map(t.map(o=>[o.branch,o])),i=new Map,r=[];for(const o of t){const l=sv(o,e);if(!l){r.push(o);continue}const h=i.get(l)??[];h.push(o),i.set(l,h)}const S=[],E=new Set;function C(o,l){if(!E.has(o.branch)){E.add(o.branch),S.push({worktree:o,depth:l});for(const h of i.get(o.branch)??[])C(h,l+1)}}for(const o of r)C(o,0);for(const o of t)C(o,0);return S}var ov=ee('<div class="fixed inset-0 bg-black/50 z-40"></div>'),av=ee('<button class="h-8 w-8 rounded-md border border-edge bg-surface text-muted text-sm flex items-center justify-center cursor-pointer hover:bg-hover" title="Close sidebar">&times;</button>'),lv=ee('<div class="mt-2 flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </div>'),cv=ee('<div class="shrink-0 border-t border-edge px-4 py-3 text-[11px] text-muted flex flex-col gap-1"><div class="flex justify-between"><span>Navigate</span><kbd class="opacity-60">Cmd+Up/Down</kbd></div> <div class="flex justify-between"><span>New worktree</span><kbd class="opacity-60">Cmd+K</kbd></div> <div class="flex justify-between"><span>Merge</span><kbd class="opacity-60">Cmd+M</kbd></div> <div class="flex justify-between"><span>Remove</span><kbd class="opacity-60">Cmd+D</kbd></div></div>'),hv=ee('<div role="separator" aria-label="Resize sidebar" aria-orientation="vertical" tabindex="0"></div>'),uv=ee('<!> <aside><div class="p-4 border-b border-edge"><div class="flex items-center justify-between"><h1 class="text-base font-semibold"> </h1> <div class="flex items-center gap-2"><button class="h-8 px-2 gap-1.5 rounded-md border border-edge bg-surface text-accent text-xs flex items-center justify-center cursor-pointer hover:bg-hover disabled:opacity-50 disabled:cursor-not-allowed" title="New Worktree (Cmd+K)"><span class="text-lg leading-none">+</span> New</button> <!></div></div> <!></div> <!> <!> <!> <!> <!></aside> <!>',1),dv=ee('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-3 text-center"><span class="spinner" style="width: 24px; height: 24px; border-width: 2px;"></span> <p class="text-sm text-primary font-medium"> </p> <p class="text-xs text-muted"> </p></div></div>'),fv=ee('<span class="text-xs text-muted"> </span>'),_v=ee('<span class="text-xs text-muted"> </span>'),vv=ee('<span class="spinner" style="width: 14px; height: 14px; border-width: 1.5px;"></span> Opening...',1),pv=ee('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-4 text-center"><p class="text-sm text-primary font-medium"> </p> <div class="flex flex-col items-center gap-1"><!> <!></div> <button class="mt-2 px-5 py-2 rounded-md bg-accent text-white text-sm font-medium cursor-pointer border-none hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"><!></button></div></div>'),gv=ee('<div class="flex-1 flex items-center justify-center text-muted text-sm"><p>Select a worktree from the sidebar to connect</p></div>'),mv=ee('<div><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>',1);function bv(t,e){qe(e,!0);let i=se(Pe({services:[],profiles:[],defaultProfileName:"",autoName:!1,linearCreateTicketOption:!1,linkedRepos:[]})),r=se(Pe([])),S=se(Pe(iu())),E=se(!1),C=se(null),o=se(null),l=se(Pe(new Set)),h=se(!1),f=se(!1),u=se(null),v=se(null),d=se(!1),m=se(!1),_=se(!1),n=se(""),a=se(!1),s=se(null),c=se(!1),p=se(""),w=se(!1),y=se(0),k=-1,g=0,x=0,T=0,A=se(Pe(localStorage.getItem(ss)??"")),P=se(Pe(ru())),M=le(()=>Ya(b(P)).terminal),H=null,F=se(null),Y=se(Pe([])),J=se(!1),Z=se(null),L=se(Pe([])),O=se(!1),R=se(null),I=se(!1),N={},Q={},ie=null,ue=null,j=se(Pe([])),D=se("disabled"),V=se(null),B=se(null),K=0;const X=3e5,he=5e3,ae=1e3;let de=se(Pe([])),ve=se(Pe([])),te=se(0);const fe=4e3,ye=10;let Ee=se(Pe(new Set));function Ge(U){return U?"remote":"local"}function Oe(U){const re=Ge(U),_e=N[re];if(_e)return Promise.resolve(_e);const me=Q[re];if(me)return me;const Me=_d({includeRemote:U}).then(Ie=>(N[re]=Ie,Ie)).finally(()=>{delete Q[re]});return Q[re]=Me,Me}function Ae(){return ie?Promise.resolve(ie):ue||(ue=vd().then(U=>(ie=U,U)).finally(()=>{ue=null}),ue)}function Xe(){N={},Q={},ie=null,ue=null,W(Y,[],!0),W(Z,null),W(J,!1),W(L,[],!0),W(R,null),W(O,!1)}function je(U){W(de,[...b(de),U],!0),W(Ee,new Set([...b(Ee),U.branch]),!0),W(ve,[U,...b(ve)].slice(0,ye),!0),sh(te),setTimeout(()=>{W(de,b(de).filter(re=>re.id!==U.id),!0)},fe),document.hidden&&Notification.permission==="granted"&&new Notification(U.message,{body:U.url??U.branch,tag:`wm-${U.id}`})}function pt(U){b(ve).some(re=>re.id===U.id)||W(ve,[U,...b(ve)].slice(0,ye),!0)}function gt(U){W(de,b(de).filter(re=>re.id!==U),!0),kd(U).catch(()=>{})}function St(U){W(de,b(de).filter(re=>re.id!==U),!0)}function Dr(){W(te,0)}const wt=140,Vt=500,Ne=10;let Rt=se(Pe(Math.min(Vt,Math.max(wt,su())))),Ur=se(!1);function Ce(U){return Math.min(Vt,Math.max(wt,U))}function Be(U){U.preventDefault(),W(Ur,!0);const re=U.clientX,_e=b(Rt);function me(Ie){W(Rt,Ce(_e+Ie.clientX-re),!0)}function Me(){W(Ur,!1),Lo(b(Rt)),window.removeEventListener("pointermove",me),window.removeEventListener("pointerup",Me)}window.addEventListener("pointermove",me),window.addEventListener("pointerup",Me)}function We(U){if(U.key==="ArrowLeft"||U.key==="ArrowRight"){U.preventDefault();const re=U.key==="ArrowRight"?Ne:-Ne;W(Rt,Ce(b(Rt)+re),!0),Lo(b(Rt))}}let Se=se(!1),Ue=se(!1),Ve=se(0),ot=se(void 0);const ht=200;let yt=se(Pe(new Set)),_r=le(()=>b(r)),In=le(()=>nv(b(_r))),Hn=le(()=>b(_r).filter(U=>U.creating)),_l=le(()=>b(_r).filter(U=>U.creating).length),qi=le(()=>Math.max(b(y),b(_l))),vl=le(()=>b(qi)>0),Nn=le(()=>b(_r).filter(U=>!b(l).has(U.branch))),pl=le(()=>b(qi)===1?"Creating...":`Creating ${b(qi)}...`),Ke=le(()=>b(S)&&!b(l).has(b(S))?b(_r).find(U=>U.branch===b(S)):void 0),Fn=le(()=>{var U,re;return!!b(S)&&((U=b(Ke))==null?void 0:U.mux)==="✓"&&!((re=b(Ke))!=null&&re.creating)}),xs=le(()=>b(S)?b(yt).has(b(S)):!1),Wn=le(()=>b(vl)?ae:he),gl=le(()=>b(D)!=="disabled");lt(()=>{const U=nu(b(S),b(Ke),b(Nn),b(E));U!==b(S)&&W(S,U,!0)}),lt(()=>{if(b(y)===0||k===-1)return;const U=b(F)?b(_r).find(re=>re.branch===b(F)):b(Hn).length===1?b(Hn)[0]:void 0;U&&(W(S,U.branch,!0),b(Se)&&W(Ue,!1))}),lt(()=>{H==null||H(b(Wn))}),lt(()=>{if(b(E)){if(b(Ke)){ko(b(Ke).branch);return}b(Nn).length===0&&ko(null)}}),lt(()=>{if(!b(h))return;const U=N[Ge(b(I))];if(U){W(Y,U,!0),W(J,!1),W(Z,null);return}const re=++x;W(J,!0),W(Z,null),Oe(b(I)).then(_e=>{re===x&&W(Y,_e,!0)}).catch(_e=>{re===x&&W(Z,Ht(_e),!0)}).finally(()=>{re===x&&W(J,!1)})}),lt(()=>{if(!b(h))return;if(ie){W(L,ie,!0),W(O,!1),W(R,null);return}const U=++T;W(L,[],!0),W(O,!0),W(R,null),Ae().then(re=>{U===T&&W(L,re,!0)}).catch(re=>{U===T&&W(R,Ht(re),!0)}).finally(()=>{U===T&&W(O,!1)})}),lt(()=>{document.title=b(i).name?`${b(i).name} - Dashboard`:"Dev Dashboard"});let Un=le(()=>{var re;const U=((re=b(Ke))==null?void 0:re.paneCount)??0;return U<2?[]:Array.from({length:U},(_e,me)=>({index:me,label:String(me+1)}))}),ml=le(()=>b(Se)&&b(Fn)&&b(Un).length>0);function Es(){const U=Date.now();U-K<X||(K=U,wd().then(re=>{W(D,re.availability,!0),W(j,re.issues,!0)}).catch(re=>console.warn("[linear]",re)))}async function er(){try{W(r,await fd(),!0),W(E,!0)}catch(U){console.error("Failed to refresh:",U)}Es()}function ks(U=null){W(I,!1),W(V,U,!0),W(h,!0)}function jn(U){ks(U)}async function bl(U){const re=g++,_e=b(Ke)==null,me=U.agent==="both"?2:1;_e&&(k=re),W(y,b(y)+me),_e&&W(F,U.agent==="both"?null:U.branch??null,!0),W(h,!1),W(V,null);try{const Me=pd(U);er();const Ie=await Me;_e&&W(F,Ie.primaryBranch,!0),Xe(),await er(),U.createLinearTicket&&(K=0,Es()),_e&&re===k&&(W(S,Ie.primaryBranch,!0),b(Se)&&W(Ue,!1))}catch(Me){alert(`Failed to create: ${Ht(Me)}`)}finally{W(y,Math.max(0,b(y)-me),!0),_e&&re===k&&(W(F,null),k=-1)}}function Ls(U){if(b(S)!==U)return;const re=b(In).map(Ze=>Ze.worktree),_e=re.findIndex(Ze=>Ze.branch===U),me=re[_e-1],Me=re[_e+1],Ie=[me,Me].find(Ze=>Ze&&!b(l).has(Ze.branch));W(S,Ie?Ie.branch:null,!0)}async function Sl(){const U=b(C);if(U){W(C,null),Ls(U),W(l,new Set([...b(l),U]),!0);try{await gd(U),Xe(),await er()}catch(re){alert(`Failed to remove: ${Ht(re)}`)}finally{W(l,new Set([...b(l)].filter(re=>re!==U)),!0)}}}async function wl(){const U=b(o);if(U){W(o,null),Ls(U),W(l,new Set([...b(l),U]),!0);try{await Sd(U),Xe(),await er()}catch(re){alert(`Failed to merge: ${Ht(re)}`)}finally{W(l,new Set([...b(l)].filter(re=>re!==U)),!0)}}}async function yl(){W(_,!0),W(n,"");try{const U=await Ao(b(a));U.status==="updated"||U.status==="already_up_to_date"?(W(m,!1),W(a,!1)):U.status==="merge_failed"&&!b(a)?(W(a,!0),W(n,`Fast-forward failed: ${U.error??"unknown error"}.
148
+ Force pull will reset main to match remote.`)):W(n,U.error??U.status,!0)}catch(U){W(n,Ht(U),!0)}finally{W(_,!1)}}async function Cl(){if(b(s)){W(c,!0),W(p,"");try{const U=await Ao(b(w),b(s));U.status==="updated"||U.status==="already_up_to_date"?(W(s,null),W(w,!1)):U.status==="merge_failed"&&!b(w)?(W(w,!0),W(p,`Fast-forward failed: ${U.error??"unknown error"}.
149
+ Force pull will reset to match remote.`)):W(p,U.error??U.status,!0)}catch(U){W(p,Ht(U),!0)}finally{W(c,!1)}}}async function zn(){const U=b(S);if(U){W(yt,new Set([...b(yt),U]),!0);try{await md(U),await er()}catch(re){alert(`Failed to open worktree: ${Ht(re)}`)}finally{W(yt,new Set([...b(yt)].filter(re=>re!==U)),!0)}}}async function xl(){const U=b(S);if(U){Ls(U);try{await bd(U),await er()}catch(re){alert(`Failed to close worktree: ${Ht(re)}`)}}}function Kn(U){const re=b(_r).filter(Me=>!b(l).has(Me.branch));if(re.length===0)return;if(!b(S)){W(S,re[U===1?0:re.length-1].branch,!0);return}const me=re.findIndex(Me=>Me.branch===b(S))+U;me>=0&&me<re.length&&W(S,re[me].branch,!0)}function Vn(U){b(h)||b(C)||b(o)||b(m)||b(s)||!(U.metaKey||U.ctrlKey)||(U.key==="ArrowUp"?(U.preventDefault(),Kn(-1)):U.key==="ArrowDown"?(U.preventDefault(),Kn(1)):U.key==="k"||U.key==="K"?(U.preventDefault(),ks()):U.key==="m"||U.key==="M"?(U.preventDefault(),b(S)&&W(o,b(S),!0)):U.key==="d"||U.key==="D"?(U.preventDefault(),b(S)&&W(C,b(S),!0)):U.key==="Enter"&&b(Ke)&&b(Ke).mux!=="✓"&&!b(Ke).creating&&!b(xs)&&(U.preventDefault(),zn()))}function El(U){var re;W(Ve,U,!0),(re=b(ot))==null||re.sendSelectPane(U)}Tn(()=>{Qa(b(P)),cd().then(At=>{W(i,At,!0)}).catch(()=>{}),er(),Es();let U=b(Wn),re;window.addEventListener("keydown",Vn);let _e=Ed(je,St,pt);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});let me,Me=!1;function Ie(){re&&clearInterval(re),!(document.hidden||Me)&&(re=setInterval(er,U))}H=At=>{U!==At&&(U=At,Ie())},Ie();function Ze(){Me&&(Me=!1,er(),Ie()),clearTimeout(me),me=setTimeout(()=>{Me=!0,re&&clearInterval(re)},6e4)}document.addEventListener("click",Ze),document.addEventListener("keydown",Ze),Ze();function vr(){document.hidden?re&&clearInterval(re):(Ze(),er(),Ie())}document.addEventListener("visibilitychange",vr);const jr=window.matchMedia("(max-width: 768px)");W(Se,jr.matches,!0),b(Se)&&W(Ue,!0);function ni(At){W(Se,At.matches,!0)}return jr.addEventListener("change",ni),()=>{re&&clearInterval(re),H=null,clearTimeout(me),document.removeEventListener("click",Ze),document.removeEventListener("keydown",Ze),window.removeEventListener("keydown",Vn),document.removeEventListener("visibilitychange",vr),jr.removeEventListener("change",ni),_e()}});var qn=mv(),$i=Fe(qn),$n=z($i);{var kl=U=>{var re=uv(),_e=Fe(re);{var me=ke=>{var He=ov();ge("click",He,()=>W(Ue,!1)),ge("keydown",He,tr=>{tr.key==="Escape"&&W(Ue,!1)}),q(ke,He)};ne(_e,ke=>{b(Se)&&ke(me)})}var Me=$(_e,2),Ie=z(Me),Ze=z(Ie),vr=z(Ze),jr=z(vr),ni=$(vr,2),At=z(ni),Ds=$(At,2);{var Ts=ke=>{var He=av();ge("click",He,()=>W(Ue,!1)),q(ke,He)};ne(Ds,ke=>{b(Se)&&ke(Ts)})}var Rs=$(Ze,2);{var mt=ke=>{var He=lv(),tr=$(z(He));ce(()=>oe(tr,` ${b(pl)??""}`)),q(ke,He)};ne(Rs,ke=>{b(qi)>0&&ke(mt)})}var Ft=$(Ie,2);Tu(Ft,{get rows(){return b(In)},get selected(){return b(S)},get removing(){return b(l)},get initializing(){return b(yt)},get notifiedBranches(){return b(Ee)},onselect:ke=>{W(S,ke,!0),W(Ee,new Set([...b(Ee)].filter(He=>He!==ke)),!0),b(Se)&&W(Ue,!1)},onremove:ke=>W(C,ke,!0)});var oi=$(Ft,2);{var Vl=ke=>{{let He=le(()=>b(i).mainBranch??"main"),tr=le(()=>Ri(b(i).projectDir,b(A))??"");Vo(ke,{get label(){return b(He)},get cursorUrl(){return b(tr)},onpull:()=>{W(m,!0),W(a,!1),W(n,"")}})}};ne(oi,ke=>{b(i).projectDir&&ke(Vl)})}var oo=$(oi,2);Je(oo,17,()=>(b(i).linkedRepos??[]).filter(ke=>ke.dir),ke=>ke.alias,(ke,He)=>{{let tr=le(()=>Ri(b(He).dir,b(A))??"");Vo(ke,{get label(){return b(He).alias},get cursorUrl(){return b(tr)},onpull:()=>{W(s,b(He).alias,!0),W(w,!1),W(p,"")}})}});var ao=$(oo,2);{var ql=ke=>{X_(ke,{get issues(){return b(j)},get availability(){return b(D)},onassign:jn,onselect:He=>W(B,He,!0)})};ne(ao,ke=>{b(gl)&&ke(ql)})}var $l=$(ao,2);{var Gl=ke=>{var He=cv();q(ke,He)};ne($l,ke=>{b(Se)||ke(Gl)})}var Xl=$(Me,2);{var Yl=ke=>{var He=hv();let tr;xe(He,"aria-valuemin",wt),xe(He,"aria-valuemax",Vt),ce(()=>{tr=Re(He,1,"w-1 shrink-0 cursor-col-resize hover:bg-accent/50 transition-colors",null,tr,{"bg-accent":b(Ur)}),xe(He,"aria-valuenow",b(Rt))}),ge("pointerdown",He,Be),ge("keydown",He,We),q(ke,He)};ne(Xl,ke=>{b(Se)||ke(Yl)})}ce(()=>{Re(Me,1,`${b(Se)?"fixed inset-0 z-50 w-full":""} bg-sidebar border-r border-edge flex flex-col overflow-hidden shrink-0`),Qt(Me,b(Se)?"":`width: ${b(Rt)}px`),oe(jr,b(i).name??"Dashboard")}),ge("click",At,()=>ks()),q(U,re)};ne($n,U=>{(!b(Se)||b(Ue))&&U(kl)})}var Ll=$($n,2),Gn=z(Ll);{let U=le(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??null}),re=le(()=>b(i).linkedRepos??[]);rd(Gn,{get name(){return b(U)},get worktree(){return b(Ke)},get sshHost(){return b(A)},get linkedRepos(){return b(re)},get isMobile(){return b(Se)},get notificationHistory(){return b(ve)},get unreadCount(){return b(te)},ontogglesidebar:()=>W(Ue,!b(Ue)),onclose:xl,onmerge:()=>{b(S)&&W(o,b(S),!0)},onremove:()=>{b(S)&&W(C,b(S),!0)},onsettings:()=>W(f,!0),ondirtyclick:()=>W(d,!0),onCiClick:_e=>W(u,_e,!0),onReviewsClick:_e=>W(v,_e,!0),onbellopen:Dr,onnotificationselect:_e=>{W(S,_e,!0),W(Ee,new Set([...b(Ee)].filter(me=>me!==_e)),!0),b(Se)&&W(Ue,!1)}})}var Xn=$(Gn,2);{var Dl=U=>{var re=Et(),_e=Fe(re);Mh(_e,()=>b(S),me=>{{let Me=le(()=>b(Se)?b(Ve):void 0);Mi(Ad(me,{get worktree(){return b(S)},get isMobile(){return b(Se)},get initialPane(){return b(Me)},get terminalTheme(){return b(M)}}),Ie=>W(ot,Ie,!0),()=>b(ot))}}),q(U,re)},Tl=U=>{var re=dv(),_e=z(re),me=$(z(_e),2),Me=z(me),Ie=$(me,2),Ze=z(Ie);ce(vr=>{oe(Me,b(Ke).branch),oe(Ze,vr)},[()=>el(b(Ke).creationPhase)]),q(U,re)},Rl=U=>{var re=pv(),_e=z(re),me=z(_e),Me=z(me),Ie=$(me,2),Ze=z(Ie);{var vr=mt=>{var Ft=fv(),oi=z(Ft);ce(()=>oe(oi,`Profile: ${b(Ke).profile??""}`)),q(mt,Ft)};ne(Ze,mt=>{b(Ke).profile&&mt(vr)})}var jr=$(Ze,2);{var ni=mt=>{var Ft=_v(),oi=z(Ft);ce(()=>oe(oi,`Agent: ${b(Ke).agentName??""}`)),q(mt,Ft)};ne(jr,mt=>{b(Ke).agentName&&mt(ni)})}var At=$(Ie,2),Ds=z(At);{var Ts=mt=>{var Ft=vv();q(mt,Ft)},Rs=mt=>{var Ft=Ye("Open Session");q(mt,Ft)};ne(Ds,mt=>{b(xs)?mt(Ts):mt(Rs,-1)})}ce(()=>{oe(Me,b(Ke).branch),At.disabled=b(xs)}),ge("click",At,zn),q(U,re)},Al=U=>{var re=gv();q(U,re)};ne(Xn,U=>{var re;b(Fn)?U(Dl):(re=b(Ke))!=null&&re.creating?U(Tl,1):b(Ke)?U(Rl,2):U(Al,-1)})}var Bl=$(Xn,2);{var Ml=U=>{N_(U,{get activePane(){return b(Ve)},get panes(){return b(Un)},onselect:El})};ne(Bl,U=>{b(ml)&&U(Ml)})}var Yn=$($i,2);{var Ol=U=>{{let re=le(()=>{var Ie;return((Ie=b(V))==null?void 0:Ie.branchName)??""}),_e=le(()=>b(V)?`${b(V).title}${b(V).description?`
150
150
 
151
- `+b(V).description:""}`:""),me=he(()=>b(i).startupEnvs??{}),Me=he(()=>b(V)!==null);pf(U,{get profiles(){return b(i).profiles},get defaultProfileName(){return b(i).defaultProfileName},get autoNameEnabled(){return b(i).autoName},get initialBranch(){return b(re)},get initialPrompt(){return b(_e)},get availableBranches(){return b(Y)},get availableBranchesLoading(){return b(J)},get availableBranchesError(){return b(Z)},get baseBranches(){return b(L)},get baseBranchesLoading(){return b(O)},get baseBranchesError(){return b(R)},get startupEnvs(){return b(me)},get linearCreateTicketOption(){return b(i).linearCreateTicketOption},get openedFromLinearIssue(){return b(Me)},oncreate:bl,oncancel:()=>{F(h,!1),F(V,null)},get includeRemoteBranches(){return b(I)},set includeRemoteBranches(Ie){F(I,Ie,!0)}})}};ne(Yn,U=>{b(h)&&U(Ol)})}var Jn=$(Yn,2);{var Pl=U=>{{let re=he(()=>`Remove worktree "${b(C)}"? This action cannot be undone.`);Ji(U,{get message(){return b(re)},onconfirm:Sl,oncancel:()=>F(C,null)})}};ne(Jn,U=>{b(C)&&U(Pl)})}var Zn=$(Jn,2);{var Il=U=>{{let re=he(()=>`Merge worktree "${b(o)}" into main? The worktree will be removed after merging.`);Ji(U,{get message(){return b(re)},confirmLabel:"Merge",variant:"accent",onconfirm:wl,oncancel:()=>F(o,null)})}};ne(Zn,U=>{b(o)&&U(Il)})}var Qn=$(Zn,2);{var Hl=U=>{{let re=he(()=>b(a)?`Force pull "${b(i).mainBranch??"main"}"? This will discard any local commits on main.`:`Pull latest "${b(i).mainBranch??"main"}" from remote?`),_e=he(()=>b(a)?"Force Pull":"Pull"),me=he(()=>b(a)?"danger":"accent");Ji(U,{get message(){return b(re)},get confirmLabel(){return b(_e)},get variant(){return b(me)},get loading(){return b(_)},get error(){return b(n)},onconfirm:yl,oncancel:()=>{F(m,!1),F(a,!1)}})}};ne(Qn,U=>{b(m)&&U(Hl)})}var eo=$(Qn,2);{var Nl=U=>{{let re=he(()=>b(w)?`Force pull "${b(s)}"? This will discard any local commits.`:`Pull latest "${b(s)}" from remote?`),_e=he(()=>b(w)?"Force Pull":"Pull"),me=he(()=>b(w)?"danger":"accent");Ji(U,{get message(){return b(re)},get confirmLabel(){return b(_e)},get variant(){return b(me)},get loading(){return b(c)},get error(){return b(p)},onconfirm:Cl,oncancel:()=>{F(s,null),F(w,!1)}})}};ne(eo,U=>{b(s)&&U(Nl)})}var to=$(eo,2);{var Fl=U=>{{let re=he(()=>b(i).linearAutoCreateWorktrees??!1),_e=he(()=>b(i).autoRemoveOnMerge??!1);Sf(U,{get currentTheme(){return b(P)},get linearAutoCreate(){return b(re)},get autoRemoveOnMerge(){return b(_e)},onthemechange:me=>F(P,me,!0),onlinearautocreatechange:me=>{b(i).linearAutoCreateWorktrees=me},onautoremovechange:me=>{b(i).autoRemoveOnMerge=me},onsave:me=>{F(A,me,!0),F(f,!1)},onclose:()=>F(f,!1)})}};ne(to,U=>{b(f)&&U(Fl)})}var ro=$(to,2);{var Wl=U=>{{let re=he(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??""});Rf(U,{get pr(){return b(u)},get branch(){return b(re)},onclose:()=>F(u,null),onfixsuccess:()=>{F(u,null),setTimeout(()=>{var _e;return(_e=b(at))==null?void 0:_e.sendInput("\r")},ht)}})}};ne(ro,U=>{b(u)&&U(Wl)})}var io=$(ro,2);{var Ul=U=>{{let re=he(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??""});Ff(U,{get pr(){return b(v)},get branch(){return b(re)},onclose:()=>F(v,null),onsendsuccess:()=>{F(v,null),setTimeout(()=>{var _e;return(_e=b(at))==null?void 0:_e.sendInput("\r")},ht)}})}};ne(io,U=>{b(v)&&U(Ul)})}var so=$(io,2);{var jl=U=>{{let re=he(()=>{var _e;return Ri((_e=b(Ke))==null?void 0:_e.dir,b(A))});P_(U,{get branch(){return b(S)},get cursorUrl(){return b(re)},onclose:()=>F(d,!1)})}};ne(so,U=>{b(d)&&b(S)&&U(jl)})}var no=$(so,2);{var zl=U=>{rv(U,{get issue(){return b(M)},onassign:re=>{F(M,null),jn(re)},onclose:()=>F(M,null)})};ne(no,U=>{b(M)&&U(zl)})}var Kl=$(no,2);U_(Kl,{get notifications(){return b(de)},ondismiss:gt,onselect:U=>{F(S,U,!0),F(Ee,new Set([...b(Ee)].filter(re=>re!==U)),!0),b(Se)&&F(Ue,!1)}}),le(()=>{Re($i,1,`flex h-dvh bg-surface text-primary ${b(Ur)?"select-none":""}`),Qt($i,b(Ur)?"cursor: col-resize":"")}),q(t,qn),$e()}bt(["click","keydown","pointerdown"]);Dh(bv,{target:document.getElementById("app")});
151
+ `+b(V).description:""}`:""),me=le(()=>b(i).startupEnvs??{}),Me=le(()=>b(V)!==null);pf(U,{get profiles(){return b(i).profiles},get defaultProfileName(){return b(i).defaultProfileName},get autoNameEnabled(){return b(i).autoName},get initialBranch(){return b(re)},get initialPrompt(){return b(_e)},get availableBranches(){return b(Y)},get availableBranchesLoading(){return b(J)},get availableBranchesError(){return b(Z)},get baseBranches(){return b(L)},get baseBranchesLoading(){return b(O)},get baseBranchesError(){return b(R)},get startupEnvs(){return b(me)},get linearCreateTicketOption(){return b(i).linearCreateTicketOption},get openedFromLinearIssue(){return b(Me)},oncreate:bl,oncancel:()=>{W(h,!1),W(V,null)},get includeRemoteBranches(){return b(I)},set includeRemoteBranches(Ie){W(I,Ie,!0)}})}};ne(Yn,U=>{b(h)&&U(Ol)})}var Jn=$(Yn,2);{var Pl=U=>{{let re=le(()=>`Remove worktree "${b(C)}"? This action cannot be undone.`);Ji(U,{get message(){return b(re)},onconfirm:Sl,oncancel:()=>W(C,null)})}};ne(Jn,U=>{b(C)&&U(Pl)})}var Zn=$(Jn,2);{var Il=U=>{{let re=le(()=>`Merge worktree "${b(o)}" into main? The worktree will be removed after merging.`);Ji(U,{get message(){return b(re)},confirmLabel:"Merge",variant:"accent",onconfirm:wl,oncancel:()=>W(o,null)})}};ne(Zn,U=>{b(o)&&U(Il)})}var Qn=$(Zn,2);{var Hl=U=>{{let re=le(()=>b(a)?`Force pull "${b(i).mainBranch??"main"}"? This will discard any local commits on main.`:`Pull latest "${b(i).mainBranch??"main"}" from remote?`),_e=le(()=>b(a)?"Force Pull":"Pull"),me=le(()=>b(a)?"danger":"accent");Ji(U,{get message(){return b(re)},get confirmLabel(){return b(_e)},get variant(){return b(me)},get loading(){return b(_)},get error(){return b(n)},onconfirm:yl,oncancel:()=>{W(m,!1),W(a,!1)}})}};ne(Qn,U=>{b(m)&&U(Hl)})}var eo=$(Qn,2);{var Nl=U=>{{let re=le(()=>b(w)?`Force pull "${b(s)}"? This will discard any local commits.`:`Pull latest "${b(s)}" from remote?`),_e=le(()=>b(w)?"Force Pull":"Pull"),me=le(()=>b(w)?"danger":"accent");Ji(U,{get message(){return b(re)},get confirmLabel(){return b(_e)},get variant(){return b(me)},get loading(){return b(c)},get error(){return b(p)},onconfirm:Cl,oncancel:()=>{W(s,null),W(w,!1)}})}};ne(eo,U=>{b(s)&&U(Nl)})}var to=$(eo,2);{var Fl=U=>{{let re=le(()=>b(i).linearAutoCreateWorktrees??!1),_e=le(()=>b(i).autoRemoveOnMerge??!1);Sf(U,{get currentTheme(){return b(P)},get linearAutoCreate(){return b(re)},get autoRemoveOnMerge(){return b(_e)},onthemechange:me=>W(P,me,!0),onlinearautocreatechange:me=>{b(i).linearAutoCreateWorktrees=me},onautoremovechange:me=>{b(i).autoRemoveOnMerge=me},onsave:me=>{W(A,me,!0),W(f,!1)},onclose:()=>W(f,!1)})}};ne(to,U=>{b(f)&&U(Fl)})}var ro=$(to,2);{var Wl=U=>{{let re=le(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??""});Rf(U,{get pr(){return b(u)},get branch(){return b(re)},onclose:()=>W(u,null),onfixsuccess:()=>{W(u,null),setTimeout(()=>{var _e;return(_e=b(ot))==null?void 0:_e.sendInput("\r")},ht)}})}};ne(ro,U=>{b(u)&&U(Wl)})}var io=$(ro,2);{var Ul=U=>{{let re=le(()=>{var _e;return((_e=b(Ke))==null?void 0:_e.branch)??""});Ff(U,{get pr(){return b(v)},get branch(){return b(re)},onclose:()=>W(v,null),onsendsuccess:()=>{W(v,null),setTimeout(()=>{var _e;return(_e=b(ot))==null?void 0:_e.sendInput("\r")},ht)}})}};ne(io,U=>{b(v)&&U(Ul)})}var so=$(io,2);{var jl=U=>{{let re=le(()=>{var _e;return Ri((_e=b(Ke))==null?void 0:_e.dir,b(A))});P_(U,{get branch(){return b(S)},get cursorUrl(){return b(re)},onclose:()=>W(d,!1)})}};ne(so,U=>{b(d)&&b(S)&&U(jl)})}var no=$(so,2);{var zl=U=>{rv(U,{get issue(){return b(B)},onassign:re=>{W(B,null),jn(re)},onclose:()=>W(B,null)})};ne(no,U=>{b(B)&&U(zl)})}var Kl=$(no,2);U_(Kl,{get notifications(){return b(de)},ondismiss:gt,onselect:U=>{W(S,U,!0),W(Ee,new Set([...b(Ee)].filter(re=>re!==U)),!0),b(Se)&&W(Ue,!1)}}),ce(()=>{Re($i,1,`flex h-dvh bg-surface text-primary ${b(Ur)?"select-none":""}`),Qt($i,b(Ur)?"cursor: col-resize":"")}),q(t,qn),$e()}bt(["click","keydown","pointerdown"]);Dh(bv,{target:document.getElementById("app")});