@tui-sandbox/library 10.2.2 → 10.3.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/CHANGELOG.md +14 -0
- package/dist/browser/assets/{index-0VekcGVw.js → index-dlAbCuMv.js} +14 -14
- package/dist/browser/index.html +1 -1
- package/dist/src/client/color-utilities.d.ts +1 -2
- package/dist/src/client/color-utilities.test.js.map +1 -1
- package/dist/src/server/blockingCommandInputSchema.d.ts +2 -2
- package/dist/src/server/index.d.ts +1 -0
- package/dist/src/server/index.js +1 -0
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/server.d.ts +22 -22
- package/dist/src/server/utilities/tabId.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -7
- package/src/client/color-utilities.test.ts +2 -1
- package/src/client/color-utilities.ts +1 -1
- package/src/server/index.ts +1 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var Nc=Object.defineProperty;var jc=(e,t,r)=>t in e?Nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ge=(e,t,r)=>jc(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))s(_);new MutationObserver(_=>{for(const E of _)if(E.type==="childList")for(const C of E.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&s(C)}).observe(document,{childList:!0,subtree:!0});function r(_){const E={};return _.integrity&&(E.integrity=_.integrity),_.referrerPolicy&&(E.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?E.credentials="include":_.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function s(_){if(_.ep)return;_.ep=!0;const E=r(_);fetch(_.href,E)}})();function Ze(e){const t={subscribe(r){let s=null,_=!1,E=!1,C=!1;function n(){if(s===null){C=!0;return}E||(E=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(h){var l;_||(l=r.next)==null||l.call(r,h)},error(h){var l;_||(_=!0,(l=r.error)==null||l.call(r,h),n())},complete(){var h;_||(_=!0,(h=r.complete)==null||h.call(r),n())}}),C&&n(),{unsubscribe:n}},pipe(...r){return r.reduce(Wc,t)}};return t}function Wc(e,t){return t(e)}function Uc(e){const t=new AbortController;return new Promise((s,_)=>{let E=!1;function C(){E||(E=!0,n.unsubscribe())}t.signal.addEventListener("abort",()=>{_(t.signal.reason)});const n=e.subscribe({next(h){E=!0,s(h),C()},error(h){_(h)},complete(){t.abort(),C()}})})}function Zc(e){return t=>{let r=0,s=null;const _=[];function E(){s||(s=t.subscribe({next(n){var h;for(const l of _)(h=l.next)==null||h.call(l,n)},error(n){var h;for(const l of _)(h=l.error)==null||h.call(l,n)},complete(){var n;for(const h of _)(n=h.complete)==null||n.call(h)}}))}function C(){if(r===0&&s){const n=s;s=null,n.unsubscribe()}}return Ze(n=>(r++,_.push(n),E(),{unsubscribe(){r--,C();const h=_.findIndex(l=>l===n);h>-1&&_.splice(h,1)}}))}}function Ss(e){let t=e;const r=[],s=C=>{t!==void 0&&C.next(t),r.push(C)},_=C=>{r.splice(r.indexOf(C),1)},E=Ze(C=>(s(C),()=>{_(C)}));return E.next=C=>{if(t!==C){t=C;for(const n of r)n.next(C)}},E.get=()=>t,E}function ys(e){return Ze(t=>{function r(_=0,E=e.op){const C=e.links[_];if(!C)throw new Error("No more links to execute - did you forget to add an ending link?");return C({op:E,next(h){return r(_+1,h)}})}return r().subscribe(t)})}const ws=()=>{},Ui=e=>{Object.freeze&&Object.freeze(e)};function Cs(e,t,r){var s,_;const E=t.join(".");return(s=r)[_=E]??(s[_]=new Proxy(ws,{get(C,n){if(!(typeof n!="string"||n==="then"))return Cs(e,[...t,n],r)},apply(C,n,h){const l=t[t.length-1];let d={args:h,path:t};return l==="call"?d={args:h.length>=2?[h[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(d={args:h.length>=2?h[1]:[],path:t.slice(0,-1)}),Ui(d.args),Ui(d.path),e(d)}})),r[E]}const qc=e=>Cs(e,[],Object.create(null)),Kc=e=>new Proxy(ws,{get(t,r){if(r!=="then")return e(r)}}),pt={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603};function et(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const Es=e=>e();function Vc(e,t){if("error"in e){const s=t.deserialize(e.error);return{ok:!1,error:{...e,error:s}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class tr extends Error{constructor(){super("Unable to transform response from server")}}function Gc(e,t){let r;try{r=Vc(e,t)}catch{throw new tr}if(!r.ok&&(!et(r.error.error)||typeof r.error.error.code!="number"))throw new tr;if(r.ok&&!et(r.result))throw new tr;return r}function mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ks;const rr=new WeakMap,Jc=()=>{};ks=Symbol.toStringTag;let Yc=ks;class Se{subscribe(){let t,r;const{settlement:s}=this;if(s===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const _=Qc();this.subscribers=eh(this.subscribers,_),t=_.promise,r=()=>{this.subscribers!==null&&(this.subscribers=rh(this.subscribers,_))}}else{const{status:_}=s;_==="fulfilled"?t=Promise.resolve(s.value):t=Promise.reject(s.reason),r=Jc}return Object.assign(t,{unsubscribe:r})}then(t,r){const s=this.subscribe(),{unsubscribe:_}=s;return Object.assign(s.then(t,r),{unsubscribe:_})}catch(t){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.catch(t),{unsubscribe:s})}finally(t){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.finally(t),{unsubscribe:s})}static proxy(t){const r=Se.getSubscribablePromise(t);return typeof r<"u"?r:Se.createSubscribablePromise(t)}static createSubscribablePromise(t){const r=new Se(t);return rr.set(t,r),rr.set(r,r),r}static getSubscribablePromise(t){return rr.get(t)}static resolve(t){const r=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return Se.proxy(r).subscribe()}static async any(t){const s=(Array.isArray(t)?t:[...t]).map(Se.resolve);try{return await Promise.any(s)}finally{s.forEach(({unsubscribe:_})=>{_()})}}static async race(t){const s=(Array.isArray(t)?t:[...t]).map(Se.resolve);try{return await Promise.race(s)}finally{s.forEach(({unsubscribe:_})=>{_()})}}static async raceReferences(t){const r=t.map(Xc);try{return await Promise.race(r)}finally{for(const s of r)s.unsubscribe()}}constructor(t){mt(this,"promise",void 0),mt(this,"subscribers",[]),mt(this,"settlement",null),mt(this,Yc,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const r=this.promise.then(s=>{const{subscribers:_}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:s},_==null||_.forEach(({resolve:E})=>{E(s)})});"catch"in r&&r.catch(s=>{const{subscribers:_}=this;this.subscribers=null,this.settlement={status:"rejected",reason:s},_==null||_.forEach(({reject:E})=>{E(s)})})}}function Xc(e){return Se.proxy(e).then(()=>[e])}function Qc(){let e,t;return{promise:new Promise((s,_)=>{e=s,t=_}),resolve:e,reject:t}}function eh(e,t){return[...e,t]}function th(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function rh(e,t){const r=e.indexOf(t);return r!==-1?th(e,r):e}var Zi,qi;(Zi=Symbol).dispose??(Zi.dispose=Symbol());(qi=Symbol).asyncDispose??(qi.asyncDispose=Symbol());function ih(e,t){const r=e,s=r[Symbol.dispose];return r[Symbol.dispose]=()=>{t(),s==null||s()},r}function sh(e,t){const r=e,s=r[Symbol.asyncDispose];return r[Symbol.asyncDispose]=async()=>{await t(),await(s==null?void 0:s())},r}const xs=Symbol();function nh(e){let t=null;return ih({start(){if(t)throw new Error("Timer already started");return new Promise(s=>{t=setTimeout(()=>s(xs),e)})}},()=>{t&&clearTimeout(t)})}function Ds(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var s,_;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=t[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=t[Symbol.dispose],r&&(_=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");_&&(s=function(){try{_.call(this)}catch(E){return Promise.reject(E)}}),e.stack.push({value:t,dispose:s,async:r})}else r&&e.stack.push({async:!0});return t}function mr(e){var t=typeof SuppressedError=="function"?SuppressedError:function(r,s,_){var E=new Error(_);return E.name="SuppressedError",E.error=r,E.suppressed=s,E};return(mr=function(s){function _(h){s.error=s.hasError?new t(h,s.error,"An error was suppressed during disposal."):h,s.hasError=!0}var E,C=0;function n(){for(;E=s.stack.pop();)try{if(!E.async&&C===1)return C=0,s.stack.push(E),Promise.resolve().then(n);if(E.dispose){var h=E.dispose.call(E.value);if(E.async)return C|=2,Promise.resolve(h).then(n,function(l){return _(l),n()})}else C|=1}catch(l){_(l)}if(C===1)return s.hasError?Promise.reject(s.error):Promise.resolve();if(s.hasError)throw s.error}return n()})(e)}const oh="ping",ah="serialized-error",ch="connected",hh="return";async function lh(e){const t={stack:[],error:void 0,hasError:!1};try{const r=Ds(t,nh(e.timeoutMs),!1),s=await Se.race([e.promise,r.start()]);return s===xs?await e.onTimeout():s}catch(r){t.error=r,t.hasError=!0}finally{mr(t)}}function uh(e){const{deserialize:t=n=>n}=e;let r={};const s=e.signal;let _=null;const E=()=>new ReadableStream({async start(n){const[h,l]=await Promise.all([e.url(),e.init()]),d=_=new e.EventSource(h,l);n.enqueue({type:"connecting",eventSource:_,event:null}),d.addEventListener(ch,p=>{const S=JSON.parse(p.data);r=S,n.enqueue({type:"connected",options:S,eventSource:d})}),d.addEventListener(ah,p=>{const g=p;n.enqueue({type:"serialized-error",error:t(JSON.parse(g.data)),eventSource:d})}),d.addEventListener(oh,()=>{n.enqueue({type:"ping",eventSource:d})}),d.addEventListener(hh,()=>{d.close(),n.close(),_=null}),d.addEventListener("error",p=>{d.readyState===EventSource.CLOSED?n.error(p):n.enqueue({type:"connecting",eventSource:d,event:p})}),d.addEventListener("message",p=>{const g=p,m={data:t(JSON.parse(g.data))};g.lastEventId&&(m.id=g.lastEventId),n.enqueue({type:"data",data:m,eventSource:d})});const u=()=>{try{d.close(),n.close()}catch{}};s.aborted?u():s.addEventListener("abort",u)},cancel(){_==null||_.close()}}),C=()=>{let n=E(),h=n.getReader();async function l(){await h.cancel(),_=null}return sh({read(){return h.read()},async recreate(){await l(),n=E(),h=n.getReader()}},l)};return Es(async function*(){const n={stack:[],error:void 0,hasError:!1};try{const h=Ds(n,C(),!0);for(;;){let l=h.read();const d=r.reconnectAfterInactivityMs;d&&(l=lh({promise:l,timeoutMs:d,onTimeout:async()=>{const p={value:{type:"timeout",ms:d,eventSource:_},done:!1};return await h.recreate(),p}}));const u=await l;if(u.done)return u.value;yield u.value}}catch(h){n.error=h,n.hasError=!0}finally{const h=mr(n);h&&await h}})}var _s,ps,ms,gs,vs,bs;typeof window>"u"||"Deno"in window||((ps=(_s=globalThis.process)==null?void 0:_s.env)==null?void 0:ps.NODE_ENV)==="test"||(gs=(ms=globalThis.process)==null?void 0:ms.env)!=null&&gs.JEST_WORKER_ID||(bs=(vs=globalThis.process)==null?void 0:vs.env)!=null&&bs.VITEST_WORKER_ID;function gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dh(e){return e instanceof de||e instanceof Error&&e.name==="TRPCClientError"}function fh(e){return et(e)&&et(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function _h(e,t){return typeof e=="string"?e:et(e)&&typeof e.message=="string"?e.message:t}class de extends Error{static from(t,r={}){const s=t;return dh(s)?(r.meta&&(s.meta={...s.meta,...r.meta}),s):fh(s)?new de(s.error.message,{...r,result:s}):new de(_h(s,"Unknown error"),{...r,cause:s})}constructor(t,r){var _,E;const s=r==null?void 0:r.cause;super(t,{cause:s}),gt(this,"cause",void 0),gt(this,"shape",void 0),gt(this,"data",void 0),gt(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=s,this.shape=(_=r==null?void 0:r.result)==null?void 0:_.error,this.data=(E=r==null?void 0:r.result)==null?void 0:E.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,de.prototype)}}function ir(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ph{$request(t){return ys({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(Zc())}async requestAsPromise(t){try{const r=this.$request(t);return(await Uc(r)).result.data}catch(r){throw de.from(r)}}query(t,r,s){return this.requestAsPromise({type:"query",path:t,input:r,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}mutation(t,r,s){return this.requestAsPromise({type:"mutation",path:t,input:r,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}subscription(t,r,s){return this.$request({type:"subscription",path:t,input:r,context:s.context,signal:s.signal}).subscribe({next(E){var C,n,h,l;switch(E.result.type){case"state":{(C=s.onConnectionStateChange)==null||C.call(s,E.result);break}case"started":{(n=s.onStarted)==null||n.call(s,{context:E.context});break}case"stopped":{(h=s.onStopped)==null||h.call(s);break}case"data":case void 0:{(l=s.onData)==null||l.call(s,E.result.data);break}}},error(E){var C;(C=s.onError)==null||C.call(s,E)},complete(){var E;(E=s.onComplete)==null||E.call(s)}})}constructor(t){ir(this,"links",void 0),ir(this,"runtime",void 0),ir(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}}const mh=Symbol.for("trpc_untypedClient"),gh={query:"query",mutate:"mutation",subscribe:"subscription"},vh=e=>gh[e];function bh(e){const t=qc(({path:r,args:s})=>{const _=[...r],E=vh(_.pop()),C=_.join(".");return e[E](C,...s)});return Kc(r=>r===mh?e:t[r])}function Rs(e){const t=new ph(e);return bh(t)}const Ki=e=>typeof e=="function";function Sh(e){if(e)return e;if(typeof window<"u"&&Ki(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ki(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Vi=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Gi(e){let t=null,r=null;const s=()=>{clearTimeout(r),r=null,t=null};function _(n){var d,u;const h=[[]];let l=0;for(;;){const p=n[l];if(!p)break;const g=h[h.length-1];if(p.aborted){(d=p.reject)==null||d.call(p,new Error("Aborted")),l++;continue}if(e.validate(g.concat(p).map(m=>m.key))){g.push(p),l++;continue}if(g.length===0){(u=p.reject)==null||u.call(p,new Error("Input is too big for a single dispatch")),l++;continue}h.push([])}return h}function E(){const n=_(t);s();for(const h of n){if(!h.length)continue;const l={items:h};for(const u of h)u.batch=l;e.fetch(l.items.map(u=>u.key)).then(async u=>{var p;await Promise.all(u.map(async(g,S)=>{var o,c;const m=l.items[S];try{const i=await Promise.resolve(g);(o=m.resolve)==null||o.call(m,i)}catch(i){(c=m.reject)==null||c.call(m,i)}m.batch=null,m.reject=null,m.resolve=null}));for(const g of l.items)(p=g.reject)==null||p.call(g,new Error("Missing result")),g.batch=null}).catch(u=>{var p;for(const g of l.items)(p=g.reject)==null||p.call(g,u),g.batch=null})}}function C(n){const h={aborted:!1,key:n,batch:null,resolve:Vi,reject:Vi},l=new Promise((d,u)=>{h.reject=u,h.resolve=d,t||(t=[]),t.push(h)});return r||(r=setTimeout(E)),l}return{load:C}}function yh(...e){const t=new AbortController,r=e.length;let s=0;const _=()=>{++s===r&&t.abort()};for(const E of e)E!=null&&E.aborted?_():E==null||E.addEventListener("abort",_,{once:!0});return t.signal}function wh(...e){const t=new AbortController;for(const r of e)r!=null&&r.aborted?t.abort():r==null||r.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function Ls(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}function Ch(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Ls(e.transformer),methodOverride:e.methodOverride}}function Eh(e){const t={};for(let r=0;r<e.length;r++){const s=e[r];t[r]=s}return t}const kh={query:"GET",mutation:"POST",subscription:"PATCH"};function As(e){return"input"in e?e.transformer.input.serialize(e.input):Eh(e.inputs.map(t=>e.transformer.input.serialize(t)))}const gr=e=>{const t=e.url.split("?");let s=t[0].replace(/\/$/,"")+"/"+e.path;const _=[];if(t[1]&&_.push(t[1]),"inputs"in e&&_.push("batch=1"),e.type==="query"||e.type==="subscription"){const E=As(e);E!==void 0&&e.methodOverride!=="POST"&&_.push(`input=${encodeURIComponent(JSON.stringify(E))}`)}return _.length&&(s+="?"+_.join("&")),s},xh=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=As(e);return t!==void 0?JSON.stringify(t):void 0},Dh=e=>Th({...e,contentTypeHeader:"application/json",getUrl:gr,getBody:xh});class Rh extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const Lh=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Rh};async function Ah(e){Lh(e.signal);const t=e.getUrl(e),r=e.getBody(e),{type:s}=e,_=await(async()=>{const C=await e.headers();return Symbol.iterator in C?Object.fromEntries(C):C})(),E={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,..._};return Sh(e.fetch)(t,{method:e.methodOverride??kh[s],signal:e.signal,body:r,headers:E})}async function Th(e){const t={},r=await Ah(e);t.response=r;const s=await r.json();return t.responseJSON=s,{json:s,meta:t}}function Ts(e){const t=Ch(e),r=e.maxURLLength??1/0,s=e.maxItems??1/0;return()=>{const _=h=>({validate(l){if(r===1/0&&s===1/0)return!0;if(l.length>s)return!1;const d=l.map(g=>g.path).join(","),u=l.map(g=>g.input);return gr({...t,type:h,path:d,inputs:u,signal:null}).length<=r},async fetch(l){const d=l.map(o=>o.path).join(","),u=l.map(o=>o.input),p=yh(...l.map(o=>o.signal)),g=await Dh({...t,path:d,inputs:u,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:l}):e.headers:{}},signal:p});return(Array.isArray(g.json)?g.json:l.map(()=>g.json)).map(o=>({meta:g.meta,json:o}))}}),E=Gi(_("query")),C=Gi(_("mutation")),n={query:E,mutation:C};return({op:h})=>Ze(l=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const u=n[h.type].load(h);let p;return u.then(g=>{p=g;const S=Gc(g.json,t.transformer.output);if(!S.ok){l.error(de.from(S.error,{meta:g.meta}));return}l.next({context:g.meta,result:S.result}),l.complete()}).catch(g=>{l.error(de.from(g,{meta:p==null?void 0:p.meta}))}),()=>{}})}}function Ji(e){return Array.isArray(e)?e:[e]}function Os(e){return t=>{const r=Ji(e.true).map(_=>_(t)),s=Ji(e.false).map(_=>_(t));return _=>Ze(E=>{const C=e.condition(_.op)?r:s;return ys({op:_.op,links:C}).subscribe(E)})}}const tt=(e,...t)=>typeof e=="function"?e(...t):e;function Oh(){let e,t;return{promise:new Promise((s,_)=>{e=s,t=_}),resolve:e,reject:t}}async function Ih(e){const t=await tt(e.url);if(!e.connectionParams)return t;const s=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+s}async function Bh(e){const t={method:"connectionParams",data:await tt(e)};return JSON.stringify(t)}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ph(e){const{promise:t,resolve:r,reject:s}=Oh();return e.addEventListener("open",()=>{e.removeEventListener("error",s),r()}),e.addEventListener("error",s),t}function Mh(e,{intervalMs:t,pongTimeoutMs:r}){let s,_;function E(){s=setTimeout(()=>{e.send("PING"),_=setTimeout(()=>{e.close()},r)},t)}function C(){clearTimeout(s),E()}function n(){clearTimeout(_),C()}e.addEventListener("open",E),e.addEventListener("message",({data:h})=>{clearTimeout(s),E(),h==="PONG"&&n()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(_)})}class yt{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++yt.connectCount;const t=Ih(this.urlOptions).then(r=>new this.WebSocketPonyfill(r));this.openPromise=t.then(async r=>{this.ws=r,r.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Mh(r,this.keepAliveOpts),r.addEventListener("close",()=>{this.ws===r&&(this.ws=null)}),await Ph(r),this.urlOptions.connectionParams&&r.send(await Bh(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(Le(this,"id",++yt.connectCount),Le(this,"WebSocketPonyfill",void 0),Le(this,"urlOptions",void 0),Le(this,"keepAliveOpts",void 0),Le(this,"wsObservable",Ss(null)),Le(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}Le(yt,"connectCount",0);function $h(e,t){return!t||e!=null&&typeof e!="object"?e:{...e??{},lastEventId:t}}async function zh(e){let t=await tt(e.url);if(e.connectionParams){const r=await tt(e.connectionParams),s=t.includes("?")?"&":"?";t+=s+"connectionParams="+encodeURIComponent(JSON.stringify(r))}return t}const Hh=[pt.BAD_GATEWAY,pt.SERVICE_UNAVAILABLE,pt.GATEWAY_TIMEOUT,pt.INTERNAL_SERVER_ERROR];function Is(e){const t=Ls(e.transformer);return()=>({op:r})=>Ze(s=>{const{type:_,path:E,input:C}=r;/* istanbul ignore if -- @preserve */if(_!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let n;const h=new AbortController,l=wh(r.signal,h.signal),d=uh({url:async()=>gr({transformer:t,url:await zh(e),input:$h(C,n),path:E,type:_,signal:null}),init:()=>tt(e.eventSourceOptions,{op:r}),signal:l,deserialize:t.output.deserialize,EventSource:e.EventSource??globalThis.EventSource}),u=Ss({type:"state",state:"connecting",error:null}),p=u.subscribe({next(g){s.next({result:g})}});return Es(async()=>{for await(const g of d)switch(g.type){case"ping":break;case"data":const S=g.data;let m;S.id?(n=S.id,m={id:S.id,data:S}):m={data:S.data},s.next({result:m,context:{eventSource:g.eventSource}});break;case"connected":{s.next({result:{type:"started"},context:{eventSource:g.eventSource}}),u.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const o=de.from({error:g.error});if(Hh.includes(g.error.code)){u.next({type:"state",state:"connecting",error:o});break}throw o}case"connecting":{const o=u.get(),c=g.event&&de.from(g.event);if(!c&&o.state==="connecting")break;u.next({type:"state",state:"connecting",error:c});break}case"timeout":u.next({type:"state",state:"connecting",error:new de(`Timeout of ${g.ms}ms reached while waiting for a response`)})}s.next({result:{type:"stopped"}}),u.next({type:"state",state:"idle",error:null}),s.complete()}).catch(g=>{s.error(de.from(g))}),()=>{s.complete(),h.abort(),p.unsubscribe()}})}const Fh={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},St=e=>Object.entries(e),{version:Hd,...Nh}=Fh,Bs=St(Nh).reduce((e,[t,r])=>(e[t]={...r,colorEntries:St(r.colors),ansiColorEntries:St(r.ansiColors)},e),{});St(Bs);var sr={exports:{}},Yi;function jh(){return Yi||(Yi=1,function(e,t){(function(r,s){e.exports=s()})(self,()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(_){this._terminal=_}dispose(){}fit(){const _=this.proposeDimensions();if(!_||!this._terminal||isNaN(_.cols)||isNaN(_.rows))return;const E=this._terminal._core;this._terminal.rows===_.rows&&this._terminal.cols===_.cols||(E._renderService.clear(),this._terminal.resize(_.cols,_.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const _=this._terminal._core,E=_._renderService.dimensions;if(E.css.cell.width===0||E.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:_.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(n.getPropertyValue("height")),l=Math.max(0,parseInt(n.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u=h-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),p=l-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(p/E.css.cell.width)),rows:Math.max(1,Math.floor(u/E.css.cell.height))}}}})(),r})())}(sr)),sr.exports}var Wh=jh(),nr={exports:{}},Xi;function Uh(){return Xi||(Xi=1,function(e,t){(function(r,s){e.exports=s()})(globalThis,()=>(()=>{var r={4567:function(C,n,h){var l=this&&this.__decorate||function(i,a,f,y){var b,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(b=i[k])&&(v=(w<3?b(v):w>3?b(a,f,v):b(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const u=h(9042),p=h(9924),g=h(844),S=h(4725),m=h(2585),o=h(3656);let c=n.AccessibilityManager=class extends g.Disposable{constructor(i,a,f,y){super(),this._terminal=i,this._coreBrowserService=f,this._renderService=y,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,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 p.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(b=>this._handleResize(b.rows))),this.register(this._terminal.onRender(b=>this._refreshRows(b.start,b.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(b=>this._handleChar(b))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
|
-
`))),this.register(this._terminal.onA11yTab(
|
|
3
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,a){this._liveRegionDebouncer.refresh(i,a,this._terminal.rows)}_renderRows(i,a){const f=this._terminal.buffer,y=f.lines.length.toString();for(let b=i;b<=a;b++){const w=f.lines.get(f.ydisp+b),v=[],k=(w==null?void 0:w.translateToString(!0,void 0,void 0,v))||"",A=(f.ydisp+b+1).toString(),O=this._rowElements[b];O&&(k.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=k,this._rowColumns.set(O,v)),O.setAttribute("aria-posinset",A),O.setAttribute("aria-setsize",y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,a){const f=i.target,y=this._rowElements[a===0?1:this._rowElements.length-2];if(f.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==y)return;let b,w;if(a===0?(b=f,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(b=this._rowElements.shift(),w=f,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),a===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(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let a={node:i.anchorNode,offset:i.anchorOffset},f={node:i.focusNode,offset:i.focusOffset};if((a.node.compareDocumentPosition(f.node)&Node.DOCUMENT_POSITION_PRECEDING||a.node===f.node&&a.offset>f.offset)&&([a,f]=[f,a]),a.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(a={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(a.node))return;const y=this._rowElements.slice(-1)[0];if(f.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(f={node:y,offset:((k=y.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(f.node))return;const b=({node:A,offset:O})=>{const I=A instanceof Text?A.parentNode:A;let L=parseInt(I==null?void 0:I.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(I);if(!z)return console.warn("columns is null. Race condition?"),null;let F=O<z.length?z[O]:z.slice(-1)[0]+1;return F>=this._terminal.cols&&(++L,F=0),{row:L,column:F}},w=b(a),v=b(f);if(w&&v){if(w.row>v.row||w.row===v.row&&w.column>=v.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(v.row-w.row)*this._terminal.cols-w.column+v.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=c=l([d(1,m.IInstantiationService),d(2,S.ICoreBrowserService),d(3,S.IRenderService)],c)},3614:(C,n)=>{function h(p){return p.replace(/\r?\n/g,"\r")}function l(p,g){return g?"\x1B[200~"+p+"\x1B[201~":p}function d(p,g,S,m){p=l(p=h(p),S.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(p,!0),g.value=""}function u(p,g,S){const m=S.getBoundingClientRect(),o=p.clientX-m.left-10,c=p.clientY-m.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${o}px`,g.style.top=`${c}px`,g.style.zIndex="1000",g.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=h,n.bracketTextForPaste=l,n.copyHandler=function(p,g){p.clipboardData&&p.clipboardData.setData("text/plain",g.selectionText),p.preventDefault()},n.handlePasteEvent=function(p,g,S,m){p.stopPropagation(),p.clipboardData&&d(p.clipboardData.getData("text/plain"),g,S,m)},n.paste=d,n.moveTextAreaUnderMouseCursor=u,n.rightClickHandler=function(p,g,S,m,o){u(p,g,S),o&&m.rightClickSelect(p),g.value=m.selectionText,g.select()}},7239:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const l=h(1505);n.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(d,u,p){this._css.set(d,u,p)}getCss(d,u){return this._css.get(d,u)}setColor(d,u,p){this._color.set(d,u,p)}getColor(d,u){return this._color.get(d,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(h,l,d,u){h.addEventListener(l,d,u);let p=!1;return{dispose:()=>{p||(p=!0,h.removeEventListener(l,d,u))}}}},3551:function(C,n,h){var l=this&&this.__decorate||function(c,i,a,f){var y,b=arguments.length,w=b<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(b<3?y(w):b>3?y(i,a,w):y(i,a))||w);return b>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const u=h(3656),p=h(8460),g=h(844),S=h(2585),m=h(4725);let o=n.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(c,i,a,f,y){super(),this._element=c,this._mouseService=i,this._renderService=a,this._bufferService=f,this._linkProviderService=y,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const i=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const a=c.composedPath();for(let f=0;f<a.length;f++){const y=a[f];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,i){var f,y;this._activeProviderReplies&&i||((f=this._activeProviderReplies)==null||f.forEach(b=>{b==null||b.forEach(w=>{w.link.dispose&&w.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=c.y);let a=!1;for(const[b,w]of this._linkProviderService.linkProviders.entries())i?(y=this._activeProviderReplies)!=null&&y.get(b)&&(a=this._checkLinkProviderResult(b,c,a)):w.provideLinks(c.y,v=>{var A,O;if(this._isMouseOut)return;const k=v==null?void 0:v.map(I=>({link:I}));(A=this._activeProviderReplies)==null||A.set(b,k),a=this._checkLinkProviderResult(b,c,a),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)})}_removeIntersectingLinks(c,i){const a=new Set;for(let f=0;f<i.size;f++){const y=i.get(f);if(y)for(let b=0;b<y.length;b++){const w=y[b],v=w.link.range.start.y<c?0:w.link.range.start.x,k=w.link.range.end.y>c?this._bufferService.cols:w.link.range.end.x;for(let A=v;A<=k;A++){if(a.has(A)){y.splice(b--,1);break}a.add(A)}}}}_checkLinkProviderResult(c,i,a){var b;if(!this._activeProviderReplies)return a;const f=this._activeProviderReplies.get(c);let y=!1;for(let w=0;w<c;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(y=!0);if(!y&&f){const w=f.find(v=>this._linkAtPosition(v.link,i));w&&(a=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!a)for(let w=0;w<this._activeProviderReplies.size;w++){const v=(b=this._activeProviderReplies.get(w))==null?void 0:b.find(k=>this._linkAtPosition(k.link,i));if(v){a=!0,this._handleNewLink(v);break}}return a}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const i=this._positionFromMouseEvent(c,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,i){this._currentLink&&this._lastMouseEvent&&(!c||!i||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(c.link,i)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var a,f;return(f=(a=this._currentLink)==null?void 0:a.state)==null?void 0:f.decorations.pointerCursor},set:a=>{var f;(f=this._currentLink)!=null&&f.state&&this._currentLink.state.decorations.pointerCursor!==a&&(this._currentLink.state.decorations.pointerCursor=a,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",a))}},underline:{get:()=>{var a,f;return(f=(a=this._currentLink)==null?void 0:a.state)==null?void 0:f.decorations.underline},set:a=>{var f,y,b;(f=this._currentLink)!=null&&f.state&&((b=(y=this._currentLink)==null?void 0:y.state)==null?void 0:b.decorations.underline)!==a&&(this._currentLink.state.decorations.underline=a,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,a))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(a=>{if(!this._currentLink)return;const f=a.start===0?0:a.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+a.end;if(this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(f,y),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(c,i,a){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(a,i.text)}_fireUnderlineEvent(c,i){const a=c.range,f=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-f-1,a.end.x,a.end.y-f-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(c,i,a){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(a,i.text)}_linkAtPosition(c,i){const a=c.range.start.y*this._bufferService.cols+c.range.start.x,f=c.range.end.y*this._bufferService.cols+c.range.end.x,y=i.y*this._bufferService.cols+i.x;return a<=y&&y<=f}_positionFromMouseEvent(c,i,a){const f=a.getCoords(c,i,this._bufferService.cols,this._bufferService.rows);if(f)return{x:f[0],y:f[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,i,a,f,y){return{x1:c,y1:i,x2:a,y2:f,cols:this._bufferService.cols,fg:y}}};n.Linkifier=o=l([d(1,m.IMouseService),d(2,m.IRenderService),d(3,S.IBufferService),d(4,m.ILinkProviderService)],o)},9042:(C,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(C,n,h){var l=this&&this.__decorate||function(m,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,o,c,i);else for(var b=m.length-1;b>=0;b--)(a=m[b])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(m,o){return function(c,i){o(c,i,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const u=h(511),p=h(2585);let g=n.OscLinkProvider=class{constructor(m,o,c){this._bufferService=m,this._optionsService=o,this._oscLinkService=c}provideLinks(m,o){var k;const c=this._bufferService.buffer.lines.get(m-1);if(!c)return void o(void 0);const i=[],a=this._optionsService.rawOptions.linkHandler,f=new u.CellData,y=c.getTrimmedLength();let b=-1,w=-1,v=!1;for(let A=0;A<y;A++)if(w!==-1||c.hasContent(A)){if(c.loadCell(A,f),f.hasExtendedAttrs()&&f.extended.urlId){if(w===-1){w=A,b=f.extended.urlId;continue}v=f.extended.urlId!==b}else w!==-1&&(v=!0);if(v||w!==-1&&A===y-1){const O=(k=this._oscLinkService.getLinkData(b))==null?void 0:k.uri;if(O){const I={start:{x:w+1,y:m},end:{x:A+(v||A!==y-1?0:1),y:m}};let L=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{const z=new URL(O);["http:","https:"].includes(z.protocol)||(L=!0)}catch{L=!0}L||i.push({text:O,range:I,activate:(z,F)=>a?a.activate(z,F,I):S(0,F),hover:(z,F)=>{var W;return(W=a==null?void 0:a.hover)==null?void 0:W.call(a,z,F,I)},leave:(z,F)=>{var W;return(W=a==null?void 0:a.leave)==null?void 0:W.call(a,z,F,I)}})}v=!1,f.hasExtendedAttrs()&&f.extended.urlId?(w=A,b=f.extended.urlId):(w=-1,b=-1)}}o(i)}};function S(m,o){if(confirm(`Do you want to navigate to ${o}?
|
|
1
|
+
var Ic=Object.defineProperty;var Bc=(e,t,r)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Bc(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))n(g);new MutationObserver(g=>{for(const E of g)if(E.type==="childList")for(const C of E.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&n(C)}).observe(document,{childList:!0,subtree:!0});function r(g){const E={};return g.integrity&&(E.integrity=g.integrity),g.referrerPolicy&&(E.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?E.credentials="include":g.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function n(g){if(g.ep)return;g.ep=!0;const E=r(g);fetch(g.href,E)}})();function He(e){const t={subscribe(r){let n=null,g=!1,E=!1,C=!1;function s(){if(n===null){C=!0;return}E||(E=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=e({next(h){var l;g||(l=r.next)==null||l.call(r,h)},error(h){var l;g||(g=!0,(l=r.error)==null||l.call(r,h),s())},complete(){var h;g||(g=!0,(h=r.complete)==null||h.call(r),s())}}),C&&s(),{unsubscribe:s}},pipe(...r){return r.reduce(Pc,t)}};return t}function Pc(e,t){return t(e)}function Mc(e){const t=new AbortController;return new Promise((n,g)=>{let E=!1;function C(){E||(E=!0,s.unsubscribe())}t.signal.addEventListener("abort",()=>{g(t.signal.reason)});const s=e.subscribe({next(h){E=!0,n(h),C()},error(h){g(h)},complete(){t.abort(),C()}})})}function $c(e){return t=>{let r=0,n=null;const g=[];function E(){n||(n=t.subscribe({next(s){var h;for(const l of g)(h=l.next)==null||h.call(l,s)},error(s){var h;for(const l of g)(h=l.error)==null||h.call(l,s)},complete(){var s;for(const h of g)(s=h.complete)==null||s.call(h)}}))}function C(){if(r===0&&n){const s=n;n=null,s.unsubscribe()}}return He(s=>(r++,g.push(s),E(),{unsubscribe(){r--,C();const h=g.findIndex(l=>l===s);h>-1&&g.splice(h,1)}}))}}function is(e){let t=e;const r=[],n=C=>{t!==void 0&&C.next(t),r.push(C)},g=C=>{r.splice(r.indexOf(C),1)},E=He(C=>(n(C),()=>{g(C)}));return E.next=C=>{if(t!==C){t=C;for(const s of r)s.next(C)}},E.get=()=>t,E}function ss(e){return He(t=>{function r(g=0,E=e.op){const C=e.links[g];if(!C)throw new Error("No more links to execute - did you forget to add an ending link?");return C({op:E,next(h){return r(g+1,h)}})}return r().subscribe(t)})}const ns=()=>{},Di=e=>{Object.freeze&&Object.freeze(e)};function os(e,t,r){var n,g;const E=t.join(".");return(n=r)[g=E]??(n[g]=new Proxy(ns,{get(C,s){if(!(typeof s!="string"||s==="then"))return os(e,[...t,s],r)},apply(C,s,h){const l=t[t.length-1];let d={args:h,path:t};return l==="call"?d={args:h.length>=2?[h[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(d={args:h.length>=2?h[1]:[],path:t.slice(0,-1)}),Di(d.args),Di(d.path),e(d)}})),r[E]}const zc=e=>os(e,[],Object.create(null)),Hc=e=>new Proxy(ns,{get(t,r){if(r!=="then")return e(r)}}),it={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603};function Ke(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const as=e=>e();function Fc(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class Ft extends Error{constructor(){super("Unable to transform response from server")}}function Nc(e,t){let r;try{r=Fc(e,t)}catch{throw new Ft}if(!r.ok&&(!Ke(r.error.error)||typeof r.error.error.code!="number"))throw new Ft;if(r.ok&&!Ke(r.result))throw new Ft;return r}function st(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cs;const Nt=new WeakMap,jc=()=>{};cs=Symbol.toStringTag;let Uc=cs;class be{subscribe(){let t,r;const{settlement:n}=this;if(n===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const g=Zc();this.subscribers=qc(this.subscribers,g),t=g.promise,r=()=>{this.subscribers!==null&&(this.subscribers=Vc(this.subscribers,g))}}else{const{status:g}=n;g==="fulfilled"?t=Promise.resolve(n.value):t=Promise.reject(n.reason),r=jc}return Object.assign(t,{unsubscribe:r})}then(t,r){const n=this.subscribe(),{unsubscribe:g}=n;return Object.assign(n.then(t,r),{unsubscribe:g})}catch(t){const r=this.subscribe(),{unsubscribe:n}=r;return Object.assign(r.catch(t),{unsubscribe:n})}finally(t){const r=this.subscribe(),{unsubscribe:n}=r;return Object.assign(r.finally(t),{unsubscribe:n})}static proxy(t){const r=be.getSubscribablePromise(t);return typeof r<"u"?r:be.createSubscribablePromise(t)}static createSubscribablePromise(t){const r=new be(t);return Nt.set(t,r),Nt.set(r,r),r}static getSubscribablePromise(t){return Nt.get(t)}static resolve(t){const r=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return be.proxy(r).subscribe()}static async any(t){const n=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:g})=>{g()})}}static async race(t){const n=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:g})=>{g()})}}static async raceReferences(t){const r=t.map(Wc);try{return await Promise.race(r)}finally{for(const n of r)n.unsubscribe()}}constructor(t){st(this,"promise",void 0),st(this,"subscribers",[]),st(this,"settlement",null),st(this,Uc,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const r=this.promise.then(n=>{const{subscribers:g}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},g==null||g.forEach(({resolve:E})=>{E(n)})});"catch"in r&&r.catch(n=>{const{subscribers:g}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},g==null||g.forEach(({reject:E})=>{E(n)})})}}function Wc(e){return be.proxy(e).then(()=>[e])}function Zc(){let e,t;return{promise:new Promise((n,g)=>{e=n,t=g}),resolve:e,reject:t}}function qc(e,t){return[...e,t]}function Kc(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Vc(e,t){const r=e.indexOf(t);return r!==-1?Kc(e,r):e}var Ri,Li;(Ri=Symbol).dispose??(Ri.dispose=Symbol());(Li=Symbol).asyncDispose??(Li.asyncDispose=Symbol());function Gc(e,t){const r=e,n=r[Symbol.dispose];return r[Symbol.dispose]=()=>{t(),n==null||n()},r}function Jc(e,t){const r=e,n=r[Symbol.asyncDispose];return r[Symbol.asyncDispose]=async()=>{await t(),await(n==null?void 0:n())},r}const hs=Symbol();function Yc(e){let t=null;return Gc({start(){if(t)throw new Error("Timer already started");return new Promise(n=>{t=setTimeout(()=>n(hs),e)})}},()=>{t&&clearTimeout(t)})}function ls(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,g;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(g=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");g&&(n=function(){try{g.call(this)}catch(E){return Promise.reject(E)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function er(e){var t=typeof SuppressedError=="function"?SuppressedError:function(r,n,g){var E=new Error(g);return E.name="SuppressedError",E.error=r,E.suppressed=n,E};return(er=function(n){function g(h){n.error=n.hasError?new t(h,n.error,"An error was suppressed during disposal."):h,n.hasError=!0}var E,C=0;function s(){for(;E=n.stack.pop();)try{if(!E.async&&C===1)return C=0,n.stack.push(E),Promise.resolve().then(s);if(E.dispose){var h=E.dispose.call(E.value);if(E.async)return C|=2,Promise.resolve(h).then(s,function(l){return g(l),s()})}else C|=1}catch(l){g(l)}if(C===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return s()})(e)}const Xc="ping",Qc="serialized-error",eh="connected",th="return";async function rh(e){const t={stack:[],error:void 0,hasError:!1};try{const r=ls(t,Yc(e.timeoutMs),!1),n=await be.race([e.promise,r.start()]);return n===hs?await e.onTimeout():n}catch(r){t.error=r,t.hasError=!0}finally{er(t)}}function ih(e){const{deserialize:t=s=>s}=e;let r={};const n=e.signal;let g=null;const E=()=>new ReadableStream({async start(s){const[h,l]=await Promise.all([e.url(),e.init()]),d=g=new e.EventSource(h,l);s.enqueue({type:"connecting",eventSource:g,event:null}),d.addEventListener(eh,_=>{const b=JSON.parse(_.data);r=b,s.enqueue({type:"connected",options:b,eventSource:d})}),d.addEventListener(Qc,_=>{const m=_;s.enqueue({type:"serialized-error",error:t(JSON.parse(m.data)),eventSource:d})}),d.addEventListener(Xc,()=>{s.enqueue({type:"ping",eventSource:d})}),d.addEventListener(th,()=>{d.close(),s.close(),g=null}),d.addEventListener("error",_=>{d.readyState===EventSource.CLOSED?s.error(_):s.enqueue({type:"connecting",eventSource:d,event:_})}),d.addEventListener("message",_=>{const m=_,p={data:t(JSON.parse(m.data))};m.lastEventId&&(p.id=m.lastEventId),s.enqueue({type:"data",data:p,eventSource:d})});const u=()=>{try{d.close(),s.close()}catch{}};n.aborted?u():n.addEventListener("abort",u)},cancel(){g==null||g.close()}}),C=()=>{let s=E(),h=s.getReader();async function l(){await h.cancel(),g=null}return Jc({read(){return h.read()},async recreate(){await l(),s=E(),h=s.getReader()}},l)};return as(async function*(){const s={stack:[],error:void 0,hasError:!1};try{const h=ls(s,C(),!0);for(;;){let l=h.read();const d=r.reconnectAfterInactivityMs;d&&(l=rh({promise:l,timeoutMs:d,onTimeout:async()=>{const _={value:{type:"timeout",ms:d,eventSource:g},done:!1};return await h.recreate(),_}}));const u=await l;if(u.done)return u.value;yield u.value}}catch(h){s.error=h,s.hasError=!0}finally{const h=er(s);h&&await h}})}var Yi,Xi,Qi,es,ts,rs;typeof window>"u"||"Deno"in window||((Xi=(Yi=globalThis.process)==null?void 0:Yi.env)==null?void 0:Xi.NODE_ENV)==="test"||(es=(Qi=globalThis.process)==null?void 0:Qi.env)!=null&&es.JEST_WORKER_ID||(rs=(ts=globalThis.process)==null?void 0:ts.env)!=null&&rs.VITEST_WORKER_ID;function nt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sh(e){return e instanceof de||e instanceof Error&&e.name==="TRPCClientError"}function nh(e){return Ke(e)&&Ke(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function oh(e,t){return typeof e=="string"?e:Ke(e)&&typeof e.message=="string"?e.message:t}class de extends Error{static from(t,r={}){const n=t;return sh(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):nh(n)?new de(n.error.message,{...r,result:n}):new de(oh(n,"Unknown error"),{...r,cause:n})}constructor(t,r){var g,E;const n=r==null?void 0:r.cause;super(t,{cause:n}),nt(this,"cause",void 0),nt(this,"shape",void 0),nt(this,"data",void 0),nt(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=n,this.shape=(g=r==null?void 0:r.result)==null?void 0:g.error,this.data=(E=r==null?void 0:r.result)==null?void 0:E.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,de.prototype)}}function jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ah{$request(t){return ss({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe($c())}async requestAsPromise(t){try{const r=this.$request(t);return(await Mc(r)).result.data}catch(r){throw de.from(r)}}query(t,r,n){return this.requestAsPromise({type:"query",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,r,n){return this.requestAsPromise({type:"mutation",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,r,n){return this.$request({type:"subscription",path:t,input:r,context:n.context,signal:n.signal}).subscribe({next(E){var C,s,h,l;switch(E.result.type){case"state":{(C=n.onConnectionStateChange)==null||C.call(n,E.result);break}case"started":{(s=n.onStarted)==null||s.call(n,{context:E.context});break}case"stopped":{(h=n.onStopped)==null||h.call(n);break}case"data":case void 0:{(l=n.onData)==null||l.call(n,E.result.data);break}}},error(E){var C;(C=n.onError)==null||C.call(n,E)},complete(){var E;(E=n.onComplete)==null||E.call(n)}})}constructor(t){jt(this,"links",void 0),jt(this,"runtime",void 0),jt(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}}const ch=Symbol.for("trpc_untypedClient"),hh={query:"query",mutate:"mutation",subscribe:"subscription"},lh=e=>hh[e];function uh(e){const t=zc(({path:r,args:n})=>{const g=[...r],E=lh(g.pop()),C=g.join(".");return e[E](C,...n)});return Hc(r=>r===ch?e:t[r])}function us(e){const t=new ah(e);return uh(t)}const Ai=e=>typeof e=="function";function dh(e){if(e)return e;if(typeof window<"u"&&Ai(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ai(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Ti=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Oi(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function g(s){var d,u;const h=[[]];let l=0;for(;;){const _=s[l];if(!_)break;const m=h[h.length-1];if(_.aborted){(d=_.reject)==null||d.call(_,new Error("Aborted")),l++;continue}if(e.validate(m.concat(_).map(p=>p.key))){m.push(_),l++;continue}if(m.length===0){(u=_.reject)==null||u.call(_,new Error("Input is too big for a single dispatch")),l++;continue}h.push([])}return h}function E(){const s=g(t);n();for(const h of s){if(!h.length)continue;const l={items:h};for(const u of h)u.batch=l;e.fetch(l.items.map(u=>u.key)).then(async u=>{var _;await Promise.all(u.map(async(m,b)=>{var o,c;const p=l.items[b];try{const i=await Promise.resolve(m);(o=p.resolve)==null||o.call(p,i)}catch(i){(c=p.reject)==null||c.call(p,i)}p.batch=null,p.reject=null,p.resolve=null}));for(const m of l.items)(_=m.reject)==null||_.call(m,new Error("Missing result")),m.batch=null}).catch(u=>{var _;for(const m of l.items)(_=m.reject)==null||_.call(m,u),m.batch=null})}}function C(s){const h={aborted:!1,key:s,batch:null,resolve:Ti,reject:Ti},l=new Promise((d,u)=>{h.reject=u,h.resolve=d,t||(t=[]),t.push(h)});return r||(r=setTimeout(E)),l}return{load:C}}function fh(...e){const t=new AbortController,r=e.length;let n=0;const g=()=>{++n===r&&t.abort()};for(const E of e)E!=null&&E.aborted?g():E==null||E.addEventListener("abort",g,{once:!0});return t.signal}function _h(...e){const t=new AbortController;for(const r of e)r!=null&&r.aborted?t.abort():r==null||r.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function ds(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}function ph(e){return{url:e.url.toString(),fetch:e.fetch,transformer:ds(e.transformer),methodOverride:e.methodOverride}}function mh(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}const gh={query:"GET",mutation:"POST",subscription:"PATCH"};function fs(e){return"input"in e?e.transformer.input.serialize(e.input):mh(e.inputs.map(t=>e.transformer.input.serialize(t)))}const tr=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const g=[];if(t[1]&&g.push(t[1]),"inputs"in e&&g.push("batch=1"),e.type==="query"||e.type==="subscription"){const E=fs(e);E!==void 0&&e.methodOverride!=="POST"&&g.push(`input=${encodeURIComponent(JSON.stringify(E))}`)}return g.length&&(n+="?"+g.join("&")),n},vh=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=fs(e);return t!==void 0?JSON.stringify(t):void 0},bh=e=>Ch({...e,contentTypeHeader:"application/json",getUrl:tr,getBody:vh});class Sh extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const yh=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Sh};async function wh(e){yh(e.signal);const t=e.getUrl(e),r=e.getBody(e),{type:n}=e,g=await(async()=>{const C=await e.headers();return Symbol.iterator in C?Object.fromEntries(C):C})(),E={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...g};return dh(e.fetch)(t,{method:e.methodOverride??gh[n],signal:e.signal,body:r,headers:E})}async function Ch(e){const t={},r=await wh(e);t.response=r;const n=await r.json();return t.responseJSON=n,{json:n,meta:t}}function _s(e){const t=ph(e),r=e.maxURLLength??1/0,n=e.maxItems??1/0;return()=>{const g=h=>({validate(l){if(r===1/0&&n===1/0)return!0;if(l.length>n)return!1;const d=l.map(m=>m.path).join(","),u=l.map(m=>m.input);return tr({...t,type:h,path:d,inputs:u,signal:null}).length<=r},async fetch(l){const d=l.map(o=>o.path).join(","),u=l.map(o=>o.input),_=fh(...l.map(o=>o.signal)),m=await bh({...t,path:d,inputs:u,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:l}):e.headers:{}},signal:_});return(Array.isArray(m.json)?m.json:l.map(()=>m.json)).map(o=>({meta:m.meta,json:o}))}}),E=Oi(g("query")),C=Oi(g("mutation")),s={query:E,mutation:C};return({op:h})=>He(l=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const u=s[h.type].load(h);let _;return u.then(m=>{_=m;const b=Nc(m.json,t.transformer.output);if(!b.ok){l.error(de.from(b.error,{meta:m.meta}));return}l.next({context:m.meta,result:b.result}),l.complete()}).catch(m=>{l.error(de.from(m,{meta:_==null?void 0:_.meta}))}),()=>{}})}}function Ii(e){return Array.isArray(e)?e:[e]}function ps(e){return t=>{const r=Ii(e.true).map(g=>g(t)),n=Ii(e.false).map(g=>g(t));return g=>He(E=>{const C=e.condition(g.op)?r:n;return ss({op:g.op,links:C}).subscribe(E)})}}const Ve=(e,...t)=>typeof e=="function"?e(...t):e;function Eh(){let e,t;return{promise:new Promise((n,g)=>{e=n,t=g}),resolve:e,reject:t}}async function kh(e){const t=await Ve(e.url);if(!e.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}async function xh(e){const t={method:"connectionParams",data:await Ve(e)};return JSON.stringify(t)}function xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dh(e){const{promise:t,resolve:r,reject:n}=Eh();return e.addEventListener("open",()=>{e.removeEventListener("error",n),r()}),e.addEventListener("error",n),t}function Rh(e,{intervalMs:t,pongTimeoutMs:r}){let n,g;function E(){n=setTimeout(()=>{e.send("PING"),g=setTimeout(()=>{e.close()},r)},t)}function C(){clearTimeout(n),E()}function s(){clearTimeout(g),C()}e.addEventListener("open",E),e.addEventListener("message",({data:h})=>{clearTimeout(n),E(),h==="PONG"&&s()}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(g)})}class ht{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++ht.connectCount;const t=kh(this.urlOptions).then(r=>new this.WebSocketPonyfill(r));this.openPromise=t.then(async r=>{this.ws=r,r.addEventListener("message",function({data:n}){n==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Rh(r,this.keepAliveOpts),r.addEventListener("close",()=>{this.ws===r&&(this.ws=null)}),await Dh(r),this.urlOptions.connectionParams&&r.send(await xh(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(xe(this,"id",++ht.connectCount),xe(this,"WebSocketPonyfill",void 0),xe(this,"urlOptions",void 0),xe(this,"keepAliveOpts",void 0),xe(this,"wsObservable",is(null)),xe(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}xe(ht,"connectCount",0);function Lh(e,t){return!t||e!=null&&typeof e!="object"?e:{...e??{},lastEventId:t}}async function Ah(e){let t=await Ve(e.url);if(e.connectionParams){const r=await Ve(e.connectionParams),n=t.includes("?")?"&":"?";t+=n+"connectionParams="+encodeURIComponent(JSON.stringify(r))}return t}const Th=[it.BAD_GATEWAY,it.SERVICE_UNAVAILABLE,it.GATEWAY_TIMEOUT,it.INTERNAL_SERVER_ERROR];function ms(e){const t=ds(e.transformer);return()=>({op:r})=>He(n=>{const{type:g,path:E,input:C}=r;/* istanbul ignore if -- @preserve */if(g!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let s;const h=new AbortController,l=_h(r.signal,h.signal),d=ih({url:async()=>tr({transformer:t,url:await Ah(e),input:Lh(C,s),path:E,type:g,signal:null}),init:()=>Ve(e.eventSourceOptions,{op:r}),signal:l,deserialize:t.output.deserialize,EventSource:e.EventSource??globalThis.EventSource}),u=is({type:"state",state:"connecting",error:null}),_=u.subscribe({next(m){n.next({result:m})}});return as(async()=>{for await(const m of d)switch(m.type){case"ping":break;case"data":const b=m.data;let p;b.id?(s=b.id,p={id:b.id,data:b}):p={data:b.data},n.next({result:p,context:{eventSource:m.eventSource}});break;case"connected":{n.next({result:{type:"started"},context:{eventSource:m.eventSource}}),u.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const o=de.from({error:m.error});if(Th.includes(m.error.code)){u.next({type:"state",state:"connecting",error:o});break}throw o}case"connecting":{const o=u.get(),c=m.event&&de.from(m.event);if(!c&&o.state==="connecting")break;u.next({type:"state",state:"connecting",error:c});break}case"timeout":u.next({type:"state",state:"connecting",error:new de(`Timeout of ${m.ms}ms reached while waiting for a response`)})}n.next({result:{type:"stopped"}}),u.next({type:"state",state:"idle",error:null}),n.complete()}).catch(m=>{n.error(de.from(m))}),()=>{n.complete(),h.abort(),_.unsubscribe()}})}const Oh={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},ct=e=>Object.entries(e),{version:gd,...Ih}=Oh,gs=ct(Ih).reduce((e,[t,r])=>(e[t]={...r,colorEntries:ct(r.colors),ansiColorEntries:ct(r.ansiColors)},e),{});ct(gs);var Ut={exports:{}},Bi;function Bh(){return Bi||(Bi=1,function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const E=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(E._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,E=g._renderService.dimensions;if(E.css.cell.width===0||E.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:g.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(s.getPropertyValue("height")),l=Math.max(0,parseInt(s.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u=h-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),_=l-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(_/E.css.cell.width)),rows:Math.max(1,Math.floor(u/E.css.cell.height))}}}})(),r})())}(Ut)),Ut.exports}var Ph=Bh(),Wt={exports:{}},Pi;function Mh(){return Pi||(Pi=1,function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(C,s,h){var l=this&&this.__decorate||function(i,a,f,y){var S,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(S=i[k])&&(v=(w<3?S(v):w>3?S(a,f,v):S(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=h(9042),_=h(9924),m=h(844),b=h(4725),p=h(2585),o=h(3656);let c=s.AccessibilityManager=class extends m.Disposable{constructor(i,a,f,y){super(),this._terminal=i,this._coreBrowserService=f,this._renderService=y,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 _.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(`
|
|
2
|
+
`))),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,o.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,m.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let a=0;a<i;a++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
3
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,a){this._liveRegionDebouncer.refresh(i,a,this._terminal.rows)}_renderRows(i,a){const f=this._terminal.buffer,y=f.lines.length.toString();for(let S=i;S<=a;S++){const w=f.lines.get(f.ydisp+S),v=[],k=(w==null?void 0:w.translateToString(!0,void 0,void 0,v))||"",A=(f.ydisp+S+1).toString(),O=this._rowElements[S];O&&(k.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=k,this._rowColumns.set(O,v)),O.setAttribute("aria-posinset",A),O.setAttribute("aria-setsize",y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,a){const f=i.target,y=this._rowElements[a===0?1:this._rowElements.length-2];if(f.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==y)return;let S,w;if(a===0?(S=f,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(S=this._rowElements.shift(),w=f,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),a===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(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let a={node:i.anchorNode,offset:i.anchorOffset},f={node:i.focusNode,offset:i.focusOffset};if((a.node.compareDocumentPosition(f.node)&Node.DOCUMENT_POSITION_PRECEDING||a.node===f.node&&a.offset>f.offset)&&([a,f]=[f,a]),a.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(a={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(a.node))return;const y=this._rowElements.slice(-1)[0];if(f.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(f={node:y,offset:((k=y.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(f.node))return;const S=({node:A,offset:O})=>{const I=A instanceof Text?A.parentNode:A;let L=parseInt(I==null?void 0:I.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(I);if(!$)return console.warn("columns is null. Race condition?"),null;let F=O<$.length?$[O]:$.slice(-1)[0]+1;return F>=this._terminal.cols&&(++L,F=0),{row:L,column:F}},w=S(a),v=S(f);if(w&&v){if(w.row>v.row||w.row===v.row&&w.column>=v.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(v.row-w.row)*this._terminal.cols-w.column+v.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=c=l([d(1,p.IInstantiationService),d(2,b.ICoreBrowserService),d(3,b.IRenderService)],c)},3614:(C,s)=>{function h(_){return _.replace(/\r?\n/g,"\r")}function l(_,m){return m?"\x1B[200~"+_+"\x1B[201~":_}function d(_,m,b,p){_=l(_=h(_),b.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(_,!0),m.value=""}function u(_,m,b){const p=b.getBoundingClientRect(),o=_.clientX-p.left-10,c=_.clientY-p.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${o}px`,m.style.top=`${c}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=h,s.bracketTextForPaste=l,s.copyHandler=function(_,m){_.clipboardData&&_.clipboardData.setData("text/plain",m.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,m,b,p){_.stopPropagation(),_.clipboardData&&d(_.clipboardData.getData("text/plain"),m,b,p)},s.paste=d,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(_,m,b,p,o){u(_,m,b),o&&p.rightClickSelect(_),m.value=p.selectionText,m.select()}},7239:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const l=h(1505);s.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(d,u,_){this._css.set(d,u,_)}getCss(d,u){return this._css.get(d,u)}setColor(d,u,_){this._color.set(d,u,_)}getColor(d,u){return this._color.get(d,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(h,l,d,u){h.addEventListener(l,d,u);let _=!1;return{dispose:()=>{_||(_=!0,h.removeEventListener(l,d,u))}}}},3551:function(C,s,h){var l=this&&this.__decorate||function(c,i,a,f){var y,S=arguments.length,w=S<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(S<3?y(w):S>3?y(i,a,w):y(i,a))||w);return S>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const u=h(3656),_=h(8460),m=h(844),b=h(2585),p=h(4725);let o=s.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(c,i,a,f,y){super(),this._element=c,this._mouseService=i,this._renderService=a,this._bufferService=f,this._linkProviderService=y,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.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,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const i=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const a=c.composedPath();for(let f=0;f<a.length;f++){const y=a[f];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,i){var f,y;this._activeProviderReplies&&i||((f=this._activeProviderReplies)==null||f.forEach(S=>{S==null||S.forEach(w=>{w.link.dispose&&w.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=c.y);let a=!1;for(const[S,w]of this._linkProviderService.linkProviders.entries())i?(y=this._activeProviderReplies)!=null&&y.get(S)&&(a=this._checkLinkProviderResult(S,c,a)):w.provideLinks(c.y,v=>{var A,O;if(this._isMouseOut)return;const k=v==null?void 0:v.map(I=>({link:I}));(A=this._activeProviderReplies)==null||A.set(S,k),a=this._checkLinkProviderResult(S,c,a),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)})}_removeIntersectingLinks(c,i){const a=new Set;for(let f=0;f<i.size;f++){const y=i.get(f);if(y)for(let S=0;S<y.length;S++){const w=y[S],v=w.link.range.start.y<c?0:w.link.range.start.x,k=w.link.range.end.y>c?this._bufferService.cols:w.link.range.end.x;for(let A=v;A<=k;A++){if(a.has(A)){y.splice(S--,1);break}a.add(A)}}}}_checkLinkProviderResult(c,i,a){var S;if(!this._activeProviderReplies)return a;const f=this._activeProviderReplies.get(c);let y=!1;for(let w=0;w<c;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(y=!0);if(!y&&f){const w=f.find(v=>this._linkAtPosition(v.link,i));w&&(a=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!a)for(let w=0;w<this._activeProviderReplies.size;w++){const v=(S=this._activeProviderReplies.get(w))==null?void 0:S.find(k=>this._linkAtPosition(k.link,i));if(v){a=!0,this._handleNewLink(v);break}}return a}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const i=this._positionFromMouseEvent(c,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,i){this._currentLink&&this._lastMouseEvent&&(!c||!i||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(c.link,i)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var a,f;return(f=(a=this._currentLink)==null?void 0:a.state)==null?void 0:f.decorations.pointerCursor},set:a=>{var f;(f=this._currentLink)!=null&&f.state&&this._currentLink.state.decorations.pointerCursor!==a&&(this._currentLink.state.decorations.pointerCursor=a,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",a))}},underline:{get:()=>{var a,f;return(f=(a=this._currentLink)==null?void 0:a.state)==null?void 0:f.decorations.underline},set:a=>{var f,y,S;(f=this._currentLink)!=null&&f.state&&((S=(y=this._currentLink)==null?void 0:y.state)==null?void 0:S.decorations.underline)!==a&&(this._currentLink.state.decorations.underline=a,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,a))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(a=>{if(!this._currentLink)return;const f=a.start===0?0:a.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+a.end;if(this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(f,y),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}})))}_linkHover(c,i,a){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(a,i.text)}_fireUnderlineEvent(c,i){const a=c.range,f=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-f-1,a.end.x,a.end.y-f-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(c,i,a){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(a,i.text)}_linkAtPosition(c,i){const a=c.range.start.y*this._bufferService.cols+c.range.start.x,f=c.range.end.y*this._bufferService.cols+c.range.end.x,y=i.y*this._bufferService.cols+i.x;return a<=y&&y<=f}_positionFromMouseEvent(c,i,a){const f=a.getCoords(c,i,this._bufferService.cols,this._bufferService.rows);if(f)return{x:f[0],y:f[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,i,a,f,y){return{x1:c,y1:i,x2:a,y2:f,cols:this._bufferService.cols,fg:y}}};s.Linkifier=o=l([d(1,p.IMouseService),d(2,p.IRenderService),d(3,b.IBufferService),d(4,p.ILinkProviderService)],o)},9042:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,s,h){var l=this&&this.__decorate||function(p,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,o,c,i);else for(var S=p.length-1;S>=0;S--)(a=p[S])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(p,o){return function(c,i){o(c,i,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=h(511),_=h(2585);let m=s.OscLinkProvider=class{constructor(p,o,c){this._bufferService=p,this._optionsService=o,this._oscLinkService=c}provideLinks(p,o){var k;const c=this._bufferService.buffer.lines.get(p-1);if(!c)return void o(void 0);const i=[],a=this._optionsService.rawOptions.linkHandler,f=new u.CellData,y=c.getTrimmedLength();let S=-1,w=-1,v=!1;for(let A=0;A<y;A++)if(w!==-1||c.hasContent(A)){if(c.loadCell(A,f),f.hasExtendedAttrs()&&f.extended.urlId){if(w===-1){w=A,S=f.extended.urlId;continue}v=f.extended.urlId!==S}else w!==-1&&(v=!0);if(v||w!==-1&&A===y-1){const O=(k=this._oscLinkService.getLinkData(S))==null?void 0:k.uri;if(O){const I={start:{x:w+1,y:p},end:{x:A+(v||A!==y-1?0:1),y:p}};let L=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{const $=new URL(O);["http:","https:"].includes($.protocol)||(L=!0)}catch{L=!0}L||i.push({text:O,range:I,activate:($,F)=>a?a.activate($,F,I):b(0,F),hover:($,F)=>{var U;return(U=a==null?void 0:a.hover)==null?void 0:U.call(a,$,F,I)},leave:($,F)=>{var U;return(U=a==null?void 0:a.leave)==null?void 0:U.call(a,$,F,I)}})}v=!1,f.hasExtendedAttrs()&&f.extended.urlId?(w=A,S=f.extended.urlId):(w=-1,S=-1)}}o(i)}};function b(p,o){if(confirm(`Do you want to navigate to ${o}?
|
|
4
4
|
|
|
5
|
-
WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=g=l([d(0,p.IBufferService),d(1,p.IOptionsService),d(2,p.IOscLinkService)],g)},6193:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(h,l){this._renderCallback=h,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(h,l,d){this._rowCount=d,h=h!==void 0?h:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 h=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const l=h(3614),d=h(3656),u=h(3551),p=h(9042),g=h(3730),S=h(1680),m=h(3107),o=h(5744),c=h(2950),i=h(1296),a=h(428),f=h(4269),y=h(5114),b=h(8934),w=h(3230),v=h(9312),k=h(4725),A=h(6731),O=h(8055),I=h(8969),L=h(8460),z=h(844),F=h(6114),W=h(8437),V=h(2584),U=h(7399),x=h(5941),R=h(9074),T=h(2585),B=h(5435),N=h(4567),Z=h(779);class G extends I.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(P={}){super(P),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,j)=>this.refresh(D,j))),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,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,z.toDisposable)(()=>{var D,j;this._customKeyEventHandler=void 0,(j=(D=this.element)==null?void 0:D.parentNode)==null||j.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const D of P){let j,H="";switch(D.index){case 256:j="foreground",H="10";break;case 257:j="background",H="11";break;case 258:j="cursor",H="12";break;default:j="ansi",H="4;"+D.index}switch(D.type){case 0:const K=O.color.toColorRGB(j==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[j]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${H};${(0,x.toRgbString)(K)}${V.C1_ESCAPED.ST}`);break;case 1:if(j==="ansi")this._themeService.modifyColors(q=>q.ansi[D.index]=O.channels.toColor(...D.color));else{const q=j;this._themeService.modifyColors(ee=>ee[q]=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(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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 P=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(P);if(!D)return;const j=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,K=D.getWidth(j),q=this._renderService.dimensions.css.cell.width*K,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,se=j*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=q+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,l.copyHandler)(D,this._selectionService)}));const P=D=>(0,l.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,d.addDisposableDomListener)(this.element,"paste",P)),F.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,l.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var j;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((j=this.element)==null?void 0:j.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.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,d.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),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",p.promptLabel),F.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(f.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,D=this.element;function j(q){const ee=P._mouseService.getMouseReportCoords(q,P.screenElement);if(!ee)return!1;let se,ne;switch(q.overrideType||q.type){case"mousemove":ne=32,q.buttons===void 0?(se=3,q.button!==void 0&&(se=q.button<3?q.button:3)):se=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":ne=0,se=q.button<3?q.button:3;break;case"mousedown":ne=1,se=q.button<3?q.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(q)===!1||P.viewport.getLinesScrolled(q)===0)return!1;ne=q.deltaY<0?0:1,se=4;break;default:return!1}return!(ne===void 0||se===void 0||se>4)&&P.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:se,action:ne,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:q=>(j(q),q.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(q)),wheel:q=>(j(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&j(q)},mousemove:q=>{q.buttons||j(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?H.mousemove||(D.addEventListener("mousemove",K.mousemove),H.mousemove=K.mousemove):(D.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&q?H.wheel||(D.addEventListener("wheel",K.wheel,{passive:!1}),H.wheel=K.wheel):(D.removeEventListener("wheel",H.wheel),H.wheel=null),2&q?H.mouseup||(H.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&q?H.mousedrag||(H.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(D,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return j(q),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(q)})),this.register((0,d.addDisposableDomListener)(D,"wheel",q=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(q);if(ee===0)return;const se=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let ne="";for(let ce=0;ce<Math.abs(ee);ce++)ne+=se;return this.coreService.triggerDataEvent(ne,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(D,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,d.addDisposableDomListener)(D,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(P,D){var j;(j=this._renderService)==null||j.refreshRows(P,D)}updateCursorStyle(P){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(P)?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(P,D,j=0){var H;j===1?(super.scrollLines(P,D,j),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(P)}paste(P){(0,l.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,D,j){this._selectionService.setSelection(P,D,j)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,D){var j;(j=this._selectionService)==null||j.selectLines(P,D)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!D&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const j=(0,U.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),j.type===3||j.type===2){const H=this.rows-1;return this.scrollLines(j.type===2?-H:H),this.cancel(P,!0)}return j.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(j.cancel&&this.cancel(P,!0),!j.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(j.key!==V.C0.ETX&&j.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:j.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(j.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,D){const j=P.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||P.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||P.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?j:j&&(!D.keyCode||D.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)D=P.charCode;else if(P.which===null||P.which===void 0)D=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;D=P.which}return!(!D||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=P.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(P),!0}return!1}resize(P,D){P!==this.cols||D!==this.rows?super.resize(P,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,D){var j,H;(j=this._charSizeService)==null||j.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var P;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(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var D,j;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(j=this.viewport)==null||j.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),j=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${j};${D}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${K};${H}t`)}}cancel(P,D){if(this.options.cancelEvents||D)return P.preventDefault(),P.stopPropagation(),!1}}n.Terminal=G},9924:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(h,l=1e3){this._renderCallback=h,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,l,d){this._rowCount=d,h=h!==void 0?h:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=u-this._lastRefreshMs,g=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,l)}}},1680:function(C,n,h){var l=this&&this.__decorate||function(c,i,a,f){var y,b=arguments.length,w=b<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(b<3?y(w):b>3?y(i,a,w):y(i,a))||w);return b>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const u=h(3656),p=h(4725),g=h(8460),S=h(844),m=h(2585);let o=n.Viewport=class extends S.Disposable{constructor(c,i,a,f,y,b,w,v){super(),this._viewportElement=c,this._scrollArea=i,this._bufferService=a,this._optionsService=f,this._charSizeService=y,this._renderService=b,this._coreBrowserService=w,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(v.colors),this.register(v.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)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 i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,i){const a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&a<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const i=this._getPixelsScrolled(c);return i!==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+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(c,i))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let i=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(c,i){var v;let a,f="";const y=[],b=i??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let k=c;k<b;k++){const A=w.get(k);if(!A)continue;const O=(v=w.get(k+1))==null?void 0:v.isWrapped;if(f+=A.translateToString(!O),!O||k===w.length-1){const I=document.createElement("div");I.textContent=f,y.push(I),f.length>0&&(a=I),f=""}}return{bufferElements:y,cursorElement:a}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let i=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(c,i){const a=this._optionsService.rawOptions.fastScrollModifier;return a==="alt"&&i.altKey||a==="ctrl"&&i.ctrlKey||a==="shift"&&i.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const i=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(c,i))}};n.Viewport=o=l([d(2,m.IBufferService),d(3,m.IOptionsService),d(4,p.ICharSizeService),d(5,p.IRenderService),d(6,p.ICoreBrowserService),d(7,p.IThemeService)],o)},3107:function(C,n,h){var l=this&&this.__decorate||function(m,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,o,c,i);else for(var b=m.length-1;b>=0;b--)(a=m[b])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(m,o){return function(c,i){o(c,i,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const u=h(4725),p=h(844),g=h(2585);let S=n.BufferDecorationRenderer=class extends p.Disposable{constructor(m,o,c,i,a){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=c,this._decorationService=i,this._renderService=a,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(f=>this._removeDecoration(f))),this.register((0,p.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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var i;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((i=m==null?void 0:m.options)==null?void 0:i.layer)==="top"),o.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=m.options.x??0;return c&&c>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(m,o),o}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let c=this._decorationElements.get(m);c||(c=this._createElement(m),m.element=c,this._decorationElements.set(m,c),this._container.appendChild(c),m.onDispose(()=>{this._decorationElements.delete(m),c.remove()})),c.style.top=o*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(c)}}_refreshXPosition(m,o=m.element){if(!o)return;const c=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var o;(o=this._decorationElements.get(m))==null||o.remove(),this._decorationElements.delete(m),m.dispose()}};n.BufferDecorationRenderer=S=l([d(1,g.IBufferService),d(2,u.ICoreBrowserService),d(3,g.IDecorationService),d(4,u.IRenderService)],S)},5871:(C,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(h){if(h.options.overviewRulerOptions){for(const l of this._zones)if(l.color===h.options.overviewRulerOptions.color&&l.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,h.marker.line))return;if(this._lineAdjacentToZone(l,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(l,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,l){return l>=h.startBufferLine&&l<=h.endBufferLine}_lineAdjacentToZone(h,l,d){return l>=h.startBufferLine-this._linePadding[d||"full"]&&l<=h.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(h,l){h.startBufferLine=Math.min(h.startBufferLine,l),h.endBufferLine=Math.max(h.endBufferLine,l)}}},5744:function(C,n,h){var l=this&&this.__decorate||function(a,f,y,b){var w,v=arguments.length,k=v<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,f,y,b);else for(var A=a.length-1;A>=0;A--)(w=a[A])&&(k=(v<3?w(k):v>3?w(f,y,k):w(f,y))||k);return v>3&&k&&Object.defineProperty(f,y,k),k},d=this&&this.__param||function(a,f){return function(y,b){f(y,b,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const u=h(5871),p=h(4725),g=h(844),S=h(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let i=n.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(a,f,y,b,w,v,k){var O;super(),this._viewportElement=a,this._screenElement=f,this._bufferService=y,this._decorationService=b,this._renderService=w,this._optionsService=v,this._coreBrowserService=k,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var I;(I=this._canvas)==null||I.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 a=Math.floor(this._canvas.width/3),f=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=a,o.center=f,o.right=a,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=o.left,c.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const a=this._canvas.height/this._bufferService.buffer.lines.length,f=Math.round(Math.max(Math.min(a,12),6)*this._coreBrowserService.dpr);m.left=f,m.center=f,m.right=f}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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 f of this._decorationService.decorations)this._colorZoneStore.addDecoration(f);this._ctx.lineWidth=1;const a=this._colorZoneStore.zones;for(const f of a)f.position!=="full"&&this._renderColorZone(f);for(const f of a)f.position==="full"&&this._renderColorZone(f);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(a){this._ctx.fillStyle=a.color,this._ctx.fillRect(c[a.position||"full"],Math.round((this._canvas.height-1)*(a.startBufferLine/this._bufferService.buffers.active.lines.length)-m[a.position||"full"]/2),o[a.position||"full"],Math.round((this._canvas.height-1)*((a.endBufferLine-a.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[a.position||"full"]))}_queueRefresh(a,f){this._shouldUpdateDimensions=a||this._shouldUpdateDimensions,this._shouldUpdateAnchor=f||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=i=l([d(2,S.IBufferService),d(3,S.IDecorationService),d(4,p.IRenderService),d(5,S.IOptionsService),d(6,p.ICoreBrowserService)],i)},2950:function(C,n,h){var l=this&&this.__decorate||function(m,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,o,c,i);else for(var b=m.length-1;b>=0;b--)(a=m[b])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(m,o){return function(c,i){o(c,i,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const u=h(4725),p=h(2585),g=h(2584);let S=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,c,i,a,f){this._textarea=m,this._compositionView=o,this._bufferService=c,this._optionsService=i,this._coreService=a,this._renderService=f,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const o=this._textarea.value,c=o.replace(m,"");this._dataAlreadySent=c,o.length>m.length?this._coreService.triggerDataEvent(c,!0):o.length<m.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}},0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const f=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(f.width,1)+"px",this._textarea.style.height=Math.max(f.height,1)+"px",this._textarea.style.lineHeight=f.height+"px"}m||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=S=l([d(2,p.IBufferService),d(3,p.IOptionsService),d(4,p.ICoreService),d(5,u.IRenderService)],S)},9806:(C,n)=>{function h(l,d,u){const p=u.getBoundingClientRect(),g=l.getComputedStyle(u),S=parseInt(g.getPropertyValue("padding-left")),m=parseInt(g.getPropertyValue("padding-top"));return[d.clientX-p.left-S,d.clientY-p.top-m]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=h,n.getCoords=function(l,d,u,p,g,S,m,o,c){if(!S)return;const i=h(l,d,u);return i?(i[0]=Math.ceil((i[0]+(c?m/2:0))/m),i[1]=Math.ceil(i[1]/o),i[0]=Math.min(Math.max(i[0],1),p+(c?1:0)),i[1]=Math.min(Math.max(i[1],1),g),i):void 0}},9504:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const l=h(2584);function d(o,c,i,a){const f=o-u(o,i),y=c-u(c,i),b=Math.abs(f-y)-function(w,v,k){let A=0;const O=w-u(w,k),I=v-u(v,k);for(let L=0;L<Math.abs(O-I);L++){const z=p(w,v)==="A"?-1:1,F=k.buffer.lines.get(O+z*L);F!=null&&F.isWrapped&&A++}return A}(o,c,i);return m(b,S(p(o,c),a))}function u(o,c){let i=0,a=c.buffer.lines.get(o),f=a==null?void 0:a.isWrapped;for(;f&&o>=0&&o<c.rows;)i++,a=c.buffer.lines.get(--o),f=a==null?void 0:a.isWrapped;return i}function p(o,c){return o>c?"A":"B"}function g(o,c,i,a,f,y){let b=o,w=c,v="";for(;b!==i||w!==a;)b+=f?1:-1,f&&b>y.cols-1?(v+=y.buffer.translateBufferLineToString(w,!1,o,b),b=0,o=0,w++):!f&&b<0&&(v+=y.buffer.translateBufferLineToString(w,!1,0,o+1),b=y.cols-1,o=b,w--);return v+y.buffer.translateBufferLineToString(w,!1,o,b)}function S(o,c){const i=c?"O":"[";return l.C0.ESC+i+o}function m(o,c){o=Math.floor(o);let i="";for(let a=0;a<o;a++)i+=c;return i}n.moveToCellSequence=function(o,c,i,a){const f=i.buffer.x,y=i.buffer.y;if(!i.buffer.hasScrollback)return function(v,k,A,O,I,L){return d(k,O,I,L).length===0?"":m(g(v,k,v,k-u(k,I),!1,I).length,S("D",L))}(f,y,0,c,i,a)+d(y,c,i,a)+function(v,k,A,O,I,L){let z;z=d(k,O,I,L).length>0?O-u(O,I):k;const F=O,W=function(V,U,x,R,T,B){let N;return N=d(x,R,T,B).length>0?R-u(R,T):U,V<x&&N<=R||V>=x&&N<R?"C":"D"}(v,k,A,O,I,L);return m(g(v,z,A,F,W==="C",I).length,S(W,L))}(f,y,o,c,i,a);let b;if(y===c)return b=f>o?"D":"C",m(Math.abs(f-o),S(b,a));b=y>c?"D":"C";const w=Math.abs(y-c);return m(function(v,k){return k.cols-v}(y>c?o:f,i)+(w-1)*i.cols+1+((y>c?f:o)-1),S(b,a))}},1296:function(C,n,h){var l=this&&this.__decorate||function(L,z,F,W){var V,U=arguments.length,x=U<3?z:W===null?W=Object.getOwnPropertyDescriptor(z,F):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(L,z,F,W);else for(var R=L.length-1;R>=0;R--)(V=L[R])&&(x=(U<3?V(x):U>3?V(z,F,x):V(z,F))||x);return U>3&&x&&Object.defineProperty(z,F,x),x},d=this&&this.__param||function(L,z){return function(F,W){z(F,W,L)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const u=h(3787),p=h(2550),g=h(2223),S=h(6171),m=h(6052),o=h(4725),c=h(8055),i=h(8460),a=h(844),f=h(2585),y="xterm-dom-renderer-owner-",b="xterm-rows",w="xterm-fg-",v="xterm-bg-",k="xterm-focus",A="xterm-selection";let O=1,I=n.DomRenderer=class extends a.Disposable{constructor(L,z,F,W,V,U,x,R,T,B,N,Z,G){super(),this._terminal=L,this._document=z,this._element=F,this._screenElement=W,this._viewportElement=V,this._helperContainer=U,this._linkifier2=x,this._charSizeService=T,this._optionsService=B,this._bufferService=N,this._coreBrowserService=Z,this._themeService=G,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(A),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(J=>this._injectCss(J))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(J=>this._handleLinkHover(J))),this.register(this._linkifier2.onHideLinkUnderline(J=>this._handleLinkLeave(J))),this.register((0,a.toDisposable)(()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new p.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 L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const z=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=z,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(L){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let z=`${this._terminalSelector} .${b} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;z+=`${this._terminalSelector} .${b} .xterm-dim { color: ${c.color.multiplyOpacity(L.foreground,.5).css};}`,z+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;z+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,z+=`@keyframes ${W} { 50% { box-shadow: none; }}`,z+=`@keyframes ${V} { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,z+=`${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,z+=`${this._terminalSelector} .${A} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${A} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${A} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[U,x]of L.ansi.entries())z+=`${this._terminalSelector} .${w}${U} { color: ${x.css}; }${this._terminalSelector} .${w}${U}.xterm-dim { color: ${c.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${v}${U} { background-color: ${x.css}; }`;z+=`${this._terminalSelector} .${w}${g.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(L.background).css}; }${this._terminalSelector} .${w}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${v}${g.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=z}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,z){for(let F=this._rowElements.length;F<=z;F++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,z){this._refreshRowElements(L,z),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,z,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,z,F),this.renderRows(0,this._bufferService.rows-1),!L||!z)return;this._selectionRenderModel.update(this._terminal,L,z,F);const W=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||x<0)return;const R=this._document.createDocumentFragment();if(F){const T=L[0]>z[0];R.appendChild(this._createSelectionElement(U,T?z[0]:L[0],T?L[0]:z[0],x-U+1))}else{const T=W===U?L[0]:0,B=U===V?z[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(U,T,B));const N=x-U-1;if(R.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,N)),U!==x){const Z=V===x?z[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(x,0,Z))}}this._selectionContainer.appendChild(R)}_createSelectionElement(L,z,F,W=1){const V=this._document.createElement("div"),U=z*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(F-z);return U+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-U),V.style.height=W*this.dimensions.css.cell.height+"px",V.style.top=L*this.dimensions.css.cell.height+"px",V.style.left=`${U}px`,V.style.width=`${x}px`,V}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 L of this._rowElements)L.replaceChildren()}renderRows(L,z){const F=this._bufferService.buffer,W=F.ybase+F.y,V=Math.min(F.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=L;T<=z;T++){const B=T+F.ydisp,N=this._rowElements[T],Z=F.lines.get(B);if(!N||!Z)break;N.replaceChildren(...this._rowFactory.createRow(Z,B,B===W,x,R,V,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,z,F,W,V,U){F<0&&(L=0),W<0&&(z=0);const x=this._bufferService.rows-1;F=Math.max(Math.min(F,x),0),W=Math.max(Math.min(W,x),0),V=Math.min(V,this._bufferService.cols);const R=this._bufferService.buffer,T=R.ybase+R.y,B=Math.min(R.x,V-1),N=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=F;J<=W;++J){const P=J+R.ydisp,D=this._rowElements[J],j=R.lines.get(P);if(!D||!j)break;D.replaceChildren(...this._rowFactory.createRow(j,P,P===T,Z,G,B,N,this.dimensions.css.cell.width,this._widthCache,U?J===F?L:0:-1,U?(J===W?z:V)-1:-1))}}};n.DomRenderer=I=l([d(7,f.IInstantiationService),d(8,o.ICharSizeService),d(9,f.IOptionsService),d(10,f.IBufferService),d(11,o.ICoreBrowserService),d(12,o.IThemeService)],I)},3787:function(C,n,h){var l=this&&this.__decorate||function(b,w,v,k){var A,O=arguments.length,I=O<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,v):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(b,w,v,k);else for(var L=b.length-1;L>=0;L--)(A=b[L])&&(I=(O<3?A(I):O>3?A(w,v,I):A(w,v))||I);return O>3&&I&&Object.defineProperty(w,v,I),I},d=this&&this.__param||function(b,w){return function(v,k){w(v,k,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const u=h(2223),p=h(643),g=h(511),S=h(2585),m=h(8055),o=h(4725),c=h(4269),i=h(6171),a=h(3734);let f=n.DomRendererRowFactory=class{constructor(b,w,v,k,A,O,I){this._document=b,this._characterJoinerService=w,this._optionsService=v,this._coreBrowserService=k,this._coreService=A,this._decorationService=O,this._themeService=I,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,w,v){this._selectionStart=b,this._selectionEnd=w,this._columnSelectMode=v}createRow(b,w,v,k,A,O,I,L,z,F,W){const V=[],U=this._characterJoinerService.getJoinedCharacters(w),x=this._themeService.colors;let R,T=b.getNoBgTrimmedLength();v&&T<O+1&&(T=O+1);let B=0,N="",Z=0,G=0,J=0,P=!1,D=0,j=!1,H=0;const K=[],q=F!==-1&&W!==-1;for(let ee=0;ee<T;ee++){b.loadCell(ee,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let ne=!1,ce=ee,Y=this._workCell;if(U.length>0&&ee===U[0][0]){ne=!0;const ie=U.shift();Y=new c.JoinedCellData(this._workCell,b.translateToString(!0,ie[0],ie[1]),ie[1]-ie[0]),ce=ie[1]-1,se=Y.getWidth()}const Ge=this._isCellInSelection(ee,w),Yt=v&&ee===O,Xt=q&&ee>=F&&ee<=W;let Qt=!1;this._decorationService.forEachDecorationAtCell(ee,w,void 0,ie=>{Qt=!0});let ft=Y.getChars()||p.WHITESPACE_CELL_CHAR;if(ft===" "&&(Y.isUnderline()||Y.isOverline())&&(ft=" "),H=se*L-z.get(ft,Y.isBold(),Y.isItalic()),R){if(B&&(Ge&&j||!Ge&&!j&&Y.bg===Z)&&(Ge&&j&&x.selectionForeground||Y.fg===G)&&Y.extended.ext===J&&Xt===P&&H===D&&!Yt&&!ne&&!Qt){Y.isInvisible()?N+=p.WHITESPACE_CELL_CHAR:N+=ft,B++;continue}B&&(R.textContent=N),R=this._document.createElement("span"),B=0,N=""}else R=this._document.createElement("span");if(Z=Y.bg,G=Y.fg,J=Y.extended.ext,P=Xt,D=H,j=Ge,ne&&O>=ee&&O<=ce&&(O=ee),!this._coreService.isCursorHidden&&Yt&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)I&&K.push("xterm-cursor-blink"),K.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline")}}if(Y.isBold()&&K.push("xterm-bold"),Y.isItalic()&&K.push("xterm-italic"),Y.isDim()&&K.push("xterm-dim"),N=Y.isInvisible()?p.WHITESPACE_CELL_CHAR:Y.getChars()||p.WHITESPACE_CELL_CHAR,Y.isUnderline()&&(K.push(`xterm-underline-${Y.extended.underlineStyle}`),N===" "&&(N=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${a.AttributeData.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let ie=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&ie<8&&(ie+=8),R.style.textDecorationColor=x.ansi[ie].css}Y.isOverline()&&(K.push("xterm-overline"),N===" "&&(N=" ")),Y.isStrikethrough()&&K.push("xterm-strikethrough"),Xt&&(R.style.textDecoration="underline");let ue=Y.getFgColor(),Je=Y.getFgColorMode(),me=Y.getBgColor(),Ye=Y.getBgColorMode();const er=!!Y.isInverse();if(er){const ie=ue;ue=me,me=ie;const Fc=Je;Je=Ye,Ye=Fc}let Ee,_t,ke,Xe=!1;switch(this._decorationService.forEachDecorationAtCell(ee,w,void 0,ie=>{ie.options.layer!=="top"&&Xe||(ie.backgroundColorRGB&&(Ye=50331648,me=ie.backgroundColorRGB.rgba>>8&16777215,Ee=ie.backgroundColorRGB),ie.foregroundColorRGB&&(Je=50331648,ue=ie.foregroundColorRGB.rgba>>8&16777215,_t=ie.foregroundColorRGB),Xe=ie.options.layer==="top")}),!Xe&&Ge&&(Ee=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,me=Ee.rgba>>8&16777215,Ye=50331648,Xe=!0,x.selectionForeground&&(Je=50331648,ue=x.selectionForeground.rgba>>8&16777215,_t=x.selectionForeground)),Xe&&K.push("xterm-decoration-top"),Ye){case 16777216:case 33554432:ke=x.ansi[me],K.push(`xterm-bg-${me}`);break;case 50331648:ke=m.channels.toColor(me>>16,me>>8&255,255&me),this._addStyle(R,`background-color:#${y((me>>>0).toString(16),"0",6)}`);break;default:er?(ke=x.foreground,K.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):ke=x.background}switch(Ee||Y.isDim()&&(Ee=m.color.multiplyOpacity(ke,.5)),Je){case 16777216:case 33554432:Y.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(R,ke,x.ansi[ue],Y,Ee,void 0)||K.push(`xterm-fg-${ue}`);break;case 50331648:const ie=m.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(R,ke,ie,Y,Ee,_t)||this._addStyle(R,`color:#${y(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ke,x.foreground,Y,Ee,_t)||er&&K.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}K.length&&(R.className=K.join(" "),K.length=0),Yt||ne||Qt?R.textContent=N:B++,H!==this.defaultSpacing&&(R.style.letterSpacing=`${H}px`),V.push(R),ee=ce}return R&&B&&(R.textContent=N),V}_applyMinimumContrast(b,w,v,k,A,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const I=this._getContrastCache(k);let L;if(A||O||(L=I.getColor(w.rgba,v.rgba)),L===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);L=m.color.ensureContrastRatio(A||w,O||v,z),I.setColor((A||w).rgba,(O||v).rgba,L??null)}return!!L&&(this._addStyle(b,`color:${L.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,w){b.setAttribute("style",`${b.getAttribute("style")||""}${w};`)}_isCellInSelection(b,w){const v=this._selectionStart,k=this._selectionEnd;return!(!v||!k)&&(this._columnSelectMode?v[0]<=k[0]?b>=v[0]&&w>=v[1]&&b<k[0]&&w<=k[1]:b<v[0]&&w>=v[1]&&b>=k[0]&&w<=k[1]:w>v[1]&&w<k[1]||v[1]===k[1]&&w===v[1]&&b>=v[0]&&b<k[0]||v[1]<k[1]&&w===k[1]&&b<k[0]||v[1]<k[1]&&w===v[1]&&b>=v[0])}};function y(b,w,v){for(;b.length<v;)b=w+b;return b}n.DomRendererRowFactory=f=l([d(1,o.ICharacterJoinerService),d(2,S.IOptionsService),d(3,o.ICoreBrowserService),d(4,S.ICoreService),d(5,S.IDecorationService),d(6,o.IThemeService)],f)},2550:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(h,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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 d=h.createElement("span");d.classList.add("xterm-char-measure-element");const u=h.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const p=h.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const g=h.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[d,u,p,g],this._container.appendChild(d),this._container.appendChild(u),this._container.appendChild(p),this._container.appendChild(g),l.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(h,l,d,u){h===this._font&&l===this._fontSize&&d===this._weight&&u===this._weightBold||(this._font=h,this._fontSize=l,this._weight=d,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(h,l,d){let u=0;if(!l&&!d&&h.length===1&&(u=h.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const S=this._measure(h,0);return S>0&&(this._flat[u]=S),S}let p=h;l&&(p+="B"),d&&(p+="I");let g=this._holey.get(p);if(g===void 0){let S=0;l&&(S|=1),d&&(S|=2),g=this._measure(h,S),g>0&&this._holey.set(p,g)}return g}_measure(h,l){const d=this._measureElements[l];return d.textContent=h.repeat(32),d.offsetWidth/32}}},2223:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const l=h(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(C,n)=>{function h(d){return 57508<=d&&d<=57558}function l(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=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(d){if(!d)throw new Error("value must not be falsy");return d},n.isPowerlineGlyph=h,n.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},n.isEmoji=l,n.allowRescaling=function(d,u,p,g){return u===1&&p>Math.ceil(1.5*g)&&d!==void 0&&d>255&&!l(d)&&!h(d)&&!function(S){return 57344<=S&&S<=63743}(d)},n.treatGlyphAsBackgroundColor=function(d){return h(d)||function(u){return 9472<=u&&u<=9631}(d)},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(d,u,p=0){return(d-(2*Math.round(u)-p))%(2*Math.round(u))}},6052:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class h{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(d,u,p,g=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const S=d.buffers.active.ydisp,m=u[1]-S,o=p[1]-S,c=Math.max(m,0),i=Math.min(o,d.rows-1);c>=d.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=i,this.startCol=u[0],this.endCol=p[0])}isCellSelected(d,u,p){return!!this.hasSelection&&(p-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}n.createSelectionRenderModel=function(){return new h}},456:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,l=this.selectionEnd;return!(!h||!l)&&(h[1]>l[1]||h[1]===l[1]&&h[0]>l[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,n,h){var l=this&&this.__decorate||function(i,a,f,y){var b,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(b=i[k])&&(v=(w<3?b(v):w>3?b(a,f,v):b(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const u=h(2585),p=h(8460),g=h(844);let S=n.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,a,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new o(i,a,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};n.CharSizeService=S=l([d(2,u.IOptionsService)],S);class m extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(a,f){a!==void 0&&a>0&&f!==void 0&&f>0&&(this._result.width=a,this._result.height=f)}}class o extends m{constructor(a,f,y){super(),this._document=a,this._parentElement=f,this._optionsService=y,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 c extends m{constructor(a){super(),this._optionsService=a,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const f=this._ctx.measureText("W");if(!("width"in f&&"fontBoundingBoxAscent"in f&&"fontBoundingBoxDescent"in f))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const a=this._ctx.measureText("W");return this._validateAndSet(a.width,a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),this._result}}},4269:function(C,n,h){var l=this&&this.__decorate||function(c,i,a,f){var y,b=arguments.length,w=b<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(b<3?y(w):b>3?y(i,a,w):y(i,a))||w);return b>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const u=h(3734),p=h(643),g=h(511),S=h(2585);class m extends u.AttributeData{constructor(i,a,f){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=a,this._width=f}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=m;let o=n.CharacterJoinerService=class Ps{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(i){const a={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(a),a.id}deregister(i){for(let a=0;a<this._characterJoiners.length;a++)if(this._characterJoiners[a].id===i)return this._characterJoiners.splice(a,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const a=this._bufferService.buffer.lines.get(i);if(!a||a.length===0)return[];const f=[],y=a.translateToString(!0);let b=0,w=0,v=0,k=a.getFg(0),A=a.getBg(0);for(let O=0;O<a.getTrimmedLength();O++)if(a.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==A){if(O-b>1){const I=this._getJoinedRanges(y,v,w,a,b);for(let L=0;L<I.length;L++)f.push(I[L])}b=O,v=w,k=this._workCell.fg,A=this._workCell.bg}w+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const O=this._getJoinedRanges(y,v,w,a,b);for(let I=0;I<O.length;I++)f.push(O[I])}return f}_getJoinedRanges(i,a,f,y,b){const w=i.substring(a,f);let v=[];try{v=this._characterJoiners[0].handler(w)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const A=this._characterJoiners[k].handler(w);for(let O=0;O<A.length;O++)Ps._mergeRanges(v,A[O])}catch(A){console.error(A)}return this._stringRangesToCellRanges(v,y,b),v}_stringRangesToCellRanges(i,a,f){let y=0,b=!1,w=0,v=i[y];if(v){for(let k=f;k<this._bufferService.cols;k++){const A=a.getWidth(k),O=a.getString(k).length||p.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!b&&v[0]<=w&&(v[0]=k,b=!0),v[1]<=w){if(v[1]=k,v=i[++y],!v)break;v[0]<=w?(v[0]=k,b=!0):b=!1}w+=O}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(i,a){let f=!1;for(let y=0;y<i.length;y++){const b=i[y];if(f){if(a[1]<=b[0])return i[y-1][1]=a[1],i;if(a[1]<=b[1])return i[y-1][1]=Math.max(a[1],b[1]),i.splice(y,1),i;i.splice(y,1),y--}else{if(a[1]<=b[0])return i.splice(y,0,a),i;if(a[1]<=b[1])return b[0]=Math.min(a[0],b[0]),i;a[0]<b[1]&&(b[0]=Math.min(a[0],b[0]),f=!0)}}return f?i[i.length-1][1]=a[1]:i.push(a),i}};n.CharacterJoinerService=o=l([d(0,S.IBufferService)],o)},5114:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const l=h(844),d=h(8460),u=h(3656);class p extends l.Disposable{constructor(m,o,c){super(),this._textarea=m,this._window=o,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this.register((0,d.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(m){this._window!==m&&(this._window=m,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=p;class g extends l.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)(()=>this.clearListener()))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const l=h(844);class d extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const g=this.linkProviders.indexOf(p);g!==-1&&this.linkProviders.splice(g,1)}}}}n.LinkProviderService=d},8934:function(C,n,h){var l=this&&this.__decorate||function(S,m,o,c){var i,a=arguments.length,f=a<3?m:c===null?c=Object.getOwnPropertyDescriptor(m,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(S,m,o,c);else for(var y=S.length-1;y>=0;y--)(i=S[y])&&(f=(a<3?i(f):a>3?i(m,o,f):i(m,o))||f);return a>3&&f&&Object.defineProperty(m,o,f),f},d=this&&this.__param||function(S,m){return function(o,c){m(o,c,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const u=h(4725),p=h(9806);let g=n.MouseService=class{constructor(S,m){this._renderService=S,this._charSizeService=m}getCoords(S,m,o,c,i){return(0,p.getCoords)(window,S,m,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(S,m){const o=(0,p.getCoordsRelativeToElement)(window,S,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};n.MouseService=g=l([d(0,u.IRenderService),d(1,u.ICharSizeService)],g)},3230:function(C,n,h){var l=this&&this.__decorate||function(i,a,f,y){var b,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(b=i[k])&&(v=(w<3?b(v):w>3?b(a,f,v):b(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const u=h(6193),p=h(4725),g=h(8460),S=h(844),m=h(7226),o=h(2585);let c=n.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,a,f,y,b,w,v,k){super(),this._rowCount=i,this._charSizeService=y,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((A,O)=>this._renderRows(A,O),v),this.register(this._renderDebouncer),this.register(v.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(w.onResize(()=>this._fullRefresh())),this.register(w.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)==null?void 0:A.clear()})),this.register(f.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()})),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(w.buffer.y,w.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(v.window,a),this.register(v.onWindowChange(A=>this._registerIntersectionObserver(A,a)))}_registerIntersectionObserver(i,a){if("IntersectionObserver"in i){const f=new i.IntersectionObserver(y=>this._handleIntersectionChange(y[y.length-1]),{threshold:0});f.observe(a),this._observerDisposable.value=(0,S.toDisposable)(()=>f.disconnect())}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,a,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,a,this._rowCount))}_renderRows(i,a){this._renderer.value&&(i=Math.min(i,this._rowCount-1),a=Math.min(a,this._rowCount-1),this._renderer.value.renderRows(i,a),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:a}),this._onRender.fire({start:i,end:a}),this._isNextRenderRedrawOnly=!0)}resize(i,a){this._rowCount=a,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw(a=>this.refreshRows(a.start,a.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,a;this._renderer.value&&((a=(i=this._renderer.value).clearTextureAtlas)==null||a.call(i),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,a){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var f;return(f=this._renderer.value)==null?void 0:f.handleResize(i,a)}):this._renderer.value.handleResize(i,a),this._fullRefresh())}handleCharSizeChanged(){var i;(i=this._renderer.value)==null||i.handleCharSizeChanged()}handleBlur(){var i;(i=this._renderer.value)==null||i.handleBlur()}handleFocus(){var i;(i=this._renderer.value)==null||i.handleFocus()}handleSelectionChanged(i,a,f){var y;this._selectionState.start=i,this._selectionState.end=a,this._selectionState.columnSelectMode=f,(y=this._renderer.value)==null||y.handleSelectionChanged(i,a,f)}handleCursorMove(){var i;(i=this._renderer.value)==null||i.handleCursorMove()}clear(){var i;(i=this._renderer.value)==null||i.clear()}};n.RenderService=c=l([d(2,o.IOptionsService),d(3,p.ICharSizeService),d(4,o.IDecorationService),d(5,o.IBufferService),d(6,p.ICoreBrowserService),d(7,p.IThemeService)],c)},9312:function(C,n,h){var l=this&&this.__decorate||function(v,k,A,O){var I,L=arguments.length,z=L<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(v,k,A,O);else for(var F=v.length-1;F>=0;F--)(I=v[F])&&(z=(L<3?I(z):L>3?I(k,A,z):I(k,A))||z);return L>3&&z&&Object.defineProperty(k,A,z),z},d=this&&this.__param||function(v,k){return function(A,O){k(A,O,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const u=h(9806),p=h(9504),g=h(456),S=h(4725),m=h(8460),o=h(844),c=h(6114),i=h(4841),a=h(511),f=h(2585),y=" ",b=new RegExp(y,"g");let w=n.SelectionService=class extends o.Disposable{constructor(v,k,A,O,I,L,z,F,W){super(),this._element=v,this._screenElement=k,this._linkifier=A,this._bufferService=O,this._coreService=I,this._mouseService=L,this._optionsService=z,this._renderService=F,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(V=>this._handleTrim(V)),this.register(this._bufferService.buffers.onBufferActivate(V=>this._handleBufferActivate(V))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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,k=this._model.finalSelectionEnd;return!(!v||!k||v[0]===k[0]&&v[1]===k[1])}get selectionText(){const v=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!v||!k)return"";const A=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(v[0]===k[0])return"";const I=v[0]<k[0]?v[0]:k[0],L=v[0]<k[0]?k[0]:v[0];for(let z=v[1];z<=k[1];z++){const F=A.translateBufferLineToString(z,!0,I,L);O.push(F)}}else{const I=v[1]===k[1]?k[0]:void 0;O.push(A.translateBufferLineToString(v[1],!0,v[0],I));for(let L=v[1]+1;L<=k[1]-1;L++){const z=A.lines.get(L),F=A.translateBufferLineToString(L,!0);z!=null&&z.isWrapped?O[O.length-1]+=F:O.push(F)}if(v[1]!==k[1]){const L=A.lines.get(k[1]),z=A.translateBufferLineToString(k[1],!0,0,k[0]);L&&L.isWrapped?O[O.length-1]+=z:O.push(z)}}return O.map(I=>I.replace(b," ")).join(c.isWindows?`\r
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=m=l([d(0,_.IBufferService),d(1,_.IOptionsService),d(2,_.IOscLinkService)],m)},6193:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(h,l){this._renderCallback=h,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(h,l,d){this._rowCount=d,h=h!==void 0?h:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 h=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const l=h(3614),d=h(3656),u=h(3551),_=h(9042),m=h(3730),b=h(1680),p=h(3107),o=h(5744),c=h(2950),i=h(1296),a=h(428),f=h(4269),y=h(5114),S=h(8934),w=h(3230),v=h(9312),k=h(4725),A=h(6731),O=h(8055),I=h(8969),L=h(8460),$=h(844),F=h(6114),U=h(8437),V=h(2584),W=h(7399),x=h(5941),R=h(9074),T=h(2585),B=h(5435),N=h(4567),Z=h(779);class G extends I.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(P={}){super(P),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,j)=>this.refresh(D,j))),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,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,$.toDisposable)(()=>{var D,j;this._customKeyEventHandler=void 0,(j=(D=this.element)==null?void 0:D.parentNode)==null||j.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const D of P){let j,z="";switch(D.index){case 256:j="foreground",z="10";break;case 257:j="background",z="11";break;case 258:j="cursor",z="12";break;default:j="ansi",z="4;"+D.index}switch(D.type){case 0:const K=O.color.toColorRGB(j==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[j]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${z};${(0,x.toRgbString)(K)}${V.C1_ESCAPED.ST}`);break;case 1:if(j==="ansi")this._themeService.modifyColors(q=>q.ansi[D.index]=O.channels.toColor(...D.color));else{const q=j;this._themeService.modifyColors(ee=>ee[q]=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(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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 P=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(P);if(!D)return;const j=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,K=D.getWidth(j),q=this._renderService.dimensions.css.cell.width*K,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,se=j*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=q+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,l.copyHandler)(D,this._selectionService)}));const P=D=>(0,l.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,d.addDisposableDomListener)(this.element,"paste",P)),F.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,l.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var j;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((j=this.element)==null?void 0:j.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.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,d.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",_.promptLabel),F.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",z=>this._handleTextAreaFocus(z))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(f.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.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(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.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(k.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,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,d.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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",z=>this._handleScreenReaderModeOptionChange(z))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,D=this.element;function j(q){const ee=P._mouseService.getMouseReportCoords(q,P.screenElement);if(!ee)return!1;let se,ne;switch(q.overrideType||q.type){case"mousemove":ne=32,q.buttons===void 0?(se=3,q.button!==void 0&&(se=q.button<3?q.button:3)):se=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":ne=0,se=q.button<3?q.button:3;break;case"mousedown":ne=1,se=q.button<3?q.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(q)===!1||P.viewport.getLinesScrolled(q)===0)return!1;ne=q.deltaY<0?0:1,se=4;break;default:return!1}return!(ne===void 0||se===void 0||se>4)&&P.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:se,action:ne,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:q=>(j(q),q.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(q)),wheel:q=>(j(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&j(q)},mousemove:q=>{q.buttons||j(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?z.mousemove||(D.addEventListener("mousemove",K.mousemove),z.mousemove=K.mousemove):(D.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&q?z.wheel||(D.addEventListener("wheel",K.wheel,{passive:!1}),z.wheel=K.wheel):(D.removeEventListener("wheel",z.wheel),z.wheel=null),2&q?z.mouseup||(z.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&q?z.mousedrag||(z.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(D,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return j(q),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(q)})),this.register((0,d.addDisposableDomListener)(D,"wheel",q=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(q);if(ee===0)return;const se=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let ne="";for(let ce=0;ce<Math.abs(ee);ce++)ne+=se;return this.coreService.triggerDataEvent(ne,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(D,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,d.addDisposableDomListener)(D,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(P,D){var j;(j=this._renderService)==null||j.refreshRows(P,D)}updateCursorStyle(P){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(P)?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(P,D,j=0){var z;j===1?(super.scrollLines(P,D,j),this.refresh(0,this.rows-1)):(z=this.viewport)==null||z.scrollLines(P)}paste(P){(0,l.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,D,j){this._selectionService.setSelection(P,D,j)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,D){var j;(j=this._selectionService)==null||j.selectLines(P,D)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!D&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const j=(0,W.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),j.type===3||j.type===2){const z=this.rows-1;return this.scrollLines(j.type===2?-z:z),this.cancel(P,!0)}return j.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(j.cancel&&this.cancel(P,!0),!j.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(j.key!==V.C0.ETX&&j.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:j.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(j.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,D){const j=P.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||P.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||P.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?j:j&&(!D.keyCode||D.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)D=P.charCode;else if(P.which===null||P.which===void 0)D=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;D=P.which}return!(!D||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=P.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(P),!0}return!1}resize(P,D){P!==this.cols||D!==this.rows?super.resize(P,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,D){var j,z;(j=this._charSizeService)==null||j.measure(),(z=this.viewport)==null||z.syncScrollArea(!0)}clear(){var P;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(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var D,j;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(j=this.viewport)==null||j.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),j=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${j};${D}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${K};${z}t`)}}cancel(P,D){if(this.options.cancelEvents||D)return P.preventDefault(),P.stopPropagation(),!1}}s.Terminal=G},9924:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(h,l=1e3){this._renderCallback=h,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,l,d){this._rowCount=d,h=h!==void 0?h:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=u-this._lastRefreshMs,m=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,l)}}},1680:function(C,s,h){var l=this&&this.__decorate||function(c,i,a,f){var y,S=arguments.length,w=S<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(S<3?y(w):S>3?y(i,a,w):y(i,a))||w);return S>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=h(3656),_=h(4725),m=h(8460),b=h(844),p=h(2585);let o=s.Viewport=class extends b.Disposable{constructor(c,i,a,f,y,S,w,v){super(),this._viewportElement=c,this._scrollArea=i,this._bufferService=a,this._optionsService=f,this._charSizeService=y,this._renderService=S,this._coreBrowserService=w,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(v.colors),this.register(v.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)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 i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,i){const a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&a<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const i=this._getPixelsScrolled(c);return i!==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+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(c,i))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let i=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(c,i){var v;let a,f="";const y=[],S=i??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let k=c;k<S;k++){const A=w.get(k);if(!A)continue;const O=(v=w.get(k+1))==null?void 0:v.isWrapped;if(f+=A.translateToString(!O),!O||k===w.length-1){const I=document.createElement("div");I.textContent=f,y.push(I),f.length>0&&(a=I),f=""}}return{bufferElements:y,cursorElement:a}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let i=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(c,i){const a=this._optionsService.rawOptions.fastScrollModifier;return a==="alt"&&i.altKey||a==="ctrl"&&i.ctrlKey||a==="shift"&&i.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const i=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(c,i))}};s.Viewport=o=l([d(2,p.IBufferService),d(3,p.IOptionsService),d(4,_.ICharSizeService),d(5,_.IRenderService),d(6,_.ICoreBrowserService),d(7,_.IThemeService)],o)},3107:function(C,s,h){var l=this&&this.__decorate||function(p,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,o,c,i);else for(var S=p.length-1;S>=0;S--)(a=p[S])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(p,o){return function(c,i){o(c,i,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=h(4725),_=h(844),m=h(2585);let b=s.BufferDecorationRenderer=class extends _.Disposable{constructor(p,o,c,i,a){super(),this._screenElement=p,this._bufferService=o,this._coreBrowserService=c,this._decorationService=i,this._renderService=a,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(f=>this._removeDecoration(f))),this.register((0,_.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 p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){var i;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((i=p==null?void 0:p.options)==null?void 0:i.layer)==="top"),o.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=p.options.x??0;return c&&c>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(p,o),o}_refreshStyle(p){const o=p.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let c=this._decorationElements.get(p);c||(c=this._createElement(p),p.element=c,this._decorationElements.set(p,c),this._container.appendChild(c),p.onDispose(()=>{this._decorationElements.delete(p),c.remove()})),c.style.top=o*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(c)}}_refreshXPosition(p,o=p.element){if(!o)return;const c=p.options.x??0;(p.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){var o;(o=this._decorationElements.get(p))==null||o.remove(),this._decorationElements.delete(p),p.dispose()}};s.BufferDecorationRenderer=b=l([d(1,m.IBufferService),d(2,u.ICoreBrowserService),d(3,m.IDecorationService),d(4,u.IRenderService)],b)},5871:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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(h){if(h.options.overviewRulerOptions){for(const l of this._zones)if(l.color===h.options.overviewRulerOptions.color&&l.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,h.marker.line))return;if(this._lineAdjacentToZone(l,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(l,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,l){return l>=h.startBufferLine&&l<=h.endBufferLine}_lineAdjacentToZone(h,l,d){return l>=h.startBufferLine-this._linePadding[d||"full"]&&l<=h.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(h,l){h.startBufferLine=Math.min(h.startBufferLine,l),h.endBufferLine=Math.max(h.endBufferLine,l)}}},5744:function(C,s,h){var l=this&&this.__decorate||function(a,f,y,S){var w,v=arguments.length,k=v<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,f,y,S);else for(var A=a.length-1;A>=0;A--)(w=a[A])&&(k=(v<3?w(k):v>3?w(f,y,k):w(f,y))||k);return v>3&&k&&Object.defineProperty(f,y,k),k},d=this&&this.__param||function(a,f){return function(y,S){f(y,S,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=h(5871),_=h(4725),m=h(844),b=h(2585),p={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let i=s.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(a,f,y,S,w,v,k){var O;super(),this._viewportElement=a,this._screenElement=f,this._bufferService=y,this._decorationService=S,this._renderService=w,this._optionsService=v,this._coreBrowserService=k,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)(()=>{var I;(I=this._canvas)==null||I.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 a=Math.floor(this._canvas.width/3),f=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=a,o.center=f,o.right=a,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=o.left,c.right=o.left+o.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const a=this._canvas.height/this._bufferService.buffer.lines.length,f=Math.round(Math.max(Math.min(a,12),6)*this._coreBrowserService.dpr);p.left=f,p.center=f,p.right=f}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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 f of this._decorationService.decorations)this._colorZoneStore.addDecoration(f);this._ctx.lineWidth=1;const a=this._colorZoneStore.zones;for(const f of a)f.position!=="full"&&this._renderColorZone(f);for(const f of a)f.position==="full"&&this._renderColorZone(f);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(a){this._ctx.fillStyle=a.color,this._ctx.fillRect(c[a.position||"full"],Math.round((this._canvas.height-1)*(a.startBufferLine/this._bufferService.buffers.active.lines.length)-p[a.position||"full"]/2),o[a.position||"full"],Math.round((this._canvas.height-1)*((a.endBufferLine-a.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[a.position||"full"]))}_queueRefresh(a,f){this._shouldUpdateDimensions=a||this._shouldUpdateDimensions,this._shouldUpdateAnchor=f||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=i=l([d(2,b.IBufferService),d(3,b.IDecorationService),d(4,_.IRenderService),d(5,b.IOptionsService),d(6,_.ICoreBrowserService)],i)},2950:function(C,s,h){var l=this&&this.__decorate||function(p,o,c,i){var a,f=arguments.length,y=f<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,c):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,o,c,i);else for(var S=p.length-1;S>=0;S--)(a=p[S])&&(y=(f<3?a(y):f>3?a(o,c,y):a(o,c))||y);return f>3&&y&&Object.defineProperty(o,c,y),y},d=this&&this.__param||function(p,o){return function(c,i){o(c,i,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=h(4725),_=h(2585),m=h(2584);let b=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,o,c,i,a,f){this._textarea=p,this._compositionView=o,this._bufferService=c,this._optionsService=i,this._coreService=a,this._renderService=f,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const o=this._textarea.value,c=o.replace(p,"");this._dataAlreadySent=c,o.length>p.length?this._coreService.triggerDataEvent(c,!0):o.length<p.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):o.length===p.length&&o!==p&&this._coreService.triggerDataEvent(o,!0)}},0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const f=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(f.width,1)+"px",this._textarea.style.height=Math.max(f.height,1)+"px",this._textarea.style.lineHeight=f.height+"px"}p||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=b=l([d(2,_.IBufferService),d(3,_.IOptionsService),d(4,_.ICoreService),d(5,u.IRenderService)],b)},9806:(C,s)=>{function h(l,d,u){const _=u.getBoundingClientRect(),m=l.getComputedStyle(u),b=parseInt(m.getPropertyValue("padding-left")),p=parseInt(m.getPropertyValue("padding-top"));return[d.clientX-_.left-b,d.clientY-_.top-p]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=h,s.getCoords=function(l,d,u,_,m,b,p,o,c){if(!b)return;const i=h(l,d,u);return i?(i[0]=Math.ceil((i[0]+(c?p/2:0))/p),i[1]=Math.ceil(i[1]/o),i[0]=Math.min(Math.max(i[0],1),_+(c?1:0)),i[1]=Math.min(Math.max(i[1],1),m),i):void 0}},9504:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const l=h(2584);function d(o,c,i,a){const f=o-u(o,i),y=c-u(c,i),S=Math.abs(f-y)-function(w,v,k){let A=0;const O=w-u(w,k),I=v-u(v,k);for(let L=0;L<Math.abs(O-I);L++){const $=_(w,v)==="A"?-1:1,F=k.buffer.lines.get(O+$*L);F!=null&&F.isWrapped&&A++}return A}(o,c,i);return p(S,b(_(o,c),a))}function u(o,c){let i=0,a=c.buffer.lines.get(o),f=a==null?void 0:a.isWrapped;for(;f&&o>=0&&o<c.rows;)i++,a=c.buffer.lines.get(--o),f=a==null?void 0:a.isWrapped;return i}function _(o,c){return o>c?"A":"B"}function m(o,c,i,a,f,y){let S=o,w=c,v="";for(;S!==i||w!==a;)S+=f?1:-1,f&&S>y.cols-1?(v+=y.buffer.translateBufferLineToString(w,!1,o,S),S=0,o=0,w++):!f&&S<0&&(v+=y.buffer.translateBufferLineToString(w,!1,0,o+1),S=y.cols-1,o=S,w--);return v+y.buffer.translateBufferLineToString(w,!1,o,S)}function b(o,c){const i=c?"O":"[";return l.C0.ESC+i+o}function p(o,c){o=Math.floor(o);let i="";for(let a=0;a<o;a++)i+=c;return i}s.moveToCellSequence=function(o,c,i,a){const f=i.buffer.x,y=i.buffer.y;if(!i.buffer.hasScrollback)return function(v,k,A,O,I,L){return d(k,O,I,L).length===0?"":p(m(v,k,v,k-u(k,I),!1,I).length,b("D",L))}(f,y,0,c,i,a)+d(y,c,i,a)+function(v,k,A,O,I,L){let $;$=d(k,O,I,L).length>0?O-u(O,I):k;const F=O,U=function(V,W,x,R,T,B){let N;return N=d(x,R,T,B).length>0?R-u(R,T):W,V<x&&N<=R||V>=x&&N<R?"C":"D"}(v,k,A,O,I,L);return p(m(v,$,A,F,U==="C",I).length,b(U,L))}(f,y,o,c,i,a);let S;if(y===c)return S=f>o?"D":"C",p(Math.abs(f-o),b(S,a));S=y>c?"D":"C";const w=Math.abs(y-c);return p(function(v,k){return k.cols-v}(y>c?o:f,i)+(w-1)*i.cols+1+((y>c?f:o)-1),b(S,a))}},1296:function(C,s,h){var l=this&&this.__decorate||function(L,$,F,U){var V,W=arguments.length,x=W<3?$:U===null?U=Object.getOwnPropertyDescriptor($,F):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(L,$,F,U);else for(var R=L.length-1;R>=0;R--)(V=L[R])&&(x=(W<3?V(x):W>3?V($,F,x):V($,F))||x);return W>3&&x&&Object.defineProperty($,F,x),x},d=this&&this.__param||function(L,$){return function(F,U){$(F,U,L)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=h(3787),_=h(2550),m=h(2223),b=h(6171),p=h(6052),o=h(4725),c=h(8055),i=h(8460),a=h(844),f=h(2585),y="xterm-dom-renderer-owner-",S="xterm-rows",w="xterm-fg-",v="xterm-bg-",k="xterm-focus",A="xterm-selection";let O=1,I=s.DomRenderer=class extends a.Disposable{constructor(L,$,F,U,V,W,x,R,T,B,N,Z,G){super(),this._terminal=L,this._document=$,this._element=F,this._screenElement=U,this._viewportElement=V,this._helperContainer=W,this._linkifier2=x,this._charSizeService=T,this._optionsService=B,this._bufferService=N,this._coreBrowserService=Z,this._themeService=G,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.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(A),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(J=>this._injectCss(J))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(J=>this._handleLinkHover(J))),this.register(this._linkifier2.onHideLinkUnderline(J=>this._handleLinkLeave(J))),this.register((0,a.toDisposable)(()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.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 L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(L){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${S} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${S} .xterm-dim { color: ${c.color.multiplyOpacity(L.foreground,.5).css};}`,$+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;$+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${U} { 50% { box-shadow: none; }}`,$+=`@keyframes ${V} { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,$+=`${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${A} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${A} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${A} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[W,x]of L.ansi.entries())$+=`${this._terminalSelector} .${w}${W} { color: ${x.css}; }${this._terminalSelector} .${w}${W}.xterm-dim { color: ${c.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${v}${W} { background-color: ${x.css}; }`;$+=`${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(L.background).css}; }${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${v}${m.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,$){for(let F=this._rowElements.length;F<=$;F++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,$){this._refreshRowElements(L,$),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,$,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,$,F),this.renderRows(0,this._bufferService.rows-1),!L||!$)return;this._selectionRenderModel.update(this._terminal,L,$,F);const U=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||x<0)return;const R=this._document.createDocumentFragment();if(F){const T=L[0]>$[0];R.appendChild(this._createSelectionElement(W,T?$[0]:L[0],T?L[0]:$[0],x-W+1))}else{const T=U===W?L[0]:0,B=W===V?$[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(W,T,B));const N=x-W-1;if(R.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,N)),W!==x){const Z=V===x?$[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(x,0,Z))}}this._selectionContainer.appendChild(R)}_createSelectionElement(L,$,F,U=1){const V=this._document.createElement("div"),W=$*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(F-$);return W+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-W),V.style.height=U*this.dimensions.css.cell.height+"px",V.style.top=L*this.dimensions.css.cell.height+"px",V.style.left=`${W}px`,V.style.width=`${x}px`,V}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 L of this._rowElements)L.replaceChildren()}renderRows(L,$){const F=this._bufferService.buffer,U=F.ybase+F.y,V=Math.min(F.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=L;T<=$;T++){const B=T+F.ydisp,N=this._rowElements[T],Z=F.lines.get(B);if(!N||!Z)break;N.replaceChildren(...this._rowFactory.createRow(Z,B,B===U,x,R,V,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,$,F,U,V,W){F<0&&(L=0),U<0&&($=0);const x=this._bufferService.rows-1;F=Math.max(Math.min(F,x),0),U=Math.max(Math.min(U,x),0),V=Math.min(V,this._bufferService.cols);const R=this._bufferService.buffer,T=R.ybase+R.y,B=Math.min(R.x,V-1),N=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=F;J<=U;++J){const P=J+R.ydisp,D=this._rowElements[J],j=R.lines.get(P);if(!D||!j)break;D.replaceChildren(...this._rowFactory.createRow(j,P,P===T,Z,G,B,N,this.dimensions.css.cell.width,this._widthCache,W?J===F?L:0:-1,W?(J===U?$:V)-1:-1))}}};s.DomRenderer=I=l([d(7,f.IInstantiationService),d(8,o.ICharSizeService),d(9,f.IOptionsService),d(10,f.IBufferService),d(11,o.ICoreBrowserService),d(12,o.IThemeService)],I)},3787:function(C,s,h){var l=this&&this.__decorate||function(S,w,v,k){var A,O=arguments.length,I=O<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,v):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,w,v,k);else for(var L=S.length-1;L>=0;L--)(A=S[L])&&(I=(O<3?A(I):O>3?A(w,v,I):A(w,v))||I);return O>3&&I&&Object.defineProperty(w,v,I),I},d=this&&this.__param||function(S,w){return function(v,k){w(v,k,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=h(2223),_=h(643),m=h(511),b=h(2585),p=h(8055),o=h(4725),c=h(4269),i=h(6171),a=h(3734);let f=s.DomRendererRowFactory=class{constructor(S,w,v,k,A,O,I){this._document=S,this._characterJoinerService=w,this._optionsService=v,this._coreBrowserService=k,this._coreService=A,this._decorationService=O,this._themeService=I,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,w,v){this._selectionStart=S,this._selectionEnd=w,this._columnSelectMode=v}createRow(S,w,v,k,A,O,I,L,$,F,U){const V=[],W=this._characterJoinerService.getJoinedCharacters(w),x=this._themeService.colors;let R,T=S.getNoBgTrimmedLength();v&&T<O+1&&(T=O+1);let B=0,N="",Z=0,G=0,J=0,P=!1,D=0,j=!1,z=0;const K=[],q=F!==-1&&U!==-1;for(let ee=0;ee<T;ee++){S.loadCell(ee,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let ne=!1,ce=ee,Y=this._workCell;if(W.length>0&&ee===W[0][0]){ne=!0;const ie=W.shift();Y=new c.JoinedCellData(this._workCell,S.translateToString(!0,ie[0],ie[1]),ie[1]-ie[0]),ce=ie[1]-1,se=Y.getWidth()}const je=this._isCellInSelection(ee,w),Mt=v&&ee===O,$t=q&&ee>=F&&ee<=U;let zt=!1;this._decorationService.forEachDecorationAtCell(ee,w,void 0,ie=>{zt=!0});let tt=Y.getChars()||_.WHITESPACE_CELL_CHAR;if(tt===" "&&(Y.isUnderline()||Y.isOverline())&&(tt=" "),z=se*L-$.get(tt,Y.isBold(),Y.isItalic()),R){if(B&&(je&&j||!je&&!j&&Y.bg===Z)&&(je&&j&&x.selectionForeground||Y.fg===G)&&Y.extended.ext===J&&$t===P&&z===D&&!Mt&&!ne&&!zt){Y.isInvisible()?N+=_.WHITESPACE_CELL_CHAR:N+=tt,B++;continue}B&&(R.textContent=N),R=this._document.createElement("span"),B=0,N=""}else R=this._document.createElement("span");if(Z=Y.bg,G=Y.fg,J=Y.extended.ext,P=$t,D=z,j=je,ne&&O>=ee&&O<=ce&&(O=ee),!this._coreService.isCursorHidden&&Mt&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)I&&K.push("xterm-cursor-blink"),K.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline")}}if(Y.isBold()&&K.push("xterm-bold"),Y.isItalic()&&K.push("xterm-italic"),Y.isDim()&&K.push("xterm-dim"),N=Y.isInvisible()?_.WHITESPACE_CELL_CHAR:Y.getChars()||_.WHITESPACE_CELL_CHAR,Y.isUnderline()&&(K.push(`xterm-underline-${Y.extended.underlineStyle}`),N===" "&&(N=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${a.AttributeData.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let ie=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&ie<8&&(ie+=8),R.style.textDecorationColor=x.ansi[ie].css}Y.isOverline()&&(K.push("xterm-overline"),N===" "&&(N=" ")),Y.isStrikethrough()&&K.push("xterm-strikethrough"),$t&&(R.style.textDecoration="underline");let ue=Y.getFgColor(),Ue=Y.getFgColorMode(),pe=Y.getBgColor(),We=Y.getBgColorMode();const Ht=!!Y.isInverse();if(Ht){const ie=ue;ue=pe,pe=ie;const Oc=Ue;Ue=We,We=Oc}let ye,rt,we,Ze=!1;switch(this._decorationService.forEachDecorationAtCell(ee,w,void 0,ie=>{ie.options.layer!=="top"&&Ze||(ie.backgroundColorRGB&&(We=50331648,pe=ie.backgroundColorRGB.rgba>>8&16777215,ye=ie.backgroundColorRGB),ie.foregroundColorRGB&&(Ue=50331648,ue=ie.foregroundColorRGB.rgba>>8&16777215,rt=ie.foregroundColorRGB),Ze=ie.options.layer==="top")}),!Ze&&je&&(ye=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,pe=ye.rgba>>8&16777215,We=50331648,Ze=!0,x.selectionForeground&&(Ue=50331648,ue=x.selectionForeground.rgba>>8&16777215,rt=x.selectionForeground)),Ze&&K.push("xterm-decoration-top"),We){case 16777216:case 33554432:we=x.ansi[pe],K.push(`xterm-bg-${pe}`);break;case 50331648:we=p.channels.toColor(pe>>16,pe>>8&255,255&pe),this._addStyle(R,`background-color:#${y((pe>>>0).toString(16),"0",6)}`);break;default:Ht?(we=x.foreground,K.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):we=x.background}switch(ye||Y.isDim()&&(ye=p.color.multiplyOpacity(we,.5)),Ue){case 16777216:case 33554432:Y.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(R,we,x.ansi[ue],Y,ye,void 0)||K.push(`xterm-fg-${ue}`);break;case 50331648:const ie=p.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(R,we,ie,Y,ye,rt)||this._addStyle(R,`color:#${y(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,we,x.foreground,Y,ye,rt)||Ht&&K.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}K.length&&(R.className=K.join(" "),K.length=0),Mt||ne||zt?R.textContent=N:B++,z!==this.defaultSpacing&&(R.style.letterSpacing=`${z}px`),V.push(R),ee=ce}return R&&B&&(R.textContent=N),V}_applyMinimumContrast(S,w,v,k,A,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const I=this._getContrastCache(k);let L;if(A||O||(L=I.getColor(w.rgba,v.rgba)),L===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);L=p.color.ensureContrastRatio(A||w,O||v,$),I.setColor((A||w).rgba,(O||v).rgba,L??null)}return!!L&&(this._addStyle(S,`color:${L.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,w){S.setAttribute("style",`${S.getAttribute("style")||""}${w};`)}_isCellInSelection(S,w){const v=this._selectionStart,k=this._selectionEnd;return!(!v||!k)&&(this._columnSelectMode?v[0]<=k[0]?S>=v[0]&&w>=v[1]&&S<k[0]&&w<=k[1]:S<v[0]&&w>=v[1]&&S>=k[0]&&w<=k[1]:w>v[1]&&w<k[1]||v[1]===k[1]&&w===v[1]&&S>=v[0]&&S<k[0]||v[1]<k[1]&&w===k[1]&&S<k[0]||v[1]<k[1]&&w===v[1]&&S>=v[0])}};function y(S,w,v){for(;S.length<v;)S=w+S;return S}s.DomRendererRowFactory=f=l([d(1,o.ICharacterJoinerService),d(2,b.IOptionsService),d(3,o.ICoreBrowserService),d(4,b.ICoreService),d(5,b.IDecorationService),d(6,o.IThemeService)],f)},2550:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(h,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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 d=h.createElement("span");d.classList.add("xterm-char-measure-element");const u=h.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const _=h.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const m=h.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[d,u,_,m],this._container.appendChild(d),this._container.appendChild(u),this._container.appendChild(_),this._container.appendChild(m),l.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(h,l,d,u){h===this._font&&l===this._fontSize&&d===this._weight&&u===this._weightBold||(this._font=h,this._fontSize=l,this._weight=d,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(h,l,d){let u=0;if(!l&&!d&&h.length===1&&(u=h.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const b=this._measure(h,0);return b>0&&(this._flat[u]=b),b}let _=h;l&&(_+="B"),d&&(_+="I");let m=this._holey.get(_);if(m===void 0){let b=0;l&&(b|=1),d&&(b|=2),m=this._measure(h,b),m>0&&this._holey.set(_,m)}return m}_measure(h,l){const d=this._measureElements[l];return d.textContent=h.repeat(32),d.offsetWidth/32}}},2223:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const l=h(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(C,s)=>{function h(d){return 57508<=d&&d<=57558}function l(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=h,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.isEmoji=l,s.allowRescaling=function(d,u,_,m){return u===1&&_>Math.ceil(1.5*m)&&d!==void 0&&d>255&&!l(d)&&!h(d)&&!function(b){return 57344<=b&&b<=63743}(d)},s.treatGlyphAsBackgroundColor=function(d){return h(d)||function(u){return 9472<=u&&u<=9631}(d)},s.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}}}},s.computeNextVariantOffset=function(d,u,_=0){return(d-(2*Math.round(u)-_))%(2*Math.round(u))}},6052:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class h{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(d,u,_,m=!1){if(this.selectionStart=u,this.selectionEnd=_,!u||!_||u[0]===_[0]&&u[1]===_[1])return void this.clear();const b=d.buffers.active.ydisp,p=u[1]-b,o=_[1]-b,c=Math.max(p,0),i=Math.min(o,d.rows-1);c>=d.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=p,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=i,this.startCol=u[0],this.endCol=_[0])}isCellSelected(d,u,_){return!!this.hasSelection&&(_-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&_>=this.viewportCappedStartRow&&u<this.endCol&&_<=this.viewportCappedEndRow:u<this.startCol&&_>=this.viewportCappedStartRow&&u>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new h}},456:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,l=this.selectionEnd;return!(!h||!l)&&(h[1]>l[1]||h[1]===l[1]&&h[0]>l[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,s,h){var l=this&&this.__decorate||function(i,a,f,y){var S,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(S=i[k])&&(v=(w<3?S(v):w>3?S(a,f,v):S(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=h(2585),_=h(8460),m=h(844);let b=s.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,a,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new o(i,a,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};s.CharSizeService=b=l([d(2,u.IOptionsService)],b);class p extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(a,f){a!==void 0&&a>0&&f!==void 0&&f>0&&(this._result.width=a,this._result.height=f)}}class o extends p{constructor(a,f,y){super(),this._document=a,this._parentElement=f,this._optionsService=y,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 c extends p{constructor(a){super(),this._optionsService=a,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const f=this._ctx.measureText("W");if(!("width"in f&&"fontBoundingBoxAscent"in f&&"fontBoundingBoxDescent"in f))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const a=this._ctx.measureText("W");return this._validateAndSet(a.width,a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),this._result}}},4269:function(C,s,h){var l=this&&this.__decorate||function(c,i,a,f){var y,S=arguments.length,w=S<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,i,a,f);else for(var v=c.length-1;v>=0;v--)(y=c[v])&&(w=(S<3?y(w):S>3?y(i,a,w):y(i,a))||w);return S>3&&w&&Object.defineProperty(i,a,w),w},d=this&&this.__param||function(c,i){return function(a,f){i(a,f,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=h(3734),_=h(643),m=h(511),b=h(2585);class p extends u.AttributeData{constructor(i,a,f){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=a,this._width=f}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=p;let o=s.CharacterJoinerService=class vs{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(i){const a={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(a),a.id}deregister(i){for(let a=0;a<this._characterJoiners.length;a++)if(this._characterJoiners[a].id===i)return this._characterJoiners.splice(a,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const a=this._bufferService.buffer.lines.get(i);if(!a||a.length===0)return[];const f=[],y=a.translateToString(!0);let S=0,w=0,v=0,k=a.getFg(0),A=a.getBg(0);for(let O=0;O<a.getTrimmedLength();O++)if(a.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==A){if(O-S>1){const I=this._getJoinedRanges(y,v,w,a,S);for(let L=0;L<I.length;L++)f.push(I[L])}S=O,v=w,k=this._workCell.fg,A=this._workCell.bg}w+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const O=this._getJoinedRanges(y,v,w,a,S);for(let I=0;I<O.length;I++)f.push(O[I])}return f}_getJoinedRanges(i,a,f,y,S){const w=i.substring(a,f);let v=[];try{v=this._characterJoiners[0].handler(w)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const A=this._characterJoiners[k].handler(w);for(let O=0;O<A.length;O++)vs._mergeRanges(v,A[O])}catch(A){console.error(A)}return this._stringRangesToCellRanges(v,y,S),v}_stringRangesToCellRanges(i,a,f){let y=0,S=!1,w=0,v=i[y];if(v){for(let k=f;k<this._bufferService.cols;k++){const A=a.getWidth(k),O=a.getString(k).length||_.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!S&&v[0]<=w&&(v[0]=k,S=!0),v[1]<=w){if(v[1]=k,v=i[++y],!v)break;v[0]<=w?(v[0]=k,S=!0):S=!1}w+=O}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(i,a){let f=!1;for(let y=0;y<i.length;y++){const S=i[y];if(f){if(a[1]<=S[0])return i[y-1][1]=a[1],i;if(a[1]<=S[1])return i[y-1][1]=Math.max(a[1],S[1]),i.splice(y,1),i;i.splice(y,1),y--}else{if(a[1]<=S[0])return i.splice(y,0,a),i;if(a[1]<=S[1])return S[0]=Math.min(a[0],S[0]),i;a[0]<S[1]&&(S[0]=Math.min(a[0],S[0]),f=!0)}}return f?i[i.length-1][1]=a[1]:i.push(a),i}};s.CharacterJoinerService=o=l([d(0,b.IBufferService)],o)},5114:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const l=h(844),d=h(8460),u=h(3656);class _ extends l.Disposable{constructor(p,o,c){super(),this._textarea=p,this._window=o,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this.register((0,d.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(p){this._window!==p&&(this._window=p,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}}s.CoreBrowserService=_;class m extends l.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)(()=>this.clearListener()))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)==null||p.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const l=h(844);class d extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const m=this.linkProviders.indexOf(_);m!==-1&&this.linkProviders.splice(m,1)}}}}s.LinkProviderService=d},8934:function(C,s,h){var l=this&&this.__decorate||function(b,p,o,c){var i,a=arguments.length,f=a<3?p:c===null?c=Object.getOwnPropertyDescriptor(p,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(b,p,o,c);else for(var y=b.length-1;y>=0;y--)(i=b[y])&&(f=(a<3?i(f):a>3?i(p,o,f):i(p,o))||f);return a>3&&f&&Object.defineProperty(p,o,f),f},d=this&&this.__param||function(b,p){return function(o,c){p(o,c,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=h(4725),_=h(9806);let m=s.MouseService=class{constructor(b,p){this._renderService=b,this._charSizeService=p}getCoords(b,p,o,c,i){return(0,_.getCoords)(window,b,p,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(b,p){const o=(0,_.getCoordsRelativeToElement)(window,b,p);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};s.MouseService=m=l([d(0,u.IRenderService),d(1,u.ICharSizeService)],m)},3230:function(C,s,h){var l=this&&this.__decorate||function(i,a,f,y){var S,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(S=i[k])&&(v=(w<3?S(v):w>3?S(a,f,v):S(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=h(6193),_=h(4725),m=h(8460),b=h(844),p=h(7226),o=h(2585);let c=s.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,a,f,y,S,w,v,k){super(),this._rowCount=i,this._charSizeService=y,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new b.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((A,O)=>this._renderRows(A,O),v),this.register(this._renderDebouncer),this.register(v.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(w.onResize(()=>this._fullRefresh())),this.register(w.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)==null?void 0:A.clear()})),this.register(f.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()})),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(w.buffer.y,w.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(v.window,a),this.register(v.onWindowChange(A=>this._registerIntersectionObserver(A,a)))}_registerIntersectionObserver(i,a){if("IntersectionObserver"in i){const f=new i.IntersectionObserver(y=>this._handleIntersectionChange(y[y.length-1]),{threshold:0});f.observe(a),this._observerDisposable.value=(0,b.toDisposable)(()=>f.disconnect())}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,a,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,a,this._rowCount))}_renderRows(i,a){this._renderer.value&&(i=Math.min(i,this._rowCount-1),a=Math.min(a,this._rowCount-1),this._renderer.value.renderRows(i,a),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:a}),this._onRender.fire({start:i,end:a}),this._isNextRenderRedrawOnly=!0)}resize(i,a){this._rowCount=a,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw(a=>this.refreshRows(a.start,a.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,a;this._renderer.value&&((a=(i=this._renderer.value).clearTextureAtlas)==null||a.call(i),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,a){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var f;return(f=this._renderer.value)==null?void 0:f.handleResize(i,a)}):this._renderer.value.handleResize(i,a),this._fullRefresh())}handleCharSizeChanged(){var i;(i=this._renderer.value)==null||i.handleCharSizeChanged()}handleBlur(){var i;(i=this._renderer.value)==null||i.handleBlur()}handleFocus(){var i;(i=this._renderer.value)==null||i.handleFocus()}handleSelectionChanged(i,a,f){var y;this._selectionState.start=i,this._selectionState.end=a,this._selectionState.columnSelectMode=f,(y=this._renderer.value)==null||y.handleSelectionChanged(i,a,f)}handleCursorMove(){var i;(i=this._renderer.value)==null||i.handleCursorMove()}clear(){var i;(i=this._renderer.value)==null||i.clear()}};s.RenderService=c=l([d(2,o.IOptionsService),d(3,_.ICharSizeService),d(4,o.IDecorationService),d(5,o.IBufferService),d(6,_.ICoreBrowserService),d(7,_.IThemeService)],c)},9312:function(C,s,h){var l=this&&this.__decorate||function(v,k,A,O){var I,L=arguments.length,$=L<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(v,k,A,O);else for(var F=v.length-1;F>=0;F--)(I=v[F])&&($=(L<3?I($):L>3?I(k,A,$):I(k,A))||$);return L>3&&$&&Object.defineProperty(k,A,$),$},d=this&&this.__param||function(v,k){return function(A,O){k(A,O,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=h(9806),_=h(9504),m=h(456),b=h(4725),p=h(8460),o=h(844),c=h(6114),i=h(4841),a=h(511),f=h(2585),y=" ",S=new RegExp(y,"g");let w=s.SelectionService=class extends o.Disposable{constructor(v,k,A,O,I,L,$,F,U){super(),this._element=v,this._screenElement=k,this._linkifier=A,this._bufferService=O,this._coreService=I,this._mouseService=L,this._optionsService=$,this._renderService=F,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(V=>this._handleTrim(V)),this.register(this._bufferService.buffers.onBufferActivate(V=>this._handleBufferActivate(V))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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,k=this._model.finalSelectionEnd;return!(!v||!k||v[0]===k[0]&&v[1]===k[1])}get selectionText(){const v=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!v||!k)return"";const A=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(v[0]===k[0])return"";const I=v[0]<k[0]?v[0]:k[0],L=v[0]<k[0]?k[0]:v[0];for(let $=v[1];$<=k[1];$++){const F=A.translateBufferLineToString($,!0,I,L);O.push(F)}}else{const I=v[1]===k[1]?k[0]:void 0;O.push(A.translateBufferLineToString(v[1],!0,v[0],I));for(let L=v[1]+1;L<=k[1]-1;L++){const $=A.lines.get(L),F=A.translateBufferLineToString(L,!0);$!=null&&$.isWrapped?O[O.length-1]+=F:O.push(F)}if(v[1]!==k[1]){const L=A.lines.get(k[1]),$=A.translateBufferLineToString(k[1],!0,0,k[0]);L&&L.isWrapped?O[O.length-1]+=$:O.push($)}}return O.map(I=>I.replace(S," ")).join(c.isWindows?`\r
|
|
6
6
|
`:`
|
|
7
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),c.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 k=this._getMouseBufferCoords(v),A=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(A&&O&&k)&&this._areCoordsInSelection(k,A,O)}isCellInSelection(v,k){const A=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!A||!O)&&this._areCoordsInSelection([v,k],A,O)}_areCoordsInSelection(v,k,A){return v[1]>k[1]&&v[1]<A[1]||k[1]===A[1]&&v[1]===k[1]&&v[0]>=k[0]&&v[0]<A[0]||k[1]<A[1]&&v[1]===A[1]&&v[0]<A[0]||k[1]<A[1]&&v[1]===k[1]&&v[0]>=k[0]}_selectWordAtCursor(v,k){var I,L;const A=(L=(I=this._linkifier.currentLink)==null?void 0:I.link)==null?void 0:L.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(v);return!!O&&(this._selectWordAt(O,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,k){this._model.clearSelection(),v=Math.max(v,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const k=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(v){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=A?0:(k>A&&(k-=A),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(v){return c.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 k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const k=this._getMouseBufferCoords(v);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(v){return v.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const k=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 A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){const O=A.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]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 k=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const O=(0,p.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,A=!(!v||!k||v[0]===k[0]&&v[1]===k[1]);A?v&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,k,A)):this._oldHasSelection&&this._fireOnSelectionChange(v,k,A)}_fireOnSelectionChange(v,k,A){this._oldSelectionStart=v,this._oldSelectionEnd=k,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(v,k){let A=k;for(let O=0;k>=O;O++){const I=v.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:I>1&&k!==O&&(A+=I-1)}return A}setSelection(v,k,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,k],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,k,A=!0,O=!0){if(v[0]>=this._bufferService.cols)return;const I=this._bufferService.buffer,L=I.lines.get(v[1]);if(!L)return;const z=I.translateBufferLineToString(v[1],!1);let F=this._convertViewportColToCharacterIndex(L,v[0]),W=F;const V=v[0]-F;let U=0,x=0,R=0,T=0;if(z.charAt(F)===" "){for(;F>0&&z.charAt(F-1)===" ";)F--;for(;W<z.length&&z.charAt(W+1)===" ";)W++}else{let Z=v[0],G=v[0];L.getWidth(Z)===0&&(U++,Z--),L.getWidth(G)===2&&(x++,G++);const J=L.getString(G).length;for(J>1&&(T+=J-1,W+=J-1);Z>0&&F>0&&!this._isCharWordSeparator(L.loadCell(Z-1,this._workCell));){L.loadCell(Z-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,Z--):P>1&&(R+=P-1,F-=P-1),F--,Z--}for(;G<L.length&&W+1<z.length&&!this._isCharWordSeparator(L.loadCell(G+1,this._workCell));){L.loadCell(G+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,G++):P>1&&(T+=P-1,W+=P-1),W++,G++}}W++;let B=F+V-U+R,N=Math.min(this._bufferService.cols,W-F+U+x-R-T);if(k||z.slice(F,W).trim()!==""){if(A&&B===0&&L.getCodePoint(0)!==32){const Z=I.lines.get(v[1]-1);if(Z&&L.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const G=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(G){const J=this._bufferService.cols-G.start;B-=J,N+=J}}}if(O&&B+N===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const Z=I.lines.get(v[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const G=this._getWordAt([0,v[1]+1],!1,!1,!0);G&&(N+=G.length)}}return{start:B,length:N}}}_selectWordAt(v,k){const A=this._getWordAt(v,k);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[A.start,v[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(v){const k=this._getWordAt(v,!0);if(k){let A=v[1];for(;k.start<0;)k.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,A]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const k=this._bufferService.buffer.getWrappedRangeForLine(v),A={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(A,this._bufferService.cols)}};n.SelectionService=w=l([d(3,f.IBufferService),d(4,f.ICoreService),d(5,S.IMouseService),d(6,f.IOptionsService),d(7,S.IRenderService),d(8,S.ICoreBrowserService)],w)},4725:(C,n,h)=>{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 l=h(8343);n.ICharSizeService=(0,l.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),n.IMouseService=(0,l.createDecorator)("MouseService"),n.IRenderService=(0,l.createDecorator)("RenderService"),n.ISelectionService=(0,l.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,l.createDecorator)("ThemeService"),n.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(C,n,h){var l=this&&this.__decorate||function(w,v,k,A){var O,I=arguments.length,L=I<3?v:A===null?A=Object.getOwnPropertyDescriptor(v,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(w,v,k,A);else for(var z=w.length-1;z>=0;z--)(O=w[z])&&(L=(I<3?O(L):I>3?O(v,k,L):O(v,k))||L);return I>3&&L&&Object.defineProperty(v,k,L),L},d=this&&this.__param||function(w,v){return function(k,A){v(k,A,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const u=h(7239),p=h(8055),g=h(8460),S=h(844),m=h(2585),o=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),i=p.css.toColor("#ffffff"),a=p.css.toColor("#000000"),f={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let k=0;k<216;k++){const A=v[k/36%6|0],O=v[k/6%6|0],I=v[k%6];w.push({css:p.channels.toCss(A,O,I),rgba:p.channels.toRgba(A,O,I)})}for(let k=0;k<24;k++){const A=8+10*k;w.push({css:p.channels.toCss(A,A,A),rgba:p.channels.toRgba(A,A,A)})}return w})());let y=n.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:c,cursor:i,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:f,selectionBackgroundOpaque:p.color.blend(c,f),selectionInactiveBackgroundTransparent:f,selectionInactiveBackgroundOpaque:p.color.blend(c,f),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(w={}){const v=this._colors;if(v.foreground=b(w.foreground,o),v.background=b(w.background,c),v.cursor=b(w.cursor,i),v.cursorAccent=b(w.cursorAccent,a),v.selectionBackgroundTransparent=b(w.selectionBackground,f),v.selectionBackgroundOpaque=p.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=b(w.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=p.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=w.selectionForeground?b(w.selectionForeground,p.NULL_COLOR):void 0,v.selectionForeground===p.NULL_COLOR&&(v.selectionForeground=void 0),p.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=p.color.opacity(v.selectionBackgroundTransparent,.3)),p.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=p.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=n.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=b(w.black,n.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=b(w.red,n.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=b(w.green,n.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=b(w.yellow,n.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=b(w.blue,n.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=b(w.magenta,n.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=b(w.cyan,n.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=b(w.white,n.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=b(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=b(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=b(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=b(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=b(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=b(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=b(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=b(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(v.ansi.length-16,w.extendedAnsi.length);for(let A=0;A<k;A++)v.ansi[A+16]=b(w.extendedAnsi[A],n.DEFAULT_ANSI_COLORS[A+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(w){w(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 b(w,v){if(w!==void 0)try{return p.css.toColor(w)}catch{}return v}n.ThemeService=y=l([d(0,m.IOptionsService)],y)},6349:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const l=h(8460),d=h(844);class u extends d.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.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(g){if(this._maxLength===g)return;const S=new Array(g);for(let m=0;m<Math.min(g,this.length);m++)S[m]=this._array[this._getCyclicIndex(m)];this._array=S,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let S=this._length;S<g;S++)this._array[S]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,S){this._array[this._getCyclicIndex(g)]=S}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,S,...m){if(S){for(let o=g;o<this._length-S;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+S)];this._length-=S,this.onDeleteEmitter.fire({index:g,amount:S})}for(let o=this._length-1;o>=g;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(g+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:g,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,m){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let c=S-1;c>=0;c--)this.set(g+c+m,this.get(g+c));const o=g+S+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<S;o++)this.set(g+o+m,this.get(g+o))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}n.CircularList=u},1439:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function h(l,d=5){if(typeof l!="object")return l;const u=Array.isArray(l)?[]:{};for(const p in l)u[p]=d<=1?l[p]:l[p]&&h(l[p],d-1);return u}},8055:(C,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 h=0,l=0,d=0,u=0;var p,g,S,m,o;function c(a){const f=a.toString(16);return f.length<2?"0"+f:f}function i(a,f){return a<f?(f+.05)/(a+.05):(a+.05)/(f+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(a){a.toCss=function(f,y,b,w){return w!==void 0?`#${c(f)}${c(y)}${c(b)}${c(w)}`:`#${c(f)}${c(y)}${c(b)}`},a.toRgba=function(f,y,b,w=255){return(f<<24|y<<16|b<<8|w)>>>0},a.toColor=function(f,y,b,w){return{css:a.toCss(f,y,b,w),rgba:a.toRgba(f,y,b,w)}}}(p||(n.channels=p={})),function(a){function f(y,b){return u=Math.round(255*b),[h,l,d]=o.toChannels(y.rgba),{css:p.toCss(h,l,d,u),rgba:p.toRgba(h,l,d,u)}}a.blend=function(y,b){if(u=(255&b.rgba)/255,u===1)return{css:b.css,rgba:b.rgba};const w=b.rgba>>24&255,v=b.rgba>>16&255,k=b.rgba>>8&255,A=y.rgba>>24&255,O=y.rgba>>16&255,I=y.rgba>>8&255;return h=A+Math.round((w-A)*u),l=O+Math.round((v-O)*u),d=I+Math.round((k-I)*u),{css:p.toCss(h,l,d),rgba:p.toRgba(h,l,d)}},a.isOpaque=function(y){return(255&y.rgba)==255},a.ensureContrastRatio=function(y,b,w){const v=o.ensureContrastRatio(y.rgba,b.rgba,w);if(v)return p.toColor(v>>24&255,v>>16&255,v>>8&255)},a.opaque=function(y){const b=(255|y.rgba)>>>0;return[h,l,d]=o.toChannels(b),{css:p.toCss(h,l,d),rgba:b}},a.opacity=f,a.multiplyOpacity=function(y,b){return u=255&y.rgba,f(y,u*b/255)},a.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}}(g||(n.color=g={})),function(a){let f,y;try{const b=document.createElement("canvas");b.width=1,b.height=1;const w=b.getContext("2d",{willReadFrequently:!0});w&&(f=w,f.globalCompositeOperation="copy",y=f.createLinearGradient(0,0,1,1))}catch{}a.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return h=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),d=parseInt(b.slice(3,4).repeat(2),16),p.toColor(h,l,d);case 5:return h=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),d=parseInt(b.slice(3,4).repeat(2),16),u=parseInt(b.slice(4,5).repeat(2),16),p.toColor(h,l,d,u);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const w=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return h=parseInt(w[1]),l=parseInt(w[2]),d=parseInt(w[3]),u=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),p.toColor(h,l,d,u);if(!f||!y)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=y,f.fillStyle=b,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[h,l,d,u]=f.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(h,l,d,u),css:b}}}(S||(n.css=S={})),function(a){function f(y,b,w){const v=y/255,k=b/255,A=w/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}a.relativeLuminance=function(y){return f(y>>16&255,y>>8&255,255&y)},a.relativeLuminance2=f}(m||(n.rgb=m={})),function(a){function f(b,w,v){const k=b>>24&255,A=b>>16&255,O=b>>8&255;let I=w>>24&255,L=w>>16&255,z=w>>8&255,F=i(m.relativeLuminance2(I,L,z),m.relativeLuminance2(k,A,O));for(;F<v&&(I>0||L>0||z>0);)I-=Math.max(0,Math.ceil(.1*I)),L-=Math.max(0,Math.ceil(.1*L)),z-=Math.max(0,Math.ceil(.1*z)),F=i(m.relativeLuminance2(I,L,z),m.relativeLuminance2(k,A,O));return(I<<24|L<<16|z<<8|255)>>>0}function y(b,w,v){const k=b>>24&255,A=b>>16&255,O=b>>8&255;let I=w>>24&255,L=w>>16&255,z=w>>8&255,F=i(m.relativeLuminance2(I,L,z),m.relativeLuminance2(k,A,O));for(;F<v&&(I<255||L<255||z<255);)I=Math.min(255,I+Math.ceil(.1*(255-I))),L=Math.min(255,L+Math.ceil(.1*(255-L))),z=Math.min(255,z+Math.ceil(.1*(255-z))),F=i(m.relativeLuminance2(I,L,z),m.relativeLuminance2(k,A,O));return(I<<24|L<<16|z<<8|255)>>>0}a.blend=function(b,w){if(u=(255&w)/255,u===1)return w;const v=w>>24&255,k=w>>16&255,A=w>>8&255,O=b>>24&255,I=b>>16&255,L=b>>8&255;return h=O+Math.round((v-O)*u),l=I+Math.round((k-I)*u),d=L+Math.round((A-L)*u),p.toRgba(h,l,d)},a.ensureContrastRatio=function(b,w,v){const k=m.relativeLuminance(b>>8),A=m.relativeLuminance(w>>8);if(i(k,A)<v){if(A<k){const L=f(b,w,v),z=i(k,m.relativeLuminance(L>>8));if(z<v){const F=y(b,w,v);return z>i(k,m.relativeLuminance(F>>8))?L:F}return L}const O=y(b,w,v),I=i(k,m.relativeLuminance(O>>8));if(I<v){const L=f(b,w,v);return I>i(k,m.relativeLuminance(L>>8))?O:L}return O}},a.reduceLuminance=f,a.increaseLuminance=y,a.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}}(o||(n.rgba=o={})),n.toPaddedHex=c,n.contrastRatio=i},8969:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const l=h(844),d=h(2585),u=h(4348),p=h(7866),g=h(744),S=h(7302),m=h(6975),o=h(8460),c=h(1753),i=h(1480),a=h(7994),f=h(9282),y=h(5435),b=h(5981),w=h(2660);let v=!1;class k extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event(O=>{var I;(I=this._onScrollApi)==null||I.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 I in O)this.optionsService.options[I]=O[I]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new S.OptionsService(O)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(a.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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(I=>{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(I=>{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 b.WriteBuffer((I,L)=>this._inputHandler.parse(I,L))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,I){this._writeBuffer.write(O,I)}writeSync(O,I){this._logService.logLevel<=d.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(O,I)}input(O,I=!0){this.coreService.triggerDataEvent(O,I)}resize(O,I){isNaN(O)||isNaN(I)||(O=Math.max(O,g.MINIMUM_COLS),I=Math.max(I,g.MINIMUM_ROWS),this._bufferService.resize(O,I))}scroll(O,I=!1){this._bufferService.scroll(O,I)}scrollLines(O,I,L){this._bufferService.scrollLines(O,I,L)}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 I=O-this._bufferService.buffer.ydisp;I!==0&&this.scrollLines(I)}registerEscHandler(O,I){return this._inputHandler.registerEscHandler(O,I)}registerDcsHandler(O,I){return this._inputHandler.registerDcsHandler(O,I)}registerCsiHandler(O,I){return this._inputHandler.registerCsiHandler(O,I)}registerOscHandler(O,I){return this._inputHandler.registerOscHandler(O,I)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const I=this.optionsService.rawOptions.windowsPty;I&&I.buildNumber!==void 0&&I.buildNumber!==void 0?O=I.backend==="conpty"&&I.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(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const I of O)I.dispose()})}}}n.CoreTerminal=k},8460:(C,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===h)return void this._listeners.splice(l,1)}}})),this._event}fire(h,l){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,h,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(h,l){return h(d=>l.fire(d))},n.runAndSubscribe=function(h,l){return l(void 0),h(d=>l(d))}},5435:function(C,n,h){var l=this&&this.__decorate||function(U,x,R,T){var B,N=arguments.length,Z=N<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(U,x,R,T);else for(var G=U.length-1;G>=0;G--)(B=U[G])&&(Z=(N<3?B(Z):N>3?B(x,R,Z):B(x,R))||Z);return N>3&&Z&&Object.defineProperty(x,R,Z),Z},d=this&&this.__param||function(U,x){return function(R,T){x(R,T,U)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const u=h(2584),p=h(7116),g=h(2015),S=h(844),m=h(482),o=h(8437),c=h(8460),i=h(643),a=h(511),f=h(3734),y=h(2585),b=h(1480),w=h(6242),v=h(6351),k=h(5941),A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function I(U,x){if(U>24)return x.setWinLines||!1;switch(U){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var L;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(n.WindowsOptionsReportType=L={}));let z=0;class F extends S.Disposable{getAttrData(){return this._curAttrData}constructor(x,R,T,B,N,Z,G,J,P=new g.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=R,this._coreService=T,this._logService=B,this._optionsService=N,this._oscLinkService=Z,this._coreMouseService=G,this._unicodeService=J,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new a.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,j)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:j.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,j,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:j,data:H})}),this._parser.setDcsHandlerFallback((D,j,H)=>{j==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:j,payload:H})}),this._parser.setPrintHandler((D,j,H)=>this.print(D,j,H)),this._parser.registerCsiHandler({final:"@"},D=>this.insertChars(D)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},D=>this.scrollLeft(D)),this._parser.registerCsiHandler({final:"A"},D=>this.cursorUp(D)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},D=>this.scrollRight(D)),this._parser.registerCsiHandler({final:"B"},D=>this.cursorDown(D)),this._parser.registerCsiHandler({final:"C"},D=>this.cursorForward(D)),this._parser.registerCsiHandler({final:"D"},D=>this.cursorBackward(D)),this._parser.registerCsiHandler({final:"E"},D=>this.cursorNextLine(D)),this._parser.registerCsiHandler({final:"F"},D=>this.cursorPrecedingLine(D)),this._parser.registerCsiHandler({final:"G"},D=>this.cursorCharAbsolute(D)),this._parser.registerCsiHandler({final:"H"},D=>this.cursorPosition(D)),this._parser.registerCsiHandler({final:"I"},D=>this.cursorForwardTab(D)),this._parser.registerCsiHandler({final:"J"},D=>this.eraseInDisplay(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},D=>this.eraseInDisplay(D,!0)),this._parser.registerCsiHandler({final:"K"},D=>this.eraseInLine(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},D=>this.eraseInLine(D,!0)),this._parser.registerCsiHandler({final:"L"},D=>this.insertLines(D)),this._parser.registerCsiHandler({final:"M"},D=>this.deleteLines(D)),this._parser.registerCsiHandler({final:"P"},D=>this.deleteChars(D)),this._parser.registerCsiHandler({final:"S"},D=>this.scrollUp(D)),this._parser.registerCsiHandler({final:"T"},D=>this.scrollDown(D)),this._parser.registerCsiHandler({final:"X"},D=>this.eraseChars(D)),this._parser.registerCsiHandler({final:"Z"},D=>this.cursorBackwardTab(D)),this._parser.registerCsiHandler({final:"`"},D=>this.charPosAbsolute(D)),this._parser.registerCsiHandler({final:"a"},D=>this.hPositionRelative(D)),this._parser.registerCsiHandler({final:"b"},D=>this.repeatPrecedingCharacter(D)),this._parser.registerCsiHandler({final:"c"},D=>this.sendDeviceAttributesPrimary(D)),this._parser.registerCsiHandler({prefix:">",final:"c"},D=>this.sendDeviceAttributesSecondary(D)),this._parser.registerCsiHandler({final:"d"},D=>this.linePosAbsolute(D)),this._parser.registerCsiHandler({final:"e"},D=>this.vPositionRelative(D)),this._parser.registerCsiHandler({final:"f"},D=>this.hVPosition(D)),this._parser.registerCsiHandler({final:"g"},D=>this.tabClear(D)),this._parser.registerCsiHandler({final:"h"},D=>this.setMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"h"},D=>this.setModePrivate(D)),this._parser.registerCsiHandler({final:"l"},D=>this.resetMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"l"},D=>this.resetModePrivate(D)),this._parser.registerCsiHandler({final:"m"},D=>this.charAttributes(D)),this._parser.registerCsiHandler({final:"n"},D=>this.deviceStatus(D)),this._parser.registerCsiHandler({prefix:"?",final:"n"},D=>this.deviceStatusPrivate(D)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},D=>this.softReset(D)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},D=>this.setCursorStyle(D)),this._parser.registerCsiHandler({final:"r"},D=>this.setScrollRegion(D)),this._parser.registerCsiHandler({final:"s"},D=>this.saveCursor(D)),this._parser.registerCsiHandler({final:"t"},D=>this.windowOptions(D)),this._parser.registerCsiHandler({final:"u"},D=>this.restoreCursor(D)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},D=>this.insertColumns(D)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},D=>this.deleteColumns(D)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},D=>this.selectProtected(D)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},D=>this.requestMode(D,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},D=>this.requestMode(D,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new w.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new w.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new w.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new w.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new w.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new w.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new w.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new w.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new w.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new w.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new w.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new w.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 p.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,j)=>this.requestStatusString(D,j)))}_preserveStack(x,R,T,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=T,this._parseStack.position=B}_logSlowResolvingAsync(x){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([x,new Promise((R,T)=>setTimeout(()=>T("#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(x,R){let T,B=this._activeBuffer.x,N=this._activeBuffer.y,Z=0;const G=this._parseStack.paused;if(G){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(T),T;B=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>O&&(Z=this._parseStack.position+O)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,D=>String.fromCharCode(D)).join("")}"`),typeof x=="string"?x.split("").map(D=>D.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(x.length,O))),G||this._dirtyRowTracker.clearRange(),x.length>O)for(let D=Z;D<x.length;D+=O){const j=D+O<x.length?D+O:x.length,H=typeof x=="string"?this._stringDecoder.decode(x.substring(D,j),this._parseBuffer):this._utf8Decoder.decode(x.subarray(D,j),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,N,H,D),this._logSlowResolvingAsync(T),T}else if(!G){const D=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,D))return this._preserveStack(B,N,D,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===B&&this._activeBuffer.y===N||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(x,R,T){let B,N;const Z=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,j=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-R>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,j);let K=this._parser.precedingJoinState;for(let q=R;q<T;++q){if(B=x[q],B<127&&Z){const ce=Z[String.fromCharCode(B)];ce&&(B=ce.charCodeAt(0))}const ee=this._unicodeService.charProperties(B,K);N=b.UnicodeService.extractWidth(ee);const se=b.UnicodeService.extractShouldJoin(ee),ne=se?b.UnicodeService.extractWidth(K):0;if(K=ee,G&&this._onA11yChar.fire((0,m.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-ne>J){if(P){const ce=H;let Y=this._activeBuffer.x-ne;for(this._activeBuffer.x=ne,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ne>0&&H instanceof o.BufferLine&&H.copyCellsFrom(ce,Y,0,ne,!1);Y<J;)ce.setCellFromCodepoint(Y++,0,1,j)}else if(this._activeBuffer.x=J-1,N===2)continue}if(se&&this._activeBuffer.x){const ce=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ce,B,N);for(let Y=N-ne;--Y>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,j)}else if(D&&(H.insertCells(this._activeBuffer.x,N-ne,this._activeBuffer.getNullCell(j)),H.getWidth(J-1)===2&&H.setCellFromCodepoint(J-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,j)),H.setCellFromCodepoint(this._activeBuffer.x++,B,N,j),N>0)for(;--N;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,j)}this._parser.precedingJoinState=K,this._activeBuffer.x<J&&T-R>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,j),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,R){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,R):this._parser.registerCsiHandler(x,T=>!I(T.params[0],this._optionsService.rawOptions.windowOptions)||R(T))}registerDcsHandler(x,R){return this._parser.registerDcsHandler(x,new v.DcsHandler(R))}registerEscHandler(x,R){return this._parser.registerEscHandler(x,R)}registerOscHandler(x,R){return this._parser.registerOscHandler(x,new w.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 x;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&&((x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&x.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 x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=x,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+R)}cursorUp(x){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const R=x.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=x.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=x.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const R=x.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,R,T,B=!1,N=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);Z.replaceCells(R,T,this._activeBuffer.getNullCell(this._eraseAttrData()),N),B&&(Z.isWrapped=!1)}_resetBufferLine(x,R=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),T.isWrapped=!1)}eraseInDisplay(x,R=!1){let T;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);T<this._bufferService.rows;T++)this._resetBufferLine(T,R);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,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(x,R=!1){switch(this._restrictCursor(this._bufferService.cols),x.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(x){this._restrictCursor();let R=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;R--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let R=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=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(T,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(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let R=x.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(x){let R=x.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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);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(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);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(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const R=this._parser.precedingJoinState;if(!R)return!0;const T=x.params[0]||1,B=b.UnicodeService.extractWidth(R),N=this._activeBuffer.x-B,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),G=new Uint32Array(Z.length*T);let J=0;for(let D=0;D<Z.length;){const j=Z.codePointAt(D)||0;G[J++]=j,D+=j>65535?2:1}let P=J;for(let D=1;D<T;++D)G.copyWithin(P,0,J),P+=J;return this.print(G,0,P),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let R=0;R<x.length;R++)switch(x.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(),x.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(x,R){const T=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:N}=this._coreMouseService,Z=this._coreService,{buffers:G,cols:J}=this._bufferService,{active:P,alt:D}=G,j=this._optionsService.rawOptions,H=se=>se?1:2,K=x.params[0];return q=K,ee=R?K===2?4:K===4?H(Z.modes.insertMode):K===12?3:K===20?H(j.convertEol):0:K===1?H(T.applicationCursorKeys):K===3?j.windowOptions.setWinLines?J===80?2:J===132?1:0:0:K===6?H(T.origin):K===7?H(T.wraparound):K===8?3:K===9?H(B==="X10"):K===12?H(j.cursorBlink):K===25?H(!Z.isCursorHidden):K===45?H(T.reverseWraparound):K===66?H(T.applicationKeypad):K===67?4:K===1e3?H(B==="VT200"):K===1002?H(B==="DRAG"):K===1003?H(B==="ANY"):K===1004?H(T.sendFocus):K===1005?4:K===1006?H(N==="SGR"):K===1015?4:K===1016?H(N==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?H(P===D):K===2004?H(T.bracketedPasteMode):0,Z.triggerDataEvent(`${u.C0.ESC}[${R?"":"?"}${q};${ee}$y`),!0;var q,ee}_updateAttrColor(x,R,T,B,N){return R===2?(x|=50331648,x&=-16777216,x|=f.AttributeData.fromColorRGB([T,B,N])):R===5&&(x&=-50331904,x|=33554432|255&T),x}_extractColor(x,R,T){const B=[0,0,-1,0,0,0];let N=0,Z=0;do{if(B[Z+N]=x.params[R+Z],x.hasSubParams(R+Z)){const G=x.getSubParams(R+Z);let J=0;do B[1]===5&&(N=1),B[Z+J+1+N]=G[J];while(++J<G.length&&J+Z+1+N<B.length);break}if(B[1]===5&&Z+N>=2||B[1]===2&&Z+N>=5)break;B[1]&&(N=1)}while(++Z+R<x.length&&Z+N<B.length);for(let G=2;G<B.length;++G)B[G]===-1&&(B[G]=0);switch(B[0]){case 38:T.fg=this._updateAttrColor(T.fg,B[1],B[3],B[4],B[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,B[1],B[3],B[4],B[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,B[1],B[3],B[4],B[5])}return Z}_processUnderline(x,R){R.extended=R.extended.clone(),(!~x||x>5)&&(x=1),R.extended.underlineStyle=x,R.fg|=268435456,x===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(x){x.fg=o.DEFAULT_ATTR_DATA.fg,x.bg=o.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=x.length;let T;const B=this._curAttrData;for(let N=0;N<R;N++)T=x.params[N],T>=30&&T<=37?(B.fg&=-50331904,B.fg|=16777216|T-30):T>=40&&T<=47?(B.bg&=-50331904,B.bg|=16777216|T-40):T>=90&&T<=97?(B.fg&=-50331904,B.fg|=16777224|T-90):T>=100&&T<=107?(B.bg&=-50331904,B.bg|=16777224|T-100):T===0?this._processSGR0(B):T===1?B.fg|=134217728:T===3?B.bg|=67108864:T===4?(B.fg|=268435456,this._processUnderline(x.hasSubParams(N)?x.getSubParams(N)[0]:1,B)):T===5?B.fg|=536870912:T===7?B.fg|=67108864:T===8?B.fg|=1073741824:T===9?B.fg|=2147483648:T===2?B.bg|=134217728:T===21?this._processUnderline(2,B):T===22?(B.fg&=-134217729,B.bg&=-134217729):T===23?B.bg&=-67108865:T===24?(B.fg&=-268435457,this._processUnderline(0,B)):T===25?B.fg&=-536870913:T===27?B.fg&=-67108865:T===28?B.fg&=-1073741825:T===29?B.fg&=2147483647:T===39?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):T===49?(B.bg&=-67108864,B.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?N+=this._extractColor(x,N,B):T===53?B.bg|=1073741824:T===55?B.bg&=-1073741825:T===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):T===100?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${R};${T}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const R=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${R};${T}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(x){const R=x.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 T=R%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(x){const R=x.params[0]||1;let T;return(x.length<2||(T=x.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(x){if(!I(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22: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(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const R=[],T=x.split(";");for(;T.length>1;){const B=T.shift(),N=T.shift();if(/^\d+$/.exec(B)){const Z=parseInt(B);if(V(Z))if(N==="?")R.push({type:0,index:Z});else{const G=(0,k.parseColor)(N);G&&R.push({type:1,index:Z,color:G})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(x){const R=x.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(x,R){this._getCurrentLinkId()&&this._finishHyperlink();const T=x.split(":");let B;const N=T.findIndex(Z=>Z.startsWith("id="));return N!==-1&&(B=T[N].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(x,R){const T=x.split(";");for(let B=0;B<T.length&&!(R>=this._specialColors.length);++B,++R)if(T[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const N=(0,k.parseColor)(T[B]);N&&this._onColor.fire([{type:1,index:this._specialColors[R],color:N}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const R=[],T=x.split(";");for(let B=0;B<T.length;++B)if(/^\d+$/.exec(T[B])){const N=parseInt(T[B]);V(N)&&R.push({type:2,index:N})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,p.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(A[x[0]],p.CHARSETS[x[1]]||p.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new a.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const T=this._activeBuffer.ybase+this._activeBuffer.y+R,B=this._activeBuffer.lines.get(T);B&&(B.fill(x),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,R){const T=this._bufferService.buffer,B=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,R){this._dirtyRowTracker.markRangeDirty(x,R)}}n.InputHandler=F;let W=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,x){U>x&&(z=U,U=x,x=z),U<this.start&&(this.start=U),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(U){return 0<=U&&U<256}W=l([d(0,y.IBufferService)],W)},844:(C,n)=>{function h(l){for(const d of l)d.dispose();l.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 l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var d;this._isDisposed||l===this._value||((d=this._value)==null||d.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},n.toDisposable=function(l){return{dispose:l}},n.disposeArray=h,n.getDisposeArrayDisposable=function(l){return{dispose:()=>h(l)}}},1505:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(d,u,p){this._data[d]||(this._data[d]={}),this._data[d][u]=p}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}n.TwoKeyMap=h,n.FourKeyMap=class{constructor(){this._data=new h}set(l,d,u,p,g){this._data.get(l,d)||this._data.set(l,d,new h),this._data.get(l,d).set(u,p,g)}get(l,d,u,p){var g;return(g=this._data.get(l,d))==null?void 0:g.get(u,p)}clear(){this._data.clear()}}},6114:(C,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 h=n.isNode?"node":navigator.userAgent,l=n.isNode?"node":navigator.platform;n.isFirefox=h.includes("Firefox"),n.isLegacyEdge=h.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(h),n.getSafariVersion=function(){if(!n.isSafari)return 0;const d=h.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),n.isIpad=l==="iPad",n.isIphone=l==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),n.isLinux=l.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(h)},6106:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let h=0;n.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(h=this._search(this._getKey(l)),this._array.splice(h,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const d=this._getKey(l);if(d===void 0||(h=this._search(d),h===-1)||this._getKey(this._array[h])!==d)return!1;do if(this._array[h]===l)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===d);return!1}*getKeyIterator(l){if(this._array.length!==0&&(h=this._search(l),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===l))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===l)}forEachByKey(l,d){if(this._array.length!==0&&(h=this._search(l),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===l))do d(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===l)}values(){return[...this._array].values()}_search(l){let d=0,u=this._array.length-1;for(;u>=d;){let p=d+u>>1;const g=this._getKey(this._array[p]);if(g>l)u=p-1;else{if(!(g<l)){for(;p>0&&this._getKey(this._array[p-1])===l;)p--;return p}d=p+1}}return d}}},7226:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const l=h(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let S=0,m=0,o=g.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),m=Math.max(S,m),c=g.timeRemaining(),1.5*m>c)return o-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-S))}ms`),void this._start();o=c}this.clear()}}class u extends d{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}n.PriorityTaskQueue=u,n.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const l=h(643);n.updateWindowsModeWrappedState=function(d){const u=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),p=u==null?void 0:u.get(d.cols-1),g=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);g&&p&&(g.isWrapped=p[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&p[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new h;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=h;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=l},9092:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const l=h(6349),d=h(7226),u=h(3734),p=h(8437),g=h(4634),S=h(511),m=h(643),o=h(4863),c=h(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(i,a,f){this._hasScrollback=i,this._optionsService=a,this._bufferService=f,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,a){return new p.BufferLine(this._bufferService.cols,this.getNullCell(i),a)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const a=i+this._optionsService.rawOptions.scrollback;return a>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:a}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=p.DEFAULT_ATTR_DATA);let a=this._rows;for(;a--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,a){const f=this.getNullCell(p.DEFAULT_ATTR_DATA);let y=0;const b=this._getCorrectBufferLength(a);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<i)for(let v=0;v<this.lines.length;v++)y+=+this.lines.get(v).resize(i,f);let w=0;if(this._rows<a)for(let v=this._rows;v<a;v++)this.lines.length<a+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(i,f)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(i,f)));else for(let v=this._rows;v>a;v--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const v=this.lines.length-b;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=b}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,a-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(i,a),this._cols>i))for(let w=0;w<this.lines.length;w++)y+=+this.lines.get(w).resize(i,f);this._cols=i,this._rows=a,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let a=0;for(;this._memoryCleanupPosition<this.lines.length;)if(a+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),a>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,a){this._cols!==i&&(i>this._cols?this._reflowLarger(i,a):this._reflowSmaller(i,a))}_reflowLarger(i,a){const f=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(f.length>0){const y=(0,g.reflowLargerCreateNewLayout)(this.lines,f);(0,g.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(i,a,y.countRemoved)}}_reflowLargerAdjustViewport(i,a,f){const y=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=f;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<a&&this.lines.push(new p.BufferLine(i,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-f,0)}_reflowSmaller(i,a){const f=this.getNullCell(p.DEFAULT_ATTR_DATA),y=[];let b=0;for(let w=this.lines.length-1;w>=0;w--){let v=this.lines.get(w);if(!v||!v.isWrapped&&v.getTrimmedLength()<=i)continue;const k=[v];for(;v.isWrapped&&w>0;)v=this.lines.get(--w),k.unshift(v);const A=this.ybase+this.y;if(A>=w&&A<w+k.length)continue;const O=k[k.length-1].getTrimmedLength(),I=(0,g.reflowSmallerGetNewLineLengths)(k,this._cols,i),L=I.length-k.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const F=[];for(let T=0;T<L;T++){const B=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(B)}F.length>0&&(y.push({start:w+k.length+b,newLines:F}),b+=F.length),k.push(...F);let W=I.length-1,V=I[W];V===0&&(W--,V=I[W]);let U=k.length-L-1,x=O;for(;U>=0;){const T=Math.min(x,V);if(k[W]===void 0)break;if(k[W].copyCellsFrom(k[U],x-T,V-T,T,!0),V-=T,V===0&&(W--,V=I[W]),x-=T,x===0){U--;const B=Math.max(U,0);x=(0,g.getWrappedLineTrimmedLength)(k,B,this._cols)}}for(let T=0;T<k.length;T++)I[T]<i&&k[T].setCell(I[T],f);let R=L-z;for(;R-- >0;)this.ybase===0?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+a-1)}if(y.length>0){const w=[],v=[];for(let W=0;W<this.lines.length;W++)v.push(this.lines.get(W));const k=this.lines.length;let A=k-1,O=0,I=y[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let L=0;for(let W=Math.min(this.lines.maxLength-1,k+b-1);W>=0;W--)if(I&&I.start>A+L){for(let V=I.newLines.length-1;V>=0;V--)this.lines.set(W--,I.newLines[V]);W++,w.push({index:A+1,amount:I.newLines.length}),L+=I.newLines.length,I=y[++O]}else this.lines.set(W,v[A--]);let z=0;for(let W=w.length-1;W>=0;W--)w[W].index+=z,this.lines.onInsertEmitter.fire(w[W]),z+=w[W].amount;const F=Math.max(0,k+b-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(i,a,f=0,y){const b=this.lines.get(i);return b?b.translateToString(a,f,y):""}getWrappedRangeForLine(i){let a=i,f=i;for(;a>0&&this.lines.get(a).isWrapped;)a--;for(;f+1<this.lines.length&&this.lines.get(f+1).isWrapped;)f++;return{first:a,last:f}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].line===i&&(this.markers[a].dispose(),this.markers.splice(a--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const a=new o.Marker(i);return this.markers.push(a),a.register(this.lines.onTrim(f=>{a.line-=f,a.line<0&&a.dispose()})),a.register(this.lines.onInsert(f=>{a.line>=f.index&&(a.line+=f.amount)})),a.register(this.lines.onDelete(f=>{a.line>=f.index&&a.line<f.index+f.amount&&a.dispose(),a.line>f.index&&(a.line-=f.amount)})),a.register(a.onDispose(()=>this._removeMarker(a))),a}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const l=h(3734),d=h(511),u=h(643),p=h(482);n.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let g=0;class S{constructor(o,c,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const a=c||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let f=0;f<o;++f)this.setCell(f,a);this.length=o}get(o){const c=this._data[3*o+0],i=2097151&c;return[this._data[3*o+1],2097152&c?this._combined[o]:i?(0,p.stringFromCodePoint)(i):"",c>>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):i]}set(o,c){this._data[3*o+1]=c[u.CHAR_DATA_ATTR_INDEX],c[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?(0,p.stringFromCodePoint)(2097151&c):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,c){return g=3*o,c.content=this._data[g+0],c.fg=this._data[g+1],c.bg=this._data[g+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c}setCell(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg}setCellFromCodepoint(o,c,i,a){268435456&a.bg&&(this._extendedAttrs[o]=a.extended),this._data[3*o+0]=c|i<<22,this._data[3*o+1]=a.fg,this._data[3*o+2]=a.bg}addCodepointToCell(o,c,i){let a=this._data[3*o+0];2097152&a?this._combined[o]+=(0,p.stringFromCodePoint)(c):2097151&a?(this._combined[o]=(0,p.stringFromCodePoint)(2097151&a)+(0,p.stringFromCodePoint)(c),a&=-2097152,a|=2097152):a=c|4194304,i&&(a&=-12582913,a|=i<<22),this._data[3*o+0]=a}insertCells(o,c,i){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length-o){const a=new d.CellData;for(let f=this.length-o-c-1;f>=0;--f)this.setCell(o+c+f,this.loadCell(o+f,a));for(let f=0;f<c;++f)this.setCell(o+f,i)}else for(let a=o;a<this.length;++a)this.setCell(a,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(o,c,i){if(o%=this.length,c<this.length-o){const a=new d.CellData;for(let f=0;f<this.length-o-c;++f)this.setCell(o+f,this.loadCell(o+c+f,a));for(let f=this.length-c;f<this.length;++f)this.setCell(f,i)}else for(let a=o;a<this.length;++a)this.setCell(a,i);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,i)}replaceCells(o,c,i,a=!1){if(a)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,i);o<c&&o<this.length;)this.isProtected(o)||this.setCell(o,i),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,i);o<c&&o<this.length;)this.setCell(o++,i)}resize(o,c){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const a=new Uint32Array(i);a.set(this._data),this._data=a}for(let a=this.length;a<o;++a)this.setCell(a,c)}else{this._data=this._data.subarray(0,i);const a=Object.keys(this._combined);for(let y=0;y<a.length;y++){const b=parseInt(a[y],10);b>=o&&delete this._combined[b]}const f=Object.keys(this._extendedAttrs);for(let y=0;y<f.length;y++){const b=parseInt(f[y],10);b>=o&&delete this._extendedAttrs[b]}}return this.length=o,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,c=!1){if(c)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,o);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const c in o._combined)this._combined[c]=o._combined[c];this._extendedAttrs={};for(const c in o._extendedAttrs)this._extendedAttrs[c]=o._extendedAttrs[c];this.isWrapped=o.isWrapped}clone(){const o=new S(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const c in this._combined)o._combined[c]=this._combined[c];for(const c in this._extendedAttrs)o._extendedAttrs[c]=this._extendedAttrs[c];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,c,i,a,f){const y=o._data;if(f)for(let w=a-1;w>=0;w--){for(let v=0;v<3;v++)this._data[3*(i+w)+v]=y[3*(c+w)+v];268435456&y[3*(c+w)+2]&&(this._extendedAttrs[i+w]=o._extendedAttrs[c+w])}else for(let w=0;w<a;w++){for(let v=0;v<3;v++)this._data[3*(i+w)+v]=y[3*(c+w)+v];268435456&y[3*(c+w)+2]&&(this._extendedAttrs[i+w]=o._extendedAttrs[c+w])}const b=Object.keys(o._combined);for(let w=0;w<b.length;w++){const v=parseInt(b[w],10);v>=c&&(this._combined[v-c+i]=o._combined[v])}}translateToString(o,c,i,a){c=c??0,i=i??this.length,o&&(i=Math.min(i,this.getTrimmedLength())),a&&(a.length=0);let f="";for(;c<i;){const y=this._data[3*c+0],b=2097151&y,w=2097152&y?this._combined[c]:b?(0,p.stringFromCodePoint)(b):u.WHITESPACE_CELL_CHAR;if(f+=w,a)for(let v=0;v<w.length;++v)a.push(c);c+=y>>22||1}return a&&a.push(c),f}}n.BufferLine=S},4841:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(h,l){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return l*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(C,n)=>{function h(l,d,u){if(d===l.length-1)return l[d].getTrimmedLength();const p=!l[d].hasContent(u-1)&&l[d].getWidth(u-1)===1,g=l[d+1].getWidth(0)===2;return p&&g?u-1:u}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(l,d,u,p,g){const S=[];for(let m=0;m<l.length-1;m++){let o=m,c=l.get(++o);if(!c.isWrapped)continue;const i=[l.get(m)];for(;o<l.length&&c.isWrapped;)i.push(c),c=l.get(++o);if(p>=m&&p<o){m+=i.length-1;continue}let a=0,f=h(i,a,d),y=1,b=0;for(;y<i.length;){const v=h(i,y,d),k=v-b,A=u-f,O=Math.min(k,A);i[a].copyCellsFrom(i[y],b,f,O,!1),f+=O,f===u&&(a++,f=0),b+=O,b===v&&(y++,b=0),f===0&&a!==0&&i[a-1].getWidth(u-1)===2&&(i[a].copyCellsFrom(i[a-1],u-1,f++,1,!1),i[a-1].setCell(u-1,g))}i[a].replaceCells(f,u,g);let w=0;for(let v=i.length-1;v>0&&(v>a||i[v].getTrimmedLength()===0);v--)w++;w>0&&(S.push(m+i.length-w),S.push(w)),m+=i.length-1}return S},n.reflowLargerCreateNewLayout=function(l,d){const u=[];let p=0,g=d[p],S=0;for(let m=0;m<l.length;m++)if(g===m){const o=d[++p];l.onDeleteEmitter.fire({index:m-S,amount:o}),m+=o-1,S+=o,g=d[++p]}else u.push(m);return{layout:u,countRemoved:S}},n.reflowLargerApplyNewLayout=function(l,d){const u=[];for(let p=0;p<d.length;p++)u.push(l.get(d[p]));for(let p=0;p<u.length;p++)l.set(p,u[p]);l.length=d.length},n.reflowSmallerGetNewLineLengths=function(l,d,u){const p=[],g=l.map((c,i)=>h(l,i,d)).reduce((c,i)=>c+i);let S=0,m=0,o=0;for(;o<g;){if(g-o<u){p.push(g-o);break}S+=u;const c=h(l,m,d);S>c&&(S-=c,m++);const i=l[m].getWidth(S-1)===2;i&&S--;const a=i?u-1:u;p.push(a),o+=a}return p},n.getWrappedLineTrimmedLength=h},5295:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const l=h(8460),d=h(844),u=h(9092);class p extends d.Disposable{constructor(S,m){super(),this._optionsService=S,this._bufferService=m,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,m){this._normal.resize(S,m),this._alt.resize(S,m),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}n.BufferSet=p},511:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const l=h(482),d=h(643),u=h(3734);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const m=new p;return m.setFromCharData(S),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(S[d.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(S[d.CHAR_DATA_CHAR_INDEX].length===2){const o=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|S[d.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=S[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=p},643:(C,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:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const l=h(8460),d=h(844);class u{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}n.Marker=u,u._nextId=1},7116:(C,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:(C,n)=>{var h,l,d;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
8
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(h||(n.C0=h={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(l||(n.C1=l={})),function(u){u.ST=`${h.ESC}\\`}(d||(n.C1_ESCAPED=d={}))},7399:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const l=h(2584),d={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(u,p,g,S){const m={type:0,cancel:!1,key:void 0},o=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?m.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?m.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?m.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(m.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:m.key=u.ctrlKey?"\b":l.C0.DEL,u.altKey&&(m.key=l.C0.ESC+m.key);break;case 9:if(u.shiftKey){m.key=l.C0.ESC+"[Z";break}m.key=l.C0.HT,m.cancel=!0;break;case 13:m.key=u.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,m.cancel=!0;break;case 27:m.key=l.C0.ESC,u.altKey&&(m.key=l.C0.ESC+l.C0.ESC),m.cancel=!0;break;case 37:if(u.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"D",m.key===l.C0.ESC+"[1;3D"&&(m.key=l.C0.ESC+(g?"b":"[1;5D"))):m.key=p?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(u.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"C",m.key===l.C0.ESC+"[1;3C"&&(m.key=l.C0.ESC+(g?"f":"[1;5C"))):m.key=p?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(u.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"A",g||m.key!==l.C0.ESC+"[1;3A"||(m.key=l.C0.ESC+"[1;5A")):m.key=p?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(u.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"B",g||m.key!==l.C0.ESC+"[1;3B"||(m.key=l.C0.ESC+"[1;5B")):m.key=p?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(m.key=l.C0.ESC+"[2~");break;case 46:m.key=o?l.C0.ESC+"[3;"+(o+1)+"~":l.C0.ESC+"[3~";break;case 36:m.key=o?l.C0.ESC+"[1;"+(o+1)+"H":p?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:m.key=o?l.C0.ESC+"[1;"+(o+1)+"F":p?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:u.shiftKey?m.type=2:u.ctrlKey?m.key=l.C0.ESC+"[5;"+(o+1)+"~":m.key=l.C0.ESC+"[5~";break;case 34:u.shiftKey?m.type=3:u.ctrlKey?m.key=l.C0.ESC+"[6;"+(o+1)+"~":m.key=l.C0.ESC+"[6~";break;case 112:m.key=o?l.C0.ESC+"[1;"+(o+1)+"P":l.C0.ESC+"OP";break;case 113:m.key=o?l.C0.ESC+"[1;"+(o+1)+"Q":l.C0.ESC+"OQ";break;case 114:m.key=o?l.C0.ESC+"[1;"+(o+1)+"R":l.C0.ESC+"OR";break;case 115:m.key=o?l.C0.ESC+"[1;"+(o+1)+"S":l.C0.ESC+"OS";break;case 116:m.key=o?l.C0.ESC+"[15;"+(o+1)+"~":l.C0.ESC+"[15~";break;case 117:m.key=o?l.C0.ESC+"[17;"+(o+1)+"~":l.C0.ESC+"[17~";break;case 118:m.key=o?l.C0.ESC+"[18;"+(o+1)+"~":l.C0.ESC+"[18~";break;case 119:m.key=o?l.C0.ESC+"[19;"+(o+1)+"~":l.C0.ESC+"[19~";break;case 120:m.key=o?l.C0.ESC+"[20;"+(o+1)+"~":l.C0.ESC+"[20~";break;case 121:m.key=o?l.C0.ESC+"[21;"+(o+1)+"~":l.C0.ESC+"[21~";break;case 122:m.key=o?l.C0.ESC+"[23;"+(o+1)+"~":l.C0.ESC+"[23~";break;case 123:m.key=o?l.C0.ESC+"[24;"+(o+1)+"~":l.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(g&&!S||!u.altKey||u.metaKey)!g||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?m.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(m.key=l.C0.US),u.key==="@"&&(m.key=l.C0.NUL)):u.keyCode===65&&(m.type=1);else{const c=d[u.keyCode],i=c==null?void 0:c[u.shiftKey?1:0];if(i)m.key=l.C0.ESC+i;else if(u.keyCode>=65&&u.keyCode<=90){const a=u.ctrlKey?u.keyCode-64:u.keyCode+32;let f=String.fromCharCode(a);u.shiftKey&&(f=f.toUpperCase()),m.key=l.C0.ESC+f}else if(u.keyCode===32)m.key=l.C0.ESC+(u.ctrlKey?l.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let a=u.code.slice(3,4);u.shiftKey||(a=a.toLowerCase()),m.key=l.C0.ESC+a,m.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?m.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?m.key=l.C0.NUL:u.keyCode>=51&&u.keyCode<=55?m.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?m.key=l.C0.DEL:u.keyCode===219?m.key=l.C0.ESC:u.keyCode===220?m.key=l.C0.FS:u.keyCode===221&&(m.key=l.C0.GS)}return m}},482:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},n.utf32ToString=function(h,l=0,d=h.length){let u="";for(let p=l;p<d;++p){let g=h[p];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,l){const d=h.length;if(!d)return 0;let u=0,p=0;if(this._interim){const g=h.charCodeAt(p++);56320<=g&&g<=57343?l[u++]=1024*(this._interim-55296)+g-56320+65536:(l[u++]=this._interim,l[u++]=g),this._interim=0}for(let g=p;g<d;++g){const S=h.charCodeAt(g);if(55296<=S&&S<=56319){if(++g>=d)return this._interim=S,u;const m=h.charCodeAt(g);56320<=m&&m<=57343?l[u++]=1024*(S-55296)+m-56320+65536:(l[u++]=S,l[u++]=m)}else S!==65279&&(l[u++]=S)}return u}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,l){const d=h.length;if(!d)return 0;let u,p,g,S,m=0,o=0,c=0;if(this.interim[0]){let f=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,w=0;for(;(b=63&this.interim[++w])&&w<4;)y<<=6,y|=b;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=v-w;for(;c<k;){if(c>=d)return 0;if(b=h[c++],(192&b)!=128){c--,f=!0;break}this.interim[w++]=b,y<<=6,y|=63&b}f||(v===2?y<128?c--:l[m++]=y:v===3?y<2048||y>=55296&&y<=57343||y===65279||(l[m++]=y):y<65536||y>1114111||(l[m++]=y)),this.interim.fill(0)}const i=d-4;let a=c;for(;a<d;){for(;!(!(a<i)||128&(u=h[a])||128&(p=h[a+1])||128&(g=h[a+2])||128&(S=h[a+3]));)l[m++]=u,l[m++]=p,l[m++]=g,l[m++]=S,a+=4;if(u=h[a++],u<128)l[m++]=u;else if((224&u)==192){if(a>=d)return this.interim[0]=u,m;if(p=h[a++],(192&p)!=128){a--;continue}if(o=(31&u)<<6|63&p,o<128){a--;continue}l[m++]=o}else if((240&u)==224){if(a>=d)return this.interim[0]=u,m;if(p=h[a++],(192&p)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=p,m;if(g=h[a++],(192&g)!=128){a--;continue}if(o=(15&u)<<12|(63&p)<<6|63&g,o<2048||o>=55296&&o<=57343||o===65279)continue;l[m++]=o}else if((248&u)==240){if(a>=d)return this.interim[0]=u,m;if(p=h[a++],(192&p)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=p,m;if(g=h[a++],(192&g)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=g,m;if(S=h[a++],(192&S)!=128){a--;continue}if(o=(7&u)<<18|(63&p)<<12|(63&g)<<6|63&S,o<65536||o>1114111)continue;l[m++]=o}}return m}}},225:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const l=h(1480),d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;n.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let g=0;g<d.length;++g)p.fill(0,d[g][0],d[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?p[g]:function(S,m){let o,c=0,i=m.length-1;if(S<m[0][0]||S>m[i][1])return!1;for(;i>=c;)if(o=c+i>>1,S>m[o][1])c=o+1;else{if(!(S<m[o][0]))return!0;i=o-1}return!1}(g,u)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,S){let m=this.wcwidth(g),o=m===0&&S!==0;if(o){const c=l.UnicodeService.extractWidth(S);c===0?o=!1:c>m&&(m=c)}return l.UnicodeService.createPropertyValue(0,m,o)}}},5981:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const l=h(8460),d=h(844);class u extends d.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,S){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S)}_innerWrite(g=0,S=!0){const m=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,S);if(c){const a=f=>Date.now()-m>=12?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(m,f);return void c.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(a)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=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=u},5941:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const h=/^([\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})$/,l=/^[\da-f]+$/;function d(u,p){const g=u.toString(16),S=g.length<2?"0"+g:g;switch(p){case 4:return g[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}n.parseColor=function(u){if(!u)return;let p=u.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const g=h.exec(p);if(g){const S=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/S*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/S*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/S*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),l.exec(p)&&[3,6,9,12].includes(p.length))){const g=p.length/3,S=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(p.slice(g*m,g*m+g),16);S[m]=g===1?o<<4:g===2?o:g===3?o>>4:o>>8}return S}},n.toRgbString=function(u,p=16){const[g,S,m]=u;return`rgb:${d(g,p)}/${d(S,p)}/${d(m,p)}`}},5770:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const l=h(482),d=h(8742),u=h(5770),p=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(S,m){this._handlers[S]===void 0&&(this._handlers[S]=[]);const o=this._handlers[S];return o.push(m),{dispose:()=>{const c=o.indexOf(m);c!==-1&&o.splice(c,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(S,m){if(this.reset(),this._ident=S,this._active=this._handlers[S]||p,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(S,m,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(S,m,o);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(S,m,o))}unhook(S,m=!0){if(this._active.length){let o=!1,c=this._active.length-1,i=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,o=m,i=this._stack.fallThrough,this._stack.paused=!1),!i&&o===!1){for(;c>=0&&(o=this._active[c].unhook(S),o!==!0);c--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,o;c--}for(;c>=0;c--)if(o=this._active[c].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",S);this._active=p,this._ident=0}};const g=new d.Params;g.addParam(0),n.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=g,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():g,this._data="",this._hitLimit=!1}put(S,m,o){this._hitLimit||(this._data+=(0,l.utf32ToString)(S,m,o),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let m=!1;if(this._hitLimit)m=!1;else if(S&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then(o=>(this._params=g,this._data="",this._hitLimit=!1,o));return this._params=g,this._data="",this._hitLimit=!1,m}}},2015:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const l=h(844),d=h(8742),u=h(6242),p=h(6351);class g{constructor(c){this.table=new Uint8Array(c)}setDefault(c,i){this.table.fill(c<<4|i)}add(c,i,a,f){this.table[i<<8|c]=a<<4|f}addMany(c,i,a,f){for(let y=0;y<c.length;y++)this.table[i<<8|c[y]]=a<<4|f}}n.TransitionTable=g;const S=160;n.VT500_TRANSITION_TABLE=function(){const o=new g(4095),c=Array.apply(null,Array(256)).map((w,v)=>v),i=(w,v)=>c.slice(w,v),a=i(32,127),f=i(0,24);f.push(25),f.push.apply(f,i(28,32));const y=i(0,14);let b;for(b in o.setDefault(1,0),o.addMany(a,0,2,0),y)o.addMany([24,26,153,154],b,3,0),o.addMany(i(128,144),b,3,0),o.addMany(i(144,152),b,3,0),o.add(156,b,0,0),o.add(27,b,11,1),o.add(157,b,4,8),o.addMany([152,158,159],b,0,7),o.add(155,b,11,3),o.add(144,b,11,9);return o.addMany(f,0,3,0),o.addMany(f,1,3,1),o.add(127,1,0,1),o.addMany(f,8,0,8),o.addMany(f,3,3,3),o.add(127,3,0,3),o.addMany(f,4,3,4),o.add(127,4,0,4),o.addMany(f,6,3,6),o.addMany(f,5,3,5),o.add(127,5,0,5),o.addMany(f,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(a,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(i(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(a,7,0,7),o.addMany(f,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(i(64,127),3,7,0),o.addMany(i(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(i(48,60),4,8,4),o.addMany(i(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(i(32,64),6,0,6),o.add(127,6,0,6),o.addMany(i(64,127),6,0,0),o.addMany(i(32,48),3,9,5),o.addMany(i(32,48),5,9,5),o.addMany(i(48,64),5,0,6),o.addMany(i(64,127),5,7,0),o.addMany(i(32,48),4,9,5),o.addMany(i(32,48),1,9,2),o.addMany(i(32,48),2,9,2),o.addMany(i(48,127),2,10,0),o.addMany(i(48,80),1,10,0),o.addMany(i(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(i(96,127),1,10,0),o.add(80,1,11,9),o.addMany(f,9,0,9),o.add(127,9,0,9),o.addMany(i(28,32),9,0,9),o.addMany(i(32,48),9,9,12),o.addMany(i(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(f,11,0,11),o.addMany(i(32,128),11,0,11),o.addMany(i(28,32),11,0,11),o.addMany(f,10,0,10),o.add(127,10,0,10),o.addMany(i(28,32),10,0,10),o.addMany(i(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(i(32,48),10,9,12),o.addMany(f,12,0,12),o.add(127,12,0,12),o.addMany(i(28,32),12,0,12),o.addMany(i(32,48),12,9,12),o.addMany(i(48,64),12,0,11),o.addMany(i(64,127),12,12,13),o.addMany(i(64,127),10,12,13),o.addMany(i(64,127),9,12,13),o.addMany(f,13,13,13),o.addMany(a,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(S,0,2,0),o.add(S,8,5,8),o.add(S,6,0,6),o.add(S,11,0,11),o.add(S,13,13,13),o}();class m extends l.Disposable{constructor(c=n.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,a,f)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,a)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(c,i=[64,126]){let a=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=c.prefix.charCodeAt(0),a&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<c.intermediates.length;++y){const b=c.intermediates.charCodeAt(y);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=b}}if(c.final.length!==1)throw new Error("final must be a single byte");const f=c.final.charCodeAt(0);if(i[0]>f||f>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return a<<=8,a|=f,a}identToString(c){const i=[];for(;c;)i.push(String.fromCharCode(255&c)),c>>=8;return i.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,i){const a=this._identifier(c,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);const f=this._escHandlers[a];return f.push(i),{dispose:()=>{const y=f.indexOf(i);y!==-1&&f.splice(y,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,i){this._executeHandlers[c.charCodeAt(0)]=i}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,i){const a=this._identifier(c);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);const f=this._csiHandlers[a];return f.push(i),{dispose:()=>{const y=f.indexOf(i);y!==-1&&f.splice(y,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,i){return this._dcsParser.registerHandler(this._identifier(c),i)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,i){return this._oscParser.registerHandler(c,i)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,i,a,f,y){this._parseStack.state=c,this._parseStack.handlers=i,this._parseStack.handlerPos=a,this._parseStack.transition=f,this._parseStack.chunkPos=y}parse(c,i,a){let f,y=0,b=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(a===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 k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&k>-1){for(;k>=0&&(f=v[k](this._params),f!==!0);k--)if(f instanceof Promise)return this._parseStack.handlerPos=k,f}this._parseStack.handlers=[];break;case 4:if(a===!1&&k>-1){for(;k>=0&&(f=v[k](),f!==!0);k--)if(f instanceof Promise)return this._parseStack.handlerPos=k,f}this._parseStack.handlers=[];break;case 6:if(y=c[this._parseStack.chunkPos],f=this._dcsParser.unhook(y!==24&&y!==26,a),f)return f;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=c[this._parseStack.chunkPos],f=this._oscParser.end(y!==24&&y!==26,a),f)return f;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=w;v<i;++v){switch(y=c[v],b=this._transitions.table[this.currentState<<8|(y<160?y:S)],b>>4){case 2:for(let L=v+1;;++L){if(L>=i||(y=c[L])<32||y>126&&y<S){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<S){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<S){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<S){this._printHandler(c,v,L),v=L-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|y];let A=k?k.length-1:-1;for(;A>=0&&(f=k[A](this._params),f!==!0);A--)if(f instanceof Promise)return this._preserveStack(3,k,A,b,v),f;A<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingJoinState=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++v<i&&(y=c[v])>47&&y<60);v--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const O=this._escHandlers[this._collect<<8|y];let I=O?O.length-1:-1;for(;I>=0&&(f=O[I](),f!==!0);I--)if(f instanceof Promise)return this._preserveStack(4,O,I,b,v),f;I<0&&this._escHandlerFb(this._collect<<8|y),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|y,this._params);break;case 13:for(let L=v+1;;++L)if(L>=i||(y=c[L])===24||y===26||y===27||y>127&&y<S){this._dcsParser.put(c,v,L),v=L-1;break}break;case 14:if(f=this._dcsParser.unhook(y!==24&&y!==26),f)return this._preserveStack(6,[],0,b,v),f;y===27&&(b|=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 L=v+1;;L++)if(L>=i||(y=c[L])<32||y>127&&y<S){this._oscParser.put(c,v,L),v=L-1;break}break;case 6:if(f=this._oscParser.end(y!==24&&y!==26),f)return this._preserveStack(5,[],0,b,v),f;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}n.EscapeSequenceParser=m},6242:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const l=h(5770),d=h(482),u=[];n.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,g){this._handlers[p]===void 0&&(this._handlers[p]=[]);const S=this._handlers[p];return S.push(g),{dispose:()=>{const m=S.indexOf(g);m!==-1&&S.splice(m,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,g,S){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(p,g,S);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(p,g,S))}start(){this.reset(),this._state=1}put(p,g,S){if(this._state!==3){if(this._state===1)for(;g<S;){const m=p[g++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&S-g>0&&this._put(p,g,S)}}end(p,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,S=g,o=this._stack.fallThrough,this._stack.paused=!1),!o&&S===!1){for(;m>=0&&(S=this._active[m].end(p),S!==!0);m--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,S;m--}for(;m>=0;m--)if(S=this._active[m].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",p);this._active=u,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,g,S){this._hitLimit||(this._data+=(0,d.utf32ToString)(p,g,S),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let g=!1;if(this._hitLimit)g=!1;else if(p&&(g=this._handler(this._data),g instanceof Promise))return g.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,g}}},8742:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const h=2147483647;class l{static fromArray(u){const p=new l;if(!u.length)return p;for(let g=Array.isArray(u[0])?1:0;g<u.length;++g){const S=u[g];if(Array.isArray(S))for(let m=0;m<S.length;++m)p.addSubParam(S[m]);else p.addParam(S)}return p}constructor(u=32,p=32){if(this.maxLength=u,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new l(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let p=0;p<this.length;++p){u.push(this.params[p]);const g=this._subParamsIdx[p]>>8,S=255&this._subParamsIdx[p];S-g>0&&u.push(Array.prototype.slice.call(this._subParams,g,S))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>h?h:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>h?h:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const p=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];return g-p>0?this._subParams.subarray(p,g):null}getSubParamsAll(){const u={};for(let p=0;p<this.length;++p){const g=this._subParamsIdx[p]>>8,S=255&this._subParamsIdx[p];S-g>0&&(u[p]=this._subParams.slice(g,S))}return u}addDigit(u){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,S=g[p-1];g[p-1]=~S?Math.min(10*S+u,h):u}}n.Params=l},5741:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,l){const d={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(d),l.dispose=()=>this._wrappedAddonDispose(d),l.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let l=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===h){l=d;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(l,1)}}},8771:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const l=h(3785),d=h(511);n.BufferApiView=class{constructor(u,p){this._buffer=u,this.type=p}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const p=this._buffer.lines.get(u);if(p)return new l.BufferLineApiView(p)}getNullCell(){return new d.CellData}}},3785:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const l=h(511);n.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,u){if(!(d<0||d>=this._line.length))return u?(this._line.loadCell(d,u),u):this._line.loadCell(d,new l.CellData)}translateToString(d,u,p){return this._line.translateToString(d,u,p)}}},8285:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const l=h(8771),d=h(8460),u=h(844);class p extends u.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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=p},7975:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,l){return this._core.registerCsiHandler(h,d=>l(d.toArray()))}addCsiHandler(h,l){return this.registerCsiHandler(h,l)}registerDcsHandler(h,l){return this._core.registerDcsHandler(h,(d,u)=>l(d,u.toArray()))}addDcsHandler(h,l){return this.registerDcsHandler(h,l)}registerEscHandler(h,l){return this._core.registerEscHandler(h,l)}addEscHandler(h,l){return this.registerEscHandler(h,l)}registerOscHandler(h,l){return this._core.registerOscHandler(h,l)}addOscHandler(h,l){return this.registerOscHandler(h,l)}}},7090:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(C,n,h){var l=this&&this.__decorate||function(o,c,i,a){var f,y=arguments.length,b=y<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,c,i,a);else for(var w=o.length-1;w>=0;w--)(f=o[w])&&(b=(y<3?f(b):y>3?f(c,i,b):f(c,i))||b);return y>3&&b&&Object.defineProperty(c,i,b),b},d=this&&this.__param||function(o,c){return function(i,a){c(i,a,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const u=h(8460),p=h(844),g=h(5295),S=h(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let m=n.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(o,this))}resize(o,c){this.cols=o,this.rows=c,this.buffers.resize(o,c),this._onResize.fire({cols:o,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,c=!1){const i=this.buffer;let a;a=this._cachedBlankLine,a&&a.length===this.cols&&a.getFg(0)===o.fg&&a.getBg(0)===o.bg||(a=i.getBlankLine(o,c),this._cachedBlankLine=a),a.isWrapped=c;const f=i.ybase+i.scrollTop,y=i.ybase+i.scrollBottom;if(i.scrollTop===0){const b=i.lines.isFull;y===i.lines.length-1?b?i.lines.recycle().copyFrom(a):i.lines.push(a.clone()):i.lines.splice(y+1,0,a.clone()),b?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const b=y-f+1;i.lines.shiftElements(f+1,b-1,-1),i.lines.set(y,a.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(o,c,i){const a=this.buffer;if(o<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else o+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);const f=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+o,a.ybase),0),f!==a.ydisp&&(c||this._onScroll.fire(a.ydisp))}};n.BufferService=m=l([d(0,S.IOptionsService)],m)},7994:(C,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(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,l){this._charsets[h]=l,this.glevel===h&&(this.charset=l)}}},1753:function(C,n,h){var l=this&&this.__decorate||function(a,f,y,b){var w,v=arguments.length,k=v<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,f,y,b);else for(var A=a.length-1;A>=0;A--)(w=a[A])&&(k=(v<3?w(k):v>3?w(f,y,k):w(f,y))||k);return v>3&&k&&Object.defineProperty(f,y,k),k},d=this&&this.__param||function(a,f){return function(y,b){f(y,b,a)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const u=h(2585),p=h(8460),g=h(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:a=>a.button!==4&&a.action===1&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)},VT200:{events:19,restrict:a=>a.action!==32},DRAG:{events:23,restrict:a=>a.action!==32||a.button!==3},ANY:{events:31,restrict:a=>!0}};function m(a,f){let y=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return a.button===4?(y|=64,y|=a.action):(y|=3&a.button,4&a.button&&(y|=64),8&a.button&&(y|=128),a.action===32?y|=32:a.action!==0||f||(y|=3)),y}const o=String.fromCharCode,c={DEFAULT:a=>{const f=[m(a,!1)+32,a.col+32,a.row+32];return f[0]>255||f[1]>255||f[2]>255?"":`\x1B[M${o(f[0])}${o(f[1])}${o(f[2])}`},SGR:a=>{const f=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${m(a,!0)};${a.col};${a.row}${f}`},SGR_PIXELS:a=>{const f=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${m(a,!0)};${a.x};${a.y}${f}`}};let i=n.CoreMouseService=class extends g.Disposable{constructor(a,f){super(),this._bufferService=a,this._coreService=f,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(S))this.addProtocol(y,S[y]);for(const y of Object.keys(c))this.addEncoding(y,c[y]);this.reset()}addProtocol(a,f){this._protocols[a]=f}addEncoding(a,f){this._encodings[a]=f}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(a){if(!this._protocols[a])throw new Error(`unknown protocol "${a}"`);this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(a){if(!this._encodings[a])throw new Error(`unknown encoding "${a}"`);this._activeEncoding=a}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows||a.button===4&&a.action===32||a.button===3&&a.action!==32||a.button!==4&&(a.action===2||a.action===3)||(a.col++,a.row++,a.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,a,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(a))return!1;const f=this._encodings[this._activeEncoding](a);return f&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(f):this._coreService.triggerDataEvent(f,!0)),this._lastEvent=a,!0}explainEvents(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}}_equalEvents(a,f,y){if(y){if(a.x!==f.x||a.y!==f.y)return!1}else if(a.col!==f.col||a.row!==f.row)return!1;return a.button===f.button&&a.action===f.action&&a.ctrl===f.ctrl&&a.alt===f.alt&&a.shift===f.shift}};n.CoreMouseService=i=l([d(0,u.IBufferService),d(1,u.ICoreService)],i)},6975:function(C,n,h){var l=this&&this.__decorate||function(i,a,f,y){var b,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(b=i[k])&&(v=(w<3?b(v):w>3?b(a,f,v):b(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const u=h(1439),p=h(8460),g=h(844),S=h(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=n.CoreService=class extends g.Disposable{constructor(i,a,f){super(),this._bufferService=i,this._logService=a,this._optionsService=f,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(m),this.decPrivateModes=(0,u.clone)(o)}reset(){this.modes=(0,u.clone)(m),this.decPrivateModes=(0,u.clone)(o)}triggerDataEvent(i,a=!1){if(this._optionsService.rawOptions.disableStdin)return;const f=this._bufferService.buffer;a&&this._optionsService.rawOptions.scrollOnUserInput&&f.ybase!==f.ydisp&&this._onRequestScrollToBottom.fire(),a&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(y=>y.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(a=>a.charCodeAt(0))),this._onBinary.fire(i))}};n.CoreService=c=l([d(0,S.IBufferService),d(1,S.ILogService),d(2,S.IOptionsService)],c)},9074:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const l=h(8055),d=h(8460),u=h(844),p=h(6106);let g=0,S=0;class m extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(i=>i==null?void 0:i.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(i){if(i.marker.isDisposed)return;const a=new o(i);if(a){const f=a.marker.onDispose(()=>a.dispose());a.onDispose(()=>{a&&(this._decorations.delete(a)&&this._onDecorationRemoved.fire(a),f.dispose())}),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,a,f){let y=0,b=0;for(const w of this._decorations.getKeyIterator(a))y=w.options.x??0,b=y+(w.options.width??1),i>=y&&i<b&&(!f||(w.options.layer??"bottom")===f)&&(yield w)}forEachDecorationAtCell(i,a,f,y){this._decorations.forEachByKey(a,b=>{g=b.options.x??0,S=g+(b.options.width??1),i>=g&&i<S&&(!f||(b.options.layer??"bottom")===f)&&y(b)})}}n.DecorationService=m;class o extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const l=h(2585),d=h(8343);class u{constructor(...g){this._entries=new Map;for(const[S,m]of g)this.set(S,m)}set(g,S){const m=this._entries.get(g);return this._entries.set(g,S),m}forEach(g){for(const[S,m]of this._entries.entries())g(S,m)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}n.ServiceCollection=u,n.InstantiationService=class{constructor(){this._services=new u,this._services.set(l.IInstantiationService,this)}setService(p,g){this._services.set(p,g)}getService(p){return this._services.get(p)}createInstance(p,...g){const S=(0,d.getServiceDependencies)(p).sort((c,i)=>c.index-i.index),m=[];for(const c of S){const i=this._services.get(c.id);if(!i)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${c.id}.`);m.push(i)}const o=S.length>0?S[0].index:g.length;if(g.length!==o)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${o+1} conflicts with ${g.length} static arguments`);return new p(...g,...m)}}},7866:function(C,n,h){var l=this&&this.__decorate||function(o,c,i,a){var f,y=arguments.length,b=y<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,c,i,a);else for(var w=o.length-1;w>=0;w--)(f=o[w])&&(b=(y<3?f(b):y>3?f(c,i,b):f(c,i))||b);return y>3&&b&&Object.defineProperty(c,i,b),b},d=this&&this.__param||function(o,c){return function(i,a){c(i,a,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const u=h(844),p=h(2585),g={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let S,m=n.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,i){this._evalLazyOptionalParams(i),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...i)}trace(o,...c){var i;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,o,c)}debug(o,...c){var i;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,o,c)}info(o,...c){var i;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,o,c)}warn(o,...c){var i;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,o,c)}error(o,...c){var i;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,o,c)}};n.LogService=m=l([d(0,p.IOptionsService)],m),n.setTraceLogger=function(o){S=o},n.traceCall=function(o,c,i){if(typeof i.value!="function")throw new Error("not supported");const a=i.value;i.value=function(...f){if(S.logLevel!==p.LogLevelEnum.TRACE)return a.apply(this,f);S.trace(`GlyphRenderer#${a.name}(${f.map(b=>JSON.stringify(b)).join(", ")})`);const y=a.apply(this,f);return S.trace(`GlyphRenderer#${a.name} return`,y),y}}},7302:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const l=h(8460),d=h(844),u=h(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:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends d.Disposable{constructor(m){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...n.DEFAULT_OPTIONS};for(const c in m)if(c in o)try{const i=m[c];o[c]=this._sanitizeAndValidateOption(c,i)}catch(i){console.error(i)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(m,o){return this.onOptionChange(c=>{c===m&&o(this.rawOptions[m])})}onMultipleOptionChange(m,o){return this.onOptionChange(c=>{m.indexOf(c)!==-1&&o()})}_setupOptions(){const m=c=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},o=(c,i)=>{if(!(c in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);i=this._sanitizeAndValidateOption(c,i),this.rawOptions[c]!==i&&(this.rawOptions[c]=i,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const i={get:m.bind(this,c),set:o.bind(this,c)};Object.defineProperty(this.options,c,i)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=n.DEFAULT_OPTIONS[m]),!function(c){return c==="block"||c==="underline"||c==="bar"}(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=n.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=p.includes(o)?o:n.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}n.OptionsService=g},2660:function(C,n,h){var l=this&&this.__decorate||function(g,S,m,o){var c,i=arguments.length,a=i<3?S:o===null?o=Object.getOwnPropertyDescriptor(S,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(g,S,m,o);else for(var f=g.length-1;f>=0;f--)(c=g[f])&&(a=(i<3?c(a):i>3?c(S,m,a):c(S,m))||a);return i>3&&a&&Object.defineProperty(S,m,a),a},d=this&&this.__param||function(g,S){return function(m,o){S(m,o,g)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const u=h(2585);let p=n.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const S=this._bufferService.buffer;if(g.id===void 0){const f=S.addMarker(S.ybase+S.y),y={data:g,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(y,f)),this._dataByLinkId.set(y.id,y),y.id}const m=g,o=this._getEntryIdKey(m),c=this._entriesWithId.get(o);if(c)return this.addLineToLink(c.id,S.ybase+S.y),c.id;const i=S.addMarker(S.ybase+S.y),a={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(a,i)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(g,S){const m=this._dataByLinkId.get(g);if(m&&m.lines.every(o=>o.line!==S)){const o=this._bufferService.buffer.addMarker(S);m.lines.push(o),o.onDispose(()=>this._removeMarkerFromLink(m,o))}}getLinkData(g){var S;return(S=this._dataByLinkId.get(g))==null?void 0:S.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,S){const m=g.lines.indexOf(S);m!==-1&&(g.lines.splice(m,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};n.OscLinkService=p=l([d(0,u.IBufferService)],p)},8343:(C,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const h="di$target",l="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(d){return d[l]||[]},n.createDecorator=function(d){if(n.serviceRegistry.has(d))return n.serviceRegistry.get(d);const u=function(p,g,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,c){o[h]===o?o[l].push({id:m,index:c}):(o[l]=[{id:m,index:c}],o[h]=o)})(u,p,S)};return u.toString=()=>d,n.serviceRegistry.set(d,u),u}},2585:(C,n,h)=>{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 l=h(8343);var d;n.IBufferService=(0,l.createDecorator)("BufferService"),n.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),n.ICoreService=(0,l.createDecorator)("CoreService"),n.ICharsetService=(0,l.createDecorator)("CharsetService"),n.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(n.LogLevelEnum=d={})),n.ILogService=(0,l.createDecorator)("LogService"),n.IOptionsService=(0,l.createDecorator)("OptionsService"),n.IOscLinkService=(0,l.createDecorator)("OscLinkService"),n.IUnicodeService=(0,l.createDecorator)("UnicodeService"),n.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(C,n,h)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const l=h(8460),d=h(225);class u{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,S,m=!1){return(16777215&g)<<3|(3&S)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const g=new d.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let S=0,m=0;const o=g.length;for(let c=0;c<o;++c){let i=g.charCodeAt(c);if(55296<=i&&i<=56319){if(++c>=o)return S+this.wcwidth(i);const y=g.charCodeAt(c);56320<=y&&y<=57343?i=1024*(i-55296)+y-56320+65536:S+=this.wcwidth(y)}const a=this.charProperties(i,m);let f=u.extractWidth(a);u.extractShouldJoin(a)&&(f-=u.extractWidth(m)),S+=f,m=a}return S}charProperties(g,S){return this._activeProvider.charProperties(g,S)}}n.UnicodeService=u}},s={};function _(C){var n=s[C];if(n!==void 0)return n.exports;var h=s[C]={exports:{}};return r[C].call(h.exports,h,h.exports,_),h.exports}var E={};return(()=>{var C=E;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const n=_(9042),h=_(3236),l=_(844),d=_(5741),u=_(8285),p=_(7975),g=_(7090),S=["cols","rows"];class m extends l.Disposable{constructor(c){super(),this._core=this.register(new h.Terminal(c)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const i=f=>this._core.options[f],a=(f,y)=>{this._checkReadonlyOptions(f),this._core.options[f]=y};for(const f in this._core.options){const y={get:i.bind(this,f),set:a.bind(this,f)};Object.defineProperty(this._publicOptions,f,y)}}_checkReadonlyOptions(c){if(S.includes(c))throw new Error(`Option "${c}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const i in c)this._publicOptions[i]=c[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,i=!0){this._core.input(c,i)}resize(c,i){this._verifyIntegers(c,i),this._core.resize(c,i)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,i,a){this._verifyIntegers(c,i,a),this._core.select(c,i,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,i){this._verifyIntegers(c,i),this._core.selectLines(c,i)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,i){this._core.write(c,i)}writeln(c,i){this._core.write(c),this._core.write(`\r
|
|
9
|
-
`,i)}paste(c){this._core.paste(c)}refresh(c,i){this._verifyIntegers(c,i),this._core.refresh(c,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return n}_verifyIntegers(...c){for(const i of c)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const i of c)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}C.Terminal=m})(),E})())}(nr)),nr.exports}var Zh=Uh();function M(e,t){class r{constructor(_){var E;const C=this;r.init(C,_),(E=C._zod).deferred??(E.deferred=[]);for(const n of C._zod.deferred)n()}static init(_,E){var C;_._zod??(_._zod={}),(C=_._zod).traits??(C.traits=new Set),_._zod.traits.add(e),t(_,E);for(const n in r.prototype)Object.defineProperty(_,n,{value:r.prototype[n].bind(_)});_._zod.constr=r,_._zod.def=E}static[Symbol.hasInstance](_){var E,C;return(C=(E=_==null?void 0:_._zod)==null?void 0:E.traits)==null?void 0:C.has(e)}}return Object.defineProperty(r,"name",{value:e}),r}const Ms=Symbol("zod_brand");class Fe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const or={};function ae(e){return e&&Object.assign(or,e),or}function qh(e){return e}function Kh(e){return e}function Vh(e){}function Gh(e){throw new Error}function Jh(e){}function Yh(e){const t=Object.keys(e).filter(s=>typeof e[e[s]]!="number"),r={};for(const s of t)r[s]=e[s];return Object.values(r)}function Te(e,t="|"){return e.map(r=>ot(r)).join(t)}function $s(e,t){return typeof t=="bigint"?t.toString():t}function Ce(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Be(e){return e==null}function Lt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function zs(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,_=r>s?r:s,E=Number.parseInt(e.toFixed(_).replace(".","")),C=Number.parseInt(t.toFixed(_).replace(".",""));return E%C/10**_}function ye(e,t,r){Object.defineProperty(e,t,{get(){{const s=r();return e[t]=s,s}},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function ve(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Xh(e,t){return t?t.reduce((r,s)=>r==null?void 0:r[s],e):e}function Qh(e){const t=Object.keys(e),r=t.map(s=>e[s]);return Promise.all(r).then(s=>{const _={};for(let E=0;E<t.length;E++)_[t[E]]=s[E];return _})}function vr(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let s=0;s<e;s++)r+=t[Math.floor(Math.random()*t.length)];return r}function $e(e){return JSON.stringify(e)}function br(e){return typeof e=="object"&&e!==null}const Hs=Ce(()=>{try{return new Function(""),!0}catch{return!1}});function wt(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function el(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const tl=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ct=new Set(["string","number","symbol"]),Fs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pe(e,t){const r=new e._zod.constr(t??e._zod.def);return t||(r._zod.parent=e),r}function rl(e,t){const r=Array.isArray(e)?{}:e??{};return{checks:Array.isArray(e)?e:t??[],params:r}}function $(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function il(e){let t;return new Proxy({},{get(r,s,_){return t??(t=e()),Reflect.get(t,s,_)},set(r,s,_,E){return t??(t=e()),Reflect.set(t,s,_,E)},has(r,s){return t??(t=e()),Reflect.has(t,s)},deleteProperty(r,s){return t??(t=e()),Reflect.deleteProperty(t,s)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,s){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,s)},defineProperty(r,s,_){return t??(t=e()),Reflect.defineProperty(t,s,_)}})}function ot(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Pe(e){return Object.keys(e).filter(t=>e[t]._zod.qout==="true")}function sl(e){return Object.keys(e).filter(t=>t.endsWith("?")).map(t=>t.replace(/\?$/,""))}function Ns(e){return e.replace(/^\?/,"").replace(/\?$/,"")}function Re(e){const t={},r={},s=[],_=[];for(const[E,C]of Object.entries(e)){E.endsWith("?")&&s.push(E.slice(0,-1)),E.startsWith("?")&&_.push(E.slice(1));const n=Ns(E);r[n]=C,t[n]=E}return{shape:r,keyMap:t,optional:s,defaulted:_}}const js={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ws={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function At(e,t){const r={},s=[],_=e._zod.def.shape,E=new Set(e._zod.def.optional);for(const C in t){if(!(C in _))throw new Error(`Unrecognized key: "${C}"`);t[C]&&(r[C]=_[C],E.has(C)&&s.push(C))}return pe(e,{...e._zod.def,shape:r,optional:s,checks:[]})}function Tt(e,t){const r={...e._zod.def.shape},s=new Set(e._zod.def.optional);for(const _ in t){if(!(_ in e._zod.def.shape))throw new Error(`Unrecognized key: "${_}"`);t[_]&&(delete r[_],s.delete(_))}return pe(e,{...e._zod.def,shape:r,optional:[...s],checks:[]})}function Us(e,t){const r={...e._zod.def,get shape(){const s={...e._zod.def.shape,...t};return ve(this,"shape",s),s},checks:[]};return ye(r,"shape",()=>({...e._zod.def.shape,...t})),pe(e,r)}function Ae(e,t){const r=new Set(Object.keys(t._zod.def.shape)),s=[...e._zod.def.optional.filter(_=>!r.has(_)),...t._zod.def.optional];return pe(e,{...e._zod.def,get shape(){const _={...e._zod.def.shape,...t._zod.def.shape};return ve(this,"shape",_),_},optional:s,catchall:t._zod.def.catchall,checks:[]})}function rt(e,t){const r=new Set(Object.keys(t._zod.def.shape)),s=[...e._zod.def.optional.filter(_=>!r.has(_)),...t._zod.def.optional];return pe(e,{...e._zod.def,get shape(){const _={...e._zod.def.shape,...t._zod.def.shape};return ve(this,"shape",_),_},optional:s,checks:[]})}function Ot(e,t,r){const s={...t._zod.def.shape},_=new Set(t._zod.def.optional);if(r)for(const E in r){if(!(E in s))throw new Error(`Unrecognized key: "${E}"`);r[E]&&(s[E]=new e({type:"optional",innerType:t._zod.def.shape[E]}),_.add(E))}else for(const E in t._zod.def.shape)s[E]=new e({type:"optional",innerType:t._zod.def.shape[E]}),_.add(E);return pe(t,{...t._zod.def,shape:s,optional:[..._],checks:[]})}function It(e,t,r){const s={...t._zod.def.shape};if(r)for(const _ in r){if(!(_ in s))throw new Error(`Unrecognized key: "${_}"`);r[_]&&(s[_]=new e({type:"nonoptional",innerType:t._zod.def.shape[_]}))}else for(const _ in t._zod.def.shape)s[_]=new e({type:"nonoptional",innerType:t._zod.def.shape[_]});return pe(t,{...t._zod.def,shape:s,optional:[],checks:[]})}function nl(e){if(e.type==="interface"){const t=Object.keys(e.shape),r=new Set(Object.keys(e.shape));return{shape:{...e.shape},keys:t,keySet:r,numKeys:t.length,optionalKeys:new Set(e.optional)}}if(e.type==="object"){const t=Object.keys(e.shape),r=new Set(Object.keys(e.shape));return{shape:{...e.shape},keys:t,keySet:r,numKeys:t.length,optionalKeys:new Set(e.optional)}}throw new Error("Invalid object-like type")}function ze(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function fe(e,t){return t.map(r=>{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Qe(e){return typeof e=="string"?e:e==null?void 0:e.message}function le(e,t,r){var _,E,C,n,h,l;const s={...e,path:e.path??[]};if(!e.message){const d=Qe((C=(E=(_=e.inst)==null?void 0:_._zod.def)==null?void 0:E.error)==null?void 0:C.call(E,e))??Qe((n=t==null?void 0:t.error)==null?void 0:n.call(t,e))??Qe((h=r.customError)==null?void 0:h.call(r,e))??Qe((l=r.localeError)==null?void 0:l.call(r,e))??"Invalid input";s.message=d}return delete s.inst,delete s.continue,t!=null&&t.reportInput||delete s.input,s}function Bt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Pt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ne(...e){const[t,r,s]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:s}:{...t}}const ol=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Ws,NUMBER_FORMAT_RANGES:js,aborted:ze,allowsEval:Hs,assert:Jh,assertEqual:qh,assertIs:Vh,assertNever:Gh,assertNotEqual:Kh,assignProp:ve,cached:Ce,cleanInterfaceKey:Ns,cleanInterfaceShape:Re,cleanRegex:Lt,clone:pe,createTransparentProxy:il,defineLazy:ye,esc:$e,escapeRegex:De,extend:Us,extendObjectLike:rt,finalizeIssue:le,floatSafeRemainder:zs,getElementAtPath:Xh,getLengthableOrigin:Pt,getParsedType:tl,getSizableOrigin:Bt,getValidEnumValues:Yh,isObject:br,isPlainObject:wt,issue:Ne,joinValues:Te,jsonStringifyReplacer:$s,mergeObjectLike:Ae,normalizeObjectLikeDef:nl,normalizeParams:$,nullish:Be,numKeys:el,omit:Tt,optionalInterfaceKeys:sl,optionalObjectKeys:Pe,partialObjectLike:Ot,pick:At,prefixIssues:fe,primitiveTypes:Fs,promiseAllObject:Qh,propertyKeyTypes:Ct,randomString:vr,requiredObjectLike:It,splitChecksAndParams:rl,stringifyPrimitive:ot,unwrapMessage:Qe},Symbol.toStringTag,{value:"Module"})),Qi=Symbol.for("{{zod.error}}");class be{get message(){return JSON.stringify(this.issues,$s,2)}constructor(t){Object.defineProperty(this,"_tag",{value:Qi,enumerable:!1}),Object.defineProperty(this,"name",{value:"$ZodError",enumerable:!1}),this.issues=t}static[Symbol.hasInstance](t){return(t==null?void 0:t._tag)===Qi}}function Zs(e,t=r=>r.message){const r={},s=[];for(const _ of e.issues)_.path.length>0?(r[_.path[0]]=r[_.path[0]]||[],r[_.path[0]].push(t(_))):s.push(t(_));return{formErrors:s,fieldErrors:r}}function qs(e,t){const r=t||function(E){return E.message},s={_errors:[]},_=E=>{for(const C of E.issues)if(C.code==="invalid_union")C.errors.map(n=>_({issues:n}));else if(C.code==="invalid_key")_({issues:C.issues});else if(C.code==="invalid_element")_({issues:C.issues});else if(C.path.length===0)s._errors.push(r(C));else{let n=s,h=0;for(;h<C.path.length;){const l=C.path[h];h===C.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(r(C))):n[l]=n[l]||{_errors:[]},n=n[l],h++}}};return _(e),s}function Ks(e,t){const r=t||function(E){return E.message},s={errors:[]},_=E=>{var C,n;for(const h of E.issues)if(h.code==="invalid_union")h.errors.map(l=>_({issues:l}));else if(h.code==="invalid_key")_({issues:h.issues});else if(h.code==="invalid_element")_({issues:h.issues});else if(h.path.length===0)s.errors.push(r(h));else{let l=s,d=0;for(;d<h.path.length;){const u=h.path[d],p=d===h.path.length-1;typeof u=="string"?(l.properties??(l.properties={}),(C=l.properties)[u]??(C[u]={errors:[]}),l=l.properties[u]):(l.items??(l.items=[]),(n=l.items)[u]??(n[u]={errors:[]}),l=l.items[u]),p&&l.errors.push(r(h)),d++}}};return _(e),s}function Vs(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`["${String(r)}"]`):r.includes(".")?t.push(`["${r}"]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Gs(e){var s;const t=[],r=[...e.issues].sort((_,E)=>_.path.length-E.path.length);for(const _ of r)t.push(`✖ ${_.message}`),(s=_.path)!=null&&s.length&&t.push(` → at ${Vs(_.path)}`);return t.join(`
|
|
10
|
-
`)}function Sr(e,t,r){const s=r?{...r,async:!1}:{async:!1},_=e._zod.run({value:t,issues:[]},s);if(_ instanceof Promise)throw new Fe;if(_.issues.length)throw new((this==null?void 0:this.Error)??be)(_.issues.map(E=>le(E,s,ae())));return _.value}const ar=Sr.bind({Error:be});function yr(e,t,r){const s=r?{...r,async:!1}:{async:!1},_=e._zod.run({value:t,issues:[]},s);if(_ instanceof Promise)throw new Fe;return _.issues.length?{success:!1,error:new((this==null?void 0:this.Error)??be)(_.issues.map(E=>le(E,s,ae())))}:{success:!0,data:_.value}}const al=yr.bind({Error:be});async function wr(e,t,r){const s=r?{...r,async:!0}:{async:!0};let _=e._zod.run({value:t,issues:[]},s);if(_ instanceof Promise&&(_=await _),_.issues.length)throw new((this==null?void 0:this.Error)??be)(_.issues.map(E=>le(E,s,ae())));return _.value}const cr=wr.bind({Error:be});async function Cr(e,t,r){const s=r?{...r,async:!0}:{async:!0};let _=e._zod.run({value:t,issues:[]},s);return _ instanceof Promise&&(_=await _),_.issues.length?{success:!1,error:new((this==null?void 0:this.Error)??be)(_.issues.map(E=>le(E,s,ae())))}:{success:!0,data:_.value}}const cl=Cr.bind({Error:be}),Js=/^[cC][^\s-]{8,}$/,Ys=/^[0-9a-z]+$/,Xs=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qs=/^[0-9a-vA-V]{20}$/,en=/^[A-Za-z0-9]{27}$/,tn=/^[a-zA-Z0-9_-]{21}$/,rn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,je=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ll=je(4),ul=je(6),dl=je(7),nn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_l=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,pl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ml=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,on="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function an(){return new RegExp(on,"u")}const Er=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,cn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gl=new RegExp(`(${Er.source})|(${kr.source})`),ln=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,un=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hr=/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/,dn=/^\+(?:[0-9]){6,14}[0-9]$/,fn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_n=new RegExp(`^${fn}$`);function pn(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function mn(e){return new RegExp(`^${pn(e)}$`)}function gn(e){let t=`${fn}T${pn(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}const vn=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bn=/^\d+n?$/,Sn=/^\d+$/,yn=/^-?\d+(?:\.\d+)?/i,wn=/true|false/i,Cn=/null/i,En=/undefined/i,kn=/^[^A-Z]*$/,xn=/^[^a-z]*$/,Dn=Object.freeze(Object.defineProperty({__proto__:null,_emoji:on,base64:ln,base64url:un,bigint:bn,boolean:wn,browserEmail:ml,cidrv4:cn,cidrv6:hn,cuid:Js,cuid2:Ys,date:_n,datetime:gn,duration:rn,e164:dn,email:nn,emoji:an,extendedDuration:hl,guid:sn,hostname:hr,html5Email:fl,integer:Sn,ip:gl,ipv4:Er,ipv6:kr,ksuid:en,lowercase:kn,nanoid:tn,null:Cn,number:yn,rfc5322Email:_l,string:vn,time:mn,ulid:Xs,undefined:En,unicodeEmail:pl,uppercase:xn,uuid:je,uuid4:ll,uuid6:ul,uuid7:dl,xid:Qs},Symbol.toStringTag,{value:"Module"})),oe=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Rn={number:"number",bigint:"bigint",object:"date"},xr=M("$ZodCheckLessThan",(e,t)=>{oe.init(e,t);const r=Rn[typeof t.value];e._zod.onattach.push(s=>{const _=s._zod.computed.maximum??Number.POSITIVE_INFINITY;t.value<_&&(s._zod.computed.maximum=t.value,s._zod.computed.inclusive=t.inclusive)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:r,code:"too_big",maximum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dr=M("$ZodCheckGreaterThan",(e,t)=>{oe.init(e,t);const r=Rn[typeof t.value];e._zod.onattach.push(s=>{const _=s._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.value>_&&(s._zod.computed.minimum=t.value,s._zod.computed.inclusive=t.inclusive)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:r,code:"too_small",minimum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ln=M("$ZodCheckMultipleOf",(e,t)=>{oe.init(e,t),e._zod.onattach.push(r=>{var s;(s=r._zod.computed).multipleOf??(s.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):zs(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),An=M("$ZodCheckNumberFormat",(e,t)=>{var C;oe.init(e,t),t.format=t.format||"float64";const r=(C=t.format)==null?void 0:C.includes("int"),s=r?"int":"number",[_,E]=js[t.format];e._zod.onattach.push(n=>{n._zod.computed.format=t.format,n._zod.computed.minimum=_,n._zod.computed.maximum=E,n._zod.computed.inclusive=!0,r&&(n._zod.computed.pattern=Sn)}),e._zod.check=n=>{const h=n.value;if(r){if(!Number.isInteger(h)){n.issues.push({expected:s,format:t.format,code:"invalid_type",input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?n.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the the safe integer range.",inst:e,origin:s,continue:!t.abort}):n.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!t.abort});return}}h<_&&n.issues.push({origin:"number",input:h,code:"too_small",minimum:_,inclusive:!0,inst:e,continue:!t.abort}),h>E&&n.issues.push({origin:"number",input:h,code:"too_big",maximum:E,inst:e})}}),Tn=M("$ZodCheckBigIntFormat",(e,t)=>{oe.init(e,t);const[r,s]=Ws[t.format];e._zod.onattach.push(_=>{_._zod.computed.format=t.format,_._zod.computed.minimum=r,_._zod.computed.maximum=s}),e._zod.check=_=>{const E=_.value;E<r&&_.issues.push({origin:"bigint",input:E,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),E>s&&_.issues.push({origin:"bigint",input:E,code:"too_big",maximum:s,inst:e})}}),On=M("$ZodCheckMaxSize",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.size!==void 0},e._zod.onattach.push(r=>{const s=r._zod.computed.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.computed.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;s.size<=t.maximum||r.issues.push({origin:Bt(s),code:"too_big",maximum:t.maximum,input:s,inst:e,continue:!t.abort})}}),In=M("$ZodCheckMinSize",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.size!==void 0},e._zod.onattach.push(r=>{const s=r._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.computed.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;s.size>=t.minimum||r.issues.push({origin:Bt(s),code:"too_small",minimum:t.minimum,input:s,inst:e,continue:!t.abort})}}),Bn=M("$ZodCheckSizeEquals",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.size!==void 0},e._zod.onattach.push(r=>{r._zod.computed.minimum=t.size,r._zod.computed.maximum=t.size,r._zod.computed.size=t.size}),e._zod.check=r=>{const s=r.value,_=s.size;if(_===t.size)return;const E=_>t.size;r.issues.push({origin:Bt(s),...E?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},input:r.value,inst:e,continue:!t.abort})}}),Pn=M("$ZodCheckMaxLength",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.length!==void 0},e._zod.onattach.push(r=>{const s=r._zod.computed.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.computed.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const E=Pt(s);r.issues.push({origin:E,code:"too_big",maximum:t.maximum,input:s,inst:e,continue:!t.abort})}}),Mn=M("$ZodCheckMinLength",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.length!==void 0},e._zod.onattach.push(r=>{const s=r._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.computed.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const E=Pt(s);r.issues.push({origin:E,code:"too_small",minimum:t.minimum,input:s,inst:e,continue:!t.abort})}}),$n=M("$ZodCheckLengthEquals",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const s=r.value;return!Be(s)&&s.length!==void 0},e._zod.onattach.push(r=>{r._zod.computed.minimum=t.length,r._zod.computed.maximum=t.length,r._zod.computed.length=t.length}),e._zod.check=r=>{const s=r.value,_=s.length;if(_===t.length)return;const E=Pt(s),C=_>t.length;r.issues.push({origin:E,...C?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),at=M("$ZodCheckStringFormat",(e,t)=>{var r;oe.init(e,t),e._zod.onattach.push(s=>{s._zod.computed.format=t.format,t.pattern&&(s._zod.computed.pattern=t.pattern)}),(r=e._zod).check??(r.check=s=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),zn=M("$ZodCheckRegex",(e,t)=>{at.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hn=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=kn),at.init(e,t)}),Fn=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xn),at.init(e,t)}),Nn=M("$ZodCheckIncludes",(e,t)=>{oe.init(e,t);const r=new RegExp(De(t.includes));t.pattern=r,e._zod.onattach.push(s=>{s._zod.computed.pattern=r}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),jn=M("$ZodCheckStartsWith",(e,t)=>{oe.init(e,t);const r=new RegExp(`^${De(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{s._zod.computed.pattern=r}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),Wn=M("$ZodCheckEndsWith",(e,t)=>{oe.init(e,t);const r=new RegExp(`.*${De(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{s._zod.computed.pattern=new RegExp(`.*${De(t.suffix)}$`)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}});function es(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues))}const Un=M("$ZodCheckProperty",(e,t)=>{oe.init(e,t),e._zod.check=r=>{const s=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(s instanceof Promise)return s.then(_=>es(_,r,t.property));es(s,r,t.property)}}),Zn=M("$ZodCheckMimeType",(e,t)=>{oe.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(s=>{s._zod.computed.mime=t.mime}),e._zod.check=s=>{r.has(s.value.type)||s.issues.push({code:"invalid_value",values:t.mime,input:s.value.type,path:["type"],inst:e})}}),qn=M("$ZodCheckOverwrite",(e,t)=>{oe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Kn{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
|
|
11
|
-
`).filter(C=>C),
|
|
12
|
-
`))}}const
|
|
7
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),c.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 k=this._getMouseBufferCoords(v),A=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(A&&O&&k)&&this._areCoordsInSelection(k,A,O)}isCellInSelection(v,k){const A=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!A||!O)&&this._areCoordsInSelection([v,k],A,O)}_areCoordsInSelection(v,k,A){return v[1]>k[1]&&v[1]<A[1]||k[1]===A[1]&&v[1]===k[1]&&v[0]>=k[0]&&v[0]<A[0]||k[1]<A[1]&&v[1]===A[1]&&v[0]<A[0]||k[1]<A[1]&&v[1]===k[1]&&v[0]>=k[0]}_selectWordAtCursor(v,k){var I,L;const A=(L=(I=this._linkifier.currentLink)==null?void 0:I.link)==null?void 0:L.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(v);return!!O&&(this._selectWordAt(O,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,k){this._model.clearSelection(),v=Math.max(v,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const k=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(v){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=A?0:(k>A&&(k-=A),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(v){return c.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 k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const k=this._getMouseBufferCoords(v);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(v){return v.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const k=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 A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){const O=A.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]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 k=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const O=(0,_.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,A=!(!v||!k||v[0]===k[0]&&v[1]===k[1]);A?v&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,k,A)):this._oldHasSelection&&this._fireOnSelectionChange(v,k,A)}_fireOnSelectionChange(v,k,A){this._oldSelectionStart=v,this._oldSelectionEnd=k,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(v,k){let A=k;for(let O=0;k>=O;O++){const I=v.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:I>1&&k!==O&&(A+=I-1)}return A}setSelection(v,k,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,k],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,k,A=!0,O=!0){if(v[0]>=this._bufferService.cols)return;const I=this._bufferService.buffer,L=I.lines.get(v[1]);if(!L)return;const $=I.translateBufferLineToString(v[1],!1);let F=this._convertViewportColToCharacterIndex(L,v[0]),U=F;const V=v[0]-F;let W=0,x=0,R=0,T=0;if($.charAt(F)===" "){for(;F>0&&$.charAt(F-1)===" ";)F--;for(;U<$.length&&$.charAt(U+1)===" ";)U++}else{let Z=v[0],G=v[0];L.getWidth(Z)===0&&(W++,Z--),L.getWidth(G)===2&&(x++,G++);const J=L.getString(G).length;for(J>1&&(T+=J-1,U+=J-1);Z>0&&F>0&&!this._isCharWordSeparator(L.loadCell(Z-1,this._workCell));){L.loadCell(Z-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,Z--):P>1&&(R+=P-1,F-=P-1),F--,Z--}for(;G<L.length&&U+1<$.length&&!this._isCharWordSeparator(L.loadCell(G+1,this._workCell));){L.loadCell(G+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,G++):P>1&&(T+=P-1,U+=P-1),U++,G++}}U++;let B=F+V-W+R,N=Math.min(this._bufferService.cols,U-F+W+x-R-T);if(k||$.slice(F,U).trim()!==""){if(A&&B===0&&L.getCodePoint(0)!==32){const Z=I.lines.get(v[1]-1);if(Z&&L.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const G=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(G){const J=this._bufferService.cols-G.start;B-=J,N+=J}}}if(O&&B+N===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const Z=I.lines.get(v[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const G=this._getWordAt([0,v[1]+1],!1,!1,!0);G&&(N+=G.length)}}return{start:B,length:N}}}_selectWordAt(v,k){const A=this._getWordAt(v,k);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[A.start,v[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(v){const k=this._getWordAt(v,!0);if(k){let A=v[1];for(;k.start<0;)k.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,A]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const k=this._bufferService.buffer.getWrappedRangeForLine(v),A={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(A,this._bufferService.cols)}};s.SelectionService=w=l([d(3,f.IBufferService),d(4,f.ICoreService),d(5,b.IMouseService),d(6,f.IOptionsService),d(7,b.IRenderService),d(8,b.ICoreBrowserService)],w)},4725:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const l=h(8343);s.ICharSizeService=(0,l.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),s.IMouseService=(0,l.createDecorator)("MouseService"),s.IRenderService=(0,l.createDecorator)("RenderService"),s.ISelectionService=(0,l.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,l.createDecorator)("ThemeService"),s.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(C,s,h){var l=this&&this.__decorate||function(w,v,k,A){var O,I=arguments.length,L=I<3?v:A===null?A=Object.getOwnPropertyDescriptor(v,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(w,v,k,A);else for(var $=w.length-1;$>=0;$--)(O=w[$])&&(L=(I<3?O(L):I>3?O(v,k,L):O(v,k))||L);return I>3&&L&&Object.defineProperty(v,k,L),L},d=this&&this.__param||function(w,v){return function(k,A){v(k,A,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=h(7239),_=h(8055),m=h(8460),b=h(844),p=h(2585),o=_.css.toColor("#ffffff"),c=_.css.toColor("#000000"),i=_.css.toColor("#ffffff"),a=_.css.toColor("#000000"),f={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let k=0;k<216;k++){const A=v[k/36%6|0],O=v[k/6%6|0],I=v[k%6];w.push({css:_.channels.toCss(A,O,I),rgba:_.channels.toRgba(A,O,I)})}for(let k=0;k<24;k++){const A=8+10*k;w.push({css:_.channels.toCss(A,A,A),rgba:_.channels.toRgba(A,A,A)})}return w})());let y=s.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:c,cursor:i,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:f,selectionBackgroundOpaque:_.color.blend(c,f),selectionInactiveBackgroundTransparent:f,selectionInactiveBackgroundOpaque:_.color.blend(c,f),ansi:s.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(w={}){const v=this._colors;if(v.foreground=S(w.foreground,o),v.background=S(w.background,c),v.cursor=S(w.cursor,i),v.cursorAccent=S(w.cursorAccent,a),v.selectionBackgroundTransparent=S(w.selectionBackground,f),v.selectionBackgroundOpaque=_.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=S(w.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=_.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=w.selectionForeground?S(w.selectionForeground,_.NULL_COLOR):void 0,v.selectionForeground===_.NULL_COLOR&&(v.selectionForeground=void 0),_.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=_.color.opacity(v.selectionBackgroundTransparent,.3)),_.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=_.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=s.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=S(w.black,s.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=S(w.red,s.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=S(w.green,s.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=S(w.yellow,s.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=S(w.blue,s.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=S(w.magenta,s.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=S(w.cyan,s.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=S(w.white,s.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=S(w.brightBlack,s.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=S(w.brightRed,s.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=S(w.brightGreen,s.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=S(w.brightYellow,s.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=S(w.brightBlue,s.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=S(w.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=S(w.brightCyan,s.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=S(w.brightWhite,s.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(v.ansi.length-16,w.extendedAnsi.length);for(let A=0;A<k;A++)v.ansi[A+16]=S(w.extendedAnsi[A],s.DEFAULT_ANSI_COLORS[A+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(w){w(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(w,v){if(w!==void 0)try{return _.css.toColor(w)}catch{}return v}s.ThemeService=y=l([d(0,p.IOptionsService)],y)},6349:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const l=h(8460),d=h(844);class u extends d.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.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(m){if(this._maxLength===m)return;const b=new Array(m);for(let p=0;p<Math.min(m,this.length);p++)b[p]=this._array[this._getCyclicIndex(p)];this._array=b,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let b=this._length;b<m;b++)this._array[b]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,b){this._array[this._getCyclicIndex(m)]=b}push(m){this._array[this._getCyclicIndex(this._length)]=m,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(m,b,...p){if(b){for(let o=m;o<this._length-b;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+b)];this._length-=b,this.onDeleteEmitter.fire({index:m,amount:b})}for(let o=this._length-1;o>=m;o--)this._array[this._getCyclicIndex(o+p.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<p.length;o++)this._array[this._getCyclicIndex(m+o)]=p[o];if(p.length&&this.onInsertEmitter.fire({index:m,amount:p.length}),this._length+p.length>this._maxLength){const o=this._length+p.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=p.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,b,p){if(!(b<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let c=b-1;c>=0;c--)this.set(m+c+p,this.get(m+c));const o=m+b+p-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<b;o++)this.set(m+o+p,this.get(m+o))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}s.CircularList=u},1439:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function h(l,d=5){if(typeof l!="object")return l;const u=Array.isArray(l)?[]:{};for(const _ in l)u[_]=d<=1?l[_]:l[_]&&h(l[_],d-1);return u}},8055:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let h=0,l=0,d=0,u=0;var _,m,b,p,o;function c(a){const f=a.toString(16);return f.length<2?"0"+f:f}function i(a,f){return a<f?(f+.05)/(a+.05):(a+.05)/(f+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(a){a.toCss=function(f,y,S,w){return w!==void 0?`#${c(f)}${c(y)}${c(S)}${c(w)}`:`#${c(f)}${c(y)}${c(S)}`},a.toRgba=function(f,y,S,w=255){return(f<<24|y<<16|S<<8|w)>>>0},a.toColor=function(f,y,S,w){return{css:a.toCss(f,y,S,w),rgba:a.toRgba(f,y,S,w)}}}(_||(s.channels=_={})),function(a){function f(y,S){return u=Math.round(255*S),[h,l,d]=o.toChannels(y.rgba),{css:_.toCss(h,l,d,u),rgba:_.toRgba(h,l,d,u)}}a.blend=function(y,S){if(u=(255&S.rgba)/255,u===1)return{css:S.css,rgba:S.rgba};const w=S.rgba>>24&255,v=S.rgba>>16&255,k=S.rgba>>8&255,A=y.rgba>>24&255,O=y.rgba>>16&255,I=y.rgba>>8&255;return h=A+Math.round((w-A)*u),l=O+Math.round((v-O)*u),d=I+Math.round((k-I)*u),{css:_.toCss(h,l,d),rgba:_.toRgba(h,l,d)}},a.isOpaque=function(y){return(255&y.rgba)==255},a.ensureContrastRatio=function(y,S,w){const v=o.ensureContrastRatio(y.rgba,S.rgba,w);if(v)return _.toColor(v>>24&255,v>>16&255,v>>8&255)},a.opaque=function(y){const S=(255|y.rgba)>>>0;return[h,l,d]=o.toChannels(S),{css:_.toCss(h,l,d),rgba:S}},a.opacity=f,a.multiplyOpacity=function(y,S){return u=255&y.rgba,f(y,u*S/255)},a.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}}(m||(s.color=m={})),function(a){let f,y;try{const S=document.createElement("canvas");S.width=1,S.height=1;const w=S.getContext("2d",{willReadFrequently:!0});w&&(f=w,f.globalCompositeOperation="copy",y=f.createLinearGradient(0,0,1,1))}catch{}a.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return h=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),d=parseInt(S.slice(3,4).repeat(2),16),_.toColor(h,l,d);case 5:return h=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),d=parseInt(S.slice(3,4).repeat(2),16),u=parseInt(S.slice(4,5).repeat(2),16),_.toColor(h,l,d,u);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 w=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(w)return h=parseInt(w[1]),l=parseInt(w[2]),d=parseInt(w[3]),u=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),_.toColor(h,l,d,u);if(!f||!y)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=y,f.fillStyle=S,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[h,l,d,u]=f.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(h,l,d,u),css:S}}}(b||(s.css=b={})),function(a){function f(y,S,w){const v=y/255,k=S/255,A=w/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}a.relativeLuminance=function(y){return f(y>>16&255,y>>8&255,255&y)},a.relativeLuminance2=f}(p||(s.rgb=p={})),function(a){function f(S,w,v){const k=S>>24&255,A=S>>16&255,O=S>>8&255;let I=w>>24&255,L=w>>16&255,$=w>>8&255,F=i(p.relativeLuminance2(I,L,$),p.relativeLuminance2(k,A,O));for(;F<v&&(I>0||L>0||$>0);)I-=Math.max(0,Math.ceil(.1*I)),L-=Math.max(0,Math.ceil(.1*L)),$-=Math.max(0,Math.ceil(.1*$)),F=i(p.relativeLuminance2(I,L,$),p.relativeLuminance2(k,A,O));return(I<<24|L<<16|$<<8|255)>>>0}function y(S,w,v){const k=S>>24&255,A=S>>16&255,O=S>>8&255;let I=w>>24&255,L=w>>16&255,$=w>>8&255,F=i(p.relativeLuminance2(I,L,$),p.relativeLuminance2(k,A,O));for(;F<v&&(I<255||L<255||$<255);)I=Math.min(255,I+Math.ceil(.1*(255-I))),L=Math.min(255,L+Math.ceil(.1*(255-L))),$=Math.min(255,$+Math.ceil(.1*(255-$))),F=i(p.relativeLuminance2(I,L,$),p.relativeLuminance2(k,A,O));return(I<<24|L<<16|$<<8|255)>>>0}a.blend=function(S,w){if(u=(255&w)/255,u===1)return w;const v=w>>24&255,k=w>>16&255,A=w>>8&255,O=S>>24&255,I=S>>16&255,L=S>>8&255;return h=O+Math.round((v-O)*u),l=I+Math.round((k-I)*u),d=L+Math.round((A-L)*u),_.toRgba(h,l,d)},a.ensureContrastRatio=function(S,w,v){const k=p.relativeLuminance(S>>8),A=p.relativeLuminance(w>>8);if(i(k,A)<v){if(A<k){const L=f(S,w,v),$=i(k,p.relativeLuminance(L>>8));if($<v){const F=y(S,w,v);return $>i(k,p.relativeLuminance(F>>8))?L:F}return L}const O=y(S,w,v),I=i(k,p.relativeLuminance(O>>8));if(I<v){const L=f(S,w,v);return I>i(k,p.relativeLuminance(L>>8))?O:L}return O}},a.reduceLuminance=f,a.increaseLuminance=y,a.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}}(o||(s.rgba=o={})),s.toPaddedHex=c,s.contrastRatio=i},8969:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const l=h(844),d=h(2585),u=h(4348),_=h(7866),m=h(744),b=h(7302),p=h(6975),o=h(8460),c=h(1753),i=h(1480),a=h(7994),f=h(9282),y=h(5435),S=h(5981),w=h(2660);let v=!1;class k extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event(O=>{var I;(I=this._onScrollApi)==null||I.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 I in O)this.optionsService.options[I]=O[I]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new b.OptionsService(O)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(a.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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(I=>{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(I=>{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((I,L)=>this._inputHandler.parse(I,L))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,I){this._writeBuffer.write(O,I)}writeSync(O,I){this._logService.logLevel<=d.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(O,I)}input(O,I=!0){this.coreService.triggerDataEvent(O,I)}resize(O,I){isNaN(O)||isNaN(I)||(O=Math.max(O,m.MINIMUM_COLS),I=Math.max(I,m.MINIMUM_ROWS),this._bufferService.resize(O,I))}scroll(O,I=!1){this._bufferService.scroll(O,I)}scrollLines(O,I,L){this._bufferService.scrollLines(O,I,L)}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 I=O-this._bufferService.buffer.ydisp;I!==0&&this.scrollLines(I)}registerEscHandler(O,I){return this._inputHandler.registerEscHandler(O,I)}registerDcsHandler(O,I){return this._inputHandler.registerDcsHandler(O,I)}registerCsiHandler(O,I){return this._inputHandler.registerCsiHandler(O,I)}registerOscHandler(O,I){return this._inputHandler.registerOscHandler(O,I)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const I=this.optionsService.rawOptions.windowsPty;I&&I.buildNumber!==void 0&&I.buildNumber!==void 0?O=I.backend==="conpty"&&I.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(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const I of O)I.dispose()})}}}s.CoreTerminal=k},8460:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===h)return void this._listeners.splice(l,1)}}})),this._event}fire(h,l){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,h,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(h,l){return h(d=>l.fire(d))},s.runAndSubscribe=function(h,l){return l(void 0),h(d=>l(d))}},5435:function(C,s,h){var l=this&&this.__decorate||function(W,x,R,T){var B,N=arguments.length,Z=N<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(W,x,R,T);else for(var G=W.length-1;G>=0;G--)(B=W[G])&&(Z=(N<3?B(Z):N>3?B(x,R,Z):B(x,R))||Z);return N>3&&Z&&Object.defineProperty(x,R,Z),Z},d=this&&this.__param||function(W,x){return function(R,T){x(R,T,W)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=h(2584),_=h(7116),m=h(2015),b=h(844),p=h(482),o=h(8437),c=h(8460),i=h(643),a=h(511),f=h(3734),y=h(2585),S=h(1480),w=h(6242),v=h(6351),k=h(5941),A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function I(W,x){if(W>24)return x.setWinLines||!1;switch(W){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var L;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(s.WindowsOptionsReportType=L={}));let $=0;class F extends b.Disposable{getAttrData(){return this._curAttrData}constructor(x,R,T,B,N,Z,G,J,P=new m.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=R,this._coreService=T,this._logService=B,this._optionsService=N,this._oscLinkService=Z,this._coreMouseService=G,this._unicodeService=J,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new a.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,j)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:j.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,j,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:j,data:z})}),this._parser.setDcsHandlerFallback((D,j,z)=>{j==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:j,payload:z})}),this._parser.setPrintHandler((D,j,z)=>this.print(D,j,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(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new w.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new w.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new w.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new w.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new w.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new w.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new w.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new w.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new w.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new w.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new w.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new w.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 _.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,j)=>this.requestStatusString(D,j)))}_preserveStack(x,R,T,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=T,this._parseStack.position=B}_logSlowResolvingAsync(x){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([x,new Promise((R,T)=>setTimeout(()=>T("#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(x,R){let T,B=this._activeBuffer.x,N=this._activeBuffer.y,Z=0;const G=this._parseStack.paused;if(G){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(T),T;B=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>O&&(Z=this._parseStack.position+O)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,D=>String.fromCharCode(D)).join("")}"`),typeof x=="string"?x.split("").map(D=>D.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(x.length,O))),G||this._dirtyRowTracker.clearRange(),x.length>O)for(let D=Z;D<x.length;D+=O){const j=D+O<x.length?D+O:x.length,z=typeof x=="string"?this._stringDecoder.decode(x.substring(D,j),this._parseBuffer):this._utf8Decoder.decode(x.subarray(D,j),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,z))return this._preserveStack(B,N,z,D),this._logSlowResolvingAsync(T),T}else if(!G){const D=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,D))return this._preserveStack(B,N,D,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===B&&this._activeBuffer.y===N||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(x,R,T){let B,N;const Z=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,j=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-R>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,j);let K=this._parser.precedingJoinState;for(let q=R;q<T;++q){if(B=x[q],B<127&&Z){const ce=Z[String.fromCharCode(B)];ce&&(B=ce.charCodeAt(0))}const ee=this._unicodeService.charProperties(B,K);N=S.UnicodeService.extractWidth(ee);const se=S.UnicodeService.extractShouldJoin(ee),ne=se?S.UnicodeService.extractWidth(K):0;if(K=ee,G&&this._onA11yChar.fire((0,p.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-ne>J){if(P){const ce=z;let Y=this._activeBuffer.x-ne;for(this._activeBuffer.x=ne,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),ne>0&&z instanceof o.BufferLine&&z.copyCellsFrom(ce,Y,0,ne,!1);Y<J;)ce.setCellFromCodepoint(Y++,0,1,j)}else if(this._activeBuffer.x=J-1,N===2)continue}if(se&&this._activeBuffer.x){const ce=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-ce,B,N);for(let Y=N-ne;--Y>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,j)}else if(D&&(z.insertCells(this._activeBuffer.x,N-ne,this._activeBuffer.getNullCell(j)),z.getWidth(J-1)===2&&z.setCellFromCodepoint(J-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,j)),z.setCellFromCodepoint(this._activeBuffer.x++,B,N,j),N>0)for(;--N;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,j)}this._parser.precedingJoinState=K,this._activeBuffer.x<J&&T-R>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,j),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,R){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,R):this._parser.registerCsiHandler(x,T=>!I(T.params[0],this._optionsService.rawOptions.windowOptions)||R(T))}registerDcsHandler(x,R){return this._parser.registerDcsHandler(x,new v.DcsHandler(R))}registerEscHandler(x,R){return this._parser.registerEscHandler(x,R)}registerOscHandler(x,R){return this._parser.registerOscHandler(x,new w.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 x;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&&((x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&x.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 x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=x,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+R)}cursorUp(x){const R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const R=x.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=x.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=x.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const R=x.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,R,T,B=!1,N=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);Z.replaceCells(R,T,this._activeBuffer.getNullCell(this._eraseAttrData()),N),B&&(Z.isWrapped=!1)}_resetBufferLine(x,R=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),T.isWrapped=!1)}eraseInDisplay(x,R=!1){let T;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);T<this._bufferService.rows;T++)this._resetBufferLine(T,R);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,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(x,R=!1){switch(this._restrictCursor(this._bufferService.cols),x.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(x){this._restrictCursor();let R=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;R--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let R=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=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(T,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(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let R=x.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(x){let R=x.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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);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(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=x.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);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(x){this._restrictCursor();const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const R=this._parser.precedingJoinState;if(!R)return!0;const T=x.params[0]||1,B=S.UnicodeService.extractWidth(R),N=this._activeBuffer.x-B,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),G=new Uint32Array(Z.length*T);let J=0;for(let D=0;D<Z.length;){const j=Z.codePointAt(D)||0;G[J++]=j,D+=j>65535?2:1}let P=J;for(let D=1;D<T;++D)G.copyWithin(P,0,J),P+=J;return this.print(G,0,P),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(x){for(let R=0;R<x.length;R++)switch(x.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let R=0;R<x.length;R++)switch(x.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(),x.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(x,R){const T=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:N}=this._coreMouseService,Z=this._coreService,{buffers:G,cols:J}=this._bufferService,{active:P,alt:D}=G,j=this._optionsService.rawOptions,z=se=>se?1:2,K=x.params[0];return q=K,ee=R?K===2?4:K===4?z(Z.modes.insertMode):K===12?3:K===20?z(j.convertEol):0:K===1?z(T.applicationCursorKeys):K===3?j.windowOptions.setWinLines?J===80?2:J===132?1:0:0:K===6?z(T.origin):K===7?z(T.wraparound):K===8?3:K===9?z(B==="X10"):K===12?z(j.cursorBlink):K===25?z(!Z.isCursorHidden):K===45?z(T.reverseWraparound):K===66?z(T.applicationKeypad):K===67?4:K===1e3?z(B==="VT200"):K===1002?z(B==="DRAG"):K===1003?z(B==="ANY"):K===1004?z(T.sendFocus):K===1005?4:K===1006?z(N==="SGR"):K===1015?4:K===1016?z(N==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?z(P===D):K===2004?z(T.bracketedPasteMode):0,Z.triggerDataEvent(`${u.C0.ESC}[${R?"":"?"}${q};${ee}$y`),!0;var q,ee}_updateAttrColor(x,R,T,B,N){return R===2?(x|=50331648,x&=-16777216,x|=f.AttributeData.fromColorRGB([T,B,N])):R===5&&(x&=-50331904,x|=33554432|255&T),x}_extractColor(x,R,T){const B=[0,0,-1,0,0,0];let N=0,Z=0;do{if(B[Z+N]=x.params[R+Z],x.hasSubParams(R+Z)){const G=x.getSubParams(R+Z);let J=0;do B[1]===5&&(N=1),B[Z+J+1+N]=G[J];while(++J<G.length&&J+Z+1+N<B.length);break}if(B[1]===5&&Z+N>=2||B[1]===2&&Z+N>=5)break;B[1]&&(N=1)}while(++Z+R<x.length&&Z+N<B.length);for(let G=2;G<B.length;++G)B[G]===-1&&(B[G]=0);switch(B[0]){case 38:T.fg=this._updateAttrColor(T.fg,B[1],B[3],B[4],B[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,B[1],B[3],B[4],B[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,B[1],B[3],B[4],B[5])}return Z}_processUnderline(x,R){R.extended=R.extended.clone(),(!~x||x>5)&&(x=1),R.extended.underlineStyle=x,R.fg|=268435456,x===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(x){x.fg=o.DEFAULT_ATTR_DATA.fg,x.bg=o.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const R=x.length;let T;const B=this._curAttrData;for(let N=0;N<R;N++)T=x.params[N],T>=30&&T<=37?(B.fg&=-50331904,B.fg|=16777216|T-30):T>=40&&T<=47?(B.bg&=-50331904,B.bg|=16777216|T-40):T>=90&&T<=97?(B.fg&=-50331904,B.fg|=16777224|T-90):T>=100&&T<=107?(B.bg&=-50331904,B.bg|=16777224|T-100):T===0?this._processSGR0(B):T===1?B.fg|=134217728:T===3?B.bg|=67108864:T===4?(B.fg|=268435456,this._processUnderline(x.hasSubParams(N)?x.getSubParams(N)[0]:1,B)):T===5?B.fg|=536870912:T===7?B.fg|=67108864:T===8?B.fg|=1073741824:T===9?B.fg|=2147483648:T===2?B.bg|=134217728:T===21?this._processUnderline(2,B):T===22?(B.fg&=-134217729,B.bg&=-134217729):T===23?B.bg&=-67108865:T===24?(B.fg&=-268435457,this._processUnderline(0,B)):T===25?B.fg&=-536870913:T===27?B.fg&=-67108865:T===28?B.fg&=-1073741825:T===29?B.fg&=2147483647:T===39?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):T===49?(B.bg&=-67108864,B.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?N+=this._extractColor(x,N,B):T===53?B.bg|=1073741824:T===55?B.bg&=-1073741825:T===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):T===100?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const R=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${R};${T}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const R=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${R};${T}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(x){const R=x.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 T=R%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(x){const R=x.params[0]||1;let T;return(x.length<2||(T=x.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(x){if(!I(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const R=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22: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(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const R=[],T=x.split(";");for(;T.length>1;){const B=T.shift(),N=T.shift();if(/^\d+$/.exec(B)){const Z=parseInt(B);if(V(Z))if(N==="?")R.push({type:0,index:Z});else{const G=(0,k.parseColor)(N);G&&R.push({type:1,index:Z,color:G})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(x){const R=x.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(x,R){this._getCurrentLinkId()&&this._finishHyperlink();const T=x.split(":");let B;const N=T.findIndex(Z=>Z.startsWith("id="));return N!==-1&&(B=T[N].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(x,R){const T=x.split(";");for(let B=0;B<T.length&&!(R>=this._specialColors.length);++B,++R)if(T[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{const N=(0,k.parseColor)(T[B]);N&&this._onColor.fire([{type:1,index:this._specialColors[R],color:N}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const R=[],T=x.split(";");for(let B=0;B<T.length;++B)if(/^\d+$/.exec(T[B])){const N=parseInt(T[B]);V(N)&&R.push({type:2,index:N})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,_.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(A[x[0]],_.CHARSETS[x[1]]||_.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new a.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){const T=this._activeBuffer.ybase+this._activeBuffer.y+R,B=this._activeBuffer.lines.get(T);B&&(B.fill(x),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,R){const T=this._bufferService.buffer,B=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,R){this._dirtyRowTracker.markRangeDirty(x,R)}}s.InputHandler=F;let U=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,x){W>x&&($=W,W=x,x=$),W<this.start&&(this.start=W),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(W){return 0<=W&&W<256}U=l([d(0,y.IBufferService)],U)},844:(C,s)=>{function h(l){for(const d of l)d.dispose();l.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var d;this._isDisposed||l===this._value||((d=this._value)==null||d.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},s.toDisposable=function(l){return{dispose:l}},s.disposeArray=h,s.getDisposeArrayDisposable=function(l){return{dispose:()=>h(l)}}},1505:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(d,u,_){this._data[d]||(this._data[d]={}),this._data[d][u]=_}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=h,s.FourKeyMap=class{constructor(){this._data=new h}set(l,d,u,_,m){this._data.get(l,d)||this._data.set(l,d,new h),this._data.get(l,d).set(u,_,m)}get(l,d,u,_){var m;return(m=this._data.get(l,d))==null?void 0:m.get(u,_)}clear(){this._data.clear()}}},6114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const h=s.isNode?"node":navigator.userAgent,l=s.isNode?"node":navigator.platform;s.isFirefox=h.includes("Firefox"),s.isLegacyEdge=h.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(h),s.getSafariVersion=function(){if(!s.isSafari)return 0;const d=h.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),s.isIpad=l==="iPad",s.isIphone=l==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),s.isLinux=l.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(h)},6106:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let h=0;s.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(h=this._search(this._getKey(l)),this._array.splice(h,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const d=this._getKey(l);if(d===void 0||(h=this._search(d),h===-1)||this._getKey(this._array[h])!==d)return!1;do if(this._array[h]===l)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===d);return!1}*getKeyIterator(l){if(this._array.length!==0&&(h=this._search(l),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===l))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===l)}forEachByKey(l,d){if(this._array.length!==0&&(h=this._search(l),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===l))do d(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===l)}values(){return[...this._array].values()}_search(l){let d=0,u=this._array.length-1;for(;u>=d;){let _=d+u>>1;const m=this._getKey(this._array[_]);if(m>l)u=_-1;else{if(!(m<l)){for(;_>0&&this._getKey(this._array[_-1])===l;)_--;return _}d=_+1}}return d}}},7226:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const l=h(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let b=0,p=0,o=m.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),p=Math.max(b,p),c=m.timeRemaining(),1.5*p>c)return o-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-b))}ms`),void this._start();o=c}this.clear()}}class u extends d{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const b=Date.now()+m;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const l=h(643);s.updateWindowsModeWrappedState=function(d){const u=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),_=u==null?void 0:u.get(d.cols-1),m=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);m&&_&&(m.isWrapped=_[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&_[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new h;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=h;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,_=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=_}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=l},9092:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const l=h(6349),d=h(7226),u=h(3734),_=h(8437),m=h(4634),b=h(511),p=h(643),o=h(4863),c=h(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(i,a,f){this._hasScrollback=i,this._optionsService=a,this._bufferService=f,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,a){return new _.BufferLine(this._bufferService.cols,this.getNullCell(i),a)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const a=i+this._optionsService.rawOptions.scrollback;return a>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:a}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=_.DEFAULT_ATTR_DATA);let a=this._rows;for(;a--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,a){const f=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=0;const S=this._getCorrectBufferLength(a);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<i)for(let v=0;v<this.lines.length;v++)y+=+this.lines.get(v).resize(i,f);let w=0;if(this._rows<a)for(let v=this._rows;v<a;v++)this.lines.length<a+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(i,f)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(i,f)));else for(let v=this._rows;v>a;v--)this.lines.length>a+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,i-1),this.y=Math.min(this.y,a-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(i,a),this._cols>i))for(let w=0;w<this.lines.length;w++)y+=+this.lines.get(w).resize(i,f);this._cols=i,this._rows=a,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let a=0;for(;this._memoryCleanupPosition<this.lines.length;)if(a+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),a>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,a){this._cols!==i&&(i>this._cols?this._reflowLarger(i,a):this._reflowSmaller(i,a))}_reflowLarger(i,a){const f=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(f.length>0){const y=(0,m.reflowLargerCreateNewLayout)(this.lines,f);(0,m.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(i,a,y.countRemoved)}}_reflowLargerAdjustViewport(i,a,f){const y=this.getNullCell(_.DEFAULT_ATTR_DATA);let S=f;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<a&&this.lines.push(new _.BufferLine(i,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-f,0)}_reflowSmaller(i,a){const f=this.getNullCell(_.DEFAULT_ATTR_DATA),y=[];let S=0;for(let w=this.lines.length-1;w>=0;w--){let v=this.lines.get(w);if(!v||!v.isWrapped&&v.getTrimmedLength()<=i)continue;const k=[v];for(;v.isWrapped&&w>0;)v=this.lines.get(--w),k.unshift(v);const A=this.ybase+this.y;if(A>=w&&A<w+k.length)continue;const O=k[k.length-1].getTrimmedLength(),I=(0,m.reflowSmallerGetNewLineLengths)(k,this._cols,i),L=I.length-k.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const F=[];for(let T=0;T<L;T++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);F.push(B)}F.length>0&&(y.push({start:w+k.length+S,newLines:F}),S+=F.length),k.push(...F);let U=I.length-1,V=I[U];V===0&&(U--,V=I[U]);let W=k.length-L-1,x=O;for(;W>=0;){const T=Math.min(x,V);if(k[U]===void 0)break;if(k[U].copyCellsFrom(k[W],x-T,V-T,T,!0),V-=T,V===0&&(U--,V=I[U]),x-=T,x===0){W--;const B=Math.max(W,0);x=(0,m.getWrappedLineTrimmedLength)(k,B,this._cols)}}for(let T=0;T<k.length;T++)I[T]<i&&k[T].setCell(I[T],f);let R=L-$;for(;R-- >0;)this.ybase===0?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+a-1)}if(y.length>0){const w=[],v=[];for(let U=0;U<this.lines.length;U++)v.push(this.lines.get(U));const k=this.lines.length;let A=k-1,O=0,I=y[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let L=0;for(let U=Math.min(this.lines.maxLength-1,k+S-1);U>=0;U--)if(I&&I.start>A+L){for(let V=I.newLines.length-1;V>=0;V--)this.lines.set(U--,I.newLines[V]);U++,w.push({index:A+1,amount:I.newLines.length}),L+=I.newLines.length,I=y[++O]}else this.lines.set(U,v[A--]);let $=0;for(let U=w.length-1;U>=0;U--)w[U].index+=$,this.lines.onInsertEmitter.fire(w[U]),$+=w[U].amount;const F=Math.max(0,k+S-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(i,a,f=0,y){const S=this.lines.get(i);return S?S.translateToString(a,f,y):""}getWrappedRangeForLine(i){let a=i,f=i;for(;a>0&&this.lines.get(a).isWrapped;)a--;for(;f+1<this.lines.length&&this.lines.get(f+1).isWrapped;)f++;return{first:a,last:f}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].line===i&&(this.markers[a].dispose(),this.markers.splice(a--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const a=new o.Marker(i);return this.markers.push(a),a.register(this.lines.onTrim(f=>{a.line-=f,a.line<0&&a.dispose()})),a.register(this.lines.onInsert(f=>{a.line>=f.index&&(a.line+=f.amount)})),a.register(this.lines.onDelete(f=>{a.line>=f.index&&a.line<f.index+f.amount&&a.dispose(),a.line>f.index&&(a.line-=f.amount)})),a.register(a.onDispose(()=>this._removeMarker(a))),a}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const l=h(3734),d=h(511),u=h(643),_=h(482);s.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let m=0;class b{constructor(o,c,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const a=c||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let f=0;f<o;++f)this.setCell(f,a);this.length=o}get(o){const c=this._data[3*o+0],i=2097151&c;return[this._data[3*o+1],2097152&c?this._combined[o]:i?(0,_.stringFromCodePoint)(i):"",c>>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):i]}set(o,c){this._data[3*o+1]=c[u.CHAR_DATA_ATTR_INDEX],c[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?(0,_.stringFromCodePoint)(2097151&c):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,c){return m=3*o,c.content=this._data[m+0],c.fg=this._data[m+1],c.bg=this._data[m+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c}setCell(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg}setCellFromCodepoint(o,c,i,a){268435456&a.bg&&(this._extendedAttrs[o]=a.extended),this._data[3*o+0]=c|i<<22,this._data[3*o+1]=a.fg,this._data[3*o+2]=a.bg}addCodepointToCell(o,c,i){let a=this._data[3*o+0];2097152&a?this._combined[o]+=(0,_.stringFromCodePoint)(c):2097151&a?(this._combined[o]=(0,_.stringFromCodePoint)(2097151&a)+(0,_.stringFromCodePoint)(c),a&=-2097152,a|=2097152):a=c|4194304,i&&(a&=-12582913,a|=i<<22),this._data[3*o+0]=a}insertCells(o,c,i){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length-o){const a=new d.CellData;for(let f=this.length-o-c-1;f>=0;--f)this.setCell(o+c+f,this.loadCell(o+f,a));for(let f=0;f<c;++f)this.setCell(o+f,i)}else for(let a=o;a<this.length;++a)this.setCell(a,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(o,c,i){if(o%=this.length,c<this.length-o){const a=new d.CellData;for(let f=0;f<this.length-o-c;++f)this.setCell(o+f,this.loadCell(o+c+f,a));for(let f=this.length-c;f<this.length;++f)this.setCell(f,i)}else for(let a=o;a<this.length;++a)this.setCell(a,i);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,i)}replaceCells(o,c,i,a=!1){if(a)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,i);o<c&&o<this.length;)this.isProtected(o)||this.setCell(o,i),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,i),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,i);o<c&&o<this.length;)this.setCell(o++,i)}resize(o,c){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const a=new Uint32Array(i);a.set(this._data),this._data=a}for(let a=this.length;a<o;++a)this.setCell(a,c)}else{this._data=this._data.subarray(0,i);const a=Object.keys(this._combined);for(let y=0;y<a.length;y++){const S=parseInt(a[y],10);S>=o&&delete this._combined[S]}const f=Object.keys(this._extendedAttrs);for(let y=0;y<f.length;y++){const S=parseInt(f[y],10);S>=o&&delete this._extendedAttrs[S]}}return this.length=o,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,c=!1){if(c)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,o);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const c in o._combined)this._combined[c]=o._combined[c];this._extendedAttrs={};for(const c in o._extendedAttrs)this._extendedAttrs[c]=o._extendedAttrs[c];this.isWrapped=o.isWrapped}clone(){const o=new b(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const c in this._combined)o._combined[c]=this._combined[c];for(const c in this._extendedAttrs)o._extendedAttrs[c]=this._extendedAttrs[c];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,c,i,a,f){const y=o._data;if(f)for(let w=a-1;w>=0;w--){for(let v=0;v<3;v++)this._data[3*(i+w)+v]=y[3*(c+w)+v];268435456&y[3*(c+w)+2]&&(this._extendedAttrs[i+w]=o._extendedAttrs[c+w])}else for(let w=0;w<a;w++){for(let v=0;v<3;v++)this._data[3*(i+w)+v]=y[3*(c+w)+v];268435456&y[3*(c+w)+2]&&(this._extendedAttrs[i+w]=o._extendedAttrs[c+w])}const S=Object.keys(o._combined);for(let w=0;w<S.length;w++){const v=parseInt(S[w],10);v>=c&&(this._combined[v-c+i]=o._combined[v])}}translateToString(o,c,i,a){c=c??0,i=i??this.length,o&&(i=Math.min(i,this.getTrimmedLength())),a&&(a.length=0);let f="";for(;c<i;){const y=this._data[3*c+0],S=2097151&y,w=2097152&y?this._combined[c]:S?(0,_.stringFromCodePoint)(S):u.WHITESPACE_CELL_CHAR;if(f+=w,a)for(let v=0;v<w.length;++v)a.push(c);c+=y>>22||1}return a&&a.push(c),f}}s.BufferLine=b},4841:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(h,l){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return l*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(C,s)=>{function h(l,d,u){if(d===l.length-1)return l[d].getTrimmedLength();const _=!l[d].hasContent(u-1)&&l[d].getWidth(u-1)===1,m=l[d+1].getWidth(0)===2;return _&&m?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(l,d,u,_,m){const b=[];for(let p=0;p<l.length-1;p++){let o=p,c=l.get(++o);if(!c.isWrapped)continue;const i=[l.get(p)];for(;o<l.length&&c.isWrapped;)i.push(c),c=l.get(++o);if(_>=p&&_<o){p+=i.length-1;continue}let a=0,f=h(i,a,d),y=1,S=0;for(;y<i.length;){const v=h(i,y,d),k=v-S,A=u-f,O=Math.min(k,A);i[a].copyCellsFrom(i[y],S,f,O,!1),f+=O,f===u&&(a++,f=0),S+=O,S===v&&(y++,S=0),f===0&&a!==0&&i[a-1].getWidth(u-1)===2&&(i[a].copyCellsFrom(i[a-1],u-1,f++,1,!1),i[a-1].setCell(u-1,m))}i[a].replaceCells(f,u,m);let w=0;for(let v=i.length-1;v>0&&(v>a||i[v].getTrimmedLength()===0);v--)w++;w>0&&(b.push(p+i.length-w),b.push(w)),p+=i.length-1}return b},s.reflowLargerCreateNewLayout=function(l,d){const u=[];let _=0,m=d[_],b=0;for(let p=0;p<l.length;p++)if(m===p){const o=d[++_];l.onDeleteEmitter.fire({index:p-b,amount:o}),p+=o-1,b+=o,m=d[++_]}else u.push(p);return{layout:u,countRemoved:b}},s.reflowLargerApplyNewLayout=function(l,d){const u=[];for(let _=0;_<d.length;_++)u.push(l.get(d[_]));for(let _=0;_<u.length;_++)l.set(_,u[_]);l.length=d.length},s.reflowSmallerGetNewLineLengths=function(l,d,u){const _=[],m=l.map((c,i)=>h(l,i,d)).reduce((c,i)=>c+i);let b=0,p=0,o=0;for(;o<m;){if(m-o<u){_.push(m-o);break}b+=u;const c=h(l,p,d);b>c&&(b-=c,p++);const i=l[p].getWidth(b-1)===2;i&&b--;const a=i?u-1:u;_.push(a),o+=a}return _},s.getWrappedLineTrimmedLength=h},5295:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const l=h(8460),d=h(844),u=h(9092);class _ extends d.Disposable{constructor(b,p){super(),this._optionsService=b,this._bufferService=p,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,p){this._normal.resize(b,p),this._alt.resize(b,p),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}s.BufferSet=_},511:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const l=h(482),d=h(643),u=h(3734);class _ extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const p=new _;return p.setFromCharData(b),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(b[d.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(b[d.CHAR_DATA_CHAR_INDEX].length===2){const o=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|b[d.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=b[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const l=h(8460),d=h(844);class u{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}s.Marker=u,u._nextId=1},7116:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,s)=>{var h,l,d;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
8
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(h||(s.C0=h={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(l||(s.C1=l={})),function(u){u.ST=`${h.ESC}\\`}(d||(s.C1_ESCAPED=d={}))},7399:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const l=h(2584),d={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:["'",'"']};s.evaluateKeyboardEvent=function(u,_,m,b){const p={type:0,cancel:!1,key:void 0},o=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?p.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?p.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?p.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(p.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:p.key=u.ctrlKey?"\b":l.C0.DEL,u.altKey&&(p.key=l.C0.ESC+p.key);break;case 9:if(u.shiftKey){p.key=l.C0.ESC+"[Z";break}p.key=l.C0.HT,p.cancel=!0;break;case 13:p.key=u.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,p.cancel=!0;break;case 27:p.key=l.C0.ESC,u.altKey&&(p.key=l.C0.ESC+l.C0.ESC),p.cancel=!0;break;case 37:if(u.metaKey)break;o?(p.key=l.C0.ESC+"[1;"+(o+1)+"D",p.key===l.C0.ESC+"[1;3D"&&(p.key=l.C0.ESC+(m?"b":"[1;5D"))):p.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(u.metaKey)break;o?(p.key=l.C0.ESC+"[1;"+(o+1)+"C",p.key===l.C0.ESC+"[1;3C"&&(p.key=l.C0.ESC+(m?"f":"[1;5C"))):p.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(u.metaKey)break;o?(p.key=l.C0.ESC+"[1;"+(o+1)+"A",m||p.key!==l.C0.ESC+"[1;3A"||(p.key=l.C0.ESC+"[1;5A")):p.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(u.metaKey)break;o?(p.key=l.C0.ESC+"[1;"+(o+1)+"B",m||p.key!==l.C0.ESC+"[1;3B"||(p.key=l.C0.ESC+"[1;5B")):p.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(p.key=l.C0.ESC+"[2~");break;case 46:p.key=o?l.C0.ESC+"[3;"+(o+1)+"~":l.C0.ESC+"[3~";break;case 36:p.key=o?l.C0.ESC+"[1;"+(o+1)+"H":_?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:p.key=o?l.C0.ESC+"[1;"+(o+1)+"F":_?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:u.shiftKey?p.type=2:u.ctrlKey?p.key=l.C0.ESC+"[5;"+(o+1)+"~":p.key=l.C0.ESC+"[5~";break;case 34:u.shiftKey?p.type=3:u.ctrlKey?p.key=l.C0.ESC+"[6;"+(o+1)+"~":p.key=l.C0.ESC+"[6~";break;case 112:p.key=o?l.C0.ESC+"[1;"+(o+1)+"P":l.C0.ESC+"OP";break;case 113:p.key=o?l.C0.ESC+"[1;"+(o+1)+"Q":l.C0.ESC+"OQ";break;case 114:p.key=o?l.C0.ESC+"[1;"+(o+1)+"R":l.C0.ESC+"OR";break;case 115:p.key=o?l.C0.ESC+"[1;"+(o+1)+"S":l.C0.ESC+"OS";break;case 116:p.key=o?l.C0.ESC+"[15;"+(o+1)+"~":l.C0.ESC+"[15~";break;case 117:p.key=o?l.C0.ESC+"[17;"+(o+1)+"~":l.C0.ESC+"[17~";break;case 118:p.key=o?l.C0.ESC+"[18;"+(o+1)+"~":l.C0.ESC+"[18~";break;case 119:p.key=o?l.C0.ESC+"[19;"+(o+1)+"~":l.C0.ESC+"[19~";break;case 120:p.key=o?l.C0.ESC+"[20;"+(o+1)+"~":l.C0.ESC+"[20~";break;case 121:p.key=o?l.C0.ESC+"[21;"+(o+1)+"~":l.C0.ESC+"[21~";break;case 122:p.key=o?l.C0.ESC+"[23;"+(o+1)+"~":l.C0.ESC+"[23~";break;case 123:p.key=o?l.C0.ESC+"[24;"+(o+1)+"~":l.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(m&&!b||!u.altKey||u.metaKey)!m||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?p.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(p.key=l.C0.US),u.key==="@"&&(p.key=l.C0.NUL)):u.keyCode===65&&(p.type=1);else{const c=d[u.keyCode],i=c==null?void 0:c[u.shiftKey?1:0];if(i)p.key=l.C0.ESC+i;else if(u.keyCode>=65&&u.keyCode<=90){const a=u.ctrlKey?u.keyCode-64:u.keyCode+32;let f=String.fromCharCode(a);u.shiftKey&&(f=f.toUpperCase()),p.key=l.C0.ESC+f}else if(u.keyCode===32)p.key=l.C0.ESC+(u.ctrlKey?l.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let a=u.code.slice(3,4);u.shiftKey||(a=a.toLowerCase()),p.key=l.C0.ESC+a,p.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?p.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?p.key=l.C0.NUL:u.keyCode>=51&&u.keyCode<=55?p.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?p.key=l.C0.DEL:u.keyCode===219?p.key=l.C0.ESC:u.keyCode===220?p.key=l.C0.FS:u.keyCode===221&&(p.key=l.C0.GS)}return p}},482:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},s.utf32ToString=function(h,l=0,d=h.length){let u="";for(let _=l;_<d;++_){let m=h[_];m>65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,l){const d=h.length;if(!d)return 0;let u=0,_=0;if(this._interim){const m=h.charCodeAt(_++);56320<=m&&m<=57343?l[u++]=1024*(this._interim-55296)+m-56320+65536:(l[u++]=this._interim,l[u++]=m),this._interim=0}for(let m=_;m<d;++m){const b=h.charCodeAt(m);if(55296<=b&&b<=56319){if(++m>=d)return this._interim=b,u;const p=h.charCodeAt(m);56320<=p&&p<=57343?l[u++]=1024*(b-55296)+p-56320+65536:(l[u++]=b,l[u++]=p)}else b!==65279&&(l[u++]=b)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,l){const d=h.length;if(!d)return 0;let u,_,m,b,p=0,o=0,c=0;if(this.interim[0]){let f=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let S,w=0;for(;(S=63&this.interim[++w])&&w<4;)y<<=6,y|=S;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=v-w;for(;c<k;){if(c>=d)return 0;if(S=h[c++],(192&S)!=128){c--,f=!0;break}this.interim[w++]=S,y<<=6,y|=63&S}f||(v===2?y<128?c--:l[p++]=y:v===3?y<2048||y>=55296&&y<=57343||y===65279||(l[p++]=y):y<65536||y>1114111||(l[p++]=y)),this.interim.fill(0)}const i=d-4;let a=c;for(;a<d;){for(;!(!(a<i)||128&(u=h[a])||128&(_=h[a+1])||128&(m=h[a+2])||128&(b=h[a+3]));)l[p++]=u,l[p++]=_,l[p++]=m,l[p++]=b,a+=4;if(u=h[a++],u<128)l[p++]=u;else if((224&u)==192){if(a>=d)return this.interim[0]=u,p;if(_=h[a++],(192&_)!=128){a--;continue}if(o=(31&u)<<6|63&_,o<128){a--;continue}l[p++]=o}else if((240&u)==224){if(a>=d)return this.interim[0]=u,p;if(_=h[a++],(192&_)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=_,p;if(m=h[a++],(192&m)!=128){a--;continue}if(o=(15&u)<<12|(63&_)<<6|63&m,o<2048||o>=55296&&o<=57343||o===65279)continue;l[p++]=o}else if((248&u)==240){if(a>=d)return this.interim[0]=u,p;if(_=h[a++],(192&_)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=_,p;if(m=h[a++],(192&m)!=128){a--;continue}if(a>=d)return this.interim[0]=u,this.interim[1]=_,this.interim[2]=m,p;if(b=h[a++],(192&b)!=128){a--;continue}if(o=(7&u)<<18|(63&_)<<12|(63&m)<<6|63&b,o<65536||o>1114111)continue;l[p++]=o}}return p}}},225:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const l=h(1480),d=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;s.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let m=0;m<d.length;++m)_.fill(0,d[m][0],d[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?_[m]:function(b,p){let o,c=0,i=p.length-1;if(b<p[0][0]||b>p[i][1])return!1;for(;i>=c;)if(o=c+i>>1,b>p[o][1])c=o+1;else{if(!(b<p[o][0]))return!0;i=o-1}return!1}(m,u)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,b){let p=this.wcwidth(m),o=p===0&&b!==0;if(o){const c=l.UnicodeService.extractWidth(b);c===0?o=!1:c>p&&(p=c)}return l.UnicodeService.createPropertyValue(0,p,o)}}},5981:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const l=h(8460),d=h(844);class u extends d.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,b){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+=m.length,this._writeBuffer.push(m),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(b)}_innerWrite(m=0,b=!0){const p=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,b);if(c){const a=f=>Date.now()-p>=12?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(p,f);return void c.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(a)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-p>=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()}}s.WriteBuffer=u},5941:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const h=/^([\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})$/,l=/^[\da-f]+$/;function d(u,_){const m=u.toString(16),b=m.length<2?"0"+m:m;switch(_){case 4:return m[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}s.parseColor=function(u){if(!u)return;let _=u.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const m=h.exec(_);if(m){const b=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/b*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/b*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/b*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),l.exec(_)&&[3,6,9,12].includes(_.length))){const m=_.length/3,b=[0,0,0];for(let p=0;p<3;++p){const o=parseInt(_.slice(m*p,m*p+m),16);b[p]=m===1?o<<4:m===2?o:m===3?o>>4:o>>8}return b}},s.toRgbString=function(u,_=16){const[m,b,p]=u;return`rgb:${d(m,_)}/${d(b,_)}/${d(p,_)}`}},5770:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const l=h(482),d=h(8742),u=h(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(b,p){this._handlers[b]===void 0&&(this._handlers[b]=[]);const o=this._handlers[b];return o.push(p),{dispose:()=>{const c=o.indexOf(p);c!==-1&&o.splice(c,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(b,p){if(this.reset(),this._ident=b,this._active=this._handlers[b]||_,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(b,p,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(b,p,o);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(b,p,o))}unhook(b,p=!0){if(this._active.length){let o=!1,c=this._active.length-1,i=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,o=p,i=this._stack.fallThrough,this._stack.paused=!1),!i&&o===!1){for(;c>=0&&(o=this._active[c].unhook(b),o!==!0);c--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,o;c--}for(;c>=0;c--)if(o=this._active[c].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",b);this._active=_,this._ident=0}};const m=new d.Params;m.addParam(0),s.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=m,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():m,this._data="",this._hitLimit=!1}put(b,p,o){this._hitLimit||(this._data+=(0,l.utf32ToString)(b,p,o),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let p=!1;if(this._hitLimit)p=!1;else if(b&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then(o=>(this._params=m,this._data="",this._hitLimit=!1,o));return this._params=m,this._data="",this._hitLimit=!1,p}}},2015:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const l=h(844),d=h(8742),u=h(6242),_=h(6351);class m{constructor(c){this.table=new Uint8Array(c)}setDefault(c,i){this.table.fill(c<<4|i)}add(c,i,a,f){this.table[i<<8|c]=a<<4|f}addMany(c,i,a,f){for(let y=0;y<c.length;y++)this.table[i<<8|c[y]]=a<<4|f}}s.TransitionTable=m;const b=160;s.VT500_TRANSITION_TABLE=function(){const o=new m(4095),c=Array.apply(null,Array(256)).map((w,v)=>v),i=(w,v)=>c.slice(w,v),a=i(32,127),f=i(0,24);f.push(25),f.push.apply(f,i(28,32));const y=i(0,14);let S;for(S in o.setDefault(1,0),o.addMany(a,0,2,0),y)o.addMany([24,26,153,154],S,3,0),o.addMany(i(128,144),S,3,0),o.addMany(i(144,152),S,3,0),o.add(156,S,0,0),o.add(27,S,11,1),o.add(157,S,4,8),o.addMany([152,158,159],S,0,7),o.add(155,S,11,3),o.add(144,S,11,9);return o.addMany(f,0,3,0),o.addMany(f,1,3,1),o.add(127,1,0,1),o.addMany(f,8,0,8),o.addMany(f,3,3,3),o.add(127,3,0,3),o.addMany(f,4,3,4),o.add(127,4,0,4),o.addMany(f,6,3,6),o.addMany(f,5,3,5),o.add(127,5,0,5),o.addMany(f,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(a,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(i(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(a,7,0,7),o.addMany(f,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(i(64,127),3,7,0),o.addMany(i(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(i(48,60),4,8,4),o.addMany(i(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(i(32,64),6,0,6),o.add(127,6,0,6),o.addMany(i(64,127),6,0,0),o.addMany(i(32,48),3,9,5),o.addMany(i(32,48),5,9,5),o.addMany(i(48,64),5,0,6),o.addMany(i(64,127),5,7,0),o.addMany(i(32,48),4,9,5),o.addMany(i(32,48),1,9,2),o.addMany(i(32,48),2,9,2),o.addMany(i(48,127),2,10,0),o.addMany(i(48,80),1,10,0),o.addMany(i(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(i(96,127),1,10,0),o.add(80,1,11,9),o.addMany(f,9,0,9),o.add(127,9,0,9),o.addMany(i(28,32),9,0,9),o.addMany(i(32,48),9,9,12),o.addMany(i(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(f,11,0,11),o.addMany(i(32,128),11,0,11),o.addMany(i(28,32),11,0,11),o.addMany(f,10,0,10),o.add(127,10,0,10),o.addMany(i(28,32),10,0,10),o.addMany(i(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(i(32,48),10,9,12),o.addMany(f,12,0,12),o.add(127,12,0,12),o.addMany(i(28,32),12,0,12),o.addMany(i(32,48),12,9,12),o.addMany(i(48,64),12,0,11),o.addMany(i(64,127),12,12,13),o.addMany(i(64,127),10,12,13),o.addMany(i(64,127),9,12,13),o.addMany(f,13,13,13),o.addMany(a,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(b,0,2,0),o.add(b,8,5,8),o.add(b,6,0,6),o.add(b,11,0,11),o.add(b,13,13,13),o}();class p extends l.Disposable{constructor(c=s.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,a,f)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,a)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(c,i=[64,126]){let a=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=c.prefix.charCodeAt(0),a&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<c.intermediates.length;++y){const S=c.intermediates.charCodeAt(y);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=S}}if(c.final.length!==1)throw new Error("final must be a single byte");const f=c.final.charCodeAt(0);if(i[0]>f||f>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return a<<=8,a|=f,a}identToString(c){const i=[];for(;c;)i.push(String.fromCharCode(255&c)),c>>=8;return i.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,i){const a=this._identifier(c,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);const f=this._escHandlers[a];return f.push(i),{dispose:()=>{const y=f.indexOf(i);y!==-1&&f.splice(y,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,i){this._executeHandlers[c.charCodeAt(0)]=i}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,i){const a=this._identifier(c);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);const f=this._csiHandlers[a];return f.push(i),{dispose:()=>{const y=f.indexOf(i);y!==-1&&f.splice(y,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,i){return this._dcsParser.registerHandler(this._identifier(c),i)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,i){return this._oscParser.registerHandler(c,i)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,i,a,f,y){this._parseStack.state=c,this._parseStack.handlers=i,this._parseStack.handlerPos=a,this._parseStack.transition=f,this._parseStack.chunkPos=y}parse(c,i,a){let f,y=0,S=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(a===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 k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&k>-1){for(;k>=0&&(f=v[k](this._params),f!==!0);k--)if(f instanceof Promise)return this._parseStack.handlerPos=k,f}this._parseStack.handlers=[];break;case 4:if(a===!1&&k>-1){for(;k>=0&&(f=v[k](),f!==!0);k--)if(f instanceof Promise)return this._parseStack.handlerPos=k,f}this._parseStack.handlers=[];break;case 6:if(y=c[this._parseStack.chunkPos],f=this._dcsParser.unhook(y!==24&&y!==26,a),f)return f;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=c[this._parseStack.chunkPos],f=this._oscParser.end(y!==24&&y!==26,a),f)return f;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=w;v<i;++v){switch(y=c[v],S=this._transitions.table[this.currentState<<8|(y<160?y:b)],S>>4){case 2:for(let L=v+1;;++L){if(L>=i||(y=c[L])<32||y>126&&y<b){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<b){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<b){this._printHandler(c,v,L),v=L-1;break}if(++L>=i||(y=c[L])<32||y>126&&y<b){this._printHandler(c,v,L),v=L-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|y];let A=k?k.length-1:-1;for(;A>=0&&(f=k[A](this._params),f!==!0);A--)if(f instanceof Promise)return this._preserveStack(3,k,A,S,v),f;A<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingJoinState=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++v<i&&(y=c[v])>47&&y<60);v--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const O=this._escHandlers[this._collect<<8|y];let I=O?O.length-1:-1;for(;I>=0&&(f=O[I](),f!==!0);I--)if(f instanceof Promise)return this._preserveStack(4,O,I,S,v),f;I<0&&this._escHandlerFb(this._collect<<8|y),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|y,this._params);break;case 13:for(let L=v+1;;++L)if(L>=i||(y=c[L])===24||y===26||y===27||y>127&&y<b){this._dcsParser.put(c,v,L),v=L-1;break}break;case 14:if(f=this._dcsParser.unhook(y!==24&&y!==26),f)return this._preserveStack(6,[],0,S,v),f;y===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 L=v+1;;L++)if(L>=i||(y=c[L])<32||y>127&&y<b){this._oscParser.put(c,v,L),v=L-1;break}break;case 6:if(f=this._oscParser.end(y!==24&&y!==26),f)return this._preserveStack(5,[],0,S,v),f;y===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=p},6242:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const l=h(5770),d=h(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,m){this._handlers[_]===void 0&&(this._handlers[_]=[]);const b=this._handlers[_];return b.push(m),{dispose:()=>{const p=b.indexOf(m);p!==-1&&b.splice(p,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,m,b){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(_,m,b);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(_,m,b))}start(){this.reset(),this._state=1}put(_,m,b){if(this._state!==3){if(this._state===1)for(;m<b;){const p=_[m++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&b-m>0&&this._put(_,m,b)}}end(_,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,p=this._active.length-1,o=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,b=m,o=this._stack.fallThrough,this._stack.paused=!1),!o&&b===!1){for(;p>=0&&(b=this._active[p].end(_),b!==!0);p--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,b;p--}for(;p>=0;p--)if(b=this._active[p].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",_);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,m,b){this._hitLimit||(this._data+=(0,d.utf32ToString)(_,m,b),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let m=!1;if(this._hitLimit)m=!1;else if(_&&(m=this._handler(this._data),m instanceof Promise))return m.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,m}}},8742:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const h=2147483647;class l{static fromArray(u){const _=new l;if(!u.length)return _;for(let m=Array.isArray(u[0])?1:0;m<u.length;++m){const b=u[m];if(Array.isArray(b))for(let p=0;p<b.length;++p)_.addSubParam(b[p]);else _.addParam(b)}return _}constructor(u=32,_=32){if(this.maxLength=u,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new l(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let _=0;_<this.length;++_){u.push(this.params[_]);const m=this._subParamsIdx[_]>>8,b=255&this._subParamsIdx[_];b-m>0&&u.push(Array.prototype.slice.call(this._subParams,m,b))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>h?h:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>h?h:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const _=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];return m-_>0?this._subParams.subarray(_,m):null}getSubParamsAll(){const u={};for(let _=0;_<this.length;++_){const m=this._subParamsIdx[_]>>8,b=255&this._subParamsIdx[_];b-m>0&&(u[_]=this._subParams.slice(m,b))}return u}addDigit(u){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,b=m[_-1];m[_-1]=~b?Math.min(10*b+u,h):u}}s.Params=l},5741:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,l){const d={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(d),l.dispose=()=>this._wrappedAddonDispose(d),l.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let l=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===h){l=d;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(l,1)}}},8771:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const l=h(3785),d=h(511);s.BufferApiView=class{constructor(u,_){this._buffer=u,this.type=_}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const _=this._buffer.lines.get(u);if(_)return new l.BufferLineApiView(_)}getNullCell(){return new d.CellData}}},3785:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const l=h(511);s.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,u){if(!(d<0||d>=this._line.length))return u?(this._line.loadCell(d,u),u):this._line.loadCell(d,new l.CellData)}translateToString(d,u,_){return this._line.translateToString(d,u,_)}}},8285:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const l=h(8771),d=h(8460),u=h(844);class _ extends u.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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)}}s.BufferNamespaceApi=_},7975:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,l){return this._core.registerCsiHandler(h,d=>l(d.toArray()))}addCsiHandler(h,l){return this.registerCsiHandler(h,l)}registerDcsHandler(h,l){return this._core.registerDcsHandler(h,(d,u)=>l(d,u.toArray()))}addDcsHandler(h,l){return this.registerDcsHandler(h,l)}registerEscHandler(h,l){return this._core.registerEscHandler(h,l)}addEscHandler(h,l){return this.registerEscHandler(h,l)}registerOscHandler(h,l){return this._core.registerOscHandler(h,l)}addOscHandler(h,l){return this.registerOscHandler(h,l)}}},7090:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(C,s,h){var l=this&&this.__decorate||function(o,c,i,a){var f,y=arguments.length,S=y<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,c,i,a);else for(var w=o.length-1;w>=0;w--)(f=o[w])&&(S=(y<3?f(S):y>3?f(c,i,S):f(c,i))||S);return y>3&&S&&Object.defineProperty(c,i,S),S},d=this&&this.__param||function(o,c){return function(i,a){c(i,a,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=h(8460),_=h(844),m=h(5295),b=h(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let p=s.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(o,this))}resize(o,c){this.cols=o,this.rows=c,this.buffers.resize(o,c),this._onResize.fire({cols:o,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,c=!1){const i=this.buffer;let a;a=this._cachedBlankLine,a&&a.length===this.cols&&a.getFg(0)===o.fg&&a.getBg(0)===o.bg||(a=i.getBlankLine(o,c),this._cachedBlankLine=a),a.isWrapped=c;const f=i.ybase+i.scrollTop,y=i.ybase+i.scrollBottom;if(i.scrollTop===0){const S=i.lines.isFull;y===i.lines.length-1?S?i.lines.recycle().copyFrom(a):i.lines.push(a.clone()):i.lines.splice(y+1,0,a.clone()),S?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const S=y-f+1;i.lines.shiftElements(f+1,S-1,-1),i.lines.set(y,a.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(o,c,i){const a=this.buffer;if(o<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else o+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);const f=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+o,a.ybase),0),f!==a.ydisp&&(c||this._onScroll.fire(a.ydisp))}};s.BufferService=p=l([d(0,b.IOptionsService)],p)},7994:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,l){this._charsets[h]=l,this.glevel===h&&(this.charset=l)}}},1753:function(C,s,h){var l=this&&this.__decorate||function(a,f,y,S){var w,v=arguments.length,k=v<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(a,f,y,S);else for(var A=a.length-1;A>=0;A--)(w=a[A])&&(k=(v<3?w(k):v>3?w(f,y,k):w(f,y))||k);return v>3&&k&&Object.defineProperty(f,y,k),k},d=this&&this.__param||function(a,f){return function(y,S){f(y,S,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=h(2585),_=h(8460),m=h(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:a=>a.button!==4&&a.action===1&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)},VT200:{events:19,restrict:a=>a.action!==32},DRAG:{events:23,restrict:a=>a.action!==32||a.button!==3},ANY:{events:31,restrict:a=>!0}};function p(a,f){let y=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return a.button===4?(y|=64,y|=a.action):(y|=3&a.button,4&a.button&&(y|=64),8&a.button&&(y|=128),a.action===32?y|=32:a.action!==0||f||(y|=3)),y}const o=String.fromCharCode,c={DEFAULT:a=>{const f=[p(a,!1)+32,a.col+32,a.row+32];return f[0]>255||f[1]>255||f[2]>255?"":`\x1B[M${o(f[0])}${o(f[1])}${o(f[2])}`},SGR:a=>{const f=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${p(a,!0)};${a.col};${a.row}${f}`},SGR_PIXELS:a=>{const f=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${p(a,!0)};${a.x};${a.y}${f}`}};let i=s.CoreMouseService=class extends m.Disposable{constructor(a,f){super(),this._bufferService=a,this._coreService=f,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(b))this.addProtocol(y,b[y]);for(const y of Object.keys(c))this.addEncoding(y,c[y]);this.reset()}addProtocol(a,f){this._protocols[a]=f}addEncoding(a,f){this._encodings[a]=f}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(a){if(!this._protocols[a])throw new Error(`unknown protocol "${a}"`);this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(a){if(!this._encodings[a])throw new Error(`unknown encoding "${a}"`);this._activeEncoding=a}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows||a.button===4&&a.action===32||a.button===3&&a.action!==32||a.button!==4&&(a.action===2||a.action===3)||(a.col++,a.row++,a.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,a,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(a))return!1;const f=this._encodings[this._activeEncoding](a);return f&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(f):this._coreService.triggerDataEvent(f,!0)),this._lastEvent=a,!0}explainEvents(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}}_equalEvents(a,f,y){if(y){if(a.x!==f.x||a.y!==f.y)return!1}else if(a.col!==f.col||a.row!==f.row)return!1;return a.button===f.button&&a.action===f.action&&a.ctrl===f.ctrl&&a.alt===f.alt&&a.shift===f.shift}};s.CoreMouseService=i=l([d(0,u.IBufferService),d(1,u.ICoreService)],i)},6975:function(C,s,h){var l=this&&this.__decorate||function(i,a,f,y){var S,w=arguments.length,v=w<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,a,f,y);else for(var k=i.length-1;k>=0;k--)(S=i[k])&&(v=(w<3?S(v):w>3?S(a,f,v):S(a,f))||v);return w>3&&v&&Object.defineProperty(a,f,v),v},d=this&&this.__param||function(i,a){return function(f,y){a(f,y,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=h(1439),_=h(8460),m=h(844),b=h(2585),p=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=s.CoreService=class extends m.Disposable{constructor(i,a,f){super(),this._bufferService=i,this._logService=a,this._optionsService=f,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(p),this.decPrivateModes=(0,u.clone)(o)}reset(){this.modes=(0,u.clone)(p),this.decPrivateModes=(0,u.clone)(o)}triggerDataEvent(i,a=!1){if(this._optionsService.rawOptions.disableStdin)return;const f=this._bufferService.buffer;a&&this._optionsService.rawOptions.scrollOnUserInput&&f.ybase!==f.ydisp&&this._onRequestScrollToBottom.fire(),a&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(y=>y.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(a=>a.charCodeAt(0))),this._onBinary.fire(i))}};s.CoreService=c=l([d(0,b.IBufferService),d(1,b.ILogService),d(2,b.IOptionsService)],c)},9074:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const l=h(8055),d=h(8460),u=h(844),_=h(6106);let m=0,b=0;class p extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(i=>i==null?void 0:i.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(i){if(i.marker.isDisposed)return;const a=new o(i);if(a){const f=a.marker.onDispose(()=>a.dispose());a.onDispose(()=>{a&&(this._decorations.delete(a)&&this._onDecorationRemoved.fire(a),f.dispose())}),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,a,f){let y=0,S=0;for(const w of this._decorations.getKeyIterator(a))y=w.options.x??0,S=y+(w.options.width??1),i>=y&&i<S&&(!f||(w.options.layer??"bottom")===f)&&(yield w)}forEachDecorationAtCell(i,a,f,y){this._decorations.forEachByKey(a,S=>{m=S.options.x??0,b=m+(S.options.width??1),i>=m&&i<b&&(!f||(S.options.layer??"bottom")===f)&&y(S)})}}s.DecorationService=p;class o extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const l=h(2585),d=h(8343);class u{constructor(...m){this._entries=new Map;for(const[b,p]of m)this.set(b,p)}set(m,b){const p=this._entries.get(m);return this._entries.set(m,b),p}forEach(m){for(const[b,p]of this._entries.entries())m(b,p)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(l.IInstantiationService,this)}setService(_,m){this._services.set(_,m)}getService(_){return this._services.get(_)}createInstance(_,...m){const b=(0,d.getServiceDependencies)(_).sort((c,i)=>c.index-i.index),p=[];for(const c of b){const i=this._services.get(c.id);if(!i)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${c.id}.`);p.push(i)}const o=b.length>0?b[0].index:m.length;if(m.length!==o)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${o+1} conflicts with ${m.length} static arguments`);return new _(...m,...p)}}},7866:function(C,s,h){var l=this&&this.__decorate||function(o,c,i,a){var f,y=arguments.length,S=y<3?c:a===null?a=Object.getOwnPropertyDescriptor(c,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,c,i,a);else for(var w=o.length-1;w>=0;w--)(f=o[w])&&(S=(y<3?f(S):y>3?f(c,i,S):f(c,i))||S);return y>3&&S&&Object.defineProperty(c,i,S),S},d=this&&this.__param||function(o,c){return function(i,a){c(i,a,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=h(844),_=h(2585),m={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let b,p=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,i){this._evalLazyOptionalParams(i),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...i)}trace(o,...c){var i;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,o,c)}debug(o,...c){var i;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,o,c)}info(o,...c){var i;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,o,c)}warn(o,...c){var i;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,o,c)}error(o,...c){var i;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,o,c)}};s.LogService=p=l([d(0,_.IOptionsService)],p),s.setTraceLogger=function(o){b=o},s.traceCall=function(o,c,i){if(typeof i.value!="function")throw new Error("not supported");const a=i.value;i.value=function(...f){if(b.logLevel!==_.LogLevelEnum.TRACE)return a.apply(this,f);b.trace(`GlyphRenderer#${a.name}(${f.map(S=>JSON.stringify(S)).join(", ")})`);const y=a.apply(this,f);return b.trace(`GlyphRenderer#${a.name} return`,y),y}}},7302:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const l=h(8460),d=h(844),u=h(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends d.Disposable{constructor(p){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...s.DEFAULT_OPTIONS};for(const c in p)if(c in o)try{const i=p[c];o[c]=this._sanitizeAndValidateOption(c,i)}catch(i){console.error(i)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(p,o){return this.onOptionChange(c=>{c===p&&o(this.rawOptions[p])})}onMultipleOptionChange(p,o){return this.onOptionChange(c=>{p.indexOf(c)!==-1&&o()})}_setupOptions(){const p=c=>{if(!(c in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},o=(c,i)=>{if(!(c in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);i=this._sanitizeAndValidateOption(c,i),this.rawOptions[c]!==i&&(this.rawOptions[c]=i,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const i={get:p.bind(this,c),set:o.bind(this,c)};Object.defineProperty(this.options,c,i)}}_sanitizeAndValidateOption(p,o){switch(p){case"cursorStyle":if(o||(o=s.DEFAULT_OPTIONS[p]),!function(c){return c==="block"||c==="underline"||c==="bar"}(o))throw new Error(`"${o}" is not a valid value for ${p}`);break;case"wordSeparator":o||(o=s.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=_.includes(o)?o:s.DEFAULT_OPTIONS[p];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${p} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${p} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}s.OptionsService=m},2660:function(C,s,h){var l=this&&this.__decorate||function(m,b,p,o){var c,i=arguments.length,a=i<3?b:o===null?o=Object.getOwnPropertyDescriptor(b,p):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(m,b,p,o);else for(var f=m.length-1;f>=0;f--)(c=m[f])&&(a=(i<3?c(a):i>3?c(b,p,a):c(b,p))||a);return i>3&&a&&Object.defineProperty(b,p,a),a},d=this&&this.__param||function(m,b){return function(p,o){b(p,o,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=h(2585);let _=s.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const b=this._bufferService.buffer;if(m.id===void 0){const f=b.addMarker(b.ybase+b.y),y={data:m,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(y,f)),this._dataByLinkId.set(y.id,y),y.id}const p=m,o=this._getEntryIdKey(p),c=this._entriesWithId.get(o);if(c)return this.addLineToLink(c.id,b.ybase+b.y),c.id;const i=b.addMarker(b.ybase+b.y),a={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(a,i)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(m,b){const p=this._dataByLinkId.get(m);if(p&&p.lines.every(o=>o.line!==b)){const o=this._bufferService.buffer.addMarker(b);p.lines.push(o),o.onDispose(()=>this._removeMarkerFromLink(p,o))}}getLinkData(m){var b;return(b=this._dataByLinkId.get(m))==null?void 0:b.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,b){const p=m.lines.indexOf(b);p!==-1&&(m.lines.splice(p,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};s.OscLinkService=_=l([d(0,u.IBufferService)],_)},8343:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const h="di$target",l="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(d){return d[l]||[]},s.createDecorator=function(d){if(s.serviceRegistry.has(d))return s.serviceRegistry.get(d);const u=function(_,m,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,o,c){o[h]===o?o[l].push({id:p,index:c}):(o[l]=[{id:p,index:c}],o[h]=o)})(u,_,b)};return u.toString=()=>d,s.serviceRegistry.set(d,u),u}},2585:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const l=h(8343);var d;s.IBufferService=(0,l.createDecorator)("BufferService"),s.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),s.ICoreService=(0,l.createDecorator)("CoreService"),s.ICharsetService=(0,l.createDecorator)("CharsetService"),s.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(s.LogLevelEnum=d={})),s.ILogService=(0,l.createDecorator)("LogService"),s.IOptionsService=(0,l.createDecorator)("OptionsService"),s.IOscLinkService=(0,l.createDecorator)("OscLinkService"),s.IUnicodeService=(0,l.createDecorator)("UnicodeService"),s.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(C,s,h)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const l=h(8460),d=h(225);class u{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,b,p=!1){return(16777215&m)<<3|(3&b)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const m=new d.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let b=0,p=0;const o=m.length;for(let c=0;c<o;++c){let i=m.charCodeAt(c);if(55296<=i&&i<=56319){if(++c>=o)return b+this.wcwidth(i);const y=m.charCodeAt(c);56320<=y&&y<=57343?i=1024*(i-55296)+y-56320+65536:b+=this.wcwidth(y)}const a=this.charProperties(i,p);let f=u.extractWidth(a);u.extractShouldJoin(a)&&(f-=u.extractWidth(p)),b+=f,p=a}return b}charProperties(m,b){return this._activeProvider.charProperties(m,b)}}s.UnicodeService=u}},n={};function g(C){var s=n[C];if(s!==void 0)return s.exports;var h=n[C]={exports:{}};return r[C].call(h.exports,h,h.exports,g),h.exports}var E={};return(()=>{var C=E;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const s=g(9042),h=g(3236),l=g(844),d=g(5741),u=g(8285),_=g(7975),m=g(7090),b=["cols","rows"];class p extends l.Disposable{constructor(c){super(),this._core=this.register(new h.Terminal(c)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const i=f=>this._core.options[f],a=(f,y)=>{this._checkReadonlyOptions(f),this._core.options[f]=y};for(const f in this._core.options){const y={get:i.bind(this,f),set:a.bind(this,f)};Object.defineProperty(this._publicOptions,f,y)}}_checkReadonlyOptions(c){if(b.includes(c))throw new Error(`Option "${c}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const i in c)this._publicOptions[i]=c[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,i=!0){this._core.input(c,i)}resize(c,i){this._verifyIntegers(c,i),this._core.resize(c,i)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,i,a){this._verifyIntegers(c,i,a),this._core.select(c,i,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,i){this._verifyIntegers(c,i),this._core.selectLines(c,i)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,i){this._core.write(c,i)}writeln(c,i){this._core.write(c),this._core.write(`\r
|
|
9
|
+
`,i)}paste(c){this._core.paste(c)}refresh(c,i){this._verifyIntegers(c,i),this._core.refresh(c,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return s}_verifyIntegers(...c){for(const i of c)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const i of c)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}C.Terminal=p})(),E})())}(Wt)),Wt.exports}var $h=Mh();function M(e,t){class r{constructor(g){var E;const C=this;r.init(C,g),(E=C._zod).deferred??(E.deferred=[]);for(const s of C._zod.deferred)s()}static init(g,E){var C;g._zod??(g._zod={}),(C=g._zod).traits??(C.traits=new Set),g._zod.traits.add(e),t(g,E);for(const s in r.prototype)Object.defineProperty(g,s,{value:r.prototype[s].bind(g)});g._zod.constr=r,g._zod.def=E}static[Symbol.hasInstance](g){var E,C;return(C=(E=g==null?void 0:g._zod)==null?void 0:E.traits)==null?void 0:C.has(e)}}return Object.defineProperty(r,"name",{value:e}),r}const bs=Symbol("zod_brand");class Pe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Zt={};function ae(e){return e&&Object.assign(Zt,e),Zt}function zh(e){return e}function Hh(e){return e}function Fh(e){}function Nh(e){throw new Error}function jh(e){}function Uh(e){const t=Object.keys(e).filter(n=>typeof e[e[n]]!="number"),r={};for(const n of t)r[n]=e[n];return Object.values(r)}function De(e,t="|"){return e.map(r=>Xe(r)).join(t)}function Ss(e,t){return typeof t=="bigint"?t.toString():t}function rr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ae(e){return e==null}function vt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ys(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,g=r>n?r:n,E=Number.parseInt(e.toFixed(g).replace(".","")),C=Number.parseInt(t.toFixed(g).replace(".",""));return E%C/10**g}function Ee(e,t,r){Object.defineProperty(e,t,{get(){{const n=r();return e[t]=n,n}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Fe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Wh(e,t){return t?t.reduce((r,n)=>r==null?void 0:r[n],e):e}function Zh(e){const t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{const g={};for(let E=0;E<t.length;E++)g[t[E]]=n[E];return g})}function ir(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Oe(e){return JSON.stringify(e)}function sr(e){return typeof e=="object"&&e!==null}const ws=rr(()=>{try{return new Function(""),!0}catch{return!1}});function lt(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function qh(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const Kh=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ut=new Set(["string","number","symbol"]),Cs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t){const r=new e._zod.constr(t??e._zod.def);return t||(r._zod.parent=e),r}function Vh(e,t){const r=Array.isArray(e)?{}:e??{};return{checks:Array.isArray(e)?e:t??[],params:r}}function H(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Gh(e){let t;return new Proxy({},{get(r,n,g){return t??(t=e()),Reflect.get(t,n,g)},set(r,n,g,E){return t??(t=e()),Reflect.set(t,n,g,E)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,g){return t??(t=e()),Reflect.defineProperty(t,n,g)}})}function Xe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Es(e){return Object.keys(e).filter(t=>e[t]._zod.optionality==="optional")}const ks={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},xs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ds(e,t){const r={},n=e._zod.def;for(const g in t){if(!(g in n.shape))throw new Error(`Unrecognized key: "${g}"`);t[g]&&(r[g]=n.shape[g])}return ge(e,{...e._zod.def,shape:r,checks:[]})}function Rs(e,t){const r={...e._zod.def.shape},n=e._zod.def;for(const g in t){if(!(g in n.shape))throw new Error(`Unrecognized key: "${g}"`);t[g]&&delete r[g]}return ge(e,{...e._zod.def,shape:r,checks:[]})}function Ls(e,t){const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Fe(this,"shape",n),n},checks:[]};return ge(e,r)}function As(e,t){return ge(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Fe(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function Ts(e,t,r){const n=t._zod.def.shape,g={...n};if(r)for(const E in r){if(!(E in n))throw new Error(`Unrecognized key: "${E}"`);r[E]&&(g[E]=e?new e({type:"optional",innerType:n[E]}):n[E])}else for(const E in n)g[E]=e?new e({type:"optional",innerType:n[E]}):n[E];return ge(t,{...t._zod.def,shape:g,checks:[]})}function Os(e,t,r){const n=t._zod.def.shape,g={...n};if(r)for(const E in r){if(!(E in g))throw new Error(`Unrecognized key: "${E}"`);r[E]&&(g[E]=new e({type:"nonoptional",innerType:n[E]}))}else for(const E in n)g[E]=new e({type:"nonoptional",innerType:n[E]});return ge(t,{...t._zod.def,shape:g,checks:[]})}function Ie(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function fe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function qe(e){return typeof e=="string"?e:e==null?void 0:e.message}function le(e,t,r){var g,E,C,s,h,l;const n={...e,path:e.path??[]};if(!e.message){const d=qe((C=(E=(g=e.inst)==null?void 0:g._zod.def)==null?void 0:E.error)==null?void 0:C.call(E,e))??qe((s=t==null?void 0:t.error)==null?void 0:s.call(t,e))??qe((h=r.customError)==null?void 0:h.call(r,e))??qe((l=r.localeError)==null?void 0:l.call(r,e))??"Invalid input";n.message=d}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function bt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function St(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Me(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Jh=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:xs,NUMBER_FORMAT_RANGES:ks,aborted:Ie,allowsEval:ws,assert:jh,assertEqual:zh,assertIs:Fh,assertNever:Nh,assertNotEqual:Hh,assignProp:Fe,cached:rr,cleanRegex:vt,clone:ge,createTransparentProxy:Gh,defineLazy:Ee,esc:Oe,escapeRegex:ke,extend:Ls,finalizeIssue:le,floatSafeRemainder:ys,getElementAtPath:Wh,getLengthableOrigin:St,getParsedType:Kh,getSizableOrigin:bt,getValidEnumValues:Uh,isObject:sr,isPlainObject:lt,issue:Me,joinValues:De,jsonStringifyReplacer:Ss,merge:As,normalizeParams:H,nullish:Ae,numKeys:qh,omit:Rs,optionalKeys:Es,partial:Ts,pick:Ds,prefixIssues:fe,primitiveTypes:Cs,promiseAllObject:Zh,propertyKeyTypes:ut,randomString:ir,required:Os,splitChecksAndParams:Vh,stringifyPrimitive:Xe,unwrapMessage:qe},Symbol.toStringTag,{value:"Module"})),Mi=Symbol.for("{{zod.error}}");class ve{get message(){return JSON.stringify(this.issues,Ss,2)}constructor(t){Object.defineProperty(this,"_tag",{value:Mi,enumerable:!1}),Object.defineProperty(this,"name",{value:"$ZodError",enumerable:!1}),this.issues=t}static[Symbol.hasInstance](t){return(t==null?void 0:t._tag)===Mi}}function Is(e,t=r=>r.message){const r={},n=[];for(const g of e.issues)g.path.length>0?(r[g.path[0]]=r[g.path[0]]||[],r[g.path[0]].push(t(g))):n.push(t(g));return{formErrors:n,fieldErrors:r}}function Bs(e,t){const r=t||function(E){return E.message},n={_errors:[]},g=E=>{for(const C of E.issues)if(C.code==="invalid_union")C.errors.map(s=>g({issues:s}));else if(C.code==="invalid_key")g({issues:C.issues});else if(C.code==="invalid_element")g({issues:C.issues});else if(C.path.length===0)n._errors.push(r(C));else{let s=n,h=0;for(;h<C.path.length;){const l=C.path[h];h===C.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(C))):s[l]=s[l]||{_errors:[]},s=s[l],h++}}};return g(e),n}function Ps(e,t){const r=t||function(E){return E.message},n={errors:[]},g=E=>{var C,s;for(const h of E.issues)if(h.code==="invalid_union")h.errors.map(l=>g({issues:l}));else if(h.code==="invalid_key")g({issues:h.issues});else if(h.code==="invalid_element")g({issues:h.issues});else if(h.path.length===0)n.errors.push(r(h));else{let l=n,d=0;for(;d<h.path.length;){const u=h.path[d],_=d===h.path.length-1;typeof u=="string"?(l.properties??(l.properties={}),(C=l.properties)[u]??(C[u]={errors:[]}),l=l.properties[u]):(l.items??(l.items=[]),(s=l.items)[u]??(s[u]={errors:[]}),l=l.items[u]),_&&l.errors.push(r(h)),d++}}};return g(e),n}function Ms(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`["${String(r)}"]`):r.includes(".")?t.push(`["${r}"]`):(t.length&&t.push("."),t.push(r));return t.join("")}function $s(e){var n;const t=[],r=[...e.issues].sort((g,E)=>g.path.length-E.path.length);for(const g of r)t.push(`✖ ${g.message}`),(n=g.path)!=null&&n.length&&t.push(` → at ${Ms(g.path)}`);return t.join(`
|
|
10
|
+
`)}function yt(e,t,r){const n=r?{...r,async:!1}:{async:!1},g=e._zod.run({value:t,issues:[]},n);if(g instanceof Promise)throw new Pe;if(g.issues.length){const E=new((this==null?void 0:this.Error)??ve)(g.issues.map(C=>le(C,n,ae())));throw Error.captureStackTrace(E,yt),E}return g.value}const qt=yt.bind({Error:ve});function nr(e,t,r){const n=r?{...r,async:!1}:{async:!1},g=e._zod.run({value:t,issues:[]},n);if(g instanceof Promise)throw new Pe;return g.issues.length?{success:!1,error:new((this==null?void 0:this.Error)??ve)(g.issues.map(E=>le(E,n,ae())))}:{success:!0,data:g.value}}const Yh=nr.bind({Error:ve});async function wt(e,t,r){const n=r?{...r,async:!0}:{async:!0};let g=e._zod.run({value:t,issues:[]},n);if(g instanceof Promise&&(g=await g),g.issues.length){const E=new((this==null?void 0:this.Error)??ve)(g.issues.map(C=>le(C,n,ae())));throw Error.captureStackTrace(E,wt),E}return g.value}const Kt=wt.bind({Error:ve});async function or(e,t,r){const n=r?{...r,async:!0}:{async:!0};let g=e._zod.run({value:t,issues:[]},n);return g instanceof Promise&&(g=await g),g.issues.length?{success:!1,error:new((this==null?void 0:this.Error)??ve)(g.issues.map(E=>le(E,n,ae())))}:{success:!0,data:g.value}}const Xh=or.bind({Error:ve}),zs=/^[cC][^\s-]{8,}$/,Hs=/^[0-9a-z]+$/,Fs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ns=/^[0-9a-vA-V]{20}$/,js=/^[A-Za-z0-9]{27}$/,Us=/^[a-zA-Z0-9_-]{21}$/,Ws=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$e=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,el=$e(4),tl=$e(6),rl=$e(7),qs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,il=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sl=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,nl=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ol=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ks="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vs(){return new RegExp(Ks,"u")}const ar=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Gs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Js=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,al=new RegExp(`(${ar.source})|(${cr.source})`),Ys=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vt=/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/,Qs=/^\+(?:[0-9]){6,14}[0-9]$/,en="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",tn=new RegExp(`^${en}$`);function rn(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function sn(e){return new RegExp(`^${rn(e)}$`)}function nn(e){let t=`${en}T${rn(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}const on=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},an=/^\d+n?$/,cn=/^\d+$/,hn=/^-?\d+(?:\.\d+)?/i,ln=/true|false/i,un=/null/i,dn=/undefined/i,fn=/^[^A-Z]*$/,_n=/^[^a-z]*$/,pn=Object.freeze(Object.defineProperty({__proto__:null,_emoji:Ks,base64:Ys,base64url:Xs,bigint:an,boolean:ln,browserEmail:ol,cidrv4:Gs,cidrv6:Js,cuid:zs,cuid2:Hs,date:tn,datetime:nn,duration:Ws,e164:Qs,email:qs,emoji:Vs,extendedDuration:Qh,guid:Zs,hostname:Vt,html5Email:il,integer:cn,ip:al,ipv4:ar,ipv6:cr,ksuid:js,lowercase:fn,nanoid:Us,null:un,number:hn,rfc5322Email:sl,string:on,time:sn,ulid:Fs,undefined:dn,unicodeEmail:nl,uppercase:_n,uuid:$e,uuid4:el,uuid6:tl,uuid7:rl,xid:Ns},Symbol.toStringTag,{value:"Module"})),oe=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mn={number:"number",bigint:"bigint",object:"date"},hr=M("$ZodCheckLessThan",(e,t)=>{oe.init(e,t);const r=mn[typeof t.value];e._zod.onattach.push(n=>{const g=n._zod.computed.maximum??Number.POSITIVE_INFINITY;t.value<g&&(n._zod.computed.maximum=t.value,n._zod.computed.inclusive=t.inclusive)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lr=M("$ZodCheckGreaterThan",(e,t)=>{oe.init(e,t);const r=mn[typeof t.value];e._zod.onattach.push(n=>{const g=n._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.value>g&&(n._zod.computed.minimum=t.value,n._zod.computed.inclusive=t.inclusive)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gn=M("$ZodCheckMultipleOf",(e,t)=>{oe.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.computed).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ys(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vn=M("$ZodCheckNumberFormat",(e,t)=>{var C;oe.init(e,t),t.format=t.format||"float64";const r=(C=t.format)==null?void 0:C.includes("int"),n=r?"int":"number",[g,E]=ks[t.format];e._zod.onattach.push(s=>{s._zod.computed.format=t.format,s._zod.computed.minimum=g,s._zod.computed.maximum=E,s._zod.computed.inclusive=!0,r&&(s._zod.computed.pattern=cn)}),e._zod.check=s=>{const h=s.value;if(r){if(!Number.isInteger(h)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?s.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}h<g&&s.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:e,continue:!t.abort}),h>E&&s.issues.push({origin:"number",input:h,code:"too_big",maximum:E,inst:e})}}),bn=M("$ZodCheckBigIntFormat",(e,t)=>{oe.init(e,t);const[r,n]=xs[t.format];e._zod.onattach.push(g=>{g._zod.computed.format=t.format,g._zod.computed.minimum=r,g._zod.computed.maximum=n}),e._zod.check=g=>{const E=g.value;E<r&&g.issues.push({origin:"bigint",input:E,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),E>n&&g.issues.push({origin:"bigint",input:E,code:"too_big",maximum:n,inst:e})}}),Sn=M("$ZodCheckMaxSize",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.size!==void 0},e._zod.onattach.push(r=>{const n=r._zod.computed.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.computed.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;n.size<=t.maximum||r.issues.push({origin:bt(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),yn=M("$ZodCheckMinSize",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.size!==void 0},e._zod.onattach.push(r=>{const n=r._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.computed.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;n.size>=t.minimum||r.issues.push({origin:bt(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),wn=M("$ZodCheckSizeEquals",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.size!==void 0},e._zod.onattach.push(r=>{r._zod.computed.minimum=t.size,r._zod.computed.maximum=t.size,r._zod.computed.size=t.size}),e._zod.check=r=>{const n=r.value,g=n.size;if(g===t.size)return;const E=g>t.size;r.issues.push({origin:bt(n),...E?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},input:r.value,inst:e,continue:!t.abort})}}),Cn=M("$ZodCheckMaxLength",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.length!==void 0},e._zod.onattach.push(r=>{const n=r._zod.computed.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.computed.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const E=St(n);r.issues.push({origin:E,code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),En=M("$ZodCheckMinLength",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.length!==void 0},e._zod.onattach.push(r=>{const n=r._zod.computed.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.computed.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const E=St(n);r.issues.push({origin:E,code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),kn=M("$ZodCheckLengthEquals",(e,t)=>{oe.init(e,t),e._zod.when=r=>{const n=r.value;return!Ae(n)&&n.length!==void 0},e._zod.onattach.push(r=>{r._zod.computed.minimum=t.length,r._zod.computed.maximum=t.length,r._zod.computed.length=t.length}),e._zod.check=r=>{const n=r.value,g=n.length;if(g===t.length)return;const E=St(n),C=g>t.length;r.issues.push({origin:E,...C?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),Qe=M("$ZodCheckStringFormat",(e,t)=>{var r;oe.init(e,t),e._zod.onattach.push(n=>{n._zod.computed.format=t.format,t.pattern&&(n._zod.computed.pattern=t.pattern)}),(r=e._zod).check??(r.check=n=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),xn=M("$ZodCheckRegex",(e,t)=>{Qe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Dn=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fn),Qe.init(e,t)}),Rn=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_n),Qe.init(e,t)}),Ln=M("$ZodCheckIncludes",(e,t)=>{oe.init(e,t);const r=new RegExp(ke(t.includes));t.pattern=r,e._zod.onattach.push(n=>{n._zod.computed.pattern=r}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),An=M("$ZodCheckStartsWith",(e,t)=>{oe.init(e,t);const r=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{n._zod.computed.pattern=r}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Tn=M("$ZodCheckEndsWith",(e,t)=>{oe.init(e,t);const r=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{n._zod.computed.pattern=new RegExp(`.*${ke(t.suffix)}$`)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function $i(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues))}const On=M("$ZodCheckProperty",(e,t)=>{oe.init(e,t),e._zod.check=r=>{const n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(g=>$i(g,r,t.property));$i(n,r,t.property)}}),In=M("$ZodCheckMimeType",(e,t)=>{oe.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.computed.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,path:["type"],inst:e})}}),Bn=M("$ZodCheckOverwrite",(e,t)=>{oe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Pn{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
11
|
+
`).filter(C=>C),g=Math.min(...n.map(C=>C.length-C.trimStart().length)),E=n.map(C=>C.slice(g)).map(C=>" ".repeat(this.indent*2)+C);for(const C of E)this.content.push(C)}compile(){const t=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(g=>` ${g}`)];return new Function(...t,n.join(`
|
|
12
|
+
`))}}const Mn={major:0,minor:11,patch:6},cl=Symbol("out"),hl=Symbol("in"),X=M("$ZodType",(e,t)=>{var g;var r;e??(e={}),e._zod.id=t.type+"_"+ir(10),e._zod.def=t,e._zod.computed=e._zod.computed||{},e._zod.version=Mn;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const E of n)for(const C of E._zod.onattach)C(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(g=e._zod.deferred)==null||g.push(()=>{e._zod.run=e._zod.parse});else{const E=(C,s,h)=>{let l=Ie(C),d;for(const u of s){if(u._zod.when){if(!u._zod.when(C))continue}else if(l)continue;const _=C.issues.length,m=u._zod.check(C);if(m instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Pe;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,C.issues.length!==_&&(l||(l=Ie(C,_)))});else{if(C.issues.length===_)continue;l||(l=Ie(C,_))}}return d?d.then(()=>C):C};e._zod.run=(C,s)=>{const h=e._zod.parse(C,s);if(h instanceof Promise){if(s.async===!1)throw new Pe;return h.then(l=>E(l,n,s))}return E(h,n,s)}}e["~standard"]={validate:E=>{const C=e._zod.run({value:E,issues:[]},{});return C instanceof Promise?C.then(({issues:s,value:h})=>s.length===0?{value:h}:{issues:s.map(l=>le(l,{},ae()))}):C.issues.length===0?{value:C.value}:{issues:C.issues.map(s=>le(s,{},ae()))}},vendor:"zod",version:1}}),Ct=M("$ZodString",(e,t)=>{var r;X.init(e,t),e._zod.pattern=((r=e==null?void 0:e._zod.computed)==null?void 0:r.pattern)??on(e._zod.computed),e._zod.parse=(n,g)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),te=M("$ZodStringFormat",(e,t)=>{Qe.init(e,t),Ct.init(e,t)}),$n=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zs),te.init(e,t)}),zn=M("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=$e(n))}else t.pattern??(t.pattern=$e());te.init(e,t)}),Hn=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qs),te.init(e,t)}),Fn=M("$ZodURL",(e,t)=>{te.init(e,t),e._zod.check=r=>{try{const n=new URL(r.value);if(Vt.lastIndex=0,!Vt.test(n.hostname))throw new Error;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e})}}}),Nn=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vs()),te.init(e,t)}),jn=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Us),te.init(e,t)}),Un=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zs),te.init(e,t)}),Wn=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hs),te.init(e,t)}),Zn=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Fs),te.init(e,t)}),qn=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ns),te.init(e,t)}),Kn=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=js),te.init(e,t)}),Vn=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nn(t)),te.init(e,t)}),Gn=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tn),te.init(e,t)}),Jn=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sn(t)),te.init(e,t)}),Yn=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ws),te.init(e,t)}),Xn=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ar),te.init(e,t),e._zod.onattach.push(r=>{r._zod.computed.format="ipv4"})}),Qn=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cr),te.init(e,t),e._zod.onattach.push(r=>{r._zod.computed.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e})}}}),eo=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gs),te.init(e,t)}),to=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Js),te.init(e,t),e._zod.check=r=>{const[n,g]=r.value.split("/");try{if(!g)throw new Error;const E=Number(g);if(`${E}`!==g)throw new Error;if(E<0||E>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e})}}}),ro=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ys),te.init(e,t),e._zod.onattach.push(r=>{r._zod.computed.contentEncoding="base64"})}),io=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xs),te.init(e,t),e._zod.onattach.push(r=>{r._zod.computed.contentEncoding="base64url"})}),so=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Qs),te.init(e,t)});function no(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r,g=JSON.parse(atob(n));return!("typ"in g&&(g==null?void 0:g.typ)!=="JWT"||t&&(!("alg"in g)||g.alg!==t))}catch{return!1}}const oo=M("$ZodJWT",(e,t)=>{te.init(e,t),e._zod.check=r=>{no(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e})}}),ur=M("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.computed.pattern??hn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const g=r.value;if(typeof g=="number"&&!Number.isNaN(g)&&Number.isFinite(g))return r;const E=typeof g=="number"?Number.isNaN(g)?"NaN":Number.isFinite(g)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:g,inst:e,...E?{received:E}:{}}),r}}),ao=M("$ZodNumber",(e,t)=>{vn.init(e,t),ur.init(e,t)}),dr=M("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=ln,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const g=r.value;return typeof g=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:g,inst:e}),r}}),fr=M("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=an,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}const{value:g}=r;return typeof g=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:g,inst:e}),r}}),co=M("$ZodBigInt",(e,t)=>{bn.init(e,t),fr.init(e,t)}),ho=M("$ZodSymbol",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const{value:g}=r;return typeof g=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:g,inst:e}),r}}),lo=M("$ZodUndefined",(e,t)=>{X.init(e,t),e._zod.pattern=dn,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{const{value:g}=r;return typeof g>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:g,inst:e}),r}}),uo=M("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=un,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const{value:g}=r;return g===null||r.issues.push({expected:"null",code:"invalid_type",input:g,inst:e}),r}}),fo=M("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),_r=M("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),_o=M("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),po=M("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const{value:g}=r;return typeof g>"u"||r.issues.push({expected:"void",code:"invalid_type",input:g,inst:e}),r}}),mo=M("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const g=r.value,E=g instanceof Date;return E&&!Number.isNaN(g.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:g,...E?{received:"Invalid Date"}:{},inst:e}),r}});function zi(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}const go=M("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=r.value;if(!Array.isArray(g))return r.issues.push({expected:"array",code:"invalid_type",input:g,inst:e}),r;r.value=Array(g.length);const E=[];for(let C=0;C<g.length;C++){const s=g[C],h=t.element._zod.run({value:s,issues:[]},n);h instanceof Promise?E.push(h.then(l=>zi(l,r,C))):zi(h,r,C)}return E.length?Promise.all(E).then(()=>r):r}});function ot(e,t,r){e.issues.length?t.issues.push(...fe(r,e.issues)):t.value[r]=e.value}function Hi(e,t,r,n){e.issues.length?n[r]===void 0?r in n&&(t.value[r]=void 0):t.issues.push(...fe(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}const vo=M("$ZodObject",(e,t)=>{X.init(e,t);const r=rr(()=>{const l=Object.keys(t.shape),d=Es(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});Ee(e._zod,"disc",()=>{const l=t.shape,d=new Map;let u=!1;for(const _ in l){const m=l[_]._zod;if(m.values||m.disc){u=!0;const b={values:new Set(m.values??[]),maps:m.disc?[m.disc]:[]};d.set(_,b)}}if(u)return d});const n=l=>{const d=new Pn(["shape","payload","ctx"]),{keys:u,optionalKeys:_}=r.value,m=o=>{const c=Oe(o);return`shape[${c}]._zod.run({ value: input[${c}], issues: [] }, ctx)`};d.write("const input = payload.value;");const b={};for(const o of u)b[o]=ir(15);for(const o of u){if(_.has(o))continue;const c=b[o];d.write(`const ${c} = ${m(o)};`),d.write(`
|
|
13
13
|
if (${c}.issues.length) payload.issues = payload.issues.concat(${c}.issues.map(iss => ({
|
|
14
14
|
...iss,
|
|
15
|
-
path: iss.path ? [${
|
|
16
|
-
})));`)}d.write("payload.value = {"),d.indented(()=>{for(const o of u){if(
|
|
15
|
+
path: iss.path ? [${Oe(o)}, ...iss.path] : [${Oe(o)}]
|
|
16
|
+
})));`)}d.write("payload.value = {"),d.indented(()=>{for(const o of u){if(_.has(o))continue;const c=b[o];d.write(` ${Oe(o)}: ${c}.value,`)}}),d.write("}");for(const o of u){if(!_.has(o))continue;const c=b[o];d.write(`const ${c} = ${m(o)};`);const i=Oe(o);d.write(`
|
|
17
17
|
if (${c}.issues.length) {
|
|
18
18
|
if (input[${i}] === undefined) {
|
|
19
19
|
if (${i} in input) {
|
|
@@ -32,6 +32,6 @@ WARNING: This link could potentially be dangerous`)){const c=window.open();if(c)
|
|
|
32
32
|
} else {
|
|
33
33
|
payload.value[${i}] = ${c}.value;
|
|
34
34
|
}
|
|
35
|
-
`)}d.write("return payload;");const m=d.compile();return(o,c)=>m(l,o,c)};let _;const E=Hs.value,C=br,{catchall:n}=t;let h;e._zod.parse=(l,d)=>{h??(h=r.value);const u=l.value;if(!C(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;const p=[];if(E&&(d==null?void 0:d.async)===!1&&d.noPrecompilation!==!0)_||(_=s(t.shape)),l=_(l,d);else{l.value={};const{keys:c,shape:i,optionalKeys:a}=h;for(const f of c){const b=i[f]._zod.run({value:u[f],issues:[]},d),w=a.has(f);b instanceof Promise?p.push(b.then(v=>w?rs(v,l,f,u):vt(v,l,f))):w?rs(b,l,f,u):vt(b,l,f)}}if(!n)return p.length?Promise.all(p).then(()=>l):l;const g=[],S=h.keySet,m=n._zod,o=m.def.type;for(const c of Object.keys(u)){if(S.has(c))continue;if(o==="never"){g.push(c);continue}const i=m.run({value:u[c],issues:[]},d);i instanceof Promise?p.push(i.then(a=>vt(a,l,c))):vt(i,l,c)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:u,inst:e}),p.length?Promise.all(p).then(()=>l):l}}),lr=M("$ZodInterface",(e,t)=>{zt.init(e,t)}),Lo=M("$ZodObject",(e,t)=>{zt.init(e,t)});function vl(e,t,r,s){for(const _ of e)if(_.issues.length===0)return t.value=_.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(_=>_.issues.map(E=>le(E,s,ae())))}),t}const Tr=M("$ZodUnion",(e,t)=>{X.init(e,t);const r=new Set;if(t.options.every(s=>s._zod.values)){for(const s of t.options)for(const _ of s._zod.values)r.add(_);e._zod.values=r}if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(_=>_._zod.pattern);e._zod.pattern=new RegExp(`^(${s.map(_=>Lt(_.source)).join("|")})$`)}e._zod.parse=(s,_)=>{const E=[];for(const C of t.options){const n=C._zod.run({value:s.value,issues:[]},_);if(n instanceof Promise)E.push(n);else{if(n.issues.length===0)return n;E.push(n)}}return vl(E,s,e,_)}});function Ao(e,t){let r=!0;for(const[s,_]of t){const E=e==null?void 0:e[s];if(_.values.size&&!_.values.has(E)&&(r=!1),_.maps.length>0)for(const C of _.maps)Ao(E,C)||(r=!1)}return r}const To=M("$ZodDiscriminatedUnion",(e,t)=>{Tr.init(e,t);const r=e._zod.parse,s=new Map;for(const E of t.options){if(!E._zod.disc)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(E)}"`);for(const[C,n]of E._zod.disc){s.has(C)||s.set(C,{values:new Set,maps:[]});const h=s.get(C);for(const l of n.values)h.values.add(l);for(const l of n.maps)h.maps.push(l)}}e._zod.disc=s;const _=new Map;for(const E of t.options){const C=E._zod.disc;if(!C)throw new Error(`Invalid disciminated union element: ${E._zod.def.type}`);_.set(E,C)}e._zod.parse=(E,C)=>{const n=E.value;if(!br(n))return E.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),E;const h=[];for(const l of t.options)_.has(l)?Ao(n,_.get(l))&&h.push(l):h.push(l);return h.length===1?h[0]._zod.run(E,C):t.unionFallback?r(E,C):(E.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:n,inst:e}),E)}}),Oo=M("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const{value:_}=r,E=t.left._zod.run({value:_,issues:[]},s),C=t.right._zod.run({value:_,issues:[]},s);return E instanceof Promise||C instanceof Promise?Promise.all([E,C]).then(([h,l])=>is(r,h,l)):is(r,E,C)}});function ur(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wt(e)&&wt(t)){const r=Object.keys(t),s=Object.keys(e).filter(E=>r.indexOf(E)!==-1),_={...e,...t};for(const E of s){const C=ur(e[E],t[E]);if(!C.valid)return{valid:!1,mergeErrorPath:[E,...C.mergeErrorPath]};_[E]=C.data}return{valid:!0,data:_}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;s<e.length;s++){const _=e[s],E=t[s],C=ur(_,E);if(!C.valid)return{valid:!1,mergeErrorPath:[s,...C.mergeErrorPath]};r.push(C.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function is(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ze(e))return e;const s=ur(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Ht=M("$ZodTuple",(e,t)=>{X.init(e,t);const r=t.items,s=r.length-[...r].reverse().findIndex(_=>_._zod.qout!=="true");e._zod.parse=(_,E)=>{const C=_.value;if(!Array.isArray(C))return _.issues.push({input:C,inst:e,expected:"tuple",code:"invalid_type"}),_;_.value=[];const n=[];if(!t.rest){const l=C.length>r.length,d=C.length<s-1;if(l||d)return _.issues.push({input:C,inst:e,origin:"array",...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),_}let h=-1;for(const l of r){if(h++,h>=C.length&&h>=s)continue;const d=l._zod.run({value:C[h],issues:[]},E);d instanceof Promise?n.push(d.then(u=>bt(u,_,h))):bt(d,_,h)}if(t.rest){const l=C.slice(r.length);for(const d of l){h++;const u=t.rest._zod.run({value:d,issues:[]},E);u instanceof Promise?n.push(u.then(p=>bt(p,_,h))):bt(u,_,h)}}return n.length?Promise.all(n).then(()=>_):_}});function bt(e,t,r){e.issues.length?t.issues.push(...fe(r,e.issues)):t.value[r]=e.value}const Io=M("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=r.value;if(!wt(_))return r.issues.push({expected:"record",code:"invalid_type",input:_,inst:e}),r;const E=[];if(t.keyType._zod.values){const C=t.keyType._zod.values;r.value={};for(const h of C)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){const l=t.valueType._zod.run({value:_[h],issues:[]},s);l instanceof Promise?E.push(l.then(d=>{d.issues.length&&r.issues.push(...fe(h,d.issues)),r.value[h]=d.value})):(l.issues.length&&r.issues.push(...fe(h,l.issues)),r.value[h]=l.value)}let n;for(const h in _)C.has(h)||(n=n??[],n.push(h));n&&n.length>0&&r.issues.push({code:"unrecognized_keys",input:_,inst:e,keys:n})}else{r.value={};for(const C of Reflect.ownKeys(_)){if(C==="__proto__")continue;const n=t.keyType._zod.run({value:C,issues:[]},s);if(n instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(n.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:n.issues.map(l=>le(l,s,ae())),input:C,path:[C],inst:e});continue}const h=t.valueType._zod.run({value:_[C],issues:[]},s);h instanceof Promise?E.push(h.then(l=>{l.issues.length?r.issues.push(...fe(C,l.issues)):r.value[n.value]=l.value})):h.issues.length?r.issues.push(...fe(C,h.issues)):r.value[n.value]=h.value}}return E.length?Promise.all(E).then(()=>r):r}}),Bo=M("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=r.value;if(!(_ instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:_,inst:e}),r;const E=[];r.value=new Map;for(const[C,n]of _){const h=t.keyType._zod.run({value:C,issues:[]},s),l=t.valueType._zod.run({value:n,issues:[]},s);h instanceof Promise||l instanceof Promise?E.push(Promise.all([h,l]).then(([d,u])=>{ss(d,u,r,C,_,e,s)})):ss(h,l,r,C,_,e,s)}return E.length?Promise.all(E).then(()=>r):r}});function ss(e,t,r,s,_,E,C){e.issues.length&&(Ct.has(typeof s)?r.issues.push(...fe(s,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:_,inst:E,issues:e.issues.map(n=>le(n,C,ae()))})),t.issues.length?Ct.has(typeof s)?r.issues.push(...fe(s,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:_,inst:E,key:s,issues:t.issues.map(n=>le(n,C,ae()))}):r.value.set(e.value,t.value)}const Po=M("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=r.value;if(!(_ instanceof Set))return r.issues.push({input:_,inst:e,expected:"set",code:"invalid_type"}),r;const E=[];r.value=new Set;for(const C of _){const n=t.valueType._zod.run({value:C,issues:[]},s);n instanceof Promise?E.push(n.then(h=>ns(h,r))):ns(n,r)}return E.length?Promise.all(E).then(()=>r):r}});function ns(e,t){e.issues.length?t.issues.push(...e.issues):t.value.add(e.value)}const Mo=M("$ZodEnum",(e,t)=>{X.init(e,t);const r=Object.entries(t.entries).filter(([s,_])=>typeof t.entries[t.entries[s]]!="number").map(([s,_])=>_);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(s=>Ct.has(typeof s)).map(s=>typeof s=="string"?De(s):s.toString()).join("|")})$`),e._zod.parse=(s,_)=>{const E=s.value;return e._zod.values.has(E)||s.issues.push({code:"invalid_value",values:r,input:E,inst:e}),s}}),$o=M("$ZodLiteral",(e,t)=>{X.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?De(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const _=r.value;return e._zod.values.has(_)||r.issues.push({code:"invalid_value",values:t.values,input:_,inst:e}),r}}),zo=M("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=r.value;return _ instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:_,inst:e}),r}}),Ho=M("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=t.transform(r.value,r);if(s.async)return(_ instanceof Promise?_:Promise.resolve(_)).then(C=>(r.value=C,r));if(_ instanceof Promise)throw new Fe;return r.value=_,r}}),Fo=M("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.qout="true",t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values,void 0]));const r=t.innerType._zod.pattern;r&&(e._zod.pattern=new RegExp(`^(${Lt(r.source)})?$`)),e._zod.parse=(s,_)=>s.value===void 0?s:t.innerType._zod.run(s,_)}),No=M("$ZodNullable",(e,t)=>{X.init(e,t),e._zod.qin=t.innerType._zod.qin,e._zod.qout=t.innerType._zod.qout;const r=t.innerType._zod.pattern;r&&(e._zod.pattern=new RegExp(`^(${Lt(r.source)}|null)$`)),t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values,null])),e._zod.parse=(s,_)=>s.value===null?s:t.innerType._zod.run(s,_)}),jo=M("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.values=t.innerType._zod.values,e._zod.parse=(r,s)=>{if(r.value===void 0)return r.value=t.defaultValue(),r;const _=t.innerType._zod.run(r,s);return _ instanceof Promise?_.then(E=>os(E,t)):os(_,t)}});function os(e,t){return e.value===void 0&&(e.value=t.defaultValue()),e}const Wo=M("$ZodNonOptional",(e,t)=>{X.init(e,t),t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values].filter(r=>r!==void 0))),e._zod.parse=(r,s)=>{const _=t.innerType._zod.run(r,s);return _ instanceof Promise?_.then(E=>as(E,e)):as(_,e)}});function as(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Uo=M("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>{const _=t.innerType._zod.run(r,s);return _ instanceof Promise?_.then(E=>(r.value=E.issues.length===0,r)):(r.value=_.issues.length===0,r)}}),Zo=M("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.qout=t.innerType._zod.qout,e._zod.values=t.innerType._zod.values,e._zod.parse=(r,s)=>{const _=t.innerType._zod.run(r,s);return _ instanceof Promise?_.then(E=>(E.issues.length?(r.value=t.catchValue({...r,error:{issues:E.issues.map(C=>le(C,s,ae()))},input:r.value}),r.issues=[]):r.value=E.value,r)):(_.issues.length?(r.value=t.catchValue({...r,error:{issues:_.issues.map(E=>le(E,s,ae()))},input:r.value}),r.issues=[]):r.value=_.value,r)}}),qo=M("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Or=M("$ZodPipe",(e,t)=>{X.init(e,t),e._zod.values=t.in._zod.values,e._zod.parse=(r,s)=>{const _=t.in._zod.run(r,s);return _ instanceof Promise?_.then(E=>cs(E,t,s)):cs(_,t,s)}});function cs(e,t,r){return ze(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const Ko=M("$ZodReadonly",(e,t)=>{X.init(e,t),ye(e._zod,"disc",()=>t.innerType._zod.disc),e._zod.qout=t.innerType._zod.qout,e._zod.parse=(r,s)=>{const _=t.innerType._zod.run(r,s);return _ instanceof Promise?_.then(hs):hs(_)}});function hs(e){return e.value=Object.freeze(e.value),e}const Vo=M("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);const r=[];for(const s of t.parts)if(s instanceof X){if(!s._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...s._zod.traits].shift()}`);const _=s._zod.pattern instanceof RegExp?s._zod.pattern.source:s._zod.pattern;if(!_)throw new Error(`Invalid template literal part: ${s._zod.traits}`);const E=_.startsWith("^")?1:0,C=_.endsWith("$")?_.length-1:_.length;r.push(_.slice(E,C))}else if(s===null||Fs.has(typeof s))r.push(De(`${s}`));else throw new Error(`Invalid template literal part: ${s}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(s,_)=>typeof s.value!="string"?(s.issues.push({input:s.value,inst:e,expected:"template_literal",code:"invalid_type"}),s):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(s.value)||s.issues.push({input:s.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),s)}),Go=M("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,s)=>Promise.resolve(r.value).then(_=>t.innerType._zod.run({value:_,issues:[]},s))}),Jo=M("$ZodLazy",(e,t)=>{X.init(e,t),ye(e._zod,"_getter",t.getter),ye(e._zod,"pattern",()=>e._zod._getter._zod.pattern),ye(e._zod,"disc",()=>e._zod._getter._zod.disc),e._zod.parse=(r,s)=>e._zod._getter._zod.run(r,s),ye(e._zod,"qin",()=>e._zod._getter._zod.qin),ye(e._zod,"qout",()=>e._zod._getter._zod.qout)}),Yo=M("$ZodCustom",(e,t)=>{oe.init(e,t),X.init(e,t),e._zod.parse=(r,s)=>r,e._zod.check=r=>{const s=r.value,_=t.fn(s);if(_ instanceof Promise)return _.then(E=>ls(E,r,s,e));ls(_,r,s,e)}});function ls(e,t,r,s){if(!e){const _={code:"custom",input:r,inst:s,path:s._zod.def.path,continue:!s._zod.def.abort};s._zod.def.params&&(_.params=s._zod.def.params),t.issues.push(Ne(_))}}const bl={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function us(e){return bl[e]??null}const Sl=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},yl={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},wl=e=>{switch(e.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${Sl(e.input)}`;case"invalid_value":return e.values.length===1?`Yanlış dəyər: gözlənilən ${ot(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Te(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=us(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??"dəyər"} ${t}${e.maximum.toString()} ${r.unit??"element"}`:`Çox böyük: gözlənilən ${e.origin??"dəyər"} ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=us(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${t}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format==="ends_with"?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format==="includes"?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format==="regex"?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${yl[t.format]??e.format}`}case"not_multiple_of":return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${e.keys.length>1?"lar":""}: ${Te(e.keys,", ")}`;case"invalid_key":return`${e.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${e.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}};function Cl(){return{localeError:wl}}const El={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function ds(e){return El[e]??null}const kl=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},xl={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Dl=e=>{switch(e.code){case"invalid_type":return`Invalid input: expected ${e.expected}, received ${kl(e.input)}`;case"invalid_value":return e.values.length===1?`Invalid input: expected ${ot(e.values[0])}`:`Invalid option: expected one of ${Te(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=ds(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${t}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=ds(e.origin);return r?`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Invalid string: must start with "${t.prefix}"`:t.format==="ends_with"?`Invalid string: must end with "${t.suffix}"`:t.format==="includes"?`Invalid string: must include "${t.includes}"`:t.format==="regex"?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${xl[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Te(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`;default:return"Invalid input"}};function Xo(){return{localeError:Dl}}const Rl={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function fs(e){return Rl[e]??null}const Ll=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":{if(Array.isArray(e))return"arreglo";if(e===null)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}}return t},Al={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},Tl=e=>{switch(e.code){case"invalid_type":return`Entrada inválida: se esperaba ${e.expected}, recibido ${Ll(e.input)}`;case"invalid_value":return e.values.length===1?`Entrada inválida: se esperaba ${ot(e.values[0])}`:`Opción inválida: se esperaba una de ${Te(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=fs(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??"valor"} tuviera ${t}${e.maximum.toString()} ${r.unit??"elementos"}`:`Demasiado grande: se esperaba que ${e.origin??"valor"} fuera ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=fs(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${t}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format==="ends_with"?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format==="includes"?`Cadena inválida: debe incluir "${t.includes}"`:t.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${Al[t.format]??e.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${e.divisor}`;case"unrecognized_keys":return`Llave${e.keys.length>1?"s":""} desconocida${e.keys.length>1?"s":""}: ${Te(e.keys,", ")}`;case"invalid_key":return`Llave inválida en ${e.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${e.origin}`;default:return"Entrada inválida"}};function Ol(){return{localeError:Tl}}const Qo=Object.freeze(Object.defineProperty({__proto__:null,az:Cl,en:Xo,es:Ol},Symbol.toStringTag,{value:"Module"})),ea=Symbol("ZodOutput"),ta=Symbol("ZodInput");class Ir{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const s=r[0];if(this._map.set(t,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){return this._map.get(t)}has(t){return this._map.has(t)}}function Br(){return new Ir}const xe=Br();function ra(e,t){return new e({type:"string",...$(t)})}function ia(e,t){return new e({type:"string",coerce:!0,...$(t)})}function Pr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function Et(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Mr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function $r(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function zr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function Hr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function Fr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function Nr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function jr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Wr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Ur(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Zr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function qr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function Kr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Vr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Gr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function Jr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function Yr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function Xr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function Qr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function ei(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function ti(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function sa(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function na(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function oa(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function aa(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function ca(e,t){return new e({type:"number",checks:[],...$(t)})}function ha(e,t){return new e({type:"number",coerce:!0,checks:[],...$(t)})}function la(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function ua(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...$(t)})}function da(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...$(t)})}function fa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...$(t)})}function _a(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...$(t)})}function pa(e,t){return new e({type:"boolean",...$(t)})}function ma(e,t){return new e({type:"boolean",coerce:!0,...$(t)})}function ga(e,t){return new e({type:"bigint",...$(t)})}function va(e,t){return new e({type:"bigint",coerce:!0,...$(t)})}function ba(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...$(t)})}function Sa(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...$(t)})}function ya(e,t){return new e({type:"symbol",...$(t)})}function wa(e,t){return new e({type:"undefined",...$(t)})}function Ca(e,t){return new e({type:"null",...$(t)})}function Ea(e,t){return new e({type:"any",...$(t)})}function Ft(e,t){return new e({type:"unknown",...$(t)})}function Nt(e,t){return new e({type:"never",...$(t)})}function ka(e,t){return new e({type:"void",...$(t)})}function xa(e,t){return new e({type:"date",...$(t)})}function Da(e,t){return new e({type:"date",coerce:!0,...$(t)})}function Ra(e,t){return new e({type:"nan",...$(t)})}function Oe(e,t){return new xr({check:"less_than",...$(t),value:e,inclusive:!1})}function _e(e,t){return new xr({check:"less_than",...$(t),value:e,inclusive:!0})}function Ie(e,t){return new Dr({check:"greater_than",...$(t),value:e,inclusive:!1})}function he(e,t){return new Dr({check:"greater_than",...$(t),value:e,inclusive:!0})}function La(e){return Ie(0,e)}function Aa(e){return Oe(0,e)}function Ta(e){return _e(0,e)}function Oa(e){return he(0,e)}function it(e,t){return new Ln({check:"multiple_of",...$(t),value:e})}function jt(e,t){return new On({check:"max_size",...$(t),maximum:e})}function st(e,t){return new In({check:"min_size",...$(t),minimum:e})}function ri(e,t){return new Bn({check:"size_equals",...$(t),size:e})}function Wt(e,t){return new Pn({check:"max_length",...$(t),maximum:e})}function We(e,t){return new Mn({check:"min_length",...$(t),minimum:e})}function Ut(e,t){return new $n({check:"length_equals",...$(t),length:e})}function ii(e,t){return new zn({check:"string_format",format:"regex",...$(t),pattern:e})}function si(e){return new Hn({check:"string_format",format:"lowercase",...$(e)})}function ni(e){return new Fn({check:"string_format",format:"uppercase",...$(e)})}function oi(e,t){return new Nn({check:"string_format",format:"includes",...$(t),includes:e})}function ai(e,t){return new jn({check:"string_format",format:"starts_with",...$(t),prefix:e})}function ci(e,t){return new Wn({check:"string_format",format:"ends_with",...$(t),suffix:e})}function Ia(e,t,r){return new Un({check:"property",property:e,schema:t,...$(r)})}function hi(e,t){return new Zn({check:"mime_type",mime:e,...$(t)})}function Me(e){return new qn({check:"overwrite",tx:e})}function li(e){return Me(t=>t.normalize(e))}function ui(){return Me(e=>e.trim())}function di(){return Me(e=>e.toLowerCase())}function fi(){return Me(e=>e.toUpperCase())}function Ba(e,t,r){return new e({type:"array",element:t,...$(r)})}function Il(e,t,r){const s=Ce(()=>Re(t)),_={type:"interface",get shape(){const E=s.value.shape;return ve(this,"shape",E),E},get optional(){return s.value.optional},...$(r)};return new e(_)}function Bl(e,t,r){const s=Ce(()=>Re(t)),_={type:"interface",get shape(){const E=s.value.shape;return ve(this,"shape",E),E},get optional(){return s.value.optional},catchall:Nt($t),...$(r)};return new e(_)}function Pl(e,t,r){const s=Ce(()=>Re(t)),_={type:"interface",get optional(){return s.value.optional},get shape(){const E=s.value.shape;return ve(this,"shape",E),E},catchall:Ft(ct),...$(r)};return new e(_)}function Ml(e,t,r){const s={type:"object",shape:t??{},get optional(){return Pe(t??{})},...$(r)};return new e(s)}function $l(e,t,r){return new e({type:"object",shape:t,get optional(){return Pe(t)},catchall:Nt($t),...$(r)})}function zl(e,t,r){return new e({type:"object",shape:t,get optional(){return Pe(t)},catchall:Ft(ct),...$(r)})}function Hl(e,t,r){return new e({type:"union",options:t,...$(r)})}function Fl(e,t,r){return new e({type:"union",options:t,...$(r)})}function Nl(e,t,r,s){return new e({type:"intersection",left:t,right:r,...$(s)})}function Pa(e,t,r,s){const _=r instanceof X,E=_?s:r,C=_?r:null;return new e({type:"tuple",items:t,rest:C,...$(E)})}function jl(e,t,r,s){return new e({type:"record",keyType:t,valueType:r,...$(s)})}function Wl(e,t,r,s){return new e({type:"map",keyType:t,valueType:r,...$(s)})}function Ul(e,t,r){return new e({type:"set",valueType:t,...$(r)})}function Zl(e,t,r){const s=Array.isArray(t)?Object.fromEntries(t.map(_=>[_,_])):t;return new e({type:"enum",entries:s,...$(r)})}function ql(e,t,r){return new e({type:"enum",entries:t,...$(r)})}function Kl(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...$(r)})}function Ma(e,t){return new e({type:"file",...$(t)})}function Vl(e,t,r){return new e({type:"transform",transform:t,...$(r)})}function Gl(e,t,r){return new e({type:"optional",innerType:t,...$(r)})}function Jl(e,t,r){return new e({type:"nullable",innerType:t,...$(r)})}function Yl(e,t,r,s){return new e({type:"default",defaultValue:typeof r=="function"?r:()=>r,innerType:t,...$(s)})}function Xl(e,t,r){return new e({type:"nonoptional",innerType:t,...$(r)})}function Ql(e,t,r){return new e({type:"success",innerType:t,...$(r)})}function eu(e,t,r,s){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r,...$(s)})}function tu(e,t,r,s){return new e({type:"pipe",in:t,out:r,...$(s)})}function ru(e,t,r){return new e({type:"readonly",innerType:t,...$(r)})}function iu(e,t,r){return new e({type:"template_literal",parts:t,...$(r)})}function su(e,t,r){return new e({type:"lazy",getter:t,...$(r)})}function nu(e,t,r){return new e({type:"promise",innerType:t,...$(r)})}function Zt(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function ou(e,t,r={}){return Zt(e,t,r)}function $a(e,t){const r=$(t),s=new Set((r==null?void 0:r.truthy)??["true","1","yes","on","y","enabled"]),_=new Set((r==null?void 0:r.falsy)??["false","0","no","off","n","disabled"]),E=e.Pipe??Or,C=e.Boolean??Lr,n=e.Unknown??ct,h=new n({type:"unknown",checks:[{_zod:{check:l=>{if(typeof l.value=="string"){let d=l.value;(r==null?void 0:r.case)!=="sensitive"&&(d=d.toLowerCase()),s.has(d)?l.value=!0:_.has(d)?l.value=!1:l.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,..._],input:l.value,inst:h})}else l.issues.push({code:"invalid_type",expected:"string",input:l.value})},def:{check:"custom"},onattach:[]}}]});return new E({type:"pipe",in:h,out:new C({type:"boolean"})})}class He{constructor(t){this._def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");return(...r)=>{const s=this._def.input?ar(this._def.input,r):r;if(!Array.isArray(s))throw new Error("Invalid arguments schema: not an array or tuple schema.");const _=t(...s);return this._def.output?ar(this._def.output,_):_}}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");return async(...r)=>{const s=this._def.input?await cr(this._def.input,r):r;if(!Array.isArray(s))throw new Error("Invalid arguments schema: not an array or tuple schema.");const _=await t(...s);return this._def.output?cr(this._def.output,_):_}}input(...t){return Array.isArray(t[0])?new He({type:"function",input:new Ht({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new He({type:"function",input:t[0],output:this._def.output})}output(t){return new He({type:"function",input:this._def.input,output:t})}}function za(e){return new He({type:"function",input:Array.isArray(e==null?void 0:e.input)?Pa(Ht,e==null?void 0:e.input):(e==null?void 0:e.input)??null,output:(e==null?void 0:e.output)??null})}const au={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"};class dr{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??xe,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){const s=t._zod.def,_=this.seen.get(t);if(_)return _.count++,r.schemaPath.includes(t)&&(_.cycle=r.path),_.count++,_.schema;const E={schema:{},count:1,cycle:void 0};this.seen.set(t,E),t._zod.toJSONSchema&&(E.schema=t._zod.toJSONSchema());const C={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.parent)E.schema._ref=this.process(t._zod.parent,C);else{const l=E.schema;switch(s.type){case"string":{const d=l;d.type="string";const{minimum:u,maximum:p,format:g,pattern:S,contentEncoding:m}=t._zod.computed;u&&(d.minLength=u),p&&(d.maxLength=p),g&&(d.format=au[g]??g),S&&(d.pattern=S.source),m&&(d.contentEncoding=m);break}case"number":{const d=l,{minimum:u,maximum:p,format:g,multipleOf:S,inclusive:m}=t._zod.computed;g!=null&&g.includes("int")?d.type="integer":d.type="number",u&&(m?d.minimum=u:d.exclusiveMinimum=u),p&&(m?d.maximum=p:d.exclusiveMaximum=p),S&&(d.multipleOf=S);break}case"boolean":{const d=l;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const d=l;d.type="null";break}case"null":{l.type="null";break}case"any":break;case"unknown":break;case"never":{l.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const d=l,{minimum:u,maximum:p}=t._zod.computed;u&&(d.minItems=u),p&&(d.maxItems=p),d.type="array",d.items=this.process(s.element,{...C,path:[...C.path,"items"]});break}case"object":case"interface":{const d=l;d.type="object",d.properties={};const u=s.shape;for(const m in u)d.properties[m]=this.process(u[m],{...C,path:[...C.path,"properties",m]});const p=new Set(Object.keys(u)),g=new Set(s.optional),S=new Set([...p].filter(m=>!g.has(m)));d.required=Array.from(S),s.catchall&&(d.additionalProperties=this.process(s.catchall,{...C,path:[...C.path,"additionalProperties"]}));break}case"union":{const d=l;d.anyOf=s.options.map((u,p)=>this.process(u,{...C,path:[...C.path,"anyOf",p]}));break}case"intersection":{const d=l;d.allOf=[this.process(s.left,{...C,path:[...C.path,"allOf",0]}),this.process(s.right,{...C,path:[...C.path,"allOf",1]})];break}case"tuple":{const d=l;d.type="array";const u=s.items.map((S,m)=>this.process(S,{...C,path:[...C.path,"prefixItems",m]}));if(this.target==="draft-2020-12"?d.prefixItems=u:d.items=u,s.rest){const S=this.process(s.rest,{...C,path:[...C.path,"items"]});this.target==="draft-2020-12"?d.items=S:d.additionalItems=S}s.rest&&(d.items=this.process(s.rest,{...C,path:[...C.path,"items"]}));const{minimum:p,maximum:g}=t._zod.computed;p&&(d.minItems=p),g&&(d.maxItems=g);break}case"record":{const d=l;d.type="object",d.propertyNames=this.process(s.keyType,{...C,path:[...C.path,"propertyNames"]}),d.additionalProperties=this.process(s.valueType,{...C,path:[...C.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const d=l;d.enum=Object.values(s.entries);break}case"literal":{const d=l,u=[];for(const p of s.values)if(p===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof p=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(p))}else u.push(p);if(u.length!==0)if(u.length===1){const p=u[0];d.const=p}else d.enum=u;break}case"file":{if(this.unrepresentable==="throw")throw new Error("File cannot be represented in JSON Schema");break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const d=this.process(s.innerType,C);l.anyOf=[d,{type:"null"}];break}case"nonoptional":{const d=this.process(s.innerType,C);Object.assign(l,d);break}case"success":{const d=l;d.type="boolean";break}case"default":{const d=this.process(s.innerType,C);Object.assign(l,d),l.default=s.defaultValue();break}case"catch":{const d=this.process(s.innerType,C);Object.assign(l,d);let u;try{u=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"pipe":{const d=this.io==="input"?s.in:s.out,u=this.process(d,C);l._ref=u;break}case"readonly":{l._ref=this.process(s.innerType,C),l.readOnly=!0;break}case"template_literal":{const d=l,u=t._zod.pattern;if(!u)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=u.source;break}case"promise":{const d=this.process(s.innerType,C);l._ref=d;break}case"optional":{l._ref=this.process(s.innerType,C);break}case"lazy":{const d=t._zod._getter,u=this.process(d,C);l._ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}const n=this.metadataRegistry.get(t);n&&Object.assign(E.schema,n);const h=this.seen.get(t);return this.override({zodSchema:t,jsonSchema:h.schema}),h.schema}emit(t,r){var l,d,u,p;const s={cycles:(r==null?void 0:r.cycles)??"ref",reused:(r==null?void 0:r.reused)??"inline",external:(r==null?void 0:r.external)??void 0},_=this.seen.get(t);if(!_)throw new Error("Unprocessed schema. This is a bug in Zod.");const E=g=>{var i;const S=this.target==="draft-2020-12"?"$defs":"definitions";if(s.external){const a=(i=s.external.registry.get(g[0]))==null?void 0:i.id;if(a)return{ref:s.external.uri(a)};const f=g[1].defId??g[1].schema.id??`schema${this.counter++}`;return g[1].defId=f,{defId:f,ref:`${s.external.uri("__shared")}#/${S}/${f}`}}if(g[1]===_)return{ref:"#"};const o=`#/${S}/`,c=g[1].schema.id??`__schema${this.counter++}`;return{defId:c,ref:o+c}},C=g=>{if(g[1].schema.$ref)return;const S=g[1],{ref:m,defId:o}=E(g);S.def={...S.schema},o&&(S.defId=o),cu(S,m)};for(const g of this.seen.entries()){const S=g[1];if(t===g[0]){C(g);continue}if(s.external){const o=(l=s.external.registry.get(g[0]))==null?void 0:l.id;if(t!==g[0]&&o){C(g);continue}}if((d=this.metadataRegistry.get(g[0]))==null?void 0:d.id){C(g);continue}if(S.cycle){if(s.cycles==="throw")throw new Error(`Cycle detected: #/${(u=S.cycle)==null?void 0:u.join("/")}/<root>
|
|
35
|
+
`)}d.write("return payload;");const p=d.compile();return(o,c)=>p(l,o,c)};let g;const E=ws.value,C=sr,{catchall:s}=t;let h;e._zod.parse=(l,d)=>{h??(h=r.value);const u=l.value;if(!C(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;const _=[];if(E&&(d==null?void 0:d.async)===!1&&d.noPrecompilation!==!0)g||(g=n(t.shape)),l=g(l,d);else{l.value={};const c=h.shape;for(const i of h.keys){const a=c[i],f=a._zod.run({value:u[i],issues:[]},d),y=a._zod.optionality==="optional";f instanceof Promise?_.push(f.then(S=>y?Hi(S,l,i,u):ot(S,l,i))):y?Hi(f,l,i,u):ot(f,l,i)}}if(!s)return _.length?Promise.all(_).then(()=>l):l;const m=[],b=h.keySet,p=s._zod,o=p.def.type;for(const c of Object.keys(u)){if(b.has(c))continue;if(o==="never"){m.push(c);continue}const i=p.run({value:u[c],issues:[]},d);i instanceof Promise?_.push(i.then(a=>ot(a,l,c))):ot(i,l,c)}return m.length&&l.issues.push({code:"unrecognized_keys",keys:m,input:u,inst:e}),_.length?Promise.all(_).then(()=>l):l}});function ll(e,t,r,n){for(const g of e)if(g.issues.length===0)return t.value=g.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(g=>g.issues.map(E=>le(E,n,ae())))}),t}const pr=M("$ZodUnion",(e,t)=>{X.init(e,t);const r=new Set;if(t.options.every(n=>n._zod.values)){for(const n of t.options)for(const g of n._zod.values)r.add(g);e._zod.values=r}if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(g=>g._zod.pattern);e._zod.pattern=new RegExp(`^(${n.map(g=>vt(g.source)).join("|")})$`)}e._zod.parse=(n,g)=>{const E=[];for(const C of t.options){const s=C._zod.run({value:n.value,issues:[]},g);if(s instanceof Promise)E.push(s);else{if(s.issues.length===0)return s;E.push(s)}}return ll(E,n,e,g)}});function bo(e,t){let r=!0;for(const[n,g]of t){const E=e==null?void 0:e[n];if(g.values.size&&!g.values.has(E)&&(r=!1),g.maps.length>0)for(const C of g.maps)bo(E,C)||(r=!1)}return r}const So=M("$ZodDiscriminatedUnion",(e,t)=>{pr.init(e,t);const r=e._zod.parse,n=new Map;for(const E of t.options){if(!E._zod.disc)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(E)}"`);for(const[C,s]of E._zod.disc){n.has(C)||n.set(C,{values:new Set,maps:[]});const h=n.get(C);for(const l of s.values)h.values.add(l);for(const l of s.maps)h.maps.push(l)}}e._zod.disc=n;const g=new Map;for(const E of t.options){const C=E._zod.disc;if(!C)throw new Error(`Invalid disciminated union element: ${E._zod.def.type}`);g.set(E,C)}e._zod.parse=(E,C)=>{const s=E.value;if(!sr(s))return E.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),E;const h=[];for(const l of t.options)g.has(l)?bo(s,g.get(l))&&h.push(l):h.push(l);return h.length===1?h[0]._zod.run(E,C):t.unionFallback?r(E,C):(E.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,inst:e}),E)}}),yo=M("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const{value:g}=r,E=t.left._zod.run({value:g,issues:[]},n),C=t.right._zod.run({value:g,issues:[]},n);return E instanceof Promise||C instanceof Promise?Promise.all([E,C]).then(([h,l])=>Fi(r,h,l)):Fi(r,E,C)}});function Gt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(lt(e)&<(t)){const r=Object.keys(t),n=Object.keys(e).filter(E=>r.indexOf(E)!==-1),g={...e,...t};for(const E of n){const C=Gt(e[E],t[E]);if(!C.valid)return{valid:!1,mergeErrorPath:[E,...C.mergeErrorPath]};g[E]=C.data}return{valid:!0,data:g}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const g=e[n],E=t[n],C=Gt(g,E);if(!C.valid)return{valid:!1,mergeErrorPath:[n,...C.mergeErrorPath]};r.push(C.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fi(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Ie(e))return e;const n=Gt(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Et=M("$ZodTuple",(e,t)=>{X.init(e,t);const r=t.items,n=r.length-[...r].reverse().findIndex(g=>g._zod.optionality!=="optional");e._zod.parse=(g,E)=>{const C=g.value;if(!Array.isArray(C))return g.issues.push({input:C,inst:e,expected:"tuple",code:"invalid_type"}),g;g.value=[];const s=[];if(!t.rest){const l=C.length>r.length,d=C.length<n-1;if(l||d)return g.issues.push({input:C,inst:e,origin:"array",...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),g}let h=-1;for(const l of r){if(h++,h>=C.length&&h>=n)continue;const d=l._zod.run({value:C[h],issues:[]},E);d instanceof Promise?s.push(d.then(u=>at(u,g,h))):at(d,g,h)}if(t.rest){const l=C.slice(r.length);for(const d of l){h++;const u=t.rest._zod.run({value:d,issues:[]},E);u instanceof Promise?s.push(u.then(_=>at(_,g,h))):at(u,g,h)}}return s.length?Promise.all(s).then(()=>g):g}});function at(e,t,r){e.issues.length?t.issues.push(...fe(r,e.issues)):t.value[r]=e.value}const wo=M("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=r.value;if(!lt(g))return r.issues.push({expected:"record",code:"invalid_type",input:g,inst:e}),r;const E=[];if(t.keyType._zod.values){const C=t.keyType._zod.values;r.value={};for(const h of C)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){const l=t.valueType._zod.run({value:g[h],issues:[]},n);l instanceof Promise?E.push(l.then(d=>{d.issues.length&&r.issues.push(...fe(h,d.issues)),r.value[h]=d.value})):(l.issues.length&&r.issues.push(...fe(h,l.issues)),r.value[h]=l.value)}let s;for(const h in g)C.has(h)||(s=s??[],s.push(h));s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:g,inst:e,keys:s})}else{r.value={};for(const C of Reflect.ownKeys(g)){if(C==="__proto__")continue;const s=t.keyType._zod.run({value:C,issues:[]},n);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(l=>le(l,n,ae())),input:C,path:[C],inst:e});continue}const h=t.valueType._zod.run({value:g[C],issues:[]},n);h instanceof Promise?E.push(h.then(l=>{l.issues.length?r.issues.push(...fe(C,l.issues)):r.value[s.value]=l.value})):h.issues.length?r.issues.push(...fe(C,h.issues)):r.value[s.value]=h.value}}return E.length?Promise.all(E).then(()=>r):r}}),Co=M("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=r.value;if(!(g instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:g,inst:e}),r;const E=[];r.value=new Map;for(const[C,s]of g){const h=t.keyType._zod.run({value:C,issues:[]},n),l=t.valueType._zod.run({value:s,issues:[]},n);h instanceof Promise||l instanceof Promise?E.push(Promise.all([h,l]).then(([d,u])=>{Ni(d,u,r,C,g,e,n)})):Ni(h,l,r,C,g,e,n)}return E.length?Promise.all(E).then(()=>r):r}});function Ni(e,t,r,n,g,E,C){e.issues.length&&(ut.has(typeof n)?r.issues.push(...fe(n,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:g,inst:E,issues:e.issues.map(s=>le(s,C,ae()))})),t.issues.length?ut.has(typeof n)?r.issues.push(...fe(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:g,inst:E,key:n,issues:t.issues.map(s=>le(s,C,ae()))}):r.value.set(e.value,t.value)}const Eo=M("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=r.value;if(!(g instanceof Set))return r.issues.push({input:g,inst:e,expected:"set",code:"invalid_type"}),r;const E=[];r.value=new Set;for(const C of g){const s=t.valueType._zod.run({value:C,issues:[]},n);s instanceof Promise?E.push(s.then(h=>ji(h,r))):ji(s,r)}return E.length?Promise.all(E).then(()=>r):r}});function ji(e,t){e.issues.length?t.issues.push(...e.issues):t.value.add(e.value)}const ko=M("$ZodEnum",(e,t)=>{X.init(e,t);const r=Object.entries(t.entries).filter(([n,g])=>typeof t.entries[t.entries[n]]!="number").map(([n,g])=>g);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>ut.has(typeof n)).map(n=>typeof n=="string"?ke(n):n.toString()).join("|")})$`),e._zod.parse=(n,g)=>{const E=n.value;return e._zod.values.has(E)||n.issues.push({code:"invalid_value",values:r,input:E,inst:e}),n}}),xo=M("$ZodLiteral",(e,t)=>{X.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ke(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const g=r.value;return e._zod.values.has(g)||r.issues.push({code:"invalid_value",values:t.values,input:g,inst:e}),r}}),Do=M("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=r.value;return g instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:g,inst:e}),r}}),Ro=M("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=t.transform(r.value,r);if(n.async)return(g instanceof Promise?g:Promise.resolve(g)).then(C=>(r.value=C,r));if(g instanceof Promise)throw new Pe;return r.value=g,r}}),Lo=M("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optionality="optional",t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values,void 0]));const r=t.innerType._zod.pattern;r&&(e._zod.pattern=new RegExp(`^(${vt(r.source)})?$`)),e._zod.parse=(n,g)=>n.value===void 0?n:t.innerType._zod.run(n,g)}),Ao=M("$ZodNullable",(e,t)=>{X.init(e,t),e._zod.optionality=t.innerType._zod.optionality;const r=t.innerType._zod.pattern;r&&(e._zod.pattern=new RegExp(`^(${vt(r.source)}|null)$`)),t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values,null])),e._zod.parse=(n,g)=>n.value===null?n:t.innerType._zod.run(n,g)}),To=M("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optionality="defaulted",e._zod.values=t.innerType._zod.values,e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue(),r;const g=t.innerType._zod.run(r,n);return g instanceof Promise?g.then(E=>Ui(E,t)):Ui(g,t)}});function Ui(e,t){return e.value===void 0&&(e.value=t.defaultValue()),e}const Oo=M("$ZodNonOptional",(e,t)=>{X.init(e,t),t.innerType._zod.values&&(e._zod.values=new Set([...t.innerType._zod.values].filter(r=>r!==void 0))),e._zod.parse=(r,n)=>{const g=t.innerType._zod.run(r,n);return g instanceof Promise?g.then(E=>Wi(E,e)):Wi(g,e)}});function Wi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Io=M("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const g=t.innerType._zod.run(r,n);return g instanceof Promise?g.then(E=>(r.value=E.issues.length===0,r)):(r.value=g.issues.length===0,r)}}),Bo=M("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.optionality=t.innerType._zod.optionality,e._zod.values=t.innerType._zod.values,e._zod.parse=(r,n)=>{const g=t.innerType._zod.run(r,n);return g instanceof Promise?g.then(E=>(E.issues.length?(r.value=t.catchValue({...r,error:{issues:E.issues.map(C=>le(C,n,ae()))},input:r.value}),r.issues=[]):r.value=E.value,r)):(g.issues.length?(r.value=t.catchValue({...r,error:{issues:g.issues.map(E=>le(E,n,ae()))},input:r.value}),r.issues=[]):r.value=g.value,r)}}),Po=M("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),mr=M("$ZodPipe",(e,t)=>{X.init(e,t),e._zod.values=t.in._zod.values,e._zod.parse=(r,n)=>{const g=t.in._zod.run(r,n);return g instanceof Promise?g.then(E=>Zi(E,t,n)):Zi(g,t,n)}});function Zi(e,t,r){return Ie(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const Mo=M("$ZodReadonly",(e,t)=>{X.init(e,t),Ee(e._zod,"disc",()=>t.innerType._zod.disc),e._zod.optionality=t.innerType._zod.optionality,e._zod.parse=(r,n)=>{const g=t.innerType._zod.run(r,n);return g instanceof Promise?g.then(qi):qi(g)}});function qi(e){return e.value=Object.freeze(e.value),e}const $o=M("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);const r=[];for(const n of t.parts)if(n instanceof X){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);const g=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!g)throw new Error(`Invalid template literal part: ${n._zod.traits}`);const E=g.startsWith("^")?1:0,C=g.endsWith("$")?g.length-1:g.length;r.push(g.slice(E,C))}else if(n===null||Cs.has(typeof n))r.push(ke(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,g)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"template_literal",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),n)}),zo=M("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(g=>t.innerType._zod.run({value:g,issues:[]},n))}),Ho=M("$ZodLazy",(e,t)=>{X.init(e,t),Ee(e._zod,"_getter",t.getter),Ee(e._zod,"pattern",()=>e._zod._getter._zod.pattern),Ee(e._zod,"disc",()=>e._zod._getter._zod.disc),Ee(e._zod,"optionality",()=>e._zod._getter._zod.optionality),e._zod.parse=(r,n)=>e._zod._getter._zod.run(r,n)}),Fo=M("$ZodCustom",(e,t)=>{oe.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,g=t.fn(n);if(g instanceof Promise)return g.then(E=>Ki(E,r,n,e));Ki(g,r,n,e)}});function Ki(e,t,r,n){if(!e){const g={code:"custom",input:r,inst:n,path:n._zod.def.path,continue:!n._zod.def.abort};n._zod.def.params&&(g.params=n._zod.def.params),t.issues.push(Me(g))}}const ul={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function Vi(e){return ul[e]??null}const dl=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},fl={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_l=e=>{switch(e.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${dl(e.input)}`;case"invalid_value":return e.values.length===1?`Yanlış dəyər: gözlənilən ${Xe(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${De(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=Vi(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??"dəyər"} ${t}${e.maximum.toString()} ${r.unit??"element"}`:`Çox böyük: gözlənilən ${e.origin??"dəyər"} ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=Vi(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${t}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format==="ends_with"?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format==="includes"?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format==="regex"?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${fl[t.format]??e.format}`}case"not_multiple_of":return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${e.keys.length>1?"lar":""}: ${De(e.keys,", ")}`;case"invalid_key":return`${e.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${e.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}};function pl(){return{localeError:_l}}const ml={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function Gi(e){return ml[e]??null}const gl=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},vl={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},bl=e=>{switch(e.code){case"invalid_type":return`Invalid input: expected ${e.expected}, received ${gl(e.input)}`;case"invalid_value":return e.values.length===1?`Invalid input: expected ${Xe(e.values[0])}`:`Invalid option: expected one of ${De(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=Gi(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${t}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=Gi(e.origin);return r?`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Invalid string: must start with "${t.prefix}"`:t.format==="ends_with"?`Invalid string: must end with "${t.suffix}"`:t.format==="includes"?`Invalid string: must include "${t.includes}"`:t.format==="regex"?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${vl[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${De(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`;default:return"Invalid input"}};function No(){return{localeError:bl}}const Sl={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function Ji(e){return Sl[e]??null}const yl=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":{if(Array.isArray(e))return"arreglo";if(e===null)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}}return t},wl={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},Cl=e=>{switch(e.code){case"invalid_type":return`Entrada inválida: se esperaba ${e.expected}, recibido ${yl(e.input)}`;case"invalid_value":return e.values.length===1?`Entrada inválida: se esperaba ${Xe(e.values[0])}`:`Opción inválida: se esperaba una de ${De(e.values,"|")}`;case"too_big":{const t=e.inclusive?"<=":"<",r=Ji(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??"valor"} tuviera ${t}${e.maximum.toString()} ${r.unit??"elementos"}`:`Demasiado grande: se esperaba que ${e.origin??"valor"} fuera ${t}${e.maximum.toString()}`}case"too_small":{const t=e.inclusive?">=":">",r=Ji(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${t}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${t}${e.minimum.toString()}`}case"invalid_format":{const t=e;return t.format==="starts_with"?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format==="ends_with"?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format==="includes"?`Cadena inválida: debe incluir "${t.includes}"`:t.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${wl[t.format]??e.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${e.divisor}`;case"unrecognized_keys":return`Llave${e.keys.length>1?"s":""} desconocida${e.keys.length>1?"s":""}: ${De(e.keys,", ")}`;case"invalid_key":return`Llave inválida en ${e.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${e.origin}`;default:return"Entrada inválida"}};function El(){return{localeError:Cl}}const jo=Object.freeze(Object.defineProperty({__proto__:null,az:pl,en:No,es:El},Symbol.toStringTag,{value:"Module"})),Uo=Symbol("ZodOutput"),Wo=Symbol("ZodInput");class gr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){return this._map.get(t)}has(t){return this._map.has(t)}}function vr(){return new gr}const Ce=vr();function Zo(e,t){return new e({type:"string",...H(t)})}function qo(e,t){return new e({type:"string",coerce:!0,...H(t)})}function br(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...H(t)})}function dt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...H(t)})}function Sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...H(t)})}function yr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(t)})}function wr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(t)})}function Cr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(t)})}function Er(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}function kr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...H(t)})}function xr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(t)})}function Dr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...H(t)})}function Rr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(t)})}function Lr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...H(t)})}function Ar(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...H(t)})}function Tr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(t)})}function Or(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(t)})}function Ir(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(t)})}function Br(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(t)})}function Pr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(t)})}function Mr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...H(t)})}function $r(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...H(t)})}function zr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...H(t)})}function Hr(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...H(t)})}function Ko(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(t)})}function Vo(e,t){return new e({type:"string",format:"date",check:"string_format",...H(t)})}function Go(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...H(t)})}function Jo(e,t){return new e({type:"string",format:"duration",check:"string_format",...H(t)})}function Yo(e,t){return new e({type:"number",checks:[],...H(t)})}function Xo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}function Qo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}function ea(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...H(t)})}function ta(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...H(t)})}function ra(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...H(t)})}function ia(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...H(t)})}function sa(e,t){return new e({type:"boolean",...H(t)})}function na(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}function oa(e,t){return new e({type:"bigint",...H(t)})}function aa(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}function ca(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(t)})}function ha(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(t)})}function la(e,t){return new e({type:"symbol",...H(t)})}function ua(e,t){return new e({type:"undefined",...H(t)})}function da(e,t){return new e({type:"null",...H(t)})}function fa(e,t){return new e({type:"any",...H(t)})}function _a(e,t){return new e({type:"unknown",...H(t)})}function pa(e,t){return new e({type:"never",...H(t)})}function ma(e,t){return new e({type:"void",...H(t)})}function ga(e,t){return new e({type:"date",...H(t)})}function va(e,t){return new e({type:"date",coerce:!0,...H(t)})}function ba(e,t){return new e({type:"nan",...H(t)})}function Re(e,t){return new hr({check:"less_than",...H(t),value:e,inclusive:!1})}function _e(e,t){return new hr({check:"less_than",...H(t),value:e,inclusive:!0})}function Le(e,t){return new lr({check:"greater_than",...H(t),value:e,inclusive:!1})}function he(e,t){return new lr({check:"greater_than",...H(t),value:e,inclusive:!0})}function Sa(e){return Le(0,e)}function ya(e){return Re(0,e)}function wa(e){return _e(0,e)}function Ca(e){return he(0,e)}function Ge(e,t){return new gn({check:"multiple_of",...H(t),value:e})}function kt(e,t){return new Sn({check:"max_size",...H(t),maximum:e})}function Je(e,t){return new yn({check:"min_size",...H(t),minimum:e})}function Fr(e,t){return new wn({check:"size_equals",...H(t),size:e})}function xt(e,t){return new Cn({check:"max_length",...H(t),maximum:e})}function ze(e,t){return new En({check:"min_length",...H(t),minimum:e})}function Dt(e,t){return new kn({check:"length_equals",...H(t),length:e})}function Nr(e,t){return new xn({check:"string_format",format:"regex",...H(t),pattern:e})}function jr(e){return new Dn({check:"string_format",format:"lowercase",...H(e)})}function Ur(e){return new Rn({check:"string_format",format:"uppercase",...H(e)})}function Wr(e,t){return new Ln({check:"string_format",format:"includes",...H(t),includes:e})}function Zr(e,t){return new An({check:"string_format",format:"starts_with",...H(t),prefix:e})}function qr(e,t){return new Tn({check:"string_format",format:"ends_with",...H(t),suffix:e})}function Ea(e,t,r){return new On({check:"property",property:e,schema:t,...H(r)})}function Kr(e,t){return new In({check:"mime_type",mime:e,...H(t)})}function Te(e){return new Bn({check:"overwrite",tx:e})}function Vr(e){return Te(t=>t.normalize(e))}function Gr(){return Te(e=>e.trim())}function Jr(){return Te(e=>e.toLowerCase())}function Yr(){return Te(e=>e.toUpperCase())}function ka(e,t,r){return new e({type:"array",element:t,...H(r)})}function kl(e,t,r){return new e({type:"union",options:t,...H(r)})}function xl(e,t,r){return new e({type:"union",options:t,...H(r)})}function Dl(e,t,r,n){return new e({type:"intersection",left:t,right:r,...H(n)})}function xa(e,t,r,n){const g=r instanceof X,E=g?n:r,C=g?r:null;return new e({type:"tuple",items:t,rest:C,...H(E)})}function Rl(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...H(n)})}function Ll(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...H(n)})}function Al(e,t,r){return new e({type:"set",valueType:t,...H(r)})}function Tl(e,t,r){const n=Array.isArray(t)?Object.fromEntries(t.map(g=>[g,g])):t;return new e({type:"enum",entries:n,...H(r)})}function Ol(e,t,r){return new e({type:"enum",entries:t,...H(r)})}function Il(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...H(r)})}function Da(e,t){return new e({type:"file",...H(t)})}function Bl(e,t,r){return new e({type:"transform",transform:t,...H(r)})}function Pl(e,t,r){return new e({type:"optional",innerType:t,...H(r)})}function Ml(e,t,r){return new e({type:"nullable",innerType:t,...H(r)})}function $l(e,t,r,n){return new e({type:"default",defaultValue:typeof r=="function"?r:()=>r,innerType:t,...H(n)})}function zl(e,t,r){return new e({type:"nonoptional",innerType:t,...H(r)})}function Hl(e,t,r){return new e({type:"success",innerType:t,...H(r)})}function Fl(e,t,r,n){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r,...H(n)})}function Nl(e,t,r,n){return new e({type:"pipe",in:t,out:r,...H(n)})}function jl(e,t,r){return new e({type:"readonly",innerType:t,...H(r)})}function Ul(e,t,r){return new e({type:"template_literal",parts:t,...H(r)})}function Wl(e,t,r){return new e({type:"lazy",getter:t,...H(r)})}function Zl(e,t,r){return new e({type:"promise",innerType:t,...H(r)})}function Rt(e,t,r){return new e({type:"custom",check:"custom",fn:t,...H(r)})}function ql(e,t,r={}){return Rt(e,t,r)}function Ra(e,t){const r=H(t),n=new Set((r==null?void 0:r.truthy)??["true","1","yes","on","y","enabled"]),g=new Set((r==null?void 0:r.falsy)??["false","0","no","off","n","disabled"]),E=e.Pipe??mr,C=e.Boolean??dr,s=e.Unknown??_r,h=new s({type:"unknown",checks:[{_zod:{check:l=>{if(typeof l.value=="string"){let d=l.value;(r==null?void 0:r.case)!=="sensitive"&&(d=d.toLowerCase()),n.has(d)?l.value=!0:g.has(d)?l.value=!1:l.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...g],input:l.value,inst:h})}else l.issues.push({code:"invalid_type",expected:"string",input:l.value})},def:{check:"custom"},onattach:[]}}]});return new E({type:"pipe",in:h,out:new C({type:"boolean"})})}class Be{constructor(t){this._def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");return(...r)=>{const n=this._def.input?qt(this._def.input,r):r;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const g=t(...n);return this._def.output?qt(this._def.output,g):g}}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");return async(...r)=>{const n=this._def.input?await Kt(this._def.input,r):r;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const g=await t(...n);return this._def.output?Kt(this._def.output,g):g}}input(...t){return Array.isArray(t[0])?new Be({type:"function",input:new Et({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new Be({type:"function",input:t[0],output:this._def.output})}output(t){return new Be({type:"function",input:this._def.input,output:t})}}function La(e){return new Be({type:"function",input:Array.isArray(e==null?void 0:e.input)?xa(Et,e==null?void 0:e.input):(e==null?void 0:e.input)??null,output:(e==null?void 0:e.output)??null})}const Kl={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"};class Jt{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??Ce,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){const n=t._zod.def,g=this.seen.get(t);if(g)return g.count++,r.schemaPath.includes(t)&&(g.cycle=r.path),g.count++,g.schema;const E={schema:{},count:1,cycle:void 0};this.seen.set(t,E),t._zod.toJSONSchema&&(E.schema=t._zod.toJSONSchema());const C={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.parent)E.schema._ref=this.process(t._zod.parent,C);else{const l=E.schema;switch(n.type){case"string":{const d=l;d.type="string";const{minimum:u,maximum:_,format:m,pattern:b,contentEncoding:p}=t._zod.computed;typeof u=="number"&&(d.minLength=u),typeof _=="number"&&(d.maxLength=_),m&&(d.format=Kl[m]??m),b&&(d.pattern=b.source),p&&(d.contentEncoding=p);break}case"number":{const d=l,{minimum:u,maximum:_,format:m,multipleOf:b,inclusive:p}=t._zod.computed;m!=null&&m.includes("int")?d.type="integer":d.type="number",typeof u=="number"&&(p?d.minimum=u:d.exclusiveMinimum=u),typeof _=="number"&&(p?d.maximum=_:d.exclusiveMaximum=_),typeof b=="number"&&(d.multipleOf=b);break}case"boolean":{const d=l;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const d=l;d.type="null";break}case"null":{l.type="null";break}case"any":break;case"unknown":break;case"never":{l.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const d=l,{minimum:u,maximum:_}=t._zod.computed;typeof u=="number"&&(d.minItems=u),typeof _=="number"&&(d.maxItems=_),d.type="array",d.items=this.process(n.element,{...C,path:[...C.path,"items"]});break}case"object":{const d=l;d.type="object",d.properties={};const u=n.shape;for(const b in u)d.properties[b]=this.process(u[b],{...C,path:[...C.path,"properties",b]});const _=new Set(Object.keys(u)),m=new Set([..._].filter(b=>{const p=n.shape[b]._zod.optionality;return this.io==="input"?p===void 0:p===void 0||p==="defaulted"}));d.required=Array.from(m),n.catchall&&(d.additionalProperties=this.process(n.catchall,{...C,path:[...C.path,"additionalProperties"]}));break}case"union":{const d=l;d.anyOf=n.options.map((u,_)=>this.process(u,{...C,path:[...C.path,"anyOf",_]}));break}case"intersection":{const d=l;d.allOf=[this.process(n.left,{...C,path:[...C.path,"allOf",0]}),this.process(n.right,{...C,path:[...C.path,"allOf",1]})];break}case"tuple":{const d=l;d.type="array";const u=n.items.map((b,p)=>this.process(b,{...C,path:[...C.path,"prefixItems",p]}));if(this.target==="draft-2020-12"?d.prefixItems=u:d.items=u,n.rest){const b=this.process(n.rest,{...C,path:[...C.path,"items"]});this.target==="draft-2020-12"?d.items=b:d.additionalItems=b}n.rest&&(d.items=this.process(n.rest,{...C,path:[...C.path,"items"]}));const{minimum:_,maximum:m}=t._zod.computed;typeof _=="number"&&(d.minItems=_),typeof m=="number"&&(d.maxItems=m);break}case"record":{const d=l;d.type="object",d.propertyNames=this.process(n.keyType,{...C,path:[...C.path,"propertyNames"]}),d.additionalProperties=this.process(n.valueType,{...C,path:[...C.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const d=l;d.enum=Object.values(n.entries);break}case"literal":{const d=l,u=[];for(const _ of n.values)if(_===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(_))}else u.push(_);if(u.length!==0)if(u.length===1){const _=u[0];d.const=_}else d.enum=u;break}case"file":{if(this.unrepresentable==="throw")throw new Error("File cannot be represented in JSON Schema");break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const d=this.process(n.innerType,C);l.anyOf=[d,{type:"null"}];break}case"nonoptional":{const d=this.process(n.innerType,C);Object.assign(l,d);break}case"success":{const d=l;d.type="boolean";break}case"default":{const d=this.process(n.innerType,C);Object.assign(l,d),l.default=n.defaultValue();break}case"catch":{const d=this.process(n.innerType,C);Object.assign(l,d);let u;try{u=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"pipe":{const d=this.io==="input"?n.in:n.out,u=this.process(d,C);l._ref=u;break}case"readonly":{l._ref=this.process(n.innerType,C),l.readOnly=!0;break}case"template_literal":{const d=l,u=t._zod.pattern;if(!u)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=u.source;break}case"promise":{const d=this.process(n.innerType,C);l._ref=d;break}case"optional":{l._ref=this.process(n.innerType,C);break}case"lazy":{const d=t._zod._getter,u=this.process(d,C);l._ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}const s=this.metadataRegistry.get(t);s&&Object.assign(E.schema,s);const h=this.seen.get(t);return this.override({zodSchema:t,jsonSchema:h.schema}),h.schema}emit(t,r){var l,d,u,_;const n={cycles:(r==null?void 0:r.cycles)??"ref",reused:(r==null?void 0:r.reused)??"inline",external:(r==null?void 0:r.external)??void 0},g=this.seen.get(t);if(!g)throw new Error("Unprocessed schema. This is a bug in Zod.");const E=m=>{var i;const b=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const a=(i=n.external.registry.get(m[0]))==null?void 0:i.id;if(a)return{ref:n.external.uri(a)};const f=m[1].defId??m[1].schema.id??`schema${this.counter++}`;return m[1].defId=f,{defId:f,ref:`${n.external.uri("__shared")}#/${b}/${f}`}}if(m[1]===g)return{ref:"#"};const o=`#/${b}/`,c=m[1].schema.id??`__schema${this.counter++}`;return{defId:c,ref:o+c}},C=m=>{if(m[1].schema.$ref)return;const b=m[1],{ref:p,defId:o}=E(m);b.def={...b.schema},o&&(b.defId=o),Vl(b,p)};for(const m of this.seen.entries()){const b=m[1];if(t===m[0]){C(m);continue}if(n.external){const o=(l=n.external.registry.get(m[0]))==null?void 0:l.id;if(t!==m[0]&&o){C(m);continue}}if((d=this.metadataRegistry.get(m[0]))==null?void 0:d.id){C(m);continue}if(b.cycle){if(n.cycles==="throw")throw new Error(`Cycle detected: #/${(u=b.cycle)==null?void 0:u.join("/")}/<root>
|
|
36
36
|
|
|
37
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);s.cycles==="ref"&&C(g);continue}if(S.count>1&&s.reused==="ref"){C(g);continue}}for(const g of this.seen.entries()){const S=g[1];fr(S.schema),S.def&&fr(S.def)}const n={..._.def},h=((p=s.external)==null?void 0:p.defs)??{};for(const g of this.seen.entries()){const S=g[1];S.def&&S.defId&&(h[S.defId]=S.def)}!s.external&&Object.keys(h).length>0&&(this.target==="draft-2020-12"?n.$defs=h:n.definitions=h);try{return JSON.parse(JSON.stringify(n))}catch{throw new Error("Error converting schema to JSON.")}}}const fr=e=>{const t={...e};e._ref&&fr(e._ref);const r=e._ref;Object.assign(e,r),Object.assign(e,t),delete e._ref};function cu(e,t){const r=e.schema;for(const s in r)delete r[s],r.$ref=t}function Ha(e,t){if(e instanceof Ir){const s=new dr(t),_={};for(const n of e._idmap.entries()){const[h,l]=n;s.process(l)}const E={},C={registry:e,uri:(t==null?void 0:t.uri)||(n=>n),defs:_};for(const n of e._idmap.entries()){const[h,l]=n;E[h]=s.emit(l,{...t,external:C})}if(Object.keys(_).length>0){const n=s.target==="draft-2020-12"?"$defs":"definitions";E.__shared={[n]:_}}return{schemas:E}}const r=new dr(t);return r.process(e),r.emit(e,t)}const hu=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lu=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:ko,$ZodArray:Ro,$ZodAsyncError:Fe,$ZodBase64:po,$ZodBase64URL:mo,$ZodBigInt:Ar,$ZodBigIntFormat:yo,$ZodBoolean:Lr,$ZodCIDRv4:fo,$ZodCIDRv6:_o,$ZodCUID:to,$ZodCUID2:ro,$ZodCatch:Zo,$ZodCheck:oe,$ZodCheckBigIntFormat:Tn,$ZodCheckEndsWith:Wn,$ZodCheckGreaterThan:Dr,$ZodCheckIncludes:Nn,$ZodCheckLengthEquals:$n,$ZodCheckLessThan:xr,$ZodCheckLowerCase:Hn,$ZodCheckMaxLength:Pn,$ZodCheckMaxSize:On,$ZodCheckMimeType:Zn,$ZodCheckMinLength:Mn,$ZodCheckMinSize:In,$ZodCheckMultipleOf:Ln,$ZodCheckNumberFormat:An,$ZodCheckOverwrite:qn,$ZodCheckProperty:Un,$ZodCheckRegex:zn,$ZodCheckSizeEquals:Bn,$ZodCheckStartsWith:jn,$ZodCheckStringFormat:at,$ZodCheckUpperCase:Fn,$ZodCustom:Yo,$ZodDate:Do,$ZodDefault:jo,$ZodDiscriminatedUnion:To,$ZodE164:go,$ZodEmail:Yn,$ZodEmoji:Qn,$ZodEnum:Mo,$ZodError:be,$ZodFile:zo,$ZodFunction:He,$ZodGUID:Gn,$ZodIPv4:lo,$ZodIPv6:uo,$ZodISODate:ao,$ZodISODateTime:oo,$ZodISODuration:ho,$ZodISOTime:co,$ZodInterface:lr,$ZodIntersection:Oo,$ZodJWT:bo,$ZodKSUID:no,$ZodLazy:Jo,$ZodLiteral:$o,$ZodMap:Bo,$ZodNaN:qo,$ZodNanoID:eo,$ZodNever:$t,$ZodNonOptional:Wo,$ZodNull:Eo,$ZodNullable:No,$ZodNumber:Rr,$ZodNumberFormat:So,$ZodObject:Lo,$ZodObjectLike:zt,$ZodOptional:Fo,$ZodPipe:Or,$ZodPromise:Go,$ZodReadonly:Ko,$ZodRecord:Io,$ZodRegistry:Ir,$ZodSet:Po,$ZodString:Mt,$ZodStringFormat:te,$ZodSuccess:Uo,$ZodSymbol:wo,$ZodTemplateLiteral:Vo,$ZodTransform:Ho,$ZodTuple:Ht,$ZodType:X,$ZodULID:io,$ZodURL:Xn,$ZodUUID:Jn,$ZodUndefined:Co,$ZodUnion:Tr,$ZodUnknown:ct,$ZodVoid:xo,$ZodXID:so,$brand:Ms,$constructor:M,$input:ta,$output:ea,Doc:Kn,JSONSchema:hu,JSONSchemaGenerator:dr,_any:Ea,_array:Ba,_base64:Xr,_base64url:Qr,_bigint:ga,_boolean:pa,_catch:eu,_cidrv4:Jr,_cidrv6:Yr,_coercedBigint:va,_coercedBoolean:ma,_coercedDate:Da,_coercedNumber:ha,_coercedString:ia,_cuid:Wr,_cuid2:Ur,_custom:Zt,_date:xa,_default:Yl,_discriminatedUnion:Fl,_e164:ei,_email:Pr,_emoji:Nr,_endsWith:ci,_enum:Zl,_file:Ma,_float32:ua,_float64:da,_gt:Ie,_gte:he,_guid:Et,_includes:oi,_int:la,_int32:fa,_int64:ba,_interface:Il,_intersection:Nl,_ipv4:Vr,_ipv6:Gr,_isoDate:na,_isoDateTime:sa,_isoDuration:aa,_isoTime:oa,_jwt:ti,_ksuid:Kr,_lazy:su,_length:Ut,_literal:Kl,_looseInterface:Pl,_looseObject:zl,_lowercase:si,_lt:Oe,_lte:_e,_map:Wl,_max:_e,_maxLength:Wt,_maxSize:jt,_mime:hi,_min:he,_minLength:We,_minSize:st,_multipleOf:it,_nan:Ra,_nanoid:jr,_nativeEnum:ql,_negative:Aa,_never:Nt,_nonnegative:Oa,_nonoptional:Xl,_nonpositive:Ta,_normalize:li,_null:Ca,_nullable:Jl,_number:ca,_object:Ml,_optional:Gl,_overwrite:Me,_parse:Sr,_parseAsync:wr,_pipe:tu,_positive:La,_promise:nu,_property:Ia,_readonly:ru,_record:jl,_refine:ou,_regex:ii,_safeParse:yr,_safeParseAsync:Cr,_set:Ul,_size:ri,_startsWith:ai,_strictInterface:Bl,_strictObject:$l,_string:ra,_stringbool:$a,_success:Ql,_symbol:ya,_templateLiteral:iu,_toLowerCase:di,_toUpperCase:fi,_transform:Vl,_trim:ui,_tuple:Pa,_uint32:_a,_uint64:Sa,_ulid:Zr,_undefined:wa,_union:Hl,_unknown:Ft,_uppercase:ni,_url:Fr,_uuid:Mr,_uuidv4:$r,_uuidv6:zr,_uuidv7:Hr,_void:ka,_xid:qr,clone:pe,config:ae,flattenError:Zs,formatError:qs,function:za,globalConfig:or,globalRegistry:xe,isValidJWT:vo,locales:Qo,parse:ar,parseAsync:cr,prettifyError:Gs,regexes:Dn,registry:Br,safeParse:al,safeParseAsync:cl,toDotPath:Vs,toJSONSchema:Ha,treeifyError:Ks,util:ol,version:Vn},Symbol.toStringTag,{value:"Module"})),Fa=M("ZodISODateTime",(e,t)=>{oo.init(e,t),re.init(e,t)});function Na(e){return sa(Fa,e)}const ja=M("ZodISODate",(e,t)=>{ao.init(e,t),re.init(e,t)});function Wa(e){return na(ja,e)}const Ua=M("ZodISOTime",(e,t)=>{co.init(e,t),re.init(e,t)});function Za(e){return oa(Ua,e)}const qa=M("ZodISODuration",(e,t)=>{ho.init(e,t),re.init(e,t)});function Ka(e){return aa(qa,e)}const uu=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:ja,ZodISODateTime:Fa,ZodISODuration:qa,ZodISOTime:Ua,date:Wa,datetime:Na,duration:Ka,time:Za},Symbol.toStringTag,{value:"Module"}));class ht extends be{format(t){return qs(this,t)}flatten(t){return Zs(this,t)}addIssue(t){this.issues.push(t)}addIssues(t){this.issues.push(...t)}get isEmpty(){return this.issues.length===0}}const Va=Sr.bind({Error:ht}),Ga=yr.bind({Error:ht}),Ja=wr.bind({Error:ht}),Ya=Cr.bind({Error:ht});function du(e){return ia(pi,e)}function fu(e){return ha(qt,e)}function _u(e){return ma(Kt,e)}function pu(e){return va(Vt,e)}function mu(e){return Da(Pi,e)}const gu=Object.freeze(Object.defineProperty({__proto__:null,bigint:pu,boolean:_u,date:mu,number:fu,string:du},Symbol.toStringTag,{value:"Module"})),Q=M("ZodType",(e,t)=>(X.init(e,t),e.def=t,e._def=t,e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),e.clone=r=>pe(e,r),e.brand=()=>e,e.register=(r,s)=>(r.add(e,s),e),e.parse=(r,s)=>Va(e,r,s),e.safeParse=(r,s)=>Ga(e,r,s),e.parseAsync=async(r,s)=>Ja(e,r,s),e.safeParseAsync=async(r,s)=>Ya(e,r,s),e.spa=e.safeParseAsync,e.refine=(r,s)=>e.check(Pc(r,s)),e.superRefine=r=>e.check(Mc(r)),e.overwrite=r=>e.check(Me(r)),e.optional=r=>xt(e,r),e.nullable=r=>Dt(e,r),e.nullish=()=>xt(Dt(e)),e.nonoptional=r=>Cc(e,r),e.array=()=>Mi(e),e.or=r=>Gt([e,r]),e.and=r=>uc(e,r),e.transform=r=>Rt(e,Ni(r)),e.default=(r,s)=>wc(e,r,s),e.catch=r=>xc(e,r),e.pipe=r=>Rt(e,r),e.readonly=()=>Lc(e),e.describe=r=>{const s=e.clone(),_={...xe.get(e)??{},description:r};return delete _.id,xe.add(s,_),s},Object.defineProperty(e,"description",{get(){var r;return(r=xe.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return xe.get(e);const s=e.clone();return xe.add(s,r[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_i=M("_ZodString",(e,t)=>{Mt.init(e,t),Q.init(e,t),e.format=e._zod.computed.format??null,e.minLength=e._zod.computed.minimum??null,e.maxLength=e._zod.computed.maximum??null,e.regex=(...r)=>e.check(ii(...r)),e.includes=(...r)=>e.check(oi(...r)),e.startsWith=r=>e.check(ai(r)),e.endsWith=r=>e.check(ci(r)),e.min=(...r)=>e.check(We(...r)),e.max=(...r)=>e.check(Wt(...r)),e.length=(...r)=>e.check(Ut(...r)),e.nonempty=(...r)=>e.check(We(1,...r)),e.lowercase=r=>e.check(si(r)),e.uppercase=r=>e.check(ni(r)),e.trim=()=>e.check(ui()),e.normalize=(...r)=>e.check(li(...r)),e.toLowerCase=()=>e.check(di()),e.toUpperCase=()=>e.check(fi())}),pi=M("ZodString",(e,t)=>{Mt.init(e,t),_i.init(e,t),e.email=r=>e.check(Pr(mi,r)),e.url=r=>e.check(Fr(gi,r)),e.jwt=r=>e.check(ti(Oi,r)),e.emoji=r=>e.check(Nr(vi,r)),e.guid=r=>e.check(Et(kt,r)),e.uuid=r=>e.check(Mr(we,r)),e.uuidv4=r=>e.check($r(we,r)),e.uuidv6=r=>e.check(zr(we,r)),e.uuidv7=r=>e.check(Hr(we,r)),e.nanoid=r=>e.check(jr(bi,r)),e.guid=r=>e.check(Et(kt,r)),e.cuid=r=>e.check(Wr(Si,r)),e.cuid2=r=>e.check(Ur(yi,r)),e.ulid=r=>e.check(Zr(wi,r)),e.base64=r=>e.check(Xr(Li,r)),e.base64url=r=>e.check(Qr(Ai,r)),e.xid=r=>e.check(qr(Ci,r)),e.ksuid=r=>e.check(Kr(Ei,r)),e.ipv4=r=>e.check(Vr(ki,r)),e.ipv6=r=>e.check(Gr(xi,r)),e.cidrv4=r=>e.check(Jr(Di,r)),e.cidrv6=r=>e.check(Yr(Ri,r)),e.e164=r=>e.check(ei(Ti,r)),e.datetime=r=>e.check(Na(r)),e.date=r=>e.check(Wa(r)),e.time=r=>e.check(Za(r)),e.duration=r=>e.check(Ka(r))});function _r(e){return ra(pi,e)}const re=M("ZodStringFormat",(e,t)=>{te.init(e,t),_i.init(e,t)}),mi=M("ZodEmail",(e,t)=>{Yn.init(e,t),re.init(e,t)});function vu(e){return Pr(mi,e)}const kt=M("ZodGUID",(e,t)=>{Gn.init(e,t),re.init(e,t)});function bu(e){return Et(kt,e)}const we=M("ZodUUID",(e,t)=>{Jn.init(e,t),re.init(e,t)});function Su(e){return Mr(we,e)}function yu(e){return $r(we,e)}function wu(e){return zr(we,e)}function Cu(e){return Hr(we,e)}const gi=M("ZodURL",(e,t)=>{Xn.init(e,t),re.init(e,t)});function Eu(e){return Fr(gi,e)}const vi=M("ZodEmoji",(e,t)=>{Qn.init(e,t),re.init(e,t)});function ku(e){return Nr(vi,e)}const bi=M("ZodNanoID",(e,t)=>{eo.init(e,t),re.init(e,t)});function xu(e){return jr(bi,e)}const Si=M("ZodCUID",(e,t)=>{to.init(e,t),re.init(e,t)});function Du(e){return Wr(Si,e)}const yi=M("ZodCUID2",(e,t)=>{ro.init(e,t),re.init(e,t)});function Ru(e){return Ur(yi,e)}const wi=M("ZodULID",(e,t)=>{io.init(e,t),re.init(e,t)});function Lu(e){return Zr(wi,e)}const Ci=M("ZodXID",(e,t)=>{so.init(e,t),re.init(e,t)});function Au(e){return qr(Ci,e)}const Ei=M("ZodKSUID",(e,t)=>{no.init(e,t),re.init(e,t)});function Tu(e){return Kr(Ei,e)}const ki=M("ZodIPv4",(e,t)=>{lo.init(e,t),re.init(e,t)});function Ou(e){return Vr(ki,e)}const xi=M("ZodIPv6",(e,t)=>{uo.init(e,t),re.init(e,t)});function Iu(e){return Gr(xi,e)}const Di=M("ZodCIDRv4",(e,t)=>{fo.init(e,t),re.init(e,t)});function Bu(e){return Jr(Di,e)}const Ri=M("ZodCIDRv6",(e,t)=>{_o.init(e,t),re.init(e,t)});function Pu(e){return Yr(Ri,e)}const Li=M("ZodBase64",(e,t)=>{po.init(e,t),re.init(e,t)});function Mu(e){return Xr(Li,e)}const Ai=M("ZodBase64URL",(e,t)=>{mo.init(e,t),re.init(e,t)});function $u(e){return Qr(Ai,e)}const Ti=M("ZodE164",(e,t)=>{go.init(e,t),re.init(e,t)});function zu(e){return ei(Ti,e)}const Oi=M("ZodJWT",(e,t)=>{bo.init(e,t),re.init(e,t)});function Hu(e){return ti(Oi,e)}const qt=M("ZodNumber",(e,t)=>{Rr.init(e,t),Q.init(e,t),e.gt=(r,s)=>e.check(Ie(r,s)),e.gte=(r,s)=>e.check(he(r,s)),e.min=(r,s)=>e.check(he(r,s)),e.lt=(r,s)=>e.check(Oe(r,s)),e.lte=(r,s)=>e.check(_e(r,s)),e.max=(r,s)=>e.check(_e(r,s)),e.int=r=>e.check(pr(r)),e.safe=r=>e.check(pr(r)),e.positive=r=>e.check(Ie(0,r)),e.nonnegative=r=>e.check(he(0,r)),e.negative=r=>e.check(Oe(0,r)),e.nonpositive=r=>e.check(_e(0,r)),e.multipleOf=(r,s)=>e.check(it(r,s)),e.step=(r,s)=>e.check(it(r,s)),e.finite=()=>e,e.minValue=e._zod.computed.minimum??null,e.maxValue=e._zod.computed.maximum??null,e.isInt=(e._zod.computed.format??"").includes("int")||Number.isSafeInteger(e._zod.computed.multipleOf??.5),e.isFinite=!0,e.format=e._zod.computed.format??null});function Xa(e){return ca(qt,e)}const qe=M("ZodNumberFormat",(e,t)=>{So.init(e,t),qt.init(e,t)});function pr(e){return la(qe,e)}function Fu(e){return ua(qe,e)}function Nu(e){return da(qe,e)}function ju(e){return fa(qe,e)}function Wu(e){return _a(qe,e)}const Kt=M("ZodBoolean",(e,t)=>{Lr.init(e,t),Q.init(e,t)});function Qa(e){return pa(Kt,e)}const Vt=M("ZodBigInt",(e,t)=>{Ar.init(e,t),Q.init(e,t),e.gte=(r,s)=>e.check(he(r,s)),e.min=(r,s)=>e.check(he(r,s)),e.gt=(r,s)=>e.check(Ie(r,s)),e.gte=(r,s)=>e.check(he(r,s)),e.min=(r,s)=>e.check(he(r,s)),e.lt=(r,s)=>e.check(Oe(r,s)),e.lte=(r,s)=>e.check(_e(r,s)),e.max=(r,s)=>e.check(_e(r,s)),e.positive=r=>e.check(Ie(BigInt(0),r)),e.negative=r=>e.check(Oe(BigInt(0),r)),e.nonpositive=r=>e.check(_e(BigInt(0),r)),e.nonnegative=r=>e.check(he(BigInt(0),r)),e.multipleOf=(r,s)=>e.check(it(r,s)),e.minValue=e._zod.computed.minimum??null,e.maxValue=e._zod.computed.maximum??null,e.format=e._zod.computed.format??null});function Uu(e){return ga(Vt,e)}const Ii=M("ZodBigIntFormat",(e,t)=>{yo.init(e,t),Vt.init(e,t)});function Zu(e){return ba(Ii,e)}function qu(e){return Sa(Ii,e)}const ec=M("ZodSymbol",(e,t)=>{wo.init(e,t),Q.init(e,t)});function Ku(e){return ya(ec,e)}const tc=M("ZodUndefined",(e,t)=>{Co.init(e,t),Q.init(e,t)});function Vu(e){return wa(tc,e)}const rc=M("ZodNull",(e,t)=>{Eo.init(e,t),Q.init(e,t)});function ic(e){return Ca(rc,e)}const sc=M("ZodAny",(e,t)=>{ko.init(e,t),Q.init(e,t)});function Gu(e){return Ea(sc,e)}const Bi=M("ZodUnknown",(e,t)=>{ct.init(e,t),Q.init(e,t)});function Ue(e){return Ft(Bi,e)}const nc=M("ZodNever",(e,t)=>{$t.init(e,t),Q.init(e,t)});function Ke(e){return Nt(nc,e)}const oc=M("ZodVoid",(e,t)=>{xo.init(e,t),Q.init(e,t)});function Ju(e){return ka(oc,e)}const Pi=M("ZodDate",(e,t)=>{Do.init(e,t),Q.init(e,t),e.min=(s,_)=>e.check(he(s,_)),e.max=(s,_)=>e.check(_e(s,_));const r=e._zod.computed;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Yu(e){return xa(Pi,e)}const ac=M("ZodArray",(e,t)=>{Ro.init(e,t),Q.init(e,t),e.element=t.element,e.min=(r,s)=>e.check(We(r,s)),e.nonempty=r=>e.check(We(1,r)),e.max=(r,s)=>e.check(Wt(r,s)),e.length=(r,s)=>e.check(Ut(r,s))});function Mi(e,t){return Ba(ac,e,t)}const Xu=M("ZodObjectLike",(e,t)=>{zt.init(e,t),Q.init(e,t)});function Qu(e){const t=e._zod.def.type==="interface"?Re(e._zod.def.shape).shape:e._zod.def.shape;return gc(Object.keys(t))}const lt=M("ZodInterface",(e,t)=>{lr.init(e,t),Q.init(e,t),e.keyof=()=>Fi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.loose=()=>e.clone({...e._zod.def,catchall:Ue()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ke()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>r instanceof lr?rt(e,r):rt(e,$i(r)),e.merge=r=>Ae(e,r),e.pick=r=>At(e,r),e.omit=r=>Tt(e,r),e.partial=(...r)=>Ot(ut,e,r[0]),e.required=(...r)=>It(dt,e,r[0])});function $i(e,t,r=lt){const s=Ce(()=>Re(e)),_={type:"interface",get shape(){const E=s.value.shape;return ve(this,"shape",E),E},get optional(){return s.value.optional},...$(t)};return new r(_)}function ed(e,t){const r=Ce(()=>Re(e)),s={type:"interface",get shape(){const _=r.value.shape;return ve(this,"shape",_),_},get optional(){return r.value.optional},catchall:Ke(),...$(t)};return new lt(s)}function td(e,t){const r=Ce(()=>Re(e)),s={type:"interface",get optional(){return r.value.optional},get shape(){const _=r.value.shape;return ve(this,"shape",_),_},catchall:Ue(),...$(t)};return new lt(s)}const Ve=M("ZodObject",(e,t)=>{Lo.init(e,t),Q.init(e,t),e.shape=t.shape,e.keyof=()=>Fi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ue()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ue()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ke()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>r instanceof Ve?rt(e,r):rt(e,zi(r)),e.merge=r=>Ae(e,r),e.pick=r=>At(e,r),e.omit=r=>Tt(e,r),e.partial=(...r)=>Ot(ut,e,r[0]),e.required=(...r)=>It(dt,e,r[0])});function zi(e,t){const r={type:"object",shape:e??{},get optional(){return Pe(e??{})},...$(t)};return new Ve(r)}function rd(e,t){return new Ve({type:"object",shape:e,get optional(){return Pe(e)},catchall:Ke(),...$(t)})}function id(e,t){return new Ve({type:"object",shape:e,get optional(){return Pe(e)},catchall:Ue(),...$(t)})}function sd(e,t){return t instanceof X?Ae(e,t):e instanceof lt?Ae(e,$i(t)):e instanceof Ve?Ae(e,zi(t)):Us(e,t)}function nd(e,t){return Ae(e,t)}function od(e,t){return At(e,t)}function ad(e,t){return Tt(e,t)}function cd(e,t){return Ot(ut,e,t)}function hd(e,t){return It(dt,e,t)}const cc=M("ZodUnion",(e,t)=>{Tr.init(e,t),Q.init(e,t),e.options=t.options});function Gt(e,t){return new cc({type:"union",options:e,...$(t)})}const hc=M("ZodDiscriminatedUnion",(e,t)=>{To.init(e,t),Q.init(e,t)});function ld(...e){typeof e[0]=="string"&&(e=e.slice(1));const[t,r]=e;return new hc({type:"union",options:t,...$(r)})}const lc=M("ZodIntersection",(e,t)=>{Oo.init(e,t),Q.init(e,t)});function uc(e,t,r){return new lc({type:"intersection",left:e,right:t,...$(r)})}const dc=M("ZodTuple",(e,t)=>{Ht.init(e,t),Q.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function ud(e,t,r){const s=t instanceof X,_=s?r:t,E=s?t:null;return new dc({type:"tuple",items:e,rest:E,...$(_)})}const Hi=M("ZodRecord",(e,t)=>{Io.init(e,t),Q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function fc(e,t,r){return new Hi({type:"record",keyType:e,valueType:t,...$(r)})}function dd(e,t,r){return new Hi({type:"record",keyType:Gt([e,Ke()]),valueType:t,...$(r)})}const _c=M("ZodMap",(e,t)=>{Bo.init(e,t),Q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function fd(e,t,r){return new _c({type:"map",keyType:e,valueType:t,...$(r)})}const pc=M("ZodSet",(e,t)=>{Po.init(e,t),Q.init(e,t),e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(jt(...r)),e.size=(...r)=>e.check(ri(...r))});function _d(e,t){return new pc({type:"set",valueType:e,...$(t)})}const nt=M("ZodEnum",(e,t)=>{Mo.init(e,t),Q.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(s,_)=>{const E={};for(const C of s)if(r.has(C))E[C]=t.entries[C];else throw new Error(`Key ${C} not found in enum`);return new nt({...t,checks:[],...$(_),entries:E})},e.exclude=(s,_)=>{const E={...t.entries};for(const C of s)if(r.has(C))delete E[C];else throw new Error(`Key ${C} not found in enum`);return new nt({...t,checks:[],...$(_),entries:E})}});function Fi(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new nt({type:"enum",entries:r,...$(t)})}function pd(e,t){return new nt({type:"enum",entries:e,...$(t)})}const mc=M("ZodLiteral",(e,t)=>{$o.init(e,t),Q.init(e,t),e.values=new Set(t.values)});function gc(e,t){return new mc({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const vc=M("ZodFile",(e,t)=>{zo.init(e,t),Q.init(e,t),e.min=(r,s)=>e.check(st(r,s)),e.max=(r,s)=>e.check(jt(r,s)),e.mime=(r,s)=>e.check(hi(r,s))});function md(e){return Ma(vc,e)}const bc=M("ZodTransform",(e,t)=>{Ho.init(e,t),Q.init(e,t),e._zod.parse=(r,s)=>{r.addIssue=E=>{if(typeof E=="string")r.issues.push(Ne(E,r.value,t));else{const C=E;C.fatal&&(C.continue=!1),C.code??(C.code="custom"),C.input??(C.input=r.value),C.inst??(C.inst=e),C.continue??(C.continue=!t.abort),r.issues.push(Ne(C))}};const _=t.transform(r.value,r);return _ instanceof Promise?_.then(E=>(r.value=E,r)):(r.value=_,r)}});function Ni(e,t){return new bc({type:"transform",transform:e,...$(t)})}const ut=M("ZodOptional",(e,t)=>{Fo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xt(e,t){return new ut({type:"optional",innerType:e,...$(t)})}const Sc=M("ZodNullable",(e,t)=>{No.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Dt(e,t){return new Sc({type:"nullable",innerType:e,...$(t)})}function gd(e){return xt(Dt(e))}const yc=M("ZodDefault",(e,t)=>{jo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wc(e,t,r){return new yc({type:"default",defaultValue:typeof t=="function"?t:()=>t,innerType:e,...$(r)})}const dt=M("ZodNonOptional",(e,t)=>{Wo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cc(e,t){return new dt({type:"nonoptional",innerType:e,...$(t)})}const Ec=M("ZodSuccess",(e,t)=>{Uo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vd(e,t){return new Ec({type:"success",innerType:e,...$(t)})}const kc=M("ZodCatch",(e,t)=>{Zo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xc(e,t,r){return new kc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t,...$(r)})}const Dc=M("ZodNaN",(e,t)=>{qo.init(e,t),Q.init(e,t)});function bd(e){return Ra(Dc,e)}const ji=M("ZodPipe",(e,t)=>{Or.init(e,t),Q.init(e,t),e.in=t.in,e.out=t.out});function Rt(e,t,r){return new ji({type:"pipe",in:e,out:t,...$(r)})}const Rc=M("ZodReadonly",(e,t)=>{Ko.init(e,t),Q.init(e,t)});function Lc(e,t){return new Rc({type:"readonly",innerType:e,...$(t)})}const Ac=M("ZodTemplateLiteral",(e,t)=>{Vo.init(e,t),Q.init(e,t)});function Sd(e,t){return new Ac({type:"template_literal",parts:e,...$(t)})}const Tc=M("ZodLazy",(e,t)=>{Jo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Oc(e){return new Tc({type:"lazy",getter:e})}const Ic=M("ZodPromise",(e,t)=>{Go.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yd(e,t){return new Ic({type:"promise",innerType:e,...$(t)})}const Jt=M("ZodCustom",(e,t)=>{Yo.init(e,t),Q.init(e,t)});function Bc(e,t){const r=new oe({check:"custom",...$(t)});return r._zod.check=e,r}function wd(e,t){return Zt(Jt,e??(()=>!0),t)}function Pc(e,t={}){return Zt(Jt,e,t)}function Mc(e,t){const r=Bc(s=>(s.addIssue=_=>{if(typeof _=="string")s.issues.push(Ne(_,s.value,r._zod.def));else{const E=_;E.fatal&&(E.continue=!1),E.code??(E.code="custom"),E.input??(E.input=s.value),E.inst??(E.inst=r),E.continue??(E.continue=!r._zod.def.abort),s.issues.push(Ne(E))}},e(s.value,s)),t);return r}function Cd(e,t={error:`Input not instance of ${e.name}`}){return new Jt({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...$(t)})}const Ed=$a.bind(null,{Pipe:ji,Boolean:Kt,Unknown:Bi});function kd(e){const t=Oc(()=>Gt([_r(e),Xa(),Qa(),ic(),Mi(t),fc(_r(),t)]));return t}function xd(e,t,r){return Rt(Ni(e,r),t,r)}const Dd={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},Rd=Object.freeze({status:"aborted"}),Ld=Rd;function Ad(e){ae({customError:e})}function Td(){return ae().customError}ae(Xo());const Od=Object.freeze(Object.defineProperty({__proto__:null,$brand:Ms,$input:ta,$output:ea,NEVER:Ld,ZodAny:sc,ZodArray:ac,ZodBase64:Li,ZodBase64URL:Ai,ZodBigInt:Vt,ZodBigIntFormat:Ii,ZodBoolean:Kt,ZodCIDRv4:Di,ZodCIDRv6:Ri,ZodCUID:Si,ZodCUID2:yi,ZodCatch:kc,ZodCustom:Jt,ZodDate:Pi,ZodDefault:yc,ZodDiscriminatedUnion:hc,ZodE164:Ti,ZodEmail:mi,ZodEmoji:vi,ZodEnum:nt,ZodError:ht,ZodFile:vc,ZodGUID:kt,ZodIPv4:ki,ZodIPv6:xi,ZodInterface:lt,ZodIntersection:lc,ZodIssueCode:Dd,ZodJWT:Oi,ZodKSUID:Ei,ZodLazy:Tc,ZodLiteral:mc,ZodMap:_c,ZodNaN:Dc,ZodNanoID:bi,ZodNever:nc,ZodNonOptional:dt,ZodNull:rc,ZodNullable:Sc,ZodNumber:qt,ZodNumberFormat:qe,ZodObject:Ve,ZodObjectLike:Xu,ZodOptional:ut,ZodPipe:ji,ZodPromise:Ic,ZodReadonly:Rc,ZodRecord:Hi,ZodSet:pc,ZodString:pi,ZodStringFormat:re,ZodSuccess:Ec,ZodSymbol:ec,ZodTemplateLiteral:Ac,ZodTransform:bc,ZodTuple:dc,ZodType:Q,ZodULID:wi,ZodURL:gi,ZodUUID:we,ZodUndefined:tc,ZodUnion:cc,ZodUnknown:Bi,ZodVoid:oc,ZodXID:Ci,_ZodString:_i,_default:wc,any:Gu,array:Mi,base64:Mu,base64url:$u,bigint:Uu,boolean:Qa,catch:xc,check:Bc,cidrv4:Bu,cidrv6:Pu,clone:pe,coerce:gu,config:ae,core:lu,cuid:Du,cuid2:Ru,custom:wd,date:Yu,discriminatedUnion:ld,e164:zu,email:vu,emoji:ku,endsWith:ci,enum:Fi,extend:sd,file:md,float32:Fu,float64:Nu,function:za,getErrorMap:Td,globalRegistry:xe,gt:Ie,gte:he,guid:bu,includes:oi,instanceof:Cd,int:pr,int32:ju,int64:Zu,interface:$i,intersection:uc,ipv4:Ou,ipv6:Iu,iso:uu,json:kd,jwt:Hu,keyof:Qu,ksuid:Tu,lazy:Oc,length:Ut,literal:gc,locales:Qo,looseInterface:td,looseObject:id,lowercase:si,lt:Oe,lte:_e,map:fd,maxLength:Wt,maxSize:jt,merge:nd,mime:hi,minLength:We,minSize:st,multipleOf:it,nan:bd,nanoid:xu,nativeEnum:pd,negative:Aa,never:Ke,nonnegative:Oa,nonoptional:Cc,nonpositive:Ta,normalize:li,null:ic,nullable:Dt,nullish:gd,number:Xa,object:zi,omit:ad,optional:xt,overwrite:Me,parse:Va,parseAsync:Ja,partial:cd,partialRecord:dd,pick:od,pipe:Rt,positive:La,preprocess:xd,prettifyError:Gs,promise:yd,property:Ia,readonly:Lc,record:fc,refine:Pc,regex:ii,regexes:Dn,registry:Br,required:hd,safeParse:Ga,safeParseAsync:Ya,set:_d,setErrorMap:Ad,size:ri,startsWith:ai,strictInterface:ed,strictObject:rd,string:_r,stringbool:Ed,success:vd,superRefine:Mc,symbol:Ku,templateLiteral:Sd,toJSONSchema:Ha,toLowerCase:di,toUpperCase:fi,transform:Ni,treeifyError:Ks,trim:ui,tuple:ud,uint32:Wu,uint64:qu,ulid:Lu,undefined:Vu,union:Gt,unknown:Ue,uppercase:ni,url:Eu,uuid:Su,uuidv4:yu,uuidv6:wu,uuidv7:Cu,void:Ju,xid:Au},Symbol.toStringTag,{value:"Module"}));function Id(e){const t=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(e);if(!t)return;if(!t[1]||!t[2]||!t[3]||!t[4])throw new Error(`Mouse event: Invalid match for data ${e}`);const r=parseInt(t[1],10),s=parseInt(t[2],10),_=parseInt(t[3],10),E=t[4]==="m";return console.log(`Mouse event: buttonCode=${r}, column=${s}, row=${_}, isRelease=${E}`),e}function $c(e,t){const r=new Zh.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),s=Bs.macchiato.colors;r.options.theme={background:s.base.hex,black:s.crust.hex,brightBlack:s.surface2.hex,blue:s.blue.hex,brightBlue:s.blue.hex,brightCyan:s.sky.hex,brightRed:s.maroon.hex,brightYellow:s.yellow.hex,cursor:s.text.hex,cyan:s.sky.hex,foreground:s.text.hex,green:s.green.hex,magenta:s.lavender.hex,red:s.red.hex,white:s.text.hex,yellow:s.yellow.hex};const _=new Wh.FitAddon;return r.loadAddon(_),r.open(e),_.fit(),window.addEventListener("resize",()=>{_.fit()}),r.onData(E=>{if(typeof E!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(E)}'`);const C=Id(E);C&&t.onMouseEvent(C)}),r.onKey(E=>{t.onKeyPress(E)}),r}function zc(){let e=Od.string().safeParse(sessionStorage.getItem("tabId")).data;return e||(e=Math.random().toString(36),sessionStorage.setItem("tabId",e)),{tabId:e}}class Bd{constructor(t){ge(this,"ready");ge(this,"tabId");ge(this,"terminal");ge(this,"trpc");const r=Rs({links:[Os({condition:E=>E.type==="subscription",true:Is({url:"/trpc"}),false:Ts({url:"/trpc"})})]});this.trpc=r,this.tabId=zc();const s=this.tabId,_=$c(t,{onMouseEvent(E){r.neovim.sendStdin.mutate({tabId:s,data:E}).catch(C=>{console.error("Error sending mouse event",C)})},onKeyPress(E){r.neovim.sendStdin.mutate({tabId:s,data:E.key})}});this.terminal=_,this.ready=new Promise(E=>{console.log("Subscribing to stdout"),r.neovim.initializeStdout.subscribe({client:s},{onStarted(){E()},onData(C){_.write(C)},onError(C){console.error("Error from the application",C)}})})}async startNeovim(t){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:t.filename,additionalEnvironmentVariables:t.additionalEnvironmentVariables,startupScriptModifications:t.startupScriptModifications,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}},tabId:this.tabId})}async runBlockingShellCommand(t){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}async runLuaCode(t){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...t,tabId:this.tabId})}async waitForLuaCode(t){await this.ready;try{return await this.trpc.neovim.waitForLuaCode.mutate({...t,tabId:this.tabId})}catch(r){throw r}}async runExCommand(t){return await this.ready,this.trpc.neovim.runExCommand.mutate({...t,tabId:this.tabId})}}class Pd{constructor(t){ge(this,"ready");ge(this,"tabId");ge(this,"terminal");ge(this,"trpc");const r=Rs({links:[Os({condition:E=>E.type==="subscription",true:Is({url:"/trpc"}),false:Ts({url:"/trpc"})})]});this.trpc=r,this.tabId=zc();const s=this.tabId,_=$c(t,{onMouseEvent(E){r.terminal.sendStdin.mutate({tabId:s,data:E}).catch(C=>{console.error("Error sending mouse event",C)})},onKeyPress(E){r.terminal.sendStdin.mutate({tabId:s,data:E.key})}});this.terminal=_,this.ready=new Promise(E=>{console.log("Subscribing to stdout"),r.terminal.onStdout.subscribe({client:s},{onStarted(){E()},onData(C){_.write(C)},onError(C){console.error("Error from the application",C)}})})}async startTerminalApplication(t){return await this.ready,await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:t.additionalEnvironmentVariables,commandToRun:t.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(t){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}}class Hc{constructor(t){ge(this,"value");this.factory=t}get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const Wi=document.querySelector("#app");if(!Wi)throw new Error("No app element found");const Md=new Hc(()=>new Bd(Wi)),$d=new Hc(()=>new Pd(Wi));window.startNeovim=async function(e){const t=Md.get(),r=await t.startNeovim({additionalEnvironmentVariables:e==null?void 0:e.additionalEnvironmentVariables,filename:(e==null?void 0:e.filename)??"initial-file.txt",startupScriptModifications:(e==null?void 0:e.startupScriptModifications)??[]});return{runBlockingShellCommand(_){return t.runBlockingShellCommand(_)},runLuaCode(_){return t.runLuaCode(_)},waitForLuaCode(_){return t.waitForLuaCode(_)},runExCommand(_){return t.runExCommand(_)},dir:r}};window.startTerminalApplication=async function(e){const t=$d.get();return{dir:await t.startTerminalApplication(e),runBlockingShellCommand(_){return t.runBlockingShellCommand(_)}}};
|
|
37
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&C(m);continue}if(b.count>1&&n.reused==="ref"){C(m);continue}}for(const m of this.seen.entries()){const b=m[1];Yt(b.schema,{target:this.target}),b.def&&Yt(b.def,{target:this.target})}const s={...g.def},h=((_=n.external)==null?void 0:_.defs)??{};for(const m of this.seen.entries()){const b=m[1];b.def&&b.defId&&(h[b.defId]=b.def)}!n.external&&Object.keys(h).length>0&&(this.target==="draft-2020-12"?s.$defs=h:s.definitions=h);try{return JSON.parse(JSON.stringify(s))}catch{throw new Error("Error converting schema to JSON.")}}}const Yt=(e,t)=>{const r={...e};e._ref&&Yt(e._ref,t);const n=e._ref;n&&(n.$ref&&t.target==="draft-7"?(e.allOf=e.allOf??[],e.allOf.push(n)):(Object.assign(e,n),Object.assign(e,r))),delete e._ref};function Vl(e,t){const r=e.schema;for(const n in r)delete r[n],r.$ref=t}function Aa(e,t){if(e instanceof gr){const n=new Jt(t),g={};for(const s of e._idmap.entries()){const[h,l]=s;n.process(l)}const E={},C={registry:e,uri:(t==null?void 0:t.uri)||(s=>s),defs:g};for(const s of e._idmap.entries()){const[h,l]=s;E[h]=n.emit(l,{...t,external:C})}if(Object.keys(g).length>0){const s=n.target==="draft-2020-12"?"$defs":"definitions";E.__shared={[s]:g}}return{schemas:E}}const r=new Jt(t);return r.process(e),r.emit(e,t)}const Gl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jl=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:fo,$ZodArray:go,$ZodAsyncError:Pe,$ZodBase64:ro,$ZodBase64URL:io,$ZodBigInt:fr,$ZodBigIntFormat:co,$ZodBoolean:dr,$ZodCIDRv4:eo,$ZodCIDRv6:to,$ZodCUID:Un,$ZodCUID2:Wn,$ZodCatch:Bo,$ZodCheck:oe,$ZodCheckBigIntFormat:bn,$ZodCheckEndsWith:Tn,$ZodCheckGreaterThan:lr,$ZodCheckIncludes:Ln,$ZodCheckLengthEquals:kn,$ZodCheckLessThan:hr,$ZodCheckLowerCase:Dn,$ZodCheckMaxLength:Cn,$ZodCheckMaxSize:Sn,$ZodCheckMimeType:In,$ZodCheckMinLength:En,$ZodCheckMinSize:yn,$ZodCheckMultipleOf:gn,$ZodCheckNumberFormat:vn,$ZodCheckOverwrite:Bn,$ZodCheckProperty:On,$ZodCheckRegex:xn,$ZodCheckSizeEquals:wn,$ZodCheckStartsWith:An,$ZodCheckStringFormat:Qe,$ZodCheckUpperCase:Rn,$ZodCustom:Fo,$ZodDate:mo,$ZodDefault:To,$ZodDiscriminatedUnion:So,$ZodE164:so,$ZodEmail:Hn,$ZodEmoji:Nn,$ZodEnum:ko,$ZodError:ve,$ZodFile:Do,$ZodFunction:Be,$ZodGUID:$n,$ZodIPv4:Xn,$ZodIPv6:Qn,$ZodISODate:Gn,$ZodISODateTime:Vn,$ZodISODuration:Yn,$ZodISOTime:Jn,$ZodIntersection:yo,$ZodJWT:oo,$ZodKSUID:Kn,$ZodLazy:Ho,$ZodLiteral:xo,$ZodMap:Co,$ZodNaN:Po,$ZodNanoID:jn,$ZodNever:_o,$ZodNonOptional:Oo,$ZodNull:uo,$ZodNullable:Ao,$ZodNumber:ur,$ZodNumberFormat:ao,$ZodObject:vo,$ZodOptional:Lo,$ZodPipe:mr,$ZodPromise:zo,$ZodReadonly:Mo,$ZodRecord:wo,$ZodRegistry:gr,$ZodSet:Eo,$ZodString:Ct,$ZodStringFormat:te,$ZodSuccess:Io,$ZodSymbol:ho,$ZodTemplateLiteral:$o,$ZodTransform:Ro,$ZodTuple:Et,$ZodType:X,$ZodULID:Zn,$ZodURL:Fn,$ZodUUID:zn,$ZodUndefined:lo,$ZodUnion:pr,$ZodUnknown:_r,$ZodVoid:po,$ZodXID:qn,$brand:bs,$constructor:M,$in:hl,$input:Wo,$out:cl,$output:Uo,Doc:Pn,JSONSchema:Gl,JSONSchemaGenerator:Jt,_any:fa,_array:ka,_base64:Mr,_base64url:$r,_bigint:oa,_boolean:sa,_catch:Fl,_cidrv4:Br,_cidrv6:Pr,_coercedBigint:aa,_coercedBoolean:na,_coercedDate:va,_coercedNumber:Xo,_coercedString:qo,_cuid:Dr,_cuid2:Rr,_custom:Rt,_date:ga,_default:$l,_discriminatedUnion:xl,_e164:zr,_email:br,_emoji:kr,_endsWith:qr,_enum:Tl,_file:Da,_float32:ea,_float64:ta,_gt:Le,_gte:he,_guid:dt,_includes:Wr,_int:Qo,_int32:ra,_int64:ca,_intersection:Dl,_ipv4:Or,_ipv6:Ir,_isoDate:Vo,_isoDateTime:Ko,_isoDuration:Jo,_isoTime:Go,_jwt:Hr,_ksuid:Tr,_lazy:Wl,_length:Dt,_literal:Il,_lowercase:jr,_lt:Re,_lte:_e,_map:Ll,_max:_e,_maxLength:xt,_maxSize:kt,_mime:Kr,_min:he,_minLength:ze,_minSize:Je,_multipleOf:Ge,_nan:ba,_nanoid:xr,_nativeEnum:Ol,_negative:ya,_never:pa,_nonnegative:Ca,_nonoptional:zl,_nonpositive:wa,_normalize:Vr,_null:da,_nullable:Ml,_number:Yo,_optional:Pl,_overwrite:Te,_parse:yt,_parseAsync:wt,_pipe:Nl,_positive:Sa,_promise:Zl,_property:Ea,_readonly:jl,_record:Rl,_refine:ql,_regex:Nr,_safeParse:nr,_safeParseAsync:or,_set:Al,_size:Fr,_startsWith:Zr,_string:Zo,_stringbool:Ra,_success:Hl,_symbol:la,_templateLiteral:Ul,_toLowerCase:Jr,_toUpperCase:Yr,_transform:Bl,_trim:Gr,_tuple:xa,_uint32:ia,_uint64:ha,_ulid:Lr,_undefined:ua,_union:kl,_unknown:_a,_uppercase:Ur,_url:Er,_uuid:Sr,_uuidv4:yr,_uuidv6:wr,_uuidv7:Cr,_void:ma,_xid:Ar,clone:ge,config:ae,flattenError:Is,formatError:Bs,function:La,globalConfig:Zt,globalRegistry:Ce,isValidJWT:no,locales:jo,parse:qt,parseAsync:Kt,prettifyError:$s,regexes:pn,registry:vr,safeParse:Yh,safeParseAsync:Xh,toDotPath:Ms,toJSONSchema:Aa,treeifyError:Ps,util:Jh,version:Mn},Symbol.toStringTag,{value:"Module"})),Ta=M("ZodISODateTime",(e,t)=>{Vn.init(e,t),re.init(e,t)});function Oa(e){return Ko(Ta,e)}const Ia=M("ZodISODate",(e,t)=>{Gn.init(e,t),re.init(e,t)});function Ba(e){return Vo(Ia,e)}const Pa=M("ZodISOTime",(e,t)=>{Jn.init(e,t),re.init(e,t)});function Ma(e){return Go(Pa,e)}const $a=M("ZodISODuration",(e,t)=>{Yn.init(e,t),re.init(e,t)});function za(e){return Jo($a,e)}const Yl=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Ia,ZodISODateTime:Ta,ZodISODuration:$a,ZodISOTime:Pa,date:Ba,datetime:Oa,duration:za,time:Ma},Symbol.toStringTag,{value:"Module"}));class et extends ve{format(t){return Bs(this,t)}flatten(t){return Is(this,t)}addIssue(t){this.issues.push(t)}addIssues(t){this.issues.push(...t)}get isEmpty(){return this.issues.length===0}}const Ha=yt.bind({Error:et}),Fa=nr.bind({Error:et}),Na=wt.bind({Error:et}),ja=or.bind({Error:et});function Xl(e){return qo(Qr,e)}function Ql(e){return Xo(Lt,e)}function eu(e){return na(At,e)}function tu(e){return aa(Tt,e)}function ru(e){return va(bi,e)}const iu=Object.freeze(Object.defineProperty({__proto__:null,bigint:tu,boolean:eu,date:ru,number:Ql,string:Xl},Symbol.toStringTag,{value:"Module"})),Q=M("ZodType",(e,t)=>(X.init(e,t),e.def=t,e._def=t,e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=r=>ge(e,r),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>Ha(e,r,n),e.safeParse=(r,n)=>Fa(e,r,n),e.parseAsync=async(r,n)=>Na(e,r,n),e.safeParseAsync=async(r,n)=>ja(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(Dc(r,n)),e.superRefine=r=>e.check(Rc(r)),e.overwrite=r=>e.check(Te(r)),e.optional=r=>pt(e,r),e.nullable=r=>mt(e,r),e.nullish=()=>pt(mt(e)),e.nonoptional=r=>pc(e,r),e.array=()=>Si(e),e.or=r=>Bt([e,r]),e.and=r=>rc(e,r),e.transform=r=>gt(e,wi(r)),e.default=(r,n)=>_c(e,r,n),e.catch=r=>vc(e,r),e.pipe=r=>gt(e,r),e.readonly=()=>yc(e),e.describe=r=>{const n=e.clone(),g={...Ce.get(e)??{},description:r};return delete g.id,Ce.add(n,g),n},Object.defineProperty(e,"description",{get(){var r;return(r=Ce.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ce.get(e);const n=e.clone();return Ce.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Xr=M("_ZodString",(e,t)=>{Ct.init(e,t),Q.init(e,t),e.format=e._zod.computed.format??null,e.minLength=e._zod.computed.minimum??null,e.maxLength=e._zod.computed.maximum??null,e.regex=(...r)=>e.check(Nr(...r)),e.includes=(...r)=>e.check(Wr(...r)),e.startsWith=r=>e.check(Zr(r)),e.endsWith=r=>e.check(qr(r)),e.min=(...r)=>e.check(ze(...r)),e.max=(...r)=>e.check(xt(...r)),e.length=(...r)=>e.check(Dt(...r)),e.nonempty=(...r)=>e.check(ze(1,...r)),e.lowercase=r=>e.check(jr(r)),e.uppercase=r=>e.check(Ur(r)),e.trim=()=>e.check(Gr()),e.normalize=(...r)=>e.check(Vr(...r)),e.toLowerCase=()=>e.check(Jr()),e.toUpperCase=()=>e.check(Yr())}),Qr=M("ZodString",(e,t)=>{Ct.init(e,t),Xr.init(e,t),e.email=r=>e.check(br(ei,r)),e.url=r=>e.check(Er(ti,r)),e.jwt=r=>e.check(Hr(mi,r)),e.emoji=r=>e.check(kr(ri,r)),e.guid=r=>e.check(dt(ft,r)),e.uuid=r=>e.check(Sr(Se,r)),e.uuidv4=r=>e.check(yr(Se,r)),e.uuidv6=r=>e.check(wr(Se,r)),e.uuidv7=r=>e.check(Cr(Se,r)),e.nanoid=r=>e.check(xr(ii,r)),e.guid=r=>e.check(dt(ft,r)),e.cuid=r=>e.check(Dr(si,r)),e.cuid2=r=>e.check(Rr(ni,r)),e.ulid=r=>e.check(Lr(oi,r)),e.base64=r=>e.check(Mr(fi,r)),e.base64url=r=>e.check($r(_i,r)),e.xid=r=>e.check(Ar(ai,r)),e.ksuid=r=>e.check(Tr(ci,r)),e.ipv4=r=>e.check(Or(hi,r)),e.ipv6=r=>e.check(Ir(li,r)),e.cidrv4=r=>e.check(Br(ui,r)),e.cidrv6=r=>e.check(Pr(di,r)),e.e164=r=>e.check(zr(pi,r)),e.datetime=r=>e.check(Oa(r)),e.date=r=>e.check(Ba(r)),e.time=r=>e.check(Ma(r)),e.duration=r=>e.check(za(r))});function Xt(e){return Zo(Qr,e)}const re=M("ZodStringFormat",(e,t)=>{te.init(e,t),Xr.init(e,t)}),ei=M("ZodEmail",(e,t)=>{Hn.init(e,t),re.init(e,t)});function su(e){return br(ei,e)}const ft=M("ZodGUID",(e,t)=>{$n.init(e,t),re.init(e,t)});function nu(e){return dt(ft,e)}const Se=M("ZodUUID",(e,t)=>{zn.init(e,t),re.init(e,t)});function ou(e){return Sr(Se,e)}function au(e){return yr(Se,e)}function cu(e){return wr(Se,e)}function hu(e){return Cr(Se,e)}const ti=M("ZodURL",(e,t)=>{Fn.init(e,t),re.init(e,t)});function lu(e){return Er(ti,e)}const ri=M("ZodEmoji",(e,t)=>{Nn.init(e,t),re.init(e,t)});function uu(e){return kr(ri,e)}const ii=M("ZodNanoID",(e,t)=>{jn.init(e,t),re.init(e,t)});function du(e){return xr(ii,e)}const si=M("ZodCUID",(e,t)=>{Un.init(e,t),re.init(e,t)});function fu(e){return Dr(si,e)}const ni=M("ZodCUID2",(e,t)=>{Wn.init(e,t),re.init(e,t)});function _u(e){return Rr(ni,e)}const oi=M("ZodULID",(e,t)=>{Zn.init(e,t),re.init(e,t)});function pu(e){return Lr(oi,e)}const ai=M("ZodXID",(e,t)=>{qn.init(e,t),re.init(e,t)});function mu(e){return Ar(ai,e)}const ci=M("ZodKSUID",(e,t)=>{Kn.init(e,t),re.init(e,t)});function gu(e){return Tr(ci,e)}const hi=M("ZodIPv4",(e,t)=>{Xn.init(e,t),re.init(e,t)});function vu(e){return Or(hi,e)}const li=M("ZodIPv6",(e,t)=>{Qn.init(e,t),re.init(e,t)});function bu(e){return Ir(li,e)}const ui=M("ZodCIDRv4",(e,t)=>{eo.init(e,t),re.init(e,t)});function Su(e){return Br(ui,e)}const di=M("ZodCIDRv6",(e,t)=>{to.init(e,t),re.init(e,t)});function yu(e){return Pr(di,e)}const fi=M("ZodBase64",(e,t)=>{ro.init(e,t),re.init(e,t)});function wu(e){return Mr(fi,e)}const _i=M("ZodBase64URL",(e,t)=>{io.init(e,t),re.init(e,t)});function Cu(e){return $r(_i,e)}const pi=M("ZodE164",(e,t)=>{so.init(e,t),re.init(e,t)});function Eu(e){return zr(pi,e)}const mi=M("ZodJWT",(e,t)=>{oo.init(e,t),re.init(e,t)});function ku(e){return Hr(mi,e)}const Lt=M("ZodNumber",(e,t)=>{ur.init(e,t),Q.init(e,t),e.gt=(r,n)=>e.check(Le(r,n)),e.gte=(r,n)=>e.check(he(r,n)),e.min=(r,n)=>e.check(he(r,n)),e.lt=(r,n)=>e.check(Re(r,n)),e.lte=(r,n)=>e.check(_e(r,n)),e.max=(r,n)=>e.check(_e(r,n)),e.int=r=>e.check(Qt(r)),e.safe=r=>e.check(Qt(r)),e.positive=r=>e.check(Le(0,r)),e.nonnegative=r=>e.check(he(0,r)),e.negative=r=>e.check(Re(0,r)),e.nonpositive=r=>e.check(_e(0,r)),e.multipleOf=(r,n)=>e.check(Ge(r,n)),e.step=(r,n)=>e.check(Ge(r,n)),e.finite=()=>e,e.minValue=e._zod.computed.minimum??null,e.maxValue=e._zod.computed.maximum??null,e.isInt=(e._zod.computed.format??"").includes("int")||Number.isSafeInteger(e._zod.computed.multipleOf??.5),e.isFinite=!0,e.format=e._zod.computed.format??null});function Ua(e){return Yo(Lt,e)}const Ne=M("ZodNumberFormat",(e,t)=>{ao.init(e,t),Lt.init(e,t)});function Qt(e){return Qo(Ne,e)}function xu(e){return ea(Ne,e)}function Du(e){return ta(Ne,e)}function Ru(e){return ra(Ne,e)}function Lu(e){return ia(Ne,e)}const At=M("ZodBoolean",(e,t)=>{dr.init(e,t),Q.init(e,t)});function Wa(e){return sa(At,e)}const Tt=M("ZodBigInt",(e,t)=>{fr.init(e,t),Q.init(e,t),e.gte=(r,n)=>e.check(he(r,n)),e.min=(r,n)=>e.check(he(r,n)),e.gt=(r,n)=>e.check(Le(r,n)),e.gte=(r,n)=>e.check(he(r,n)),e.min=(r,n)=>e.check(he(r,n)),e.lt=(r,n)=>e.check(Re(r,n)),e.lte=(r,n)=>e.check(_e(r,n)),e.max=(r,n)=>e.check(_e(r,n)),e.positive=r=>e.check(Le(BigInt(0),r)),e.negative=r=>e.check(Re(BigInt(0),r)),e.nonpositive=r=>e.check(_e(BigInt(0),r)),e.nonnegative=r=>e.check(he(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(Ge(r,n)),e.minValue=e._zod.computed.minimum??null,e.maxValue=e._zod.computed.maximum??null,e.format=e._zod.computed.format??null});function Au(e){return oa(Tt,e)}const gi=M("ZodBigIntFormat",(e,t)=>{co.init(e,t),Tt.init(e,t)});function Tu(e){return ca(gi,e)}function Ou(e){return ha(gi,e)}const Za=M("ZodSymbol",(e,t)=>{ho.init(e,t),Q.init(e,t)});function Iu(e){return la(Za,e)}const qa=M("ZodUndefined",(e,t)=>{lo.init(e,t),Q.init(e,t)});function Bu(e){return ua(qa,e)}const Ka=M("ZodNull",(e,t)=>{uo.init(e,t),Q.init(e,t)});function Va(e){return da(Ka,e)}const Ga=M("ZodAny",(e,t)=>{fo.init(e,t),Q.init(e,t)});function Pu(e){return fa(Ga,e)}const vi=M("ZodUnknown",(e,t)=>{_r.init(e,t),Q.init(e,t)});function _t(e){return _a(vi,e)}const Ja=M("ZodNever",(e,t)=>{_o.init(e,t),Q.init(e,t)});function Ot(e){return pa(Ja,e)}const Ya=M("ZodVoid",(e,t)=>{po.init(e,t),Q.init(e,t)});function Mu(e){return ma(Ya,e)}const bi=M("ZodDate",(e,t)=>{mo.init(e,t),Q.init(e,t),e.min=(n,g)=>e.check(he(n,g)),e.max=(n,g)=>e.check(_e(n,g));const r=e._zod.computed;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function $u(e){return ga(bi,e)}const Xa=M("ZodArray",(e,t)=>{go.init(e,t),Q.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ze(r,n)),e.nonempty=r=>e.check(ze(1,r)),e.max=(r,n)=>e.check(xt(r,n)),e.length=(r,n)=>e.check(Dt(r,n))});function Si(e,t){return ka(Xa,e,t)}function zu(e){const t=e._zod.def.shape;return hc(Object.keys(t))}const It=M("ZodObject",(e,t)=>{vo.init(e,t),Q.init(e,t),Ee(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>ac(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_t()}),e.loose=()=>e.clone({...e._zod.def,catchall:_t()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ot()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Ls(e,r),e.merge=r=>As(e,r),e.pick=r=>Ds(e,r),e.omit=r=>Rs(e,r),e.partial=(...r)=>Ts(Ci,e,r[0]),e.required=(...r)=>Os(Ei,e,r[0])});function Hu(e,t){const r={type:"object",get shape(){return Fe(this,"shape",{...e}),this.shape},...H(t)};return new It(r)}function Fu(e,t){return new It({type:"object",get shape(){return Fe(this,"shape",{...e}),this.shape},catchall:Ot(),...H(t)})}function Nu(e,t){return new It({type:"object",get shape(){return Fe(this,"shape",{...e}),this.shape},catchall:_t(),...H(t)})}const Qa=M("ZodUnion",(e,t)=>{pr.init(e,t),Q.init(e,t),e.options=t.options});function Bt(e,t){return new Qa({type:"union",options:e,...H(t)})}const ec=M("ZodDiscriminatedUnion",(e,t)=>{So.init(e,t),Q.init(e,t)});function ju(...e){typeof e[0]=="string"&&(e=e.slice(1));const[t,r]=e;return new ec({type:"union",options:t,...H(r)})}const tc=M("ZodIntersection",(e,t)=>{yo.init(e,t),Q.init(e,t)});function rc(e,t,r){return new tc({type:"intersection",left:e,right:t,...H(r)})}const ic=M("ZodTuple",(e,t)=>{Et.init(e,t),Q.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Uu(e,t,r){const n=t instanceof X,g=n?r:t,E=n?t:null;return new ic({type:"tuple",items:e,rest:E,...H(g)})}const yi=M("ZodRecord",(e,t)=>{wo.init(e,t),Q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function sc(e,t,r){return new yi({type:"record",keyType:e,valueType:t,...H(r)})}function Wu(e,t,r){return new yi({type:"record",keyType:Bt([e,Ot()]),valueType:t,...H(r)})}const nc=M("ZodMap",(e,t)=>{Co.init(e,t),Q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Zu(e,t,r){return new nc({type:"map",keyType:e,valueType:t,...H(r)})}const oc=M("ZodSet",(e,t)=>{Eo.init(e,t),Q.init(e,t),e.min=(...r)=>e.check(Je(...r)),e.nonempty=r=>e.check(Je(1,r)),e.max=(...r)=>e.check(kt(...r)),e.size=(...r)=>e.check(Fr(...r))});function qu(e,t){return new oc({type:"set",valueType:e,...H(t)})}const Ye=M("ZodEnum",(e,t)=>{ko.init(e,t),Q.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,g)=>{const E={};for(const C of n)if(r.has(C))E[C]=t.entries[C];else throw new Error(`Key ${C} not found in enum`);return new Ye({...t,checks:[],...H(g),entries:E})},e.exclude=(n,g)=>{const E={...t.entries};for(const C of n)if(r.has(C))delete E[C];else throw new Error(`Key ${C} not found in enum`);return new Ye({...t,checks:[],...H(g),entries:E})}});function ac(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ye({type:"enum",entries:r,...H(t)})}function Ku(e,t){return new Ye({type:"enum",entries:e,...H(t)})}const cc=M("ZodLiteral",(e,t)=>{xo.init(e,t),Q.init(e,t),e.values=new Set(t.values)});function hc(e,t){return new cc({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}const lc=M("ZodFile",(e,t)=>{Do.init(e,t),Q.init(e,t),e.min=(r,n)=>e.check(Je(r,n)),e.max=(r,n)=>e.check(kt(r,n)),e.mime=(r,n)=>e.check(Kr(r,n))});function Vu(e){return Da(lc,e)}const uc=M("ZodTransform",(e,t)=>{Ro.init(e,t),Q.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=E=>{if(typeof E=="string")r.issues.push(Me(E,r.value,t));else{const C=E;C.fatal&&(C.continue=!1),C.code??(C.code="custom"),C.input??(C.input=r.value),C.inst??(C.inst=e),C.continue??(C.continue=!t.abort),r.issues.push(Me(C))}};const g=t.transform(r.value,r);return g instanceof Promise?g.then(E=>(r.value=E,r)):(r.value=g,r)}});function wi(e,t){return new uc({type:"transform",transform:e,...H(t)})}const Ci=M("ZodOptional",(e,t)=>{Lo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pt(e,t){return new Ci({type:"optional",innerType:e,...H(t)})}const dc=M("ZodNullable",(e,t)=>{Ao.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mt(e,t){return new dc({type:"nullable",innerType:e,...H(t)})}function Gu(e){return pt(mt(e))}const fc=M("ZodDefault",(e,t)=>{To.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _c(e,t,r){return new fc({type:"default",defaultValue:typeof t=="function"?t:()=>t,innerType:e,...H(r)})}const Ei=M("ZodNonOptional",(e,t)=>{Oo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new Ei({type:"nonoptional",innerType:e,...H(t)})}const mc=M("ZodSuccess",(e,t)=>{Io.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ju(e,t){return new mc({type:"success",innerType:e,...H(t)})}const gc=M("ZodCatch",(e,t)=>{Bo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vc(e,t,r){return new gc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t,...H(r)})}const bc=M("ZodNaN",(e,t)=>{Po.init(e,t),Q.init(e,t)});function Yu(e){return ba(bc,e)}const ki=M("ZodPipe",(e,t)=>{mr.init(e,t),Q.init(e,t),e.in=t.in,e.out=t.out});function gt(e,t,r){return new ki({type:"pipe",in:e,out:t,...H(r)})}const Sc=M("ZodReadonly",(e,t)=>{Mo.init(e,t),Q.init(e,t)});function yc(e,t){return new Sc({type:"readonly",innerType:e,...H(t)})}const wc=M("ZodTemplateLiteral",(e,t)=>{$o.init(e,t),Q.init(e,t)});function Xu(e,t){return new wc({type:"template_literal",parts:e,...H(t)})}const Cc=M("ZodLazy",(e,t)=>{Ho.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Ec(e){return new Cc({type:"lazy",getter:e})}const kc=M("ZodPromise",(e,t)=>{zo.init(e,t),Q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qu(e,t){return new kc({type:"promise",innerType:e,...H(t)})}const Pt=M("ZodCustom",(e,t)=>{Fo.init(e,t),Q.init(e,t)});function xc(e,t){const r=new oe({check:"custom",...H(t)});return r._zod.check=e,r}function ed(e,t){return Rt(Pt,e??(()=>!0),t)}function Dc(e,t={}){return Rt(Pt,e,t)}function Rc(e,t){const r=xc(n=>(n.addIssue=g=>{if(typeof g=="string")n.issues.push(Me(g,n.value,r._zod.def));else{const E=g;E.fatal&&(E.continue=!1),E.code??(E.code="custom"),E.input??(E.input=n.value),E.inst??(E.inst=r),E.continue??(E.continue=!r._zod.def.abort),n.issues.push(Me(E))}},e(n.value,n)),t);return r}function td(e,t={error:`Input not instance of ${e.name}`}){return new Pt({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...H(t)})}const rd=Ra.bind(null,{Pipe:ki,Boolean:At,Unknown:vi});function id(e){const t=Ec(()=>Bt([Xt(e),Ua(),Wa(),Va(),Si(t),sc(Xt(),t)]));return t}function sd(e,t,r){return gt(wi(e,r),t,r)}const nd={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},od=Object.freeze({status:"aborted"}),ad=od;function cd(e){ae({customError:e})}function hd(){return ae().customError}ae(No());const ld=Object.freeze(Object.defineProperty({__proto__:null,$brand:bs,$input:Wo,$output:Uo,NEVER:ad,ZodAny:Ga,ZodArray:Xa,ZodBase64:fi,ZodBase64URL:_i,ZodBigInt:Tt,ZodBigIntFormat:gi,ZodBoolean:At,ZodCIDRv4:ui,ZodCIDRv6:di,ZodCUID:si,ZodCUID2:ni,ZodCatch:gc,ZodCustom:Pt,ZodDate:bi,ZodDefault:fc,ZodDiscriminatedUnion:ec,ZodE164:pi,ZodEmail:ei,ZodEmoji:ri,ZodEnum:Ye,ZodError:et,ZodFile:lc,ZodGUID:ft,ZodIPv4:hi,ZodIPv6:li,ZodIntersection:tc,ZodIssueCode:nd,ZodJWT:mi,ZodKSUID:ci,ZodLazy:Cc,ZodLiteral:cc,ZodMap:nc,ZodNaN:bc,ZodNanoID:ii,ZodNever:Ja,ZodNonOptional:Ei,ZodNull:Ka,ZodNullable:dc,ZodNumber:Lt,ZodNumberFormat:Ne,ZodObject:It,ZodOptional:Ci,ZodPipe:ki,ZodPromise:kc,ZodReadonly:Sc,ZodRecord:yi,ZodSet:oc,ZodString:Qr,ZodStringFormat:re,ZodSuccess:mc,ZodSymbol:Za,ZodTemplateLiteral:wc,ZodTransform:uc,ZodTuple:ic,ZodType:Q,ZodULID:oi,ZodURL:ti,ZodUUID:Se,ZodUndefined:qa,ZodUnion:Qa,ZodUnknown:vi,ZodVoid:Ya,ZodXID:ai,_ZodString:Xr,_default:_c,any:Pu,array:Si,base64:wu,base64url:Cu,bigint:Au,boolean:Wa,catch:vc,check:xc,cidrv4:Su,cidrv6:yu,clone:ge,coerce:iu,config:ae,core:Jl,cuid:fu,cuid2:_u,custom:ed,date:$u,discriminatedUnion:ju,e164:Eu,email:su,emoji:uu,endsWith:qr,enum:ac,file:Vu,float32:xu,float64:Du,function:La,getErrorMap:hd,globalRegistry:Ce,gt:Le,gte:he,guid:nu,includes:Wr,instanceof:td,int:Qt,int32:Ru,int64:Tu,intersection:rc,ipv4:vu,ipv6:bu,iso:Yl,json:id,jwt:ku,keyof:zu,ksuid:gu,lazy:Ec,length:Dt,literal:hc,locales:jo,looseObject:Nu,lowercase:jr,lt:Re,lte:_e,map:Zu,maxLength:xt,maxSize:kt,mime:Kr,minLength:ze,minSize:Je,multipleOf:Ge,nan:Yu,nanoid:du,nativeEnum:Ku,negative:ya,never:Ot,nonnegative:Ca,nonoptional:pc,nonpositive:wa,normalize:Vr,null:Va,nullable:mt,nullish:Gu,number:Ua,object:Hu,optional:pt,overwrite:Te,parse:Ha,parseAsync:Na,partialRecord:Wu,pipe:gt,positive:Sa,preprocess:sd,prettifyError:$s,promise:Qu,property:Ea,readonly:yc,record:sc,refine:Dc,regex:Nr,regexes:pn,registry:vr,safeParse:Fa,safeParseAsync:ja,set:qu,setErrorMap:cd,size:Fr,startsWith:Zr,strictObject:Fu,string:Xt,stringbool:rd,success:Ju,superRefine:Rc,symbol:Iu,templateLiteral:Xu,toJSONSchema:Aa,toLowerCase:Jr,toUpperCase:Yr,transform:wi,treeifyError:Ps,trim:Gr,tuple:Uu,uint32:Lu,uint64:Ou,ulid:pu,undefined:Bu,union:Bt,unknown:_t,uppercase:Ur,url:lu,uuid:ou,uuidv4:au,uuidv6:cu,uuidv7:hu,void:Mu,xid:mu},Symbol.toStringTag,{value:"Module"}));function ud(e){const t=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(e);if(!t)return;if(!t[1]||!t[2]||!t[3]||!t[4])throw new Error(`Mouse event: Invalid match for data ${e}`);const r=parseInt(t[1],10),n=parseInt(t[2],10),g=parseInt(t[3],10),E=t[4]==="m";return console.log(`Mouse event: buttonCode=${r}, column=${n}, row=${g}, isRelease=${E}`),e}function Lc(e,t){const r=new $h.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),n=gs.macchiato.colors;r.options.theme={background:n.base.hex,black:n.crust.hex,brightBlack:n.surface2.hex,blue:n.blue.hex,brightBlue:n.blue.hex,brightCyan:n.sky.hex,brightRed:n.maroon.hex,brightYellow:n.yellow.hex,cursor:n.text.hex,cyan:n.sky.hex,foreground:n.text.hex,green:n.green.hex,magenta:n.lavender.hex,red:n.red.hex,white:n.text.hex,yellow:n.yellow.hex};const g=new Ph.FitAddon;return r.loadAddon(g),r.open(e),g.fit(),window.addEventListener("resize",()=>{g.fit()}),r.onData(E=>{if(typeof E!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(E)}'`);const C=ud(E);C&&t.onMouseEvent(C)}),r.onKey(E=>{t.onKeyPress(E)}),r}function Ac(){let e=ld.string().safeParse(sessionStorage.getItem("tabId")).data;return e||(e=Math.random().toString(36),sessionStorage.setItem("tabId",e)),{tabId:e}}class dd{constructor(t){me(this,"ready");me(this,"tabId");me(this,"terminal");me(this,"trpc");const r=us({links:[ps({condition:E=>E.type==="subscription",true:ms({url:"/trpc"}),false:_s({url:"/trpc"})})]});this.trpc=r,this.tabId=Ac();const n=this.tabId,g=Lc(t,{onMouseEvent(E){r.neovim.sendStdin.mutate({tabId:n,data:E}).catch(C=>{console.error("Error sending mouse event",C)})},onKeyPress(E){r.neovim.sendStdin.mutate({tabId:n,data:E.key})}});this.terminal=g,this.ready=new Promise(E=>{console.log("Subscribing to stdout"),r.neovim.initializeStdout.subscribe({client:n},{onStarted(){E()},onData(C){g.write(C)},onError(C){console.error("Error from the application",C)}})})}async startNeovim(t){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:t.filename,additionalEnvironmentVariables:t.additionalEnvironmentVariables,startupScriptModifications:t.startupScriptModifications,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}},tabId:this.tabId})}async runBlockingShellCommand(t){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}async runLuaCode(t){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...t,tabId:this.tabId})}async waitForLuaCode(t){await this.ready;try{return await this.trpc.neovim.waitForLuaCode.mutate({...t,tabId:this.tabId})}catch(r){throw r}}async runExCommand(t){return await this.ready,this.trpc.neovim.runExCommand.mutate({...t,tabId:this.tabId})}}class fd{constructor(t){me(this,"ready");me(this,"tabId");me(this,"terminal");me(this,"trpc");const r=us({links:[ps({condition:E=>E.type==="subscription",true:ms({url:"/trpc"}),false:_s({url:"/trpc"})})]});this.trpc=r,this.tabId=Ac();const n=this.tabId,g=Lc(t,{onMouseEvent(E){r.terminal.sendStdin.mutate({tabId:n,data:E}).catch(C=>{console.error("Error sending mouse event",C)})},onKeyPress(E){r.terminal.sendStdin.mutate({tabId:n,data:E.key})}});this.terminal=g,this.ready=new Promise(E=>{console.log("Subscribing to stdout"),r.terminal.onStdout.subscribe({client:n},{onStarted(){E()},onData(C){g.write(C)},onError(C){console.error("Error from the application",C)}})})}async startTerminalApplication(t){return await this.ready,await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:t.additionalEnvironmentVariables,commandToRun:t.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(t){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}}class Tc{constructor(t){me(this,"value");this.factory=t}get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const xi=document.querySelector("#app");if(!xi)throw new Error("No app element found");const _d=new Tc(()=>new dd(xi)),pd=new Tc(()=>new fd(xi));window.startNeovim=async function(e){const t=_d.get(),r=await t.startNeovim({additionalEnvironmentVariables:e==null?void 0:e.additionalEnvironmentVariables,filename:(e==null?void 0:e.filename)??"initial-file.txt",startupScriptModifications:(e==null?void 0:e.startupScriptModifications)??[]});return{runBlockingShellCommand(g){return t.runBlockingShellCommand(g)},runLuaCode(g){return t.runLuaCode(g)},waitForLuaCode(g){return t.waitForLuaCode(g)},runExCommand(g){return t.runExCommand(g)},dir:r}};window.startTerminalApplication=async function(e){const t=pd.get();return{dir:await t.startTerminalApplication(e),runBlockingShellCommand(g){return t.runBlockingShellCommand(g)}}};
|