wmdev 0.3.0 → 0.5.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.
- package/README.md +7 -0
- package/backend/dist/server.js +227 -34
- package/frontend/dist/assets/index-C3n4a8bx.js +32 -0
- package/frontend/dist/assets/index-DANb8sJ_.css +32 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-D9tls-CM.css +0 -32
- package/frontend/dist/assets/index-Dp6OOEt3.js +0 -25
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var go=Object.defineProperty;var Ls=r=>{throw TypeError(r)};var mo=(r,o,_)=>o in r?go(r,o,{enumerable:!0,configurable:!0,writable:!0,value:_}):r[o]=_;var wt=(r,o,_)=>mo(r,typeof o!="symbol"?o+"":o,_),Di=(r,o,_)=>o.has(r)||Ls("Cannot "+_);var W=(r,o,_)=>(Di(r,o,"read from private field"),_?_.call(r):o.get(r)),he=(r,o,_)=>o.has(r)?Ls("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(r):o.set(r,_),ue=(r,o,_,w)=>(Di(r,o,"write to private field"),w?w.call(r,_):o.set(r,_),_),xe=(r,o,_)=>(Di(r,o,"access private method"),_);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const b of document.querySelectorAll('link[rel="modulepreload"]'))w(b);new MutationObserver(b=>{for(const k of b)if(k.type==="childList")for(const E of k.addedNodes)E.tagName==="LINK"&&E.rel==="modulepreload"&&w(E)}).observe(document,{childList:!0,subtree:!0});function _(b){const k={};return b.integrity&&(k.integrity=b.integrity),b.referrerPolicy&&(k.referrerPolicy=b.referrerPolicy),b.crossOrigin==="use-credentials"?k.credentials="include":b.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function w(b){if(b.ep)return;b.ep=!0;const k=_(b);fetch(b.href,k)}})();const So="5";var Js;typeof window<"u"&&((Js=window.__svelte??(window.__svelte={})).v??(Js.v=new Set)).add(So);const bo=1,wo=2,Qs=4,Co=8,yo=16,xo=1,Eo=4,ko=8,Lo=16,Do=1,Ro=2,Oe=Symbol(),en="http://www.w3.org/1999/xhtml",Ao="@attach",Ni=!1;var os=Array.isArray,To=Array.prototype.indexOf,Tr=Array.prototype.includes,mi=Array.from,Bo=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,Mo=Object.getOwnPropertyDescriptors,Oo=Object.prototype,Po=Array.prototype,tn=Object.getPrototypeOf,Ds=Object.isExtensible;const Io=()=>{};function Ho(r){for(var o=0;o<r.length;o++)r[o]()}function rn(){var r,o,_=new Promise((w,b)=>{r=w,o=b});return{promise:_,resolve:r,reject:o}}const We=2,Fr=4,Xr=8,as=1<<24,rr=16,mt=32,Sr=64,Wi=128,ot=512,Pe=1024,Ue=2048,gt=4096,tt=8192,Ht=16384,Nr=32768,pr=65536,Rs=1<<17,Fo=1<<18,Wr=1<<19,No=1<<20,It=1<<25,gr=65536,Ui=1<<21,ls=1<<22,Xt=1<<23,_r=Symbol("$state"),Wo=Symbol("legacy props"),Uo=Symbol(""),nr=new class extends Error{constructor(){super(...arguments);wt(this,"name","StaleReactionError");wt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Ys;const cs=!!((Ys=globalThis.document)!=null&&Ys.contentType)&&globalThis.document.contentType.includes("xml");function sn(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function jo(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function zo(r,o,_){throw new Error("https://svelte.dev/e/each_key_duplicate")}function $o(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ko(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function qo(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Vo(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Go(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function Xo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Jo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Yo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Zo(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Qo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ea(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function nn(r){return r===this.v}function ta(r,o){return r!=r?o==o:r!==o||r!==null&&typeof r=="object"||typeof r=="function"}function on(r){return!ta(r,this.v)}let ra=!1,Xe=null;function Br(r){Xe=r}function De(r,o=!1,_){Xe={p:Xe,i:!1,c:null,e:null,s:r,x:null,l:null}}function Re(r){var o=Xe,_=o.e;if(_!==null){o.e=null;for(var w of _)Ln(w)}return r!==void 0&&(o.x=r),o.i=!0,Xe=o.p,r??{}}function an(){return!0}let or=[];function ln(){var r=or;or=[],Ho(r)}function kt(r){if(or.length===0&&!Vr){var o=or;queueMicrotask(()=>{o===or&&ln()})}or.push(r)}function ia(){for(;or.length>0;)ln()}function cn(r){var o=pe;if(o===null)return fe.f|=Xt,r;if((o.f&Nr)===0&&(o.f&Fr)===0)throw r;Gt(r,o)}function Gt(r,o){for(;o!==null;){if((o.f&Wi)!==0){if((o.f&Nr)===0)throw r;try{o.b.error(r);return}catch(_){r=_}}o=o.parent}throw r}const sa=-7169;function ke(r,o){r.f=r.f&sa|o}function hs(r){(r.f&ot)!==0||r.deps===null?ke(r,Pe):ke(r,gt)}function hn(r){if(r!==null)for(const o of r)(o.f&We)===0||(o.f&gr)===0||(o.f^=gr,hn(o.deps))}function un(r,o,_){(r.f&Ue)!==0?o.add(r):(r.f>)!==0&&_.add(r),hn(r.deps),ke(r,Pe)}const ai=new Set;let de=null,ji=null,He=null,qe=[],Si=null,Vr=!1,Mr=null;var $t,Cr,hr,yr,xr,Er,Kt,Ct,kr,Je,zi,$i,Ki,qi;const bs=class bs{constructor(){he(this,Je);wt(this,"current",new Map);wt(this,"previous",new Map);he(this,$t,new Set);he(this,Cr,new Set);he(this,hr,0);he(this,yr,0);he(this,xr,null);he(this,Er,new Set);he(this,Kt,new Set);he(this,Ct,new Map);wt(this,"is_fork",!1);he(this,kr,!1)}skip_effect(o){W(this,Ct).has(o)||W(this,Ct).set(o,{d:[],m:[]})}unskip_effect(o){var _=W(this,Ct).get(o);if(_){W(this,Ct).delete(o);for(var w of _.d)ke(w,Ue),vt(w);for(w of _.m)ke(w,gt),vt(w)}}process(o){var b;qe=[],this.apply();var _=Mr=[],w=[];for(const k of o)xe(this,Je,$i).call(this,k,_,w);if(Mr=null,xe(this,Je,zi).call(this)){xe(this,Je,Ki).call(this,w),xe(this,Je,Ki).call(this,_);for(const[k,E]of W(this,Ct))vn(k,E)}else{ji=this,de=null;for(const k of W(this,$t))k(this);W(this,$t).clear(),W(this,hr)===0&&xe(this,Je,qi).call(this),As(w),As(_),W(this,Er).clear(),W(this,Kt).clear(),ji=null,(b=W(this,xr))==null||b.resolve()}He=null}capture(o,_){_!==Oe&&!this.previous.has(o)&&this.previous.set(o,_),(o.f&Xt)===0&&(this.current.set(o,o.v),He==null||He.set(o,o.v))}activate(){de=this,this.apply()}deactivate(){de===this&&(de=null,He=null)}flush(){var o;if(qe.length>0)de=this,dn();else if(W(this,hr)===0&&!this.is_fork){for(const _ of W(this,$t))_(this);W(this,$t).clear(),xe(this,Je,qi).call(this),(o=W(this,xr))==null||o.resolve()}this.deactivate()}discard(){for(const o of W(this,Cr))o(this);W(this,Cr).clear()}increment(o){ue(this,hr,W(this,hr)+1),o&&ue(this,yr,W(this,yr)+1)}decrement(o){ue(this,hr,W(this,hr)-1),o&&ue(this,yr,W(this,yr)-1),!W(this,kr)&&(ue(this,kr,!0),kt(()=>{ue(this,kr,!1),xe(this,Je,zi).call(this)?qe.length>0&&this.flush():this.revive()}))}revive(){for(const o of W(this,Er))W(this,Kt).delete(o),ke(o,Ue),vt(o);for(const o of W(this,Kt))ke(o,gt),vt(o);this.flush()}oncommit(o){W(this,$t).add(o)}ondiscard(o){W(this,Cr).add(o)}settled(){return(W(this,xr)??ue(this,xr,rn())).promise}static ensure(){if(de===null){const o=de=new bs;ai.add(de),Vr||kt(()=>{de===o&&o.flush()})}return de}apply(){}};$t=new WeakMap,Cr=new WeakMap,hr=new WeakMap,yr=new WeakMap,xr=new WeakMap,Er=new WeakMap,Kt=new WeakMap,Ct=new WeakMap,kr=new WeakMap,Je=new WeakSet,zi=function(){return this.is_fork||W(this,yr)>0},$i=function(o,_,w){o.f^=Pe;for(var b=o.first;b!==null;){var k=b.f,E=(k&(mt|Sr))!==0,n=E&&(k&Pe)!==0,a=n||(k&tt)!==0||W(this,Ct).has(b);if(!a&&b.fn!==null){E?b.f^=Pe:(k&Fr)!==0?_.push(b):ni(b)&&((k&rr)!==0&&W(this,Kt).add(b),Ir(b));var c=b.first;if(c!==null){b=c;continue}}for(;b!==null;){var f=b.next;if(f!==null){b=f;break}b=b.parent}}},Ki=function(o){for(var _=0;_<o.length;_+=1)un(o[_],W(this,Er),W(this,Kt))},qi=function(){var k;if(ai.size>1){this.previous.clear();var o=de,_=He,w=!0;for(const E of ai){if(E===this){w=!1;continue}const n=[];for(const[c,f]of this.current){if(E.current.has(c))if(w&&f!==E.current.get(c))E.current.set(c,f);else continue;n.push(c)}if(n.length===0)continue;const a=[...E.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var b=qe;qe=[];const c=new Set,f=new Map;for(const l of n)fn(l,a,c,f);if(qe.length>0){de=E,E.apply();for(const l of qe)xe(k=E,Je,$i).call(k,l,[],[]);E.deactivate()}qe=b}}de=o,He=_}W(this,Ct).clear(),ai.delete(this)};let Jt=bs;function na(r){var o=Vr;Vr=!0;try{for(var _;;){if(ia(),qe.length===0&&(de==null||de.flush(),qe.length===0))return Si=null,_;dn()}}finally{Vr=o}}function dn(){var r=null;try{for(var o=0;qe.length>0;){var _=Jt.ensure();if(o++>1e3){var w,b;oa()}_.process(qe),Yt.clear()}}finally{qe=[],Si=null,Mr=null}}function oa(){try{Vo()}catch(r){Gt(r,Si)}}let ut=null;function As(r){var o=r.length;if(o!==0){for(var _=0;_<o;){var w=r[_++];if((w.f&(Ht|tt))===0&&ni(w)&&(ut=new Set,Ir(w),w.deps===null&&w.first===null&&w.nodes===null&&w.teardown===null&&w.ac===null&&An(w),(ut==null?void 0:ut.size)>0)){Yt.clear();for(const b of ut){if((b.f&(Ht|tt))!==0)continue;const k=[b];let E=b.parent;for(;E!==null;)ut.has(E)&&(ut.delete(E),k.push(E)),E=E.parent;for(let n=k.length-1;n>=0;n--){const a=k[n];(a.f&(Ht|tt))===0&&Ir(a)}}ut.clear()}}ut=null}}function fn(r,o,_,w){if(!_.has(r)&&(_.add(r),r.reactions!==null))for(const b of r.reactions){const k=b.f;(k&We)!==0?fn(b,o,_,w):(k&(ls|rr))!==0&&(k&Ue)===0&&_n(b,o,w)&&(ke(b,Ue),vt(b))}}function _n(r,o,_){const w=_.get(r);if(w!==void 0)return w;if(r.deps!==null)for(const b of r.deps){if(Tr.call(o,b))return!0;if((b.f&We)!==0&&_n(b,o,_))return _.set(b,!0),!0}return _.set(r,!1),!1}function vt(r){var o=Si=r,_=o.b;if(_!=null&&_.is_pending&&(r.f&(Fr|Xr|as))!==0&&(r.f&Nr)===0){_.defer_effect(r);return}for(;o.parent!==null;){o=o.parent;var w=o.f;if(Mr!==null&&o===pe&&(r.f&Xr)===0)return;if((w&(Sr|mt))!==0){if((w&Pe)===0)return;o.f^=Pe}}qe.push(o)}function vn(r,o){if(!((r.f&mt)!==0&&(r.f&Pe)!==0)){(r.f&Ue)!==0?o.d.push(r):(r.f>)!==0&&o.m.push(r),ke(r,Pe);for(var _=r.first;_!==null;)vn(_,o),_=_.next}}function aa(r){let o=0,_=Qt(0),w;return()=>{ds()&&(L(_),Ci(()=>(o===0&&(w=Wt(()=>r(()=>Zt(_)))),o+=1,()=>{kt(()=>{o-=1,o===0&&(w==null||w(),w=void 0,Zt(_))})})))}}var la=pr|Wr;function ca(r,o,_,w){new ha(r,o,_,w)}var nt,ns,yt,ur,Ke,xt,Qe,dt,Ot,dr,qt,Lr,Dr,Rr,Pt,_i,Me,ua,da,fa,Vi,hi,ui,Gi;class ha{constructor(o,_,w,b){he(this,Me);wt(this,"parent");wt(this,"is_pending",!1);wt(this,"transform_error");he(this,nt);he(this,ns,null);he(this,yt);he(this,ur);he(this,Ke);he(this,xt,null);he(this,Qe,null);he(this,dt,null);he(this,Ot,null);he(this,dr,0);he(this,qt,0);he(this,Lr,!1);he(this,Dr,new Set);he(this,Rr,new Set);he(this,Pt,null);he(this,_i,aa(()=>(ue(this,Pt,Qt(W(this,dr))),()=>{ue(this,Pt,null)})));var k;ue(this,nt,o),ue(this,yt,_),ue(this,ur,E=>{var n=pe;n.b=this,n.f|=Wi,w(E)}),this.parent=pe.b,this.transform_error=b??((k=this.parent)==null?void 0:k.transform_error)??(E=>E),ue(this,Ke,si(()=>{xe(this,Me,Vi).call(this)},la))}defer_effect(o){un(o,W(this,Dr),W(this,Rr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!W(this,yt).pending}update_pending_count(o){xe(this,Me,Gi).call(this,o),ue(this,dr,W(this,dr)+o),!(!W(this,Pt)||W(this,Lr))&&(ue(this,Lr,!0),kt(()=>{ue(this,Lr,!1),W(this,Pt)&&Or(W(this,Pt),W(this,dr))}))}get_effect_pending(){return W(this,_i).call(this),L(W(this,Pt))}error(o){var _=W(this,yt).onerror;let w=W(this,yt).failed;if(!_&&!w)throw o;W(this,xt)&&(Ne(W(this,xt)),ue(this,xt,null)),W(this,Qe)&&(Ne(W(this,Qe)),ue(this,Qe,null)),W(this,dt)&&(Ne(W(this,dt)),ue(this,dt,null));var b=!1,k=!1;const E=()=>{if(b){ea();return}b=!0,k&&Zo(),W(this,dt)!==null&&vr(W(this,dt),()=>{ue(this,dt,null)}),xe(this,Me,ui).call(this,()=>{Jt.ensure(),xe(this,Me,Vi).call(this)})},n=a=>{try{k=!0,_==null||_(a,E),k=!1}catch(c){Gt(c,W(this,Ke)&&W(this,Ke).parent)}w&&ue(this,dt,xe(this,Me,ui).call(this,()=>{Jt.ensure();try{return Ge(()=>{var c=pe;c.b=this,c.f|=Wi,w(W(this,nt),()=>a,()=>E)})}catch(c){return Gt(c,W(this,Ke).parent),null}}))};kt(()=>{var a;try{a=this.transform_error(o)}catch(c){Gt(c,W(this,Ke)&&W(this,Ke).parent);return}a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(n,c=>Gt(c,W(this,Ke)&&W(this,Ke).parent)):n(a)})}}nt=new WeakMap,ns=new WeakMap,yt=new WeakMap,ur=new WeakMap,Ke=new WeakMap,xt=new WeakMap,Qe=new WeakMap,dt=new WeakMap,Ot=new WeakMap,dr=new WeakMap,qt=new WeakMap,Lr=new WeakMap,Dr=new WeakMap,Rr=new WeakMap,Pt=new WeakMap,_i=new WeakMap,Me=new WeakSet,ua=function(){try{ue(this,xt,Ge(()=>W(this,ur).call(this,W(this,nt))))}catch(o){this.error(o)}},da=function(o){const _=W(this,yt).failed;_&&ue(this,dt,Ge(()=>{_(W(this,nt),()=>o,()=>()=>{})}))},fa=function(){const o=W(this,yt).pending;o&&(this.is_pending=!0,ue(this,Qe,Ge(()=>o(W(this,nt)))),kt(()=>{var _=ue(this,Ot,document.createDocumentFragment()),w=Ft();_.append(w),ue(this,xt,xe(this,Me,ui).call(this,()=>(Jt.ensure(),Ge(()=>W(this,ur).call(this,w))))),W(this,qt)===0&&(W(this,nt).before(_),ue(this,Ot,null),vr(W(this,Qe),()=>{ue(this,Qe,null)}),xe(this,Me,hi).call(this))}))},Vi=function(){try{if(this.is_pending=this.has_pending_snippet(),ue(this,qt,0),ue(this,dr,0),ue(this,xt,Ge(()=>{W(this,ur).call(this,W(this,nt))})),W(this,qt)>0){var o=ue(this,Ot,document.createDocumentFragment());Mn(W(this,xt),o);const _=W(this,yt).pending;ue(this,Qe,Ge(()=>_(W(this,nt))))}else xe(this,Me,hi).call(this)}catch(_){this.error(_)}},hi=function(){this.is_pending=!1;for(const o of W(this,Dr))ke(o,Ue),vt(o);for(const o of W(this,Rr))ke(o,gt),vt(o);W(this,Dr).clear(),W(this,Rr).clear()},ui=function(o){var _=pe,w=fe,b=Xe;Lt(W(this,Ke)),lt(W(this,Ke)),Br(W(this,Ke).ctx);try{return o()}catch(k){return cn(k),null}finally{Lt(_),lt(w),Br(b)}},Gi=function(o){var _;if(!this.has_pending_snippet()){this.parent&&xe(_=this.parent,Me,Gi).call(_,o);return}ue(this,qt,W(this,qt)+o),W(this,qt)===0&&(xe(this,Me,hi).call(this),W(this,Qe)&&vr(W(this,Qe),()=>{ue(this,Qe,null)}),W(this,Ot)&&(W(this,nt).before(W(this,Ot)),ue(this,Ot,null)))};function pn(r,o,_,w){const b=bi;var k=r.filter(l=>!l.settled);if(_.length===0&&k.length===0){w(o.map(b));return}var E=pe,n=_a(),a=k.length===1?k[0].promise:k.length>1?Promise.all(k.map(l=>l.promise)):null;function c(l){n();try{w(l)}catch(u){(E.f&Ht)===0&&Gt(u,E)}Xi()}if(_.length===0){a.then(()=>c(o.map(b)));return}function f(){n(),Promise.all(_.map(l=>pa(l))).then(l=>c([...o.map(b),...l])).catch(l=>Gt(l,E))}a?a.then(f):f()}function _a(){var r=pe,o=fe,_=Xe,w=de;return function(k=!0){Lt(r),lt(o),Br(_),k&&(w==null||w.activate())}}function Xi(r=!0){Lt(null),lt(null),Br(null),r&&(de==null||de.deactivate())}function va(){var r=pe.b,o=de,_=r.is_rendered();return r.update_pending_count(1),o.increment(_),()=>{r.update_pending_count(-1),o.decrement(_)}}function bi(r){var o=We|Ue,_=fe!==null&&(fe.f&We)!==0?fe:null;return pe!==null&&(pe.f|=Wr),{ctx:Xe,deps:null,effects:null,equals:nn,f:o,fn:r,reactions:null,rv:0,v:Oe,wv:0,parent:_??pe,ac:null}}function pa(r,o,_){pe===null&&jo();var b=void 0,k=Qt(Oe),E=!fe,n=new Map;return Ba(()=>{var u;var a=rn();b=a.promise;try{Promise.resolve(r()).then(a.resolve,a.reject).finally(Xi)}catch(p){a.reject(p),Xi()}var c=de;if(E){var f=va();(u=n.get(c))==null||u.reject(nr),n.delete(c),n.set(c,a)}const l=(p,m=void 0)=>{if(c.activate(),m)m!==nr&&(k.f|=Xt,Or(k,m));else{(k.f&Xt)!==0&&(k.f^=Xt),Or(k,p);for(const[h,t]of n){if(n.delete(h),h===c)break;t.reject(nr)}}f&&f()};a.promise.then(l,p=>l(null,p||"unknown"))}),fs(()=>{for(const a of n.values())a.reject(nr)}),new Promise(a=>{function c(f){function l(){f===b?a(k):c(b)}f.then(l,l)}c(b)})}function ve(r){const o=bi(r);return On(o),o}function gn(r){const o=bi(r);return o.equals=on,o}function ga(r){var o=r.effects;if(o!==null){r.effects=null;for(var _=0;_<o.length;_+=1)Ne(o[_])}}function ma(r){for(var o=r.parent;o!==null;){if((o.f&We)===0)return(o.f&Ht)===0?o:null;o=o.parent}return null}function us(r){var o,_=pe;Lt(ma(r));try{r.f&=~gr,ga(r),o=Fn(r)}finally{Lt(_)}return o}function mn(r){var o=us(r);if(!r.equals(o)&&(r.wv=In(),(!(de!=null&&de.is_fork)||r.deps===null)&&(r.v=o,r.deps===null))){ke(r,Pe);return}er||(He!==null?(ds()||de!=null&&de.is_fork)&&He.set(r,o):hs(r))}function Sa(r){var o,_;if(r.effects!==null)for(const w of r.effects)(w.teardown||w.ac)&&((o=w.teardown)==null||o.call(w),(_=w.ac)==null||_.abort(nr),w.teardown=Io,w.ac=null,Jr(w,0),_s(w))}function Sn(r){if(r.effects!==null)for(const o of r.effects)o.teardown&&Ir(o)}let Ji=new Set;const Yt=new Map;let bn=!1;function Qt(r,o){var _={f:0,v:r,reactions:null,equals:nn,rv:0,wv:0};return _}function ae(r,o){const _=Qt(r);return On(_),_}function ba(r,o=!1,_=!0){const w=Qt(r);return o||(w.equals=on),w}function V(r,o,_=!1){fe!==null&&(!pt||(fe.f&Rs)!==0)&&an()&&(fe.f&(We|rr|ls|Rs))!==0&&(at===null||!Tr.call(at,r))&&Yo();let w=_?Ee(o):o;return Or(r,w)}function Or(r,o){if(!r.equals(o)){var _=r.v;er?Yt.set(r,o):Yt.set(r,_),r.v=o;var w=Jt.ensure();if(w.capture(r,_),(r.f&We)!==0){const b=r;(r.f&Ue)!==0&&us(b),hs(b)}r.wv=In(),wn(r,Ue),pe!==null&&(pe.f&Pe)!==0&&(pe.f&(mt|Sr))===0&&(st===null?Pa([r]):st.push(r)),!w.is_fork&&Ji.size>0&&!bn&&wa()}return o}function wa(){bn=!1;for(const r of Ji)(r.f&Pe)!==0&&ke(r,gt),ni(r)&&Ir(r);Ji.clear()}function Ca(r,o=1){var _=L(r),w=o===1?_++:_--;return V(r,_),w}function Zt(r){V(r,r.v+1)}function wn(r,o){var _=r.reactions;if(_!==null)for(var w=_.length,b=0;b<w;b++){var k=_[b],E=k.f,n=(E&Ue)===0;if(n&&ke(k,o),(E&We)!==0){var a=k;He==null||He.delete(a),(E&gr)===0&&(E&ot&&(k.f|=gr),wn(a,gt))}else n&&((E&rr)!==0&&ut!==null&&ut.add(k),vt(k))}}function Ee(r){if(typeof r!="object"||r===null||_r in r)return r;const o=tn(r);if(o!==Oo&&o!==Po)return r;var _=new Map,w=os(r),b=ae(0),k=Nt,E=n=>{if(Nt===k)return n();var a=fe,c=Nt;lt(null),Os(k);var f=n();return lt(a),Os(c),f};return w&&_.set("length",ae(r.length)),new Proxy(r,{defineProperty(n,a,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Xo();var f=_.get(a);return f===void 0?E(()=>{var l=ae(c.value);return _.set(a,l),l}):V(f,c.value,!0),!0},deleteProperty(n,a){var c=_.get(a);if(c===void 0){if(a in n){const f=E(()=>ae(Oe));_.set(a,f),Zt(b)}}else V(c,Oe),Zt(b);return!0},get(n,a,c){var p;if(a===_r)return r;var f=_.get(a),l=a in n;if(f===void 0&&(!l||(p=wr(n,a))!=null&&p.writable)&&(f=E(()=>{var m=Ee(l?n[a]:Oe),h=ae(m);return h}),_.set(a,f)),f!==void 0){var u=L(f);return u===Oe?void 0:u}return Reflect.get(n,a,c)},getOwnPropertyDescriptor(n,a){var c=Reflect.getOwnPropertyDescriptor(n,a);if(c&&"value"in c){var f=_.get(a);f&&(c.value=L(f))}else if(c===void 0){var l=_.get(a),u=l==null?void 0:l.v;if(l!==void 0&&u!==Oe)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return c},has(n,a){var u;if(a===_r)return!0;var c=_.get(a),f=c!==void 0&&c.v!==Oe||Reflect.has(n,a);if(c!==void 0||pe!==null&&(!f||(u=wr(n,a))!=null&&u.writable)){c===void 0&&(c=E(()=>{var p=f?Ee(n[a]):Oe,m=ae(p);return m}),_.set(a,c));var l=L(c);if(l===Oe)return!1}return f},set(n,a,c,f){var s;var l=_.get(a),u=a in n;if(w&&a==="length")for(var p=c;p<l.v;p+=1){var m=_.get(p+"");m!==void 0?V(m,Oe):p in n&&(m=E(()=>ae(Oe)),_.set(p+"",m))}if(l===void 0)(!u||(s=wr(n,a))!=null&&s.writable)&&(l=E(()=>ae(void 0)),V(l,Ee(c)),_.set(a,l));else{u=l.v!==Oe;var h=E(()=>Ee(c));V(l,h)}var t=Reflect.getOwnPropertyDescriptor(n,a);if(t!=null&&t.set&&t.set.call(f,c),!u){if(w&&typeof a=="string"){var i=_.get("length"),e=Number(a);Number.isInteger(e)&&e>=i.v&&V(i,e+1)}Zt(b)}return!0},ownKeys(n){L(b);var a=Reflect.ownKeys(n).filter(l=>{var u=_.get(l);return u===void 0||u.v!==Oe});for(var[c,f]of _)f.v!==Oe&&!(c in n)&&a.push(c);return a},setPrototypeOf(){Jo()}})}function Ts(r){try{if(r!==null&&typeof r=="object"&&_r in r)return r[_r]}catch{}return r}function ya(r,o){return Object.is(Ts(r),Ts(o))}var Yi,Cn,yn,xn;function xa(){if(Yi===void 0){Yi=window,Cn=/Firefox/.test(navigator.userAgent);var r=Element.prototype,o=Node.prototype,_=Text.prototype;yn=wr(o,"firstChild").get,xn=wr(o,"nextSibling").get,Ds(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Ds(_)&&(_.__t=void 0)}}function Ft(r=""){return document.createTextNode(r)}function Pr(r){return yn.call(r)}function ri(r){return xn.call(r)}function X(r,o){return Pr(r)}function Le(r,o=!1){{var _=Pr(r);return _ instanceof Comment&&_.data===""?ri(_):_}}function J(r,o=1,_=!1){let w=r;for(;o--;)w=ri(w);return w}function Ea(r){r.textContent=""}function En(){return!1}function ka(r,o,_){return document.createElementNS(en,r,void 0)}function La(r,o){if(o){const _=document.body;r.autofocus=!0,kt(()=>{document.activeElement===_&&r.focus()})}}let Bs=!1;function Da(){Bs||(Bs=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var o;if(!r.defaultPrevented)for(const _ of r.target.elements)(o=_.__on_r)==null||o.call(_)})},{capture:!0}))}function wi(r){var o=fe,_=pe;lt(null),Lt(null);try{return r()}finally{lt(o),Lt(_)}}function kn(r,o,_,w=_){r.addEventListener(o,()=>wi(_));const b=r.__on_r;b?r.__on_r=()=>{b(),w(!0)}:r.__on_r=()=>w(!0),Da()}function Ra(r){pe===null&&(fe===null&&qo(),Ko()),er&&$o()}function Aa(r,o){var _=o.last;_===null?o.last=o.first=r:(_.next=r,r.prev=_,o.last=r)}function Dt(r,o){var _=pe;_!==null&&(_.f&tt)!==0&&(r|=tt);var w={ctx:Xe,deps:null,nodes:null,f:r|Ue|ot,first:null,fn:o,last:null,next:null,parent:_,b:_&&_.b,prev:null,teardown:null,wv:0,ac:null},b=w;if((r&Fr)!==0)Mr!==null?Mr.push(w):vt(w);else if(o!==null){try{Ir(w)}catch(E){throw Ne(w),E}b.deps===null&&b.teardown===null&&b.nodes===null&&b.first===b.last&&(b.f&Wr)===0&&(b=b.first,(r&rr)!==0&&(r&pr)!==0&&b!==null&&(b.f|=pr))}if(b!==null&&(b.parent=_,_!==null&&Aa(b,_),fe!==null&&(fe.f&We)!==0&&(r&Sr)===0)){var k=fe;(k.effects??(k.effects=[])).push(b)}return w}function ds(){return fe!==null&&!pt}function fs(r){const o=Dt(Xr,null);return ke(o,Pe),o.teardown=r,o}function mr(r){Ra();var o=pe.f,_=!fe&&(o&mt)!==0&&(o&Nr)===0;if(_){var w=Xe;(w.e??(w.e=[])).push(r)}else return Ln(r)}function Ln(r){return Dt(Fr|No,r)}function Ta(r){Jt.ensure();const o=Dt(Sr|Wr,r);return(_={})=>new Promise(w=>{_.outro?vr(o,()=>{Ne(o),w(void 0)}):(Ne(o),w(void 0))})}function ii(r){return Dt(Fr,r)}function Ba(r){return Dt(ls|Wr,r)}function Ci(r,o=0){return Dt(Xr|o,r)}function oe(r,o=[],_=[],w=[]){pn(w,o,_,b=>{Dt(Xr,()=>r(...b.map(L)))})}function si(r,o=0){var _=Dt(rr|o,r);return _}function Dn(r,o=0){var _=Dt(as|o,r);return _}function Ge(r){return Dt(mt|Wr,r)}function Rn(r){var o=r.teardown;if(o!==null){const _=er,w=fe;Ms(!0),lt(null);try{o.call(null)}finally{Ms(_),lt(w)}}}function _s(r,o=!1){var _=r.first;for(r.first=r.last=null;_!==null;){const b=_.ac;b!==null&&wi(()=>{b.abort(nr)});var w=_.next;(_.f&Sr)!==0?_.parent=null:Ne(_,o),_=w}}function Ma(r){for(var o=r.first;o!==null;){var _=o.next;(o.f&mt)===0&&Ne(o),o=_}}function Ne(r,o=!0){var _=!1;(o||(r.f&Fo)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(Oa(r.nodes.start,r.nodes.end),_=!0),_s(r,o&&!_),Jr(r,0),ke(r,Ht);var w=r.nodes&&r.nodes.t;if(w!==null)for(const k of w)k.stop();Rn(r);var b=r.parent;b!==null&&b.first!==null&&An(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=null}function Oa(r,o){for(;r!==null;){var _=r===o?null:ri(r);r.remove(),r=_}}function An(r){var o=r.parent,_=r.prev,w=r.next;_!==null&&(_.next=w),w!==null&&(w.prev=_),o!==null&&(o.first===r&&(o.first=w),o.last===r&&(o.last=_))}function vr(r,o,_=!0){var w=[];Tn(r,w,!0);var b=()=>{_&&Ne(r),o&&o()},k=w.length;if(k>0){var E=()=>--k||b();for(var n of w)n.out(E)}else b()}function Tn(r,o,_){if((r.f&tt)===0){r.f^=tt;var w=r.nodes&&r.nodes.t;if(w!==null)for(const n of w)(n.is_global||_)&&o.push(n);for(var b=r.first;b!==null;){var k=b.next,E=(b.f&pr)!==0||(b.f&mt)!==0&&(r.f&rr)!==0;Tn(b,o,E?_:!1),b=k}}}function vs(r){Bn(r,!0)}function Bn(r,o){if((r.f&tt)!==0){r.f^=tt,(r.f&Pe)===0&&(ke(r,Ue),vt(r));for(var _=r.first;_!==null;){var w=_.next,b=(_.f&pr)!==0||(_.f&mt)!==0;Bn(_,b?o:!1),_=w}var k=r.nodes&&r.nodes.t;if(k!==null)for(const E of k)(E.is_global||o)&&E.in()}}function Mn(r,o){if(r.nodes)for(var _=r.nodes.start,w=r.nodes.end;_!==null;){var b=_===w?null:ri(_);o.append(_),_=b}}let di=!1,er=!1;function Ms(r){er=r}let fe=null,pt=!1;function lt(r){fe=r}let pe=null;function Lt(r){pe=r}let at=null;function On(r){fe!==null&&(at===null?at=[r]:at.push(r))}let Ve=null,Ze=0,st=null;function Pa(r){st=r}let Pn=1,ar=0,Nt=ar;function Os(r){Nt=r}function In(){return++Pn}function ni(r){var o=r.f;if((o&Ue)!==0)return!0;if(o&We&&(r.f&=~gr),(o>)!==0){for(var _=r.deps,w=_.length,b=0;b<w;b++){var k=_[b];if(ni(k)&&mn(k),k.wv>r.wv)return!0}(o&ot)!==0&&He===null&&ke(r,Pe)}return!1}function Hn(r,o,_=!0){var w=r.reactions;if(w!==null&&!(at!==null&&Tr.call(at,r)))for(var b=0;b<w.length;b++){var k=w[b];(k.f&We)!==0?Hn(k,o,!1):o===k&&(_?ke(k,Ue):(k.f&Pe)!==0&&ke(k,gt),vt(k))}}function Fn(r){var h;var o=Ve,_=Ze,w=st,b=fe,k=at,E=Xe,n=pt,a=Nt,c=r.f;Ve=null,Ze=0,st=null,fe=(c&(mt|Sr))===0?r:null,at=null,Br(r.ctx),pt=!1,Nt=++ar,r.ac!==null&&(wi(()=>{r.ac.abort(nr)}),r.ac=null);try{r.f|=Ui;var f=r.fn,l=f();r.f|=Nr;var u=r.deps,p=de==null?void 0:de.is_fork;if(Ve!==null){var m;if(p||Jr(r,Ze),u!==null&&Ze>0)for(u.length=Ze+Ve.length,m=0;m<Ve.length;m++)u[Ze+m]=Ve[m];else r.deps=u=Ve;if(ds()&&(r.f&ot)!==0)for(m=Ze;m<u.length;m++)((h=u[m]).reactions??(h.reactions=[])).push(r)}else!p&&u!==null&&Ze<u.length&&(Jr(r,Ze),u.length=Ze);if(an()&&st!==null&&!pt&&u!==null&&(r.f&(We|gt|Ue))===0)for(m=0;m<st.length;m++)Hn(st[m],r);if(b!==null&&b!==r){if(ar++,b.deps!==null)for(let t=0;t<_;t+=1)b.deps[t].rv=ar;if(o!==null)for(const t of o)t.rv=ar;st!==null&&(w===null?w=st:w.push(...st))}return(r.f&Xt)!==0&&(r.f^=Xt),l}catch(t){return cn(t)}finally{r.f^=Ui,Ve=o,Ze=_,st=w,fe=b,at=k,Br(E),pt=n,Nt=a}}function Ia(r,o){let _=o.reactions;if(_!==null){var w=To.call(_,r);if(w!==-1){var b=_.length-1;b===0?_=o.reactions=null:(_[w]=_[b],_.pop())}}if(_===null&&(o.f&We)!==0&&(Ve===null||!Tr.call(Ve,o))){var k=o;(k.f&ot)!==0&&(k.f^=ot,k.f&=~gr),hs(k),Sa(k),Jr(k,0)}}function Jr(r,o){var _=r.deps;if(_!==null)for(var w=o;w<_.length;w++)Ia(r,_[w])}function Ir(r){var o=r.f;if((o&Ht)===0){ke(r,Pe);var _=pe,w=di;pe=r,di=!0;try{(o&(rr|as))!==0?Ma(r):_s(r),Rn(r);var b=Fn(r);r.teardown=typeof b=="function"?b:null,r.wv=Pn;var k;Ni&&ra&&(r.f&Ue)!==0&&r.deps}finally{di=w,pe=_}}}async function Ha(){await Promise.resolve(),na()}function L(r){var o=r.f,_=(o&We)!==0;if(fe!==null&&!pt){var w=pe!==null&&(pe.f&Ht)!==0;if(!w&&(at===null||!Tr.call(at,r))){var b=fe.deps;if((fe.f&Ui)!==0)r.rv<ar&&(r.rv=ar,Ve===null&&b!==null&&b[Ze]===r?Ze++:Ve===null?Ve=[r]:Ve.push(r));else{(fe.deps??(fe.deps=[])).push(r);var k=r.reactions;k===null?r.reactions=[fe]:Tr.call(k,fe)||k.push(fe)}}}if(er&&Yt.has(r))return Yt.get(r);if(_){var E=r;if(er){var n=E.v;return((E.f&Pe)===0&&E.reactions!==null||Wn(E))&&(n=us(E)),Yt.set(E,n),n}var a=(E.f&ot)===0&&!pt&&fe!==null&&(di||(fe.f&ot)!==0),c=(E.f&Nr)===0;ni(E)&&(a&&(E.f|=ot),mn(E)),a&&!c&&(Sn(E),Nn(E))}if(He!=null&&He.has(r))return He.get(r);if((r.f&Xt)!==0)throw r.v;return r.v}function Nn(r){if(r.f|=ot,r.deps!==null)for(const o of r.deps)(o.reactions??(o.reactions=[])).push(r),(o.f&We)!==0&&(o.f&ot)===0&&(Sn(o),Nn(o))}function Wn(r){if(r.v===Oe)return!0;if(r.deps===null)return!1;for(const o of r.deps)if(Yt.has(o)||(o.f&We)!==0&&Wn(o))return!0;return!1}function Wt(r){var o=pt;try{return pt=!0,r()}finally{pt=o}}const lr=Symbol("events"),Un=new Set,Zi=new Set;function jn(r,o,_,w={}){function b(k){if(w.capture||Qi.call(o,k),!k.cancelBubble)return wi(()=>_==null?void 0:_.call(this,k))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?kt(()=>{o.addEventListener(r,b,w)}):o.addEventListener(r,b,w),b}function oi(r,o,_,w,b){var k={capture:w,passive:b},E=jn(r,o,_,k);(o===document.body||o===window||o===document||o instanceof HTMLMediaElement)&&fs(()=>{o.removeEventListener(r,E,k)})}function me(r,o,_){(o[lr]??(o[lr]={}))[r]=_}function St(r){for(var o=0;o<r.length;o++)Un.add(r[o]);for(var _ of Zi)_(r)}let Ps=null;function Qi(r){var t,i;var o=this,_=o.ownerDocument,w=r.type,b=((t=r.composedPath)==null?void 0:t.call(r))||[],k=b[0]||r.target;Ps=r;var E=0,n=Ps===r&&r[lr];if(n){var a=b.indexOf(n);if(a!==-1&&(o===document||o===window)){r[lr]=o;return}var c=b.indexOf(o);if(c===-1)return;a<=c&&(E=a)}if(k=b[E]||r.target,k!==o){Bo(r,"currentTarget",{configurable:!0,get(){return k||_}});var f=fe,l=pe;lt(null),Lt(null);try{for(var u,p=[];k!==null;){var m=k.assignedSlot||k.parentNode||k.host||null;try{var h=(i=k[lr])==null?void 0:i[w];h!=null&&(!k.disabled||r.target===k)&&h.call(k,r)}catch(e){u?p.push(e):u=e}if(r.cancelBubble||m===o||m===null)break;k=m}if(u){for(let e of p)queueMicrotask(()=>{throw e});throw u}}finally{r[lr]=o,delete r.currentTarget,lt(f),Lt(l)}}}var Zs;const Ri=((Zs=globalThis==null?void 0:globalThis.window)==null?void 0:Zs.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function Fa(r){return(Ri==null?void 0:Ri.createHTML(r))??r}function zn(r){var o=ka("template");return o.innerHTML=Fa(r.replaceAll("<!>","<!---->")),o.content}function Yr(r,o){var _=pe;_.nodes===null&&(_.nodes={start:r,end:o,a:null,t:null})}function ee(r,o){var _=(o&Do)!==0,w=(o&Ro)!==0,b,k=!r.startsWith("<!>");return()=>{b===void 0&&(b=zn(k?r:"<!>"+r),_||(b=Pr(b)));var E=w||Cn?document.importNode(b,!0):b.cloneNode(!0);if(_){var n=Pr(E),a=E.lastChild;Yr(n,a)}else Yr(E,E);return E}}function Na(r,o,_="svg"){var w=!r.startsWith("<!>"),b=`<${_}>${w?r:"<!>"+r}</${_}>`,k;return()=>{if(!k){var E=zn(b),n=Pr(E);k=Pr(n)}var a=k.cloneNode(!0);return Yr(a,a),a}}function yi(r,o){return Na(r,o,"svg")}function Fe(r=""){{var o=Ft(r+"");return Yr(o,o),o}}function tr(){var r=document.createDocumentFragment(),o=document.createComment(""),_=Ft();return r.append(o,_),Yr(o,_),r}function G(r,o){r!==null&&r.before(o)}function Wa(r){return r.endsWith("capture")&&r!=="gotpointercapture"&&r!=="lostpointercapture"}const Ua=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function ja(r){return Ua.includes(r)}const za={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 $a(r){return r=r.toLowerCase(),za[r]??r}const Ka=["touchstart","touchmove"];function qa(r){return Ka.includes(r)}function se(r,o){var _=o==null?"":typeof o=="object"?`${o}`:o;_!==(r.__t??(r.__t=r.nodeValue))&&(r.__t=_,r.nodeValue=`${_}`)}function Va(r,o){return Ga(r,o)}const li=new Map;function Ga(r,{target:o,anchor:_,props:w={},events:b,context:k,intro:E=!0,transformError:n}){xa();var a=void 0,c=Ta(()=>{var f=_??o.appendChild(Ft());ca(f,{pending:()=>{}},p=>{De({});var m=Xe;k&&(m.c=k),b&&(w.$$events=b),a=r(p,w)||{},Re()},n);var l=new Set,u=p=>{for(var m=0;m<p.length;m++){var h=p[m];if(!l.has(h)){l.add(h);var t=qa(h);for(const s of[o,document]){var i=li.get(s);i===void 0&&(i=new Map,li.set(s,i));var e=i.get(h);e===void 0?(s.addEventListener(h,Qi,{passive:t}),i.set(h,1)):i.set(h,e+1)}}}};return u(mi(Un)),Zi.add(u),()=>{var t;for(var p of l)for(const i of[o,document]){var m=li.get(i),h=m.get(p);--h==0?(i.removeEventListener(p,Qi),m.delete(p),m.size===0&&li.delete(i)):m.set(p,h)}Zi.delete(u),f!==_&&((t=f.parentNode)==null||t.removeChild(f))}});return Xa.set(a,c),a}let Xa=new WeakMap;var ft,Et,et,fr,ei,ti,vi;class ps{constructor(o,_=!0){wt(this,"anchor");he(this,ft,new Map);he(this,Et,new Map);he(this,et,new Map);he(this,fr,new Set);he(this,ei,!0);he(this,ti,o=>{if(W(this,ft).has(o)){var _=W(this,ft).get(o),w=W(this,Et).get(_);if(w)vs(w),W(this,fr).delete(_);else{var b=W(this,et).get(_);b&&(W(this,Et).set(_,b.effect),W(this,et).delete(_),b.fragment.lastChild.remove(),this.anchor.before(b.fragment),w=b.effect)}for(const[k,E]of W(this,ft)){if(W(this,ft).delete(k),k===o)break;const n=W(this,et).get(E);n&&(Ne(n.effect),W(this,et).delete(E))}for(const[k,E]of W(this,Et)){if(k===_||W(this,fr).has(k))continue;const n=()=>{if(Array.from(W(this,ft).values()).includes(k)){var c=document.createDocumentFragment();Mn(E,c),c.append(Ft()),W(this,et).set(k,{effect:E,fragment:c})}else Ne(E);W(this,fr).delete(k),W(this,Et).delete(k)};W(this,ei)||!w?(W(this,fr).add(k),vr(E,n,!1)):n()}}});he(this,vi,o=>{W(this,ft).delete(o);const _=Array.from(W(this,ft).values());for(const[w,b]of W(this,et))_.includes(w)||(Ne(b.effect),W(this,et).delete(w))});this.anchor=o,ue(this,ei,_)}ensure(o,_){var w=de,b=En();if(_&&!W(this,Et).has(o)&&!W(this,et).has(o))if(b){var k=document.createDocumentFragment(),E=Ft();k.append(E),W(this,et).set(o,{effect:Ge(()=>_(E)),fragment:k})}else W(this,Et).set(o,Ge(()=>_(this.anchor)));if(W(this,ft).set(w,o),b){for(const[n,a]of W(this,Et))n===o?w.unskip_effect(a):w.skip_effect(a);for(const[n,a]of W(this,et))n===o?w.unskip_effect(a.effect):w.skip_effect(a.effect);w.oncommit(W(this,ti)),w.ondiscard(W(this,vi))}else W(this,ti).call(this,w)}}ft=new WeakMap,Et=new WeakMap,et=new WeakMap,fr=new WeakMap,ei=new WeakMap,ti=new WeakMap,vi=new WeakMap;function gs(r,o,..._){var w=new ps(r);si(()=>{const b=o()??null;w.ensure(b,b&&(k=>b(k,..._)))},pr)}function ms(r){Xe===null&&sn(),mr(()=>{const o=Wt(r);if(typeof o=="function")return o})}function Ja(r){Xe===null&&sn(),ms(()=>()=>Wt(r))}function ne(r,o,_=!1){var w=new ps(r),b=_?pr:0;function k(E,n){w.ensure(E,n)}si(()=>{var E=!1;o((n,a=0)=>{E=!0,k(a,n)}),E||k(!1,null)},b)}const Ya=Symbol("NaN");function Za(r,o,_){var w=new ps(r);si(()=>{var b=o();b!==b&&(b=Ya),w.ensure(b,_)})}function Zr(r,o){return o}function Qa(r,o,_){for(var w=[],b=o.length,k,E=o.length,n=0;n<b;n++){let l=o[n];vr(l,()=>{if(k){if(k.pending.delete(l),k.done.add(l),k.pending.size===0){var u=r.outrogroups;es(mi(k.done)),u.delete(k),u.size===0&&(r.outrogroups=null)}}else E-=1},!1)}if(E===0){var a=w.length===0&&_!==null;if(a){var c=_,f=c.parentNode;Ea(f),f.append(c),r.items.clear()}es(o,!a)}else k={pending:new Set(o),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(k)}function es(r,o=!0){for(var _=0;_<r.length;_++)Ne(r[_],o)}var Is;function je(r,o,_,w,b,k=null){var E=r,n=new Map,a=(o&Qs)!==0;if(a){var c=r;E=c.appendChild(Ft())}var f=null,l=gn(()=>{var i=_();return os(i)?i:i==null?[]:mi(i)}),u,p=!0;function m(){t.fallback=f,el(t,u,E,o,w),f!==null&&(u.length===0?(f.f&It)===0?vs(f):(f.f^=It,qr(f,null,E)):vr(f,()=>{f=null}))}var h=si(()=>{u=L(l);for(var i=u.length,e=new Set,s=de,d=En(),g=0;g<i;g+=1){var S=u[g],C=w(S,g),v=p?null:n.get(C);v?(v.v&&Or(v.v,S),v.i&&Or(v.i,g),d&&s.unskip_effect(v.e)):(v=tl(n,p?E:Is??(Is=Ft()),S,C,g,b,o,_),p||(v.e.f|=It),n.set(C,v)),e.add(C)}if(i===0&&k&&!f&&(p?f=Ge(()=>k(E)):(f=Ge(()=>k(Is??(Is=Ft()))),f.f|=It)),i>e.size&&zo(),!p)if(d){for(const[x,M]of n)e.has(x)||s.skip_effect(M.e);s.oncommit(m),s.ondiscard(()=>{})}else m();L(l)}),t={effect:h,items:n,outrogroups:null,fallback:f};p=!1}function zr(r){for(;r!==null&&(r.f&mt)===0;)r=r.next;return r}function el(r,o,_,w,b){var M,O,P,T,H,I,N,j,$;var k=(w&Co)!==0,E=o.length,n=r.items,a=zr(r.effect.first),c,f=null,l,u=[],p=[],m,h,t,i;if(k)for(i=0;i<E;i+=1)m=o[i],h=b(m,i),t=n.get(h).e,(t.f&It)===0&&((O=(M=t.nodes)==null?void 0:M.a)==null||O.measure(),(l??(l=new Set)).add(t));for(i=0;i<E;i+=1){if(m=o[i],h=b(m,i),t=n.get(h).e,r.outrogroups!==null)for(const y of r.outrogroups)y.pending.delete(t),y.done.delete(t);if((t.f&It)!==0)if(t.f^=It,t===a)qr(t,null,_);else{var e=f?f.next:a;t===r.effect.last&&(r.effect.last=t.prev),t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),zt(r,f,t),zt(r,t,e),qr(t,e,_),f=t,u=[],p=[],a=zr(f.next);continue}if((t.f&tt)!==0&&(vs(t),k&&((T=(P=t.nodes)==null?void 0:P.a)==null||T.unfix(),(l??(l=new Set)).delete(t))),t!==a){if(c!==void 0&&c.has(t)){if(u.length<p.length){var s=p[0],d;f=s.prev;var g=u[0],S=u[u.length-1];for(d=0;d<u.length;d+=1)qr(u[d],s,_);for(d=0;d<p.length;d+=1)c.delete(p[d]);zt(r,g.prev,S.next),zt(r,f,g),zt(r,S,s),a=s,f=S,i-=1,u=[],p=[]}else c.delete(t),qr(t,a,_),zt(r,t.prev,t.next),zt(r,t,f===null?r.effect.first:f.next),zt(r,f,t),f=t;continue}for(u=[],p=[];a!==null&&a!==t;)(c??(c=new Set)).add(a),p.push(a),a=zr(a.next);if(a===null)continue}(t.f&It)===0&&u.push(t),f=t,a=zr(t.next)}if(r.outrogroups!==null){for(const y of r.outrogroups)y.pending.size===0&&(es(mi(y.done)),(H=r.outrogroups)==null||H.delete(y));r.outrogroups.size===0&&(r.outrogroups=null)}if(a!==null||c!==void 0){var C=[];if(c!==void 0)for(t of c)(t.f&tt)===0&&C.push(t);for(;a!==null;)(a.f&tt)===0&&a!==r.fallback&&C.push(a),a=zr(a.next);var v=C.length;if(v>0){var x=(w&Qs)!==0&&E===0?_:null;if(k){for(i=0;i<v;i+=1)(N=(I=C[i].nodes)==null?void 0:I.a)==null||N.measure();for(i=0;i<v;i+=1)($=(j=C[i].nodes)==null?void 0:j.a)==null||$.fix()}Qa(r,C,x)}}k&&kt(()=>{var y,R;if(l!==void 0)for(t of l)(R=(y=t.nodes)==null?void 0:y.a)==null||R.apply()})}function tl(r,o,_,w,b,k,E,n){var a=(E&bo)!==0?(E&yo)===0?ba(_,!1,!1):Qt(_):null,c=(E&wo)!==0?Qt(b):null;return{v:a,i:c,e:Ge(()=>(k(o,a??_,c??b,n),()=>{r.delete(w)}))}}function qr(r,o,_){if(r.nodes)for(var w=r.nodes.start,b=r.nodes.end,k=o&&(o.f&It)===0?o.nodes.start:_;w!==null;){var E=ri(w);if(k.before(w),w===b)return;w=E}}function zt(r,o,_){o===null?r.effect.first=_:o.next=_,_===null?r.effect.last=o:_.prev=o}function rl(r,o,_){ii(()=>{var w=Wt(()=>o(r,_==null?void 0:_())||{});if(w!=null&&w.destroy)return()=>w.destroy()})}function il(r,o){var _=void 0,w;Dn(()=>{_!==(_=o())&&(w&&(Ne(w),w=null),_&&(w=Ge(()=>{ii(()=>_(r))})))})}function $n(r){var o,_,w="";if(typeof r=="string"||typeof r=="number")w+=r;else if(typeof r=="object")if(Array.isArray(r)){var b=r.length;for(o=0;o<b;o++)r[o]&&(_=$n(r[o]))&&(w&&(w+=" "),w+=_)}else for(_ in r)r[_]&&(w&&(w+=" "),w+=_);return w}function sl(){for(var r,o,_=0,w="",b=arguments.length;_<b;_++)(r=arguments[_])&&(o=$n(r))&&(w&&(w+=" "),w+=o);return w}function Kn(r){return typeof r=="object"?sl(r):r??""}const Hs=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function nl(r,o,_){var w=r==null?"":""+r;if(o&&(w=w?w+" "+o:o),_){for(var b of Object.keys(_))if(_[b])w=w?w+" "+b:b;else if(w.length)for(var k=b.length,E=0;(E=w.indexOf(b,E))>=0;){var n=E+k;(E===0||Hs.includes(w[E-1]))&&(n===w.length||Hs.includes(w[n]))?w=(E===0?"":w.substring(0,E))+w.substring(n+1):E=n}}return w===""?null:w}function Fs(r,o=!1){var _=o?" !important;":";",w="";for(var b of Object.keys(r)){var k=r[b];k!=null&&k!==""&&(w+=" "+b+": "+k+_)}return w}function Ai(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function ol(r,o){if(o){var _="",w,b;if(Array.isArray(o)?(w=o[0],b=o[1]):w=o,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var k=!1,E=0,n=!1,a=[];w&&a.push(...Object.keys(w).map(Ai)),b&&a.push(...Object.keys(b).map(Ai));var c=0,f=-1;const h=r.length;for(var l=0;l<h;l++){var u=r[l];if(n?u==="/"&&r[l-1]==="*"&&(n=!1):k?k===u&&(k=!1):u==="/"&&r[l+1]==="*"?n=!0:u==='"'||u==="'"?k=u:u==="("?E++:u===")"&&E--,!n&&k===!1&&E===0){if(u===":"&&f===-1)f=l;else if(u===";"||l===h-1){if(f!==-1){var p=Ai(r.substring(c,f).trim());if(!a.includes(p)){u!==";"&&l++;var m=r.substring(c,l).trim();_+=" "+m+";"}}c=l+1,f=-1}}}}return w&&(_+=Fs(w)),b&&(_+=Fs(b,!0)),_=_.trim(),_===""?null:_}return r==null?null:String(r)}function Be(r,o,_,w,b,k){var E=r.__className;if(E!==_||E===void 0){var n=nl(_,w,k);n==null?r.removeAttribute("class"):o?r.className=n:r.setAttribute("class",n),r.__className=_}else if(k&&b!==k)for(var a in k){var c=!!k[a];(b==null||c!==!!b[a])&&r.classList.toggle(a,c)}return k}function Ti(r,o={},_,w){for(var b in _){var k=_[b];o[b]!==k&&(_[b]==null?r.style.removeProperty(b):r.style.setProperty(b,k,w))}}function Qr(r,o,_,w){var b=r.__style;if(b!==o){var k=ol(o,w);k==null?r.removeAttribute("style"):r.style.cssText=k,r.__style=o}else w&&(Array.isArray(w)?(Ti(r,_==null?void 0:_[0],w[0]),Ti(r,_==null?void 0:_[1],w[1],"important")):Ti(r,_,w));return w}function ts(r,o,_=!1){if(r.multiple){if(o==null)return;if(!os(o))return Qo();for(var w of r.options)w.selected=o.includes(Ns(w));return}for(w of r.options){var b=Ns(w);if(ya(b,o)){w.selected=!0;return}}(!_||o!==void 0)&&(r.selectedIndex=-1)}function al(r){var o=new MutationObserver(()=>{ts(r,r.__value)});o.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),fs(()=>{o.disconnect()})}function Ns(r){return"__value"in r?r.__value:r.value}const $r=Symbol("class"),Kr=Symbol("style"),qn=Symbol("is custom element"),Vn=Symbol("is html"),ll=cs?"option":"OPTION",cl=cs?"select":"SELECT",hl=cs?"progress":"PROGRESS";function Ws(r,o){var _=xi(r);_.value===(_.value=o??void 0)||r.value===o&&(o!==0||r.nodeName!==hl)||(r.value=o??"")}function rs(r,o){var _=xi(r);_.checked!==(_.checked=o??void 0)&&(r.checked=o)}function ul(r,o){o?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Ce(r,o,_,w){var b=xi(r);b[o]!==(b[o]=_)&&(o==="loading"&&(r[Uo]=_),_==null?r.removeAttribute(o):typeof _!="string"&&Xn(r).includes(o)?r[o]=_:r.setAttribute(o,_))}function dl(r,o,_,w,b=!1,k=!1){var E=xi(r),n=E[qn],a=!E[Vn],c=o||{},f=r.nodeName===ll;for(var l in o)l in _||(_[l]=null);_.class?_.class=Kn(_.class):_[$r]&&(_.class=null),_[Kr]&&(_.style??(_.style=null));var u=Xn(r);for(const d in _){let g=_[d];if(f&&d==="value"&&g==null){r.value=r.__value="",c[d]=g;continue}if(d==="class"){var p=r.namespaceURI==="http://www.w3.org/1999/xhtml";Be(r,p,g,w,o==null?void 0:o[$r],_[$r]),c[d]=g,c[$r]=_[$r];continue}if(d==="style"){Qr(r,g,o==null?void 0:o[Kr],_[Kr]),c[d]=g,c[Kr]=_[Kr];continue}var m=c[d];if(!(g===m&&!(g===void 0&&r.hasAttribute(d)))){c[d]=g;var h=d[0]+d[1];if(h!=="$$")if(h==="on"){const S={},C="$$"+d;let v=d.slice(2);var t=ja(v);if(Wa(v)&&(v=v.slice(0,-7),S.capture=!0),!t&&m){if(g!=null)continue;r.removeEventListener(v,c[C],S),c[C]=null}if(t)me(v,r,g),St([v]);else if(g!=null){let x=function(M){c[d].call(this,M)};var s=x;c[C]=jn(v,r,x,S)}}else if(d==="style")Ce(r,d,g);else if(d==="autofocus")La(r,!!g);else if(!n&&(d==="__value"||d==="value"&&g!=null))r.value=r.__value=g;else if(d==="selected"&&f)ul(r,g);else{var i=d;a||(i=$a(i));var e=i==="defaultValue"||i==="defaultChecked";if(g==null&&!n&&!e)if(E[d]=null,i==="value"||i==="checked"){let S=r;const C=o===void 0;if(i==="value"){let v=S.defaultValue;S.removeAttribute(i),S.defaultValue=v,S.value=S.__value=C?v:null}else{let v=S.defaultChecked;S.removeAttribute(i),S.defaultChecked=v,S.checked=C?v:!1}}else r.removeAttribute(d);else e||u.includes(i)&&(n||typeof g!="string")?(r[i]=g,i in E&&(E[i]=Oe)):typeof g!="function"&&Ce(r,i,g)}}}return c}function Gn(r,o,_=[],w=[],b=[],k,E=!1,n=!1){pn(b,_,w,a=>{var c=void 0,f={},l=r.nodeName===cl,u=!1;if(Dn(()=>{var m=o(...a.map(L)),h=dl(r,c,m,k,E,n);u&&l&&"value"in m&&ts(r,m.value);for(let i of Object.getOwnPropertySymbols(f))m[i]||Ne(f[i]);for(let i of Object.getOwnPropertySymbols(m)){var t=m[i];i.description===Ao&&(!c||t!==c[i])&&(f[i]&&Ne(f[i]),f[i]=Ge(()=>il(r,()=>t))),h[i]=t}c=h}),l){var p=r;ii(()=>{ts(p,c.value,!0),al(p)})}u=!0})}function xi(r){return r.__attributes??(r.__attributes={[qn]:r.nodeName.includes("-"),[Vn]:r.namespaceURI===en})}var Us=new Map;function Xn(r){var o=r.getAttribute("is")||r.nodeName,_=Us.get(o);if(_)return _;Us.set(o,_=[]);for(var w,b=r,k=Element.prototype;k!==b;){w=Mo(b);for(var E in w)w[E].set&&_.push(E);b=tn(b)}return _}function Gr(r,o,_=o){var w=new WeakSet;kn(r,"input",async b=>{var k=b?r.defaultValue:r.value;if(k=Bi(r)?Mi(k):k,_(k),de!==null&&w.add(de),await Ha(),k!==(k=o())){var E=r.selectionStart,n=r.selectionEnd,a=r.value.length;if(r.value=k??"",n!==null){var c=r.value.length;E===n&&n===a&&c>a?(r.selectionStart=c,r.selectionEnd=c):(r.selectionStart=E,r.selectionEnd=Math.min(n,c))}}}),Wt(o)==null&&r.value&&(_(Bi(r)?Mi(r.value):r.value),de!==null&&w.add(de)),Ci(()=>{var b=o();if(r===document.activeElement){var k=ji??de;if(w.has(k))return}Bi(r)&&b===Mi(r.value)||r.type==="date"&&!b&&!r.value||b!==r.value&&(r.value=b??"")})}function fl(r,o,_=o){kn(r,"change",w=>{var b=w?r.defaultChecked:r.checked;_(b)}),Wt(o)==null&&_(r.checked),Ci(()=>{var w=o();r.checked=!!w})}function Bi(r){var o=r.type;return o==="number"||o==="range"}function Mi(r){return r===""?null:+r}function js(r,o){return r===o||(r==null?void 0:r[_r])===o}function Ei(r={},o,_,w){return ii(()=>{var b,k;return Ci(()=>{b=k,k=[],Wt(()=>{r!==_(...k)&&(o(r,...k),b&&js(_(...b),r)&&o(null,...b))})}),()=>{kt(()=>{k&&js(_(...k),r)&&o(null,...k)})}}),r}let ci=!1;function _l(r){var o=ci;try{return ci=!1,[r(),ci]}finally{ci=o}}const vl={get(r,o){if(!r.exclude.includes(o))return r.props[o]},set(r,o){return!1},getOwnPropertyDescriptor(r,o){if(!r.exclude.includes(o)&&o in r.props)return{enumerable:!0,configurable:!0,value:r.props[o]}},has(r,o){return r.exclude.includes(o)?!1:o in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(o=>!r.exclude.includes(o))}};function Jn(r,o,_){return new Proxy({props:r,exclude:o},vl)}function ye(r,o,_,w){var e;var b=(_&ko)!==0,k=(_&Lo)!==0,E=w,n=!0,a=()=>(n&&(n=!1,E=k?Wt(w):w),E),c;if(b){var f=_r in r||Wo in r;c=((e=wr(r,o))==null?void 0:e.set)??(f&&o in r?s=>r[o]=s:void 0)}var l,u=!1;b?[l,u]=_l(()=>r[o]):l=r[o],l===void 0&&w!==void 0&&(l=a(),c&&(Go(),c(l)));var p;if(p=()=>{var s=r[o];return s===void 0?a():(n=!0,s)},(_&Eo)===0)return p;if(c){var m=r.$$legacy;return(function(s,d){return arguments.length>0?((!d||m||u)&&c(d?p():s),s):p()})}var h=!1,t=((_&xo)!==0?bi:gn)(()=>(h=!1,p()));b&&L(t);var i=pe;return(function(s,d){if(arguments.length>0){const g=d?L(t):b?Ee(s):s;return V(t,g),h=!0,E!==void 0&&(E=g),s}return er&&h||(i.f&Ht)!==0?t.v:L(t)})}const fi="wt-ssh-host";function Ss(r){return r.repo?`${r.repo} #${r.number}`:`PR #${r.number}`}function cr(r){return r instanceof Error?r.message:String(r)}function zs(r,o){return o.toLowerCase().includes(r.toLowerCase())}var pl=ee('<a target="_blank" rel="noopener"> </a>'),gl=ee("<span> </span>");function Yn(r,o){De(o,!0);let _=ye(o,"clickable",3,!1);function w(c){return c==="merged"?"bg-[#8b5cf6]/20 text-[#a78bfa]":c==="closed"?"bg-danger/20 text-danger":c==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}let b=ve(()=>Ss(o.pr));var k=tr(),E=Le(k);{var n=c=>{var f=pl(),l=X(f);oe(u=>{Ce(f,"href",o.pr.url),Be(f,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),se(l,L(b))},[()=>w(o.pr.state)]),G(c,f)},a=c=>{var f=gl(),l=X(f);oe(u=>{Be(f,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),se(l,L(b))},[()=>w(o.pr.state)]),G(c,f)};ne(E,c=>{_()&&o.pr.url?c(n):c(a,!1)})}G(r,k),Re()}var ml=ee('<a target="_blank" rel="noopener noreferrer" class="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80"> </a>');function Zn(r,o){De(o,!0);var _=ml(),w=X(_);oe(()=>{Ce(_,"href",o.issue.url),Qr(_,`color: ${o.issue.state.color??""}; background: ${o.issue.state.color??""}20;`),Ce(_,"title",`${o.issue.identifier??""} (${o.issue.state.name??""})`),se(w,o.issue.identifier)}),G(r,_),Re()}var Sl=yi('<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>'),bl=yi('<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>'),wl=yi('<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>'),Cl=yi('<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>'),yl=ee("<span><!> </span>");function xl(r,o){const _=f=>{var l=tr(),u=Le(l);{var p=i=>{var e=Sl();oe(()=>{Ce(e,"width",w()),Ce(e,"height",w())}),G(i,e)},m=i=>{var e=bl();oe(()=>{Ce(e,"width",w()),Ce(e,"height",w())}),G(i,e)},h=i=>{var e=wl();oe(()=>{Ce(e,"width",w()),Ce(e,"height",w())}),G(i,e)},t=i=>{var e=Cl();oe(()=>{Ce(e,"width",w()),Ce(e,"height",w())}),G(i,e)};ne(u,i=>{o.status==="working"?i(p):o.status==="waiting"?i(m,1):o.status==="done"?i(h,2):o.status==="error"&&i(t,3)})}G(f,l)};let w=ye(o,"size",3,10),b=ye(o,"pill",3,!1);function k(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 E=tr(),n=Le(E);{var a=f=>{var l=yl(),u=X(l);_(u);var p=J(u);oe(m=>{Be(l,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${m??""}`),se(p,` ${(o.status||"idle")??""}`)},[()=>k(o.status)]),G(f,l)},c=f=>{_(f)};ne(n,f=>{b()?f(a):f(c,!1)})}G(r,E)}var El=ee('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),kl=ee('<span class="shrink-0 text-[10px] text-muted">closed</span>'),Ll=ee('<span class="shrink-0"><!></span>'),Dl=ee('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),Rl=ee("<span> </span>"),Al=ee("<span> </span>"),Tl=ee("<span> </span>"),Bl=ee('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),Ml=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">×</button></li>'),Ol=ee('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function Pl(r,o){De(o,!0);var _=Ol();je(_,21,()=>o.worktrees,w=>w.branch,(w,b)=>{const k=ve(()=>L(b).branch===o.selected),E=ve(()=>o.removing.has(L(b).branch)),n=ve(()=>L(b).mux!=="✓"),a=ve(()=>o.initializing.has(L(b).branch));var c=Ml(),f=X(c),l=X(f),u=X(l),p=X(u),m=X(p),h=J(p,2);{var t=j=>{var $=El();G(j,$)},i=j=>{var $=kl();G(j,$)},e=j=>{var $=Ll(),y=X($);xl(y,{get status(){return L(b).agent},size:14}),G(j,$)};ne(h,j=>{L(a)?j(t):L(n)?j(i,1):j(e,!1)})}var s=J(h,2);{var d=j=>{var $=Dl();G(j,$)},g=ve(()=>o.notifiedBranches.has(L(b).branch));ne(s,j=>{L(g)&&j(d)})}var S=J(u,2);je(S,17,()=>L(b).prs,j=>j.repo,(j,$)=>{Yn(j,{get pr(){return L($)}})});var C=J(S,2);{var v=j=>{Zn(j,{get issue(){return L(b).linearIssue}})};ne(C,j=>{L(b).linearIssue&&j(v)})}var x=J(l,2),M=X(x);{var O=j=>{var $=Rl(),y=X($);oe(()=>se(y,L(b).agentName)),G(j,$)};ne(M,j=>{L(b).agentName&&j(O)})}var P=J(M,2);{var T=j=>{var $=Al(),y=X($);oe(()=>se(y,L(b).profile)),G(j,$)};ne(P,j=>{L(b).profile&&j(T)})}var H=J(x,2);{var I=j=>{var $=Bl();je($,21,()=>L(b).services,Zr,(y,R)=>{var A=tr(),B=Le(A);{var U=K=>{var Q=Tl(),te=X(Q);oe(()=>{Be(Q,1,Kn(L(R).running?"text-success":"")),se(te,`${L(R).name??""}:${L(R).port??""}`)}),G(K,Q)};ne(B,K=>{L(R).port&&K(U)})}G(y,A)}),G(j,$)};ne(H,j=>{L(b).services.length>0&&j(I)})}var N=J(f,2);oe(()=>{Be(c,1,`mb-0.5 group relative ${L(E)||L(a)?"opacity-40 pointer-events-none":""}`),Be(f,1,`w-full py-2.5 px-3 rounded-md border cursor-pointer flex flex-col gap-1 text-left text-inherit text-sm bg-transparent hover:bg-hover ${L(k)?"bg-active border-accent":"border-transparent"} ${L(n)&&!L(a)?"opacity-50":""}`),se(m,L(b).branch)}),me("click",f,()=>o.onselect(L(b).branch)),me("click",N,j=>{j.stopPropagation(),o.onremove(L(b).branch)}),G(w,c)}),G(r,_),Re()}St(["click"]);var Il=ee('<button type="button" title="View CI checks"><span></span> CI</button>');function Hl(r,o){De(o,!0);function _(E){return E==="failed"?"bg-danger/20 text-danger":E==="success"?"bg-success/20 text-success":E==="pending"?"bg-warning/20 text-warning":"bg-muted/20 text-muted"}function w(E){return E==="failed"?"bg-danger":E==="success"?"bg-success":E==="pending"?"bg-warning animate-pulse":"bg-muted"}var b=Il(),k=X(b);oe((E,n)=>{Be(b,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex items-center gap-1 cursor-pointer border-none hover:opacity-80 ${E??""}`),Be(k,1,`inline-block w-1.5 h-1.5 rounded-full ${n??""}`)},[()=>_(o.pr.ciStatus),()=>w(o.pr.ciStatus)]),me("click",b,E=>{E.stopPropagation(),o.onclick(o.pr)}),G(r,b),Re()}St(["click"]);var Fl=ee('<button type="button" class="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex items-center gap-1 cursor-pointer border-none hover:opacity-80 bg-accent/20 text-accent" title="Send PR comments to Claude for review"><span class="inline-block w-1.5 h-1.5 rounded-full bg-accent"></span> </button>');function Nl(r,o){De(o,!0);var _=Fl(),w=J(X(_));oe(()=>se(w,` ${o.pr.comments.length??""} ${o.pr.comments.length===1?"comment":"comments"}`)),me("click",_,b=>{b.stopPropagation(),o.onclick(o.pr)}),G(r,_),Re()}St(["click"]);var Wl=ee("<button><!></button>");function ze(r,o){let _=ye(o,"variant",3,"default"),w=ye(o,"small",3,!1),b=ye(o,"class",3,""),k=Jn(o,["$$slots","$$events","$$legacy","variant","small","class","children"]);const E={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},n={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 a=Wl();Gn(a,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${E[w()?"small":"normal"]??""} ${n[_()]??""} ${b()??""}`,...k}));var c=X(a);gs(c,()=>o.children),G(r,a)}var Ul=ee('<span class="text-success">✓</span>'),jl=ee('<span class="text-accent">☍</span>'),zl=ee('<span class="text-[10px] text-muted"> </span>'),$l=ee('<span class="text-xs text-accent truncate"> </span>'),Kl=ee('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function Qn(r,o){De(o,!0);let _=ye(o,"showTimestamp",3,!1),w=ye(o,"large",3,!1);var b=Kl(),k=Le(b),E=X(k);{var n=h=>{var t=Ul();G(h,t)},a=h=>{var t=jl();G(h,t)};ne(E,h=>{o.notification.type==="agent_stopped"?h(n):h(a,!1)})}var c=J(k,2),f=X(c),l=X(f),u=J(f,2);{var p=h=>{var t=zl(),i=X(t);oe(e=>se(i,e),[()=>new Date(o.notification.timestamp).toLocaleTimeString()]),G(h,t)},m=h=>{var t=$l(),i=X(t);oe(()=>se(i,o.notification.url)),G(h,t)};ne(u,h=>{_()?h(p):o.notification.url&&h(m,1)})}oe(()=>{Be(k,1,`shrink-0 ${w()?"text-base":"text-sm"}`),Be(f,1,`${w()?"text-sm":"text-xs"} text-primary truncate`),se(l,o.notification.message)}),G(r,b),Re()}var ql=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>'),Vl=ee('<span class="text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning">dirty</span>'),Gl=ee("<!> <!> <!>",1),Xl=ee('<a target="_blank" rel="noopener"> </a>'),Jl=ee('<div class="flex items-center gap-1"><a class="text-[11px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-mono no-underline hover:opacity-80" title="Open in Cursor">Cursor</a><button type="button" class="text-[11px] px-1 py-0.5 rounded border border-accent/40 text-accent cursor-pointer bg-transparent hover:opacity-80 flex items-center" title="Cursor SSH settings"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" 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>'),Yl=ee("<!> <!>",1),Zl=ee("<!> <!>",1),Ql=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>'),ec=ee('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),tc=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>'),rc=ee('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),ic=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>'),sc=ee('<div class="flex items-center justify-between px-4 py-2 bg-topbar border-b border-edge min-h-12"><div class="flex items-center gap-3"><!> <span class="text-sm font-semibold truncate"> </span> <!> <!> <!> <!></div> <div class="flex gap-2 items-center"><!> <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></div></div>');function nc(r,o){De(o,!0);let _=ye(o,"isMobile",3,!1),w=ye(o,"notificationHistory",19,()=>[]),b=ye(o,"unreadCount",3,0),k=ae(!1);function E(){var I;V(k,!L(k)),L(k)&&((I=o.onbellopen)==null||I.call(o))}function n(I){I.target.closest(".bell-container")||V(k,!1)}let a=ve(()=>{var N;const I=(N=o.worktree)==null?void 0:N.dir;return I?o.sshHost?`cursor://vscode-remote/ssh-remote+${o.sshHost}${I}`:`cursor://file${I}`:null});var c=sc();oi("click",Yi,n);var f=X(c),l=X(f);{var u=I=>{var N=ql();me("click",N,function(...j){var $;($=o.ontogglesidebar)==null||$.apply(this,j)}),G(I,N)};ne(l,I=>{_()&&o.ontogglesidebar&&I(u)})}var p=J(l,2),m=X(p),h=J(p,2);{var t=I=>{var N=Vl();G(I,N)};ne(h,I=>{var N;(N=o.worktree)!=null&&N.dirty&&I(t)})}var i=J(h,2);{var e=I=>{Zn(I,{get issue(){return o.worktree.linearIssue}})};ne(i,I=>{var N;(N=o.worktree)!=null&&N.linearIssue&&I(e)})}var s=J(i,2);je(s,17,()=>{var I;return((I=o.worktree)==null?void 0:I.prs)??[]},I=>I.repo,(I,N)=>{var j=Gl(),$=Le(j);Yn($,{get pr(){return L(N)},clickable:!0});var y=J($,2);{var R=U=>{Hl(U,{get pr(){return L(N)},get onclick(){return o.onciclick}})};ne(y,U=>{L(N).ciChecks&&L(N).ciChecks.length>0&&U(R)})}var A=J(y,2);{var B=U=>{Nl(U,{get pr(){return L(N)},get onclick(){return o.onreviewsclick}})};ne(A,U=>{L(N).comments.length>0&&U(B)})}G(I,j)});var d=J(s,2);{var g=I=>{var N=Yl(),j=Le(N);je(j,17,()=>{var R;return((R=o.worktree)==null?void 0:R.services)??[]},Zr,(R,A)=>{var B=tr(),U=Le(B);{var K=Q=>{var te=Xl(),F=X(te);oe(()=>{Ce(te,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${L(A).port??""}`),Be(te,1,`text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${L(A).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),se(F,`${L(A).name??""} :${L(A).port??""}`)}),G(Q,te)};ne(U,Q=>{L(A).port&&Q(K)})}G(R,B)});var $=J(j,2);{var y=R=>{var A=Jl(),B=X(A),U=J(B);oe(()=>Ce(B,"href",L(a))),me("click",U,function(...K){var Q;(Q=o.onsettings)==null||Q.apply(this,K)}),G(R,A)};ne($,R=>{L(a)&&R(y)})}G(I,N)};ne(d,I=>{_()||I(g)})}var S=J(f,2),C=X(S);{var v=I=>{var N=Zl(),j=Le(N);ze(j,{variant:"accent-outline",get onclick(){return o.onmerge},title:"Merge worktree",children:(y,R)=>{var A=Fe();oe(()=>se(A,_()?"M":"Merge")),G(y,A)},$$slots:{default:!0}});var $=J(j,2);ze($,{variant:"danger-outline",get onclick(){return o.onremove},title:"Remove worktree",children:(y,R)=>{var A=Fe();oe(()=>se(A,_()?"R":"Remove")),G(y,A)},$$slots:{default:!0}}),G(I,N)};ne(C,I=>{o.name&&I(v)})}var x=J(C,2),M=X(x),O=J(X(M),2);{var P=I=>{var N=Ql(),j=X(N);oe(()=>se(j,b()>9?"9+":b())),G(I,N)};ne(O,I=>{b()>0&&I(P)})}var T=J(M,2);{var H=I=>{var N=ic(),j=J(X(N),2);{var $=R=>{var A=ec();G(R,A)},y=R=>{var A=rc();je(A,21,w,B=>B.id,(B,U)=>{var K=tc(),Q=X(K),te=X(Q);Qn(te,{get notification(){return L(U)},showTimestamp:!0}),me("click",Q,()=>{var F;(F=o.onnotificationselect)==null||F.call(o,L(U).branch),V(k,!1)}),G(B,K)}),G(R,A)};ne(j,R=>{w().length===0?R($):R(y,!1)})}G(I,N)};ne(T,I=>{L(k)&&I(H)})}oe(()=>se(m,o.name??"Select a worktree")),me("keydown",x,()=>{}),me("click",M,E),G(r,c),Re()}St(["click","keydown"]);var Oi={exports:{}},$s;function oc(){return $s||($s=1,(function(r,o){(function(_,w){r.exports=w()})(globalThis,(()=>(()=>{var _={4567:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,g){var S,C=arguments.length,v=C<3?s:g===null?g=Object.getOwnPropertyDescriptor(s,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,g);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,g){s(d,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const l=a(9042),u=a(9924),p=a(844),m=a(4725),h=a(2585),t=a(3656);let i=n.AccessibilityManager=class extends p.Disposable{constructor(e,s,d,g){super(),this._terminal=e,this._coreBrowserService=d,this._renderService=g,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 S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,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 u.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((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
3
|
+
`)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,t.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let s=0;s<e;s++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
4
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,s){this._liveRegionDebouncer.refresh(e,s,this._terminal.rows)}_renderRows(e,s){const d=this._terminal.buffer,g=d.lines.length.toString();for(let S=e;S<=s;S++){const C=d.lines.get(d.ydisp+S),v=[],x=(C==null?void 0:C.translateToString(!0,void 0,void 0,v))||"",M=(d.ydisp+S+1).toString(),O=this._rowElements[S];O&&(x.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=x,this._rowColumns.set(O,v)),O.setAttribute("aria-posinset",M),O.setAttribute("aria-setsize",g))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,s){const d=e.target,g=this._rowElements[s===0?1:this._rowElements.length-2];if(d.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==g)return;let S,C;if(s===0?(S=d,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(S=this._rowElements.shift(),C=d,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:e.anchorNode,offset:e.anchorOffset},d={node:e.focusNode,offset:e.focusOffset};if((s.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===d.node&&s.offset>d.offset)&&([s,d]=[d,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const g=this._rowElements.slice(-1)[0];if(d.node.compareDocumentPosition(g)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(d={node:g,offset:((x=g.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(d.node))return;const S=({node:M,offset:O})=>{const P=M instanceof Text?M.parentNode:M;let T=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(T))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 I=O<H.length?H[O]:H.slice(-1)[0]+1;return I>=this._terminal.cols&&(++T,I=0),{row:T,column:I}},C=S(s),v=S(d);if(C&&v){if(C.row>v.row||C.row===v.row&&C.column>=v.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(v.row-C.row)*this._terminal.cols-C.column+v.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=i=c([f(1,h.IInstantiationService),f(2,m.ICoreBrowserService),f(3,m.IRenderService)],i)},3614:(E,n)=>{function a(u){return u.replace(/\r?\n/g,"\r")}function c(u,p){return p?"\x1B[200~"+u+"\x1B[201~":u}function f(u,p,m,h){u=c(u=a(u),m.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),m.triggerDataEvent(u,!0),p.value=""}function l(u,p,m){const h=m.getBoundingClientRect(),t=u.clientX-h.left-10,i=u.clientY-h.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${t}px`,p.style.top=`${i}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=c,n.copyHandler=function(u,p){u.clipboardData&&u.clipboardData.setData("text/plain",p.selectionText),u.preventDefault()},n.handlePasteEvent=function(u,p,m,h){u.stopPropagation(),u.clipboardData&&f(u.clipboardData.getData("text/plain"),p,m,h)},n.paste=f,n.moveTextAreaUnderMouseCursor=l,n.rightClickHandler=function(u,p,m,h,t){l(u,p,m),t&&h.rightClickSelect(u),p.value=h.selectionText,p.select()}},7239:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const c=a(1505);n.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(f,l,u){this._css.set(f,l,u)}getCss(f,l){return this._css.get(f,l)}setColor(f,l,u){this._color.set(f,l,u)}getColor(f,l){return this._color.get(f,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,c,f,l){a.addEventListener(c,f,l);let u=!1;return{dispose:()=>{u||(u=!0,a.removeEventListener(c,f,l))}}}},3551:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var g,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(g=i[v])&&(C=(S<3?g(C):S>3?g(e,s,C):g(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const l=a(3656),u=a(8460),p=a(844),m=a(2585),h=a(4725);let t=n.Linkifier=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(i,e,s,d,g){super(),this._element=i,this._mouseService=e,this._renderService=s,this._bufferService=d,this._linkProviderService=g,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new u.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new u.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const s=i.composedPath();for(let d=0;d<s.length;d++){const g=s[d];if(g.classList.contains("xterm"))break;if(g.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){var d,g;this._activeProviderReplies&&e||((d=this._activeProviderReplies)==null||d.forEach((S=>{S==null||S.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=i.y);let s=!1;for(const[S,C]of this._linkProviderService.linkProviders.entries())e?(g=this._activeProviderReplies)!=null&&g.get(S)&&(s=this._checkLinkProviderResult(S,i,s)):C.provideLinks(i.y,(v=>{var M,O;if(this._isMouseOut)return;const x=v==null?void 0:v.map((P=>({link:P})));(M=this._activeProviderReplies)==null||M.set(S,x),s=this._checkLinkProviderResult(S,i,s),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)}))}_removeIntersectingLinks(i,e){const s=new Set;for(let d=0;d<e.size;d++){const g=e.get(d);if(g)for(let S=0;S<g.length;S++){const C=g[S],v=C.link.range.start.y<i?0:C.link.range.start.x,x=C.link.range.end.y>i?this._bufferService.cols:C.link.range.end.x;for(let M=v;M<=x;M++){if(s.has(M)){g.splice(S--,1);break}s.add(M)}}}}_checkLinkProviderResult(i,e,s){var S;if(!this._activeProviderReplies)return s;const d=this._activeProviderReplies.get(i);let g=!1;for(let C=0;C<i;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(g=!0);if(!g&&d){const C=d.find((v=>this._linkAtPosition(v.link,e)));C&&(s=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let C=0;C<this._activeProviderReplies.size;C++){const v=(S=this._activeProviderReplies.get(C))==null?void 0:S.find((x=>this._linkAtPosition(x.link,e)));if(v){s=!0,this._handleNewLink(v);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.pointerCursor},set:s=>{var d;(d=this._currentLink)!=null&&d.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.underline},set:s=>{var d,g,S;(d=this._currentLink)!=null&&d.state&&((S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((s=>{if(!this._currentLink)return;const d=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,g=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=g&&(this._clearCurrentLink(d,g),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(i,e,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(s,e.text)}_fireUnderlineEvent(i,e){const s=i.range,d=this._bufferService.buffer.ydisp,g=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-d-1,s.end.x,s.end.y-d-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(g)}_linkLeave(i,e,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(s,e.text)}_linkAtPosition(i,e){const s=i.range.start.y*this._bufferService.cols+i.range.start.x,d=i.range.end.y*this._bufferService.cols+i.range.end.x,g=e.y*this._bufferService.cols+e.x;return s<=g&&g<=d}_positionFromMouseEvent(i,e,s){const d=s.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,s,d,g){return{x1:i,y1:e,x2:s,y2:d,cols:this._bufferService.cols,fg:g}}};n.Linkifier=t=c([f(1,h.IMouseService),f(2,h.IRenderService),f(3,m.IBufferService),f(4,h.ILinkProviderService)],t)},9042:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(E,n,a){var c=this&&this.__decorate||function(h,t,i,e){var s,d=arguments.length,g=d<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,t,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(g=(d<3?s(g):d>3?s(t,i,g):s(t,i))||g);return d>3&&g&&Object.defineProperty(t,i,g),g},f=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const l=a(511),u=a(2585);let p=n.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){var x;const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],s=this._optionsService.rawOptions.linkHandler,d=new l.CellData,g=i.getTrimmedLength();let S=-1,C=-1,v=!1;for(let M=0;M<g;M++)if(C!==-1||i.hasContent(M)){if(i.loadCell(M,d),d.hasExtendedAttrs()&&d.extended.urlId){if(C===-1){C=M,S=d.extended.urlId;continue}v=d.extended.urlId!==S}else C!==-1&&(v=!0);if(v||C!==-1&&M===g-1){const O=(x=this._oscLinkService.getLinkData(S))==null?void 0:x.uri;if(O){const P={start:{x:C+1,y:h},end:{x:M+(v||M!==g-1?0:1),y:h}};let T=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const H=new URL(O);["http:","https:"].includes(H.protocol)||(T=!0)}catch{T=!0}T||e.push({text:O,range:P,activate:(H,I)=>s?s.activate(H,I,P):m(0,I),hover:(H,I)=>{var N;return(N=s==null?void 0:s.hover)==null?void 0:N.call(s,H,I,P)},leave:(H,I)=>{var N;return(N=s==null?void 0:s.leave)==null?void 0:N.call(s,H,I,P)}})}v=!1,d.hasExtendedAttrs()&&d.extended.urlId?(C=M,S=d.extended.urlId):(C=-1,S=-1)}}t(e)}};function m(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
5
|
+
|
|
6
|
+
WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=p=c([f(0,u.IBufferService),f(1,u.IOptionsService),f(2,u.IOscLinkService)],p)},6193:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,f){this._rowCount=f,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const c=a(3614),f=a(3656),l=a(3551),u=a(9042),p=a(3730),m=a(1680),h=a(3107),t=a(5744),i=a(2950),e=a(1296),s=a(428),d=a(4269),g=a(5114),S=a(8934),C=a(3230),v=a(9312),x=a(4725),M=a(6731),O=a(8055),P=a(8969),T=a(8460),H=a(844),I=a(6114),N=a(8437),j=a(2584),$=a(7399),y=a(5941),R=a(9074),A=a(2585),B=a(5435),U=a(4567),K=a(779);class Q 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(F={}){super(F),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((D,Y)=>this.refresh(D,Y)))),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,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.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,Y;this._customKeyEventHandler=void 0,(Y=(D=this.element)==null?void 0:D.parentNode)==null||Y.removeChild(this.element)})))}_handleColorEvent(F){if(this._themeService)for(const D of F){let Y,z="";switch(D.index){case 256:Y="foreground",z="10";break;case 257:Y="background",z="11";break;case 258:Y="cursor",z="12";break;default:Y="ansi",z="4;"+D.index}switch(D.type){case 0:const re=O.color.toColorRGB(Y==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[Y]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${z};${(0,y.toRgbString)(re)}${j.C1_ESCAPED.ST}`);break;case 1:if(Y==="ansi")this._themeService.modifyColors((Z=>Z.ansi[D.index]=O.channels.toColor(...D.color)));else{const Z=Y;this._themeService.modifyColors((le=>le[Z]=O.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(F){F?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(F){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var F;return(F=this.textarea)==null?void 0:F.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 F=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(F);if(!D)return;const Y=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,re=D.getWidth(Y),Z=this._renderService.dimensions.css.cell.width*re,le=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=Y*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=le+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(D=>{this.hasSelection()&&(0,c.copyHandler)(D,this._selectionService)})));const F=D=>(0,c.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",F)),this.register((0,f.addDisposableDomListener)(this.element,"paste",F)),I.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(D=>{D.button===2&&(0,c.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(D=>{(0,c.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),I.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(D=>{D.button===1&&(0,c.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(F=>this._keyUp(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(F=>this._keyDown(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(F=>this._keyPress(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(F=>this._compositionHelper.compositionupdate(F)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(F=>this._inputEvent(F)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(F){var Y;if(!F)throw new Error("Terminal requires a parent element.");if(F.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((Y=this.element)==null?void 0:Y.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=F.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"),F.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",(z=>this.updateCursorStyle(z)))),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",u.promptLabel),I.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(g.CoreBrowserService,this.textarea,F.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",(z=>this._handleTextAreaFocus(z)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(M.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(d.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((z=>this._onRender.fire(z)))),this.onResize((z=>this._renderService.resize(z.cols,z.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.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((z=>this.scrollLines(z.amount,z.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((z=>this.scrollLines(z.amount,z.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((z=>this._renderService.handleSelectionChanged(z.start,z.end,z.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((z=>{this.textarea.value=z,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(z=>this._selectionService.handleMouseDown(z)))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(z=>this._handleScreenReaderModeOptionChange(z)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const F=this,D=this.element;function Y(Z){const le=F._mouseService.getMouseReportCoords(Z,F.screenElement);if(!le)return!1;let _e,Se;switch(Z.overrideType||Z.type){case"mousemove":Se=32,Z.buttons===void 0?(_e=3,Z.button!==void 0&&(_e=Z.button<3?Z.button:3)):_e=1&Z.buttons?0:4&Z.buttons?1:2&Z.buttons?2:3;break;case"mouseup":Se=0,_e=Z.button<3?Z.button:3;break;case"mousedown":Se=1,_e=Z.button<3?Z.button:3;break;case"wheel":if(F._customWheelEventHandler&&F._customWheelEventHandler(Z)===!1||F.viewport.getLinesScrolled(Z)===0)return!1;Se=Z.deltaY<0?0:1,_e=4;break;default:return!1}return!(Se===void 0||_e===void 0||_e>4)&&F.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:Se,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:Z=>(Y(Z),Z.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(Z)),wheel:Z=>(Y(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&Y(Z)},mousemove:Z=>{Z.buttons||Y(Z)}};this.register(this.coreMouseService.onProtocolChange((Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),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&Z?z.mousemove||(D.addEventListener("mousemove",re.mousemove),z.mousemove=re.mousemove):(D.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&Z?z.wheel||(D.addEventListener("wheel",re.wheel,{passive:!1}),z.wheel=re.wheel):(D.removeEventListener("wheel",z.wheel),z.wheel=null),2&Z?z.mouseup||(z.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&Z?z.mousedrag||(z.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(D,"mousedown",(Z=>{if(Z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Z))return Y(Z),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(Z)}))),this.register((0,f.addDisposableDomListener)(D,"wheel",(Z=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(Z);if(le===0)return;const _e=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");let Se="";for(let Ae=0;Ae<Math.abs(le);Ae++)Se+=_e;return this.coreService.triggerDataEvent(Se,!0),this.cancel(Z,!0)}return this.viewport.handleWheel(Z)?this.cancel(Z):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(D,"touchstart",(Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Z),this.cancel(Z)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(D,"touchmove",(Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Z)?void 0:this.cancel(Z)}),{passive:!1}))}refresh(F,D){var Y;(Y=this._renderService)==null||Y.refreshRows(F,D)}updateCursorStyle(F){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(F)?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(F,D,Y=0){var z;Y===1?(super.scrollLines(F,D,Y),this.refresh(0,this.rows-1)):(z=this.viewport)==null||z.scrollLines(F)}paste(F){(0,c.paste)(F,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(F){this._customKeyEventHandler=F}attachCustomWheelEventHandler(F){this._customWheelEventHandler=F}registerLinkProvider(F){return this._linkProviderService.registerLinkProvider(F)}registerCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(F);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(F)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(F){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+F)}registerDecoration(F){return this._decorationService.registerDecoration(F)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(F,D,Y){this._selectionService.setSelection(F,D,Y)}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 F;(F=this._selectionService)==null||F.clearSelection()}selectAll(){var F;(F=this._selectionService)==null||F.selectAll()}selectLines(F,D){var Y;(Y=this._selectionService)==null||Y.selectLines(F,D)}_keyDown(F){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&F.altKey;if(!D&&!this._compositionHelper.keydown(F))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||F.key!=="Dead"&&F.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Y=(0,$.evaluateKeyboardEvent)(F,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(F),Y.type===3||Y.type===2){const z=this.rows-1;return this.scrollLines(Y.type===2?-z:z),this.cancel(F,!0)}return Y.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,F)||(Y.cancel&&this.cancel(F,!0),!Y.key||!!(F.key&&!F.ctrlKey&&!F.altKey&&!F.metaKey&&F.key.length===1&&F.key.charCodeAt(0)>=65&&F.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Y.key!==j.C0.ETX&&Y.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Y.key,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(Y.key,!0),!this.optionsService.rawOptions.screenReaderMode||F.altKey||F.ctrlKey?this.cancel(F,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(F,D){const Y=F.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||F.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||F.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?Y:Y&&(!D.keyCode||D.keyCode>47)}_keyUp(F){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1||((function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18})(F)||this.focus(),this.updateCursorStyle(F),this._keyPressHandled=!1)}_keyPress(F){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;if(this.cancel(F),F.charCode)D=F.charCode;else if(F.which===null||F.which===void 0)D=F.keyCode;else{if(F.which===0||F.charCode===0)return!1;D=F.which}return!(!D||(F.altKey||F.ctrlKey||F.metaKey)&&!this._isThirdLevelShift(this.browser,F)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(F){if(F.data&&F.inputType==="insertText"&&(!F.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=F.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(F),!0}return!1}resize(F,D){F!==this.cols||D!==this.rows?super.resize(F,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(F,D){var Y,z;(Y=this._charSizeService)==null||Y.measure(),(z=this.viewport)==null||z.syncScrollArea(!0)}clear(){var F;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(N.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(F=this.viewport)==null||F.reset(),this.refresh(0,this.rows-1)}}reset(){var D,Y;this.options.rows=this.rows,this.options.cols=this.cols;const F=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(Y=this.viewport)==null||Y.reset(),this._customKeyEventHandler=F,this.refresh(0,this.rows-1)}clearTextureAtlas(){var F;(F=this._renderService)==null||F.clearTextureAtlas()}_reportFocus(){var F;(F=this.element)!=null&&F.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(F){if(this._renderService)switch(F){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),Y=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${Y};${D}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${re};${z}t`)}}cancel(F,D){if(this.options.cancelEvents||D)return F.preventDefault(),F.stopPropagation(),!1}}n.Terminal=Q},9924:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,f){this._rowCount=f,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const u=l-this._lastRefreshMs,p=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var g,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(g=i[v])&&(C=(S<3?g(C):S>3?g(e,s,C):g(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const l=a(3656),u=a(4725),p=a(8460),m=a(844),h=a(2585);let t=n.Viewport=class extends m.Disposable{constructor(i,e,s,d,g,S,C,v){super(),this._viewportElement=i,this._scrollArea=e,this._bufferService=s,this._optionsService=d,this._charSizeService=g,this._renderService=S,this._coreBrowserService=C,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 p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.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(v.colors),this.register(v.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.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(i){if(i)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<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(i,e){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&s<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const e=this._getPixelsScrolled(i);return e!==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+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=i*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(i,e){var v;let s,d="";const g=[],S=e??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let x=i;x<S;x++){const M=C.get(x);if(!M)continue;const O=(v=C.get(x+1))==null?void 0:v.isWrapped;if(d+=M.translateToString(!O),!O||x===C.length-1){const P=document.createElement("div");P.textContent=d,g.push(P),d.length>0&&(s=P),d=""}}return{bufferElements:g,cursorElement:s}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(i,e){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&e.altKey||s==="ctrl"&&e.ctrlKey||s==="shift"&&e.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const e=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}};n.Viewport=t=c([f(2,h.IBufferService),f(3,h.IOptionsService),f(4,u.ICharSizeService),f(5,u.IRenderService),f(6,u.ICoreBrowserService),f(7,u.IThemeService)],t)},3107:function(E,n,a){var c=this&&this.__decorate||function(h,t,i,e){var s,d=arguments.length,g=d<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,t,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(g=(d<3?s(g):d>3?s(t,i,g):s(t,i))||g);return d>3&&g&&Object.defineProperty(t,i,g),g},f=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const l=a(4725),u=a(844),p=a(2585);let m=n.BufferDecorationRenderer=class extends u.Disposable{constructor(h,t,i,e,s){super(),this._screenElement=h,this._bufferService=t,this._coreBrowserService=i,this._decorationService=e,this._renderService=s,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((d=>this._removeDecoration(d)))),this.register((0,u.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 h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var e;const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((e=h==null?void 0:h.options)==null?void 0:e.layer)==="top"),t.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=h.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(h,t),t}_refreshStyle(h){const t=h.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let i=this._decorationElements.get(h);i||(i=this._createElement(h),h.element=i,this._decorationElements.set(h,i),this._container.appendChild(i),h.onDispose((()=>{this._decorationElements.delete(h),i.remove()}))),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(i)}}_refreshXPosition(h,t=h.element){if(!t)return;const i=h.options.x??0;(h.options.anchor||"left")==="right"?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var t;(t=this._decorationElements.get(h))==null||t.remove(),this._decorationElements.delete(h),h.dispose()}};n.BufferDecorationRenderer=m=c([f(1,p.IBufferService),f(2,l.ICoreBrowserService),f(3,p.IDecorationService),f(4,l.IRenderService)],m)},5871:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,f){return c>=a.startBufferLine-this._linePadding[f||"full"]&&c<=a.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(E,n,a){var c=this&&this.__decorate||function(s,d,g,S){var C,v=arguments.length,x=v<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(s,d,g,S);else for(var M=s.length-1;M>=0;M--)(C=s[M])&&(x=(v<3?C(x):v>3?C(d,g,x):C(d,g))||x);return v>3&&x&&Object.defineProperty(d,g,x),x},f=this&&this.__param||function(s,d){return function(g,S){d(g,S,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const l=a(5871),u=a(4725),p=a(844),m=a(2585),h={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let e=n.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,d,g,S,C,v,x){var O;super(),this._viewportElement=s,this._screenElement=d,this._bufferService=g,this._decorationService=S,this._renderService=C,this._optionsService=v,this._coreBrowserService=x,this._colorZoneStore=new l.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(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const M=this._canvas.getContext("2d");if(!M)throw new Error("Ctx cannot be null");this._ctx=M,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,p.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 s=Math.floor(this._canvas.width/3),d=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=s,t.center=d,t.right=s,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=t.left,i.right=t.left+t.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,d=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);h.left=d,h.center=d,h.right=d}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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 d of this._decorationService.decorations)this._colorZoneStore.addDecoration(d);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const d of s)d.position!=="full"&&this._renderColorZone(d);for(const d of s)d.position==="full"&&this._renderColorZone(d);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(i[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-h[s.position||"full"]/2),t[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[s.position||"full"]))}_queueRefresh(s,d){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=d||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=e=c([f(2,m.IBufferService),f(3,m.IDecorationService),f(4,u.IRenderService),f(5,m.IOptionsService),f(6,u.ICoreBrowserService)],e)},2950:function(E,n,a){var c=this&&this.__decorate||function(h,t,i,e){var s,d=arguments.length,g=d<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,t,i,e);else for(var S=h.length-1;S>=0;S--)(s=h[S])&&(g=(d<3?s(g):d>3?s(t,i,g):s(t,i))||g);return d>3&&g&&Object.defineProperty(t,i,g),g},f=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const l=a(4725),u=a(2585),p=a(2584);let m=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,t,i,e,s,d){this._textarea=h,this._compositionView=t,this._bufferService=i,this._optionsService=e,this._coreService=s,this._renderService=d,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(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}}),0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(h,"");this._dataAlreadySent=i,t.length>h.length?this._coreService.triggerDataEvent(i,!0):t.length<h.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):t.length===h.length&&t!==h&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(h){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const d=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(d.width,1)+"px",this._textarea.style.height=Math.max(d.height,1)+"px",this._textarea.style.lineHeight=d.height+"px"}h||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=m=c([f(2,u.IBufferService),f(3,u.IOptionsService),f(4,u.ICoreService),f(5,l.IRenderService)],m)},9806:(E,n)=>{function a(c,f,l){const u=l.getBoundingClientRect(),p=c.getComputedStyle(l),m=parseInt(p.getPropertyValue("padding-left")),h=parseInt(p.getPropertyValue("padding-top"));return[f.clientX-u.left-m,f.clientY-u.top-h]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(c,f,l,u,p,m,h,t,i){if(!m)return;const e=a(c,f,l);return e?(e[0]=Math.ceil((e[0]+(i?h/2:0))/h),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),u+(i?1:0)),e[1]=Math.min(Math.max(e[1],1),p),e):void 0}},9504:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const c=a(2584);function f(t,i,e,s){const d=t-l(t,e),g=i-l(i,e),S=Math.abs(d-g)-(function(C,v,x){let M=0;const O=C-l(C,x),P=v-l(v,x);for(let T=0;T<Math.abs(O-P);T++){const H=u(C,v)==="A"?-1:1,I=x.buffer.lines.get(O+H*T);I!=null&&I.isWrapped&&M++}return M})(t,i,e);return h(S,m(u(t,i),s))}function l(t,i){let e=0,s=i.buffer.lines.get(t),d=s==null?void 0:s.isWrapped;for(;d&&t>=0&&t<i.rows;)e++,s=i.buffer.lines.get(--t),d=s==null?void 0:s.isWrapped;return e}function u(t,i){return t>i?"A":"B"}function p(t,i,e,s,d,g){let S=t,C=i,v="";for(;S!==e||C!==s;)S+=d?1:-1,d&&S>g.cols-1?(v+=g.buffer.translateBufferLineToString(C,!1,t,S),S=0,t=0,C++):!d&&S<0&&(v+=g.buffer.translateBufferLineToString(C,!1,0,t+1),S=g.cols-1,t=S,C--);return v+g.buffer.translateBufferLineToString(C,!1,t,S)}function m(t,i){const e=i?"O":"[";return c.C0.ESC+e+t}function h(t,i){t=Math.floor(t);let e="";for(let s=0;s<t;s++)e+=i;return e}n.moveToCellSequence=function(t,i,e,s){const d=e.buffer.x,g=e.buffer.y;if(!e.buffer.hasScrollback)return(function(v,x,M,O,P,T){return f(x,O,P,T).length===0?"":h(p(v,x,v,x-l(x,P),!1,P).length,m("D",T))})(d,g,0,i,e,s)+f(g,i,e,s)+(function(v,x,M,O,P,T){let H;H=f(x,O,P,T).length>0?O-l(O,P):x;const I=O,N=(function(j,$,y,R,A,B){let U;return U=f(y,R,A,B).length>0?R-l(R,A):$,j<y&&U<=R||j>=y&&U<R?"C":"D"})(v,x,M,O,P,T);return h(p(v,H,M,I,N==="C",P).length,m(N,T))})(d,g,t,i,e,s);let S;if(g===i)return S=d>t?"D":"C",h(Math.abs(d-t),m(S,s));S=g>i?"D":"C";const C=Math.abs(g-i);return h((function(v,x){return x.cols-v})(g>i?t:d,e)+(C-1)*e.cols+1+((g>i?d:t)-1),m(S,s))}},1296:function(E,n,a){var c=this&&this.__decorate||function(T,H,I,N){var j,$=arguments.length,y=$<3?H:N===null?N=Object.getOwnPropertyDescriptor(H,I):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(T,H,I,N);else for(var R=T.length-1;R>=0;R--)(j=T[R])&&(y=($<3?j(y):$>3?j(H,I,y):j(H,I))||y);return $>3&&y&&Object.defineProperty(H,I,y),y},f=this&&this.__param||function(T,H){return function(I,N){H(I,N,T)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const l=a(3787),u=a(2550),p=a(2223),m=a(6171),h=a(6052),t=a(4725),i=a(8055),e=a(8460),s=a(844),d=a(2585),g="xterm-dom-renderer-owner-",S="xterm-rows",C="xterm-fg-",v="xterm-bg-",x="xterm-focus",M="xterm-selection";let O=1,P=n.DomRenderer=class extends s.Disposable{constructor(T,H,I,N,j,$,y,R,A,B,U,K,Q){super(),this._terminal=T,this._document=H,this._element=I,this._screenElement=N,this._viewportElement=j,this._helperContainer=$,this._linkifier2=y,this._charSizeService=A,this._optionsService=B,this._bufferService=U,this._coreBrowserService=K,this._themeService=Q,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),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(M),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((te=>this._injectCss(te)))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(g+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((te=>this._handleLinkHover(te)))),this.register(this._linkifier2.onHideLinkUnderline((te=>this._handleLinkLeave(te)))),this.register((0,s.toDisposable)((()=>{this._element.classList.remove(g+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new u.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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${S} 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(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${S} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${S} .xterm-dim { color: ${i.color.multiplyOpacity(T.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 I=`blink_underline_${this._terminalClass}`,N=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;H+=`@keyframes ${I} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${N} { 50% { box-shadow: none; }}`,H+=`@keyframes ${j} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,H+=`${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${S}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${M} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${M} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${M} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[$,y]of T.ansi.entries())H+=`${this._terminalSelector} .${C}${$} { color: ${y.css}; }${this._terminalSelector} .${C}${$}.xterm-dim { color: ${i.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${v}${$} { background-color: ${y.css}; }`;H+=`${this._terminalSelector} .${C}${p.INVERTED_DEFAULT_COLOR} { color: ${i.color.opaque(T.background).css}; }${this._terminalSelector} .${C}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${i.color.multiplyOpacity(i.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${v}${p.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,H){for(let I=this._rowElements.length;I<=H;I++){const N=this._document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,H){this._refreshRowElements(T,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(T,H,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,H,I),this.renderRows(0,this._bufferService.rows-1),!T||!H)return;this._selectionRenderModel.update(this._terminal,T,H,I);const N=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,$=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if($>=this._bufferService.rows||y<0)return;const R=this._document.createDocumentFragment();if(I){const A=T[0]>H[0];R.appendChild(this._createSelectionElement($,A?H[0]:T[0],A?T[0]:H[0],y-$+1))}else{const A=N===$?T[0]:0,B=$===j?H[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement($,A,B));const U=y-$-1;if(R.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,U)),$!==y){const K=j===y?H[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(y,0,K))}}this._selectionContainer.appendChild(R)}_createSelectionElement(T,H,I,N=1){const j=this._document.createElement("div"),$=H*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(I-H);return $+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-$),j.style.height=N*this.dimensions.css.cell.height+"px",j.style.top=T*this.dimensions.css.cell.height+"px",j.style.left=`${$}px`,j.style.width=`${y}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 T of this._rowElements)T.replaceChildren()}renderRows(T,H){const I=this._bufferService.buffer,N=I.ybase+I.y,j=Math.min(I.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=T;A<=H;A++){const B=A+I.ydisp,U=this._rowElements[A],K=I.lines.get(B);if(!U||!K)break;U.replaceChildren(...this._rowFactory.createRow(K,B,B===N,y,R,j,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${g}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,H,I,N,j,$){I<0&&(T=0),N<0&&(H=0);const y=this._bufferService.rows-1;I=Math.max(Math.min(I,y),0),N=Math.max(Math.min(N,y),0),j=Math.min(j,this._bufferService.cols);const R=this._bufferService.buffer,A=R.ybase+R.y,B=Math.min(R.x,j-1),U=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,Q=this._optionsService.rawOptions.cursorInactiveStyle;for(let te=I;te<=N;++te){const F=te+R.ydisp,D=this._rowElements[te],Y=R.lines.get(F);if(!D||!Y)break;D.replaceChildren(...this._rowFactory.createRow(Y,F,F===A,K,Q,B,U,this.dimensions.css.cell.width,this._widthCache,$?te===I?T:0:-1,$?(te===N?H:j)-1:-1))}}};n.DomRenderer=P=c([f(7,d.IInstantiationService),f(8,t.ICharSizeService),f(9,d.IOptionsService),f(10,d.IBufferService),f(11,t.ICoreBrowserService),f(12,t.IThemeService)],P)},3787:function(E,n,a){var c=this&&this.__decorate||function(S,C,v,x){var M,O=arguments.length,P=O<3?C:x===null?x=Object.getOwnPropertyDescriptor(C,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(S,C,v,x);else for(var T=S.length-1;T>=0;T--)(M=S[T])&&(P=(O<3?M(P):O>3?M(C,v,P):M(C,v))||P);return O>3&&P&&Object.defineProperty(C,v,P),P},f=this&&this.__param||function(S,C){return function(v,x){C(v,x,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const l=a(2223),u=a(643),p=a(511),m=a(2585),h=a(8055),t=a(4725),i=a(4269),e=a(6171),s=a(3734);let d=n.DomRendererRowFactory=class{constructor(S,C,v,x,M,O,P){this._document=S,this._characterJoinerService=C,this._optionsService=v,this._coreBrowserService=x,this._coreService=M,this._decorationService=O,this._themeService=P,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,C,v){this._selectionStart=S,this._selectionEnd=C,this._columnSelectMode=v}createRow(S,C,v,x,M,O,P,T,H,I,N){const j=[],$=this._characterJoinerService.getJoinedCharacters(C),y=this._themeService.colors;let R,A=S.getNoBgTrimmedLength();v&&A<O+1&&(A=O+1);let B=0,U="",K=0,Q=0,te=0,F=!1,D=0,Y=!1,z=0;const re=[],Z=I!==-1&&N!==-1;for(let le=0;le<A;le++){S.loadCell(le,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let Se=!1,Ae=le,ce=this._workCell;if($.length>0&&le===$[0][0]){Se=!0;const be=$.shift();ce=new i.JoinedCellData(this._workCell,S.translateToString(!0,be[0],be[1]),be[1]-be[0]),Ae=be[1]-1,_e=ce.getWidth()}const Rt=this._isCellInSelection(le,C),At=v&&le===O,Tt=Z&&le>=I&&le<=N;let bt=!1;this._decorationService.forEachDecorationAtCell(le,C,void 0,(be=>{bt=!0}));let Bt=ce.getChars()||u.WHITESPACE_CELL_CHAR;if(Bt===" "&&(ce.isUnderline()||ce.isOverline())&&(Bt=" "),z=_e*T-H.get(Bt,ce.isBold(),ce.isItalic()),R){if(B&&(Rt&&Y||!Rt&&!Y&&ce.bg===K)&&(Rt&&Y&&y.selectionForeground||ce.fg===Q)&&ce.extended.ext===te&&Tt===F&&z===D&&!At&&!Se&&!bt){ce.isInvisible()?U+=u.WHITESPACE_CELL_CHAR:U+=Bt,B++;continue}B&&(R.textContent=U),R=this._document.createElement("span"),B=0,U=""}else R=this._document.createElement("span");if(K=ce.bg,Q=ce.fg,te=ce.extended.ext,F=Tt,D=z,Y=Rt,Se&&O>=le&&O<=Ae&&(O=le),!this._coreService.isCursorHidden&&At&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&re.push("xterm-cursor-blink"),re.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(M)switch(M){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(ce.isBold()&&re.push("xterm-bold"),ce.isItalic()&&re.push("xterm-italic"),ce.isDim()&&re.push("xterm-dim"),U=ce.isInvisible()?u.WHITESPACE_CELL_CHAR:ce.getChars()||u.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(re.push(`xterm-underline-${ce.extended.underlineStyle}`),U===" "&&(U=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let be=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&be<8&&(be+=8),R.style.textDecorationColor=y.ansi[be].css}ce.isOverline()&&(re.push("xterm-overline"),U===" "&&(U=" ")),ce.isStrikethrough()&&re.push("xterm-strikethrough"),Tt&&(R.style.textDecoration="underline");let $e=ce.getFgColor(),ir=ce.getFgColorMode(),rt=ce.getBgColor(),jt=ce.getBgColorMode();const jr=!!ce.isInverse();if(jr){const be=$e;$e=rt,rt=be;const ki=ir;ir=jt,jt=ki}let ct,br,ht,sr=!1;switch(this._decorationService.forEachDecorationAtCell(le,C,void 0,(be=>{be.options.layer!=="top"&&sr||(be.backgroundColorRGB&&(jt=50331648,rt=be.backgroundColorRGB.rgba>>8&16777215,ct=be.backgroundColorRGB),be.foregroundColorRGB&&(ir=50331648,$e=be.foregroundColorRGB.rgba>>8&16777215,br=be.foregroundColorRGB),sr=be.options.layer==="top")})),!sr&&Rt&&(ct=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,rt=ct.rgba>>8&16777215,jt=50331648,sr=!0,y.selectionForeground&&(ir=50331648,$e=y.selectionForeground.rgba>>8&16777215,br=y.selectionForeground)),sr&&re.push("xterm-decoration-top"),jt){case 16777216:case 33554432:ht=y.ansi[rt],re.push(`xterm-bg-${rt}`);break;case 50331648:ht=h.channels.toColor(rt>>16,rt>>8&255,255&rt),this._addStyle(R,`background-color:#${g((rt>>>0).toString(16),"0",6)}`);break;default:jr?(ht=y.foreground,re.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):ht=y.background}switch(ct||ce.isDim()&&(ct=h.color.multiplyOpacity(ht,.5)),ir){case 16777216:case 33554432:ce.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(R,ht,y.ansi[$e],ce,ct,void 0)||re.push(`xterm-fg-${$e}`);break;case 50331648:const be=h.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(R,ht,be,ce,ct,br)||this._addStyle(R,`color:#${g($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ht,y.foreground,ce,ct,br)||jr&&re.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}re.length&&(R.className=re.join(" "),re.length=0),At||Se||bt?R.textContent=U:B++,z!==this.defaultSpacing&&(R.style.letterSpacing=`${z}px`),j.push(R),le=Ae}return R&&B&&(R.textContent=U),j}_applyMinimumContrast(S,C,v,x,M,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const P=this._getContrastCache(x);let T;if(M||O||(T=P.getColor(C.rgba,v.rgba)),T===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);T=h.color.ensureContrastRatio(M||C,O||v,H),P.setColor((M||C).rgba,(O||v).rgba,T??null)}return!!T&&(this._addStyle(S,`color:${T.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,C){S.setAttribute("style",`${S.getAttribute("style")||""}${C};`)}_isCellInSelection(S,C){const v=this._selectionStart,x=this._selectionEnd;return!(!v||!x)&&(this._columnSelectMode?v[0]<=x[0]?S>=v[0]&&C>=v[1]&&S<x[0]&&C<=x[1]:S<v[0]&&C>=v[1]&&S>=x[0]&&C<=x[1]:C>v[1]&&C<x[1]||v[1]===x[1]&&C===v[1]&&S>=v[0]&&S<x[0]||v[1]<x[1]&&C===x[1]&&S<x[0]||v[1]<x[1]&&C===v[1]&&S>=v[0])}};function g(S,C,v){for(;S.length<v;)S=C+S;return S}n.DomRendererRowFactory=d=c([f(1,t.ICharacterJoinerService),f(2,m.IOptionsService),f(3,t.ICoreBrowserService),f(4,m.ICoreService),f(5,m.IDecorationService),f(6,t.IThemeService)],d)},2550:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.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=a.createElement("span");f.classList.add("xterm-char-measure-element");const l=a.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const u=a.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontStyle="italic";const p=a.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[f,l,u,p],this._container.appendChild(f),this._container.appendChild(l),this._container.appendChild(u),this._container.appendChild(p),c.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(a,c,f,l){a===this._font&&c===this._fontSize&&f===this._weight&&l===this._weightBold||(this._font=a,this._fontSize=c,this._weight=f,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(a,c,f){let l=0;if(!c&&!f&&a.length===1&&(l=a.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const m=this._measure(a,0);return m>0&&(this._flat[l]=m),m}let u=a;c&&(u+="B"),f&&(u+="I");let p=this._holey.get(u);if(p===void 0){let m=0;c&&(m|=1),f&&(m|=2),p=this._measure(a,m),p>0&&this._holey.set(u,p)}return p}_measure(a,c){const f=this._measureElements[c];return f.textContent=a.repeat(32),f.offsetWidth/32}}},2223:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(E,n)=>{function a(f){return 57508<=f&&f<=57558}function c(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(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},n.isEmoji=c,n.allowRescaling=function(f,l,u,p){return l===1&&u>Math.ceil(1.5*p)&&f!==void 0&&f>255&&!c(f)&&!a(f)&&!(function(m){return 57344<=m&&m<=63743})(f)},n.treatGlyphAsBackgroundColor=function(f){return a(f)||(function(l){return 9472<=l&&l<=9631})(f)},n.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}}}},n.computeNextVariantOffset=function(f,l,u=0){return(f-(2*Math.round(l)-u))%(2*Math.round(l))}},6052:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class a{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,l,u,p=!1){if(this.selectionStart=l,this.selectionEnd=u,!l||!u||l[0]===u[0]&&l[1]===u[1])return void this.clear();const m=f.buffers.active.ydisp,h=l[1]-m,t=u[1]-m,i=Math.max(h,0),e=Math.min(t,f.rows-1);i>=f.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=h,this.viewportEndRow=t,this.viewportCappedStartRow=i,this.viewportCappedEndRow=e,this.startCol=l[0],this.endCol=u[0])}isCellSelected(f,l,u){return!!this.hasSelection&&(u-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&u>=this.viewportCappedStartRow&&l<this.endCol&&u<=this.viewportCappedEndRow:l<this.startCol&&u>=this.viewportCappedStartRow&&l>=this.endCol&&u<=this.viewportCappedEndRow:u>this.viewportStartRow&&u<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&u===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&u===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&u===this.viewportStartRow&&l>=this.startCol)}}n.createSelectionRenderModel=function(){return new a}},456:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,g){var S,C=arguments.length,v=C<3?s:g===null?g=Object.getOwnPropertyDescriptor(s,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,g);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,g){s(d,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const l=a(2585),u=a(8460),p=a(844);let m=n.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new u.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new i(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};n.CharSizeService=m=c([f(2,l.IOptionsService)],m);class h extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,d){s!==void 0&&s>0&&d!==void 0&&d>0&&(this._result.width=s,this._result.height=d)}}class t extends h{constructor(s,d,g){super(),this._document=s,this._parentElement=d,this._optionsService=g,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 i extends h{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const d=this._ctx.measureText("W");if(!("width"in d&&"fontBoundingBoxAscent"in d&&"fontBoundingBoxDescent"in d))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(E,n,a){var c=this&&this.__decorate||function(i,e,s,d){var g,S=arguments.length,C=S<3?e:d===null?d=Object.getOwnPropertyDescriptor(e,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,e,s,d);else for(var v=i.length-1;v>=0;v--)(g=i[v])&&(C=(S<3?g(C):S>3?g(e,s,C):g(e,s))||C);return S>3&&C&&Object.defineProperty(e,s,C),C},f=this&&this.__param||function(i,e){return function(s,d){e(s,d,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const l=a(3734),u=a(643),p=a(511),m=a(2585);class h extends l.AttributeData{constructor(e,s,d){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=s,this._width=d}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=h;let t=n.CharacterJoinerService=class eo{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(e){const s={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(s),s.id}deregister(e){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===e)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(e);if(!s||s.length===0)return[];const d=[],g=s.translateToString(!0);let S=0,C=0,v=0,x=s.getFg(0),M=s.getBg(0);for(let O=0;O<s.getTrimmedLength();O++)if(s.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==M){if(O-S>1){const P=this._getJoinedRanges(g,v,C,s,S);for(let T=0;T<P.length;T++)d.push(P[T])}S=O,v=C,x=this._workCell.fg,M=this._workCell.bg}C+=this._workCell.getChars().length||u.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const O=this._getJoinedRanges(g,v,C,s,S);for(let P=0;P<O.length;P++)d.push(O[P])}return d}_getJoinedRanges(e,s,d,g,S){const C=e.substring(s,d);let v=[];try{v=this._characterJoiners[0].handler(C)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const M=this._characterJoiners[x].handler(C);for(let O=0;O<M.length;O++)eo._mergeRanges(v,M[O])}catch(M){console.error(M)}return this._stringRangesToCellRanges(v,g,S),v}_stringRangesToCellRanges(e,s,d){let g=0,S=!1,C=0,v=e[g];if(v){for(let x=d;x<this._bufferService.cols;x++){const M=s.getWidth(x),O=s.getString(x).length||u.WHITESPACE_CELL_CHAR.length;if(M!==0){if(!S&&v[0]<=C&&(v[0]=x,S=!0),v[1]<=C){if(v[1]=x,v=e[++g],!v)break;v[0]<=C?(v[0]=x,S=!0):S=!1}C+=O}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(e,s){let d=!1;for(let g=0;g<e.length;g++){const S=e[g];if(d){if(s[1]<=S[0])return e[g-1][1]=s[1],e;if(s[1]<=S[1])return e[g-1][1]=Math.max(s[1],S[1]),e.splice(g,1),e;e.splice(g,1),g--}else{if(s[1]<=S[0])return e.splice(g,0,s),e;if(s[1]<=S[1])return S[0]=Math.min(s[0],S[0]),e;s[0]<S[1]&&(S[0]=Math.min(s[0],S[0]),d=!0)}}return d?e[e.length-1][1]=s[1]:e.push(s),e}};n.CharacterJoinerService=t=c([f(0,m.IBufferService)],t)},5114:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const c=a(844),f=a(8460),l=a(3656);class u extends c.Disposable{constructor(h,t,i){super(),this._textarea=h,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new p(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((e=>this._screenDprMonitor.setWindow(e)))),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(h){this._window!==h&&(this._window=h,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}}n.CoreBrowserService=u;class p extends c.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new c.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,c.toDisposable)((()=>this.clearListener())))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var h;this._outerListener&&((h=this._resolutionMediaMatchList)==null||h.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:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const c=a(844);class f extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(u){return this.linkProviders.push(u),{dispose:()=>{const p=this.linkProviders.indexOf(u);p!==-1&&this.linkProviders.splice(p,1)}}}}n.LinkProviderService=f},8934:function(E,n,a){var c=this&&this.__decorate||function(m,h,t,i){var e,s=arguments.length,d=s<3?h:i===null?i=Object.getOwnPropertyDescriptor(h,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(m,h,t,i);else for(var g=m.length-1;g>=0;g--)(e=m[g])&&(d=(s<3?e(d):s>3?e(h,t,d):e(h,t))||d);return s>3&&d&&Object.defineProperty(h,t,d),d},f=this&&this.__param||function(m,h){return function(t,i){h(t,i,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const l=a(4725),u=a(9806);let p=n.MouseService=class{constructor(m,h){this._renderService=m,this._charSizeService=h}getCoords(m,h,t,i,e){return(0,u.getCoords)(window,m,h,t,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(m,h){const t=(0,u.getCoordsRelativeToElement)(window,m,h);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};n.MouseService=p=c([f(0,l.IRenderService),f(1,l.ICharSizeService)],p)},3230:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,g){var S,C=arguments.length,v=C<3?s:g===null?g=Object.getOwnPropertyDescriptor(s,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,g);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,g){s(d,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const l=a(6193),u=a(4725),p=a(8460),m=a(844),h=a(7226),t=a(2585);let i=n.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,s,d,g,S,C,v,x){super(),this._rowCount=e,this._charSizeService=g,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new h.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 p.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new p.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new p.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new p.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((M,O)=>this._renderRows(M,O)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var M;return(M=this._renderer.value)==null?void 0:M.clear()}))),this.register(d.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(d.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(d.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,s),this.register(v.onWindowChange((M=>this._registerIntersectionObserver(M,s))))}_registerIntersectionObserver(e,s){if("IntersectionObserver"in e){const d=new e.IntersectionObserver((g=>this._handleIntersectionChange(g[g.length-1])),{threshold:0});d.observe(s),this._observerDisposable.value=(0,m.toDisposable)((()=>d.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,s,d=!1){this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,s,this._rowCount))}_renderRows(e,s){this._renderer.value&&(e=Math.min(e,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(e,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:s}),this._onRender.fire({start:e,end:s}),this._isNextRenderRedrawOnly=!0)}resize(e,s){this._rowCount=s,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((s=>this.refreshRows(s.start,s.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,s;this._renderer.value&&((s=(e=this._renderer.value).clearTextureAtlas)==null||s.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var d;return(d=this._renderer.value)==null?void 0:d.handleResize(e,s)})):this._renderer.value.handleResize(e,s),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,s,d){var g;this._selectionState.start=e,this._selectionState.end=s,this._selectionState.columnSelectMode=d,(g=this._renderer.value)==null||g.handleSelectionChanged(e,s,d)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};n.RenderService=i=c([f(2,t.IOptionsService),f(3,u.ICharSizeService),f(4,t.IDecorationService),f(5,t.IBufferService),f(6,u.ICoreBrowserService),f(7,u.IThemeService)],i)},9312:function(E,n,a){var c=this&&this.__decorate||function(v,x,M,O){var P,T=arguments.length,H=T<3?x:O===null?O=Object.getOwnPropertyDescriptor(x,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(v,x,M,O);else for(var I=v.length-1;I>=0;I--)(P=v[I])&&(H=(T<3?P(H):T>3?P(x,M,H):P(x,M))||H);return T>3&&H&&Object.defineProperty(x,M,H),H},f=this&&this.__param||function(v,x){return function(M,O){x(M,O,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const l=a(9806),u=a(9504),p=a(456),m=a(4725),h=a(8460),t=a(844),i=a(6114),e=a(4841),s=a(511),d=a(2585),g=" ",S=new RegExp(g,"g");let C=n.SelectionService=class extends t.Disposable{constructor(v,x,M,O,P,T,H,I,N){super(),this._element=v,this._screenElement=x,this._linkifier=M,this._bufferService=O,this._coreService=P,this._mouseService=T,this._optionsService=H,this._renderService=I,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.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 p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.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 v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!v||!x||v[0]===x[0]&&v[1]===x[1])}get selectionText(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!v||!x)return"";const M=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(v[0]===x[0])return"";const P=v[0]<x[0]?v[0]:x[0],T=v[0]<x[0]?x[0]:v[0];for(let H=v[1];H<=x[1];H++){const I=M.translateBufferLineToString(H,!0,P,T);O.push(I)}}else{const P=v[1]===x[1]?x[0]:void 0;O.push(M.translateBufferLineToString(v[1],!0,v[0],P));for(let T=v[1]+1;T<=x[1]-1;T++){const H=M.lines.get(T),I=M.translateBufferLineToString(T,!0);H!=null&&H.isWrapped?O[O.length-1]+=I:O.push(I)}if(v[1]!==x[1]){const T=M.lines.get(x[1]),H=M.translateBufferLineToString(x[1],!0,0,x[0]);T&&T.isWrapped?O[O.length-1]+=H:O.push(H)}}return O.map((P=>P.replace(S," "))).join(i.isWindows?`\r
|
|
7
|
+
`:`
|
|
8
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),i.isLinux&&v&&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(v){const x=this._getMouseBufferCoords(v),M=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(M&&O&&x)&&this._areCoordsInSelection(x,M,O)}isCellInSelection(v,x){const M=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!M||!O)&&this._areCoordsInSelection([v,x],M,O)}_areCoordsInSelection(v,x,M){return v[1]>x[1]&&v[1]<M[1]||x[1]===M[1]&&v[1]===x[1]&&v[0]>=x[0]&&v[0]<M[0]||x[1]<M[1]&&v[1]===M[1]&&v[0]<M[0]||x[1]<M[1]&&v[1]===x[1]&&v[0]>=x[0]}_selectWordAtCursor(v,x){var P,T;const M=(T=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:T.range;if(M)return this._model.selectionStart=[M.start.x-1,M.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(M,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(v);return!!O&&(this._selectWordAt(O,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,x){this._model.clearSelection(),v=Math.max(v,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const x=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(v){let x=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const M=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=M?0:(x>M&&(x-=M),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(v){return i.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!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(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const x=this._getMouseBufferCoords(v);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(v){return v.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.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(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const M=this._bufferService.buffer;if(this._model.selectionEnd[1]<M.lines.length){const O=M.lines.get(this._model.selectionEnd[1]);O&&O.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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const x=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const M=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(M&&M[0]!==void 0&&M[1]!==void 0){const O=(0,u.moveToCellSequence)(M[0]-1,M[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,M=!(!v||!x||v[0]===x[0]&&v[1]===x[1]);M?v&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,x,M)):this._oldHasSelection&&this._fireOnSelectionChange(v,x,M)}_fireOnSelectionChange(v,x,M){this._oldSelectionStart=v,this._oldSelectionEnd=x,this._oldHasSelection=M,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(v,x){let M=x;for(let O=0;x>=O;O++){const P=v.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?M--:P>1&&x!==O&&(M+=P-1)}return M}setSelection(v,x,M){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,x],this._model.selectionStartLength=M,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,x,M=!0,O=!0){if(v[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,T=P.lines.get(v[1]);if(!T)return;const H=P.translateBufferLineToString(v[1],!1);let I=this._convertViewportColToCharacterIndex(T,v[0]),N=I;const j=v[0]-I;let $=0,y=0,R=0,A=0;if(H.charAt(I)===" "){for(;I>0&&H.charAt(I-1)===" ";)I--;for(;N<H.length&&H.charAt(N+1)===" ";)N++}else{let K=v[0],Q=v[0];T.getWidth(K)===0&&($++,K--),T.getWidth(Q)===2&&(y++,Q++);const te=T.getString(Q).length;for(te>1&&(A+=te-1,N+=te-1);K>0&&I>0&&!this._isCharWordSeparator(T.loadCell(K-1,this._workCell));){T.loadCell(K-1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===0?($++,K--):F>1&&(R+=F-1,I-=F-1),I--,K--}for(;Q<T.length&&N+1<H.length&&!this._isCharWordSeparator(T.loadCell(Q+1,this._workCell));){T.loadCell(Q+1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,Q++):F>1&&(A+=F-1,N+=F-1),N++,Q++}}N++;let B=I+j-$+R,U=Math.min(this._bufferService.cols,N-I+$+y-R-A);if(x||H.slice(I,N).trim()!==""){if(M&&B===0&&T.getCodePoint(0)!==32){const K=P.lines.get(v[1]-1);if(K&&T.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const Q=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(Q){const te=this._bufferService.cols-Q.start;B-=te,U+=te}}}if(O&&B+U===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const K=P.lines.get(v[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const Q=this._getWordAt([0,v[1]+1],!1,!1,!0);Q&&(U+=Q.length)}}return{start:B,length:U}}}_selectWordAt(v,x){const M=this._getWordAt(v,x);if(M){for(;M.start<0;)M.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[M.start,v[1]],this._model.selectionStartLength=M.length}}_selectToWordAt(v){const x=this._getWordAt(v,!0);if(x){let M=v[1];for(;x.start<0;)x.start+=this._bufferService.cols,M--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,M++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,M]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const x=this._bufferService.buffer.getWrappedRangeForLine(v),M={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,e.getRangeLength)(M,this._bufferService.cols)}};n.SelectionService=C=c([f(3,d.IBufferService),f(4,d.ICoreService),f(5,m.IMouseService),f(6,d.IOptionsService),f(7,m.IRenderService),f(8,m.ICoreBrowserService)],C)},4725:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const c=a(8343);n.ICharSizeService=(0,c.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),n.IMouseService=(0,c.createDecorator)("MouseService"),n.IRenderService=(0,c.createDecorator)("RenderService"),n.ISelectionService=(0,c.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,c.createDecorator)("ThemeService"),n.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(E,n,a){var c=this&&this.__decorate||function(C,v,x,M){var O,P=arguments.length,T=P<3?v:M===null?M=Object.getOwnPropertyDescriptor(v,x):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,v,x,M);else for(var H=C.length-1;H>=0;H--)(O=C[H])&&(T=(P<3?O(T):P>3?O(v,x,T):O(v,x))||T);return P>3&&T&&Object.defineProperty(v,x,T),T},f=this&&this.__param||function(C,v){return function(x,M){v(x,M,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const l=a(7239),u=a(8055),p=a(8460),m=a(844),h=a(2585),t=u.css.toColor("#ffffff"),i=u.css.toColor("#000000"),e=u.css.toColor("#ffffff"),s=u.css.toColor("#000000"),d={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[u.css.toColor("#2e3436"),u.css.toColor("#cc0000"),u.css.toColor("#4e9a06"),u.css.toColor("#c4a000"),u.css.toColor("#3465a4"),u.css.toColor("#75507b"),u.css.toColor("#06989a"),u.css.toColor("#d3d7cf"),u.css.toColor("#555753"),u.css.toColor("#ef2929"),u.css.toColor("#8ae234"),u.css.toColor("#fce94f"),u.css.toColor("#729fcf"),u.css.toColor("#ad7fa8"),u.css.toColor("#34e2e2"),u.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let x=0;x<216;x++){const M=v[x/36%6|0],O=v[x/6%6|0],P=v[x%6];C.push({css:u.channels.toCss(M,O,P),rgba:u.channels.toRgba(M,O,P)})}for(let x=0;x<24;x++){const M=8+10*x;C.push({css:u.channels.toCss(M,M,M),rgba:u.channels.toRgba(M,M,M)})}return C})());let g=n.ThemeService=class extends m.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:i,cursor:e,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:d,selectionBackgroundOpaque:u.color.blend(i,d),selectionInactiveBackgroundTransparent:d,selectionInactiveBackgroundOpaque:u.color.blend(i,d),ansi:n.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(C={}){const v=this._colors;if(v.foreground=S(C.foreground,t),v.background=S(C.background,i),v.cursor=S(C.cursor,e),v.cursorAccent=S(C.cursorAccent,s),v.selectionBackgroundTransparent=S(C.selectionBackground,d),v.selectionBackgroundOpaque=u.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=u.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=C.selectionForeground?S(C.selectionForeground,u.NULL_COLOR):void 0,v.selectionForeground===u.NULL_COLOR&&(v.selectionForeground=void 0),u.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=u.color.opacity(v.selectionBackgroundTransparent,.3)),u.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=u.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=n.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=S(C.black,n.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=S(C.red,n.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=S(C.green,n.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=S(C.yellow,n.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=S(C.blue,n.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=S(C.magenta,n.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=S(C.cyan,n.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=S(C.white,n.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=S(C.brightBlack,n.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=S(C.brightRed,n.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=S(C.brightGreen,n.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=S(C.brightYellow,n.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=S(C.brightBlue,n.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=S(C.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=S(C.brightCyan,n.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=S(C.brightWhite,n.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const x=Math.min(v.ansi.length-16,C.extendedAnsi.length);for(let M=0;M<x;M++)v.ansi[M+16]=S(C.extendedAnsi[M],n.DEFAULT_ANSI_COLORS[M+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(C){C(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 S(C,v){if(C!==void 0)try{return u.css.toColor(C)}catch{}return v}n.ThemeService=g=c([f(0,h.IOptionsService)],g)},6349:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const c=a(8460),f=a(844);class l extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(p){if(this._maxLength===p)return;const m=new Array(p);for(let h=0;h<Math.min(p,this.length);h++)m[h]=this._array[this._getCyclicIndex(h)];this._array=m,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let m=this._length;m<p;m++)this._array[m]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,m){this._array[this._getCyclicIndex(p)]=m}push(p){this._array[this._getCyclicIndex(this._length)]=p,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(p,m,...h){if(m){for(let t=p;t<this._length-m;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+m)];this._length-=m,this.onDeleteEmitter.fire({index:p,amount:m})}for(let t=this._length-1;t>=p;t--)this._array[this._getCyclicIndex(t+h.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<h.length;t++)this._array[this._getCyclicIndex(p+t)]=h[t];if(h.length&&this.onInsertEmitter.fire({index:p,amount:h.length}),this._length+h.length>this._maxLength){const t=this._length+h.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=h.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,m,h){if(!(m<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let i=m-1;i>=0;i--)this.set(p+i+h,this.get(p+i));const t=p+m+h-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<m;t++)this.set(p+t+h,this.get(p+t))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}n.CircularList=l},1439:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(c,f=5){if(typeof c!="object")return c;const l=Array.isArray(c)?[]:{};for(const u in c)l[u]=f<=1?c[u]:c[u]&&a(c[u],f-1);return l}},8055:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let a=0,c=0,f=0,l=0;var u,p,m,h,t;function i(s){const d=s.toString(16);return d.length<2?"0"+d:d}function e(s,d){return s<d?(d+.05)/(s+.05):(s+.05)/(d+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(d,g,S,C){return C!==void 0?`#${i(d)}${i(g)}${i(S)}${i(C)}`:`#${i(d)}${i(g)}${i(S)}`},s.toRgba=function(d,g,S,C=255){return(d<<24|g<<16|S<<8|C)>>>0},s.toColor=function(d,g,S,C){return{css:s.toCss(d,g,S,C),rgba:s.toRgba(d,g,S,C)}}})(u||(n.channels=u={})),(function(s){function d(g,S){return l=Math.round(255*S),[a,c,f]=t.toChannels(g.rgba),{css:u.toCss(a,c,f,l),rgba:u.toRgba(a,c,f,l)}}s.blend=function(g,S){if(l=(255&S.rgba)/255,l===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,v=S.rgba>>16&255,x=S.rgba>>8&255,M=g.rgba>>24&255,O=g.rgba>>16&255,P=g.rgba>>8&255;return a=M+Math.round((C-M)*l),c=O+Math.round((v-O)*l),f=P+Math.round((x-P)*l),{css:u.toCss(a,c,f),rgba:u.toRgba(a,c,f)}},s.isOpaque=function(g){return(255&g.rgba)==255},s.ensureContrastRatio=function(g,S,C){const v=t.ensureContrastRatio(g.rgba,S.rgba,C);if(v)return u.toColor(v>>24&255,v>>16&255,v>>8&255)},s.opaque=function(g){const S=(255|g.rgba)>>>0;return[a,c,f]=t.toChannels(S),{css:u.toCss(a,c,f),rgba:S}},s.opacity=d,s.multiplyOpacity=function(g,S){return l=255&g.rgba,d(g,l*S/255)},s.toColorRGB=function(g){return[g.rgba>>24&255,g.rgba>>16&255,g.rgba>>8&255]}})(p||(n.color=p={})),(function(s){let d,g;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(d=C,d.globalCompositeOperation="copy",g=d.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return a=parseInt(S.slice(1,2).repeat(2),16),c=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),u.toColor(a,c,f);case 5:return a=parseInt(S.slice(1,2).repeat(2),16),c=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),l=parseInt(S.slice(4,5).repeat(2),16),u.toColor(a,c,f,l);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return a=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),l=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),u.toColor(a,c,f,l);if(!d||!g)throw new Error("css.toColor: Unsupported css format");if(d.fillStyle=g,d.fillStyle=S,typeof d.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(d.fillRect(0,0,1,1),[a,c,f,l]=d.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:u.toRgba(a,c,f,l),css:S}}})(m||(n.css=m={})),(function(s){function d(g,S,C){const v=g/255,x=S/255,M=C/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))}s.relativeLuminance=function(g){return d(g>>16&255,g>>8&255,255&g)},s.relativeLuminance2=d})(h||(n.rgb=h={})),(function(s){function d(S,C,v){const x=S>>24&255,M=S>>16&255,O=S>>8&255;let P=C>>24&255,T=C>>16&255,H=C>>8&255,I=e(h.relativeLuminance2(P,T,H),h.relativeLuminance2(x,M,O));for(;I<v&&(P>0||T>0||H>0);)P-=Math.max(0,Math.ceil(.1*P)),T-=Math.max(0,Math.ceil(.1*T)),H-=Math.max(0,Math.ceil(.1*H)),I=e(h.relativeLuminance2(P,T,H),h.relativeLuminance2(x,M,O));return(P<<24|T<<16|H<<8|255)>>>0}function g(S,C,v){const x=S>>24&255,M=S>>16&255,O=S>>8&255;let P=C>>24&255,T=C>>16&255,H=C>>8&255,I=e(h.relativeLuminance2(P,T,H),h.relativeLuminance2(x,M,O));for(;I<v&&(P<255||T<255||H<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=Math.min(255,H+Math.ceil(.1*(255-H))),I=e(h.relativeLuminance2(P,T,H),h.relativeLuminance2(x,M,O));return(P<<24|T<<16|H<<8|255)>>>0}s.blend=function(S,C){if(l=(255&C)/255,l===1)return C;const v=C>>24&255,x=C>>16&255,M=C>>8&255,O=S>>24&255,P=S>>16&255,T=S>>8&255;return a=O+Math.round((v-O)*l),c=P+Math.round((x-P)*l),f=T+Math.round((M-T)*l),u.toRgba(a,c,f)},s.ensureContrastRatio=function(S,C,v){const x=h.relativeLuminance(S>>8),M=h.relativeLuminance(C>>8);if(e(x,M)<v){if(M<x){const T=d(S,C,v),H=e(x,h.relativeLuminance(T>>8));if(H<v){const I=g(S,C,v);return H>e(x,h.relativeLuminance(I>>8))?T:I}return T}const O=g(S,C,v),P=e(x,h.relativeLuminance(O>>8));if(P<v){const T=d(S,C,v);return P>e(x,h.relativeLuminance(T>>8))?O:T}return O}},s.reduceLuminance=d,s.increaseLuminance=g,s.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(t||(n.rgba=t={})),n.toPaddedHex=i,n.contrastRatio=e},8969:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const c=a(844),f=a(2585),l=a(4348),u=a(7866),p=a(744),m=a(7302),h=a(6975),t=a(8460),i=a(1753),e=a(1480),s=a(7994),d=a(9282),g=a(5435),S=a(5981),C=a(2660);let v=!1;class x extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event((O=>{var P;(P=this._onScrollApi)==null||P.fire(O.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(O){for(const P in O)this.optionsService.options[P]=O[P]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new m.OptionsService(O)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(u.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.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 S.WriteBuffer(((P,T)=>this._inputHandler.parse(P,T)))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,P){this._writeBuffer.write(O,P)}writeSync(O,P){this._logService.logLevel<=f.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(O,P)}input(O,P=!0){this.coreService.triggerDataEvent(O,P)}resize(O,P){isNaN(O)||isNaN(P)||(O=Math.max(O,p.MINIMUM_COLS),P=Math.max(P,p.MINIMUM_ROWS),this._bufferService.resize(O,P))}scroll(O,P=!1){this._bufferService.scroll(O,P)}scrollLines(O,P,T){this._bufferService.scrollLines(O,P,T)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const P=O-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(O,P){return this._inputHandler.registerEscHandler(O,P)}registerDcsHandler(O,P){return this._inputHandler.registerDcsHandler(O,P)}registerCsiHandler(O,P){return this._inputHandler.registerCsiHandler(O,P)}registerOscHandler(O,P){return this._inputHandler.registerOscHandler(O,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?O=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},(()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const P of O)P.dispose()}))}}}n.CoreTerminal=x},8460:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const f=[];for(let l=0;l<this._listeners.length;l++)f.push(this._listeners[l]);for(let l=0;l<f.length;l++)f[l].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,c){return a((f=>c.fire(f)))},n.runAndSubscribe=function(a,c){return c(void 0),a((f=>c(f)))}},5435:function(E,n,a){var c=this&&this.__decorate||function($,y,R,A){var B,U=arguments.length,K=U<3?y:A===null?A=Object.getOwnPropertyDescriptor(y,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,y,R,A);else for(var Q=$.length-1;Q>=0;Q--)(B=$[Q])&&(K=(U<3?B(K):U>3?B(y,R,K):B(y,R))||K);return U>3&&K&&Object.defineProperty(y,R,K),K},f=this&&this.__param||function($,y){return function(R,A){y(R,A,$)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const l=a(2584),u=a(7116),p=a(2015),m=a(844),h=a(482),t=a(8437),i=a(8460),e=a(643),s=a(511),d=a(3734),g=a(2585),S=a(1480),C=a(6242),v=a(6351),x=a(5941),M={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function P($,y){if($>24)return y.setWinLines||!1;switch($){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var T;(function($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(n.WindowsOptionsReportType=T={}));let H=0;class I extends m.Disposable{getAttrData(){return this._curAttrData}constructor(y,R,A,B,U,K,Q,te,F=new p.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=R,this._coreService=A,this._logService=B,this._optionsService=U,this._oscLinkService=K,this._coreMouseService=Q,this._unicodeService=te,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._parser.setCsiHandlerFallback(((D,Y)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:Y.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,Y,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:Y,data:z})})),this._parser.setDcsHandlerFallback(((D,Y,z)=>{Y==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:Y,payload:z})})),this._parser.setPrintHandler(((D,Y,z)=>this.print(D,Y,z))),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(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((D=>(this.setTitle(D),this.setIconName(D),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((D=>this.setIconName(D)))),this._parser.registerOscHandler(2,new C.OscHandler((D=>this.setTitle(D)))),this._parser.registerOscHandler(4,new C.OscHandler((D=>this.setOrReportIndexedColor(D)))),this._parser.registerOscHandler(8,new C.OscHandler((D=>this.setHyperlink(D)))),this._parser.registerOscHandler(10,new C.OscHandler((D=>this.setOrReportFgColor(D)))),this._parser.registerOscHandler(11,new C.OscHandler((D=>this.setOrReportBgColor(D)))),this._parser.registerOscHandler(12,new C.OscHandler((D=>this.setOrReportCursorColor(D)))),this._parser.registerOscHandler(104,new C.OscHandler((D=>this.restoreIndexedColor(D)))),this._parser.registerOscHandler(110,new C.OscHandler((D=>this.restoreFgColor(D)))),this._parser.registerOscHandler(111,new C.OscHandler((D=>this.restoreBgColor(D)))),this._parser.registerOscHandler(112,new C.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 u.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 v.DcsHandler(((D,Y)=>this.requestStatusString(D,Y))))}_preserveStack(y,R,A,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=A,this._parseStack.position=B}_logSlowResolvingAsync(y){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([y,new Promise(((R,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,R){let A,B=this._activeBuffer.x,U=this._activeBuffer.y,K=0;const Q=this._parseStack.paused;if(Q){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(A),A;B=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>O&&(K=this._parseStack.position+O)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(D=>String.fromCharCode(D))).join("")}"`),typeof y=="string"?y.split("").map((D=>D.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(y.length,O))),Q||this._dirtyRowTracker.clearRange(),y.length>O)for(let D=K;D<y.length;D+=O){const Y=D+O<y.length?D+O:y.length,z=typeof y=="string"?this._stringDecoder.decode(y.substring(D,Y),this._parseBuffer):this._utf8Decoder.decode(y.subarray(D,Y),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,z))return this._preserveStack(B,U,z,D),this._logSlowResolvingAsync(A),A}else if(!Q){const D=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,D))return this._preserveStack(B,U,D,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===B&&this._activeBuffer.y===U||this._onCursorMove.fire();const te=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),F=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);F<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(F,this._bufferService.rows-1),Math.min(te,this._bufferService.rows-1))}print(y,R,A){let B,U;const K=this._charsetService.charset,Q=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,Y=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-R>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Y);let re=this._parser.precedingJoinState;for(let Z=R;Z<A;++Z){if(B=y[Z],B<127&&K){const Ae=K[String.fromCharCode(B)];Ae&&(B=Ae.charCodeAt(0))}const le=this._unicodeService.charProperties(B,re);U=S.UnicodeService.extractWidth(le);const _e=S.UnicodeService.extractShouldJoin(le),Se=_e?S.UnicodeService.extractWidth(re):0;if(re=le,Q&&this._onA11yChar.fire((0,h.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-Se>te){if(F){const Ae=z;let ce=this._activeBuffer.x-Se;for(this._activeBuffer.x=Se,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),z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Se>0&&z instanceof t.BufferLine&&z.copyCellsFrom(Ae,ce,0,Se,!1);ce<te;)Ae.setCellFromCodepoint(ce++,0,1,Y)}else if(this._activeBuffer.x=te-1,U===2)continue}if(_e&&this._activeBuffer.x){const Ae=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-Ae,B,U);for(let ce=U-Se;--ce>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,Y)}else if(D&&(z.insertCells(this._activeBuffer.x,U-Se,this._activeBuffer.getNullCell(Y)),z.getWidth(te-1)===2&&z.setCellFromCodepoint(te-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,Y)),z.setCellFromCodepoint(this._activeBuffer.x++,B,U,Y),U>0)for(;--U;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,Y)}this._parser.precedingJoinState=re,this._activeBuffer.x<te&&A-R>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,Y),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,R){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,R):this._parser.registerCsiHandler(y,(A=>!P(A.params[0],this._optionsService.rawOptions.windowOptions)||R(A)))}registerDcsHandler(y,R){return this._parser.registerDcsHandler(y,new v.DcsHandler(R))}registerEscHandler(y,R){return this._parser.registerEscHandler(y,R)}registerOscHandler(y,R){return this._parser.registerOscHandler(y,new C.OscHandler(R))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=y,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+R)}cursorUp(y){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const R=y.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=y.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const R=y.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,R,A,B=!1,U=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);K.replaceCells(R,A,this._activeBuffer.getNullCell(this._eraseAttrData()),U),B&&(K.isWrapped=!1)}_resetBufferLine(y,R=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),A.isWrapped=!1)}eraseInDisplay(y,R=!1){let A;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);A<this._bufferService.rows;A++)this._resetBufferLine(A,R);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,R);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(y,R=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;R--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let R=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;R--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let R=y.params[0]||1;for(;R--;)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(y){let R=y.params[0]||1;for(;R--;)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(t.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=y.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const R=this._parser.precedingJoinState;if(!R)return!0;const A=y.params[0]||1,B=S.UnicodeService.extractWidth(R),U=this._activeBuffer.x-B,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),Q=new Uint32Array(K.length*A);let te=0;for(let D=0;D<K.length;){const Y=K.codePointAt(D)||0;Q[te++]=Y,D+=Y>65535?2:1}let F=te;for(let D=1;D<A;++D)Q.copyWithin(F,0,te),F+=te;return this.print(Q,0,F),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,u.DEFAULT_CHARSET),this._charsetService.setgCharset(1,u.DEFAULT_CHARSET),this._charsetService.setgCharset(2,u.DEFAULT_CHARSET),this._charsetService.setgCharset(3,u.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(y){for(let R=0;R<y.length;R++)switch(y.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let R=0;R<y.length;R++)switch(y.params[R]){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(),y.params[R]===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(y,R){const A=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:U}=this._coreMouseService,K=this._coreService,{buffers:Q,cols:te}=this._bufferService,{active:F,alt:D}=Q,Y=this._optionsService.rawOptions,z=_e=>_e?1:2,re=y.params[0];return Z=re,le=R?re===2?4:re===4?z(K.modes.insertMode):re===12?3:re===20?z(Y.convertEol):0:re===1?z(A.applicationCursorKeys):re===3?Y.windowOptions.setWinLines?te===80?2:te===132?1:0:0:re===6?z(A.origin):re===7?z(A.wraparound):re===8?3:re===9?z(B==="X10"):re===12?z(Y.cursorBlink):re===25?z(!K.isCursorHidden):re===45?z(A.reverseWraparound):re===66?z(A.applicationKeypad):re===67?4:re===1e3?z(B==="VT200"):re===1002?z(B==="DRAG"):re===1003?z(B==="ANY"):re===1004?z(A.sendFocus):re===1005?4:re===1006?z(U==="SGR"):re===1015?4:re===1016?z(U==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?z(F===D):re===2004?z(A.bracketedPasteMode):0,K.triggerDataEvent(`${l.C0.ESC}[${R?"":"?"}${Z};${le}$y`),!0;var Z,le}_updateAttrColor(y,R,A,B,U){return R===2?(y|=50331648,y&=-16777216,y|=d.AttributeData.fromColorRGB([A,B,U])):R===5&&(y&=-50331904,y|=33554432|255&A),y}_extractColor(y,R,A){const B=[0,0,-1,0,0,0];let U=0,K=0;do{if(B[K+U]=y.params[R+K],y.hasSubParams(R+K)){const Q=y.getSubParams(R+K);let te=0;do B[1]===5&&(U=1),B[K+te+1+U]=Q[te];while(++te<Q.length&&te+K+1+U<B.length);break}if(B[1]===5&&K+U>=2||B[1]===2&&K+U>=5)break;B[1]&&(U=1)}while(++K+R<y.length&&K+U<B.length);for(let Q=2;Q<B.length;++Q)B[Q]===-1&&(B[Q]=0);switch(B[0]){case 38:A.fg=this._updateAttrColor(A.fg,B[1],B[3],B[4],B[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,B[1],B[3],B[4],B[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,B[1],B[3],B[4],B[5])}return K}_processUnderline(y,R){R.extended=R.extended.clone(),(!~y||y>5)&&(y=1),R.extended.underlineStyle=y,R.fg|=268435456,y===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(y){y.fg=t.DEFAULT_ATTR_DATA.fg,y.bg=t.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=y.length;let A;const B=this._curAttrData;for(let U=0;U<R;U++)A=y.params[U],A>=30&&A<=37?(B.fg&=-50331904,B.fg|=16777216|A-30):A>=40&&A<=47?(B.bg&=-50331904,B.bg|=16777216|A-40):A>=90&&A<=97?(B.fg&=-50331904,B.fg|=16777224|A-90):A>=100&&A<=107?(B.bg&=-50331904,B.bg|=16777224|A-100):A===0?this._processSGR0(B):A===1?B.fg|=134217728:A===3?B.bg|=67108864:A===4?(B.fg|=268435456,this._processUnderline(y.hasSubParams(U)?y.getSubParams(U)[0]:1,B)):A===5?B.fg|=536870912:A===7?B.fg|=67108864:A===8?B.fg|=1073741824:A===9?B.fg|=2147483648:A===2?B.bg|=134217728:A===21?this._processUnderline(2,B):A===22?(B.fg&=-134217729,B.bg&=-134217729):A===23?B.bg&=-67108865:A===24?(B.fg&=-268435457,this._processUnderline(0,B)):A===25?B.fg&=-536870913:A===27?B.fg&=-67108865:A===28?B.fg&=-1073741825:A===29?B.fg&=2147483647:A===39?(B.fg&=-67108864,B.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):A===49?(B.bg&=-67108864,B.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?U+=this._extractColor(y,U,B):A===53?B.bg|=1073741824:A===55?B.bg&=-1073741825:A===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):A===100?(B.fg&=-67108864,B.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${R};${A}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const R=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${R};${A}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.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(y){const R=y.params[0]||1;switch(R){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 A=R%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(y){const R=y.params[0]||1;let A;return(y.length<2||(A=y.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(y){if(!P(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const R=[],A=y.split(";");for(;A.length>1;){const B=A.shift(),U=A.shift();if(/^\d+$/.exec(B)){const K=parseInt(B);if(j(K))if(U==="?")R.push({type:0,index:K});else{const Q=(0,x.parseColor)(U);Q&&R.push({type:1,index:K,color:Q})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(y){const R=y.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(y,R){this._getCurrentLinkId()&&this._finishHyperlink();const A=y.split(":");let B;const U=A.findIndex((K=>K.startsWith("id=")));return U!==-1&&(B=A[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,R){const A=y.split(";");for(let B=0;B<A.length&&!(R>=this._specialColors.length);++B,++R)if(A[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const U=(0,x.parseColor)(A[B]);U&&this._onColor.fire([{type:1,index:this._specialColors[R],color:U}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const R=[],A=y.split(";");for(let B=0;B<A.length;++B)if(/^\d+$/.exec(A[B])){const U=parseInt(A[B]);j(U)&&R.push({type:2,index:U})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){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,u.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(M[y[0]],u.CHARSETS[y[1]]||u.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 y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,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=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new s.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const A=this._activeBuffer.ybase+this._activeBuffer.y+R,B=this._activeBuffer.lines.get(A);B&&(B.fill(y),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,R){const A=this._bufferService.buffer,B=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${U}${l.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,R){this._dirtyRowTracker.markRangeDirty(y,R)}}n.InputHandler=I;let N=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,y){$>y&&(H=$,$=y,y=H),$<this.start&&(this.start=$),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j($){return 0<=$&&$<256}N=c([f(0,g.IBufferService)],N)},844:(E,n)=>{function a(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=a,n.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(f,l,u){this._data[f]||(this._data[f]={}),this._data[f][l]=u}get(f,l){return this._data[f]?this._data[f][l]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(c,f,l,u,p){this._data.get(c,f)||this._data.set(c,f,new a),this._data.get(c,f).set(l,u,p)}get(c,f,l,u){var p;return(p=this._data.get(c,f))==null?void 0:p.get(l,u)}clear(){this._data.clear()}}},6114:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const a=n.isNode?"node":navigator.userAgent,c=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const f=a.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),n.isIpad=c==="iPad",n.isIphone=c==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),n.isLinux=c.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const f=this._getKey(c);if(f===void 0||(a=this._search(f),a===-1)||this._getKey(this._array[a])!==f)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===f);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,f){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do f(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let f=0,l=this._array.length-1;for(;l>=f;){let u=f+l>>1;const p=this._getKey(this._array[u]);if(p>c)l=u-1;else{if(!(p<c)){for(;u>0&&this._getKey(this._array[u-1])===c;)u--;return u}f=u+1}}return f}}},7226:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const c=a(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let m=0,h=0,t=p.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(m=Date.now(),this._tasks[this._i]()||this._i++,m=Math.max(1,Date.now()-m),h=Math.max(m,h),i=p.timeRemaining(),1.5*h>i)return t-m<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-m))}ms`),void this._start();t=i}this.clear()}}class l extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const m=Date.now()+p;return{timeRemaining:()=>Math.max(0,m-Date.now())}}}n.PriorityTaskQueue=l,n.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(u){return requestIdleCallback(u)}_cancelCallback(u){cancelIdleCallback(u)}}:l,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(u){this._queue.clear(),this._queue.enqueue(u)}flush(){this._queue.flush()}}},9282:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const c=a(643);n.updateWindowsModeWrappedState=function(f){const l=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),u=l==null?void 0:l.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&u&&(p.isWrapped=u[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&u[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}n.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,u=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=u}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=c},9092:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const c=a(6349),f=a(7226),l=a(3734),u=a(8437),p=a(4634),m=a(511),h=a(643),t=a(4863),i=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,s,d){this._hasScrollback=e,this._optionsService=s,this._bufferService=d,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=u.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=m.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.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 c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,s){return new u.BufferLine(this._bufferService.cols,this.getNullCell(e),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const s=e+this._optionsService.rawOptions.scrollback;return s>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:s}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=u.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,s){const d=this.getNullCell(u.DEFAULT_ATTR_DATA);let g=0;const S=this._getCorrectBufferLength(s);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<e)for(let v=0;v<this.lines.length;v++)g+=+this.lines.get(v).resize(e,d);let C=0;if(this._rows<s)for(let v=this._rows;v<s;v++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new u.BufferLine(e,d)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new u.BufferLine(e,d)));else for(let v=this._rows;v>s;v--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const v=this.lines.length-S;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=S}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,s-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(e,s),this._cols>e))for(let C=0;C<this.lines.length;C++)g+=+this.lines.get(C).resize(e,d);this._cols=e,this._rows=s,this._memoryCleanupQueue.clear(),g>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,s){this._cols!==e&&(e>this._cols?this._reflowLarger(e,s):this._reflowSmaller(e,s))}_reflowLarger(e,s){const d=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(u.DEFAULT_ATTR_DATA));if(d.length>0){const g=(0,p.reflowLargerCreateNewLayout)(this.lines,d);(0,p.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(e,s,g.countRemoved)}}_reflowLargerAdjustViewport(e,s,d){const g=this.getNullCell(u.DEFAULT_ATTR_DATA);let S=d;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new u.BufferLine(e,g))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-d,0)}_reflowSmaller(e,s){const d=this.getNullCell(u.DEFAULT_ATTR_DATA),g=[];let S=0;for(let C=this.lines.length-1;C>=0;C--){let v=this.lines.get(C);if(!v||!v.isWrapped&&v.getTrimmedLength()<=e)continue;const x=[v];for(;v.isWrapped&&C>0;)v=this.lines.get(--C),x.unshift(v);const M=this.ybase+this.y;if(M>=C&&M<C+x.length)continue;const O=x[x.length-1].getTrimmedLength(),P=(0,p.reflowSmallerGetNewLineLengths)(x,this._cols,e),T=P.length-x.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const I=[];for(let A=0;A<T;A++){const B=this.getBlankLine(u.DEFAULT_ATTR_DATA,!0);I.push(B)}I.length>0&&(g.push({start:C+x.length+S,newLines:I}),S+=I.length),x.push(...I);let N=P.length-1,j=P[N];j===0&&(N--,j=P[N]);let $=x.length-T-1,y=O;for(;$>=0;){const A=Math.min(y,j);if(x[N]===void 0)break;if(x[N].copyCellsFrom(x[$],y-A,j-A,A,!0),j-=A,j===0&&(N--,j=P[N]),y-=A,y===0){$--;const B=Math.max($,0);y=(0,p.getWrappedLineTrimmedLength)(x,B,this._cols)}}for(let A=0;A<x.length;A++)P[A]<e&&x[A].setCell(P[A],d);let R=T-H;for(;R-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+s-1)}if(g.length>0){const C=[],v=[];for(let N=0;N<this.lines.length;N++)v.push(this.lines.get(N));const x=this.lines.length;let M=x-1,O=0,P=g[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let T=0;for(let N=Math.min(this.lines.maxLength-1,x+S-1);N>=0;N--)if(P&&P.start>M+T){for(let j=P.newLines.length-1;j>=0;j--)this.lines.set(N--,P.newLines[j]);N++,C.push({index:M+1,amount:P.newLines.length}),T+=P.newLines.length,P=g[++O]}else this.lines.set(N,v[M--]);let H=0;for(let N=C.length-1;N>=0;N--)C[N].index+=H,this.lines.onInsertEmitter.fire(C[N]),H+=C[N].amount;const I=Math.max(0,x+S-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(e,s,d=0,g){const S=this.lines.get(e);return S?S.translateToString(s,d,g):""}getWrappedRangeForLine(e){let s=e,d=e;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;d+1<this.lines.length&&this.lines.get(d+1).isWrapped;)d++;return{first:s,last:d}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===e&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const s=new t.Marker(e);return this.markers.push(s),s.register(this.lines.onTrim((d=>{s.line-=d,s.line<0&&s.dispose()}))),s.register(this.lines.onInsert((d=>{s.line>=d.index&&(s.line+=d.amount)}))),s.register(this.lines.onDelete((d=>{s.line>=d.index&&s.line<d.index+d.amount&&s.dispose(),s.line>d.index&&(s.line-=d.amount)}))),s.register(s.onDispose((()=>this._removeMarker(s)))),s}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const c=a(3734),f=a(511),l=a(643),u=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let p=0;class m{constructor(t,i,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const s=i||f.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let d=0;d<t;++d)this.setCell(d,s);this.length=t}get(t){const i=this._data[3*t+0],e=2097151&i;return[this._data[3*t+1],2097152&i?this._combined[t]:e?(0,u.stringFromCodePoint)(e):"",i>>22,2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,i){this._data[3*t+1]=i[l.CHAR_DATA_ATTR_INDEX],i[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=i[1],this._data[3*t+0]=2097152|t|i[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=i[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&i}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t]:2097151&i?(0,u.stringFromCodePoint)(2097151&i):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,i){return p=3*t,i.content=this._data[p+0],i.fg=this._data[p+1],i.bg=this._data[p+2],2097152&i.content&&(i.combinedData=this._combined[t]),268435456&i.bg&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){2097152&i.content&&(this._combined[t]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=i.content,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}setCellFromCodepoint(t,i,e,s){268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=i|e<<22,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}addCodepointToCell(t,i,e){let s=this._data[3*t+0];2097152&s?this._combined[t]+=(0,u.stringFromCodePoint)(i):2097151&s?(this._combined[t]=(0,u.stringFromCodePoint)(2097151&s)+(0,u.stringFromCodePoint)(i),s&=-2097152,s|=2097152):s=i|4194304,e&&(s&=-12582913,s|=e<<22),this._data[3*t+0]=s}insertCells(t,i,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length-t){const s=new f.CellData;for(let d=this.length-t-i-1;d>=0;--d)this.setCell(t+i+d,this.loadCell(t+d,s));for(let d=0;d<i;++d)this.setCell(t+d,e)}else for(let s=t;s<this.length;++s)this.setCell(s,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,i,e){if(t%=this.length,i<this.length-t){const s=new f.CellData;for(let d=0;d<this.length-t-i;++d)this.setCell(t+d,this.loadCell(t+i+d,s));for(let d=this.length-i;d<this.length;++d)this.setCell(d,e)}else for(let s=t;s<this.length;++s)this.setCell(s,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,i,e,s=!1){if(s)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.setCell(t++,e)}resize(t,i){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const s=new Uint32Array(e);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,e);const s=Object.keys(this._combined);for(let g=0;g<s.length;g++){const S=parseInt(s[g],10);S>=t&&delete this._combined[S]}const d=Object.keys(this._extendedAttrs);for(let g=0;g<d.length;g++){const S=parseInt(d[g],10);S>=t&&delete this._extendedAttrs[S]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(const i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){const t=new m(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const i in this._combined)t._combined[i]=this._combined[i];for(const i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,i,e,s,d){const g=t._data;if(d)for(let C=s-1;C>=0;C--){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=g[3*(i+C)+v];268435456&g[3*(i+C)+2]&&(this._extendedAttrs[e+C]=t._extendedAttrs[i+C])}else for(let C=0;C<s;C++){for(let v=0;v<3;v++)this._data[3*(e+C)+v]=g[3*(i+C)+v];268435456&g[3*(i+C)+2]&&(this._extendedAttrs[e+C]=t._extendedAttrs[i+C])}const S=Object.keys(t._combined);for(let C=0;C<S.length;C++){const v=parseInt(S[C],10);v>=i&&(this._combined[v-i+e]=t._combined[v])}}translateToString(t,i,e,s){i=i??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),s&&(s.length=0);let d="";for(;i<e;){const g=this._data[3*i+0],S=2097151&g,C=2097152&g?this._combined[i]:S?(0,u.stringFromCodePoint)(S):l.WHITESPACE_CELL_CHAR;if(d+=C,s)for(let v=0;v<C.length;++v)s.push(i);i+=g>>22||1}return s&&s.push(i),d}}n.BufferLine=m},4841:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(E,n)=>{function a(c,f,l){if(f===c.length-1)return c[f].getTrimmedLength();const u=!c[f].hasContent(l-1)&&c[f].getWidth(l-1)===1,p=c[f+1].getWidth(0)===2;return u&&p?l-1:l}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(c,f,l,u,p){const m=[];for(let h=0;h<c.length-1;h++){let t=h,i=c.get(++t);if(!i.isWrapped)continue;const e=[c.get(h)];for(;t<c.length&&i.isWrapped;)e.push(i),i=c.get(++t);if(u>=h&&u<t){h+=e.length-1;continue}let s=0,d=a(e,s,f),g=1,S=0;for(;g<e.length;){const v=a(e,g,f),x=v-S,M=l-d,O=Math.min(x,M);e[s].copyCellsFrom(e[g],S,d,O,!1),d+=O,d===l&&(s++,d=0),S+=O,S===v&&(g++,S=0),d===0&&s!==0&&e[s-1].getWidth(l-1)===2&&(e[s].copyCellsFrom(e[s-1],l-1,d++,1,!1),e[s-1].setCell(l-1,p))}e[s].replaceCells(d,l,p);let C=0;for(let v=e.length-1;v>0&&(v>s||e[v].getTrimmedLength()===0);v--)C++;C>0&&(m.push(h+e.length-C),m.push(C)),h+=e.length-1}return m},n.reflowLargerCreateNewLayout=function(c,f){const l=[];let u=0,p=f[u],m=0;for(let h=0;h<c.length;h++)if(p===h){const t=f[++u];c.onDeleteEmitter.fire({index:h-m,amount:t}),h+=t-1,m+=t,p=f[++u]}else l.push(h);return{layout:l,countRemoved:m}},n.reflowLargerApplyNewLayout=function(c,f){const l=[];for(let u=0;u<f.length;u++)l.push(c.get(f[u]));for(let u=0;u<l.length;u++)c.set(u,l[u]);c.length=f.length},n.reflowSmallerGetNewLineLengths=function(c,f,l){const u=[],p=c.map(((i,e)=>a(c,e,f))).reduce(((i,e)=>i+e));let m=0,h=0,t=0;for(;t<p;){if(p-t<l){u.push(p-t);break}m+=l;const i=a(c,h,f);m>i&&(m-=i,h++);const e=c[h].getWidth(m-1)===2;e&&m--;const s=e?l-1:l;u.push(s),t+=s}return u},n.getWrappedLineTrimmedLength=a},5295:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const c=a(8460),f=a(844),l=a(9092);class u extends f.Disposable{constructor(m,h){super(),this._optionsService=m,this._bufferService=h,this._onBufferActivate=this.register(new c.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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,h){this._normal.resize(m,h),this._alt.resize(m,h),this.setupTabStops(m)}setupTabStops(m){this._normal.setupTabStops(m),this._alt.setupTabStops(m)}}n.BufferSet=u},511:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const c=a(482),f=a(643),l=a(3734);class u extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(m){const h=new u;return h.setFromCharData(m),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.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 h=!1;if(m[f.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(m[f.CHAR_DATA_CHAR_INDEX].length===2){const t=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const i=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(t-55296)+i-56320+65536|m[f.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[f.CHAR_DATA_WIDTH_INDEX]<<22;h&&(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()]}}n.CellData=u},643:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const c=a(8460),f=a(844);class l{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new c.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(p){return this._disposables.push(p),p}}n.Marker=l,l._nextId=1},7116:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(E,n)=>{var a,c,f;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
9
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(a||(n.C0=a={})),(function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""})(c||(n.C1=c={})),(function(l){l.ST=`${a.ESC}\\`})(f||(n.C1_ESCAPED=f={}))},7399:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const c=a(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:["'",'"']};n.evaluateKeyboardEvent=function(l,u,p,m){const h={type:0,cancel:!1,key:void 0},t=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?h.key=u?c.C0.ESC+"OA":c.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?h.key=u?c.C0.ESC+"OD":c.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?h.key=u?c.C0.ESC+"OC":c.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(h.key=u?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:h.key=l.ctrlKey?"\b":c.C0.DEL,l.altKey&&(h.key=c.C0.ESC+h.key);break;case 9:if(l.shiftKey){h.key=c.C0.ESC+"[Z";break}h.key=c.C0.HT,h.cancel=!0;break;case 13:h.key=l.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,h.cancel=!0;break;case 27:h.key=c.C0.ESC,l.altKey&&(h.key=c.C0.ESC+c.C0.ESC),h.cancel=!0;break;case 37:if(l.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"D",h.key===c.C0.ESC+"[1;3D"&&(h.key=c.C0.ESC+(p?"b":"[1;5D"))):h.key=u?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(l.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"C",h.key===c.C0.ESC+"[1;3C"&&(h.key=c.C0.ESC+(p?"f":"[1;5C"))):h.key=u?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(l.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"A",p||h.key!==c.C0.ESC+"[1;3A"||(h.key=c.C0.ESC+"[1;5A")):h.key=u?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(l.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"B",p||h.key!==c.C0.ESC+"[1;3B"||(h.key=c.C0.ESC+"[1;5B")):h.key=u?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(h.key=c.C0.ESC+"[2~");break;case 46:h.key=t?c.C0.ESC+"[3;"+(t+1)+"~":c.C0.ESC+"[3~";break;case 36:h.key=t?c.C0.ESC+"[1;"+(t+1)+"H":u?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:h.key=t?c.C0.ESC+"[1;"+(t+1)+"F":u?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:l.shiftKey?h.type=2:l.ctrlKey?h.key=c.C0.ESC+"[5;"+(t+1)+"~":h.key=c.C0.ESC+"[5~";break;case 34:l.shiftKey?h.type=3:l.ctrlKey?h.key=c.C0.ESC+"[6;"+(t+1)+"~":h.key=c.C0.ESC+"[6~";break;case 112:h.key=t?c.C0.ESC+"[1;"+(t+1)+"P":c.C0.ESC+"OP";break;case 113:h.key=t?c.C0.ESC+"[1;"+(t+1)+"Q":c.C0.ESC+"OQ";break;case 114:h.key=t?c.C0.ESC+"[1;"+(t+1)+"R":c.C0.ESC+"OR";break;case 115:h.key=t?c.C0.ESC+"[1;"+(t+1)+"S":c.C0.ESC+"OS";break;case 116:h.key=t?c.C0.ESC+"[15;"+(t+1)+"~":c.C0.ESC+"[15~";break;case 117:h.key=t?c.C0.ESC+"[17;"+(t+1)+"~":c.C0.ESC+"[17~";break;case 118:h.key=t?c.C0.ESC+"[18;"+(t+1)+"~":c.C0.ESC+"[18~";break;case 119:h.key=t?c.C0.ESC+"[19;"+(t+1)+"~":c.C0.ESC+"[19~";break;case 120:h.key=t?c.C0.ESC+"[20;"+(t+1)+"~":c.C0.ESC+"[20~";break;case 121:h.key=t?c.C0.ESC+"[21;"+(t+1)+"~":c.C0.ESC+"[21~";break;case 122:h.key=t?c.C0.ESC+"[23;"+(t+1)+"~":c.C0.ESC+"[23~";break;case 123:h.key=t?c.C0.ESC+"[24;"+(t+1)+"~":c.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(p&&!m||!l.altKey||l.metaKey)!p||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?h.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(h.key=c.C0.US),l.key==="@"&&(h.key=c.C0.NUL)):l.keyCode===65&&(h.type=1);else{const i=f[l.keyCode],e=i==null?void 0:i[l.shiftKey?1:0];if(e)h.key=c.C0.ESC+e;else if(l.keyCode>=65&&l.keyCode<=90){const s=l.ctrlKey?l.keyCode-64:l.keyCode+32;let d=String.fromCharCode(s);l.shiftKey&&(d=d.toUpperCase()),h.key=c.C0.ESC+d}else if(l.keyCode===32)h.key=c.C0.ESC+(l.ctrlKey?c.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let s=l.code.slice(3,4);l.shiftKey||(s=s.toLowerCase()),h.key=c.C0.ESC+s,h.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?h.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?h.key=c.C0.NUL:l.keyCode>=51&&l.keyCode<=55?h.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?h.key=c.C0.DEL:l.keyCode===219?h.key=c.C0.ESC:l.keyCode===220?h.key=c.C0.FS:l.keyCode===221&&(h.key=c.C0.GS)}return h}},482:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,c=0,f=a.length){let l="";for(let u=c;u<f;++u){let p=a[u];p>65535?(p-=65536,l+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):l+=String.fromCharCode(p)}return l},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const f=a.length;if(!f)return 0;let l=0,u=0;if(this._interim){const p=a.charCodeAt(u++);56320<=p&&p<=57343?c[l++]=1024*(this._interim-55296)+p-56320+65536:(c[l++]=this._interim,c[l++]=p),this._interim=0}for(let p=u;p<f;++p){const m=a.charCodeAt(p);if(55296<=m&&m<=56319){if(++p>=f)return this._interim=m,l;const h=a.charCodeAt(p);56320<=h&&h<=57343?c[l++]=1024*(m-55296)+h-56320+65536:(c[l++]=m,c[l++]=h)}else m!==65279&&(c[l++]=m)}return l}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const f=a.length;if(!f)return 0;let l,u,p,m,h=0,t=0,i=0;if(this.interim[0]){let d=!1,g=this.interim[0];g&=(224&g)==192?31:(240&g)==224?15:7;let S,C=0;for(;(S=63&this.interim[++C])&&C<4;)g<<=6,g|=S;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=v-C;for(;i<x;){if(i>=f)return 0;if(S=a[i++],(192&S)!=128){i--,d=!0;break}this.interim[C++]=S,g<<=6,g|=63&S}d||(v===2?g<128?i--:c[h++]=g:v===3?g<2048||g>=55296&&g<=57343||g===65279||(c[h++]=g):g<65536||g>1114111||(c[h++]=g)),this.interim.fill(0)}const e=f-4;let s=i;for(;s<f;){for(;!(!(s<e)||128&(l=a[s])||128&(u=a[s+1])||128&(p=a[s+2])||128&(m=a[s+3]));)c[h++]=l,c[h++]=u,c[h++]=p,c[h++]=m,s+=4;if(l=a[s++],l<128)c[h++]=l;else if((224&l)==192){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(t=(31&l)<<6|63&u,t<128){s--;continue}c[h++]=t}else if((240&l)==224){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,h;if(p=a[s++],(192&p)!=128){s--;continue}if(t=(15&l)<<12|(63&u)<<6|63&p,t<2048||t>=55296&&t<=57343||t===65279)continue;c[h++]=t}else if((248&l)==240){if(s>=f)return this.interim[0]=l,h;if(u=a[s++],(192&u)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,h;if(p=a[s++],(192&p)!=128){s--;continue}if(s>=f)return this.interim[0]=l,this.interim[1]=u,this.interim[2]=p,h;if(m=a[s++],(192&m)!=128){s--;continue}if(t=(7&l)<<18|(63&u)<<12|(63&p)<<6|63&m,t<65536||t>1114111)continue;c[h++]=t}}return h}}},225:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const c=a(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]],l=[[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 u;n.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),u.fill(1),u[0]=0,u.fill(0,1,32),u.fill(0,127,160),u.fill(2,4352,4448),u[9001]=2,u[9002]=2,u.fill(2,11904,42192),u[12351]=1,u.fill(2,44032,55204),u.fill(2,63744,64256),u.fill(2,65040,65050),u.fill(2,65072,65136),u.fill(2,65280,65377),u.fill(2,65504,65511);for(let p=0;p<f.length;++p)u.fill(0,f[p][0],f[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?u[p]:(function(m,h){let t,i=0,e=h.length-1;if(m<h[0][0]||m>h[e][1])return!1;for(;e>=i;)if(t=i+e>>1,m>h[t][1])i=t+1;else{if(!(m<h[t][0]))return!0;e=t-1}return!1})(p,l)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}charProperties(p,m){let h=this.wcwidth(p),t=h===0&&m!==0;if(t){const i=c.UnicodeService.extractWidth(m);i===0?t=!1:i>h&&(h=i)}return c.UnicodeService.createPropertyValue(0,h,t)}}},5981:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const c=a(8460),f=a(844);class l extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,m){if(m!==void 0&&this._syncCalls>m)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,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+=p.length,this._writeBuffer.push(p),this._callbacks.push(m),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(m)}_innerWrite(p=0,m=!0){const h=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],i=this._action(t,m);if(i){const s=d=>Date.now()-h>=12?setTimeout((()=>this._innerWrite(0,d))):this._innerWrite(h,d);return void i.catch((d=>(queueMicrotask((()=>{throw d})),Promise.resolve(!1)))).then(s)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-h>=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()}}n.WriteBuffer=l},5941:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const a=/^([\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})$/,c=/^[\da-f]+$/;function f(l,u){const p=l.toString(16),m=p.length<2?"0"+p:p;switch(u){case 4:return p[0];case 8:return m;case 12:return(m+m).slice(0,3);default:return m+m}}n.parseColor=function(l){if(!l)return;let u=l.toLowerCase();if(u.indexOf("rgb:")===0){u=u.slice(4);const p=a.exec(u);if(p){const m=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/m*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/m*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/m*255)]}}else if(u.indexOf("#")===0&&(u=u.slice(1),c.exec(u)&&[3,6,9,12].includes(u.length))){const p=u.length/3,m=[0,0,0];for(let h=0;h<3;++h){const t=parseInt(u.slice(p*h,p*h+p),16);m[h]=p===1?t<<4:p===2?t:p===3?t>>4:t>>8}return m}},n.toRgbString=function(l,u=16){const[p,m,h]=l;return`rgb:${f(p,u)}/${f(m,u)}/${f(h,u)}`}},5770:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const c=a(482),f=a(8742),l=a(5770),u=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=u,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}registerHandler(m,h){this._handlers[m]===void 0&&(this._handlers[m]=[]);const t=this._handlers[m];return t.push(h),{dispose:()=>{const i=t.indexOf(h);i!==-1&&t.splice(i,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=u,this._ident=0}hook(m,h){if(this.reset(),this._ident=m,this._active=this._handlers[m]||u,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(m,h,t){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(m,h,t);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(m,h,t))}unhook(m,h=!0){if(this._active.length){let t=!1,i=this._active.length-1,e=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,t=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;i>=0&&(t=this._active[i].unhook(m),t!==!0);i--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,t;i--}for(;i>=0;i--)if(t=this._active[i].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",m);this._active=u,this._ident=0}};const p=new f.Params;p.addParam(0),n.DcsHandler=class{constructor(m){this._handler=m,this._data="",this._params=p,this._hitLimit=!1}hook(m){this._params=m.length>1||m.params[0]?m.clone():p,this._data="",this._hitLimit=!1}put(m,h,t){this._hitLimit||(this._data+=(0,c.utf32ToString)(m,h,t),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(m){let h=!1;if(this._hitLimit)h=!1;else if(m&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then((t=>(this._params=p,this._data="",this._hitLimit=!1,t)));return this._params=p,this._data="",this._hitLimit=!1,h}}},2015:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const c=a(844),f=a(8742),l=a(6242),u=a(6351);class p{constructor(i){this.table=new Uint8Array(i)}setDefault(i,e){this.table.fill(i<<4|e)}add(i,e,s,d){this.table[e<<8|i]=s<<4|d}addMany(i,e,s,d){for(let g=0;g<i.length;g++)this.table[e<<8|i[g]]=s<<4|d}}n.TransitionTable=p;const m=160;n.VT500_TRANSITION_TABLE=(function(){const t=new p(4095),i=Array.apply(null,Array(256)).map(((C,v)=>v)),e=(C,v)=>i.slice(C,v),s=e(32,127),d=e(0,24);d.push(25),d.push.apply(d,e(28,32));const g=e(0,14);let S;for(S in t.setDefault(1,0),t.addMany(s,0,2,0),g)t.addMany([24,26,153,154],S,3,0),t.addMany(e(128,144),S,3,0),t.addMany(e(144,152),S,3,0),t.add(156,S,0,0),t.add(27,S,11,1),t.add(157,S,4,8),t.addMany([152,158,159],S,0,7),t.add(155,S,11,3),t.add(144,S,11,9);return t.addMany(d,0,3,0),t.addMany(d,1,3,1),t.add(127,1,0,1),t.addMany(d,8,0,8),t.addMany(d,3,3,3),t.add(127,3,0,3),t.addMany(d,4,3,4),t.add(127,4,0,4),t.addMany(d,6,3,6),t.addMany(d,5,3,5),t.add(127,5,0,5),t.addMany(d,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(s,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(s,7,0,7),t.addMany(d,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(d,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(d,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(d,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(d,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(d,13,13,13),t.addMany(s,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(m,0,2,0),t.add(m,8,5,8),t.add(m,6,0,6),t.add(m,11,0,11),t.add(m,13,13,13),t})();class h extends c.Disposable{constructor(i=n.VT500_TRANSITION_TABLE){super(),this._transitions=i,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=(e,s,d)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,s)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new u.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(i,e=[64,126]){let s=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=i.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let g=0;g<i.intermediates.length;++g){const S=i.intermediates.charCodeAt(g);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=S}}if(i.final.length!==1)throw new Error("final must be a single byte");const d=i.final.charCodeAt(0);if(e[0]>d||d>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return s<<=8,s|=d,s}identToString(i){const e=[];for(;i;)e.push(String.fromCharCode(255&i)),i>>=8;return e.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,e){const s=this._identifier(i,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const d=this._escHandlers[s];return d.push(e),{dispose:()=>{const g=d.indexOf(e);g!==-1&&d.splice(g,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,e){this._executeHandlers[i.charCodeAt(0)]=e}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,e){const s=this._identifier(i);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const d=this._csiHandlers[s];return d.push(e),{dispose:()=>{const g=d.indexOf(e);g!==-1&&d.splice(g,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,e){return this._dcsParser.registerHandler(this._identifier(i),e)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,e){return this._oscParser.registerHandler(i,e)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}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(i,e,s,d,g){this._parseStack.state=i,this._parseStack.handlers=e,this._parseStack.handlerPos=s,this._parseStack.transition=d,this._parseStack.chunkPos=g}parse(i,e,s){let d,g=0,S=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&x>-1){for(;x>=0&&(d=v[x](this._params),d!==!0);x--)if(d instanceof Promise)return this._parseStack.handlerPos=x,d}this._parseStack.handlers=[];break;case 4:if(s===!1&&x>-1){for(;x>=0&&(d=v[x](),d!==!0);x--)if(d instanceof Promise)return this._parseStack.handlerPos=x,d}this._parseStack.handlers=[];break;case 6:if(g=i[this._parseStack.chunkPos],d=this._dcsParser.unhook(g!==24&&g!==26,s),d)return d;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(g=i[this._parseStack.chunkPos],d=this._oscParser.end(g!==24&&g!==26,s),d)return d;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=C;v<e;++v){switch(g=i[v],S=this._transitions.table[this.currentState<<8|(g<160?g:m)],S>>4){case 2:for(let T=v+1;;++T){if(T>=e||(g=i[T])<32||g>126&&g<m){this._printHandler(i,v,T),v=T-1;break}if(++T>=e||(g=i[T])<32||g>126&&g<m){this._printHandler(i,v,T),v=T-1;break}if(++T>=e||(g=i[T])<32||g>126&&g<m){this._printHandler(i,v,T),v=T-1;break}if(++T>=e||(g=i[T])<32||g>126&&g<m){this._printHandler(i,v,T),v=T-1;break}}break;case 3:this._executeHandlers[g]?this._executeHandlers[g]():this._executeHandlerFb(g),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:g,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|g];let M=x?x.length-1:-1;for(;M>=0&&(d=x[M](this._params),d!==!0);M--)if(d instanceof Promise)return this._preserveStack(3,x,M,S,v),d;M<0&&this._csiHandlerFb(this._collect<<8|g,this._params),this.precedingJoinState=0;break;case 8:do switch(g){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(g-48)}while(++v<e&&(g=i[v])>47&&g<60);v--;break;case 9:this._collect<<=8,this._collect|=g;break;case 10:const O=this._escHandlers[this._collect<<8|g];let P=O?O.length-1:-1;for(;P>=0&&(d=O[P](),d!==!0);P--)if(d instanceof Promise)return this._preserveStack(4,O,P,S,v),d;P<0&&this._escHandlerFb(this._collect<<8|g),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|g,this._params);break;case 13:for(let T=v+1;;++T)if(T>=e||(g=i[T])===24||g===26||g===27||g>127&&g<m){this._dcsParser.put(i,v,T),v=T-1;break}break;case 14:if(d=this._dcsParser.unhook(g!==24&&g!==26),d)return this._preserveStack(6,[],0,S,v),d;g===27&&(S|=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 T=v+1;;T++)if(T>=e||(g=i[T])<32||g>127&&g<m){this._oscParser.put(i,v,T),v=T-1;break}break;case 6:if(d=this._oscParser.end(g!==24&&g!==26),d)return this._preserveStack(5,[],0,S,v),d;g===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}n.EscapeSequenceParser=h},6242:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const c=a(5770),f=a(482),l=[];n.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(u,p){this._handlers[u]===void 0&&(this._handlers[u]=[]);const m=this._handlers[u];return m.push(p),{dispose:()=>{const h=m.indexOf(p);h!==-1&&m.splice(h,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")}_put(u,p,m){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(u,p,m);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(u,p,m))}start(){this.reset(),this._state=1}put(u,p,m){if(this._state!==3){if(this._state===1)for(;p<m;){const h=u[p++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&m-p>0&&this._put(u,p,m)}}end(u,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let m=!1,h=this._active.length-1,t=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,m=p,t=this._stack.fallThrough,this._stack.paused=!1),!t&&m===!1){for(;h>=0&&(m=this._active[h].end(u),m!==!0);h--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,m;h--}for(;h>=0;h--)if(m=this._active[h].end(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,m}else this._handlerFb(this._id,"END",u);this._active=l,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(u){this._handler=u,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(u,p,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(u,p,m),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(u){let p=!1;if(this._hitLimit)p=!1;else if(u&&(p=this._handler(this._data),p instanceof Promise))return p.then((m=>(this._data="",this._hitLimit=!1,m)));return this._data="",this._hitLimit=!1,p}}},8742:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class c{static fromArray(l){const u=new c;if(!l.length)return u;for(let p=Array.isArray(l[0])?1:0;p<l.length;++p){const m=l[p];if(Array.isArray(m))for(let h=0;h<m.length;++h)u.addSubParam(m[h]);else u.addParam(m)}return u}constructor(l=32,u=32){if(this.maxLength=l,this.maxSubParamsLength=u,u>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(u),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new c(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let u=0;u<this.length;++u){l.push(this.params[u]);const p=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];m-p>0&&l.push(Array.prototype.slice.call(this._subParams,p,m))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>a?a:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>a?a:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const u=this._subParamsIdx[l]>>8,p=255&this._subParamsIdx[l];return p-u>0?this._subParams.subarray(u,p):null}getSubParamsAll(){const l={};for(let u=0;u<this.length;++u){const p=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];m-p>0&&(l[u]=this._subParams.slice(p,m))}return l}addDigit(l){let u;if(this._rejectDigits||!(u=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,m=p[u-1];p[u-1]=~m?Math.min(10*m+l,a):l}}n.Params=c},5741:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const f={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(f),c.dispose=()=>this._wrappedAddonDispose(f),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===a){c=f;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const c=a(3785),f=a(511);n.BufferApiView=class{constructor(l,u){this._buffer=l,this.type=u}init(l){return this._buffer=l,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(l){const u=this._buffer.lines.get(l);if(u)return new c.BufferLineApiView(u)}getNullCell(){return new f.CellData}}},3785:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const c=a(511);n.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,l){if(!(f<0||f>=this._line.length))return l?(this._line.loadCell(f,l),l):this._line.loadCell(f,new c.CellData)}translateToString(f,l,u){return this._line.translateToString(f,l,u)}}},8285:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const c=a(8771),f=a(8460),l=a(844);class u extends l.Disposable{constructor(m){super(),this._core=m,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}n.BufferNamespaceApi=u},7975:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(f=>c(f.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((f,l)=>c(f,l.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(E,n,a){var c=this&&this.__decorate||function(t,i,e,s){var d,g=arguments.length,S=g<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,i,e,s);else for(var C=t.length-1;C>=0;C--)(d=t[C])&&(S=(g<3?d(S):g>3?d(i,e,S):d(i,e))||S);return g>3&&S&&Object.defineProperty(i,e,S),S},f=this&&this.__param||function(t,i){return function(e,s){i(e,s,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const l=a(8460),u=a(844),p=a(5295),m=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let h=n.BufferService=class extends u.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(t,this))}resize(t,i){this.cols=t,this.rows=i,this.buffers.resize(t,i),this._onResize.fire({cols:t,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,i=!1){const e=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===t.fg&&s.getBg(0)===t.bg||(s=e.getBlankLine(t,i),this._cachedBlankLine=s),s.isWrapped=i;const d=e.ybase+e.scrollTop,g=e.ybase+e.scrollBottom;if(e.scrollTop===0){const S=e.lines.isFull;g===e.lines.length-1?S?e.lines.recycle().copyFrom(s):e.lines.push(s.clone()):e.lines.splice(g+1,0,s.clone()),S?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const S=g-d+1;e.lines.shiftElements(d+1,S-1,-1),e.lines.set(g,s.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,i,e){const s=this.buffer;if(t<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else t+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const d=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+t,s.ybase),0),d!==s.ydisp&&(i||this._onScroll.fire(s.ydisp))}};n.BufferService=h=c([f(0,m.IOptionsService)],h)},7994:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(E,n,a){var c=this&&this.__decorate||function(s,d,g,S){var C,v=arguments.length,x=v<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(s,d,g,S);else for(var M=s.length-1;M>=0;M--)(C=s[M])&&(x=(v<3?C(x):v>3?C(d,g,x):C(d,g))||x);return v>3&&x&&Object.defineProperty(d,g,x),x},f=this&&this.__param||function(s,d){return function(g,S){d(g,S,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const l=a(2585),u=a(8460),p=a(844),m={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function h(s,d){let g=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(g|=64,g|=s.action):(g|=3&s.button,4&s.button&&(g|=64),8&s.button&&(g|=128),s.action===32?g|=32:s.action!==0||d||(g|=3)),g}const t=String.fromCharCode,i={DEFAULT:s=>{const d=[h(s,!1)+32,s.col+32,s.row+32];return d[0]>255||d[1]>255||d[2]>255?"":`\x1B[M${t(d[0])}${t(d[1])}${t(d[2])}`},SGR:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${h(s,!0)};${s.col};${s.row}${d}`},SGR_PIXELS:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${h(s,!0)};${s.x};${s.y}${d}`}};let e=n.CoreMouseService=class extends p.Disposable{constructor(s,d){super(),this._bufferService=s,this._coreService=d,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new u.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const g of Object.keys(m))this.addProtocol(g,m[g]);for(const g of Object.keys(i))this.addEncoding(g,i[g]);this.reset()}addProtocol(s,d){this._protocols[s]=d}addEncoding(s,d){this._encodings[s]=d}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const d=this._encodings[this._activeEncoding](s);return d&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(d):this._coreService.triggerDataEvent(d,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,d,g){if(g){if(s.x!==d.x||s.y!==d.y)return!1}else if(s.col!==d.col||s.row!==d.row)return!1;return s.button===d.button&&s.action===d.action&&s.ctrl===d.ctrl&&s.alt===d.alt&&s.shift===d.shift}};n.CoreMouseService=e=c([f(0,l.IBufferService),f(1,l.ICoreService)],e)},6975:function(E,n,a){var c=this&&this.__decorate||function(e,s,d,g){var S,C=arguments.length,v=C<3?s:g===null?g=Object.getOwnPropertyDescriptor(s,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,d,g);else for(var x=e.length-1;x>=0;x--)(S=e[x])&&(v=(C<3?S(v):C>3?S(s,d,v):S(s,d))||v);return C>3&&v&&Object.defineProperty(s,d,v),v},f=this&&this.__param||function(e,s){return function(d,g){s(d,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const l=a(1439),u=a(8460),p=a(844),m=a(2585),h=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=n.CoreService=class extends p.Disposable{constructor(e,s,d){super(),this._bufferService=e,this._logService=s,this._optionsService=d,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new u.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new u.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(h),this.decPrivateModes=(0,l.clone)(t)}reset(){this.modes=(0,l.clone)(h),this.decPrivateModes=(0,l.clone)(t)}triggerDataEvent(e,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const d=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&d.ybase!==d.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((g=>g.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((s=>s.charCodeAt(0))))),this._onBinary.fire(e))}};n.CoreService=i=c([f(0,m.IBufferService),f(1,m.ILogService),f(2,m.IOptionsService)],i)},9074:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const c=a(8055),f=a(8460),l=a(844),u=a(6106);let p=0,m=0;class h extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new u.SortedList((e=>e==null?void 0:e.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,l.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const s=new t(e);if(s){const d=s.marker.onDispose((()=>s.dispose()));s.onDispose((()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),d.dispose())})),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,s,d){let g=0,S=0;for(const C of this._decorations.getKeyIterator(s))g=C.options.x??0,S=g+(C.options.width??1),e>=g&&e<S&&(!d||(C.options.layer??"bottom")===d)&&(yield C)}forEachDecorationAtCell(e,s,d,g){this._decorations.forEachByKey(s,(S=>{p=S.options.x??0,m=p+(S.options.width??1),e>=p&&e<m&&(!d||(S.options.layer??"bottom")===d)&&g(S)}))}}n.DecorationService=h;class t extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,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=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const c=a(2585),f=a(8343);class l{constructor(...p){this._entries=new Map;for(const[m,h]of p)this.set(m,h)}set(p,m){const h=this._entries.get(p);return this._entries.set(p,m),h}forEach(p){for(const[m,h]of this._entries.entries())p(m,h)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}n.ServiceCollection=l,n.InstantiationService=class{constructor(){this._services=new l,this._services.set(c.IInstantiationService,this)}setService(u,p){this._services.set(u,p)}getService(u){return this._services.get(u)}createInstance(u,...p){const m=(0,f.getServiceDependencies)(u).sort(((i,e)=>i.index-e.index)),h=[];for(const i of m){const e=this._services.get(i.id);if(!e)throw new Error(`[createInstance] ${u.name} depends on UNKNOWN service ${i.id}.`);h.push(e)}const t=m.length>0?m[0].index:p.length;if(p.length!==t)throw new Error(`[createInstance] First service dependency of ${u.name} at position ${t+1} conflicts with ${p.length} static arguments`);return new u(...p,...h)}}},7866:function(E,n,a){var c=this&&this.__decorate||function(t,i,e,s){var d,g=arguments.length,S=g<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,i,e,s);else for(var C=t.length-1;C>=0;C--)(d=t[C])&&(S=(g<3?d(S):g>3?d(i,e,S):d(i,e))||S);return g>3&&S&&Object.defineProperty(i,e,S),S},f=this&&this.__param||function(t,i){return function(e,s){i(e,s,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const l=a(844),u=a(2585),p={trace:u.LogLevelEnum.TRACE,debug:u.LogLevelEnum.DEBUG,info:u.LogLevelEnum.INFO,warn:u.LogLevelEnum.WARN,error:u.LogLevelEnum.ERROR,off:u.LogLevelEnum.OFF};let m,h=n.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=u.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),m=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let i=0;i<t.length;i++)typeof t[i]=="function"&&(t[i]=t[i]())}_log(t,i,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...e)}trace(t,...i){var e;this._logLevel<=u.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,t,i)}debug(t,...i){var e;this._logLevel<=u.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,t,i)}info(t,...i){var e;this._logLevel<=u.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,t,i)}warn(t,...i){var e;this._logLevel<=u.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,t,i)}error(t,...i){var e;this._logLevel<=u.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,t,i)}};n.LogService=h=c([f(0,u.IOptionsService)],h),n.setTraceLogger=function(t){m=t},n.traceCall=function(t,i,e){if(typeof e.value!="function")throw new Error("not supported");const s=e.value;e.value=function(...d){if(m.logLevel!==u.LogLevelEnum.TRACE)return s.apply(this,d);m.trace(`GlyphRenderer#${s.name}(${d.map((S=>JSON.stringify(S))).join(", ")})`);const g=s.apply(this,d);return m.trace(`GlyphRenderer#${s.name} return`,g),g}}},7302:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const c=a(8460),f=a(844),l=a(6114);n.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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const u=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends f.Disposable{constructor(h){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...n.DEFAULT_OPTIONS};for(const i in h)if(i in t)try{const e=h[i];t[i]=this._sanitizeAndValidateOption(i,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(h,t){return this.onOptionChange((i=>{i===h&&t(this.rawOptions[h])}))}onMultipleOptionChange(h,t){return this.onOptionChange((i=>{h.indexOf(i)!==-1&&t()}))}_setupOptions(){const h=i=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,e)=>{if(!(i in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);e=this._sanitizeAndValidateOption(i,e),this.rawOptions[i]!==e&&(this.rawOptions[i]=e,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const e={get:h.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,e)}}_sanitizeAndValidateOption(h,t){switch(h){case"cursorStyle":if(t||(t=n.DEFAULT_OPTIONS[h]),!(function(i){return i==="block"||i==="underline"||i==="bar"})(t))throw new Error(`"${t}" is not a valid value for ${h}`);break;case"wordSeparator":t||(t=n.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=u.includes(t)?t:n.DEFAULT_OPTIONS[h];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${h} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${h} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}n.OptionsService=p},2660:function(E,n,a){var c=this&&this.__decorate||function(p,m,h,t){var i,e=arguments.length,s=e<3?m:t===null?t=Object.getOwnPropertyDescriptor(m,h):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(p,m,h,t);else for(var d=p.length-1;d>=0;d--)(i=p[d])&&(s=(e<3?i(s):e>3?i(m,h,s):i(m,h))||s);return e>3&&s&&Object.defineProperty(m,h,s),s},f=this&&this.__param||function(p,m){return function(h,t){m(h,t,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const l=a(2585);let u=n.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const m=this._bufferService.buffer;if(p.id===void 0){const d=m.addMarker(m.ybase+m.y),g={data:p,id:this._nextId++,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(g,d))),this._dataByLinkId.set(g.id,g),g.id}const h=p,t=this._getEntryIdKey(h),i=this._entriesWithId.get(t);if(i)return this.addLineToLink(i.id,m.ybase+m.y),i.id;const e=m.addMarker(m.ybase+m.y),s={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(s,e))),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(p,m){const h=this._dataByLinkId.get(p);if(h&&h.lines.every((t=>t.line!==m))){const t=this._bufferService.buffer.addMarker(m);h.lines.push(t),t.onDispose((()=>this._removeMarkerFromLink(h,t)))}}getLinkData(p){var m;return(m=this._dataByLinkId.get(p))==null?void 0:m.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,m){const h=p.lines.indexOf(m);h!==-1&&(p.lines.splice(h,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};n.OscLinkService=u=c([f(0,l.IBufferService)],u)},8343:(E,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",c="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(f){return f[c]||[]},n.createDecorator=function(f){if(n.serviceRegistry.has(f))return n.serviceRegistry.get(f);const l=function(u,p,m){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,t,i){t[a]===t?t[c].push({id:h,index:i}):(t[c]=[{id:h,index:i}],t[a]=t)})(l,u,m)};return l.toString=()=>f,n.serviceRegistry.set(f,l),l}},2585:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const c=a(8343);var f;n.IBufferService=(0,c.createDecorator)("BufferService"),n.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),n.ICoreService=(0,c.createDecorator)("CoreService"),n.ICharsetService=(0,c.createDecorator)("CharsetService"),n.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(f||(n.LogLevelEnum=f={})),n.ILogService=(0,c.createDecorator)("LogService"),n.IOptionsService=(0,c.createDecorator)("OptionsService"),n.IOscLinkService=(0,c.createDecorator)("OscLinkService"),n.IUnicodeService=(0,c.createDecorator)("UnicodeService"),n.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(E,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const c=a(8460),f=a(225);class l{static extractShouldJoin(p){return(1&p)!=0}static extractWidth(p){return p>>1&3}static extractCharKind(p){return p>>3}static createPropertyValue(p,m,h=!1){return(16777215&p)<<3|(3&m)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const p=new f.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let m=0,h=0;const t=p.length;for(let i=0;i<t;++i){let e=p.charCodeAt(i);if(55296<=e&&e<=56319){if(++i>=t)return m+this.wcwidth(e);const g=p.charCodeAt(i);56320<=g&&g<=57343?e=1024*(e-55296)+g-56320+65536:m+=this.wcwidth(g)}const s=this.charProperties(e,h);let d=l.extractWidth(s);l.extractShouldJoin(s)&&(d-=l.extractWidth(h)),m+=d,h=s}return m}charProperties(p,m){return this._activeProvider.charProperties(p,m)}}n.UnicodeService=l}},w={};function b(E){var n=w[E];if(n!==void 0)return n.exports;var a=w[E]={exports:{}};return _[E].call(a.exports,a,a.exports,b),a.exports}var k={};return(()=>{var E=k;Object.defineProperty(E,"__esModule",{value:!0}),E.Terminal=void 0;const n=b(9042),a=b(3236),c=b(844),f=b(5741),l=b(8285),u=b(7975),p=b(7090),m=["cols","rows"];class h extends c.Disposable{constructor(i){super(),this._core=this.register(new a.Terminal(i)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const e=d=>this._core.options[d],s=(d,g)=>{this._checkReadonlyOptions(d),this._core.options[d]=g};for(const d in this._core.options){const g={get:e.bind(this,d),set:s.bind(this,d)};Object.defineProperty(this._publicOptions,d,g)}}_checkReadonlyOptions(i){if(m.includes(i))throw new Error(`Option "${i}" 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 u.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new p.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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const e in i)this._publicOptions[e]=i[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(i,e=!0){this._core.input(i,e)}resize(i,e){this._verifyIntegers(i,e),this._core.resize(i,e)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}attachCustomWheelEventHandler(i){this._core.attachCustomWheelEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){return this._checkProposedApi(),this._verifyPositiveIntegers(i.x??0,i.width??0,i.height??0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,e,s){this._verifyIntegers(i,e,s),this._core.select(i,e,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,e){this._verifyIntegers(i,e),this._core.selectLines(i,e)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,e){this._core.write(i,e)}writeln(i,e){this._core.write(i),this._core.write(`\r
|
|
10
|
+
`,e)}paste(i){this._core.paste(i)}refresh(i,e){this._verifyIntegers(i,e),this._core.refresh(i,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(i){this._addonManager.loadAddon(this,i)}static get strings(){return n}_verifyIntegers(...i){for(const e of i)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...i){for(const e of i)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}E.Terminal=h})(),k})()))})(Oi)),Oi.exports}var ac=oc(),Pi={exports:{}},Ks;function lc(){return Ks||(Ks=1,(function(r,o){(function(_,w){r.exports=w()})(self,(()=>(()=>{var _={};return(()=>{var w=_;Object.defineProperty(w,"__esModule",{value:!0}),w.FitAddon=void 0,w.FitAddon=class{activate(b){this._terminal=b}dispose(){}fit(){const b=this.proposeDimensions();if(!b||!this._terminal||isNaN(b.cols)||isNaN(b.rows))return;const k=this._terminal._core;this._terminal.rows===b.rows&&this._terminal.cols===b.cols||(k._renderService.clear(),this._terminal.resize(b.cols,b.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const b=this._terminal._core,k=b._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const E=this._terminal.options.scrollback===0?0:b.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),c=Math.max(0,parseInt(n.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),l=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),u=c-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-E;return{cols:Math.max(2,Math.floor(u/k.css.cell.width)),rows:Math.max(1,Math.floor(l/k.css.cell.height))}}}})(),_})()))})(Pi)),Pi.exports}var cc=lc(),Ii={exports:{}},qs;function hc(){return qs||(qs=1,(function(r,o){(function(_,w){r.exports=w()})(self,(()=>(()=>{var _={6:(E,n)=>{function a(f){try{const l=new URL(f),u=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return f.toLocaleLowerCase().startsWith(u.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(f,l,u,p={}){this._terminal=f,this._regex=l,this._handler=u,this._options=p}provideLinks(f,l){const u=c.computeLink(f,this._regex,this._terminal,this._handler);l(this._addCallbacks(u))}_addCallbacks(f){return f.map((l=>(l.leave=this._options.leave,l.hover=(u,p)=>{if(this._options.hover){const{range:m}=l;this._options.hover(u,p,m)}},l)))}};class c{static computeLink(l,u,p,m){const h=new RegExp(u.source,(u.flags||"")+"g"),[t,i]=c._getWindowedLineStrings(l-1,p),e=t.join("");let s;const d=[];for(;s=h.exec(e);){const g=s[0];if(!a(g))continue;const[S,C]=c._mapStrIdx(p,i,0,s.index),[v,x]=c._mapStrIdx(p,S,C,g.length);if(S===-1||C===-1||v===-1||x===-1)continue;const M={start:{x:C+1,y:S+1},end:{x,y:v+1}};d.push({range:M,text:g,activate:m})}return d}static _getWindowedLineStrings(l,u){let p,m=l,h=l,t=0,i="";const e=[];if(p=u.buffer.active.getLine(l)){const s=p.translateToString(!0);if(p.isWrapped&&s[0]!==" "){for(t=0;(p=u.buffer.active.getLine(--m))&&t<2048&&(i=p.translateToString(!0),t+=i.length,e.push(i),p.isWrapped&&i.indexOf(" ")===-1););e.reverse()}for(e.push(s),t=0;(p=u.buffer.active.getLine(++h))&&p.isWrapped&&t<2048&&(i=p.translateToString(!0),t+=i.length,e.push(i),i.indexOf(" ")===-1););}return[e,m]}static _mapStrIdx(l,u,p,m){const h=l.buffer.active,t=h.getNullCell();let i=p;for(;m;){const e=h.getLine(u);if(!e)return[-1,-1];for(let s=i;s<e.length;++s){e.getCell(s,t);const d=t.getChars();if(t.getWidth()&&(m-=d.length||1,s===e.length-1&&d==="")){const g=h.getLine(u+1);g&&g.isWrapped&&(g.getCell(0,t),t.getWidth()===2&&(m+=1))}if(m<0)return[u,s]}u++,i=0}return[u,i]}}n.LinkComputer=c}},w={};function b(E){var n=w[E];if(n!==void 0)return n.exports;var a=w[E]={exports:{}};return _[E](a,a.exports,b),a.exports}var k={};return(()=>{var E=k;Object.defineProperty(E,"__esModule",{value:!0}),E.WebLinksAddon=void 0;const n=b(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(f,l){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}E.WebLinksAddon=class{constructor(f=c,l={}){this._handler=f,this._options=l}activate(f){this._terminal=f;const l=this._options,u=l.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,u,this._handler,l))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),k})()))})(Ii)),Ii.exports}var uc=hc(),dc=ee('<div class="flex-1 min-h-0 w-full p-1 overflow-hidden"></div>');function fc(r,o){De(o,!0);let _=ye(o,"isMobile",3,!1),w,b,k,E,n,a;function c(m){var t;if((t=navigator.clipboard)!=null&&t.writeText){navigator.clipboard.writeText(m).catch(()=>{});return}const h=document.createElement("textarea");h.value=m,h.style.position="fixed",h.style.opacity="0",document.body.appendChild(h),h.select(),document.execCommand("copy"),document.body.removeChild(h)}function f(m){(E==null?void 0:E.readyState)===WebSocket.OPEN&&E.send(JSON.stringify({type:"selectPane",pane:m}))}function l(m){(E==null?void 0:E.readyState)===WebSocket.OPEN&&E.send(JSON.stringify({type:"input",data:m}))}ms(()=>{b=new ac.Terminal({cursorBlink:!0,theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"},fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:_()?13:11,scrollback:1e4}),k=new cc.FitAddon,b.loadAddon(k),b.loadAddon(new uc.WebLinksAddon),b.open(w),w.addEventListener("contextmenu",h=>h.preventDefault()),b.parser.registerOscHandler(52,h=>{const t=h.indexOf(";");if(t!==-1){const i=h.slice(t+1);try{c(atob(i))}catch{}}return!0}),b.onSelectionChange(()=>{const h=b.getSelection();h&&c(h)}),b.attachCustomKeyEventHandler(h=>{if(h.key==="Enter"&&h.shiftKey&&!h.ctrlKey&&!h.metaKey&&!h.altKey)return h.type==="keydown"&&E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(h.type!=="keydown")return!0;const t=h.metaKey||h.ctrlKey;return t&&(h.key==="c"||h.key==="C")?b.hasSelection()?(c(b.getSelection()),b.clearSelection(),!1):!0:!(t&&(h.key==="ArrowUp"||h.key==="ArrowDown")||t&&(h.key==="k"||h.key==="K")||t&&(h.key==="m"||h.key==="M")||t&&(h.key==="d"||h.key==="D"))}),requestAnimationFrame(()=>{k.fit(),b.focus()});const m=location.protocol==="https:"?"wss:":"ws:";E=new WebSocket(`${m}//${location.host}/ws/${encodeURIComponent(o.worktree)}`),E.onmessage=h=>{const t=h.data,i=t[0];if(i==="o"||i==="s"){b.write(t.slice(1));return}try{const e=JSON.parse(t);switch(e.type){case"exit":b.writeln(`\r
|
|
11
|
+
\x1B[33m[Process exited with code ${e.exitCode}]\x1B[0m`);break;case"error":b.writeln(`\r
|
|
12
|
+
\x1B[31m[Error: ${e.message}]\x1B[0m`);break}}catch{}},E.onopen=()=>{k.fit();const h={type:"resize",cols:b.cols,rows:b.rows};_()&&o.initialPane!==void 0&&(h.initialPane=o.initialPane),E.send(JSON.stringify(h))},E.onclose=()=>{b.writeln(`\r
|
|
13
|
+
\x1B[90m[Disconnected]\x1B[0m`)},b.onData(h=>{E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"input",data:h}))}),n=new ResizeObserver(()=>{clearTimeout(a),a=setTimeout(()=>{k.fit(),E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"resize",cols:b.cols,rows:b.rows}))},150)}),n.observe(w)}),Ja(()=>{clearTimeout(a),n==null||n.disconnect(),E==null||E.close(),b==null||b.dispose()});var u={sendSelectPane:f,sendInput:l},p=dc();return Ei(p,m=>w=m,()=>w),G(r,p),Re(u)}var _c=ee("<dialog><!></dialog>");function Ur(r,o){De(o,!0);let _=ye(o,"wide",3,!1),w;mr(()=>{w==null||w.showModal()});var b=_c(),k=X(b);gs(k,()=>o.children),Ei(b,E=>w=E,()=>w),oe(()=>Be(b,1,`bg-sidebar text-primary border border-edge rounded-xl p-6 w-[90%] ${_()?"max-w-[560px]":"max-w-[380px]"}`)),oi("close",b,function(...E){var n;(n=o.onclose)==null||n.apply(this,E)}),G(r,b),Re()}var vc=ee('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),pc=ee('<span class="spinner"></span>'),gc=ee("<!> ",1),mc=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 Vs(r,o){De(o,!0);let _=ye(o,"loading",3,!1),w=ye(o,"error",3,""),b=ye(o,"confirmLabel",3,"Remove"),k=ye(o,"variant",3,"danger");Ur(r,{get onclose(){return o.oncancel},children:(E,n)=>{var a=mc(),c=J(X(a),2),f=X(c),l=J(c,2);{var u=t=>{var i=vc(),e=X(i);oe(()=>se(e,w())),G(t,i)};ne(l,t=>{w()&&t(u)})}var p=J(l,2),m=X(p);ze(m,{type:"button",get onclick(){return o.oncancel},get disabled(){return _()},children:(t,i)=>{var e=Fe("Cancel");G(t,e)},$$slots:{default:!0}});var h=J(m,2);{let t=ve(()=>k()==="accent"?"cta":"danger");ze(h,{type:"submit",get variant(){return L(t)},class:"flex items-center gap-1.5",get disabled(){return _()},autofocus:!0,children:(i,e)=>{var s=gc(),d=Le(s);{var g=C=>{var v=pc();G(C,v)};ne(d,C=>{_()&&C(g)})}var S=J(d);oe(()=>se(S,` ${b()??""}`)),G(i,s)},$$slots:{default:!0}})}oe(()=>se(f,o.message)),oi("submit",a,t=>{t.preventDefault(),o.onconfirm()}),G(E,a)},$$slots:{default:!0}}),Re()}var Sc=ee('<div class="mb-4"><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>'),bc=ee('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),wc=ee('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),Cc=ee('<div class="flex flex-col gap-2 mb-6"></div>'),yc=ee('<span class="spinner"></span>'),xc=ee("<!> Create",1),Ec=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">(optional)</span></label> <textarea id="wt-prompt" rows="3" 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" placeholder="Describe the task for the agent..."></textarea></div> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-name">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" placeholder="auto-generated if empty"/></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 kc(r,o){De(o,!0);let _=ye(o,"loading",3,!1),w=ye(o,"profiles",19,()=>[]),b=ye(o,"initialBranch",3,""),k=ye(o,"initialPrompt",3,""),E=ye(o,"startupEnvs",19,()=>({}));const n=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}],a="wt-default-profile",c="wt-default-agent",f=localStorage.getItem(a),l=localStorage.getItem(c);let u=ve(()=>{var g;return f??((g=w()[0])==null?void 0:g.name)??"Full"}),p=ae(Ee(b())),m=ae(Ee(k())),h=ae(Ee(l??"claude")),t=ae(Ee(f??"Full")),i=ae(!1),e=Ee({...E()}),s=ve(()=>Object.keys(E()));function d(g){g.focus()}mr(()=>{w().some(g=>g.name===L(t))||V(t,L(u),!0)}),Ur(r,{get onclose(){return o.oncancel},children:(g,S)=>{var C=Ec(),v=J(X(C),2),x=J(X(v),2);rl(x,A=>d==null?void 0:d(A)),ii(()=>Gr(x,()=>L(m),A=>V(m,A)));var M=J(v,2),O=J(X(M),2),P=J(M,2);je(P,16,()=>L(s),A=>A,(A,B)=>{var U=Sc(),K=X(U),Q=X(K),te=J(K,2);oe(()=>{Ce(K,"for",`wt-env-${B??""}`),se(Q,B),Ce(te,"id",`wt-env-${B??""}`)}),Gr(te,()=>e[B],F=>e[B]=F),G(A,U)});var T=J(P,2);je(T,21,()=>n,Zr,(A,B)=>{var U=bc(),K=X(U),Q=J(K);oe(()=>{Be(U,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
14
|
+
${L(h)===L(B).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),Ws(K,L(B).value),rs(K,L(h)===L(B).value),se(Q,` ${L(B).label??""}`)}),me("change",K,()=>V(h,L(B).value,!0)),G(A,U)});var H=J(T,2);{var I=A=>{var B=Cc();je(B,21,w,Zr,(U,K)=>{var Q=wc(),te=X(Q),F=J(te);oe(()=>{Be(Q,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
15
|
+
${L(t)===L(K).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),Ws(te,L(K).name),rs(te,L(t)===L(K).name),se(F,` ${L(K).name??""}`)}),me("change",te,()=>V(t,L(K).name,!0)),G(U,Q)}),G(A,B)};ne(H,A=>{w().length>1&&A(I)})}var N=J(H,2),j=X(N),$=J(N,2),y=X($);ze(y,{type:"button",get onclick(){return o.oncancel},get disabled(){return _()},children:(A,B)=>{var U=Fe("Cancel");G(A,U)},$$slots:{default:!0}});var R=J(y,2);ze(R,{type:"submit",variant:"cta",class:"flex items-center gap-1.5",get disabled(){return _()},children:(A,B)=>{var U=xc(),K=Le(U);{var Q=te=>{var F=yc();G(te,F)};ne(K,te=>{_()&&te(Q)})}G(A,U)},$$slots:{default:!0}}),oi("submit",C,A=>{A.preventDefault(),L(i)?(localStorage.setItem(a,L(t)),localStorage.setItem(c,L(h))):(localStorage.removeItem(a),localStorage.removeItem(c));const B={};for(const[U,K]of Object.entries(e))K&&(B[U]=K);o.oncreate(L(p).trim(),L(t),L(h),L(m).trim(),B)}),me("keydown",x,A=>{var B;A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),(B=A.currentTarget.form)==null||B.requestSubmit())}),Gr(O,()=>L(p),A=>V(p,A)),fl(j,()=>L(i),A=>V(i,A)),G(g,C)},$$slots:{default:!0}}),Re()}St(["keydown","change"]);var Lc=ee('<form><h2 class="text-base mb-4">Settings</h2> <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 Dc(r,o){De(o,!0);let _=ae(Ee(localStorage.getItem(fi)??"")),w;mr(()=>{w==null||w.focus()});function b(){const k=L(_).trim();k?localStorage.setItem(fi,k):localStorage.removeItem(fi),o.onsave(k)}Ur(r,{get onclose(){return o.onclose},children:(k,E)=>{var n=Lc(),a=J(X(n),2),c=J(X(a),2);Ei(c,p=>w=p,()=>w);var f=J(a,2),l=X(f);ze(l,{type:"button",get onclick(){return o.onclose},children:(p,m)=>{var h=Fe("Cancel");G(p,h)},$$slots:{default:!0}});var u=J(l,2);ze(u,{type:"submit",variant:"cta",children:(p,m)=>{var h=Fe("Save");G(p,h)},$$slots:{default:!0}}),oi("submit",n,p=>{p.preventDefault(),b()}),Gr(c,()=>L(_),p=>V(_,p)),G(k,n)},$$slots:{default:!0}}),Re()}async function Ut(r,o){const _=await fetch(`/api/${r}`,{headers:{"Content-Type":"application/json"},...o}),w=await _.json();if(!_.ok)throw new Error(w.error||`HTTP ${_.status}`);return w}function Rc(){return Ut("config")}let Hi=null,Fi=null;async function Ac(){const r={};Hi&&(r["If-None-Match"]=Hi);const o=await fetch("/api/worktrees",{headers:r});if(o.status===304&&Fi)return Fi;if(!o.ok){const w=await o.json();throw new Error(w.error||`HTTP ${o.status}`)}const _=await o.json();return Hi=o.headers.get("etag"),Fi=_,_}function Tc(r,o,_,w,b){return Ut("worktrees",{method:"POST",body:JSON.stringify({...r?{branch:r}:{},profile:o,agent:_,...w?{prompt:w}:{},...b&&Object.keys(b).length>0?{envOverrides:b}:{}})})}function Bc(r){return Ut(`worktrees/${encodeURIComponent(r)}`,{method:"DELETE"})}function Gs(r){return Ut(`worktrees/${encodeURIComponent(r)}/open`,{method:"POST"})}function Mc(r){return Ut(`worktrees/${encodeURIComponent(r)}/merge`,{method:"POST"})}function Oc(){return Ut("linear/issues")}async function Pc(r){return(await Ut(`ci-logs/${r}`)).logs}async function to(r,o,_){await Ut(`worktrees/${encodeURIComponent(r)}/send`,{method:"POST",body:JSON.stringify({text:o,..._?{preamble:_}:{}})})}function Ic(r,o,_){const w=new EventSource("/api/notifications/stream");return w.addEventListener("initial",b=>{try{const k=JSON.parse(b.data);_==null||_(k)}catch{}}),w.addEventListener("notification",b=>{try{const k=JSON.parse(b.data);r(k)}catch{}}),w.addEventListener("dismiss",b=>{try{const{id:k}=JSON.parse(b.data);o(k)}catch{}}),()=>w.close()}async function Hc(r){await Ut(`notifications/${r}/dismiss`,{method:"POST"})}function Fc(r){return r.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function ro(r,o=3e4){const w=Fc(r).replace(/\r\n/g,`
|
|
16
|
+
`).replace(/\r/g,`
|
|
17
|
+
`).replace(/[^\x09\x0A\x20-\x7E]/g,"");return w.length>o?`[... truncated]
|
|
18
|
+
`+w.slice(-o):w}var Nc=ee("<button><!></button>");function is(r,o){let _=Jn(o,["$$slots","$$events","$$legacy","children"]);var w=Nc();Gn(w,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",..._}));var b=X(w);gs(b,()=>o.children),G(r,w)}var Wc=ee('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub ↗</a>'),Uc=ee('<div class="text-[12px] text-muted py-2">Loading logs...</div>'),jc=ee('<div class="text-[12px] text-danger py-2"> </div>'),zc=ee('<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>',1),$c=ee('<div class="text-[12px] text-danger py-1.5"> </div>'),Kc=ee('<div class="mt-2"><!> <!></div>'),qc=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>'),Vc=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 Gc(r,o){De(o,!0);let _=ae(null),w=ae(""),b=ae(!1),k=ae(""),E=ae(!1),n=ae(null),a=ae(""),c=ve(()=>Ss(o.pr));async function f(h){if(L(_)===h){V(_,null);return}V(_,h,!0),V(w,""),V(k,""),V(b,!0),V(E,!1),V(a,"");try{V(w,await Pc(h),!0)}catch(t){V(k,cr(t),!0)}finally{V(b,!1)}}async function l(h){if(!o.branch)return;V(a,""),V(n,L(_)??-1,!0);const t=["Fix the failing CI check.",`PR: ${L(c)}`,`Check: ${h}`,"","Logs:"].join(`
|
|
19
|
+
`)+`
|
|
20
|
+
`,i=ro(L(w));try{await to(o.branch,i,t),o.onfixsuccess()}catch(e){V(a,cr(e),!0)}finally{V(n,null)}}async function u(){await navigator.clipboard.writeText(L(w)),V(E,!0),setTimeout(()=>{V(E,!1)},2e3)}function p(h){return h==="success"?"✓":h==="failed"?"✗":h==="skipped"?"—":"○"}function m(h){return h==="success"?"text-success":h==="failed"?"text-danger":h==="pending"?"text-warning":"text-muted"}Ur(r,{get onclose(){return o.onclose},wide:!0,children:(h,t)=>{var i=Vc(),e=Le(i),s=X(e),d=J(e,2);je(d,21,()=>o.pr.ciChecks,C=>C.name+C.runId,(C,v)=>{var x=qc(),M=X(x),O=X(M),P=X(O),T=J(O,2),H=X(T),I=J(T,2),N=X(I),j=J(M,2),$=X(j);{var y=K=>{is(K,{onclick:()=>f(L(v).runId),children:(Q,te)=>{var F=Fe();oe(()=>se(F,L(_)===L(v).runId?"Hide logs":"View logs")),G(Q,F)},$$slots:{default:!0}})};ne($,K=>{L(v).status==="failed"&&L(v).runId&&K(y)})}var R=J($,2);{var A=K=>{var Q=Wc();oe(()=>Ce(Q,"href",L(v).url)),G(K,Q)};ne(R,K=>{L(v).url&&K(A)})}var B=J(j,2);{var U=K=>{var Q=Kc(),te=X(Q);{var F=Z=>{var le=Uc();G(Z,le)},D=Z=>{var le=jc(),_e=X(le);oe(()=>se(_e,L(k))),G(Z,le)},Y=Z=>{var le=zc(),_e=Le(le),Se=X(_e),Ae=J(_e,2),ce=X(Ae);is(ce,{onclick:u,children:(At,Tt)=>{var bt=Fe();oe(()=>se(bt,L(E)?"Copied!":"Copy logs")),G(At,bt)},$$slots:{default:!0}});var Rt=J(ce,2);{let At=ve(()=>!o.branch||!L(w)||L(b)||L(n)!==null);ze(Rt,{variant:"cta",small:!0,get disabled(){return L(At)},onclick:()=>l(L(v).name),children:(Tt,bt)=>{var Bt=Fe();oe(()=>se(Bt,L(n)!==null?"Asking agent...":"Ask agent to fix")),G(Tt,Bt)},$$slots:{default:!0}})}oe(()=>se(Se,L(w))),G(Z,le)};ne(te,Z=>{L(b)?Z(F):L(k)?Z(D,1):L(w)&&Z(Y,2)})}var z=J(te,2);{var re=Z=>{var le=$c(),_e=X(le);oe(()=>se(_e,L(a))),G(Z,le)};ne(z,Z=>{L(a)&&Z(re)})}G(K,Q)};ne(B,K=>{L(_)===L(v).runId&&K(U)})}oe((K,Q,te)=>{Be(O,1,`text-sm font-bold ${K??""}`),se(P,Q),se(H,L(v).name),Be(I,1,`text-[11px] ${te??""}`),se(N,L(v).status)},[()=>m(L(v).status),()=>p(L(v).status),()=>m(L(v).status)]),G(C,x)});var g=J(d,2),S=X(g);ze(S,{type:"button",get onclick(){return o.onclose},children:(C,v)=>{var x=Fe("Close");G(C,x)},$$slots:{default:!0}}),oe(()=>se(s,`CI Checks — ${L(c)??""}`)),G(h,i)},$$slots:{default:!0}}),Re()}var Xc=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],Jc=["difference","intersection","symmetricDifference","union"],Xs=!1,Ar,_t,Vt,pi,Hr,io,so;const gi=class gi extends Set{constructor(_){super();he(this,Hr);he(this,Ar,new Map);he(this,_t,ae(0));he(this,Vt,ae(0));he(this,pi,Nt||-1);if(_){for(var w of _)super.add(w);W(this,Vt).v=super.size}Xs||xe(this,Hr,so).call(this)}has(_){var w=super.has(_),b=W(this,Ar),k=b.get(_);if(k===void 0){if(!w)return L(W(this,_t)),!1;k=xe(this,Hr,io).call(this,!0),b.set(_,k)}return L(k),w}add(_){return super.has(_)||(super.add(_),V(W(this,Vt),super.size),Zt(W(this,_t))),this}delete(_){var w=super.delete(_),b=W(this,Ar),k=b.get(_);return k!==void 0&&(b.delete(_),V(k,!1)),w&&(V(W(this,Vt),super.size),Zt(W(this,_t))),w}clear(){if(super.size!==0){super.clear();var _=W(this,Ar);for(var w of _.values())V(w,!1);_.clear(),V(W(this,Vt),0),Zt(W(this,_t))}}keys(){return this.values()}values(){return L(W(this,_t)),super.values()}entries(){return L(W(this,_t)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return L(W(this,Vt))}};Ar=new WeakMap,_t=new WeakMap,Vt=new WeakMap,pi=new WeakMap,Hr=new WeakSet,io=function(_){return Nt===W(this,pi)?ae(_):Qt(_)},so=function(){Xs=!0;var _=gi.prototype,w=Set.prototype;for(const b of Xc)_[b]=function(...k){return L(W(this,_t)),w[b].apply(this,k)};for(const b of Jc)_[b]=function(...k){L(W(this,_t));var E=w[b].apply(this,k);return new gi(E)}};let ss=gi;var Yc=ee('<span class="text-muted ml-1">(reply)</span>'),Zc=ee('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),Qc=ee('<span class="text-accent/60 ml-1">review</span>'),eh=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>'),th=ee('<div class="text-[12px] text-danger mb-3"> </div>'),rh=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 ih(r,o){De(o,!0);let _=ae(!1),w=ae("");const b=new ss;mr(()=>{const u=o.pr.comments.length;Wt(()=>{b.clear();for(let p=0;p<u;p++)b.add(p)})});let k=ve(()=>Ss(o.pr)),E=ve(()=>b.size===o.pr.comments.length),n=ve(()=>b.size===0);function a(){if(L(E))b.clear();else for(let u=0;u<o.pr.comments.length;u++)b.add(u)}function c(u){b.has(u)?b.delete(u):b.add(u)}function f(u,p){if(u.type==="inline"){const m=u.line?`${u.path}:${u.line}`:u.path,h=u.diffHunk?`
|
|
21
|
+
\`\`\`diff
|
|
22
|
+
${u.diffHunk}
|
|
23
|
+
\`\`\`
|
|
24
|
+
`:`
|
|
25
|
+
`;return`[${p}] @${u.author} (${u.createdAt.slice(0,10)}) on ${m}:${h}${u.body}`}return`[${p}] @${u.author} (${u.createdAt.slice(0,10)}):
|
|
26
|
+
${u.body}`}async function l(){if(!o.branch||L(n))return;V(_,!0),V(w,"");const u=["Review the PR comments (including inline review comments) and elaborate a plan to address them.",`PR: ${L(k)}`,"","Comments:"].join(`
|
|
27
|
+
`)+`
|
|
28
|
+
`,p=o.pr.comments.filter((m,h)=>b.has(h)).map((m,h)=>f(m,h+1)).join(`
|
|
29
|
+
|
|
30
|
+
`);try{await to(o.branch,ro(p,2e4),u),o.onsendsuccess()}catch(m){V(w,cr(m),!0)}finally{V(_,!1)}}Ur(r,{get onclose(){return o.onclose},wide:!0,children:(u,p)=>{var m=rh(),h=Le(m),t=X(h),i=J(h,2),e=X(i);is(e,{onclick:a,children:(O,P)=>{var T=Fe();oe(()=>se(T,L(E)?"Deselect all":"Select all")),G(O,T)},$$slots:{default:!0}});var s=J(e,2),d=X(s),g=J(i,2);je(g,21,()=>o.pr.comments,Zr,(O,P,T)=>{var H=eh(),I=X(H),N=X(I),j=J(N,2),$=X(j);{var y=D=>{var Y=Zc(),z=X(Y),re=J(z);{var Z=le=>{var _e=Yc();G(le,_e)};ne(re,le=>{L(P).isReply&&le(Z)})}oe(()=>{Ce(Y,"title",L(P).path),se(z,`${L(P).path??""}${L(P).line?`:${L(P).line}`:""} `)}),G(D,Y)};ne($,D=>{L(P).type==="inline"&&D(y)})}var R=J($,2),A=X(R),B=X(A),U=J(A),K=J(U);{var Q=D=>{var Y=Qc();G(D,Y)};ne(K,D=>{L(P).type==="inline"&&D(Q)})}var te=J(R,2),F=X(te);oe((D,Y)=>{rs(N,D),se(B,`@${L(P).author??""}`),se(U,` · ${Y??""} `),se(F,L(P).body)},[()=>b.has(T),()=>L(P).createdAt.slice(0,10)]),me("change",N,()=>c(T)),G(O,H)});var S=J(g,2);{var C=O=>{var P=th(),T=X(P);oe(()=>se(T,L(w))),G(O,P)};ne(S,O=>{L(w)&&O(C)})}var v=J(S,2),x=X(v);ze(x,{type:"button",get onclick(){return o.onclose},children:(O,P)=>{var T=Fe("Cancel");G(O,T)},$$slots:{default:!0}});var M=J(x,2);{let O=ve(()=>L(n)||L(_));ze(M,{variant:"cta",small:!0,get disabled(){return L(O)},onclick:l,children:(P,T)=>{var H=Fe();oe(()=>se(H,L(_)?"Sending...":`Send ${b.size} to agent`)),G(P,H)},$$slots:{default:!0}})}oe(()=>{se(t,`PR Comments — ${L(k)??""}`),se(d,`${b.size??""} of ${o.pr.comments.length??""} selected`)}),G(u,m)},$$slots:{default:!0}}),Re()}St(["change"]);var sh=ee('<button type="button"> </button>'),nh=ee('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function oh(r,o){De(o,!0);var _=nh();je(_,21,()=>o.panes,w=>w.index,(w,b)=>{var k=sh(),E=X(k);oe(()=>{Be(k,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${o.activePane===L(b).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),se(E,L(b).label)}),me("click",k,()=>o.onselect(L(b).index)),G(w,k)}),G(r,_),Re()}St(["click"]);var ah=ee('<div class="toast svelte-1974bvt" role="alert"><button type="button" class="flex-1 flex items-center 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">×</button></div>'),lh=ee('<div class="fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm"></div>');function ch(r,o){De(o,!0);var _=tr(),w=Le(_);{var b=k=>{var E=lh();je(E,21,()=>o.notifications,n=>n.id,(n,a)=>{var c=ah(),f=X(c),l=X(f);Qn(l,{get notification(){return L(a)},large:!0});var u=J(f,2);me("click",f,()=>{o.ondismiss(L(a).id),o.onselect(L(a).branch)}),me("click",u,()=>o.ondismiss(L(a).id)),G(n,c)}),G(k,E)};ne(w,k=>{o.notifications.length>0&&k(b)})}G(r,_),Re()}St(["click"]);var hh=ee('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),uh=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>'),dh=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),fh=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 _h(r,o){De(o,!0);let _=ae(!0),w=ae(""),b=ve(()=>L(w)?o.issues.filter(p=>zs(L(w),p.title)||(p.description?zs(L(w),p.description):!1)):o.issues);var k=fh(),E=X(k),n=X(E),a=X(n),c=J(n,2),f=X(c),l=J(E,2);{var u=p=>{var m=dh(),h=Le(m),t=X(h),i=J(h,2);je(i,21,()=>L(b),e=>e.id,(e,s)=>{var d=uh(),g=X(d),S=X(g),C=J(S,2),v=X(C),x=J(C,2),M=X(x),O=J(g,2),P=X(O),T=J(O,2);{var H=B=>{var U=hh(),K=X(U);oe(()=>se(K,L(s).description)),G(B,U)};ne(T,B=>{L(s).description&&B(H)})}var I=J(T,2),N=X(I),j=X(N),$=J(j);{var y=B=>{var U=Fe();oe(()=>se(U,`· ${L(s).project??""}`)),G(B,U)};ne($,B=>{L(s).project&&B(y)})}var R=J(N,2),A=X(R);ze(A,{small:!0,variant:"accent-outline",onclick:()=>o.onassign(L(s)),children:(B,U)=>{var K=Fe("Implement");G(B,K)},$$slots:{default:!0}}),oe(()=>{Qr(S,`background: ${L(s).state.color??""};`),Ce(S,"title",L(s).state.name),Ce(C,"href",L(s).url),se(v,L(s).identifier),se(M,L(s).priorityLabel),se(P,L(s).title),se(j,L(s).team.key)}),me("click",d,()=>o.onselect(L(s))),me("keydown",d,B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o.onselect(L(s)))}),me("click",C,B=>B.stopPropagation()),me("keydown",C,B=>B.stopPropagation()),me("click",R,B=>B.stopPropagation()),me("keydown",R,B=>{(B.key==="Enter"||B.key===" ")&&B.stopPropagation()}),G(e,d)}),Gr(t,()=>L(w),e=>V(w,e)),G(p,m)};ne(l,p=>{L(_)||p(u)})}oe(()=>{se(a,`Linear (${L(b).length!==o.issues.length?`${L(b).length}/`:""}${o.issues.length??""})`),se(f,L(_)?"▸":"▾")}),me("click",E,()=>V(_,!L(_))),G(r,k),Re()}St(["click","keydown"]);var vh=ee('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),ph=ee('<p class="text-[13px] text-muted italic mb-4">No description</p>'),gh=ee("<span> </span>"),mh=ee('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),Sh=ee("<span> </span>"),bh=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 wh(r,o){De(o,!0),Ur(r,{get onclose(){return o.onclose},wide:!0,children:(_,w)=>{var b=bh(),k=Le(b),E=X(k),n=J(E,2),a=X(n),c=J(n,2),f=X(c),l=J(c,2),u=X(l),p=J(k,2),m=X(p),h=J(p,2);{var t=H=>{var I=vh(),N=X(I);oe(()=>se(N,o.issue.description)),G(H,I)},i=H=>{var I=ph();G(H,I)};ne(h,H=>{o.issue.description?H(t):H(i,!1)})}var e=J(h,2),s=X(e),d=X(s),g=J(s,2);{var S=H=>{var I=gh(),N=X(I);oe(()=>se(N,`· ${o.issue.project??""}`)),G(H,I)};ne(g,H=>{o.issue.project&&H(S)})}var C=J(g,2);{var v=H=>{var I=tr(),N=Le(I);je(N,17,()=>o.issue.labels,j=>j.name,(j,$)=>{var y=mh(),R=X(y);oe(()=>{Qr(y,`color: ${L($).color??""}; background: ${L($).color??""}20;`),se(R,L($).name)}),G(j,y)}),G(H,I)};ne(C,H=>{o.issue.labels.length>0&&H(v)})}var x=J(C,2);{var M=H=>{var I=Sh(),N=X(I);oe(()=>se(N,`Due ${o.issue.dueDate??""}`)),G(H,I)};ne(x,H=>{o.issue.dueDate&&H(M)})}var O=J(e,2),P=X(O);ze(P,{get onclick(){return o.onclose},children:(H,I)=>{var N=Fe("Close");G(H,N)},$$slots:{default:!0}});var T=J(P,2);ze(T,{variant:"accent-outline",onclick:()=>o.onassign(o.issue),children:(H,I)=>{var N=Fe("Implement");G(H,N)},$$slots:{default:!0}}),oe(()=>{Qr(E,`background: ${o.issue.state.color??""};`),Ce(E,"title",o.issue.state.name),Ce(n,"href",o.issue.url),se(a,o.issue.identifier),se(f,o.issue.state.name),se(u,`· ${o.issue.priorityLabel??""}`),se(m,o.issue.title),se(d,o.issue.team.key)}),G(_,b)},$$slots:{default:!0}}),Re()}var Ch=ee('<div class="fixed inset-0 bg-black/50 z-40"></div>'),yh=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">×</button>'),xh=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>'),Eh=ee('<!> <aside><div class="flex items-center justify-between p-4 border-b border-edge"><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> <!> <!> <!></aside>',1),kh=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>'),Lh=ee('<div class="flex h-dvh bg-surface text-primary"><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!>',1);function Dh(r,o){De(o,!0);let _=ae(Ee({services:[],profiles:{default:{name:"default"}},autoName:!1})),w=ae(Ee([])),b=ae(null),k=ae(null),E=ae(null),n=ae(Ee(new Set)),a=ae(!1),c=ae(!1),f=ae(null),l=ae(null),u=ae(!1),p=ae(Ee(localStorage.getItem(fi)??"")),m=ae(Ee([])),h=ae(null),t=ae(null),i=0;const e=3e5;let s=ae(Ee([])),d=ae(Ee([])),g=ae(0);const S=4e3,C=10;let v=ae(Ee(new Set));function x(q){V(s,[...L(s),q],!0),V(v,new Set([...L(v),q.branch]),!0),V(d,[q,...L(d)].slice(0,C),!0),Ca(g),setTimeout(()=>{V(s,L(s).filter(ie=>ie.id!==q.id),!0)},S),document.hidden&&Notification.permission==="granted"&&new Notification(q.message,{body:q.url??q.branch,tag:`wm-${q.id}`})}function M(q){L(d).some(ie=>ie.id===q.id)||V(d,[q,...L(d)].slice(0,C),!0)}function O(q){V(s,L(s).filter(ie=>ie.id!==q),!0),Hc(q).catch(()=>{})}function P(q){V(s,L(s).filter(ie=>ie.id!==q),!0)}function T(){V(g,0)}let H=ae(!1),I=ae(!1),N=ae(0),j=ae(void 0);const $=200;let y=ae(Ee(new Set)),R=ve(()=>L(w)),A=ve(()=>L(R).find(q=>q.branch===L(b))),B=ve(()=>{var q;return!!L(b)&&((q=L(A))==null?void 0:q.mux)==="✓"});mr(()=>{if(!L(b)&&L(R).length>0){const q=L(R).find(ie=>ie.mux==="✓");V(b,(q??L(R)[0]).branch,!0)}}),mr(()=>{document.title=L(_).name?`${L(_).name} - Dashboard`:"Dev Dashboard"});let U=ve(()=>{var ie;const q=((ie=L(A))==null?void 0:ie.paneCount)??0;return q<2?[]:Array.from({length:q},(ge,Te)=>({index:Te,label:String(Te+1)}))}),K=ve(()=>L(H)&&L(B)&&L(U).length>0);function Q(){const q=Date.now();q-i<e||(i=q,Oc().then(ie=>{V(m,ie,!0)}).catch(ie=>console.warn("[linear]",ie)))}async function te(){try{V(w,await Ac(),!0)}catch(q){console.error("Failed to refresh:",q)}Q()}function F(q){V(h,q,!0),V(a,!0)}async function D(q,ie,ge,Te,Ie){V(u,!0);try{const it=await Tc(q||void 0,ie,ge,Te||void 0,Object.keys(Ie).length>0?Ie:void 0);await Gs(it.branch),V(a,!1),V(h,null),await te(),V(b,it.branch,!0),L(H)&&V(I,!1)}catch(it){alert(`Failed to create: ${cr(it)}`)}finally{V(u,!1)}}function Y(q){if(L(b)!==q)return;const ie=L(R).findIndex(Te=>Te.branch===q),ge=L(R)[ie-1]??L(R)[ie+1];V(b,ge?ge.branch:null,!0)}async function z(){const q=L(k);if(q){V(k,null),Y(q),V(n,new Set([...L(n),q]),!0);try{await Bc(q),await te()}catch(ie){alert(`Failed to remove: ${cr(ie)}`)}finally{V(n,new Set([...L(n)].filter(ie=>ie!==q)),!0)}}}async function re(){const q=L(E);if(q){V(E,null),Y(q),V(n,new Set([...L(n),q]),!0);try{await Mc(q),await te()}catch(ie){alert(`Failed to merge: ${cr(ie)}`)}finally{V(n,new Set([...L(n)].filter(ie=>ie!==q)),!0)}}}function Z(q){const ie=L(R).filter(Ie=>!L(n).has(Ie.branch));if(ie.length===0)return;if(!L(b)){V(b,ie[q===1?0:ie.length-1].branch,!0);return}const Te=ie.findIndex(Ie=>Ie.branch===L(b))+q;Te>=0&&Te<ie.length&&V(b,ie[Te].branch,!0)}function le(q){L(a)||L(k)||L(E)||!(q.metaKey||q.ctrlKey)||(q.key==="ArrowUp"?(q.preventDefault(),Z(-1)):q.key==="ArrowDown"?(q.preventDefault(),Z(1)):q.key==="k"||q.key==="K"?(q.preventDefault(),L(u)||V(a,!0)):q.key==="m"||q.key==="M"?(q.preventDefault(),L(b)&&V(E,L(b),!0)):(q.key==="d"||q.key==="D")&&(q.preventDefault(),L(b)&&V(k,L(b),!0)))}function _e(q){var ie;V(N,q,!0),(ie=L(j))==null||ie.sendSelectPane(q)}ms(()=>{Rc().then(Ie=>{V(_,Ie,!0)}).catch(()=>{}),te(),Q();const q=setInterval(te,5e3);window.addEventListener("keydown",le);const ie=Ic(x,P,M);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});const ge=window.matchMedia("(max-width: 768px)");V(H,ge.matches,!0),L(H)&&V(I,!0);function Te(Ie){V(H,Ie.matches,!0)}return ge.addEventListener("change",Te),()=>{clearInterval(q),window.removeEventListener("keydown",le),ge.removeEventListener("change",Te),ie()}});var Se=Lh(),Ae=Le(Se),ce=X(Ae);{var Rt=q=>{var ie=Eh(),ge=Le(ie);{var Te=we=>{var Ye=Ch();me("click",Ye,()=>V(I,!1)),me("keydown",Ye,Mt=>{Mt.key==="Escape"&&V(I,!1)}),G(we,Ye)};ne(ge,we=>{L(H)&&we(Te)})}var Ie=J(ge,2),it=X(Ie),xs=X(it),co=X(xs),ho=J(xs,2),Li=X(ho),uo=J(Li,2);{var fo=we=>{var Ye=yh();me("click",Ye,()=>V(I,!1)),G(we,Ye)};ne(uo,we=>{L(H)&&we(fo)})}var Es=J(it,2);Pl(Es,{get worktrees(){return L(R)},get selected(){return L(b)},get removing(){return L(n)},get initializing(){return L(y)},get notifiedBranches(){return L(v)},onselect:async we=>{V(b,we,!0),V(v,new Set([...L(v)].filter(Mt=>Mt!==we)),!0),L(H)&&V(I,!1);const Ye=L(w).find(Mt=>Mt.branch===we);if(Ye&&Ye.mux!=="✓"){V(y,new Set([...L(y),we]),!0);try{await Gs(we),await te()}catch(Mt){alert(`Failed to open worktree: ${cr(Mt)}`)}finally{V(y,new Set([...L(y)].filter(Mt=>Mt!==we)),!0)}}},onremove:we=>V(k,we,!0)});var ks=J(Es,2);{var _o=we=>{_h(we,{get issues(){return L(m)},onassign:F,onselect:Ye=>V(t,Ye,!0)})};ne(ks,we=>{L(m).length>0&&we(_o)})}var vo=J(ks,2);{var po=we=>{var Ye=xh();G(we,Ye)};ne(vo,we=>{L(H)||we(po)})}oe(()=>{Be(Ie,1,`${L(H)?"fixed inset-0 z-50 w-full":"w-[220px] min-w-[220px]"} bg-sidebar border-r border-edge flex flex-col overflow-hidden`),se(co,L(_).name??"Dashboard"),Li.disabled=L(u)}),me("click",Li,()=>V(a,!0)),G(q,ie)};ne(ce,q=>{(!L(H)||L(I))&&q(Rt)})}var At=J(ce,2),Tt=X(At);nc(Tt,{get name(){return L(b)},get worktree(){return L(A)},get sshHost(){return L(p)},get isMobile(){return L(H)},get notificationHistory(){return L(d)},get unreadCount(){return L(g)},ontogglesidebar:()=>V(I,!L(I)),onmerge:()=>{L(b)&&V(E,L(b),!0)},onremove:()=>{L(b)&&V(k,L(b),!0)},onsettings:()=>V(c,!0),onciclick:q=>V(f,q,!0),onreviewsclick:q=>V(l,q,!0),onbellopen:T,onnotificationselect:q=>{V(b,q,!0),V(v,new Set([...L(v)].filter(ie=>ie!==q)),!0),L(H)&&V(I,!1)}});var bt=J(Tt,2);{var Bt=q=>{var ie=tr(),ge=Le(ie);Za(ge,()=>L(b),Te=>{{let Ie=ve(()=>L(H)?L(N):void 0);Ei(fc(Te,{get worktree(){return L(b)},get isMobile(){return L(H)},get initialPane(){return L(Ie)}}),it=>V(j,it,!0),()=>L(j))}}),G(q,ie)},$e=q=>{var ie=kh();G(q,ie)};ne(bt,q=>{L(B)?q(Bt):q($e,!1)})}var ir=J(bt,2);{var rt=q=>{oh(q,{get activePane(){return L(N)},get panes(){return L(U)},onselect:_e})};ne(ir,q=>{L(K)&&q(rt)})}var jt=J(Ae,2);{var jr=q=>{{let ie=ve(()=>[L(_).profiles.default,...L(_).profiles.sandbox?[L(_).profiles.sandbox]:[]]),ge=ve(()=>{var it;return((it=L(h))==null?void 0:it.branchName)??""}),Te=ve(()=>L(h)?`${L(h).title}${L(h).description?`
|
|
31
|
+
|
|
32
|
+
`+L(h).description:""}`:""),Ie=ve(()=>L(_).startupEnvs??{});kc(q,{get loading(){return L(u)},get profiles(){return L(ie)},get initialBranch(){return L(ge)},get initialPrompt(){return L(Te)},get startupEnvs(){return L(Ie)},oncreate:D,oncancel:()=>{V(a,!1),V(h,null)}})}};ne(jt,q=>{L(a)&&q(jr)})}var ct=J(jt,2);{var br=q=>{{let ie=ve(()=>`Remove worktree "${L(k)}"? This action cannot be undone.`);Vs(q,{get message(){return L(ie)},onconfirm:z,oncancel:()=>V(k,null)})}};ne(ct,q=>{L(k)&&q(br)})}var ht=J(ct,2);{var sr=q=>{{let ie=ve(()=>`Merge worktree "${L(E)}" into main? The worktree will be removed after merging.`);Vs(q,{get message(){return L(ie)},confirmLabel:"Merge",variant:"accent",onconfirm:re,oncancel:()=>V(E,null)})}};ne(ht,q=>{L(E)&&q(sr)})}var be=J(ht,2);{var ki=q=>{Dc(q,{onsave:ie=>{V(p,ie,!0),V(c,!1)},onclose:()=>V(c,!1)})};ne(be,q=>{L(c)&&q(ki)})}var ws=J(be,2);{var no=q=>{{let ie=ve(()=>{var ge;return((ge=L(A))==null?void 0:ge.branch)??""});Gc(q,{get pr(){return L(f)},get branch(){return L(ie)},onclose:()=>V(f,null),onfixsuccess:()=>{V(f,null),setTimeout(()=>{var ge;return(ge=L(j))==null?void 0:ge.sendInput("\r")},$)}})}};ne(ws,q=>{L(f)&&q(no)})}var Cs=J(ws,2);{var oo=q=>{{let ie=ve(()=>{var ge;return((ge=L(A))==null?void 0:ge.branch)??""});ih(q,{get pr(){return L(l)},get branch(){return L(ie)},onclose:()=>V(l,null),onsendsuccess:()=>{V(l,null),setTimeout(()=>{var ge;return(ge=L(j))==null?void 0:ge.sendInput("\r")},$)}})}};ne(Cs,q=>{L(l)&&q(oo)})}var ys=J(Cs,2);{var ao=q=>{wh(q,{get issue(){return L(t)},onassign:ie=>{V(t,null),F(ie)},onclose:()=>V(t,null)})};ne(ys,q=>{L(t)&&q(ao)})}var lo=J(ys,2);ch(lo,{get notifications(){return L(s)},ondismiss:O,onselect:q=>{V(b,q,!0),V(v,new Set([...L(v)].filter(ie=>ie!==q)),!0),L(H)&&V(I,!1)}}),G(r,Se),Re()}St(["click","keydown"]);Va(Dh,{target:document.getElementById("app")});
|