@runmedev/react-console 3.16.0 → 3.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
- "use strict";var ou=Object.defineProperty;var au=(e,t,r)=>t in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>au(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cu=require("react/jsx-runtime"),Fi=require("react"),La=require("@bufbuild/protobuf/wkt"),xe=require("@bufbuild/protobuf");var rn=function(e,t){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},rn(e,t)};function pt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rn(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function lu(e,t,r,i){function s(h){return h instanceof r?h:new r(function(p){p(h)})}return new(r||(r=Promise))(function(h,p){function n(g){try{a(i.next(g))}catch(d){p(d)}}function o(g){try{a(i.throw(g))}catch(d){p(d)}}function a(g){g.done?h(g.value):s(g.value).then(n,o)}a((i=i.apply(e,[])).next())})}function xa(e,t){var r={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},i,s,h,p=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return p.next=n(0),p.throw=n(1),p.return=n(2),typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function n(a){return function(g){return o([a,g])}}function o(a){if(i)throw new TypeError("Generator is already executing.");for(;p&&(p=0,a[0]&&(r=0)),r;)try{if(i=1,s&&(h=a[0]&2?s.return:a[0]?s.throw||((h=s.return)&&h.call(s),0):s.next)&&!(h=h.call(s,a[1])).done)return h;switch(s=0,h&&(a=[a[0]&2,h.value]),a[0]){case 0:case 1:h=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,s=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(h=r.trys,!(h=h.length>0&&h[h.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!h||a[1]>h[0]&&a[1]<h[3])){r.label=a[1];break}if(a[0]===6&&r.label<h[1]){r.label=h[1],h=a;break}if(h&&r.label<h[2]){r.label=h[2],r.ops.push(a);break}h[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(g){a=[6,g],s=0}finally{i=h=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function Ft(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rt(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),s,h=[],p;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)h.push(s.value)}catch(n){p={error:n}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(p)throw p.error}}return h}function dt(e,t,r){if(arguments.length===2)for(var i=0,s=t.length,h;i<s;i++)(h||!(i in t))&&(h||(h=Array.prototype.slice.call(t,0,i)),h[i]=t[i]);return e.concat(h||Array.prototype.slice.call(t))}function xt(e){return this instanceof xt?(this.v=e,this):new xt(e)}function uu(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),s,h=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),n("next"),n("throw"),n("return",p),s[Symbol.asyncIterator]=function(){return this},s;function p(b){return function(C){return Promise.resolve(C).then(b,d)}}function n(b,C){i[b]&&(s[b]=function(m){return new Promise(function(c,u){h.push([b,m,c,u])>1||o(b,m)})},C&&(s[b]=C(s[b])))}function o(b,C){try{a(i[b](C))}catch(m){v(h[0][3],m)}}function a(b){b.value instanceof xt?Promise.resolve(b.value.v).then(g,d):v(h[0][2],b)}function g(b){o("next",b)}function d(b){o("throw",b)}function v(b,C){b(C),h.shift(),h.length&&o(h[0][0],h[0][1])}}function du(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ft=="function"?Ft(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(h){r[h]=e[h]&&function(p){return new Promise(function(n,o){p=e[h](p),s(n,o,p.done,p.value)})}}function s(h,p,n,o){Promise.resolve(o).then(function(a){h({value:a,done:n})},p)}}/**
1
+ "use strict";var uh=Object.defineProperty;var dh=(e,t,r)=>t in e?uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>dh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const hh=require("react/jsx-runtime"),ln=require("react");var xn=function(e,t){return xn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},xn(e,t)};function Ct(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xn(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function fh(e,t,r,i){function n(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function s(g){try{c(i.next(g))}catch(f){d(f)}}function o(g){try{c(i.throw(g))}catch(f){d(f)}}function c(g){g.done?a(g.value):n(g.value).then(s,o)}c((i=i.apply(e,[])).next())})}function Zc(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,d=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return d.next=s(0),d.throw=s(1),d.return=s(2),typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function s(c){return function(g){return o([c,g])}}function o(c){if(i)throw new TypeError("Generator is already executing.");for(;d&&(d=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(a=c[0]&2?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(g){c=[6,g],n=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function qt(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ut(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,a=[],d;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){d={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(d)throw d.error}}return a}function _t(e,t,r){if(arguments.length===2)for(var i=0,n=t.length,a;i<n;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}function jt(e){return this instanceof jt?(this.v=e,this):new jt(e)}function ph(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",d),n[Symbol.asyncIterator]=function(){return this},n;function d(_){return function(w){return Promise.resolve(w).then(_,f)}}function s(_,w){i[_]&&(n[_]=function(v){return new Promise(function(l,h){a.push([_,v,l,h])>1||o(_,v)})},w&&(n[_]=w(n[_])))}function o(_,w){try{c(i[_](w))}catch(v){m(a[0][3],v)}}function c(_){_.value instanceof jt?Promise.resolve(_.value.v).then(g,f):m(a[0][2],_)}function g(_){o("next",_)}function f(_){o("throw",_)}function m(_,w){_(w),a.shift(),a.length&&o(a[0][0],a[0][1])}}function gh(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof qt=="function"?qt(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(a){r[a]=e[a]&&function(d){return new Promise(function(s,o){d=e[a](d),n(s,o,d.done,d.value)})}}function n(a,d,s,o){Promise.resolve(o).then(function(c){a({value:c,done:s})},d)}}/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const qr=globalThis,Rn=qr.ShadowRoot&&(qr.ShadyCSS===void 0||qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bn=Symbol(),Ss=new WeakMap;let Da=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Bn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Rn&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Ss.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Ss.set(t,e))}return e}toString(){return this.cssText}};const sr=e=>new Da(typeof e=="string"?e:e+"",void 0,Bn),Xe=(e,...t)=>{const r=e.length===1?e[0]:t.reduce(((i,s,h)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[h+1]),e[0]);return new Da(r,e,Bn)},hu=(e,t)=>{if(Rn)e.adoptedStyleSheets=t.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(const r of t){const i=document.createElement("style"),s=qr.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=r.cssText,e.appendChild(i)}},Es=Rn?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return sr(r)})(e):e;/**
5
+ */const gi=globalThis,ls=gi.ShadowRoot&&(gi.ShadyCSS===void 0||gi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,us=Symbol(),_o=new WeakMap;let Kc=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==us)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ls&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=_o.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&_o.set(t,e))}return e}toString(){return this.cssText}};const _r=e=>new Kc(typeof e=="string"?e:e+"",void 0,us),et=(e,...t)=>{const r=e.length===1?e[0]:t.reduce(((i,n,a)=>i+(d=>{if(d._$cssResult$===!0)return d.cssText;if(typeof d=="number")return d;throw Error("Value passed to 'css' function must be a 'css' function result: "+d+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[a+1]),e[0]);return new Kc(r,e,us)},mh=(e,t)=>{if(ls)e.adoptedStyleSheets=t.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(const r of t){const i=document.createElement("style"),n=gi.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,e.appendChild(i)}},yo=ls?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return _r(r)})(e):e;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:fu,defineProperty:pu,getOwnPropertyDescriptor:gu,getOwnPropertyNames:vu,getOwnPropertySymbols:mu,getPrototypeOf:_u}=Object,Mt=globalThis,Cs=Mt.trustedTypes,bu=Cs?Cs.emptyScript:"",ws=Mt.reactiveElementPolyfillSupport,cr=(e,t)=>e,ai={toAttribute(e,t){switch(t){case Boolean:e=e?bu:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Nn=(e,t)=>!fu(e,t),ks={attribute:!0,type:String,converter:ai,reflect:!1,useDefault:!1,hasChanged:Nn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Mt.litPropertyMetadata??(Mt.litPropertyMetadata=new WeakMap);let Nt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ks){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&pu(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){const{get:i,set:s}=gu(this.prototype,e)??{get(){return this[t]},set(h){this[t]=h}};return{get:i,set(h){const p=i==null?void 0:i.call(this);s==null||s.call(this,h),this.requestUpdate(e,p,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ks}static _$Ei(){if(this.hasOwnProperty(cr("elementProperties")))return;const e=_u(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(cr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(cr("properties"))){const t=this.properties,r=[...vu(t),...mu(t)];for(const i of r)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)t.unshift(Es(i))}else e!==void 0&&t.push(Es(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return hu(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var r;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const h=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:ai).toAttribute(t,i.type);this._$Em=e,h==null?this.removeAttribute(s):this.setAttribute(s,h),this._$Em=null}}_$AK(e,t){var r,i;const s=this.constructor,h=s._$Eh.get(e);if(h!==void 0&&this._$Em!==h){const p=s.getPropertyOptions(h),n=typeof p.converter=="function"?{fromAttribute:p.converter}:((r=p.converter)==null?void 0:r.fromAttribute)!==void 0?p.converter:ai;this._$Em=h;const o=n.fromAttribute(t,p.type);this[h]=o??((i=this._$Ej)==null?void 0:i.get(h))??o,this._$Em=null}}requestUpdate(e,t,r){var i;if(e!==void 0){const s=this.constructor,h=this[e];if(r??(r=s.getPropertyOptions(e)),!((r.hasChanged??Nn)(h,t)||r.useDefault&&r.reflect&&h===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},h){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,h??t??this[e]),s!==!0||h!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,h]of this._$Ep)this[s]=h;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,h]of i){const{wrapped:p}=h,n=this[s];p!==!0||this._$AL.has(s)||n===void 0||this.C(s,void 0,h,n)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach((i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)})),this.update(r)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};Nt.elementStyles=[],Nt.shadowRootOptions={mode:"open"},Nt[cr("elementProperties")]=new Map,Nt[cr("finalized")]=new Map,ws==null||ws({ReactiveElement:Nt}),(Mt.reactiveElementVersions??(Mt.reactiveElementVersions=[])).push("2.1.1");/**
9
+ */const{is:vh,defineProperty:bh,getOwnPropertyDescriptor:_h,getOwnPropertyNames:yh,getOwnPropertySymbols:Sh,getPrototypeOf:Eh}=Object,er=globalThis,So=er.trustedTypes,wh=So?So.emptyScript:"",Eo=er.reactiveElementPolyfillSupport,Er=(e,t)=>e,wi={toAttribute(e,t){switch(t){case Boolean:e=e?wh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},ds=(e,t)=>!vh(e,t),wo={attribute:!0,type:String,converter:wi,reflect:!1,useDefault:!1,hasChanged:ds};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),er.litPropertyMetadata??(er.litPropertyMetadata=new WeakMap);let Xt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=wo){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&bh(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){const{get:i,set:n}=_h(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const d=i==null?void 0:i.call(this);n==null||n.call(this,a),this.requestUpdate(e,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??wo}static _$Ei(){if(this.hasOwnProperty(Er("elementProperties")))return;const e=Eh(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Er("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Er("properties"))){const t=this.properties,r=[...yh(t),...Sh(t)];for(const i of r)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)t.unshift(yo(i))}else e!==void 0&&t.push(yo(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mh(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var r;const i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){const a=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:wi).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(e,t){var r,i;const n=this.constructor,a=n._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const d=n.getPropertyOptions(a),s=typeof d.converter=="function"?{fromAttribute:d.converter}:((r=d.converter)==null?void 0:r.fromAttribute)!==void 0?d.converter:wi;this._$Em=a;const o=s.fromAttribute(t,d.type);this[a]=o??((i=this._$Ej)==null?void 0:i.get(a))??o,this._$Em=null}}requestUpdate(e,t,r){var i;if(e!==void 0){const n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??ds)(a,t)||r.useDefault&&r.reflect&&a===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,a]of i){const{wrapped:d}=a,s=this[n];d!==!0||this._$AL.has(n)||s===void 0||this.C(n,void 0,a,s)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(r)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Xt[Er("elementProperties")]=new Map,Xt[Er("finalized")]=new Map,Eo==null||Eo({ReactiveElement:Xt}),(er.reactiveElementVersions??(er.reactiveElementVersions=[])).push("2.1.1");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const ci=globalThis,li=ci.trustedTypes,Is=li?li.createPolicy("lit-html",{createHTML:e=>e}):void 0,Oa="$lit$",ut=`lit$${Math.random().toFixed(9).slice(2)}$`,Fa="?"+ut,yu=`<${Fa}>`,It=document,fr=()=>It.createComment(""),pr=e=>e===null||typeof e!="object"&&typeof e!="function",Ln=Array.isArray,Su=e=>Ln(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Mi=`[
14
- \f\r]`,rr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,As=/-->/g,Ts=/>/g,vt=RegExp(`>|${Mi}(?:([^\\s"'>=/]+)(${Mi}*=${Mi}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Rs=/'/g,Bs=/"/g,Ma=/^(?:script|style|textarea|title)$/i,Eu=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),z=Eu(1),Ut=Symbol.for("lit-noChange"),me=Symbol.for("lit-nothing"),Ns=new WeakMap,bt=It.createTreeWalker(It,129);function Ua(e,t){if(!Ln(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(t):t}const Cu=(e,t)=>{const r=e.length-1,i=[];let s,h=t===2?"<svg>":t===3?"<math>":"",p=rr;for(let n=0;n<r;n++){const o=e[n];let a,g,d=-1,v=0;for(;v<o.length&&(p.lastIndex=v,g=p.exec(o),g!==null);)v=p.lastIndex,p===rr?g[1]==="!--"?p=As:g[1]!==void 0?p=Ts:g[2]!==void 0?(Ma.test(g[2])&&(s=RegExp("</"+g[2],"g")),p=vt):g[3]!==void 0&&(p=vt):p===vt?g[0]===">"?(p=s??rr,d=-1):g[1]===void 0?d=-2:(d=p.lastIndex-g[2].length,a=g[1],p=g[3]===void 0?vt:g[3]==='"'?Bs:Rs):p===Bs||p===Rs?p=vt:p===As||p===Ts?p=rr:(p=vt,s=void 0);const b=p===vt&&e[n+1].startsWith("/>")?" ":"";h+=p===rr?o+yu:d>=0?(i.push(a),o.slice(0,d)+Oa+o.slice(d)+ut+b):o+ut+(d===-2?n:b)}return[Ua(e,h+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class gr{constructor({strings:t,_$litType$:r},i){let s;this.parts=[];let h=0,p=0;const n=t.length-1,o=this.parts,[a,g]=Cu(t,r);if(this.el=gr.createElement(a,i),bt.currentNode=this.el.content,r===2||r===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=bt.nextNode())!==null&&o.length<n;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(Oa)){const v=g[p++],b=s.getAttribute(d).split(ut),C=/([.?@])?(.*)/.exec(v);o.push({type:1,index:h,name:C[2],strings:b,ctor:C[1]==="."?ku:C[1]==="?"?Iu:C[1]==="@"?Au:Ci}),s.removeAttribute(d)}else d.startsWith(ut)&&(o.push({type:6,index:h}),s.removeAttribute(d));if(Ma.test(s.tagName)){const d=s.textContent.split(ut),v=d.length-1;if(v>0){s.textContent=li?li.emptyScript:"";for(let b=0;b<v;b++)s.append(d[b],fr()),bt.nextNode(),o.push({type:2,index:++h});s.append(d[v],fr())}}}else if(s.nodeType===8)if(s.data===Fa)o.push({type:2,index:h});else{let d=-1;for(;(d=s.data.indexOf(ut,d+1))!==-1;)o.push({type:7,index:h}),d+=ut.length-1}h++}}static createElement(t,r){const i=It.createElement("template");return i.innerHTML=t,i}}function Vt(e,t,r=e,i){var s,h;if(t===Ut)return t;let p=i!==void 0?(s=r._$Co)==null?void 0:s[i]:r._$Cl;const n=pr(t)?void 0:t._$litDirective$;return(p==null?void 0:p.constructor)!==n&&((h=p==null?void 0:p._$AO)==null||h.call(p,!1),n===void 0?p=void 0:(p=new n(e),p._$AT(e,r,i)),i!==void 0?(r._$Co??(r._$Co=[]))[i]=p:r._$Cl=p),p!==void 0&&(t=Vt(e,p._$AS(e,t.values),p,i)),t}class wu{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:r},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??It).importNode(r,!0);bt.currentNode=s;let h=bt.nextNode(),p=0,n=0,o=i[0];for(;o!==void 0;){if(p===o.index){let a;o.type===2?a=new Lr(h,h.nextSibling,this,t):o.type===1?a=new o.ctor(h,o.name,o.strings,this,t):o.type===6&&(a=new Tu(h,this,t)),this._$AV.push(a),o=i[++n]}p!==(o==null?void 0:o.index)&&(h=bt.nextNode(),p++)}return bt.currentNode=It,s}p(t){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,r),r+=i.strings.length-2):i._$AI(t[r])),r++}}class Lr{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,r,i,s){this.type=2,this._$AH=me,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=Vt(this,t,r),pr(t)?t===me||t==null||t===""?(this._$AH!==me&&this._$AR(),this._$AH=me):t!==this._$AH&&t!==Ut&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Su(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==me&&pr(this._$AH)?this._$AA.nextSibling.data=t:this.T(It.createTextNode(t)),this._$AH=t}$(t){var r;const{values:i,_$litType$:s}=t,h=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=gr.createElement(Ua(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===h)this._$AH.p(i);else{const p=new wu(h,this),n=p.u(this.options);p.p(i),this.T(n),this._$AH=p}}_$AC(t){let r=Ns.get(t.strings);return r===void 0&&Ns.set(t.strings,r=new gr(t)),r}k(t){Ln(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,s=0;for(const h of t)s===r.length?r.push(i=new Lr(this.O(fr()),this.O(fr()),this,this.options)):i=r[s],i._$AI(h),s++;s<r.length&&(this._$AR(i&&i._$AB.nextSibling,s),r.length=s)}_$AR(t=this._$AA.nextSibling,r){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,r);t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var r;this._$AM===void 0&&(this._$Cv=t,(r=this._$AP)==null||r.call(this,t))}}class Ci{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,i,s,h){this.type=1,this._$AH=me,this._$AN=void 0,this.element=t,this.name=r,this._$AM=s,this.options=h,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=me}_$AI(t,r=this,i,s){const h=this.strings;let p=!1;if(h===void 0)t=Vt(this,t,r,0),p=!pr(t)||t!==this._$AH&&t!==Ut,p&&(this._$AH=t);else{const n=t;let o,a;for(t=h[0],o=0;o<h.length-1;o++)a=Vt(this,n[i+o],r,o),a===Ut&&(a=this._$AH[o]),p||(p=!pr(a)||a!==this._$AH[o]),a===me?t=me:t!==me&&(t+=(a??"")+h[o+1]),this._$AH[o]=a}p&&!s&&this.j(t)}j(t){t===me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ku extends Ci{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===me?void 0:t}}class Iu extends Ci{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==me)}}class Au extends Ci{constructor(t,r,i,s,h){super(t,r,i,s,h),this.type=5}_$AI(t,r=this){if((t=Vt(this,t,r,0)??me)===Ut)return;const i=this._$AH,s=t===me&&i!==me||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,h=t!==me&&(i===me||s);s&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,t):this._$AH.handleEvent(t)}}class Tu{constructor(t,r,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Vt(this,t)}}const Ls=ci.litHtmlPolyfillSupport;Ls==null||Ls(gr,Lr),(ci.litHtmlVersions??(ci.litHtmlVersions=[])).push("3.3.1");const Ru=(e,t,r)=>{const i=(r==null?void 0:r.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const h=(r==null?void 0:r.renderBefore)??null;i._$litPart$=s=new Lr(t.insertBefore(fr(),h),h,void 0,r??{})}return s._$AI(e),s};/**
13
+ */const Ci=globalThis,ki=Ci.trustedTypes,Co=ki?ki.createPolicy("lit-html",{createHTML:e=>e}):void 0,Yc="$lit$",bt=`lit$${Math.random().toFixed(9).slice(2)}$`,Xc="?"+bt,Ch=`<${Xc}>`,Pt=document,Ar=()=>Pt.createComment(""),Nr=e=>e===null||typeof e!="object"&&typeof e!="function",hs=Array.isArray,kh=e=>hs(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",un=`[
14
+ \f\r]`,mr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ko=/-->/g,Io=/>/g,Nt=RegExp(`>|${un}(?:([^\\s"'>=/]+)(${un}*=${un}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ao=/'/g,No=/"/g,Jc=/^(?:script|style|textarea|title)$/i,Ih=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),j=Ih(1),tr=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),To=new WeakMap,xt=Pt.createTreeWalker(Pt,129);function jc(e,t){if(!hs(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Co!==void 0?Co.createHTML(t):t}const Ah=(e,t)=>{const r=e.length-1,i=[];let n,a=t===2?"<svg>":t===3?"<math>":"",d=mr;for(let s=0;s<r;s++){const o=e[s];let c,g,f=-1,m=0;for(;m<o.length&&(d.lastIndex=m,g=d.exec(o),g!==null);)m=d.lastIndex,d===mr?g[1]==="!--"?d=ko:g[1]!==void 0?d=Io:g[2]!==void 0?(Jc.test(g[2])&&(n=RegExp("</"+g[2],"g")),d=Nt):g[3]!==void 0&&(d=Nt):d===Nt?g[0]===">"?(d=n??mr,f=-1):g[1]===void 0?f=-2:(f=d.lastIndex-g[2].length,c=g[1],d=g[3]===void 0?Nt:g[3]==='"'?No:Ao):d===No||d===Ao?d=Nt:d===ko||d===Io?d=mr:(d=Nt,n=void 0);const _=d===Nt&&e[s+1].startsWith("/>")?" ":"";a+=d===mr?o+Ch:f>=0?(i.push(c),o.slice(0,f)+Yc+o.slice(f)+bt+_):o+bt+(f===-2?s:_)}return[jc(e,a+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class Tr{constructor({strings:t,_$litType$:r},i){let n;this.parts=[];let a=0,d=0;const s=t.length-1,o=this.parts,[c,g]=Ah(t,r);if(this.el=Tr.createElement(c,i),xt.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(n=xt.nextNode())!==null&&o.length<s;){if(n.nodeType===1){if(n.hasAttributes())for(const f of n.getAttributeNames())if(f.endsWith(Yc)){const m=g[d++],_=n.getAttribute(f).split(bt),w=/([.?@])?(.*)/.exec(m);o.push({type:1,index:a,name:w[2],strings:_,ctor:w[1]==="."?Th:w[1]==="?"?Rh:w[1]==="@"?Bh:Mi}),n.removeAttribute(f)}else f.startsWith(bt)&&(o.push({type:6,index:a}),n.removeAttribute(f));if(Jc.test(n.tagName)){const f=n.textContent.split(bt),m=f.length-1;if(m>0){n.textContent=ki?ki.emptyScript:"";for(let _=0;_<m;_++)n.append(f[_],Ar()),xt.nextNode(),o.push({type:2,index:++a});n.append(f[m],Ar())}}}else if(n.nodeType===8)if(n.data===Xc)o.push({type:2,index:a});else{let f=-1;for(;(f=n.data.indexOf(bt,f+1))!==-1;)o.push({type:7,index:a}),f+=bt.length-1}a++}}static createElement(t,r){const i=Pt.createElement("template");return i.innerHTML=t,i}}function rr(e,t,r=e,i){var n,a;if(t===tr)return t;let d=i!==void 0?(n=r._$Co)==null?void 0:n[i]:r._$Cl;const s=Nr(t)?void 0:t._$litDirective$;return(d==null?void 0:d.constructor)!==s&&((a=d==null?void 0:d._$AO)==null||a.call(d,!1),s===void 0?d=void 0:(d=new s(e),d._$AT(e,r,i)),i!==void 0?(r._$Co??(r._$Co=[]))[i]=d:r._$Cl=d),d!==void 0&&(t=rr(e,d._$AS(e,t.values),d,i)),t}class Nh{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:r},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??Pt).importNode(r,!0);xt.currentNode=n;let a=xt.nextNode(),d=0,s=0,o=i[0];for(;o!==void 0;){if(d===o.index){let c;o.type===2?c=new Kr(a,a.nextSibling,this,t):o.type===1?c=new o.ctor(a,o.name,o.strings,this,t):o.type===6&&(c=new Lh(a,this,t)),this._$AV.push(c),o=i[++s]}d!==(o==null?void 0:o.index)&&(a=xt.nextNode(),d++)}return xt.currentNode=Pt,n}p(t){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,r),r+=i.strings.length-2):i._$AI(t[r])),r++}}class Kr{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,r,i,n){this.type=2,this._$AH=_e,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=rr(this,t,r),Nr(t)?t===_e||t==null||t===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):t!==this._$AH&&t!==tr&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):kh(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_e&&Nr(this._$AH)?this._$AA.nextSibling.data=t:this.T(Pt.createTextNode(t)),this._$AH=t}$(t){var r;const{values:i,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Tr.createElement(jc(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===a)this._$AH.p(i);else{const d=new Nh(a,this),s=d.u(this.options);d.p(i),this.T(s),this._$AH=d}}_$AC(t){let r=To.get(t.strings);return r===void 0&&To.set(t.strings,r=new Tr(t)),r}k(t){hs(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,n=0;for(const a of t)n===r.length?r.push(i=new Kr(this.O(Ar()),this.O(Ar()),this,this.options)):i=r[n],i._$AI(a),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(t=this._$AA.nextSibling,r){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,r);t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var r;this._$AM===void 0&&(this._$Cv=t,(r=this._$AP)==null||r.call(this,t))}}class Mi{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,i,n,a){this.type=1,this._$AH=_e,this._$AN=void 0,this.element=t,this.name=r,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=_e}_$AI(t,r=this,i,n){const a=this.strings;let d=!1;if(a===void 0)t=rr(this,t,r,0),d=!Nr(t)||t!==this._$AH&&t!==tr,d&&(this._$AH=t);else{const s=t;let o,c;for(t=a[0],o=0;o<a.length-1;o++)c=rr(this,s[i+o],r,o),c===tr&&(c=this._$AH[o]),d||(d=!Nr(c)||c!==this._$AH[o]),c===_e?t=_e:t!==_e&&(t+=(c??"")+a[o+1]),this._$AH[o]=c}d&&!n&&this.j(t)}j(t){t===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Th extends Mi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_e?void 0:t}}class Rh extends Mi{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_e)}}class Bh extends Mi{constructor(t,r,i,n,a){super(t,r,i,n,a),this.type=5}_$AI(t,r=this){if((t=rr(this,t,r,0)??_e)===tr)return;const i=this._$AH,n=t===_e&&i!==_e||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==_e&&(i===_e||n);n&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,t):this._$AH.handleEvent(t)}}class Lh{constructor(t,r,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){rr(this,t)}}const Ro=Ci.litHtmlPolyfillSupport;Ro==null||Ro(Tr,Kr),(Ci.litHtmlVersions??(Ci.litHtmlVersions=[])).push("3.3.1");const xh=(e,t,r)=>{const i=(r==null?void 0:r.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const a=(r==null?void 0:r.renderBefore)??null;i._$litPart$=n=new Kr(t.insertBefore(Ar(),a),a,void 0,r??{})}return n._$AI(e),n};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */const vr=globalThis;class Be extends Nt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const r=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=r.firstChild),r}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ru(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Ut}}var xs;Be._$litElement$=!0,Be.finalized=!0,(xs=vr.litElementHydrateSupport)==null||xs.call(vr,{LitElement:Be});const Ds=vr.litElementPolyfillSupport;Ds==null||Ds({LitElement:Be});(vr.litElementVersions??(vr.litElementVersions=[])).push("4.2.1");/**
19
+ */const Rr=globalThis;class Oe extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const r=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=r.firstChild),r}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=xh(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return tr}}var Bo;Oe._$litElement$=!0,Oe.finalized=!0,(Bo=Rr.litElementHydrateSupport)==null||Bo.call(Rr,{LitElement:Oe});const Lo=Rr.litElementPolyfillSupport;Lo==null||Lo({LitElement:Oe});(Rr.litElementVersions??(Rr.litElementVersions=[])).push("4.2.1");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const Ue=e=>(t,r)=>{r!==void 0?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};/**
23
+ */const Ge=e=>(t,r)=>{r!==void 0?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};/**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Bu={attribute:!0,type:String,converter:ai,reflect:!1,hasChanged:Nn},Nu=(e=Bu,t,r)=>{const{kind:i,metadata:s}=r;let h=globalThis.litPropertyMetadata.get(s);if(h===void 0&&globalThis.litPropertyMetadata.set(s,h=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),h.set(r.name,e),i==="accessor"){const{name:p}=r;return{set(n){const o=t.get.call(this);t.set.call(this,n),this.requestUpdate(p,o,e)},init(n){return n!==void 0&&this.C(p,void 0,e,n),n}}}if(i==="setter"){const{name:p}=r;return function(n){const o=this[p];t.call(this,n),this.requestUpdate(p,o,e)}}throw Error("Unsupported decorator location: "+i)};function G(e){return(t,r)=>typeof r=="object"?Nu(e,t,r):((i,s,h)=>{const p=s.hasOwnProperty(h);return s.constructor.createProperty(h,i),p?Object.getOwnPropertyDescriptor(s,h):void 0})(e,t,r)}/**
27
+ */const Dh={attribute:!0,type:String,converter:wi,reflect:!1,hasChanged:ds},Oh=(e=Dh,t,r)=>{const{kind:i,metadata:n}=r;let a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(r.name,e),i==="accessor"){const{name:d}=r;return{set(s){const o=t.get.call(this);t.set.call(this,s),this.requestUpdate(d,o,e)},init(s){return s!==void 0&&this.C(d,void 0,e,s),s}}}if(i==="setter"){const{name:d}=r;return function(s){const o=this[d];t.call(this,s),this.requestUpdate(d,o,e)}}throw Error("Unsupported decorator location: "+i)};function Z(e){return(t,r)=>typeof r=="object"?Oh(e,t,r):((i,n,a)=>{const d=n.hasOwnProperty(a);return n.constructor.createProperty(a,i),d?Object.getOwnPropertyDescriptor(n,a):void 0})(e,t,r)}/**
28
28
  * @license
29
29
  * Copyright 2017 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */function Lu(e){return G({...e,state:!0,attribute:!1})}var xu=(e,t,r,i)=>{for(var s=t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=p(s)||s);return s};let nn=class extends Be{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return z`
31
+ */function Fh(e){return Z({...e,state:!0,attribute:!1})}var Vh=(e,t,r,i)=>{for(var n=t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=d(n)||n);return n};let Dn=class extends Oe{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return j`
32
32
  <div class="close-button tooltip">
33
33
  <span class="tooltiptext">Close</span>
34
34
  <vscode-button
@@ -40,7 +40,7 @@
40
40
  <span class="icon icon-close"></span>
41
41
  </vscode-button>
42
42
  </div>
43
- `}};nn.styles=Xe`
43
+ `}};Dn.styles=et`
44
44
  :host {
45
45
  --button-icon-hover-background: var(--vscode-toolbar-hoverBackground);
46
46
  --tooltip-background: #343434;
@@ -113,7 +113,7 @@
113
113
  .tooltip:not(:hover) .tooltiptext {
114
114
  transition-delay: 0s;
115
115
  }
116
- `;nn=xu([Ue("close-cell-button")],nn);const Va=z`
116
+ `;Dn=Vh([Ge("close-cell-button")],Dn);const zc=j`
117
117
  <svg
118
118
  class="icon"
119
119
  width="16"
@@ -133,11 +133,11 @@
133
133
  d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z"
134
134
  />
135
135
  </svg>
136
- `;var Du=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,Pa=(e,t,r,i)=>{for(var s=i>1?void 0:i?Ou(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&Du(t,r,s),s};let ui=class extends Be{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return z`
136
+ `;var Uh=Object.defineProperty,Mh=Object.getOwnPropertyDescriptor,Qc=(e,t,r,i)=>{for(var n=i>1?void 0:i?Mh(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&Uh(t,r,n),n};let Ii=class extends Oe{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return j`
137
137
  <vscode-button appearance="secondary" @click=${this.onCopy}>
138
- ${Va} ${this.copyText}
138
+ ${zc} ${this.copyText}
139
139
  </vscode-button>
140
- `}};ui.styles=Xe`
140
+ `}};Ii.styles=et`
141
141
  vscode-button {
142
142
  color: var(--vscode-button-foreground);
143
143
  background-color: var(--vscode-button-background);
@@ -154,25 +154,25 @@
154
154
  margin: 0 5px 0 -5px;
155
155
  padding: 0;
156
156
  }
157
- `;Pa([G({type:String})],ui.prototype,"copyText",2);ui=Pa([Ue("copy-button")],ui);var sn={exports:{}},Fu=sn.exports,Os;function Mu(){return Os||(Os=1,(function(e,t){(function(r,i){e.exports=i()})(Fu,(()=>(()=>{var r={930:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const a=o(485);n.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(g,d,v){this._css.set(g,d,v)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,v){this._color.set(g,d,v)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},997:function(p,n,o){var a=this&&this.__decorate||function(w,S,k,R){var B,L=arguments.length,T=L<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,S,k,R);else for(var F=w.length-1;F>=0;F--)(B=w[F])&&(T=(L<3?B(T):L>3?B(S,k,T):B(S,k))||T);return L>3&&T&&Object.defineProperty(S,k,T),T},g=this&&this.__param||function(w,S){return function(k,R){S(k,R,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const d=o(930),v=o(160),b=o(345),C=o(859),m=o(97),c=v.css.toColor("#ffffff"),u=v.css.toColor("#000000"),l=v.css.toColor("#ffffff"),f=v.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=S[k/36%6|0],B=S[k/6%6|0],L=S[k%6];w.push({css:v.channels.toCss(R,B,L),rgba:v.channels.toRgba(R,B,L)})}for(let k=0;k<24;k++){const R=8+10*k;w.push({css:v.channels.toCss(R,R,R),rgba:v.channels.toRgba(R,R,R)})}return w})());let E=n.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:u,cursor:l,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:v.color.blend(u,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:v.color.blend(u,_),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 S=this._colors;if(S.foreground=y(w.foreground,c),S.background=y(w.background,u),S.cursor=y(w.cursor,l),S.cursorAccent=y(w.cursorAccent,f),S.selectionBackgroundTransparent=y(w.selectionBackground,_),S.selectionBackgroundOpaque=v.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=y(w.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=v.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=w.selectionForeground?y(w.selectionForeground,v.NULL_COLOR):void 0,S.selectionForeground===v.NULL_COLOR&&(S.selectionForeground=void 0),v.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=v.color.opacity(S.selectionBackgroundTransparent,.3)),v.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=v.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=n.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=y(w.black,n.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=y(w.red,n.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=y(w.green,n.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=y(w.yellow,n.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=y(w.blue,n.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=y(w.magenta,n.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=y(w.cyan,n.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=y(w.white,n.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=y(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=y(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=y(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=y(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=y(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=y(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=y(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=y(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(S.ansi.length-16,w.extendedAnsi.length);for(let R=0;R<k;R++)S.ansi[R+16]=y(w.extendedAnsi[R],n.DEFAULT_ANSI_COLORS[R+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 S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}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 y(w,S){if(w!==void 0)try{return v.css.toColor(w)}catch{}return S}n.ThemeService=E=a([g(0,m.IOptionsService)],E)},160:(p,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 o=0,a=0,g=0,d=0;var v,b,C,m,c;function u(f){const _=f.toString(16);return _.length<2?"0"+_:_}function l(f,_){return f<_?(_+.05)/(f+.05):(f+.05)/(_+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(_,E,y,w){return w!==void 0?`#${u(_)}${u(E)}${u(y)}${u(w)}`:`#${u(_)}${u(E)}${u(y)}`},f.toRgba=function(_,E,y,w=255){return(_<<24|E<<16|y<<8|w)>>>0},f.toColor=function(_,E,y,w){return{css:f.toCss(_,E,y,w),rgba:f.toRgba(_,E,y,w)}}})(v||(n.channels=v={})),(function(f){function _(E,y){return d=Math.round(255*y),[o,a,g]=c.toChannels(E.rgba),{css:v.toCss(o,a,g,d),rgba:v.toRgba(o,a,g,d)}}f.blend=function(E,y){if(d=(255&y.rgba)/255,d===1)return{css:y.css,rgba:y.rgba};const w=y.rgba>>24&255,S=y.rgba>>16&255,k=y.rgba>>8&255,R=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return o=R+Math.round((w-R)*d),a=B+Math.round((S-B)*d),g=L+Math.round((k-L)*d),{css:v.toCss(o,a,g),rgba:v.toRgba(o,a,g)}},f.isOpaque=function(E){return(255&E.rgba)==255},f.ensureContrastRatio=function(E,y,w){const S=c.ensureContrastRatio(E.rgba,y.rgba,w);if(S)return v.toColor(S>>24&255,S>>16&255,S>>8&255)},f.opaque=function(E){const y=(255|E.rgba)>>>0;return[o,a,g]=c.toChannels(y),{css:v.toCss(o,a,g),rgba:y}},f.opacity=_,f.multiplyOpacity=function(E,y){return d=255&E.rgba,_(E,d*y/255)},f.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(n.color=b={})),(function(f){let _,E;try{const y=document.createElement("canvas");y.width=1,y.height=1;const w=y.getContext("2d",{willReadFrequently:!0});w&&(_=w,_.globalCompositeOperation="copy",E=_.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return o=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),v.toColor(o,a,g);case 5:return o=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),d=parseInt(y.slice(4,5).repeat(2),16),v.toColor(o,a,g,d);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const w=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return o=parseInt(w[1]),a=parseInt(w[2]),g=parseInt(w[3]),d=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),v.toColor(o,a,g,d);if(!_||!E)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=E,_.fillStyle=y,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[o,a,g,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(o,a,g,d),css:y}}})(C||(n.css=C={})),(function(f){function _(E,y,w){const S=E/255,k=y/255,R=w/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}f.relativeLuminance=function(E){return _(E>>16&255,E>>8&255,255&E)},f.relativeLuminance2=_})(m||(n.rgb=m={})),(function(f){function _(y,w,S){const k=y>>24&255,R=y>>16&255,B=y>>8&255;let L=w>>24&255,T=w>>16&255,F=w>>8&255,U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));for(;U<S&&(L>0||T>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),T-=Math.max(0,Math.ceil(.1*T)),F-=Math.max(0,Math.ceil(.1*F)),U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));return(L<<24|T<<16|F<<8|255)>>>0}function E(y,w,S){const k=y>>24&255,R=y>>16&255,B=y>>8&255;let L=w>>24&255,T=w>>16&255,F=w>>8&255,U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));for(;U<S&&(L<255||T<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),T=Math.min(255,T+Math.ceil(.1*(255-T))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));return(L<<24|T<<16|F<<8|255)>>>0}f.blend=function(y,w){if(d=(255&w)/255,d===1)return w;const S=w>>24&255,k=w>>16&255,R=w>>8&255,B=y>>24&255,L=y>>16&255,T=y>>8&255;return o=B+Math.round((S-B)*d),a=L+Math.round((k-L)*d),g=T+Math.round((R-T)*d),v.toRgba(o,a,g)},f.ensureContrastRatio=function(y,w,S){const k=m.relativeLuminance(y>>8),R=m.relativeLuminance(w>>8);if(l(k,R)<S){if(R<k){const T=_(y,w,S),F=l(k,m.relativeLuminance(T>>8));if(F<S){const U=E(y,w,S);return F>l(k,m.relativeLuminance(U>>8))?T:U}return T}const B=E(y,w,S),L=l(k,m.relativeLuminance(B>>8));if(L<S){const T=_(y,w,S);return L>l(k,m.relativeLuminance(T>>8))?B:T}return B}},f.reduceLuminance=_,f.increaseLuminance=E,f.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(c||(n.rgba=c={})),n.toPaddedHex=u,n.contrastRatio=l},345:(p,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===o)return void this._listeners.splice(a,1)}}})),this._event}fire(o,a){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,o,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,a){return o((g=>a.fire(g)))},n.runAndSubscribe=function(o,a){return a(void 0),o((g=>a(g)))}},859:(p,n)=>{function o(a){for(const g of a)g.dispose();a.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 a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){const g=this._disposables.indexOf(a);g!==-1&&this._disposables.splice(g,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){var g;this._isDisposed||a===this._value||((g=this._value)==null||g.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,(a=this._value)==null||a.dispose(),this._value=void 0}},n.toDisposable=function(a){return{dispose:a}},n.disposeArray=o,n.getDisposeArrayDisposable=function(a){return{dispose:()=>o(a)}}},485:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,d,v){this._data[g]||(this._data[g]={}),this._data[g][d]=v}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}n.TwoKeyMap=o,n.FourKeyMap=class{constructor(){this._data=new o}set(a,g,d,v,b){this._data.get(a,g)||this._data.set(a,g,new o),this._data.get(a,g).set(d,v,b)}get(a,g,d,v){var b;return(b=this._data.get(a,g))==null?void 0:b.get(d,v)}clear(){this._data.clear()}}},726:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const o="di$target",a="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(g){return g[a]||[]},n.createDecorator=function(g){if(n.serviceRegistry.has(g))return n.serviceRegistry.get(g);const d=function(v,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,c,u){c[o]===c?c[a].push({id:m,index:u}):(c[a]=[{id:m,index:u}],c[o]=c)})(d,v,C)};return d.toString=()=>g,n.serviceRegistry.set(g,d),d}},97:(p,n,o)=>{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 a=o(726);var g;n.IBufferService=(0,a.createDecorator)("BufferService"),n.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),n.ICoreService=(0,a.createDecorator)("CoreService"),n.ICharsetService=(0,a.createDecorator)("CharsetService"),n.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(g||(n.LogLevelEnum=g={})),n.ILogService=(0,a.createDecorator)("LogService"),n.IOptionsService=(0,a.createDecorator)("OptionsService"),n.IOscLinkService=(0,a.createDecorator)("OscLinkService"),n.IUnicodeService=(0,a.createDecorator)("UnicodeService"),n.IDecorationService=(0,a.createDecorator)("DecorationService")}},i={};function s(p){var n=i[p];if(n!==void 0)return n.exports;var o=i[p]={exports:{}};return r[p].call(o.exports,o,o.exports,s),o.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.HTMLSerializeHandler=p.SerializeAddon=void 0;const n=s(997);function o(m,c,u){return Math.max(c,Math.min(m,u))}class a{constructor(c){this._buffer=c}serialize(c,u){const l=this._buffer.getNullCell(),f=this._buffer.getNullCell();let _=l;const E=c.start.y,y=c.end.y,w=c.start.x,S=c.end.x;this._beforeSerialize(y-E,E,y);for(let k=E;k<=y;k++){const R=this._buffer.getLine(k);if(R){const B=k===c.start.y?w:0,L=k===c.end.y?S:R.length;for(let T=B;T<L;T++){const F=R.getCell(T,_===l?f:l);F?(this._nextCell(F,_,k,T),_=F):console.warn(`Can't get cell at row=${k}, col=${T}`)}}this._rowEnd(k,k===y)}return this._afterSerialize(),this._serializeString(u)}_nextCell(c,u,l,f){}_rowEnd(c,u){}_beforeSerialize(c,u,l){}_afterSerialize(){}_serializeString(c){return""}}function g(m,c){return m.getFgColorMode()===c.getFgColorMode()&&m.getFgColor()===c.getFgColor()}function d(m,c){return m.getBgColorMode()===c.getBgColorMode()&&m.getBgColor()===c.getBgColor()}function v(m,c){return m.isInverse()===c.isInverse()&&m.isBold()===c.isBold()&&m.isUnderline()===c.isUnderline()&&m.isOverline()===c.isOverline()&&m.isBlink()===c.isBlink()&&m.isInvisible()===c.isInvisible()&&m.isItalic()===c.isItalic()&&m.isDim()===c.isDim()&&m.isStrikethrough()===c.isStrikethrough()}class b extends a{constructor(c,u){super(c),this._terminal=u,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(c,u,l){this._allRows=new Array(c),this._lastContentCursorRow=u,this._lastCursorRow=u,this._firstRow=u}_rowEnd(c,u){var l;this._nullCellCount>0&&!d(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let f="";if(!u){c-this._firstRow>=this._terminal.rows&&((l=this._buffer.getLine(this._cursorStyleRow))==null||l.getCell(this._cursorStyleCol,this._backgroundCell));const _=this._buffer.getLine(c),E=this._buffer.getLine(c+1);if(E.isWrapped){f="";const y=_.getCell(_.length-1,this._thisRowLastChar),w=_.getCell(_.length-2,this._thisRowLastSecondChar),S=E.getCell(0,this._nextRowFirstChar),k=S.getWidth()>1;let R=!1;(S.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((y.getChars()||y.getWidth()===0)&&d(y,S)&&(R=!0),k&&(w.getChars()||w.getWidth()===0)&&d(y,S)&&d(w,S)&&(R=!0)),R||(f="-".repeat(this._nullCellCount+1),f+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(f+="\x1B[A",f+=`\x1B[${_.length-this._nullCellCount}C`,f+=`\x1B[${this._nullCellCount}X`,f+=`\x1B[${_.length-this._nullCellCount}D`,f+="\x1B[B"),this._lastContentCursorRow=c+1,this._lastContentCursorCol=0,this._lastCursorRow=c+1,this._lastCursorCol=0)}else f=`\r
158
- `,this._lastCursorRow=c+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=f,this._currentRow="",this._nullCellCount=0}_diffStyle(c,u){const l=[],f=!g(c,u),_=!d(c,u),E=!v(c,u);if(f||_||E)if(c.isAttributeDefault())u.isAttributeDefault()||l.push(0);else{if(f){const y=c.getFgColor();c.isFgRGB()?l.push(38,2,y>>>16&255,y>>>8&255,255&y):c.isFgPalette()?y>=16?l.push(38,5,y):l.push(8&y?90+(7&y):30+(7&y)):l.push(39)}if(_){const y=c.getBgColor();c.isBgRGB()?l.push(48,2,y>>>16&255,y>>>8&255,255&y):c.isBgPalette()?y>=16?l.push(48,5,y):l.push(8&y?100+(7&y):40+(7&y)):l.push(49)}E&&(c.isInverse()!==u.isInverse()&&l.push(c.isInverse()?7:27),c.isBold()!==u.isBold()&&l.push(c.isBold()?1:22),c.isUnderline()!==u.isUnderline()&&l.push(c.isUnderline()?4:24),c.isOverline()!==u.isOverline()&&l.push(c.isOverline()?53:55),c.isBlink()!==u.isBlink()&&l.push(c.isBlink()?5:25),c.isInvisible()!==u.isInvisible()&&l.push(c.isInvisible()?8:28),c.isItalic()!==u.isItalic()&&l.push(c.isItalic()?3:23),c.isDim()!==u.isDim()&&l.push(c.isDim()?2:22),c.isStrikethrough()!==u.isStrikethrough()&&l.push(c.isStrikethrough()?9:29))}return l}_nextCell(c,u,l,f){if(c.getWidth()===0)return;const _=c.getChars()==="",E=this._diffStyle(c,this._cursorStyle);if(_?!d(this._cursorStyle,c):E.length>0){this._nullCellCount>0&&(d(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=l,this._lastContentCursorCol=this._lastCursorCol=f,this._currentRow+=`\x1B[${E.join(";")}m`;const y=this._buffer.getLine(l);y!==void 0&&(y.getCell(f,this._cursorStyle),this._cursorStyleRow=l,this._cursorStyleCol=f)}_?this._nullCellCount+=c.getWidth():(this._nullCellCount>0&&(d(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=c.getChars(),this._lastContentCursorRow=this._lastCursorRow=l,this._lastContentCursorCol=this._lastCursorCol=f+c.getWidth())}_serializeString(c){let u=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(u=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let l="";for(let y=0;y<u;y++)l+=this._allRows[y],y+1<u&&(l+=this._allRowSeparators[y]);if(!c){const y=this._buffer.baseY+this._buffer.cursorY,w=this._buffer.cursorX,S=k=>{k>0?l+=`\x1B[${k}C`:k<0&&(l+=`\x1B[${-k}D`)};(y!==this._lastCursorRow||w!==this._lastCursorCol)&&((f=y-this._lastCursorRow)>0?l+=`\x1B[${f}B`:f<0&&(l+=`\x1B[${-f}A`),S(w-this._lastCursorCol))}var f;const _=this._terminal._core._inputHandler._curAttrData,E=this._diffStyle(_,this._cursorStyle);return E.length>0&&(l+=`\x1B[${E.join(";")}m`),l}}p.SerializeAddon=class{activate(m){this._terminal=m}_serializeBufferByScrollback(m,c,u){const l=c.length,f=u===void 0?l:o(u+m.rows,0,l);return this._serializeBufferByRange(m,c,{start:l-f,end:l-1},!1)}_serializeBufferByRange(m,c,u,l){return new b(c,m).serialize({start:{x:0,y:typeof u.start=="number"?u.start:u.start.line},end:{x:m.cols,y:typeof u.end=="number"?u.end:u.end.line}},l)}_serializeBufferAsHTML(m,c){var u;const l=m.buffer.active,f=new C(l,m,c);if(!c.onlySelection){const E=l.length,y=c.scrollback,w=y===void 0?E:o(y+m.rows,0,E);return f.serialize({start:{x:0,y:E-w},end:{x:m.cols,y:E-1}})}const _=(u=this._terminal)==null?void 0:u.getSelectionPosition();return _!==void 0?f.serialize({start:{x:_.start.x,y:_.start.y},end:{x:_.end.x,y:_.end.y}}):""}_serializeModes(m){let c="";const u=m.modes;if(u.applicationCursorKeysMode&&(c+="\x1B[?1h"),u.applicationKeypadMode&&(c+="\x1B[?66h"),u.bracketedPasteMode&&(c+="\x1B[?2004h"),u.insertMode&&(c+="\x1B[4h"),u.originMode&&(c+="\x1B[?6h"),u.reverseWraparoundMode&&(c+="\x1B[?45h"),u.sendFocusMode&&(c+="\x1B[?1004h"),u.wraparoundMode===!1&&(c+="\x1B[?7l"),u.mouseTrackingMode!=="none")switch(u.mouseTrackingMode){case"x10":c+="\x1B[?9h";break;case"vt200":c+="\x1B[?1000h";break;case"drag":c+="\x1B[?1002h";break;case"any":c+="\x1B[?1003h"}return c}serialize(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let c=m!=null&&m.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,m.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,m==null?void 0:m.scrollback);return m!=null&&m.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(c+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),m!=null&&m.excludeModes||(c+=this._serializeModes(this._terminal)),c}serializeAsHTML(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,m||{})}dispose(){}};class C extends a{constructor(c,u,l){super(c),this._terminal=u,this._options=l,this._currentRow="",this._htmlContent="",u._core._themeService?this._ansiColors=u._core._themeService.colors.ansi:this._ansiColors=n.DEFAULT_ANSI_COLORS}_padStart(c,u,l){return u>>=0,l=l??" ",c.length>u?c:((u-=c.length)>l.length&&(l+=l.repeat(u/l.length)),l.slice(0,u)+c)}_beforeSerialize(c,u,l){var f,_;this._htmlContent+="<html><body><!--StartFragment--><pre>";let E="#000000",y="#ffffff";this._options.includeGlobalBackground&&(E=((f=this._terminal.options.theme)==null?void 0:f.foreground)??"#ffffff",y=((_=this._terminal.options.theme)==null?void 0:_.background)??"#000000");const w=[];w.push("color: "+E+";"),w.push("background-color: "+y+";"),w.push("font-family: "+this._terminal.options.fontFamily+";"),w.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+w.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(c,u){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(c,u){const l=u?c.getFgColor():c.getBgColor();return(u?c.isFgRGB():c.isBgRGB())?"#"+[l>>16&255,l>>8&255,255&l].map((f=>this._padStart(f.toString(16),2,"0"))).join(""):(u?c.isFgPalette():c.isBgPalette())?this._ansiColors[l].css:void 0}_diffStyle(c,u){const l=[],f=!g(c,u),_=!d(c,u),E=!v(c,u);if(f||_||E){const y=this._getHexColor(c,!0);y&&l.push("color: "+y+";");const w=this._getHexColor(c,!1);return w&&l.push("background-color: "+w+";"),c.isInverse()&&l.push("color: #000000; background-color: #BFBFBF;"),c.isBold()&&l.push("font-weight: bold;"),c.isUnderline()&&c.isOverline()?l.push("text-decoration: overline underline;"):c.isUnderline()?l.push("text-decoration: underline;"):c.isOverline()&&l.push("text-decoration: overline;"),c.isBlink()&&l.push("text-decoration: blink;"),c.isInvisible()&&l.push("visibility: hidden;"),c.isItalic()&&l.push("font-style: italic;"),c.isDim()&&l.push("opacity: 0.5;"),c.isStrikethrough()&&l.push("text-decoration: line-through;"),l}}_nextCell(c,u,l,f){if(c.getWidth()===0)return;const _=c.getChars()==="",E=this._diffStyle(c,u);E&&(this._currentRow+=E.length===0?"</span><span>":"</span><span style='"+E.join(" ")+"'>"),this._currentRow+=_?" ":c.getChars()}_serializeString(){return this._htmlContent}}p.HTMLSerializeHandler=C})(),h})()))})(sn)),sn.exports}var Uu=Mu(),on={exports:{}},Vu=on.exports,Fs;function Pu(){return Fs||(Fs=1,(function(e,t){(function(r,i){e.exports=i()})(Vu,(()=>(()=>{var r={433:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV11=void 0;const a=o(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],d=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],v=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],b=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let C;function m(c,u){let l,f=0,_=u.length-1;if(c<u[0][0]||c>u[_][1])return!1;for(;_>=f;)if(l=f+_>>1,c>u[l][1])f=l+1;else{if(!(c<u[l][0]))return!0;_=l-1}return!1}n.UnicodeV11=class{constructor(){if(this.version="11",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160);for(let c=0;c<g.length;++c)C.fill(0,g[c][0],g[c][1]+1);for(let c=0;c<v.length;++c)C.fill(2,v[c][0],v[c][1]+1)}}wcwidth(c){return c<32?0:c<127?1:c<65536?C[c]:m(c,d)?0:m(c,b)?2:1}charProperties(c,u){let l=this.wcwidth(c),f=l===0&&u!==0;if(f){const _=a.UnicodeService.extractWidth(u);_===0?f=!1:_>l&&(l=_)}return a.UnicodeService.createPropertyValue(0,l,f)}}},345:(p,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===o)return void this._listeners.splice(a,1)}}})),this._event}fire(o,a){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,o,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,a){return o((g=>a.fire(g)))},n.runAndSubscribe=function(o,a){return a(void 0),o((g=>a(g)))}},490:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const a=o(938),g=[[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]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;n.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let b=0;b<g.length;++b)v.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?v[b]:(function(C,m){let c,u=0,l=m.length-1;if(C<m[0][0]||C>m[l][1])return!1;for(;l>=u;)if(c=u+l>>1,C>m[c][1])u=c+1;else{if(!(C<m[c][0]))return!0;l=c-1}return!1})(b,d)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,C){let m=this.wcwidth(b),c=m===0&&C!==0;if(c){const u=a.UnicodeService.extractWidth(C);u===0?c=!1:u>m&&(m=u)}return a.UnicodeService.createPropertyValue(0,m,c)}}},938:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const a=o(345),g=o(490);class d{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,C,m=!1){return(16777215&b)<<3|(3&C)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let C=0,m=0;const c=b.length;for(let u=0;u<c;++u){let l=b.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=c)return C+this.wcwidth(l);const E=b.charCodeAt(u);56320<=E&&E<=57343?l=1024*(l-55296)+E-56320+65536:C+=this.wcwidth(E)}const f=this.charProperties(l,m);let _=d.extractWidth(f);d.extractShouldJoin(f)&&(_-=d.extractWidth(m)),C+=_,m=f}return C}charProperties(b,C){return this._activeProvider.charProperties(b,C)}}n.UnicodeService=d}},i={};function s(p){var n=i[p];if(n!==void 0)return n.exports;var o=i[p]={exports:{}};return r[p](o,o.exports,s),o.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const n=s(433);p.Unicode11Addon=class{activate(o){o.unicode.register(new n.UnicodeV11)}dispose(){}}})(),h})()))})(on)),on.exports}var Wu=Pu(),Ms={exports:{}},Us;function Hu(){return Us||(Us=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(p,n)=>{function o(g){try{const d=new URL(g),v=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(g,d,v,b={}){this._terminal=g,this._regex=d,this._handler=v,this._options=b}provideLinks(g,d){const v=a.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(v))}_addCallbacks(g){return g.map((d=>(d.leave=this._options.leave,d.hover=(v,b)=>{if(this._options.hover){const{range:C}=d;this._options.hover(v,b,C)}},d)))}};class a{static computeLink(d,v,b,C){const m=new RegExp(v.source,(v.flags||"")+"g"),[c,u]=a._getWindowedLineStrings(d-1,b),l=c.join("");let f;const _=[];for(;f=m.exec(l);){const E=f[0];if(!o(E))continue;const[y,w]=a._mapStrIdx(b,u,0,f.index),[S,k]=a._mapStrIdx(b,y,w,E.length);if(y===-1||w===-1||S===-1||k===-1)continue;const R={start:{x:w+1,y:y+1},end:{x:k,y:S+1}};_.push({range:R,text:E,activate:C})}return _}static _getWindowedLineStrings(d,v){let b,C=d,m=d,c=0,u="";const l=[];if(b=v.buffer.active.getLine(d)){const f=b.translateToString(!0);if(b.isWrapped&&f[0]!==" "){for(c=0;(b=v.buffer.active.getLine(--C))&&c<2048&&(u=b.translateToString(!0),c+=u.length,l.push(u),b.isWrapped&&u.indexOf(" ")===-1););l.reverse()}for(l.push(f),c=0;(b=v.buffer.active.getLine(++m))&&b.isWrapped&&c<2048&&(u=b.translateToString(!0),c+=u.length,l.push(u),u.indexOf(" ")===-1););}return[l,C]}static _mapStrIdx(d,v,b,C){const m=d.buffer.active,c=m.getNullCell();let u=b;for(;C;){const l=m.getLine(v);if(!l)return[-1,-1];for(let f=u;f<l.length;++f){l.getCell(f,c);const _=c.getChars();if(c.getWidth()&&(C-=_.length||1,f===l.length-1&&_==="")){const E=m.getLine(v+1);E&&E.isWrapped&&(E.getCell(0,c),c.getWidth()===2&&(C+=1))}if(C<0)return[v,f]}v++,u=0}return[v,u]}}n.LinkComputer=a}},i={};function s(p){var n=i[p];if(n!==void 0)return n.exports;var o=i[p]={exports:{}};return r[p](o,o.exports,s),o.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const n=s(6),o=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function a(g,d){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(g=a,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,v=d.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,v,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})()))})(Ms)),Ms.exports}var $u=Hu(),Vs={exports:{}},Ps;function Zu(){return Ps||(Ps=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,(()=>(()=>{var r={4567:function(p,n,o){var a=this&&this.__decorate||function(l,f,_,E){var y,w=arguments.length,S=w<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,f,_,E);else for(var k=l.length-1;k>=0;k--)(y=l[k])&&(S=(w<3?y(S):w>3?y(f,_,S):y(f,_))||S);return w>3&&S&&Object.defineProperty(f,_,S),S},g=this&&this.__param||function(l,f){return function(_,E){f(_,E,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const d=o(9042),v=o(9924),b=o(844),C=o(4725),m=o(2585),c=o(3656);let u=n.AccessibilityManager=class extends b.Disposable{constructor(l,f,_,E){super(),this._terminal=l,this._coreBrowserService=_,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
159
- `)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,c.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let f=0;f<l;f++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
160
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,f){this._liveRegionDebouncer.refresh(l,f,this._terminal.rows)}_renderRows(l,f){const _=this._terminal.buffer,E=_.lines.length.toString();for(let y=l;y<=f;y++){const w=_.lines.get(_.ydisp+y),S=[],k=(w==null?void 0:w.translateToString(!0,void 0,void 0,S))||"",R=(_.ydisp+y+1).toString(),B=this._rowElements[y];B&&(k.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=k,this._rowColumns.set(B,S)),B.setAttribute("aria-posinset",R),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,f){const _=l.target,E=this._rowElements[f===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==E)return;let y,w;if(f===0?(y=_,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(y=this._rowElements.shift(),w=_,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:f.anchorNode,offset:f.anchorOffset},E={node:f.focusNode,offset:f.focusOffset};if((_.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===E.node&&_.offset>E.offset)&&([_,E]=[E,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const y=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:y,offset:((l=y.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(E.node))return;const w=({node:R,offset:B})=>{const L=R instanceof Text?R.parentNode:R;let T=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(L);if(!F)return console.warn("columns is null. Race condition?"),null;let U=B<F.length?F[B]:F.slice(-1)[0]+1;return U>=this._terminal.cols&&(++T,U=0),{row:T,column:U}},S=w(_),k=w(E);if(S&&k){if(S.row>k.row||S.row===k.row&&S.column>=k.column)throw new Error("invalid range");this._terminal.select(S.column,S.row,(k.row-S.row)*this._terminal.cols-S.column+k.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=u=a([g(1,m.IInstantiationService),g(2,C.ICoreBrowserService),g(3,C.IRenderService)],u)},3614:(p,n)=>{function o(v){return v.replace(/\r?\n/g,"\r")}function a(v,b){return b?"\x1B[200~"+v+"\x1B[201~":v}function g(v,b,C,m){v=a(v=o(v),C.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),b.value=""}function d(v,b,C){const m=C.getBoundingClientRect(),c=v.clientX-m.left-10,u=v.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${c}px`,b.style.top=`${u}px`,b.style.zIndex="1000",b.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=o,n.bracketTextForPaste=a,n.copyHandler=function(v,b){v.clipboardData&&v.clipboardData.setData("text/plain",b.selectionText),v.preventDefault()},n.handlePasteEvent=function(v,b,C,m){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),b,C,m)},n.paste=g,n.moveTextAreaUnderMouseCursor=d,n.rightClickHandler=function(v,b,C,m,c){d(v,b,C),c&&m.rightClickSelect(v),b.value=m.selectionText,b.select()}},7239:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const a=o(1505);n.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(g,d,v){this._css.set(g,d,v)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,v){this._color.set(g,d,v)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(o,a,g,d){o.addEventListener(a,g,d);let v=!1;return{dispose:()=>{v||(v=!0,o.removeEventListener(a,g,d))}}}},3551:function(p,n,o){var a=this&&this.__decorate||function(u,l,f,_){var E,y=arguments.length,w=y<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,l,f,_);else for(var S=u.length-1;S>=0;S--)(E=u[S])&&(w=(y<3?E(w):y>3?E(l,f,w):E(l,f))||w);return y>3&&w&&Object.defineProperty(l,f,w),w},g=this&&this.__param||function(u,l){return function(f,_){l(f,_,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const d=o(3656),v=o(8460),b=o(844),C=o(2585),m=o(4725);let c=n.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(u,l,f,_,E){super(),this._element=u,this._mouseService=l,this._renderService=f,this._bufferService=_,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const f=u.composedPath();for(let _=0;_<f.length;_++){const E=f[_];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,l){var f,_;this._activeProviderReplies&&l||((f=this._activeProviderReplies)==null||f.forEach((y=>{y==null||y.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let E=!1;for(const[y,w]of this._linkProviderService.linkProviders.entries())l?(_=this._activeProviderReplies)!=null&&_.get(y)&&(E=this._checkLinkProviderResult(y,u,E)):w.provideLinks(u.y,(S=>{var k,R;if(this._isMouseOut)return;const B=S==null?void 0:S.map((L=>({link:L})));(k=this._activeProviderReplies)==null||k.set(y,B),E=this._checkLinkProviderResult(y,u,E),((R=this._activeProviderReplies)==null?void 0:R.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,l){const f=new Set;for(let _=0;_<l.size;_++){const E=l.get(_);if(E)for(let y=0;y<E.length;y++){const w=E[y],S=w.link.range.start.y<u?0:w.link.range.start.x,k=w.link.range.end.y>u?this._bufferService.cols:w.link.range.end.x;for(let R=S;R<=k;R++){if(f.has(R)){E.splice(y--,1);break}f.add(R)}}}}_checkLinkProviderResult(u,l,f){var _;if(!this._activeProviderReplies)return f;const E=this._activeProviderReplies.get(u);let y=!1;for(let w=0;w<u;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(y=!0);if(!y&&E){const w=E.find((S=>this._linkAtPosition(S.link,l)));w&&(f=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let w=0;w<this._activeProviderReplies.size;w++){const S=(_=this._activeProviderReplies.get(w))==null?void 0:_.find((k=>this._linkAtPosition(k.link,l)));if(S){f=!0,this._handleNewLink(S);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,l){this._currentLink&&this._lastMouseEvent&&(!u||!l||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(u.link,l)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var f,_;return(_=(f=this._currentLink)==null?void 0:f.state)==null?void 0:_.decorations.pointerCursor},set:f=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>{var f,_;return(_=(f=this._currentLink)==null?void 0:f.state)==null?void 0:_.decorations.underline},set:f=>{var _,E,y;(_=this._currentLink)!=null&&_.state&&((y=(E=this._currentLink)==null?void 0:E.state)==null?void 0:y.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((f=>{if(!this._currentLink)return;const _=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(_,E),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(u,l,f){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(f,l.text)}_fireUnderlineEvent(u,l){const f=u.range,_=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-_-1,f.end.x,f.end.y-_-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(u,l,f){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(f,l.text)}_linkAtPosition(u,l){const f=u.range.start.y*this._bufferService.cols+u.range.start.x,_=u.range.end.y*this._bufferService.cols+u.range.end.x,E=l.y*this._bufferService.cols+l.x;return f<=E&&E<=_}_positionFromMouseEvent(u,l,f){const _=f.getCoords(u,l,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,l,f,_,E){return{x1:u,y1:l,x2:f,y2:_,cols:this._bufferService.cols,fg:E}}};n.Linkifier=c=a([g(1,m.IMouseService),g(2,m.IRenderService),g(3,C.IBufferService),g(4,m.ILinkProviderService)],c)},9042:(p,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(p,n,o){var a=this&&this.__decorate||function(m,c,u,l){var f,_=arguments.length,E=_<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,c,u,l);else for(var y=m.length-1;y>=0;y--)(f=m[y])&&(E=(_<3?f(E):_>3?f(c,u,E):f(c,u))||E);return _>3&&E&&Object.defineProperty(c,u,E),E},g=this&&this.__param||function(m,c){return function(u,l){c(u,l,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const d=o(511),v=o(2585);let b=n.OscLinkProvider=class{constructor(m,c,u){this._bufferService=m,this._optionsService=c,this._oscLinkService=u}provideLinks(m,c){var u;const l=this._bufferService.buffer.lines.get(m-1);if(!l)return void c(void 0);const f=[],_=this._optionsService.rawOptions.linkHandler,E=new d.CellData,y=l.getTrimmedLength();let w=-1,S=-1,k=!1;for(let R=0;R<y;R++)if(S!==-1||l.hasContent(R)){if(l.loadCell(R,E),E.hasExtendedAttrs()&&E.extended.urlId){if(S===-1){S=R,w=E.extended.urlId;continue}k=E.extended.urlId!==w}else S!==-1&&(k=!0);if(k||S!==-1&&R===y-1){const B=(u=this._oscLinkService.getLinkData(w))==null?void 0:u.uri;if(B){const L={start:{x:S+1,y:m},end:{x:R+(k||R!==y-1?0:1),y:m}};let T=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const F=new URL(B);["http:","https:"].includes(F.protocol)||(T=!0)}catch{T=!0}T||f.push({text:B,range:L,activate:(F,U)=>_?_.activate(F,U,L):C(0,U),hover:(F,U)=>{var $;return($=_==null?void 0:_.hover)==null?void 0:$.call(_,F,U,L)},leave:(F,U)=>{var $;return($=_==null?void 0:_.leave)==null?void 0:$.call(_,F,U,L)}})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(S=R,w=E.extended.urlId):(S=-1,w=-1)}}c(f)}};function C(m,c){if(confirm(`Do you want to navigate to ${c}?
157
+ `;Qc([Z({type:String})],Ii.prototype,"copyText",2);Ii=Qc([Ge("copy-button")],Ii);var On={exports:{}},Ph=On.exports,xo;function Wh(){return xo||(xo=1,(function(e,t){(function(r,i){e.exports=i()})(Ph,(()=>(()=>{var r={930:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(485);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(g,f,m){this._css.set(g,f,m)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,m){this._color.set(g,f,m)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},997:function(d,s,o){var c=this&&this.__decorate||function(C,S,k,T){var R,L=arguments.length,N=L<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(C,S,k,T);else for(var U=C.length-1;U>=0;U--)(R=C[U])&&(N=(L<3?R(N):L>3?R(S,k,N):R(S,k))||N);return L>3&&N&&Object.defineProperty(S,k,N),N},g=this&&this.__param||function(C,S){return function(k,T){S(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=o(930),m=o(160),_=o(345),w=o(859),v=o(97),l=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),u=m.css.toColor("#ffffff"),p=m.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=S[k/36%6|0],R=S[k/6%6|0],L=S[k%6];C.push({css:m.channels.toCss(T,R,L),rgba:m.channels.toRgba(T,R,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:m.channels.toCss(T,T,T),rgba:m.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:h,cursor:u,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:m.color.blend(h,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:m.color.blend(h,b),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(C={}){const S=this._colors;if(S.foreground=y(C.foreground,l),S.background=y(C.background,h),S.cursor=y(C.cursor,u),S.cursorAccent=y(C.cursorAccent,p),S.selectionBackgroundTransparent=y(C.selectionBackground,b),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=y(C.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=C.selectionForeground?y(C.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=s.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=y(C.black,s.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=y(C.red,s.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=y(C.green,s.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=y(C.yellow,s.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=y(C.blue,s.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=y(C.magenta,s.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=y(C.cyan,s.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=y(C.white,s.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=y(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=y(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=y(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=y(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=y(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=y(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=y(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=y(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(S.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)S.ansi[T+16]=y(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[C]=this._restoreColors.ansi[C]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(C){C(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(C,S){if(C!==void 0)try{return m.css.toColor(C)}catch{}return S}s.ThemeService=E=c([g(0,v.IOptionsService)],E)},160:(d,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 o=0,c=0,g=0,f=0;var m,_,w,v,l;function h(p){const b=p.toString(16);return b.length<2?"0"+b:b}function u(p,b){return p<b?(b+.05)/(p+.05):(p+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(b,E,y,C){return C!==void 0?`#${h(b)}${h(E)}${h(y)}${h(C)}`:`#${h(b)}${h(E)}${h(y)}`},p.toRgba=function(b,E,y,C=255){return(b<<24|E<<16|y<<8|C)>>>0},p.toColor=function(b,E,y,C){return{css:p.toCss(b,E,y,C),rgba:p.toRgba(b,E,y,C)}}})(m||(s.channels=m={})),(function(p){function b(E,y){return f=Math.round(255*y),[o,c,g]=l.toChannels(E.rgba),{css:m.toCss(o,c,g,f),rgba:m.toRgba(o,c,g,f)}}p.blend=function(E,y){if(f=(255&y.rgba)/255,f===1)return{css:y.css,rgba:y.rgba};const C=y.rgba>>24&255,S=y.rgba>>16&255,k=y.rgba>>8&255,T=E.rgba>>24&255,R=E.rgba>>16&255,L=E.rgba>>8&255;return o=T+Math.round((C-T)*f),c=R+Math.round((S-R)*f),g=L+Math.round((k-L)*f),{css:m.toCss(o,c,g),rgba:m.toRgba(o,c,g)}},p.isOpaque=function(E){return(255&E.rgba)==255},p.ensureContrastRatio=function(E,y,C){const S=l.ensureContrastRatio(E.rgba,y.rgba,C);if(S)return m.toColor(S>>24&255,S>>16&255,S>>8&255)},p.opaque=function(E){const y=(255|E.rgba)>>>0;return[o,c,g]=l.toChannels(y),{css:m.toCss(o,c,g),rgba:y}},p.opacity=b,p.multiplyOpacity=function(E,y){return f=255&E.rgba,b(E,f*y/255)},p.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(_||(s.color=_={})),(function(p){let b,E;try{const y=document.createElement("canvas");y.width=1,y.height=1;const C=y.getContext("2d",{willReadFrequently:!0});C&&(b=C,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return o=parseInt(y.slice(1,2).repeat(2),16),c=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),m.toColor(o,c,g);case 5:return o=parseInt(y.slice(1,2).repeat(2),16),c=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),f=parseInt(y.slice(4,5).repeat(2),16),m.toColor(o,c,g,f);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const C=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),g=parseInt(C[3]),f=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),m.toColor(o,c,g,f);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=y,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[o,c,g,f]=b.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,c,g,f),css:y}}})(w||(s.css=w={})),(function(p){function b(E,y,C){const S=E/255,k=y/255,T=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}p.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},p.relativeLuminance2=b})(v||(s.rgb=v={})),(function(p){function b(y,C,S){const k=y>>24&255,T=y>>16&255,R=y>>8&255;let L=C>>24&255,N=C>>16&255,U=C>>8&255,P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));for(;P<S&&(L>0||N>0||U>0);)L-=Math.max(0,Math.ceil(.1*L)),N-=Math.max(0,Math.ceil(.1*N)),U-=Math.max(0,Math.ceil(.1*U)),P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));return(L<<24|N<<16|U<<8|255)>>>0}function E(y,C,S){const k=y>>24&255,T=y>>16&255,R=y>>8&255;let L=C>>24&255,N=C>>16&255,U=C>>8&255,P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));for(;P<S&&(L<255||N<255||U<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),N=Math.min(255,N+Math.ceil(.1*(255-N))),U=Math.min(255,U+Math.ceil(.1*(255-U))),P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));return(L<<24|N<<16|U<<8|255)>>>0}p.blend=function(y,C){if(f=(255&C)/255,f===1)return C;const S=C>>24&255,k=C>>16&255,T=C>>8&255,R=y>>24&255,L=y>>16&255,N=y>>8&255;return o=R+Math.round((S-R)*f),c=L+Math.round((k-L)*f),g=N+Math.round((T-N)*f),m.toRgba(o,c,g)},p.ensureContrastRatio=function(y,C,S){const k=v.relativeLuminance(y>>8),T=v.relativeLuminance(C>>8);if(u(k,T)<S){if(T<k){const N=b(y,C,S),U=u(k,v.relativeLuminance(N>>8));if(U<S){const P=E(y,C,S);return U>u(k,v.relativeLuminance(P>>8))?N:P}return N}const R=E(y,C,S),L=u(k,v.relativeLuminance(R>>8));if(L<S){const N=b(y,C,S);return L>u(k,v.relativeLuminance(N>>8))?R:N}return R}},p.reduceLuminance=b,p.increaseLuminance=E,p.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(l||(s.rgba=l={})),s.toPaddedHex=h,s.contrastRatio=u},345:(d,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o((g=>c.fire(g)))},s.runAndSubscribe=function(o,c){return c(void 0),o((g=>c(g)))}},859:(d,s)=>{function o(c){for(const g of c)g.dispose();c.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 c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const g=this._disposables.indexOf(c);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var g;this._isDisposed||c===this._value||((g=this._value)==null||g.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,f,m){this._data[g]||(this._data[g]={}),this._data[g][f]=m}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,g,f,m,_){this._data.get(c,g)||this._data.set(c,g,new o),this._data.get(c,g).set(f,m,_)}get(c,g,f,m){var _;return(_=this._data.get(c,g))==null?void 0:_.get(f,m)}clear(){this._data.clear()}}},726:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[c]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const f=function(m,_,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(f,m,w)};return f.toString=()=>g,s.serviceRegistry.set(g,f),f}},97:(d,s,o)=>{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 c=o(726);var g;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},i={};function n(d){var s=i[d];if(s!==void 0)return s.exports;var o=i[d]={exports:{}};return r[d].call(o.exports,o,o.exports,n),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.HTMLSerializeHandler=d.SerializeAddon=void 0;const s=n(997);function o(v,l,h){return Math.max(l,Math.min(v,h))}class c{constructor(l){this._buffer=l}serialize(l,h){const u=this._buffer.getNullCell(),p=this._buffer.getNullCell();let b=u;const E=l.start.y,y=l.end.y,C=l.start.x,S=l.end.x;this._beforeSerialize(y-E,E,y);for(let k=E;k<=y;k++){const T=this._buffer.getLine(k);if(T){const R=k===l.start.y?C:0,L=k===l.end.y?S:T.length;for(let N=R;N<L;N++){const U=T.getCell(N,b===u?p:u);U?(this._nextCell(U,b,k,N),b=U):console.warn(`Can't get cell at row=${k}, col=${N}`)}}this._rowEnd(k,k===y)}return this._afterSerialize(),this._serializeString(h)}_nextCell(l,h,u,p){}_rowEnd(l,h){}_beforeSerialize(l,h,u){}_afterSerialize(){}_serializeString(l){return""}}function g(v,l){return v.getFgColorMode()===l.getFgColorMode()&&v.getFgColor()===l.getFgColor()}function f(v,l){return v.getBgColorMode()===l.getBgColorMode()&&v.getBgColor()===l.getBgColor()}function m(v,l){return v.isInverse()===l.isInverse()&&v.isBold()===l.isBold()&&v.isUnderline()===l.isUnderline()&&v.isOverline()===l.isOverline()&&v.isBlink()===l.isBlink()&&v.isInvisible()===l.isInvisible()&&v.isItalic()===l.isItalic()&&v.isDim()===l.isDim()&&v.isStrikethrough()===l.isStrikethrough()}class _ extends c{constructor(l,h){super(l),this._terminal=h,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(l,h,u){this._allRows=new Array(l),this._lastContentCursorRow=h,this._lastCursorRow=h,this._firstRow=h}_rowEnd(l,h){var u;this._nullCellCount>0&&!f(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let p="";if(!h){l-this._firstRow>=this._terminal.rows&&((u=this._buffer.getLine(this._cursorStyleRow))==null||u.getCell(this._cursorStyleCol,this._backgroundCell));const b=this._buffer.getLine(l),E=this._buffer.getLine(l+1);if(E.isWrapped){p="";const y=b.getCell(b.length-1,this._thisRowLastChar),C=b.getCell(b.length-2,this._thisRowLastSecondChar),S=E.getCell(0,this._nextRowFirstChar),k=S.getWidth()>1;let T=!1;(S.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((y.getChars()||y.getWidth()===0)&&f(y,S)&&(T=!0),k&&(C.getChars()||C.getWidth()===0)&&f(y,S)&&f(C,S)&&(T=!0)),T||(p="-".repeat(this._nullCellCount+1),p+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(p+="\x1B[A",p+=`\x1B[${b.length-this._nullCellCount}C`,p+=`\x1B[${this._nullCellCount}X`,p+=`\x1B[${b.length-this._nullCellCount}D`,p+="\x1B[B"),this._lastContentCursorRow=l+1,this._lastContentCursorCol=0,this._lastCursorRow=l+1,this._lastCursorCol=0)}else p=`\r
158
+ `,this._lastCursorRow=l+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=p,this._currentRow="",this._nullCellCount=0}_diffStyle(l,h){const u=[],p=!g(l,h),b=!f(l,h),E=!m(l,h);if(p||b||E)if(l.isAttributeDefault())h.isAttributeDefault()||u.push(0);else{if(p){const y=l.getFgColor();l.isFgRGB()?u.push(38,2,y>>>16&255,y>>>8&255,255&y):l.isFgPalette()?y>=16?u.push(38,5,y):u.push(8&y?90+(7&y):30+(7&y)):u.push(39)}if(b){const y=l.getBgColor();l.isBgRGB()?u.push(48,2,y>>>16&255,y>>>8&255,255&y):l.isBgPalette()?y>=16?u.push(48,5,y):u.push(8&y?100+(7&y):40+(7&y)):u.push(49)}E&&(l.isInverse()!==h.isInverse()&&u.push(l.isInverse()?7:27),l.isBold()!==h.isBold()&&u.push(l.isBold()?1:22),l.isUnderline()!==h.isUnderline()&&u.push(l.isUnderline()?4:24),l.isOverline()!==h.isOverline()&&u.push(l.isOverline()?53:55),l.isBlink()!==h.isBlink()&&u.push(l.isBlink()?5:25),l.isInvisible()!==h.isInvisible()&&u.push(l.isInvisible()?8:28),l.isItalic()!==h.isItalic()&&u.push(l.isItalic()?3:23),l.isDim()!==h.isDim()&&u.push(l.isDim()?2:22),l.isStrikethrough()!==h.isStrikethrough()&&u.push(l.isStrikethrough()?9:29))}return u}_nextCell(l,h,u,p){if(l.getWidth()===0)return;const b=l.getChars()==="",E=this._diffStyle(l,this._cursorStyle);if(b?!f(this._cursorStyle,l):E.length>0){this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=u,this._lastContentCursorCol=this._lastCursorCol=p,this._currentRow+=`\x1B[${E.join(";")}m`;const y=this._buffer.getLine(u);y!==void 0&&(y.getCell(p,this._cursorStyle),this._cursorStyleRow=u,this._cursorStyleCol=p)}b?this._nullCellCount+=l.getWidth():(this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=l.getChars(),this._lastContentCursorRow=this._lastCursorRow=u,this._lastContentCursorCol=this._lastCursorCol=p+l.getWidth())}_serializeString(l){let h=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(h=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let u="";for(let y=0;y<h;y++)u+=this._allRows[y],y+1<h&&(u+=this._allRowSeparators[y]);if(!l){const y=this._buffer.baseY+this._buffer.cursorY,C=this._buffer.cursorX,S=k=>{k>0?u+=`\x1B[${k}C`:k<0&&(u+=`\x1B[${-k}D`)};(y!==this._lastCursorRow||C!==this._lastCursorCol)&&((p=y-this._lastCursorRow)>0?u+=`\x1B[${p}B`:p<0&&(u+=`\x1B[${-p}A`),S(C-this._lastCursorCol))}var p;const b=this._terminal._core._inputHandler._curAttrData,E=this._diffStyle(b,this._cursorStyle);return E.length>0&&(u+=`\x1B[${E.join(";")}m`),u}}d.SerializeAddon=class{activate(v){this._terminal=v}_serializeBufferByScrollback(v,l,h){const u=l.length,p=h===void 0?u:o(h+v.rows,0,u);return this._serializeBufferByRange(v,l,{start:u-p,end:u-1},!1)}_serializeBufferByRange(v,l,h,u){return new _(l,v).serialize({start:{x:0,y:typeof h.start=="number"?h.start:h.start.line},end:{x:v.cols,y:typeof h.end=="number"?h.end:h.end.line}},u)}_serializeBufferAsHTML(v,l){var h;const u=v.buffer.active,p=new w(u,v,l);if(!l.onlySelection){const E=u.length,y=l.scrollback,C=y===void 0?E:o(y+v.rows,0,E);return p.serialize({start:{x:0,y:E-C},end:{x:v.cols,y:E-1}})}const b=(h=this._terminal)==null?void 0:h.getSelectionPosition();return b!==void 0?p.serialize({start:{x:b.start.x,y:b.start.y},end:{x:b.end.x,y:b.end.y}}):""}_serializeModes(v){let l="";const h=v.modes;if(h.applicationCursorKeysMode&&(l+="\x1B[?1h"),h.applicationKeypadMode&&(l+="\x1B[?66h"),h.bracketedPasteMode&&(l+="\x1B[?2004h"),h.insertMode&&(l+="\x1B[4h"),h.originMode&&(l+="\x1B[?6h"),h.reverseWraparoundMode&&(l+="\x1B[?45h"),h.sendFocusMode&&(l+="\x1B[?1004h"),h.wraparoundMode===!1&&(l+="\x1B[?7l"),h.mouseTrackingMode!=="none")switch(h.mouseTrackingMode){case"x10":l+="\x1B[?9h";break;case"vt200":l+="\x1B[?1000h";break;case"drag":l+="\x1B[?1002h";break;case"any":l+="\x1B[?1003h"}return l}serialize(v){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let l=v!=null&&v.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,v.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,v==null?void 0:v.scrollback);return v!=null&&v.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(l+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),v!=null&&v.excludeModes||(l+=this._serializeModes(this._terminal)),l}serializeAsHTML(v){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,v||{})}dispose(){}};class w extends c{constructor(l,h,u){super(l),this._terminal=h,this._options=u,this._currentRow="",this._htmlContent="",h._core._themeService?this._ansiColors=h._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(l,h,u){return h>>=0,u=u??" ",l.length>h?l:((h-=l.length)>u.length&&(u+=u.repeat(h/u.length)),u.slice(0,h)+l)}_beforeSerialize(l,h,u){var p,b;this._htmlContent+="<html><body><!--StartFragment--><pre>";let E="#000000",y="#ffffff";this._options.includeGlobalBackground&&(E=((p=this._terminal.options.theme)==null?void 0:p.foreground)??"#ffffff",y=((b=this._terminal.options.theme)==null?void 0:b.background)??"#000000");const C=[];C.push("color: "+E+";"),C.push("background-color: "+y+";"),C.push("font-family: "+this._terminal.options.fontFamily+";"),C.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+C.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(l,h){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(l,h){const u=h?l.getFgColor():l.getBgColor();return(h?l.isFgRGB():l.isBgRGB())?"#"+[u>>16&255,u>>8&255,255&u].map((p=>this._padStart(p.toString(16),2,"0"))).join(""):(h?l.isFgPalette():l.isBgPalette())?this._ansiColors[u].css:void 0}_diffStyle(l,h){const u=[],p=!g(l,h),b=!f(l,h),E=!m(l,h);if(p||b||E){const y=this._getHexColor(l,!0);y&&u.push("color: "+y+";");const C=this._getHexColor(l,!1);return C&&u.push("background-color: "+C+";"),l.isInverse()&&u.push("color: #000000; background-color: #BFBFBF;"),l.isBold()&&u.push("font-weight: bold;"),l.isUnderline()&&l.isOverline()?u.push("text-decoration: overline underline;"):l.isUnderline()?u.push("text-decoration: underline;"):l.isOverline()&&u.push("text-decoration: overline;"),l.isBlink()&&u.push("text-decoration: blink;"),l.isInvisible()&&u.push("visibility: hidden;"),l.isItalic()&&u.push("font-style: italic;"),l.isDim()&&u.push("opacity: 0.5;"),l.isStrikethrough()&&u.push("text-decoration: line-through;"),u}}_nextCell(l,h,u,p){if(l.getWidth()===0)return;const b=l.getChars()==="",E=this._diffStyle(l,h);E&&(this._currentRow+=E.length===0?"</span><span>":"</span><span style='"+E.join(" ")+"'>"),this._currentRow+=b?" ":l.getChars()}_serializeString(){return this._htmlContent}}d.HTMLSerializeHandler=w})(),a})()))})(On)),On.exports}var $h=Wh(),Fn={exports:{}},Hh=Fn.exports,Do;function Gh(){return Do||(Do=1,(function(e,t){(function(r,i){e.exports=i()})(Hh,(()=>(()=>{var r={433:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=o(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],m=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function v(l,h){let u,p=0,b=h.length-1;if(l<h[0][0]||l>h[b][1])return!1;for(;b>=p;)if(u=p+b>>1,l>h[u][1])p=u+1;else{if(!(l<h[u][0]))return!0;b=u-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let l=0;l<g.length;++l)w.fill(0,g[l][0],g[l][1]+1);for(let l=0;l<m.length;++l)w.fill(2,m[l][0],m[l][1]+1)}}wcwidth(l){return l<32?0:l<127?1:l<65536?w[l]:v(l,f)?0:v(l,_)?2:1}charProperties(l,h){let u=this.wcwidth(l),p=u===0&&h!==0;if(p){const b=c.UnicodeService.extractWidth(h);b===0?p=!1:b>u&&(u=b)}return c.UnicodeService.createPropertyValue(0,u,p)}}},345:(d,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o((g=>c.fire(g)))},s.runAndSubscribe=function(o,c){return c(void 0),o((g=>c(g)))}},490:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=o(938),g=[[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]],f=[[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 m;s.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let _=0;_<g.length;++_)m.fill(0,g[_][0],g[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?m[_]:(function(w,v){let l,h=0,u=v.length-1;if(w<v[0][0]||w>v[u][1])return!1;for(;u>=h;)if(l=h+u>>1,w>v[l][1])h=l+1;else{if(!(w<v[l][0]))return!0;u=l-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,w){let v=this.wcwidth(_),l=v===0&&w!==0;if(l){const h=c.UnicodeService.extractWidth(w);h===0?l=!1:h>v&&(v=h)}return c.UnicodeService.createPropertyValue(0,v,l)}}},938:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=o(345),g=o(490);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,w,v=!1){return(16777215&_)<<3|(3&w)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new g.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let w=0,v=0;const l=_.length;for(let h=0;h<l;++h){let u=_.charCodeAt(h);if(55296<=u&&u<=56319){if(++h>=l)return w+this.wcwidth(u);const E=_.charCodeAt(h);56320<=E&&E<=57343?u=1024*(u-55296)+E-56320+65536:w+=this.wcwidth(E)}const p=this.charProperties(u,v);let b=f.extractWidth(p);f.extractShouldJoin(p)&&(b-=f.extractWidth(v)),w+=b,v=p}return w}charProperties(_,w){return this._activeProvider.charProperties(_,w)}}s.UnicodeService=f}},i={};function n(d){var s=i[d];if(s!==void 0)return s.exports;var o=i[d]={exports:{}};return r[d](o,o.exports,n),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.Unicode11Addon=void 0;const s=n(433);d.Unicode11Addon=class{activate(o){o.unicode.register(new s.UnicodeV11)}dispose(){}}})(),a})()))})(Fn)),Fn.exports}var Zh=Gh(),Oo={exports:{}},Fo;function Kh(){return Fo||(Fo=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(d,s)=>{function o(g){try{const f=new URL(g),m=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return g.toLocaleLowerCase().startsWith(m.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(g,f,m,_={}){this._terminal=g,this._regex=f,this._handler=m,this._options=_}provideLinks(g,f){const m=c.computeLink(g,this._regex,this._terminal,this._handler);f(this._addCallbacks(m))}_addCallbacks(g){return g.map((f=>(f.leave=this._options.leave,f.hover=(m,_)=>{if(this._options.hover){const{range:w}=f;this._options.hover(m,_,w)}},f)))}};class c{static computeLink(f,m,_,w){const v=new RegExp(m.source,(m.flags||"")+"g"),[l,h]=c._getWindowedLineStrings(f-1,_),u=l.join("");let p;const b=[];for(;p=v.exec(u);){const E=p[0];if(!o(E))continue;const[y,C]=c._mapStrIdx(_,h,0,p.index),[S,k]=c._mapStrIdx(_,y,C,E.length);if(y===-1||C===-1||S===-1||k===-1)continue;const T={start:{x:C+1,y:y+1},end:{x:k,y:S+1}};b.push({range:T,text:E,activate:w})}return b}static _getWindowedLineStrings(f,m){let _,w=f,v=f,l=0,h="";const u=[];if(_=m.buffer.active.getLine(f)){const p=_.translateToString(!0);if(_.isWrapped&&p[0]!==" "){for(l=0;(_=m.buffer.active.getLine(--w))&&l<2048&&(h=_.translateToString(!0),l+=h.length,u.push(h),_.isWrapped&&h.indexOf(" ")===-1););u.reverse()}for(u.push(p),l=0;(_=m.buffer.active.getLine(++v))&&_.isWrapped&&l<2048&&(h=_.translateToString(!0),l+=h.length,u.push(h),h.indexOf(" ")===-1););}return[u,w]}static _mapStrIdx(f,m,_,w){const v=f.buffer.active,l=v.getNullCell();let h=_;for(;w;){const u=v.getLine(m);if(!u)return[-1,-1];for(let p=h;p<u.length;++p){u.getCell(p,l);const b=l.getChars();if(l.getWidth()&&(w-=b.length||1,p===u.length-1&&b==="")){const E=v.getLine(m+1);E&&E.isWrapped&&(E.getCell(0,l),l.getWidth()===2&&(w+=1))}if(w<0)return[m,p]}m++,h=0}return[m,h]}}s.LinkComputer=c}},i={};function n(d){var s=i[d];if(s!==void 0)return s.exports;var o=i[d]={exports:{}};return r[d](o,o.exports,n),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const s=n(6),o=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(g,f){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(g=c,f={}){this._handler=g,this._options=f}activate(g){this._terminal=g;const f=this._options,m=f.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,m,this._handler,f))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),a})()))})(Oo)),Oo.exports}var Yh=Kh(),Vo={exports:{}},Uo;function Xh(){return Uo||(Uo=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,(()=>(()=>{var r={4567:function(d,s,o){var c=this&&this.__decorate||function(u,p,b,E){var y,C=arguments.length,S=C<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,p,b,E);else for(var k=u.length-1;k>=0;k--)(y=u[k])&&(S=(C<3?y(S):C>3?y(p,b,S):y(p,b))||S);return C>3&&S&&Object.defineProperty(p,b,S),S},g=this&&this.__param||function(u,p){return function(b,E){p(b,E,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const f=o(9042),m=o(9924),_=o(844),w=o(4725),v=o(2585),l=o(3656);let h=s.AccessibilityManager=class extends _.Disposable{constructor(u,p,b,E){super(),this._terminal=u,this._coreBrowserService=b,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
159
+ `)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,l.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(u){for(let p=0;p<u;p++)this._handleChar(" ")}_handleChar(u){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==u&&(this._charsToAnnounce+=u):this._charsToAnnounce+=u,u===`
160
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(u){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(u)||this._charsToConsume.push(u)}_refreshRows(u,p){this._liveRegionDebouncer.refresh(u,p,this._terminal.rows)}_renderRows(u,p){const b=this._terminal.buffer,E=b.lines.length.toString();for(let y=u;y<=p;y++){const C=b.lines.get(b.ydisp+y),S=[],k=(C==null?void 0:C.translateToString(!0,void 0,void 0,S))||"",T=(b.ydisp+y+1).toString(),R=this._rowElements[y];R&&(k.length===0?(R.innerText=" ",this._rowColumns.set(R,[0,1])):(R.textContent=k,this._rowColumns.set(R,S)),R.setAttribute("aria-posinset",T),R.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(u,p){const b=u.target,E=this._rowElements[p===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||u.relatedTarget!==E)return;let y,C;if(p===0?(y=b,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(y=this._rowElements.shift(),C=b,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),u.preventDefault(),u.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:p.anchorNode,offset:p.anchorOffset},E={node:p.focusNode,offset:p.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const y=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:y,offset:((u=y.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(E.node))return;const C=({node:T,offset:R})=>{const L=T instanceof Text?T.parentNode:T;let N=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(L);if(!U)return console.warn("columns is null. Race condition?"),null;let P=R<U.length?U[R]:U.slice(-1)[0]+1;return P>=this._terminal.cols&&(++N,P=0),{row:N,column:P}},S=C(b),k=C(E);if(S&&k){if(S.row>k.row||S.row===k.row&&S.column>=k.column)throw new Error("invalid range");this._terminal.select(S.column,S.row,(k.row-S.row)*this._terminal.cols-S.column+k.column)}}_handleResize(u){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>u;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const u=this._coreBrowserService.mainDocument.createElement("div");return u.setAttribute("role","listitem"),u.tabIndex=-1,this._refreshRowDimensions(u),u}_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 u=0;u<this._terminal.rows;u++)this._refreshRowDimensions(this._rowElements[u])}}_refreshRowDimensions(u){u.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=h=c([g(1,v.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],h)},3614:(d,s)=>{function o(m){return m.replace(/\r?\n/g,"\r")}function c(m,_){return _?"\x1B[200~"+m+"\x1B[201~":m}function g(m,_,w,v){m=c(m=o(m),w.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(m,!0),_.value=""}function f(m,_,w){const v=w.getBoundingClientRect(),l=m.clientX-v.left-10,h=m.clientY-v.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${l}px`,_.style.top=`${h}px`,_.style.zIndex="1000",_.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=o,s.bracketTextForPaste=c,s.copyHandler=function(m,_){m.clipboardData&&m.clipboardData.setData("text/plain",_.selectionText),m.preventDefault()},s.handlePasteEvent=function(m,_,w,v){m.stopPropagation(),m.clipboardData&&g(m.clipboardData.getData("text/plain"),_,w,v)},s.paste=g,s.moveTextAreaUnderMouseCursor=f,s.rightClickHandler=function(m,_,w,v,l){f(m,_,w),l&&v.rightClickSelect(m),_.value=v.selectionText,_.select()}},7239:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(g,f,m){this._css.set(g,f,m)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,m){this._color.set(g,f,m)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,g,f){o.addEventListener(c,g,f);let m=!1;return{dispose:()=>{m||(m=!0,o.removeEventListener(c,g,f))}}}},3551:function(d,s,o){var c=this&&this.__decorate||function(h,u,p,b){var E,y=arguments.length,C=y<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,u,p,b);else for(var S=h.length-1;S>=0;S--)(E=h[S])&&(C=(y<3?E(C):y>3?E(u,p,C):E(u,p))||C);return y>3&&C&&Object.defineProperty(u,p,C),C},g=this&&this.__param||function(h,u){return function(p,b){u(p,b,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const f=o(3656),m=o(8460),_=o(844),w=o(2585),v=o(4725);let l=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(h,u,p,b,E){super(),this._element=h,this._mouseService=u,this._renderService=p,this._bufferService=b,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const u=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!u)return;this._isMouseOut=!1;const p=h.composedPath();for(let b=0;b<p.length;b++){const E=p[b];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._handleHover(u),this._lastBufferCell=u)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,u){var p,b;this._activeProviderReplies&&u||((p=this._activeProviderReplies)==null||p.forEach((y=>{y==null||y.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let E=!1;for(const[y,C]of this._linkProviderService.linkProviders.entries())u?(b=this._activeProviderReplies)!=null&&b.get(y)&&(E=this._checkLinkProviderResult(y,h,E)):C.provideLinks(h.y,(S=>{var k,T;if(this._isMouseOut)return;const R=S==null?void 0:S.map((L=>({link:L})));(k=this._activeProviderReplies)==null||k.set(y,R),E=this._checkLinkProviderResult(y,h,E),((T=this._activeProviderReplies)==null?void 0:T.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,u){const p=new Set;for(let b=0;b<u.size;b++){const E=u.get(b);if(E)for(let y=0;y<E.length;y++){const C=E[y],S=C.link.range.start.y<h?0:C.link.range.start.x,k=C.link.range.end.y>h?this._bufferService.cols:C.link.range.end.x;for(let T=S;T<=k;T++){if(p.has(T)){E.splice(y--,1);break}p.add(T)}}}}_checkLinkProviderResult(h,u,p){var b;if(!this._activeProviderReplies)return p;const E=this._activeProviderReplies.get(h);let y=!1;for(let C=0;C<h;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(y=!0);if(!y&&E){const C=E.find((S=>this._linkAtPosition(S.link,u)));C&&(p=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let C=0;C<this._activeProviderReplies.size;C++){const S=(b=this._activeProviderReplies.get(C))==null?void 0:b.find((k=>this._linkAtPosition(k.link,u)));if(S){p=!0,this._handleNewLink(S);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const u=this._positionFromMouseEvent(h,this._element,this._mouseService);u&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,u){this._currentLink&&this._lastMouseEvent&&(!h||!u||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._linkAtPosition(h.link,u)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var p,b;return(b=(p=this._currentLink)==null?void 0:p.state)==null?void 0:b.decorations.pointerCursor},set:p=>{var b;(b=this._currentLink)!=null&&b.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>{var p,b;return(b=(p=this._currentLink)==null?void 0:p.state)==null?void 0:b.decorations.underline},set:p=>{var b,E,y;(b=this._currentLink)!=null&&b.state&&((y=(E=this._currentLink)==null?void 0:E.state)==null?void 0:y.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;const b=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(b,E),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(h,u,p){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(p,u.text)}_fireUnderlineEvent(h,u){const p=h.range,b=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-b-1,p.end.x,p.end.y-b-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(h,u,p){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(p,u.text)}_linkAtPosition(h,u){const p=h.range.start.y*this._bufferService.cols+h.range.start.x,b=h.range.end.y*this._bufferService.cols+h.range.end.x,E=u.y*this._bufferService.cols+u.x;return p<=E&&E<=b}_positionFromMouseEvent(h,u,p){const b=p.getCoords(h,u,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,u,p,b,E){return{x1:h,y1:u,x2:p,y2:b,cols:this._bufferService.cols,fg:E}}};s.Linkifier=l=c([g(1,v.IMouseService),g(2,v.IRenderService),g(3,w.IBufferService),g(4,v.ILinkProviderService)],l)},9042:(d,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(d,s,o){var c=this&&this.__decorate||function(v,l,h,u){var p,b=arguments.length,E=b<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,l,h,u);else for(var y=v.length-1;y>=0;y--)(p=v[y])&&(E=(b<3?p(E):b>3?p(l,h,E):p(l,h))||E);return b>3&&E&&Object.defineProperty(l,h,E),E},g=this&&this.__param||function(v,l){return function(h,u){l(h,u,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const f=o(511),m=o(2585);let _=s.OscLinkProvider=class{constructor(v,l,h){this._bufferService=v,this._optionsService=l,this._oscLinkService=h}provideLinks(v,l){var h;const u=this._bufferService.buffer.lines.get(v-1);if(!u)return void l(void 0);const p=[],b=this._optionsService.rawOptions.linkHandler,E=new f.CellData,y=u.getTrimmedLength();let C=-1,S=-1,k=!1;for(let T=0;T<y;T++)if(S!==-1||u.hasContent(T)){if(u.loadCell(T,E),E.hasExtendedAttrs()&&E.extended.urlId){if(S===-1){S=T,C=E.extended.urlId;continue}k=E.extended.urlId!==C}else S!==-1&&(k=!0);if(k||S!==-1&&T===y-1){const R=(h=this._oscLinkService.getLinkData(C))==null?void 0:h.uri;if(R){const L={start:{x:S+1,y:v},end:{x:T+(k||T!==y-1?0:1),y:v}};let N=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const U=new URL(R);["http:","https:"].includes(U.protocol)||(N=!0)}catch{N=!0}N||p.push({text:R,range:L,activate:(U,P)=>b?b.activate(U,P,L):w(0,P),hover:(U,P)=>{var H;return(H=b==null?void 0:b.hover)==null?void 0:H.call(b,U,P,L)},leave:(U,P)=>{var H;return(H=b==null?void 0:b.leave)==null?void 0:H.call(b,U,P,L)}})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(S=T,C=E.extended.urlId):(S=-1,C=-1)}}l(p)}};function w(v,l){if(confirm(`Do you want to navigate to ${l}?
161
161
 
162
- WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=b=a([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],b)},6193:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(o,a){this._renderCallback=o,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,a,g){this._rowCount=g,o=o!==void 0?o:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a,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 o=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const a=o(3614),g=o(3656),d=o(3551),v=o(9042),b=o(3730),C=o(1680),m=o(3107),c=o(5744),u=o(2950),l=o(1296),f=o(428),_=o(4269),E=o(5114),y=o(8934),w=o(3230),S=o(9312),k=o(4725),R=o(6731),B=o(8055),L=o(8969),T=o(8460),F=o(844),U=o(6114),$=o(8437),j=o(2584),Z=o(7399),I=o(5941),N=o(9074),x=o(2585),D=o(5435),W=o(4567),Y=o(779);class J extends L.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(O={}){super(O),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(N.DecorationService),this._instantiationService.setService(x.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((A,H)=>this.refresh(A,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((A=>this._reportWindowsOptions(A)))),this.register(this._inputHandler.onColor((A=>this._handleColorEvent(A)))),this.register((0,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((A=>this._afterResize(A.cols,A.rows)))),this.register((0,F.toDisposable)((()=>{var A,H;this._customKeyEventHandler=void 0,(H=(A=this.element)==null?void 0:A.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(O){if(this._themeService)for(const A of O){let H,M="";switch(A.index){case 256:H="foreground",M="10";break;case 257:H="background",M="11";break;case 258:H="cursor",M="12";break;default:H="ansi",M="4;"+A.index}switch(A.type){case 0:const K=B.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${M};${(0,I.toRgbString)(K)}${j.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((X=>X.ansi[A.index]=B.channels.toColor(...A.color)));else{const X=H;this._themeService.modifyColors((te=>te[X]=B.channels.toColor(...A.color)))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(O){O?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var O;return(O=this.textarea)==null?void 0:O.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const O=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(O);if(!A)return;const H=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,K=A.getWidth(H),X=this._renderService.dimensions.css.cell.width*K,te=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=te+"px",this.textarea.style.width=X+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(A=>{this.hasSelection()&&(0,a.copyHandler)(A,this._selectionService)})));const O=A=>(0,a.handlePasteEvent)(A,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,g.addDisposableDomListener)(this.element,"paste",O)),U.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(A=>{A.button===2&&(0,a.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(A=>{(0,a.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),U.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(A=>{A.button===1&&(0,a.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(O=>this._keyUp(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(O=>this._keyDown(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(O=>this._keyPress(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(O=>this._compositionHelper.compositionupdate(O)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(O=>this._inputEvent(O)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(O){var A;if(!O)throw new Error("Terminal requires a parent element.");if(O.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((A=this.element)==null?void 0:A.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=O.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"),O.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),U.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(E.CoreBrowserService,this.textarea,O.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.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((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const O=this,A=this.element;function H(X){const te=O._mouseService.getMouseReportCoords(X,O.screenElement);if(!te)return!1;let pe,ge;switch(X.overrideType||X.type){case"mousemove":ge=32,X.buttons===void 0?(pe=3,X.button!==void 0&&(pe=X.button<3?X.button:3)):pe=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":ge=0,pe=X.button<3?X.button:3;break;case"mousedown":ge=1,pe=X.button<3?X.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(X)===!1||O.viewport.getLinesScrolled(X)===0)return!1;ge=X.deltaY<0?0:1,pe=4;break;default:return!1}return!(ge===void 0||pe===void 0||pe>4)&&O.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:pe,action:ge,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:X=>(H(X),X.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(X)),wheel:X=>(H(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&H(X)},mousemove:X=>{X.buttons||H(X)}};this.register(this.coreMouseService.onProtocolChange((X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&X?M.mousemove||(A.addEventListener("mousemove",K.mousemove),M.mousemove=K.mousemove):(A.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&X?M.wheel||(A.addEventListener("wheel",K.wheel,{passive:!1}),M.wheel=K.wheel):(A.removeEventListener("wheel",M.wheel),M.wheel=null),2&X?M.mouseup||(M.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&X?M.mousedrag||(M.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(A,"mousedown",(X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return H(X),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(X)}))),this.register((0,g.addDisposableDomListener)(A,"wheel",(X=>{if(!M.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(X);if(te===0)return;const pe=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let ge="";for(let De=0;De<Math.abs(te);De++)ge+=pe;return this.coreService.triggerDataEvent(ge,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(A,"touchstart",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(A,"touchmove",(X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)}),{passive:!1}))}refresh(O,A){var H;(H=this._renderService)==null||H.refreshRows(O,A)}updateCursorStyle(O){var A;(A=this._selectionService)!=null&&A.shouldColumnSelect(O)?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(O,A,H=0){var M;H===1?(super.scrollLines(O,A,H),this.refresh(0,this.rows-1)):(M=this.viewport)==null||M.scrollLines(O)}paste(O){(0,a.paste)(O,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(O){this._customKeyEventHandler=O}attachCustomWheelEventHandler(O){this._customWheelEventHandler=O}registerLinkProvider(O){return this._linkProviderService.registerLinkProvider(O)}registerCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(O);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(O)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(O){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)}registerDecoration(O){return this._decorationService.registerDecoration(O)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(O,A,H){this._selectionService.setSelection(O,A,H)}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 O;(O=this._selectionService)==null||O.clearSelection()}selectAll(){var O;(O=this._selectionService)==null||O.selectAll()}selectLines(O,A){var H;(H=this._selectionService)==null||H.selectLines(O,A)}_keyDown(O){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&O.altKey;if(!A&&!this._compositionHelper.keydown(O))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;A||O.key!=="Dead"&&O.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,Z.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),H.type===3||H.type===2){const M=this.rows-1;return this.scrollLines(H.type===2?-M:M),this.cancel(O,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||(H.cancel&&this.cancel(O,!0),!H.key||!!(O.key&&!O.ctrlKey&&!O.altKey&&!O.metaKey&&O.key.length===1&&O.key.charCodeAt(0)>=65&&O.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==j.C0.ETX&&H.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,A){const H=O.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||O.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||O.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?H:H&&(!A.keyCode||A.keyCode>47)}_keyUp(O){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||((function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18})(O)||this.focus(),this.updateCursorStyle(O),this._keyPressHandled=!1)}_keyPress(O){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)A=O.charCode;else if(O.which===null||O.which===void 0)A=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;A=O.which}return!(!A||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(O){if(O.data&&O.inputType==="insertText"&&(!O.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=O.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(O),!0}return!1}resize(O,A){O!==this.cols||A!==this.rows?super.resize(O,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(O,A){var H,M;(H=this._charSizeService)==null||H.measure(),(M=this.viewport)==null||M.syncScrollArea(!0)}clear(){var O;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 A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(O=this.viewport)==null||O.reset(),this.refresh(0,this.rows-1)}}reset(){var O,A;this.options.rows=this.rows,this.options.cols=this.cols;const H=this._customKeyEventHandler;this._setup(),super.reset(),(O=this._selectionService)==null||O.reset(),this._decorationService.reset(),(A=this.viewport)==null||A.reset(),this._customKeyEventHandler=H,this.refresh(0,this.rows-1)}clearTextureAtlas(){var O;(O=this._renderService)==null||O.clearTextureAtlas()}_reportFocus(){var O;(O=this.element)!=null&&O.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${H};${A}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${K};${M}t`)}}cancel(O,A){if(this.options.cancelEvents||A)return O.preventDefault(),O.stopPropagation(),!1}}n.Terminal=J},9924:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(o,a=1e3){this._renderCallback=o,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,a,g){this._rowCount=g,o=o!==void 0?o:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=d-this._lastRefreshMs,b=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,a)}}},1680:function(p,n,o){var a=this&&this.__decorate||function(u,l,f,_){var E,y=arguments.length,w=y<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,l,f,_);else for(var S=u.length-1;S>=0;S--)(E=u[S])&&(w=(y<3?E(w):y>3?E(l,f,w):E(l,f))||w);return y>3&&w&&Object.defineProperty(l,f,w),w},g=this&&this.__param||function(u,l){return function(f,_){l(f,_,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const d=o(3656),v=o(4725),b=o(8460),C=o(844),m=o(2585);let c=n.Viewport=class extends C.Disposable{constructor(u,l,f,_,E,y,w,S){super(),this._viewportElement=u,this._scrollArea=l,this._bufferService=f,this._optionsService=_,this._charSizeService=E,this._renderService=y,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.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(S.colors),this.register(S.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,l){const f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&f<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const l=this._getPixelsScrolled(u);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(u,l){var f;let _,E="";const y=[],w=l??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let k=u;k<w;k++){const R=S.get(k);if(!R)continue;const B=(f=S.get(k+1))==null?void 0:f.isWrapped;if(E+=R.translateToString(!B),!B||k===S.length-1){const L=document.createElement("div");L.textContent=E,y.push(L),E.length>0&&(_=L),E=""}}return{bufferElements:y,cursorElement:_}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(u,l){const f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&l.altKey||f==="ctrl"&&l.ctrlKey||f==="shift"&&l.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const l=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}};n.Viewport=c=a([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],c)},3107:function(p,n,o){var a=this&&this.__decorate||function(m,c,u,l){var f,_=arguments.length,E=_<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,c,u,l);else for(var y=m.length-1;y>=0;y--)(f=m[y])&&(E=(_<3?f(E):_>3?f(c,u,E):f(c,u))||E);return _>3&&E&&Object.defineProperty(c,u,E),E},g=this&&this.__param||function(m,c){return function(u,l){c(u,l,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const d=o(4725),v=o(844),b=o(2585);let C=n.BufferDecorationRenderer=class extends v.Disposable{constructor(m,c,u,l,f){super(),this._screenElement=m,this._bufferService=c,this._coreBrowserService=u,this._decorationService=l,this._renderService=f,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((_=>this._removeDecoration(_)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var c;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((c=m==null?void 0:m.options)==null?void 0:c.layer)==="top"),u.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=m.options.x??0;return l&&l>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(m,u),u}_refreshStyle(m){const c=m.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let u=this._decorationElements.get(m);u||(u=this._createElement(m),m.element=u,this._decorationElements.set(m,u),this._container.appendChild(u),m.onDispose((()=>{this._decorationElements.delete(m),u.remove()}))),u.style.top=c*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(u)}}_refreshXPosition(m,c=m.element){if(!c)return;const u=m.options.x??0;(m.options.anchor||"left")==="right"?c.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var c;(c=this._decorationElements.get(m))==null||c.remove(),this._decorationElements.delete(m),m.dispose()}};n.BufferDecorationRenderer=C=a([g(1,b.IBufferService),g(2,d.ICoreBrowserService),g(3,b.IDecorationService),g(4,d.IRenderService)],C)},5871:(p,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(o){if(o.options.overviewRulerOptions){for(const a of this._zones)if(a.color===o.options.overviewRulerOptions.color&&a.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,o.marker.line))return;if(this._lineAdjacentToZone(a,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(a,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,a){return a>=o.startBufferLine&&a<=o.endBufferLine}_lineAdjacentToZone(o,a,g){return a>=o.startBufferLine-this._linePadding[g||"full"]&&a<=o.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(o,a){o.startBufferLine=Math.min(o.startBufferLine,a),o.endBufferLine=Math.max(o.endBufferLine,a)}}},5744:function(p,n,o){var a=this&&this.__decorate||function(f,_,E,y){var w,S=arguments.length,k=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,y);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(k=(S<3?w(k):S>3?w(_,E,k):w(_,E))||k);return S>3&&k&&Object.defineProperty(_,E,k),k},g=this&&this.__param||function(f,_){return function(E,y){_(E,y,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const d=o(5871),v=o(4725),b=o(844),C=o(2585),m={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let l=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,_,E,y,w,S,k){var R;super(),this._viewportElement=f,this._screenElement=_,this._bufferService=E,this._decorationService=y,this._renderService=w,this._optionsService=S,this._coreBrowserService=k,this._colorZoneStore=new d.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(),(R=this._viewportElement.parentElement)==null||R.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var L;(L=this._canvas)==null||L.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 f=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=f,c.center=_,c.right=f,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=c.left,u.right=c.left+c.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);m.left=_,m.center=_,m.right=_}_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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const _ of f)_.position!=="full"&&this._renderColorZone(_);for(const _ of f)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(u[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-m[f.position||"full"]/2),c[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[f.position||"full"]))}_queueRefresh(f,_){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=l=a([g(2,C.IBufferService),g(3,C.IDecorationService),g(4,v.IRenderService),g(5,C.IOptionsService),g(6,v.ICoreBrowserService)],l)},2950:function(p,n,o){var a=this&&this.__decorate||function(m,c,u,l){var f,_=arguments.length,E=_<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,c,u,l);else for(var y=m.length-1;y>=0;y--)(f=m[y])&&(E=(_<3?f(E):_>3?f(c,u,E):f(c,u))||E);return _>3&&E&&Object.defineProperty(c,u,E),E},g=this&&this.__param||function(m,c){return function(u,l){c(u,l,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const d=o(4725),v=o(2585),b=o(2584);let C=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,c,u,l,f,_){this._textarea=m,this._compositionView=c,this._bufferService=u,this._optionsService=l,this._coreService=f,this._renderService=_,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 c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const c=this._textarea.value,u=c.replace(m,"");this._dataAlreadySent=u,c.length>m.length?this._coreService.triggerDataEvent(u,!0):c.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):c.length===m.length&&c!==m&&this._coreService.triggerDataEvent(c,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=C=a([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,d.IRenderService)],C)},9806:(p,n)=>{function o(a,g,d){const v=d.getBoundingClientRect(),b=a.getComputedStyle(d),C=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[g.clientX-v.left-C,g.clientY-v.top-m]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=o,n.getCoords=function(a,g,d,v,b,C,m,c,u){if(!C)return;const l=o(a,g,d);return l?(l[0]=Math.ceil((l[0]+(u?m/2:0))/m),l[1]=Math.ceil(l[1]/c),l[0]=Math.min(Math.max(l[0],1),v+(u?1:0)),l[1]=Math.min(Math.max(l[1],1),b),l):void 0}},9504:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const a=o(2584);function g(c,u,l,f){const _=c-d(c,l),E=u-d(u,l),y=Math.abs(_-E)-(function(w,S,k){let R=0;const B=w-d(w,k),L=S-d(S,k);for(let T=0;T<Math.abs(B-L);T++){const F=v(w,S)==="A"?-1:1,U=k.buffer.lines.get(B+F*T);U!=null&&U.isWrapped&&R++}return R})(c,u,l);return m(y,C(v(c,u),f))}function d(c,u){let l=0,f=u.buffer.lines.get(c),_=f==null?void 0:f.isWrapped;for(;_&&c>=0&&c<u.rows;)l++,f=u.buffer.lines.get(--c),_=f==null?void 0:f.isWrapped;return l}function v(c,u){return c>u?"A":"B"}function b(c,u,l,f,_,E){let y=c,w=u,S="";for(;y!==l||w!==f;)y+=_?1:-1,_&&y>E.cols-1?(S+=E.buffer.translateBufferLineToString(w,!1,c,y),y=0,c=0,w++):!_&&y<0&&(S+=E.buffer.translateBufferLineToString(w,!1,0,c+1),y=E.cols-1,c=y,w--);return S+E.buffer.translateBufferLineToString(w,!1,c,y)}function C(c,u){const l=u?"O":"[";return a.C0.ESC+l+c}function m(c,u){c=Math.floor(c);let l="";for(let f=0;f<c;f++)l+=u;return l}n.moveToCellSequence=function(c,u,l,f){const _=l.buffer.x,E=l.buffer.y;if(!l.buffer.hasScrollback)return(function(S,k,R,B,L,T){return g(k,B,L,T).length===0?"":m(b(S,k,S,k-d(k,L),!1,L).length,C("D",T))})(_,E,0,u,l,f)+g(E,u,l,f)+(function(S,k,R,B,L,T){let F;F=g(k,B,L,T).length>0?B-d(B,L):k;const U=B,$=(function(j,Z,I,N,x,D){let W;return W=g(I,N,x,D).length>0?N-d(N,x):Z,j<I&&W<=N||j>=I&&W<N?"C":"D"})(S,k,R,B,L,T);return m(b(S,F,R,U,$==="C",L).length,C($,T))})(_,E,c,u,l,f);let y;if(E===u)return y=_>c?"D":"C",m(Math.abs(_-c),C(y,f));y=E>u?"D":"C";const w=Math.abs(E-u);return m((function(S,k){return k.cols-S})(E>u?c:_,l)+(w-1)*l.cols+1+((E>u?_:c)-1),C(y,f))}},1296:function(p,n,o){var a=this&&this.__decorate||function(T,F,U,$){var j,Z=arguments.length,I=Z<3?F:$===null?$=Object.getOwnPropertyDescriptor(F,U):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(T,F,U,$);else for(var N=T.length-1;N>=0;N--)(j=T[N])&&(I=(Z<3?j(I):Z>3?j(F,U,I):j(F,U))||I);return Z>3&&I&&Object.defineProperty(F,U,I),I},g=this&&this.__param||function(T,F){return function(U,$){F(U,$,T)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const d=o(3787),v=o(2550),b=o(2223),C=o(6171),m=o(6052),c=o(4725),u=o(8055),l=o(8460),f=o(844),_=o(2585),E="xterm-dom-renderer-owner-",y="xterm-rows",w="xterm-fg-",S="xterm-bg-",k="xterm-focus",R="xterm-selection";let B=1,L=n.DomRenderer=class extends f.Disposable{constructor(T,F,U,$,j,Z,I,N,x,D,W,Y,J){super(),this._terminal=T,this._document=F,this._element=U,this._screenElement=$,this._viewportElement=j,this._helperContainer=Z,this._linkifier2=I,this._charSizeService=x,this._optionsService=D,this._bufferService=W,this._coreBrowserService=Y,this._themeService=J,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Q=>this._injectCss(Q)))),this._injectCss(this._themeService.colors),this._rowFactory=N.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Q=>this._handleLinkHover(Q)))),this.register(this._linkifier2.onHideLinkUnderline((Q=>this._handleLinkLeave(Q)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${y} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${y} .xterm-dim { color: ${u.color.multiplyOpacity(T.foreground,.5).css};}`,F+=`${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 U=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;F+=`@keyframes ${U} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${$} { 50% { box-shadow: none; }}`,F+=`@keyframes ${j} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,F+=`${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,I]of T.ansi.entries())F+=`${this._terminalSelector} .${w}${Z} { color: ${I.css}; }${this._terminalSelector} .${w}${Z}.xterm-dim { color: ${u.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${S}${Z} { background-color: ${I.css}; }`;F+=`${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(T.background).css}; }${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${S}${b.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,F){for(let U=this._rowElements.length;U<=F;U++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,F){this._refreshRowElements(T,F),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(T,F,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,F,U),this.renderRows(0,this._bufferService.rows-1),!T||!F)return;this._selectionRenderModel.update(this._terminal,T,F,U);const $=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||I<0)return;const N=this._document.createDocumentFragment();if(U){const x=T[0]>F[0];N.appendChild(this._createSelectionElement(Z,x?F[0]:T[0],x?T[0]:F[0],I-Z+1))}else{const x=$===Z?T[0]:0,D=Z===j?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(Z,x,D));const W=I-Z-1;if(N.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,W)),Z!==I){const Y=j===I?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(I,0,Y))}}this._selectionContainer.appendChild(N)}_createSelectionElement(T,F,U,$=1){const j=this._document.createElement("div"),Z=F*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(U-F);return Z+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Z),j.style.height=$*this.dimensions.css.cell.height+"px",j.style.top=T*this.dimensions.css.cell.height+"px",j.style.left=`${Z}px`,j.style.width=`${I}px`,j}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,F){const U=this._bufferService.buffer,$=U.ybase+U.y,j=Math.min(U.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=T;x<=F;x++){const D=x+U.ydisp,W=this._rowElements[x],Y=U.lines.get(D);if(!W||!Y)break;W.replaceChildren(...this._rowFactory.createRow(Y,D,D===$,I,N,j,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,F,U,$,j,Z){U<0&&(T=0),$<0&&(F=0);const I=this._bufferService.rows-1;U=Math.max(Math.min(U,I),0),$=Math.max(Math.min($,I),0),j=Math.min(j,this._bufferService.cols);const N=this._bufferService.buffer,x=N.ybase+N.y,D=Math.min(N.x,j-1),W=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=U;Q<=$;++Q){const O=Q+N.ydisp,A=this._rowElements[Q],H=N.lines.get(O);if(!A||!H)break;A.replaceChildren(...this._rowFactory.createRow(H,O,O===x,Y,J,D,W,this.dimensions.css.cell.width,this._widthCache,Z?Q===U?T:0:-1,Z?(Q===$?F:j)-1:-1))}}};n.DomRenderer=L=a([g(7,_.IInstantiationService),g(8,c.ICharSizeService),g(9,_.IOptionsService),g(10,_.IBufferService),g(11,c.ICoreBrowserService),g(12,c.IThemeService)],L)},3787:function(p,n,o){var a=this&&this.__decorate||function(y,w,S,k){var R,B=arguments.length,L=B<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,w,S,k);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(L=(B<3?R(L):B>3?R(w,S,L):R(w,S))||L);return B>3&&L&&Object.defineProperty(w,S,L),L},g=this&&this.__param||function(y,w){return function(S,k){w(S,k,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const d=o(2223),v=o(643),b=o(511),C=o(2585),m=o(8055),c=o(4725),u=o(4269),l=o(6171),f=o(3734);let _=n.DomRendererRowFactory=class{constructor(y,w,S,k,R,B,L){this._document=y,this._characterJoinerService=w,this._optionsService=S,this._coreBrowserService=k,this._coreService=R,this._decorationService=B,this._themeService=L,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,w,S){this._selectionStart=y,this._selectionEnd=w,this._columnSelectMode=S}createRow(y,w,S,k,R,B,L,T,F,U,$){const j=[],Z=this._characterJoinerService.getJoinedCharacters(w),I=this._themeService.colors;let N,x=y.getNoBgTrimmedLength();S&&x<B+1&&(x=B+1);let D=0,W="",Y=0,J=0,Q=0,O=!1,A=0,H=!1,M=0;const K=[],X=U!==-1&&$!==-1;for(let te=0;te<x;te++){y.loadCell(te,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let ge=!1,De=te,q=this._workCell;if(Z.length>0&&te===Z[0][0]){ge=!0;const de=Z.shift();q=new u.JoinedCellData(this._workCell,y.translateToString(!0,de[0],de[1]),de[1]-de[0]),De=de[1]-1,pe=q.getWidth()}const Qt=this._isCellInSelection(te,w),Li=S&&te===B,xi=X&&te>=U&&te<=$;let Di=!1;this._decorationService.forEachDecorationAtCell(te,w,void 0,(de=>{Di=!0}));let Pr=q.getChars()||v.WHITESPACE_CELL_CHAR;if(Pr===" "&&(q.isUnderline()||q.isOverline())&&(Pr=" "),M=pe*T-F.get(Pr,q.isBold(),q.isItalic()),N){if(D&&(Qt&&H||!Qt&&!H&&q.bg===Y)&&(Qt&&H&&I.selectionForeground||q.fg===J)&&q.extended.ext===Q&&xi===O&&M===A&&!Li&&!ge&&!Di){q.isInvisible()?W+=v.WHITESPACE_CELL_CHAR:W+=Pr,D++;continue}D&&(N.textContent=W),N=this._document.createElement("span"),D=0,W=""}else N=this._document.createElement("span");if(Y=q.bg,J=q.fg,Q=q.extended.ext,O=xi,A=M,H=Qt,ge&&B>=te&&B<=De&&(B=te),!this._coreService.isCursorHidden&&Li&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&K.push("xterm-cursor-blink"),K.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){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(q.isBold()&&K.push("xterm-bold"),q.isItalic()&&K.push("xterm-italic"),q.isDim()&&K.push("xterm-dim"),W=q.isInvisible()?v.WHITESPACE_CELL_CHAR:q.getChars()||v.WHITESPACE_CELL_CHAR,q.isUnderline()&&(K.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())N.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let de=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&de<8&&(de+=8),N.style.textDecorationColor=I.ansi[de].css}q.isOverline()&&(K.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&K.push("xterm-strikethrough"),xi&&(N.style.textDecoration="underline");let Ve=q.getFgColor(),qt=q.getFgColorMode(),Ke=q.getBgColor(),er=q.getBgColorMode();const Oi=!!q.isInverse();if(Oi){const de=Ve;Ve=Ke,Ke=de;const su=qt;qt=er,er=su}let st,Wr,ot,tr=!1;switch(this._decorationService.forEachDecorationAtCell(te,w,void 0,(de=>{de.options.layer!=="top"&&tr||(de.backgroundColorRGB&&(er=50331648,Ke=de.backgroundColorRGB.rgba>>8&16777215,st=de.backgroundColorRGB),de.foregroundColorRGB&&(qt=50331648,Ve=de.foregroundColorRGB.rgba>>8&16777215,Wr=de.foregroundColorRGB),tr=de.options.layer==="top")})),!tr&&Qt&&(st=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ke=st.rgba>>8&16777215,er=50331648,tr=!0,I.selectionForeground&&(qt=50331648,Ve=I.selectionForeground.rgba>>8&16777215,Wr=I.selectionForeground)),tr&&K.push("xterm-decoration-top"),er){case 16777216:case 33554432:ot=I.ansi[Ke],K.push(`xterm-bg-${Ke}`);break;case 50331648:ot=m.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle(N,`background-color:#${E((Ke>>>0).toString(16),"0",6)}`);break;default:Oi?(ot=I.foreground,K.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):ot=I.background}switch(st||q.isDim()&&(st=m.color.multiplyOpacity(ot,.5)),qt){case 16777216:case 33554432:q.isBold()&&Ve<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ve+=8),this._applyMinimumContrast(N,ot,I.ansi[Ve],q,st,void 0)||K.push(`xterm-fg-${Ve}`);break;case 50331648:const de=m.channels.toColor(Ve>>16&255,Ve>>8&255,255&Ve);this._applyMinimumContrast(N,ot,de,q,st,Wr)||this._addStyle(N,`color:#${E(Ve.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(N,ot,I.foreground,q,st,Wr)||Oi&&K.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}K.length&&(N.className=K.join(" "),K.length=0),Li||ge||Di?N.textContent=W:D++,M!==this.defaultSpacing&&(N.style.letterSpacing=`${M}px`),j.push(N),te=De}return N&&D&&(N.textContent=W),j}_applyMinimumContrast(y,w,S,k,R,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const L=this._getContrastCache(k);let T;if(R||B||(T=L.getColor(w.rgba,S.rgba)),T===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);T=m.color.ensureContrastRatio(R||w,B||S,F),L.setColor((R||w).rgba,(B||S).rgba,T??null)}return!!T&&(this._addStyle(y,`color:${T.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,w){y.setAttribute("style",`${y.getAttribute("style")||""}${w};`)}_isCellInSelection(y,w){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?y>=S[0]&&w>=S[1]&&y<k[0]&&w<=k[1]:y<S[0]&&w>=S[1]&&y>=k[0]&&w<=k[1]:w>S[1]&&w<k[1]||S[1]===k[1]&&w===S[1]&&y>=S[0]&&y<k[0]||S[1]<k[1]&&w===k[1]&&y<k[0]||S[1]<k[1]&&w===S[1]&&y>=S[0])}};function E(y,w,S){for(;y.length<S;)y=w+y;return y}n.DomRendererRowFactory=_=a([g(1,c.ICharacterJoinerService),g(2,C.IOptionsService),g(3,c.ICoreBrowserService),g(4,C.ICoreService),g(5,C.IDecorationService),g(6,c.IThemeService)],_)},2550:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(o,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 g=o.createElement("span");g.classList.add("xterm-char-measure-element");const d=o.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const v=o.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const b=o.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[g,d,v,b],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(b),a.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(o,a,g,d){o===this._font&&a===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=o,this._fontSize=a,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(o,a,g){let d=0;if(!a&&!g&&o.length===1&&(d=o.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const C=this._measure(o,0);return C>0&&(this._flat[d]=C),C}let v=o;a&&(v+="B"),g&&(v+="I");let b=this._holey.get(v);if(b===void 0){let C=0;a&&(C|=1),g&&(C|=2),b=this._measure(o,C),b>0&&this._holey.set(v,b)}return b}_measure(o,a){const g=this._measureElements[a];return g.textContent=o.repeat(32),g.offsetWidth/32}}},2223:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const a=o(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(p,n)=>{function o(g){return 57508<=g&&g<=57558}function a(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=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(g){if(!g)throw new Error("value must not be falsy");return g},n.isPowerlineGlyph=o,n.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},n.isEmoji=a,n.allowRescaling=function(g,d,v,b){return d===1&&v>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!a(g)&&!o(g)&&!(function(C){return 57344<=C&&C<=63743})(g)},n.treatGlyphAsBackgroundColor=function(g){return o(g)||(function(d){return 9472<=d&&d<=9631})(g)},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(g,d,v=0){return(g-(2*Math.round(d)-v))%(2*Math.round(d))}},6052:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class o{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(g,d,v,b=!1){if(this.selectionStart=d,this.selectionEnd=v,!d||!v||d[0]===v[0]&&d[1]===v[1])return void this.clear();const C=g.buffers.active.ydisp,m=d[1]-C,c=v[1]-C,u=Math.max(m,0),l=Math.min(c,g.rows-1);u>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=c,this.viewportCappedStartRow=u,this.viewportCappedEndRow=l,this.startCol=d[0],this.endCol=v[0])}isCellSelected(g,d,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&v>=this.viewportCappedStartRow&&d<this.endCol&&v<=this.viewportCappedEndRow:d<this.startCol&&v>=this.viewportCappedStartRow&&d>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&d>=this.startCol)}}n.createSelectionRenderModel=function(){return new o}},456:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,a=this.selectionEnd;return!(!o||!a)&&(o[1]>a[1]||o[1]===a[1]&&o[0]>a[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(p,n,o){var a=this&&this.__decorate||function(l,f,_,E){var y,w=arguments.length,S=w<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,f,_,E);else for(var k=l.length-1;k>=0;k--)(y=l[k])&&(S=(w<3?y(S):w>3?y(f,_,S):y(f,_))||S);return w>3&&S&&Object.defineProperty(f,_,S),S},g=this&&this.__param||function(l,f){return function(_,E){f(_,E,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const d=o(2585),v=o(8460),b=o(844);let C=n.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,f,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new c(l,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};n.CharSizeService=C=a([g(2,d.IOptionsService)],C);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,_){f!==void 0&&f>0&&_!==void 0&&_>0&&(this._result.width=f,this._result.height=_)}}class c extends m{constructor(f,_,E){super(),this._document=f,this._parentElement=_,this._optionsService=E,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 u extends m{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(p,n,o){var a=this&&this.__decorate||function(u,l,f,_){var E,y=arguments.length,w=y<3?l:_===null?_=Object.getOwnPropertyDescriptor(l,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,l,f,_);else for(var S=u.length-1;S>=0;S--)(E=u[S])&&(w=(y<3?E(w):y>3?E(l,f,w):E(l,f))||w);return y>3&&w&&Object.defineProperty(l,f,w),w},g=this&&this.__param||function(u,l){return function(f,_){l(f,_,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const d=o(3734),v=o(643),b=o(511),C=o(2585);class m extends d.AttributeData{constructor(l,f,_){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=f,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=m;let c=n.CharacterJoinerService=class Wa{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const f={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(f),f.id}deregister(l){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===l)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(l);if(!f||f.length===0)return[];const _=[],E=f.translateToString(!0);let y=0,w=0,S=0,k=f.getFg(0),R=f.getBg(0);for(let B=0;B<f.getTrimmedLength();B++)if(f.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==R){if(B-y>1){const L=this._getJoinedRanges(E,S,w,f,y);for(let T=0;T<L.length;T++)_.push(L[T])}y=B,S=w,k=this._workCell.fg,R=this._workCell.bg}w+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const B=this._getJoinedRanges(E,S,w,f,y);for(let L=0;L<B.length;L++)_.push(B[L])}return _}_getJoinedRanges(l,f,_,E,y){const w=l.substring(f,_);let S=[];try{S=this._characterJoiners[0].handler(w)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const R=this._characterJoiners[k].handler(w);for(let B=0;B<R.length;B++)Wa._mergeRanges(S,R[B])}catch(R){console.error(R)}return this._stringRangesToCellRanges(S,E,y),S}_stringRangesToCellRanges(l,f,_){let E=0,y=!1,w=0,S=l[E];if(S){for(let k=_;k<this._bufferService.cols;k++){const R=f.getWidth(k),B=f.getString(k).length||v.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!y&&S[0]<=w&&(S[0]=k,y=!0),S[1]<=w){if(S[1]=k,S=l[++E],!S)break;S[0]<=w?(S[0]=k,y=!0):y=!1}w+=B}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(l,f){let _=!1;for(let E=0;E<l.length;E++){const y=l[E];if(_){if(f[1]<=y[0])return l[E-1][1]=f[1],l;if(f[1]<=y[1])return l[E-1][1]=Math.max(f[1],y[1]),l.splice(E,1),l;l.splice(E,1),E--}else{if(f[1]<=y[0])return l.splice(E,0,f),l;if(f[1]<=y[1])return y[0]=Math.min(f[0],y[0]),l;f[0]<y[1]&&(y[0]=Math.min(f[0],y[0]),_=!0)}}return _?l[l.length-1][1]=f[1]:l.push(f),l}};n.CharacterJoinerService=c=a([g(0,C.IBufferService)],c)},5114:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const a=o(844),g=o(8460),d=o(3656);class v extends a.Disposable{constructor(m,c,u){super(),this._textarea=m,this._window=c,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,g.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=v;class b extends a.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.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:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const a=o(844);class g extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const b=this.linkProviders.indexOf(v);b!==-1&&this.linkProviders.splice(b,1)}}}}n.LinkProviderService=g},8934:function(p,n,o){var a=this&&this.__decorate||function(C,m,c,u){var l,f=arguments.length,_=f<3?m:u===null?u=Object.getOwnPropertyDescriptor(m,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(C,m,c,u);else for(var E=C.length-1;E>=0;E--)(l=C[E])&&(_=(f<3?l(_):f>3?l(m,c,_):l(m,c))||_);return f>3&&_&&Object.defineProperty(m,c,_),_},g=this&&this.__param||function(C,m){return function(c,u){m(c,u,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const d=o(4725),v=o(9806);let b=n.MouseService=class{constructor(C,m){this._renderService=C,this._charSizeService=m}getCoords(C,m,c,u,l){return(0,v.getCoords)(window,C,m,c,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(C,m){const c=(0,v.getCoordsRelativeToElement)(window,C,m);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};n.MouseService=b=a([g(0,d.IRenderService),g(1,d.ICharSizeService)],b)},3230:function(p,n,o){var a=this&&this.__decorate||function(l,f,_,E){var y,w=arguments.length,S=w<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,f,_,E);else for(var k=l.length-1;k>=0;k--)(y=l[k])&&(S=(w<3?y(S):w>3?y(f,_,S):y(f,_))||S);return w>3&&S&&Object.defineProperty(f,_,S),S},g=this&&this.__param||function(l,f){return function(_,E){f(_,E,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const d=o(6193),v=o(4725),b=o(8460),C=o(844),m=o(7226),c=o(2585);let u=n.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,f,_,E,y,w,S,k){super(),this._rowCount=l,this._charSizeService=E,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((R,B)=>this._renderRows(R,B)),S),this.register(this._renderDebouncer),this.register(S.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(S.window,f),this.register(S.onWindowChange((R=>this._registerIntersectionObserver(R,f))))}_registerIntersectionObserver(l,f){if("IntersectionObserver"in l){const _=new l.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});_.observe(f),this._observerDisposable.value=(0,C.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,f,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,f,this._rowCount))}_renderRows(l,f){this._renderer.value&&(l=Math.min(l,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(l,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:f}),this._onRender.fire({start:l,end:f}),this._isNextRenderRedrawOnly=!0)}resize(l,f){this._rowCount=f,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((f=>this.refreshRows(f.start,f.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,f;this._renderer.value&&((f=(l=this._renderer.value).clearTextureAtlas)==null||f.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(l,f)})):this._renderer.value.handleResize(l,f),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,f,_){var E;this._selectionState.start=l,this._selectionState.end=f,this._selectionState.columnSelectMode=_,(E=this._renderer.value)==null||E.handleSelectionChanged(l,f,_)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};n.RenderService=u=a([g(2,c.IOptionsService),g(3,v.ICharSizeService),g(4,c.IDecorationService),g(5,c.IBufferService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],u)},9312:function(p,n,o){var a=this&&this.__decorate||function(S,k,R,B){var L,T=arguments.length,F=T<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,R):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(S,k,R,B);else for(var U=S.length-1;U>=0;U--)(L=S[U])&&(F=(T<3?L(F):T>3?L(k,R,F):L(k,R))||F);return T>3&&F&&Object.defineProperty(k,R,F),F},g=this&&this.__param||function(S,k){return function(R,B){k(R,B,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const d=o(9806),v=o(9504),b=o(456),C=o(4725),m=o(8460),c=o(844),u=o(6114),l=o(4841),f=o(511),_=o(2585),E=" ",y=new RegExp(E,"g");let w=n.SelectionService=class extends c.Disposable{constructor(S,k,R,B,L,T,F,U,$){super(),this._element=S,this._screenElement=k,this._linkifier=R,this._bufferService=B,this._coreService=L,this._mouseService=T,this._optionsService=F,this._renderService=U,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.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=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((j=>this._handleTrim(j))),this.register(this._bufferService.buffers.onBufferActivate((j=>this._handleBufferActivate(j)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.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 S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const R=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const L=S[0]<k[0]?S[0]:k[0],T=S[0]<k[0]?k[0]:S[0];for(let F=S[1];F<=k[1];F++){const U=R.translateBufferLineToString(F,!0,L,T);B.push(U)}}else{const L=S[1]===k[1]?k[0]:void 0;B.push(R.translateBufferLineToString(S[1],!0,S[0],L));for(let T=S[1]+1;T<=k[1]-1;T++){const F=R.lines.get(T),U=R.translateBufferLineToString(T,!0);F!=null&&F.isWrapped?B[B.length-1]+=U:B.push(U)}if(S[1]!==k[1]){const T=R.lines.get(k[1]),F=R.translateBufferLineToString(k[1],!0,0,k[0]);T&&T.isWrapped?B[B.length-1]+=F:B.push(F)}}return B.map((L=>L.replace(y," "))).join(u.isWindows?`\r
162
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([g(0,m.IBufferService),g(1,m.IOptionsService),g(2,m.IOscLinkService)],_)},6193:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,c,g){this._rowCount=g,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=o(3614),g=o(3656),f=o(3551),m=o(9042),_=o(3730),w=o(1680),v=o(3107),l=o(5744),h=o(2950),u=o(1296),p=o(428),b=o(4269),E=o(5114),y=o(8934),C=o(3230),S=o(9312),k=o(4725),T=o(6731),R=o(8055),L=o(8969),N=o(8460),U=o(844),P=o(6114),H=o(8437),J=o(2584),G=o(7399),I=o(5941),B=o(9074),x=o(2585),D=o(5435),W=o(4567),K=o(779);class z extends L.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(O={}){super(O),this.browser=P,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(x.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((A,$)=>this.refresh(A,$)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((A=>this._reportWindowsOptions(A)))),this.register(this._inputHandler.onColor((A=>this._handleColorEvent(A)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((A=>this._afterResize(A.cols,A.rows)))),this.register((0,U.toDisposable)((()=>{var A,$;this._customKeyEventHandler=void 0,($=(A=this.element)==null?void 0:A.parentNode)==null||$.removeChild(this.element)})))}_handleColorEvent(O){if(this._themeService)for(const A of O){let $,M="";switch(A.index){case 256:$="foreground",M="10";break;case 257:$="background",M="11";break;case 258:$="cursor",M="12";break;default:$="ansi",M="4;"+A.index}switch(A.type){case 0:const X=R.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${M};${(0,I.toRgbString)(X)}${J.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors((Y=>Y.ansi[A.index]=R.channels.toColor(...A.color)));else{const Y=$;this._themeService.modifyColors((te=>te[Y]=R.channels.toColor(...A.color)))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(O){O?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var O;return(O=this.textarea)==null?void 0:O.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const O=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(O);if(!A)return;const $=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,X=A.getWidth($),Y=this._renderService.dimensions.css.cell.width*X,te=this.buffer.y*this._renderService.dimensions.css.cell.height,me=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=me+"px",this.textarea.style.top=te+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(A=>{this.hasSelection()&&(0,c.copyHandler)(A,this._selectionService)})));const O=A=>(0,c.handlePasteEvent)(A,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,g.addDisposableDomListener)(this.element,"paste",O)),P.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(A=>{A.button===2&&(0,c.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(A=>{(0,c.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),P.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(A=>{A.button===1&&(0,c.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(O=>this._keyUp(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(O=>this._keyDown(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(O=>this._keyPress(O)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(O=>this._compositionHelper.compositionupdate(O)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(O=>this._inputEvent(O)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(O){var A;if(!O)throw new Error("Terminal requires a parent element.");if(O.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((A=this.element)==null?void 0:A.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=O.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"),O.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),P.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(E.CoreBrowserService,this.textarea,O.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const O=this,A=this.element;function $(Y){const te=O._mouseService.getMouseReportCoords(Y,O.screenElement);if(!te)return!1;let me,ve;switch(Y.overrideType||Y.type){case"mousemove":ve=32,Y.buttons===void 0?(me=3,Y.button!==void 0&&(me=Y.button<3?Y.button:3)):me=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":ve=0,me=Y.button<3?Y.button:3;break;case"mousedown":ve=1,me=Y.button<3?Y.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(Y)===!1||O.viewport.getLinesScrolled(Y)===0)return!1;ve=Y.deltaY<0?0:1,me=4;break;default:return!1}return!(ve===void 0||me===void 0||me>4)&&O.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:me,action:ve,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:Y=>($(Y),Y.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(Y)),wheel:Y=>($(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&$(Y)},mousemove:Y=>{Y.buttons||$(Y)}};this.register(this.coreMouseService.onProtocolChange((Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),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&Y?M.mousemove||(A.addEventListener("mousemove",X.mousemove),M.mousemove=X.mousemove):(A.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&Y?M.wheel||(A.addEventListener("wheel",X.wheel,{passive:!1}),M.wheel=X.wheel):(A.removeEventListener("wheel",M.wheel),M.wheel=null),2&Y?M.mouseup||(M.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&Y?M.mousedrag||(M.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(A,"mousedown",(Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return $(Y),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(Y)}))),this.register((0,g.addDisposableDomListener)(A,"wheel",(Y=>{if(!M.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Y)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(Y);if(te===0)return;const me=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let ve="";for(let Ue=0;Ue<Math.abs(te);Ue++)ve+=me;return this.coreService.triggerDataEvent(ve,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(A,"touchstart",(Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(A,"touchmove",(Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)}),{passive:!1}))}refresh(O,A){var $;($=this._renderService)==null||$.refreshRows(O,A)}updateCursorStyle(O){var A;(A=this._selectionService)!=null&&A.shouldColumnSelect(O)?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(O,A,$=0){var M;$===1?(super.scrollLines(O,A,$),this.refresh(0,this.rows-1)):(M=this.viewport)==null||M.scrollLines(O)}paste(O){(0,c.paste)(O,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(O){this._customKeyEventHandler=O}attachCustomWheelEventHandler(O){this._customWheelEventHandler=O}registerLinkProvider(O){return this._linkProviderService.registerLinkProvider(O)}registerCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(O);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(O)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(O){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)}registerDecoration(O){return this._decorationService.registerDecoration(O)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(O,A,$){this._selectionService.setSelection(O,A,$)}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 O;(O=this._selectionService)==null||O.clearSelection()}selectAll(){var O;(O=this._selectionService)==null||O.selectAll()}selectLines(O,A){var $;($=this._selectionService)==null||$.selectLines(O,A)}_keyDown(O){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&O.altKey;if(!A&&!this._compositionHelper.keydown(O))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;A||O.key!=="Dead"&&O.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,G.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),$.type===3||$.type===2){const M=this.rows-1;return this.scrollLines($.type===2?-M:M),this.cancel(O,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||($.cancel&&this.cancel(O,!0),!$.key||!!(O.key&&!O.ctrlKey&&!O.altKey&&!O.metaKey&&O.key.length===1&&O.key.charCodeAt(0)>=65&&O.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==J.C0.ETX&&$.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,A){const $=O.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||O.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||O.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?$:$&&(!A.keyCode||A.keyCode>47)}_keyUp(O){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||((function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18})(O)||this.focus(),this.updateCursorStyle(O),this._keyPressHandled=!1)}_keyPress(O){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)A=O.charCode;else if(O.which===null||O.which===void 0)A=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;A=O.which}return!(!A||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(O){if(O.data&&O.inputType==="insertText"&&(!O.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=O.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(O),!0}return!1}resize(O,A){O!==this.cols||A!==this.rows?super.resize(O,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(O,A){var $,M;($=this._charSizeService)==null||$.measure(),(M=this.viewport)==null||M.syncScrollArea(!0)}clear(){var O;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 A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(O=this.viewport)==null||O.reset(),this.refresh(0,this.rows-1)}}reset(){var O,A;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(O=this._selectionService)==null||O.reset(),this._decorationService.reset(),(A=this.viewport)==null||A.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var O;(O=this._renderService)==null||O.clearTextureAtlas()}_reportFocus(){var O;(O=this.element)!=null&&O.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${$};${A}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${X};${M}t`)}}cancel(O,A){if(this.options.cancelEvents||A)return O.preventDefault(),O.stopPropagation(),!1}}s.Terminal=z},9924:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,g){this._rowCount=g,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=f-this._lastRefreshMs,_=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(d,s,o){var c=this&&this.__decorate||function(h,u,p,b){var E,y=arguments.length,C=y<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,u,p,b);else for(var S=h.length-1;S>=0;S--)(E=h[S])&&(C=(y<3?E(C):y>3?E(u,p,C):E(u,p))||C);return y>3&&C&&Object.defineProperty(u,p,C),C},g=this&&this.__param||function(h,u){return function(p,b){u(p,b,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const f=o(3656),m=o(4725),_=o(8460),w=o(844),v=o(2585);let l=s.Viewport=class extends w.Disposable{constructor(h,u,p,b,E,y,C,S){super(),this._viewportElement=h,this._scrollArea=u,this._bufferService=p,this._optionsService=b,this._charSizeService=E,this._renderService=y,this._coreBrowserService=C,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.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(S.colors),this.register(S.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 u=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==u&&(this._lastRecordedBufferHeight=u,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 u=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,u){const p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(u<0&&this._viewportElement.scrollTop!==0||u>0&&p<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const u=this._getPixelsScrolled(h);return u!==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+u:this._smoothScrollState.target+=u,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=u,this._bubbleScroll(h,u))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const u=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+u,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let u=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?u*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._currentRowHeight*this._bufferService.rows),u}getBufferElements(h,u){var p;let b,E="";const y=[],C=u??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let k=h;k<C;k++){const T=S.get(k);if(!T)continue;const R=(p=S.get(k+1))==null?void 0:p.isWrapped;if(E+=T.translateToString(!R),!R||k===S.length-1){const L=document.createElement("div");L.textContent=E,y.push(L),E.length>0&&(b=L),E=""}}return{bufferElements:y,cursorElement:b}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let u=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(u/=this._currentRowHeight+0,this._wheelPartialScroll+=u,u=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._bufferService.rows),u}_applyScrollModifier(h,u){const p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&u.altKey||p==="ctrl"&&u.ctrlKey||p==="shift"&&u.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const u=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(h,u))}};s.Viewport=l=c([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,m.ICharSizeService),g(5,m.IRenderService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],l)},3107:function(d,s,o){var c=this&&this.__decorate||function(v,l,h,u){var p,b=arguments.length,E=b<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,l,h,u);else for(var y=v.length-1;y>=0;y--)(p=v[y])&&(E=(b<3?p(E):b>3?p(l,h,E):p(l,h))||E);return b>3&&E&&Object.defineProperty(l,h,E),E},g=this&&this.__param||function(v,l){return function(h,u){l(h,u,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const f=o(4725),m=o(844),_=o(2585);let w=s.BufferDecorationRenderer=class extends m.Disposable{constructor(v,l,h,u,p){super(),this._screenElement=v,this._bufferService=l,this._coreBrowserService=h,this._decorationService=u,this._renderService=p,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((b=>this._removeDecoration(b)))),this.register((0,m.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var l;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((l=v==null?void 0:v.options)==null?void 0:l.layer)==="top"),h.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=v.options.x??0;return u&&u>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(v,h),h}_refreshStyle(v){const l=v.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let h=this._decorationElements.get(v);h||(h=this._createElement(v),v.element=h,this._decorationElements.set(v,h),this._container.appendChild(h),v.onDispose((()=>{this._decorationElements.delete(v),h.remove()}))),h.style.top=l*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(h)}}_refreshXPosition(v,l=v.element){if(!l)return;const h=v.options.x??0;(v.options.anchor||"left")==="right"?l.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":l.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var l;(l=this._decorationElements.get(v))==null||l.remove(),this._decorationElements.delete(v),v.dispose()}};s.BufferDecorationRenderer=w=c([g(1,_.IBufferService),g(2,f.ICoreBrowserService),g(3,_.IDecorationService),g(4,f.IRenderService)],w)},5871:(d,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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,g){return c>=o.startBufferLine-this._linePadding[g||"full"]&&c<=o.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(d,s,o){var c=this&&this.__decorate||function(p,b,E,y){var C,S=arguments.length,k=S<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,b,E,y);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(S<3?C(k):S>3?C(b,E,k):C(b,E))||k);return S>3&&k&&Object.defineProperty(b,E,k),k},g=this&&this.__param||function(p,b){return function(E,y){b(E,y,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const f=o(5871),m=o(4725),_=o(844),w=o(2585),v={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let u=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,b,E,y,C,S,k){var T;super(),this._viewportElement=p,this._screenElement=b,this._bufferService=E,this._decorationService=y,this._renderService=C,this._optionsService=S,this._coreBrowserService=k,this._colorZoneStore=new f.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(),(T=this._viewportElement.parentElement)==null||T.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var L;(L=this._canvas)==null||L.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 p=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=p,l.center=b,l.right=p,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=l.left,h.right=l.left+l.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);v.left=b,v.center=b,v.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const b of p)b.position!=="full"&&this._renderColorZone(b);for(const b of p)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(h[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-v[p.position||"full"]/2),l[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[p.position||"full"]))}_queueRefresh(p,b){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=u=c([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,m.IRenderService),g(5,w.IOptionsService),g(6,m.ICoreBrowserService)],u)},2950:function(d,s,o){var c=this&&this.__decorate||function(v,l,h,u){var p,b=arguments.length,E=b<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,h):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,l,h,u);else for(var y=v.length-1;y>=0;y--)(p=v[y])&&(E=(b<3?p(E):b>3?p(l,h,E):p(l,h))||E);return b>3&&E&&Object.defineProperty(l,h,E),E},g=this&&this.__param||function(v,l){return function(h,u){l(h,u,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const f=o(4725),m=o(2585),_=o(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,l,h,u,p,b){this._textarea=v,this._compositionView=l,this._bufferService=h,this._optionsService=u,this._coreService=p,this._renderService=b,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const l=this._textarea.value,h=l.replace(v,"");this._dataAlreadySent=h,l.length>v.length?this._coreService.triggerDataEvent(h,!0):l.length<v.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):l.length===v.length&&l!==v&&this._coreService.triggerDataEvent(l,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,u=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=l*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=u+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"px",this._textarea.style.top=u+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=c([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,m.ICoreService),g(5,f.IRenderService)],w)},9806:(d,s)=>{function o(c,g,f){const m=f.getBoundingClientRect(),_=c.getComputedStyle(f),w=parseInt(_.getPropertyValue("padding-left")),v=parseInt(_.getPropertyValue("padding-top"));return[g.clientX-m.left-w,g.clientY-m.top-v]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(c,g,f,m,_,w,v,l,h){if(!w)return;const u=o(c,g,f);return u?(u[0]=Math.ceil((u[0]+(h?v/2:0))/v),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),m+(h?1:0)),u[1]=Math.min(Math.max(u[1],1),_),u):void 0}},9504:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=o(2584);function g(l,h,u,p){const b=l-f(l,u),E=h-f(h,u),y=Math.abs(b-E)-(function(C,S,k){let T=0;const R=C-f(C,k),L=S-f(S,k);for(let N=0;N<Math.abs(R-L);N++){const U=m(C,S)==="A"?-1:1,P=k.buffer.lines.get(R+U*N);P!=null&&P.isWrapped&&T++}return T})(l,h,u);return v(y,w(m(l,h),p))}function f(l,h){let u=0,p=h.buffer.lines.get(l),b=p==null?void 0:p.isWrapped;for(;b&&l>=0&&l<h.rows;)u++,p=h.buffer.lines.get(--l),b=p==null?void 0:p.isWrapped;return u}function m(l,h){return l>h?"A":"B"}function _(l,h,u,p,b,E){let y=l,C=h,S="";for(;y!==u||C!==p;)y+=b?1:-1,b&&y>E.cols-1?(S+=E.buffer.translateBufferLineToString(C,!1,l,y),y=0,l=0,C++):!b&&y<0&&(S+=E.buffer.translateBufferLineToString(C,!1,0,l+1),y=E.cols-1,l=y,C--);return S+E.buffer.translateBufferLineToString(C,!1,l,y)}function w(l,h){const u=h?"O":"[";return c.C0.ESC+u+l}function v(l,h){l=Math.floor(l);let u="";for(let p=0;p<l;p++)u+=h;return u}s.moveToCellSequence=function(l,h,u,p){const b=u.buffer.x,E=u.buffer.y;if(!u.buffer.hasScrollback)return(function(S,k,T,R,L,N){return g(k,R,L,N).length===0?"":v(_(S,k,S,k-f(k,L),!1,L).length,w("D",N))})(b,E,0,h,u,p)+g(E,h,u,p)+(function(S,k,T,R,L,N){let U;U=g(k,R,L,N).length>0?R-f(R,L):k;const P=R,H=(function(J,G,I,B,x,D){let W;return W=g(I,B,x,D).length>0?B-f(B,x):G,J<I&&W<=B||J>=I&&W<B?"C":"D"})(S,k,T,R,L,N);return v(_(S,U,T,P,H==="C",L).length,w(H,N))})(b,E,l,h,u,p);let y;if(E===h)return y=b>l?"D":"C",v(Math.abs(b-l),w(y,p));y=E>h?"D":"C";const C=Math.abs(E-h);return v((function(S,k){return k.cols-S})(E>h?l:b,u)+(C-1)*u.cols+1+((E>h?b:l)-1),w(y,p))}},1296:function(d,s,o){var c=this&&this.__decorate||function(N,U,P,H){var J,G=arguments.length,I=G<3?U:H===null?H=Object.getOwnPropertyDescriptor(U,P):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(N,U,P,H);else for(var B=N.length-1;B>=0;B--)(J=N[B])&&(I=(G<3?J(I):G>3?J(U,P,I):J(U,P))||I);return G>3&&I&&Object.defineProperty(U,P,I),I},g=this&&this.__param||function(N,U){return function(P,H){U(P,H,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const f=o(3787),m=o(2550),_=o(2223),w=o(6171),v=o(6052),l=o(4725),h=o(8055),u=o(8460),p=o(844),b=o(2585),E="xterm-dom-renderer-owner-",y="xterm-rows",C="xterm-fg-",S="xterm-bg-",k="xterm-focus",T="xterm-selection";let R=1,L=s.DomRenderer=class extends p.Disposable{constructor(N,U,P,H,J,G,I,B,x,D,W,K,z){super(),this._terminal=N,this._document=U,this._element=P,this._screenElement=H,this._viewportElement=J,this._helperContainer=G,this._linkifier2=I,this._charSizeService=x,this._optionsService=D,this._bufferService=W,this._coreBrowserService=K,this._themeService=z,this._terminalClass=R++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new u.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Q=>this._injectCss(Q)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Q=>this._handleLinkHover(Q)))),this.register(this._linkifier2.onHideLinkUnderline((Q=>this._handleLinkLeave(Q)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.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 N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),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 P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,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(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${y} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${y} .xterm-dim { color: ${h.color.multiplyOpacity(N.foreground,.5).css};}`,U+=`${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 P=`blink_underline_${this._terminalClass}`,H=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;U+=`@keyframes ${P} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${H} { 50% { box-shadow: none; }}`,U+=`@keyframes ${J} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,U+=`${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${y}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[G,I]of N.ansi.entries())U+=`${this._terminalSelector} .${C}${G} { color: ${I.css}; }${this._terminalSelector} .${C}${G}.xterm-dim { color: ${h.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${S}${G} { background-color: ${I.css}; }`;U+=`${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(N.background).css}; }${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${S}${_.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,U){for(let P=this._rowElements.length;P<=U;P++){const H=this._document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,U){this._refreshRowElements(N,U),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(N,U,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,U,P),this.renderRows(0,this._bufferService.rows-1),!N||!U)return;this._selectionRenderModel.update(this._terminal,N,U,P);const H=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||I<0)return;const B=this._document.createDocumentFragment();if(P){const x=N[0]>U[0];B.appendChild(this._createSelectionElement(G,x?U[0]:N[0],x?N[0]:U[0],I-G+1))}else{const x=H===G?N[0]:0,D=G===J?U[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(G,x,D));const W=I-G-1;if(B.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,W)),G!==I){const K=J===I?U[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(I,0,K))}}this._selectionContainer.appendChild(B)}_createSelectionElement(N,U,P,H=1){const J=this._document.createElement("div"),G=U*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(P-U);return G+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-G),J.style.height=H*this.dimensions.css.cell.height+"px",J.style.top=N*this.dimensions.css.cell.height+"px",J.style.left=`${G}px`,J.style.width=`${I}px`,J}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,U){const P=this._bufferService.buffer,H=P.ybase+P.y,J=Math.min(P.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=N;x<=U;x++){const D=x+P.ydisp,W=this._rowElements[x],K=P.lines.get(D);if(!W||!K)break;W.replaceChildren(...this._rowFactory.createRow(K,D,D===H,I,B,J,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,U,P,H,J,G){P<0&&(N=0),H<0&&(U=0);const I=this._bufferService.rows-1;P=Math.max(Math.min(P,I),0),H=Math.max(Math.min(H,I),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,x=B.ybase+B.y,D=Math.min(B.x,J-1),W=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=P;Q<=H;++Q){const O=Q+B.ydisp,A=this._rowElements[Q],$=B.lines.get(O);if(!A||!$)break;A.replaceChildren(...this._rowFactory.createRow($,O,O===x,K,z,D,W,this.dimensions.css.cell.width,this._widthCache,G?Q===P?N:0:-1,G?(Q===H?U:J)-1:-1))}}};s.DomRenderer=L=c([g(7,b.IInstantiationService),g(8,l.ICharSizeService),g(9,b.IOptionsService),g(10,b.IBufferService),g(11,l.ICoreBrowserService),g(12,l.IThemeService)],L)},3787:function(d,s,o){var c=this&&this.__decorate||function(y,C,S,k){var T,R=arguments.length,L=R<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(y,C,S,k);else for(var N=y.length-1;N>=0;N--)(T=y[N])&&(L=(R<3?T(L):R>3?T(C,S,L):T(C,S))||L);return R>3&&L&&Object.defineProperty(C,S,L),L},g=this&&this.__param||function(y,C){return function(S,k){C(S,k,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const f=o(2223),m=o(643),_=o(511),w=o(2585),v=o(8055),l=o(4725),h=o(4269),u=o(6171),p=o(3734);let b=s.DomRendererRowFactory=class{constructor(y,C,S,k,T,R,L){this._document=y,this._characterJoinerService=C,this._optionsService=S,this._coreBrowserService=k,this._coreService=T,this._decorationService=R,this._themeService=L,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,C,S){this._selectionStart=y,this._selectionEnd=C,this._columnSelectMode=S}createRow(y,C,S,k,T,R,L,N,U,P,H){const J=[],G=this._characterJoinerService.getJoinedCharacters(C),I=this._themeService.colors;let B,x=y.getNoBgTrimmedLength();S&&x<R+1&&(x=R+1);let D=0,W="",K=0,z=0,Q=0,O=!1,A=0,$=!1,M=0;const X=[],Y=P!==-1&&H!==-1;for(let te=0;te<x;te++){y.loadCell(te,this._workCell);let me=this._workCell.getWidth();if(me===0)continue;let ve=!1,Ue=te,q=this._workCell;if(G.length>0&&te===G[0][0]){ve=!0;const fe=G.shift();q=new h.JoinedCellData(this._workCell,y.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),Ue=fe[1]-1,me=q.getWidth()}const hr=this._isCellInSelection(te,C),sn=S&&te===R,on=Y&&te>=P&&te<=H;let an=!1;this._decorationService.forEachDecorationAtCell(te,C,void 0,(fe=>{an=!0}));let ri=q.getChars()||m.WHITESPACE_CELL_CHAR;if(ri===" "&&(q.isUnderline()||q.isOverline())&&(ri=" "),M=me*N-U.get(ri,q.isBold(),q.isItalic()),B){if(D&&(hr&&$||!hr&&!$&&q.bg===K)&&(hr&&$&&I.selectionForeground||q.fg===z)&&q.extended.ext===Q&&on===O&&M===A&&!sn&&!ve&&!an){q.isInvisible()?W+=m.WHITESPACE_CELL_CHAR:W+=ri,D++;continue}D&&(B.textContent=W),B=this._document.createElement("span"),D=0,W=""}else B=this._document.createElement("span");if(K=q.bg,z=q.fg,Q=q.extended.ext,O=on,A=M,$=hr,ve&&R>=te&&R<=Ue&&(R=te),!this._coreService.isCursorHidden&&sn&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&X.push("xterm-cursor-blink"),X.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(q.isBold()&&X.push("xterm-bold"),q.isItalic()&&X.push("xterm-italic"),q.isDim()&&X.push("xterm-dim"),W=q.isInvisible()?m.WHITESPACE_CELL_CHAR:q.getChars()||m.WHITESPACE_CELL_CHAR,q.isUnderline()&&(X.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let fe=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&fe<8&&(fe+=8),B.style.textDecorationColor=I.ansi[fe].css}q.isOverline()&&(X.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&X.push("xterm-strikethrough"),on&&(B.style.textDecoration="underline");let Ze=q.getFgColor(),fr=q.getFgColorMode(),tt=q.getBgColor(),pr=q.getBgColorMode();const cn=!!q.isInverse();if(cn){const fe=Ze;Ze=tt,tt=fe;const lh=fr;fr=pr,pr=lh}let ft,ii,pt,gr=!1;switch(this._decorationService.forEachDecorationAtCell(te,C,void 0,(fe=>{fe.options.layer!=="top"&&gr||(fe.backgroundColorRGB&&(pr=50331648,tt=fe.backgroundColorRGB.rgba>>8&16777215,ft=fe.backgroundColorRGB),fe.foregroundColorRGB&&(fr=50331648,Ze=fe.foregroundColorRGB.rgba>>8&16777215,ii=fe.foregroundColorRGB),gr=fe.options.layer==="top")})),!gr&&hr&&(ft=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,tt=ft.rgba>>8&16777215,pr=50331648,gr=!0,I.selectionForeground&&(fr=50331648,Ze=I.selectionForeground.rgba>>8&16777215,ii=I.selectionForeground)),gr&&X.push("xterm-decoration-top"),pr){case 16777216:case 33554432:pt=I.ansi[tt],X.push(`xterm-bg-${tt}`);break;case 50331648:pt=v.channels.toColor(tt>>16,tt>>8&255,255&tt),this._addStyle(B,`background-color:#${E((tt>>>0).toString(16),"0",6)}`);break;default:cn?(pt=I.foreground,X.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):pt=I.background}switch(ft||q.isDim()&&(ft=v.color.multiplyOpacity(pt,.5)),fr){case 16777216:case 33554432:q.isBold()&&Ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ze+=8),this._applyMinimumContrast(B,pt,I.ansi[Ze],q,ft,void 0)||X.push(`xterm-fg-${Ze}`);break;case 50331648:const fe=v.channels.toColor(Ze>>16&255,Ze>>8&255,255&Ze);this._applyMinimumContrast(B,pt,fe,q,ft,ii)||this._addStyle(B,`color:#${E(Ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,pt,I.foreground,q,ft,ii)||cn&&X.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}X.length&&(B.className=X.join(" "),X.length=0),sn||ve||an?B.textContent=W:D++,M!==this.defaultSpacing&&(B.style.letterSpacing=`${M}px`),J.push(B),te=Ue}return B&&D&&(B.textContent=W),J}_applyMinimumContrast(y,C,S,k,T,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,u.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const L=this._getContrastCache(k);let N;if(T||R||(N=L.getColor(C.rgba,S.rgba)),N===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);N=v.color.ensureContrastRatio(T||C,R||S,U),L.setColor((T||C).rgba,(R||S).rgba,N??null)}return!!N&&(this._addStyle(y,`color:${N.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,C){y.setAttribute("style",`${y.getAttribute("style")||""}${C};`)}_isCellInSelection(y,C){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?y>=S[0]&&C>=S[1]&&y<k[0]&&C<=k[1]:y<S[0]&&C>=S[1]&&y>=k[0]&&C<=k[1]:C>S[1]&&C<k[1]||S[1]===k[1]&&C===S[1]&&y>=S[0]&&y<k[0]||S[1]<k[1]&&C===k[1]&&y<k[0]||S[1]<k[1]&&C===S[1]&&y>=S[0])}};function E(y,C,S){for(;y.length<S;)y=C+y;return y}s.DomRendererRowFactory=b=c([g(1,l.ICharacterJoinerService),g(2,w.IOptionsService),g(3,l.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,l.IThemeService)],b)},2550:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 g=o.createElement("span");g.classList.add("xterm-char-measure-element");const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const m=o.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const _=o.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[g,f,m,_],this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(m),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,g,f){o===this._font&&c===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=o,this._fontSize=c,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(o,c,g){let f=0;if(!c&&!g&&o.length===1&&(f=o.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const w=this._measure(o,0);return w>0&&(this._flat[f]=w),w}let m=o;c&&(m+="B"),g&&(m+="I");let _=this._holey.get(m);if(_===void 0){let w=0;c&&(w|=1),g&&(w|=2),_=this._measure(o,w),_>0&&this._holey.set(m,_)}return _}_measure(o,c){const g=this._measureElements[c];return g.textContent=o.repeat(32),g.offsetWidth/32}}},2223:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,s)=>{function o(g){return 57508<=g&&g<=57558}function c(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=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(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=c,s.allowRescaling=function(g,f,m,_){return f===1&&m>Math.ceil(1.5*_)&&g!==void 0&&g>255&&!c(g)&&!o(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return o(g)||(function(f){return 9472<=f&&f<=9631})(g)},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(g,f,m=0){return(g-(2*Math.round(f)-m))%(2*Math.round(f))}},6052:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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(g,f,m,_=!1){if(this.selectionStart=f,this.selectionEnd=m,!f||!m||f[0]===m[0]&&f[1]===m[1])return void this.clear();const w=g.buffers.active.ydisp,v=f[1]-w,l=m[1]-w,h=Math.max(v,0),u=Math.min(l,g.rows-1);h>=g.rows||u<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=l,this.viewportCappedStartRow=h,this.viewportCappedEndRow=u,this.startCol=f[0],this.endCol=m[0])}isCellSelected(g,f,m){return!!this.hasSelection&&(m-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&m>=this.viewportCappedStartRow&&f<this.endCol&&m<=this.viewportCappedEndRow:f<this.startCol&&m>=this.viewportCappedStartRow&&f>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,s,o){var c=this&&this.__decorate||function(u,p,b,E){var y,C=arguments.length,S=C<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,p,b,E);else for(var k=u.length-1;k>=0;k--)(y=u[k])&&(S=(C<3?y(S):C>3?y(p,b,S):y(p,b))||S);return C>3&&S&&Object.defineProperty(p,b,S),S},g=this&&this.__param||function(u,p){return function(b,E){p(b,E,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const f=o(2585),m=o(8460),_=o(844);let w=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,p,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new l(u,p,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const u=this._measureStrategy.measure();u.width===this.width&&u.height===this.height||(this.width=u.width,this.height=u.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=c([g(2,f.IOptionsService)],w);class v extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,b){p!==void 0&&p>0&&b!==void 0&&b>0&&(this._result.width=p,this._result.height=b)}}class l extends v{constructor(p,b,E){super(),this._document=p,this._parentElement=b,this._optionsService=E,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 h extends v{constructor(p){super(),this._optionsService=p,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(d,s,o){var c=this&&this.__decorate||function(h,u,p,b){var E,y=arguments.length,C=y<3?u:b===null?b=Object.getOwnPropertyDescriptor(u,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,u,p,b);else for(var S=h.length-1;S>=0;S--)(E=h[S])&&(C=(y<3?E(C):y>3?E(u,p,C):E(u,p))||C);return y>3&&C&&Object.defineProperty(u,p,C),C},g=this&&this.__param||function(h,u){return function(p,b){u(p,b,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const f=o(3734),m=o(643),_=o(511),w=o(2585);class v extends f.AttributeData{constructor(u,p,b){super(),this.content=0,this.combinedData="",this.fg=u.fg,this.bg=u.bg,this.combinedData=p,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(u){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=v;let l=s.CharacterJoinerService=class qc{constructor(u){this._bufferService=u,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(u){const p={id:this._nextCharacterJoinerId++,handler:u};return this._characterJoiners.push(p),p.id}deregister(u){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===u)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(u){if(this._characterJoiners.length===0)return[];const p=this._bufferService.buffer.lines.get(u);if(!p||p.length===0)return[];const b=[],E=p.translateToString(!0);let y=0,C=0,S=0,k=p.getFg(0),T=p.getBg(0);for(let R=0;R<p.getTrimmedLength();R++)if(p.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==T){if(R-y>1){const L=this._getJoinedRanges(E,S,C,p,y);for(let N=0;N<L.length;N++)b.push(L[N])}y=R,S=C,k=this._workCell.fg,T=this._workCell.bg}C+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const R=this._getJoinedRanges(E,S,C,p,y);for(let L=0;L<R.length;L++)b.push(R[L])}return b}_getJoinedRanges(u,p,b,E,y){const C=u.substring(p,b);let S=[];try{S=this._characterJoiners[0].handler(C)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const T=this._characterJoiners[k].handler(C);for(let R=0;R<T.length;R++)qc._mergeRanges(S,T[R])}catch(T){console.error(T)}return this._stringRangesToCellRanges(S,E,y),S}_stringRangesToCellRanges(u,p,b){let E=0,y=!1,C=0,S=u[E];if(S){for(let k=b;k<this._bufferService.cols;k++){const T=p.getWidth(k),R=p.getString(k).length||m.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&S[0]<=C&&(S[0]=k,y=!0),S[1]<=C){if(S[1]=k,S=u[++E],!S)break;S[0]<=C?(S[0]=k,y=!0):y=!1}C+=R}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(u,p){let b=!1;for(let E=0;E<u.length;E++){const y=u[E];if(b){if(p[1]<=y[0])return u[E-1][1]=p[1],u;if(p[1]<=y[1])return u[E-1][1]=Math.max(p[1],y[1]),u.splice(E,1),u;u.splice(E,1),E--}else{if(p[1]<=y[0])return u.splice(E,0,p),u;if(p[1]<=y[1])return y[0]=Math.min(p[0],y[0]),u;p[0]<y[1]&&(y[0]=Math.min(p[0],y[0]),b=!0)}}return b?u[u.length-1][1]=p[1]:u.push(p),u}};s.CharacterJoinerService=l=c([g(0,w.IBufferService)],l)},5114:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=o(844),g=o(8460),f=o(3656);class m extends c.Disposable{constructor(v,l,h){super(),this._textarea=v,this._window=l,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((u=>this._screenDprMonitor.setWindow(u)))),this.register((0,g.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(v){this._window!==v&&(this._window=v,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=m;class _ extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=o(844);class g extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const _=this.linkProviders.indexOf(m);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=g},8934:function(d,s,o){var c=this&&this.__decorate||function(w,v,l,h){var u,p=arguments.length,b=p<3?v:h===null?h=Object.getOwnPropertyDescriptor(v,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(w,v,l,h);else for(var E=w.length-1;E>=0;E--)(u=w[E])&&(b=(p<3?u(b):p>3?u(v,l,b):u(v,l))||b);return p>3&&b&&Object.defineProperty(v,l,b),b},g=this&&this.__param||function(w,v){return function(l,h){v(l,h,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const f=o(4725),m=o(9806);let _=s.MouseService=class{constructor(w,v){this._renderService=w,this._charSizeService=v}getCoords(w,v,l,h,u){return(0,m.getCoords)(window,w,v,l,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,u)}getMouseReportCoords(w,v){const l=(0,m.getCoordsRelativeToElement)(window,w,v);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};s.MouseService=_=c([g(0,f.IRenderService),g(1,f.ICharSizeService)],_)},3230:function(d,s,o){var c=this&&this.__decorate||function(u,p,b,E){var y,C=arguments.length,S=C<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,p,b,E);else for(var k=u.length-1;k>=0;k--)(y=u[k])&&(S=(C<3?y(S):C>3?y(p,b,S):y(p,b))||S);return C>3&&S&&Object.defineProperty(p,b,S),S},g=this&&this.__param||function(u,p){return function(b,E){p(b,E,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const f=o(6193),m=o(4725),_=o(8460),w=o(844),v=o(7226),l=o(2585);let h=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(u,p,b,E,y,C,S,k){super(),this._rowCount=u,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new w.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((T,R)=>this._renderRows(T,R)),S),this.register(this._renderDebouncer),this.register(S.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(b.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(S.window,p),this.register(S.onWindowChange((T=>this._registerIntersectionObserver(T,p))))}_registerIntersectionObserver(u,p){if("IntersectionObserver"in u){const b=new u.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});b.observe(p),this._observerDisposable.value=(0,w.toDisposable)((()=>b.disconnect()))}}_handleIntersectionChange(u){this._isPaused=u.isIntersecting===void 0?u.intersectionRatio===0:!u.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(u,p,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(u,p,this._rowCount))}_renderRows(u,p){this._renderer.value&&(u=Math.min(u,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(u,p),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:u,end:p}),this._onRender.fire({start:u,end:p}),this._isNextRenderRedrawOnly=!0)}resize(u,p){this._rowCount=p,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(u){this._renderer.value=u,this._renderer.value&&(this._renderer.value.onRequestRedraw((p=>this.refreshRows(p.start,p.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(u){return this._renderDebouncer.addRefreshCallback(u)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var u,p;this._renderer.value&&((p=(u=this._renderer.value).clearTextureAtlas)==null||p.call(u),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(u,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(u,p)})):this._renderer.value.handleResize(u,p),this._fullRefresh())}handleCharSizeChanged(){var u;(u=this._renderer.value)==null||u.handleCharSizeChanged()}handleBlur(){var u;(u=this._renderer.value)==null||u.handleBlur()}handleFocus(){var u;(u=this._renderer.value)==null||u.handleFocus()}handleSelectionChanged(u,p,b){var E;this._selectionState.start=u,this._selectionState.end=p,this._selectionState.columnSelectMode=b,(E=this._renderer.value)==null||E.handleSelectionChanged(u,p,b)}handleCursorMove(){var u;(u=this._renderer.value)==null||u.handleCursorMove()}clear(){var u;(u=this._renderer.value)==null||u.clear()}};s.RenderService=h=c([g(2,l.IOptionsService),g(3,m.ICharSizeService),g(4,l.IDecorationService),g(5,l.IBufferService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],h)},9312:function(d,s,o){var c=this&&this.__decorate||function(S,k,T,R){var L,N=arguments.length,U=N<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(S,k,T,R);else for(var P=S.length-1;P>=0;P--)(L=S[P])&&(U=(N<3?L(U):N>3?L(k,T,U):L(k,T))||U);return N>3&&U&&Object.defineProperty(k,T,U),U},g=this&&this.__param||function(S,k){return function(T,R){k(T,R,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const f=o(9806),m=o(9504),_=o(456),w=o(4725),v=o(8460),l=o(844),h=o(6114),u=o(4841),p=o(511),b=o(2585),E=" ",y=new RegExp(E,"g");let C=s.SelectionService=class extends l.Disposable{constructor(S,k,T,R,L,N,U,P,H){super(),this._element=S,this._screenElement=k,this._linkifier=T,this._bufferService=R,this._coreService=L,this._mouseService=N,this._optionsService=U,this._renderService=P,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.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 S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const T=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const L=S[0]<k[0]?S[0]:k[0],N=S[0]<k[0]?k[0]:S[0];for(let U=S[1];U<=k[1];U++){const P=T.translateBufferLineToString(U,!0,L,N);R.push(P)}}else{const L=S[1]===k[1]?k[0]:void 0;R.push(T.translateBufferLineToString(S[1],!0,S[0],L));for(let N=S[1]+1;N<=k[1]-1;N++){const U=T.lines.get(N),P=T.translateBufferLineToString(N,!0);U!=null&&U.isWrapped?R[R.length-1]+=P:R.push(P)}if(S[1]!==k[1]){const N=T.lines.get(k[1]),U=T.translateBufferLineToString(k[1],!0,0,k[0]);N&&N.isWrapped?R[R.length-1]+=U:R.push(U)}}return R.map((L=>L.replace(y," "))).join(h.isWindows?`\r
163
163
  `:`
164
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),R=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(R&&B&&k)&&this._areCoordsInSelection(k,R,B)}isCellInSelection(S,k){const R=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!R||!B)&&this._areCoordsInSelection([S,k],R,B)}_areCoordsInSelection(S,k,R){return S[1]>k[1]&&S[1]<R[1]||k[1]===R[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<R[0]||k[1]<R[1]&&S[1]===R[1]&&S[0]<R[0]||k[1]<R[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var R,B;const L=(B=(R=this._linkifier.currentLink)==null?void 0:R.link)==null?void 0:B.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const T=this._getMouseBufferCoords(S);return!!T&&(this._selectWordAt(T,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return u.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!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(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.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(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const B=R.lines.get(this._model.selectionEnd[1]);B&&B.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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const B=(0,v.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);R?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,R)}_fireOnSelectionChange(S,k,R){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(S,k){let R=k;for(let B=0;k>=B;B++){const L=S.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:L>1&&k!==B&&(R+=L-1)}return R}setSelection(S,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,R=!0,B=!0){if(S[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,T=L.lines.get(S[1]);if(!T)return;const F=L.translateBufferLineToString(S[1],!1);let U=this._convertViewportColToCharacterIndex(T,S[0]),$=U;const j=S[0]-U;let Z=0,I=0,N=0,x=0;if(F.charAt(U)===" "){for(;U>0&&F.charAt(U-1)===" ";)U--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let Y=S[0],J=S[0];T.getWidth(Y)===0&&(Z++,Y--),T.getWidth(J)===2&&(I++,J++);const Q=T.getString(J).length;for(Q>1&&(x+=Q-1,$+=Q-1);Y>0&&U>0&&!this._isCharWordSeparator(T.loadCell(Y-1,this._workCell));){T.loadCell(Y-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,Y--):O>1&&(N+=O-1,U-=O-1),U--,Y--}for(;J<T.length&&$+1<F.length&&!this._isCharWordSeparator(T.loadCell(J+1,this._workCell));){T.loadCell(J+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,J++):O>1&&(x+=O-1,$+=O-1),$++,J++}}$++;let D=U+j-Z+N,W=Math.min(this._bufferService.cols,$-U+Z+I-N-x);if(k||F.slice(U,$).trim()!==""){if(R&&D===0&&T.getCodePoint(0)!==32){const Y=L.lines.get(S[1]-1);if(Y&&T.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(J){const Q=this._bufferService.cols-J.start;D-=Q,W+=Q}}}if(B&&D+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const Y=L.lines.get(S[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const J=this._getWordAt([0,S[1]+1],!1,!1,!0);J&&(W+=J.length)}}return{start:D,length:W}}}_selectWordAt(S,k){const R=this._getWordAt(S,k);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[R.start,S[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let R=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),R={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,l.getRangeLength)(R,this._bufferService.cols)}};n.SelectionService=w=a([g(3,_.IBufferService),g(4,_.ICoreService),g(5,C.IMouseService),g(6,_.IOptionsService),g(7,C.IRenderService),g(8,C.ICoreBrowserService)],w)},4725:(p,n,o)=>{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 a=o(8343);n.ICharSizeService=(0,a.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),n.IMouseService=(0,a.createDecorator)("MouseService"),n.IRenderService=(0,a.createDecorator)("RenderService"),n.ISelectionService=(0,a.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,a.createDecorator)("ThemeService"),n.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(p,n,o){var a=this&&this.__decorate||function(w,S,k,R){var B,L=arguments.length,T=L<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,S,k,R);else for(var F=w.length-1;F>=0;F--)(B=w[F])&&(T=(L<3?B(T):L>3?B(S,k,T):B(S,k))||T);return L>3&&T&&Object.defineProperty(S,k,T),T},g=this&&this.__param||function(w,S){return function(k,R){S(k,R,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const d=o(7239),v=o(8055),b=o(8460),C=o(844),m=o(2585),c=v.css.toColor("#ffffff"),u=v.css.toColor("#000000"),l=v.css.toColor("#ffffff"),f=v.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=S[k/36%6|0],B=S[k/6%6|0],L=S[k%6];w.push({css:v.channels.toCss(R,B,L),rgba:v.channels.toRgba(R,B,L)})}for(let k=0;k<24;k++){const R=8+10*k;w.push({css:v.channels.toCss(R,R,R),rgba:v.channels.toRgba(R,R,R)})}return w})());let E=n.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:u,cursor:l,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:v.color.blend(u,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:v.color.blend(u,_),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 S=this._colors;if(S.foreground=y(w.foreground,c),S.background=y(w.background,u),S.cursor=y(w.cursor,l),S.cursorAccent=y(w.cursorAccent,f),S.selectionBackgroundTransparent=y(w.selectionBackground,_),S.selectionBackgroundOpaque=v.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=y(w.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=v.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=w.selectionForeground?y(w.selectionForeground,v.NULL_COLOR):void 0,S.selectionForeground===v.NULL_COLOR&&(S.selectionForeground=void 0),v.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=v.color.opacity(S.selectionBackgroundTransparent,.3)),v.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=v.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=n.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=y(w.black,n.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=y(w.red,n.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=y(w.green,n.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=y(w.yellow,n.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=y(w.blue,n.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=y(w.magenta,n.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=y(w.cyan,n.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=y(w.white,n.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=y(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=y(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=y(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=y(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=y(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=y(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=y(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=y(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(S.ansi.length-16,w.extendedAnsi.length);for(let R=0;R<k;R++)S.ansi[R+16]=y(w.extendedAnsi[R],n.DEFAULT_ANSI_COLORS[R+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 S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}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 y(w,S){if(w!==void 0)try{return v.css.toColor(w)}catch{}return S}n.ThemeService=E=a([g(0,m.IOptionsService)],E)},6349:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const a=o(8460),g=o(844);class d extends g.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new a.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new a.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new a.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(b){if(this._maxLength===b)return;const C=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)C[m]=this._array[this._getCyclicIndex(m)];this._array=C,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let C=this._length;C<b;C++)this._array[C]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,C){this._array[this._getCyclicIndex(b)]=C}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,C,...m){if(C){for(let c=b;c<this._length-C;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+C)];this._length-=C,this.onDeleteEmitter.fire({index:b,amount:C})}for(let c=this._length-1;c>=b;c--)this._array[this._getCyclicIndex(c+m.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<m.length;c++)this._array[this._getCyclicIndex(b+c)]=m[c];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const c=this._length+m.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,C,m){if(!(C<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let u=C-1;u>=0;u--)this.set(b+u+m,this.get(b+u));const c=b+C+m-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<C;c++)this.set(b+c+m,this.get(b+c))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}n.CircularList=d},1439:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function o(a,g=5){if(typeof a!="object")return a;const d=Array.isArray(a)?[]:{};for(const v in a)d[v]=g<=1?a[v]:a[v]&&o(a[v],g-1);return d}},8055:(p,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 o=0,a=0,g=0,d=0;var v,b,C,m,c;function u(f){const _=f.toString(16);return _.length<2?"0"+_:_}function l(f,_){return f<_?(_+.05)/(f+.05):(f+.05)/(_+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(_,E,y,w){return w!==void 0?`#${u(_)}${u(E)}${u(y)}${u(w)}`:`#${u(_)}${u(E)}${u(y)}`},f.toRgba=function(_,E,y,w=255){return(_<<24|E<<16|y<<8|w)>>>0},f.toColor=function(_,E,y,w){return{css:f.toCss(_,E,y,w),rgba:f.toRgba(_,E,y,w)}}})(v||(n.channels=v={})),(function(f){function _(E,y){return d=Math.round(255*y),[o,a,g]=c.toChannels(E.rgba),{css:v.toCss(o,a,g,d),rgba:v.toRgba(o,a,g,d)}}f.blend=function(E,y){if(d=(255&y.rgba)/255,d===1)return{css:y.css,rgba:y.rgba};const w=y.rgba>>24&255,S=y.rgba>>16&255,k=y.rgba>>8&255,R=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return o=R+Math.round((w-R)*d),a=B+Math.round((S-B)*d),g=L+Math.round((k-L)*d),{css:v.toCss(o,a,g),rgba:v.toRgba(o,a,g)}},f.isOpaque=function(E){return(255&E.rgba)==255},f.ensureContrastRatio=function(E,y,w){const S=c.ensureContrastRatio(E.rgba,y.rgba,w);if(S)return v.toColor(S>>24&255,S>>16&255,S>>8&255)},f.opaque=function(E){const y=(255|E.rgba)>>>0;return[o,a,g]=c.toChannels(y),{css:v.toCss(o,a,g),rgba:y}},f.opacity=_,f.multiplyOpacity=function(E,y){return d=255&E.rgba,_(E,d*y/255)},f.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(n.color=b={})),(function(f){let _,E;try{const y=document.createElement("canvas");y.width=1,y.height=1;const w=y.getContext("2d",{willReadFrequently:!0});w&&(_=w,_.globalCompositeOperation="copy",E=_.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return o=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),v.toColor(o,a,g);case 5:return o=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),d=parseInt(y.slice(4,5).repeat(2),16),v.toColor(o,a,g,d);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const w=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return o=parseInt(w[1]),a=parseInt(w[2]),g=parseInt(w[3]),d=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),v.toColor(o,a,g,d);if(!_||!E)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=E,_.fillStyle=y,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[o,a,g,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(o,a,g,d),css:y}}})(C||(n.css=C={})),(function(f){function _(E,y,w){const S=E/255,k=y/255,R=w/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}f.relativeLuminance=function(E){return _(E>>16&255,E>>8&255,255&E)},f.relativeLuminance2=_})(m||(n.rgb=m={})),(function(f){function _(y,w,S){const k=y>>24&255,R=y>>16&255,B=y>>8&255;let L=w>>24&255,T=w>>16&255,F=w>>8&255,U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));for(;U<S&&(L>0||T>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),T-=Math.max(0,Math.ceil(.1*T)),F-=Math.max(0,Math.ceil(.1*F)),U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));return(L<<24|T<<16|F<<8|255)>>>0}function E(y,w,S){const k=y>>24&255,R=y>>16&255,B=y>>8&255;let L=w>>24&255,T=w>>16&255,F=w>>8&255,U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));for(;U<S&&(L<255||T<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),T=Math.min(255,T+Math.ceil(.1*(255-T))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=l(m.relativeLuminance2(L,T,F),m.relativeLuminance2(k,R,B));return(L<<24|T<<16|F<<8|255)>>>0}f.blend=function(y,w){if(d=(255&w)/255,d===1)return w;const S=w>>24&255,k=w>>16&255,R=w>>8&255,B=y>>24&255,L=y>>16&255,T=y>>8&255;return o=B+Math.round((S-B)*d),a=L+Math.round((k-L)*d),g=T+Math.round((R-T)*d),v.toRgba(o,a,g)},f.ensureContrastRatio=function(y,w,S){const k=m.relativeLuminance(y>>8),R=m.relativeLuminance(w>>8);if(l(k,R)<S){if(R<k){const T=_(y,w,S),F=l(k,m.relativeLuminance(T>>8));if(F<S){const U=E(y,w,S);return F>l(k,m.relativeLuminance(U>>8))?T:U}return T}const B=E(y,w,S),L=l(k,m.relativeLuminance(B>>8));if(L<S){const T=_(y,w,S);return L>l(k,m.relativeLuminance(T>>8))?B:T}return B}},f.reduceLuminance=_,f.increaseLuminance=E,f.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(c||(n.rgba=c={})),n.toPaddedHex=u,n.contrastRatio=l},8969:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const a=o(844),g=o(2585),d=o(4348),v=o(7866),b=o(744),C=o(7302),m=o(6975),c=o(8460),u=o(1753),l=o(1480),f=o(7994),_=o(9282),E=o(5435),y=o(5981),w=o(2660);let S=!1;class k extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event((B=>{var L;(L=this._onScrollApi)==null||L.fire(B.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(B){for(const L in B)this.optionsService.options[L]=B[L]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new a.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new C.OptionsService(B)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.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((L=>{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((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((L,T)=>this._inputHandler.parse(L,T)))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,L){this._writeBuffer.write(B,L)}writeSync(B,L){this._logService.logLevel<=g.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(B,L)}input(B,L=!0){this.coreService.triggerDataEvent(B,L)}resize(B,L){isNaN(B)||isNaN(L)||(B=Math.max(B,b.MINIMUM_COLS),L=Math.max(L,b.MINIMUM_ROWS),this._bufferService.resize(B,L))}scroll(B,L=!1){this._bufferService.scroll(B,L)}scrollLines(B,L,T){this._bufferService.scrollLines(B,L,T)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const L=B-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(B,L){return this._inputHandler.registerEscHandler(B,L)}registerDcsHandler(B,L){return this._inputHandler.registerDcsHandler(B,L)}registerCsiHandler(B,L){return this._inputHandler.registerCsiHandler(B,L)}registerOscHandler(B,L){return this._inputHandler.registerOscHandler(B,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?B=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)((()=>{for(const L of B)L.dispose()}))}}}n.CoreTerminal=k},8460:(p,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===o)return void this._listeners.splice(a,1)}}})),this._event}fire(o,a){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,o,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,a){return o((g=>a.fire(g)))},n.runAndSubscribe=function(o,a){return a(void 0),o((g=>a(g)))}},5435:function(p,n,o){var a=this&&this.__decorate||function(Z,I,N,x){var D,W=arguments.length,Y=W<3?I:x===null?x=Object.getOwnPropertyDescriptor(I,N):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(Z,I,N,x);else for(var J=Z.length-1;J>=0;J--)(D=Z[J])&&(Y=(W<3?D(Y):W>3?D(I,N,Y):D(I,N))||Y);return W>3&&Y&&Object.defineProperty(I,N,Y),Y},g=this&&this.__param||function(Z,I){return function(N,x){I(N,x,Z)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const d=o(2584),v=o(7116),b=o(2015),C=o(844),m=o(482),c=o(8437),u=o(8460),l=o(643),f=o(511),_=o(3734),E=o(2585),y=o(1480),w=o(6242),S=o(6351),k=o(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function L(Z,I){if(Z>24)return I.setWinLines||!1;switch(Z){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var T;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(n.WindowsOptionsReportType=T={}));let F=0;class U extends C.Disposable{getAttrData(){return this._curAttrData}constructor(I,N,x,D,W,Y,J,Q,O=new b.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=N,this._coreService=x,this._logService=D,this._optionsService=W,this._oscLinkService=Y,this._coreMouseService=J,this._unicodeService=Q,this._parser=O,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._parser.setCsiHandlerFallback(((A,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:H.toArray()})})),this._parser.setEscHandlerFallback((A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})})),this._parser.setExecuteHandlerFallback((A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})})),this._parser.setOscHandlerFallback(((A,H,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:H,data:M})})),this._parser.setDcsHandlerFallback(((A,H,M)=>{H==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:H,payload:M})})),this._parser.setPrintHandler(((A,H,M)=>this.print(A,H,M))),this._parser.registerCsiHandler({final:"@"},(A=>this.insertChars(A))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(A=>this.scrollLeft(A))),this._parser.registerCsiHandler({final:"A"},(A=>this.cursorUp(A))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(A=>this.scrollRight(A))),this._parser.registerCsiHandler({final:"B"},(A=>this.cursorDown(A))),this._parser.registerCsiHandler({final:"C"},(A=>this.cursorForward(A))),this._parser.registerCsiHandler({final:"D"},(A=>this.cursorBackward(A))),this._parser.registerCsiHandler({final:"E"},(A=>this.cursorNextLine(A))),this._parser.registerCsiHandler({final:"F"},(A=>this.cursorPrecedingLine(A))),this._parser.registerCsiHandler({final:"G"},(A=>this.cursorCharAbsolute(A))),this._parser.registerCsiHandler({final:"H"},(A=>this.cursorPosition(A))),this._parser.registerCsiHandler({final:"I"},(A=>this.cursorForwardTab(A))),this._parser.registerCsiHandler({final:"J"},(A=>this.eraseInDisplay(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(A=>this.eraseInDisplay(A,!0))),this._parser.registerCsiHandler({final:"K"},(A=>this.eraseInLine(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(A=>this.eraseInLine(A,!0))),this._parser.registerCsiHandler({final:"L"},(A=>this.insertLines(A))),this._parser.registerCsiHandler({final:"M"},(A=>this.deleteLines(A))),this._parser.registerCsiHandler({final:"P"},(A=>this.deleteChars(A))),this._parser.registerCsiHandler({final:"S"},(A=>this.scrollUp(A))),this._parser.registerCsiHandler({final:"T"},(A=>this.scrollDown(A))),this._parser.registerCsiHandler({final:"X"},(A=>this.eraseChars(A))),this._parser.registerCsiHandler({final:"Z"},(A=>this.cursorBackwardTab(A))),this._parser.registerCsiHandler({final:"`"},(A=>this.charPosAbsolute(A))),this._parser.registerCsiHandler({final:"a"},(A=>this.hPositionRelative(A))),this._parser.registerCsiHandler({final:"b"},(A=>this.repeatPrecedingCharacter(A))),this._parser.registerCsiHandler({final:"c"},(A=>this.sendDeviceAttributesPrimary(A))),this._parser.registerCsiHandler({prefix:">",final:"c"},(A=>this.sendDeviceAttributesSecondary(A))),this._parser.registerCsiHandler({final:"d"},(A=>this.linePosAbsolute(A))),this._parser.registerCsiHandler({final:"e"},(A=>this.vPositionRelative(A))),this._parser.registerCsiHandler({final:"f"},(A=>this.hVPosition(A))),this._parser.registerCsiHandler({final:"g"},(A=>this.tabClear(A))),this._parser.registerCsiHandler({final:"h"},(A=>this.setMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(A=>this.setModePrivate(A))),this._parser.registerCsiHandler({final:"l"},(A=>this.resetMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(A=>this.resetModePrivate(A))),this._parser.registerCsiHandler({final:"m"},(A=>this.charAttributes(A))),this._parser.registerCsiHandler({final:"n"},(A=>this.deviceStatus(A))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(A=>this.deviceStatusPrivate(A))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(A=>this.softReset(A))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(A=>this.setCursorStyle(A))),this._parser.registerCsiHandler({final:"r"},(A=>this.setScrollRegion(A))),this._parser.registerCsiHandler({final:"s"},(A=>this.saveCursor(A))),this._parser.registerCsiHandler({final:"t"},(A=>this.windowOptions(A))),this._parser.registerCsiHandler({final:"u"},(A=>this.restoreCursor(A))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(A=>this.insertColumns(A))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(A=>this.deleteColumns(A))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(A=>this.selectProtected(A))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(A=>this.requestMode(A,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(A=>this.requestMode(A,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((A=>(this.setTitle(A),this.setIconName(A),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((A=>this.setIconName(A)))),this._parser.registerOscHandler(2,new w.OscHandler((A=>this.setTitle(A)))),this._parser.registerOscHandler(4,new w.OscHandler((A=>this.setOrReportIndexedColor(A)))),this._parser.registerOscHandler(8,new w.OscHandler((A=>this.setHyperlink(A)))),this._parser.registerOscHandler(10,new w.OscHandler((A=>this.setOrReportFgColor(A)))),this._parser.registerOscHandler(11,new w.OscHandler((A=>this.setOrReportBgColor(A)))),this._parser.registerOscHandler(12,new w.OscHandler((A=>this.setOrReportCursorColor(A)))),this._parser.registerOscHandler(104,new w.OscHandler((A=>this.restoreIndexedColor(A)))),this._parser.registerOscHandler(110,new w.OscHandler((A=>this.restoreFgColor(A)))),this._parser.registerOscHandler(111,new w.OscHandler((A=>this.restoreBgColor(A)))),this._parser.registerOscHandler(112,new w.OscHandler((A=>this.restoreCursorColor(A)))),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 A in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},(()=>this.selectCharset("("+A))),this._parser.registerEscHandler({intermediates:")",final:A},(()=>this.selectCharset(")"+A))),this._parser.registerEscHandler({intermediates:"*",final:A},(()=>this.selectCharset("*"+A))),this._parser.registerEscHandler({intermediates:"+",final:A},(()=>this.selectCharset("+"+A))),this._parser.registerEscHandler({intermediates:"-",final:A},(()=>this.selectCharset("-"+A))),this._parser.registerEscHandler({intermediates:".",final:A},(()=>this.selectCharset("."+A))),this._parser.registerEscHandler({intermediates:"/",final:A},(()=>this.selectCharset("/"+A)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((A=>(this._logService.error("Parsing error: ",A),A))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler(((A,H)=>this.requestStatusString(A,H))))}_preserveStack(I,N,x,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=x,this._parseStack.position=D}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((N,x)=>setTimeout((()=>x("#SLOW_TIMEOUT")),5e3)))]).catch((N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,N){let x,D=this._activeBuffer.x,W=this._activeBuffer.y,Y=0;const J=this._parseStack.paused;if(J){if(x=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(x),x;D=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(Y=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(A=>String.fromCharCode(A))).join("")}"`),typeof I=="string"?I.split("").map((A=>A.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(I.length,B))),J||this._dirtyRowTracker.clearRange(),I.length>B)for(let A=Y;A<I.length;A+=B){const H=A+B<I.length?A+B:I.length,M=typeof I=="string"?this._stringDecoder.decode(I.substring(A,H),this._parseBuffer):this._utf8Decoder.decode(I.subarray(A,H),this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,M))return this._preserveStack(D,W,M,A),this._logSlowResolvingAsync(x),x}else if(!J){const A=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,A))return this._preserveStack(D,W,A,0),this._logSlowResolvingAsync(x),x}this._activeBuffer.x===D&&this._activeBuffer.y===W||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),O=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);O<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(O,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(I,N,x){let D,W;const Y=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,H=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&x-N>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let K=this._parser.precedingJoinState;for(let X=N;X<x;++X){if(D=I[X],D<127&&Y){const De=Y[String.fromCharCode(D)];De&&(D=De.charCodeAt(0))}const te=this._unicodeService.charProperties(D,K);W=y.UnicodeService.extractWidth(te);const pe=y.UnicodeService.extractShouldJoin(te),ge=pe?y.UnicodeService.extractWidth(K):0;if(K=te,J&&this._onA11yChar.fire((0,m.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ge>Q){if(O){const De=M;let q=this._activeBuffer.x-ge;for(this._activeBuffer.x=ge,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ge>0&&M instanceof c.BufferLine&&M.copyCellsFrom(De,q,0,ge,!1);q<Q;)De.setCellFromCodepoint(q++,0,1,H)}else if(this._activeBuffer.x=Q-1,W===2)continue}if(pe&&this._activeBuffer.x){const De=M.getWidth(this._activeBuffer.x-1)?1:2;M.addCodepointToCell(this._activeBuffer.x-De,D,W);for(let q=W-ge;--q>=0;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(A&&(M.insertCells(this._activeBuffer.x,W-ge,this._activeBuffer.getNullCell(H)),M.getWidth(Q-1)===2&&M.setCellFromCodepoint(Q-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,H)),M.setCellFromCodepoint(this._activeBuffer.x++,D,W,H),W>0)for(;--W;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=K,this._activeBuffer.x<Q&&x-N>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,N){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,N):this._parser.registerCsiHandler(I,(x=>!L(x.params[0],this._optionsService.rawOptions.windowOptions)||N(x)))}registerDcsHandler(I,N){return this._parser.registerDcsHandler(I,new S.DcsHandler(N))}registerEscHandler(I,N){return this._parser.registerEscHandler(I,N)}registerOscHandler(I,N){return this._parser.registerOscHandler(I,new w.OscHandler(N))}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 I;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&&(I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=I,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+N)}cursorUp(I){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const N=I.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const N=I.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,N,x,D=!1,W=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Y.replaceCells(N,x,this._activeBuffer.getNullCell(this._eraseAttrData()),W),D&&(Y.isWrapped=!1)}_resetBufferLine(I,N=!1){const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);x&&(x.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),x.isWrapped=!1)}eraseInDisplay(I,N=!1){let x;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);x<this._bufferService.rows;x++)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(x);break;case 1:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x,0,this._activeBuffer.x+1,!0,N),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(x+1).isWrapped=!1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(x=this._bufferService.rows,this._dirtyRowTracker.markDirty(x-1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(I,N=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;N--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(x,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;N--;)this._activeBuffer.lines.splice(x,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let N=I.params[0]||1;for(;N--;)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(I){let N=I.params[0]||1;for(;N--;)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(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.deleteCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.insertCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.deleteCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const N=this._parser.precedingJoinState;if(!N)return!0;const x=I.params[0]||1,D=y.UnicodeService.extractWidth(N),W=this._activeBuffer.x-D,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),J=new Uint32Array(Y.length*x);let Q=0;for(let A=0;A<Y.length;){const H=Y.codePointAt(A)||0;J[Q++]=H,A+=H>65535?2:1}let O=Q;for(let A=1;A<x;++A)J.copyWithin(O,0,Q),O+=Q;return this.print(J,0,O),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){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(),I.params[N]===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(I,N){const x=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:W}=this._coreMouseService,Y=this._coreService,{buffers:J,cols:Q}=this._bufferService,{active:O,alt:A}=J,H=this._optionsService.rawOptions,M=pe=>pe?1:2,K=I.params[0];return X=K,te=N?K===2?4:K===4?M(Y.modes.insertMode):K===12?3:K===20?M(H.convertEol):0:K===1?M(x.applicationCursorKeys):K===3?H.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:K===6?M(x.origin):K===7?M(x.wraparound):K===8?3:K===9?M(D==="X10"):K===12?M(H.cursorBlink):K===25?M(!Y.isCursorHidden):K===45?M(x.reverseWraparound):K===66?M(x.applicationKeypad):K===67?4:K===1e3?M(D==="VT200"):K===1002?M(D==="DRAG"):K===1003?M(D==="ANY"):K===1004?M(x.sendFocus):K===1005?4:K===1006?M(W==="SGR"):K===1015?4:K===1016?M(W==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?M(O===A):K===2004?M(x.bracketedPasteMode):0,Y.triggerDataEvent(`${d.C0.ESC}[${N?"":"?"}${X};${te}$y`),!0;var X,te}_updateAttrColor(I,N,x,D,W){return N===2?(I|=50331648,I&=-16777216,I|=_.AttributeData.fromColorRGB([x,D,W])):N===5&&(I&=-50331904,I|=33554432|255&x),I}_extractColor(I,N,x){const D=[0,0,-1,0,0,0];let W=0,Y=0;do{if(D[Y+W]=I.params[N+Y],I.hasSubParams(N+Y)){const J=I.getSubParams(N+Y);let Q=0;do D[1]===5&&(W=1),D[Y+Q+1+W]=J[Q];while(++Q<J.length&&Q+Y+1+W<D.length);break}if(D[1]===5&&Y+W>=2||D[1]===2&&Y+W>=5)break;D[1]&&(W=1)}while(++Y+N<I.length&&Y+W<D.length);for(let J=2;J<D.length;++J)D[J]===-1&&(D[J]=0);switch(D[0]){case 38:x.fg=this._updateAttrColor(x.fg,D[1],D[3],D[4],D[5]);break;case 48:x.bg=this._updateAttrColor(x.bg,D[1],D[3],D[4],D[5]);break;case 58:x.extended=x.extended.clone(),x.extended.underlineColor=this._updateAttrColor(x.extended.underlineColor,D[1],D[3],D[4],D[5])}return Y}_processUnderline(I,N){N.extended=N.extended.clone(),(!~I||I>5)&&(I=1),N.extended.underlineStyle=I,N.fg|=268435456,I===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(I){I.fg=c.DEFAULT_ATTR_DATA.fg,I.bg=c.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=I.length;let x;const D=this._curAttrData;for(let W=0;W<N;W++)x=I.params[W],x>=30&&x<=37?(D.fg&=-50331904,D.fg|=16777216|x-30):x>=40&&x<=47?(D.bg&=-50331904,D.bg|=16777216|x-40):x>=90&&x<=97?(D.fg&=-50331904,D.fg|=16777224|x-90):x>=100&&x<=107?(D.bg&=-50331904,D.bg|=16777224|x-100):x===0?this._processSGR0(D):x===1?D.fg|=134217728:x===3?D.bg|=67108864:x===4?(D.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,D)):x===5?D.fg|=536870912:x===7?D.fg|=67108864:x===8?D.fg|=1073741824:x===9?D.fg|=2147483648:x===2?D.bg|=134217728:x===21?this._processUnderline(2,D):x===22?(D.fg&=-134217729,D.bg&=-134217729):x===23?D.bg&=-67108865:x===24?(D.fg&=-268435457,this._processUnderline(0,D)):x===25?D.fg&=-536870913:x===27?D.fg&=-67108865:x===28?D.fg&=-1073741825:x===29?D.fg&=2147483647:x===39?(D.fg&=-67108864,D.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):x===49?(D.bg&=-67108864,D.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):x===38||x===48||x===58?W+=this._extractColor(I,W,D):x===53?D.bg|=1073741824:x===55?D.bg&=-1073741825:x===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):x===100?(D.fg&=-67108864,D.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",x);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${N};${x}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${N};${x}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.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(I){const N=I.params[0]||1;switch(N){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 x=N%2==1;return this._optionsService.options.cursorBlink=x,!0}setScrollRegion(I){const N=I.params[0]||1;let x;return(I.length<2||(x=I.params[1])>this._bufferService.rows||x===0)&&(x=this._bufferService.rows),x>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=x-1,this._setCursor(0,0)),!0}windowOptions(I){if(!L(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const N=[],x=I.split(";");for(;x.length>1;){const D=x.shift(),W=x.shift();if(/^\d+$/.exec(D)){const Y=parseInt(D);if(j(Y))if(W==="?")N.push({type:0,index:Y});else{const J=(0,k.parseColor)(W);J&&N.push({type:1,index:Y,color:J})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(I){const N=I.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(I,N){this._getCurrentLinkId()&&this._finishHyperlink();const x=I.split(":");let D;const W=x.findIndex((Y=>Y.startsWith("id=")));return W!==-1&&(D=x[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,N){const x=I.split(";");for(let D=0;D<x.length&&!(N>=this._specialColors.length);++D,++N)if(x[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const W=(0,k.parseColor)(x[D]);W&&this._onColor.fire([{type:1,index:this._specialColors[N],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const N=[],x=I.split(";");for(let D=0;D<x.length;++D)if(/^\d+$/.exec(x[D])){const W=parseInt(x[D]);j(W)&&N.push({type:2,index:W})}return N.length&&this._onColor.fire(N),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(R[I[0]],v.CHARSETS[I[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new f.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N<this._bufferService.rows;++N){const x=this._activeBuffer.ybase+this._activeBuffer.y+N,D=this._activeBuffer.lines.get(x);D&&(D.fill(I),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,N){const x=this._bufferService.buffer,D=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${x.scrollTop+1};${x.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,N){this._dirtyRowTracker.markRangeDirty(I,N)}}n.InputHandler=U;let $=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,I){Z>I&&(F=Z,Z=I,I=F),Z<this.start&&(this.start=Z),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j(Z){return 0<=Z&&Z<256}$=a([g(0,E.IBufferService)],$)},844:(p,n)=>{function o(a){for(const g of a)g.dispose();a.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 a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){const g=this._disposables.indexOf(a);g!==-1&&this._disposables.splice(g,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){var g;this._isDisposed||a===this._value||((g=this._value)==null||g.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,(a=this._value)==null||a.dispose(),this._value=void 0}},n.toDisposable=function(a){return{dispose:a}},n.disposeArray=o,n.getDisposeArrayDisposable=function(a){return{dispose:()=>o(a)}}},1505:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,d,v){this._data[g]||(this._data[g]={}),this._data[g][d]=v}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}n.TwoKeyMap=o,n.FourKeyMap=class{constructor(){this._data=new o}set(a,g,d,v,b){this._data.get(a,g)||this._data.set(a,g,new o),this._data.get(a,g).set(d,v,b)}get(a,g,d,v){var b;return(b=this._data.get(a,g))==null?void 0:b.get(d,v)}clear(){this._data.clear()}}},6114:(p,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 o=n.isNode?"node":navigator.userAgent,a=n.isNode?"node":navigator.platform;n.isFirefox=o.includes("Firefox"),n.isLegacyEdge=o.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(o),n.getSafariVersion=function(){if(!n.isSafari)return 0;const g=o.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),n.isIpad=a==="iPad",n.isIphone=a==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),n.isLinux=a.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(o)},6106:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let o=0;n.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(o=this._search(this._getKey(a)),this._array.splice(o,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;const g=this._getKey(a);if(g===void 0||(o=this._search(g),o===-1)||this._getKey(this._array[o])!==g)return!1;do if(this._array[o]===a)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===g);return!1}*getKeyIterator(a){if(this._array.length!==0&&(o=this._search(a),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===a))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===a)}forEachByKey(a,g){if(this._array.length!==0&&(o=this._search(a),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===a))do g(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===a)}values(){return[...this._array].values()}_search(a){let g=0,d=this._array.length-1;for(;d>=g;){let v=g+d>>1;const b=this._getKey(this._array[v]);if(b>a)d=v-1;else{if(!(b<a)){for(;v>0&&this._getKey(this._array[v-1])===a;)v--;return v}g=v+1}}return g}}},7226:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const a=o(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let C=0,m=0,c=b.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),m=Math.max(C,m),u=b.timeRemaining(),1.5*m>u)return c-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-C))}ms`),void this._start();c=u}this.clear()}}class d extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const C=Date.now()+b;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}n.PriorityTaskQueue=d,n.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:d,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const a=o(643);n.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=d==null?void 0:d.get(g.cols-1),b=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);b&&v&&(b.isWrapped=v[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&v[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new o;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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=o;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,v=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=v}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=a},9092:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const a=o(6349),g=o(7226),d=o(3734),v=o(8437),b=o(4634),C=o(511),m=o(643),c=o(4863),u=o(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(l,f,_){this._hasScrollback=l,this._optionsService=f,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,f){return new v.BufferLine(this._bufferService.cols,this.getNullCell(l),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const f=l+this._optionsService.rawOptions.scrollback;return f>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:f}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=v.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,f){const _=this.getNullCell(v.DEFAULT_ATTR_DATA);let E=0;const y=this._getCorrectBufferLength(f);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<l)for(let S=0;S<this.lines.length;S++)E+=+this.lines.get(S).resize(l,_);let w=0;if(this._rows<f)for(let S=this._rows;S<f;S++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(l,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(l,_)));else for(let S=this._rows;S>f;S--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const S=this.lines.length-y;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=y}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,f-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(l,f),this._cols>l))for(let w=0;w<this.lines.length;w++)E+=+this.lines.get(w).resize(l,_);this._cols=l,this._rows=f,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,f){this._cols!==l&&(l>this._cols?this._reflowLarger(l,f):this._reflowSmaller(l,f))}_reflowLarger(l,f){const _=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(_.length>0){const E=(0,b.reflowLargerCreateNewLayout)(this.lines,_);(0,b.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(l,f,E.countRemoved)}}_reflowLargerAdjustViewport(l,f,_){const E=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=_;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new v.BufferLine(l,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(l,f){const _=this.getNullCell(v.DEFAULT_ATTR_DATA),E=[];let y=0;for(let w=this.lines.length-1;w>=0;w--){let S=this.lines.get(w);if(!S||!S.isWrapped&&S.getTrimmedLength()<=l)continue;const k=[S];for(;S.isWrapped&&w>0;)S=this.lines.get(--w),k.unshift(S);const R=this.ybase+this.y;if(R>=w&&R<w+k.length)continue;const B=k[k.length-1].getTrimmedLength(),L=(0,b.reflowSmallerGetNewLineLengths)(k,this._cols,l),T=L.length-k.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const U=[];for(let x=0;x<T;x++){const D=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);U.push(D)}U.length>0&&(E.push({start:w+k.length+y,newLines:U}),y+=U.length),k.push(...U);let $=L.length-1,j=L[$];j===0&&($--,j=L[$]);let Z=k.length-T-1,I=B;for(;Z>=0;){const x=Math.min(I,j);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[Z],I-x,j-x,x,!0),j-=x,j===0&&($--,j=L[$]),I-=x,I===0){Z--;const D=Math.max(Z,0);I=(0,b.getWrappedLineTrimmedLength)(k,D,this._cols)}}for(let x=0;x<k.length;x++)L[x]<l&&k[x].setCell(L[x],_);let N=T-F;for(;N-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+f-1)}if(E.length>0){const w=[],S=[];for(let $=0;$<this.lines.length;$++)S.push(this.lines.get($));const k=this.lines.length;let R=k-1,B=0,L=E[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let T=0;for(let $=Math.min(this.lines.maxLength-1,k+y-1);$>=0;$--)if(L&&L.start>R+T){for(let j=L.newLines.length-1;j>=0;j--)this.lines.set($--,L.newLines[j]);$++,w.push({index:R+1,amount:L.newLines.length}),T+=L.newLines.length,L=E[++B]}else this.lines.set($,S[R--]);let F=0;for(let $=w.length-1;$>=0;$--)w[$].index+=F,this.lines.onInsertEmitter.fire(w[$]),F+=w[$].amount;const U=Math.max(0,k+y-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(l,f,_=0,E){const y=this.lines.get(l);return y?y.translateToString(f,_,E):""}getWrappedRangeForLine(l){let f=l,_=l;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:f,last:_}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===l&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const f=new c.Marker(l);return this.markers.push(f),f.register(this.lines.onTrim((_=>{f.line-=_,f.line<0&&f.dispose()}))),f.register(this.lines.onInsert((_=>{f.line>=_.index&&(f.line+=_.amount)}))),f.register(this.lines.onDelete((_=>{f.line>=_.index&&f.line<_.index+_.amount&&f.dispose(),f.line>_.index&&(f.line-=_.amount)}))),f.register(f.onDispose((()=>this._removeMarker(f)))),f}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const a=o(3734),g=o(511),d=o(643),v=o(482);n.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let b=0;class C{constructor(c,u,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const f=u||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let _=0;_<c;++_)this.setCell(_,f);this.length=c}get(c){const u=this._data[3*c+0],l=2097151&u;return[this._data[3*c+1],2097152&u?this._combined[c]:l?(0,v.stringFromCodePoint)(l):"",u>>22,2097152&u?this._combined[c].charCodeAt(this._combined[c].length-1):l]}set(c,u){this._data[3*c+1]=u[d.CHAR_DATA_ATTR_INDEX],u[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=u[1],this._data[3*c+0]=2097152|c|u[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=u[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const u=this._data[3*c+0];return 2097152&u?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&u}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const u=this._data[3*c+0];return 2097152&u?this._combined[c]:2097151&u?(0,v.stringFromCodePoint)(2097151&u):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,u){return b=3*c,u.content=this._data[b+0],u.fg=this._data[b+1],u.bg=this._data[b+2],2097152&u.content&&(u.combinedData=this._combined[c]),268435456&u.bg&&(u.extended=this._extendedAttrs[c]),u}setCell(c,u){2097152&u.content&&(this._combined[c]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[c]=u.extended),this._data[3*c+0]=u.content,this._data[3*c+1]=u.fg,this._data[3*c+2]=u.bg}setCellFromCodepoint(c,u,l,f){268435456&f.bg&&(this._extendedAttrs[c]=f.extended),this._data[3*c+0]=u|l<<22,this._data[3*c+1]=f.fg,this._data[3*c+2]=f.bg}addCodepointToCell(c,u,l){let f=this._data[3*c+0];2097152&f?this._combined[c]+=(0,v.stringFromCodePoint)(u):2097151&f?(this._combined[c]=(0,v.stringFromCodePoint)(2097151&f)+(0,v.stringFromCodePoint)(u),f&=-2097152,f|=2097152):f=u|4194304,l&&(f&=-12582913,f|=l<<22),this._data[3*c+0]=f}insertCells(c,u,l){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length-c){const f=new g.CellData;for(let _=this.length-c-u-1;_>=0;--_)this.setCell(c+u+_,this.loadCell(c+_,f));for(let _=0;_<u;++_)this.setCell(c+_,l)}else for(let f=c;f<this.length;++f)this.setCell(f,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(c,u,l){if(c%=this.length,u<this.length-c){const f=new g.CellData;for(let _=0;_<this.length-c-u;++_)this.setCell(c+_,this.loadCell(c+u+_,f));for(let _=this.length-u;_<this.length;++_)this.setCell(_,l)}else for(let f=c;f<this.length;++f)this.setCell(f,l);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,l)}replaceCells(c,u,l,f=!1){if(f)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,l);c<u&&c<this.length;)this.isProtected(c)||this.setCell(c,l),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,l);c<u&&c<this.length;)this.setCell(c++,l)}resize(c,u){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const f=new Uint32Array(l);f.set(this._data),this._data=f}for(let f=this.length;f<c;++f)this.setCell(f,u)}else{this._data=this._data.subarray(0,l);const f=Object.keys(this._combined);for(let E=0;E<f.length;E++){const y=parseInt(f[E],10);y>=c&&delete this._combined[y]}const _=Object.keys(this._extendedAttrs);for(let E=0;E<_.length;E++){const y=parseInt(_[E],10);y>=c&&delete this._extendedAttrs[y]}}return this.length=c,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,u=!1){if(u)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,c);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const u in c._combined)this._combined[u]=c._combined[u];this._extendedAttrs={};for(const u in c._extendedAttrs)this._extendedAttrs[u]=c._extendedAttrs[u];this.isWrapped=c.isWrapped}clone(){const c=new C(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const u in this._combined)c._combined[u]=this._combined[u];for(const u in this._extendedAttrs)c._extendedAttrs[u]=this._extendedAttrs[u];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,u,l,f,_){const E=c._data;if(_)for(let w=f-1;w>=0;w--){for(let S=0;S<3;S++)this._data[3*(l+w)+S]=E[3*(u+w)+S];268435456&E[3*(u+w)+2]&&(this._extendedAttrs[l+w]=c._extendedAttrs[u+w])}else for(let w=0;w<f;w++){for(let S=0;S<3;S++)this._data[3*(l+w)+S]=E[3*(u+w)+S];268435456&E[3*(u+w)+2]&&(this._extendedAttrs[l+w]=c._extendedAttrs[u+w])}const y=Object.keys(c._combined);for(let w=0;w<y.length;w++){const S=parseInt(y[w],10);S>=u&&(this._combined[S-u+l]=c._combined[S])}}translateToString(c,u,l,f){u=u??0,l=l??this.length,c&&(l=Math.min(l,this.getTrimmedLength())),f&&(f.length=0);let _="";for(;u<l;){const E=this._data[3*u+0],y=2097151&E,w=2097152&E?this._combined[u]:y?(0,v.stringFromCodePoint)(y):d.WHITESPACE_CELL_CHAR;if(_+=w,f)for(let S=0;S<w.length;++S)f.push(u);u+=E>>22||1}return f&&f.push(u),_}}n.BufferLine=C},4841:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(o,a){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return a*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(p,n)=>{function o(a,g,d){if(g===a.length-1)return a[g].getTrimmedLength();const v=!a[g].hasContent(d-1)&&a[g].getWidth(d-1)===1,b=a[g+1].getWidth(0)===2;return v&&b?d-1:d}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(a,g,d,v,b){const C=[];for(let m=0;m<a.length-1;m++){let c=m,u=a.get(++c);if(!u.isWrapped)continue;const l=[a.get(m)];for(;c<a.length&&u.isWrapped;)l.push(u),u=a.get(++c);if(v>=m&&v<c){m+=l.length-1;continue}let f=0,_=o(l,f,g),E=1,y=0;for(;E<l.length;){const S=o(l,E,g),k=S-y,R=d-_,B=Math.min(k,R);l[f].copyCellsFrom(l[E],y,_,B,!1),_+=B,_===d&&(f++,_=0),y+=B,y===S&&(E++,y=0),_===0&&f!==0&&l[f-1].getWidth(d-1)===2&&(l[f].copyCellsFrom(l[f-1],d-1,_++,1,!1),l[f-1].setCell(d-1,b))}l[f].replaceCells(_,d,b);let w=0;for(let S=l.length-1;S>0&&(S>f||l[S].getTrimmedLength()===0);S--)w++;w>0&&(C.push(m+l.length-w),C.push(w)),m+=l.length-1}return C},n.reflowLargerCreateNewLayout=function(a,g){const d=[];let v=0,b=g[v],C=0;for(let m=0;m<a.length;m++)if(b===m){const c=g[++v];a.onDeleteEmitter.fire({index:m-C,amount:c}),m+=c-1,C+=c,b=g[++v]}else d.push(m);return{layout:d,countRemoved:C}},n.reflowLargerApplyNewLayout=function(a,g){const d=[];for(let v=0;v<g.length;v++)d.push(a.get(g[v]));for(let v=0;v<d.length;v++)a.set(v,d[v]);a.length=g.length},n.reflowSmallerGetNewLineLengths=function(a,g,d){const v=[],b=a.map(((u,l)=>o(a,l,g))).reduce(((u,l)=>u+l));let C=0,m=0,c=0;for(;c<b;){if(b-c<d){v.push(b-c);break}C+=d;const u=o(a,m,g);C>u&&(C-=u,m++);const l=a[m].getWidth(C-1)===2;l&&C--;const f=l?d-1:d;v.push(f),c+=f}return v},n.getWrappedLineTrimmedLength=o},5295:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const a=o(8460),g=o(844),d=o(9092);class v extends g.Disposable{constructor(C,m){super(),this._optionsService=C,this._bufferService=m,this._onBufferActivate=this.register(new a.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,m){this._normal.resize(C,m),this._alt.resize(C,m),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}n.BufferSet=v},511:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const a=o(482),g=o(643),d=o(3734);class v extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const m=new v;return m.setFromCharData(C),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(C[g.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(C[g.CHAR_DATA_CHAR_INDEX].length===2){const c=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const u=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(c-55296)+u-56320+65536|C[g.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[g.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=C[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=v},643:(p,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:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const a=o(8460),g=o(844);class d{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new a.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}n.Marker=d,d._nextId=1},7116:(p,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:(p,n)=>{var o,a,g;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
165
- `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(o||(n.C0=o={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(a||(n.C1=a={})),(function(d){d.ST=`${o.ESC}\\`})(g||(n.C1_ESCAPED=g={}))},7399:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const a=o(2584),g={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(d,v,b,C){const m={type:0,cancel:!1,key:void 0},c=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?m.key=v?a.C0.ESC+"OA":a.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?m.key=v?a.C0.ESC+"OD":a.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?m.key=v?a.C0.ESC+"OC":a.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(m.key=v?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:m.key=d.ctrlKey?"\b":a.C0.DEL,d.altKey&&(m.key=a.C0.ESC+m.key);break;case 9:if(d.shiftKey){m.key=a.C0.ESC+"[Z";break}m.key=a.C0.HT,m.cancel=!0;break;case 13:m.key=d.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,m.cancel=!0;break;case 27:m.key=a.C0.ESC,d.altKey&&(m.key=a.C0.ESC+a.C0.ESC),m.cancel=!0;break;case 37:if(d.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"D",m.key===a.C0.ESC+"[1;3D"&&(m.key=a.C0.ESC+(b?"b":"[1;5D"))):m.key=v?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(d.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"C",m.key===a.C0.ESC+"[1;3C"&&(m.key=a.C0.ESC+(b?"f":"[1;5C"))):m.key=v?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(d.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"A",b||m.key!==a.C0.ESC+"[1;3A"||(m.key=a.C0.ESC+"[1;5A")):m.key=v?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(d.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"B",b||m.key!==a.C0.ESC+"[1;3B"||(m.key=a.C0.ESC+"[1;5B")):m.key=v?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(m.key=a.C0.ESC+"[2~");break;case 46:m.key=c?a.C0.ESC+"[3;"+(c+1)+"~":a.C0.ESC+"[3~";break;case 36:m.key=c?a.C0.ESC+"[1;"+(c+1)+"H":v?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:m.key=c?a.C0.ESC+"[1;"+(c+1)+"F":v?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:d.shiftKey?m.type=2:d.ctrlKey?m.key=a.C0.ESC+"[5;"+(c+1)+"~":m.key=a.C0.ESC+"[5~";break;case 34:d.shiftKey?m.type=3:d.ctrlKey?m.key=a.C0.ESC+"[6;"+(c+1)+"~":m.key=a.C0.ESC+"[6~";break;case 112:m.key=c?a.C0.ESC+"[1;"+(c+1)+"P":a.C0.ESC+"OP";break;case 113:m.key=c?a.C0.ESC+"[1;"+(c+1)+"Q":a.C0.ESC+"OQ";break;case 114:m.key=c?a.C0.ESC+"[1;"+(c+1)+"R":a.C0.ESC+"OR";break;case 115:m.key=c?a.C0.ESC+"[1;"+(c+1)+"S":a.C0.ESC+"OS";break;case 116:m.key=c?a.C0.ESC+"[15;"+(c+1)+"~":a.C0.ESC+"[15~";break;case 117:m.key=c?a.C0.ESC+"[17;"+(c+1)+"~":a.C0.ESC+"[17~";break;case 118:m.key=c?a.C0.ESC+"[18;"+(c+1)+"~":a.C0.ESC+"[18~";break;case 119:m.key=c?a.C0.ESC+"[19;"+(c+1)+"~":a.C0.ESC+"[19~";break;case 120:m.key=c?a.C0.ESC+"[20;"+(c+1)+"~":a.C0.ESC+"[20~";break;case 121:m.key=c?a.C0.ESC+"[21;"+(c+1)+"~":a.C0.ESC+"[21~";break;case 122:m.key=c?a.C0.ESC+"[23;"+(c+1)+"~":a.C0.ESC+"[23~";break;case 123:m.key=c?a.C0.ESC+"[24;"+(c+1)+"~":a.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(b&&!C||!d.altKey||d.metaKey)!b||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?m.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(m.key=a.C0.US),d.key==="@"&&(m.key=a.C0.NUL)):d.keyCode===65&&(m.type=1);else{const u=g[d.keyCode],l=u==null?void 0:u[d.shiftKey?1:0];if(l)m.key=a.C0.ESC+l;else if(d.keyCode>=65&&d.keyCode<=90){const f=d.ctrlKey?d.keyCode-64:d.keyCode+32;let _=String.fromCharCode(f);d.shiftKey&&(_=_.toUpperCase()),m.key=a.C0.ESC+_}else if(d.keyCode===32)m.key=a.C0.ESC+(d.ctrlKey?a.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let f=d.code.slice(3,4);d.shiftKey||(f=f.toLowerCase()),m.key=a.C0.ESC+f,m.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?m.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?m.key=a.C0.NUL:d.keyCode>=51&&d.keyCode<=55?m.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?m.key=a.C0.DEL:d.keyCode===219?m.key=a.C0.ESC:d.keyCode===220?m.key=a.C0.FS:d.keyCode===221&&(m.key=a.C0.GS)}return m}},482:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},n.utf32ToString=function(o,a=0,g=o.length){let d="";for(let v=a;v<g;++v){let b=o[v];b>65535?(b-=65536,d+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):d+=String.fromCharCode(b)}return d},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,a){const g=o.length;if(!g)return 0;let d=0,v=0;if(this._interim){const b=o.charCodeAt(v++);56320<=b&&b<=57343?a[d++]=1024*(this._interim-55296)+b-56320+65536:(a[d++]=this._interim,a[d++]=b),this._interim=0}for(let b=v;b<g;++b){const C=o.charCodeAt(b);if(55296<=C&&C<=56319){if(++b>=g)return this._interim=C,d;const m=o.charCodeAt(b);56320<=m&&m<=57343?a[d++]=1024*(C-55296)+m-56320+65536:(a[d++]=C,a[d++]=m)}else C!==65279&&(a[d++]=C)}return d}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,a){const g=o.length;if(!g)return 0;let d,v,b,C,m=0,c=0,u=0;if(this.interim[0]){let _=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let y,w=0;for(;(y=63&this.interim[++w])&&w<4;)E<<=6,E|=y;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-w;for(;u<k;){if(u>=g)return 0;if(y=o[u++],(192&y)!=128){u--,_=!0;break}this.interim[w++]=y,E<<=6,E|=63&y}_||(S===2?E<128?u--:a[m++]=E:S===3?E<2048||E>=55296&&E<=57343||E===65279||(a[m++]=E):E<65536||E>1114111||(a[m++]=E)),this.interim.fill(0)}const l=g-4;let f=u;for(;f<g;){for(;!(!(f<l)||128&(d=o[f])||128&(v=o[f+1])||128&(b=o[f+2])||128&(C=o[f+3]));)a[m++]=d,a[m++]=v,a[m++]=b,a[m++]=C,f+=4;if(d=o[f++],d<128)a[m++]=d;else if((224&d)==192){if(f>=g)return this.interim[0]=d,m;if(v=o[f++],(192&v)!=128){f--;continue}if(c=(31&d)<<6|63&v,c<128){f--;continue}a[m++]=c}else if((240&d)==224){if(f>=g)return this.interim[0]=d,m;if(v=o[f++],(192&v)!=128){f--;continue}if(f>=g)return this.interim[0]=d,this.interim[1]=v,m;if(b=o[f++],(192&b)!=128){f--;continue}if(c=(15&d)<<12|(63&v)<<6|63&b,c<2048||c>=55296&&c<=57343||c===65279)continue;a[m++]=c}else if((248&d)==240){if(f>=g)return this.interim[0]=d,m;if(v=o[f++],(192&v)!=128){f--;continue}if(f>=g)return this.interim[0]=d,this.interim[1]=v,m;if(b=o[f++],(192&b)!=128){f--;continue}if(f>=g)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=b,m;if(C=o[f++],(192&C)!=128){f--;continue}if(c=(7&d)<<18|(63&v)<<12|(63&b)<<6|63&C,c<65536||c>1114111)continue;a[m++]=c}}return m}}},225:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const a=o(1480),g=[[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]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;n.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let b=0;b<g.length;++b)v.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?v[b]:(function(C,m){let c,u=0,l=m.length-1;if(C<m[0][0]||C>m[l][1])return!1;for(;l>=u;)if(c=u+l>>1,C>m[c][1])u=c+1;else{if(!(C<m[c][0]))return!0;l=c-1}return!1})(b,d)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,C){let m=this.wcwidth(b),c=m===0&&C!==0;if(c){const u=a.UnicodeService.extractWidth(C);u===0?c=!1:u>m&&(m=u)}return a.UnicodeService.createPropertyValue(0,m,c)}}},5981:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const a=o(8460),g=o(844);class d extends g.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,C){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C)}_innerWrite(b=0,C=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],u=this._action(c,C);if(u){const f=_=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(m,_);return void u.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(f)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=c.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=d},5941:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const o=/^([\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})$/,a=/^[\da-f]+$/;function g(d,v){const b=d.toString(16),C=b.length<2?"0"+b:b;switch(v){case 4:return b[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}n.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const b=o.exec(v);if(b){const C=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/C*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/C*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),a.exec(v)&&[3,6,9,12].includes(v.length))){const b=v.length/3,C=[0,0,0];for(let m=0;m<3;++m){const c=parseInt(v.slice(b*m,b*m+b),16);C[m]=b===1?c<<4:b===2?c:b===3?c>>4:c>>8}return C}},n.toRgbString=function(d,v=16){const[b,C,m]=d;return`rgb:${g(b,v)}/${g(C,v)}/${g(m,v)}`}},5770:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const a=o(482),g=o(8742),d=o(5770),v=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,m){this._handlers[C]===void 0&&(this._handlers[C]=[]);const c=this._handlers[C];return c.push(m),{dispose:()=>{const u=c.indexOf(m);u!==-1&&c.splice(u,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,m){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(C,m,c){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(C,m,c);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(C,m,c))}unhook(C,m=!0){if(this._active.length){let c=!1,u=this._active.length-1,l=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,c=m,l=this._stack.fallThrough,this._stack.paused=!1),!l&&c===!1){for(;u>=0&&(c=this._active[u].unhook(C),c!==!0);u--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,c;u--}for(;u>=0;u--)if(c=this._active[u].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const b=new g.Params;b.addParam(0),n.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=b,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():b,this._data="",this._hitLimit=!1}put(C,m,c){this._hitLimit||(this._data+=(0,a.utf32ToString)(C,m,c),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let m=!1;if(this._hitLimit)m=!1;else if(C&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((c=>(this._params=b,this._data="",this._hitLimit=!1,c)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const a=o(844),g=o(8742),d=o(6242),v=o(6351);class b{constructor(u){this.table=new Uint8Array(u)}setDefault(u,l){this.table.fill(u<<4|l)}add(u,l,f,_){this.table[l<<8|u]=f<<4|_}addMany(u,l,f,_){for(let E=0;E<u.length;E++)this.table[l<<8|u[E]]=f<<4|_}}n.TransitionTable=b;const C=160;n.VT500_TRANSITION_TABLE=(function(){const c=new b(4095),u=Array.apply(null,Array(256)).map(((w,S)=>S)),l=(w,S)=>u.slice(w,S),f=l(32,127),_=l(0,24);_.push(25),_.push.apply(_,l(28,32));const E=l(0,14);let y;for(y in c.setDefault(1,0),c.addMany(f,0,2,0),E)c.addMany([24,26,153,154],y,3,0),c.addMany(l(128,144),y,3,0),c.addMany(l(144,152),y,3,0),c.add(156,y,0,0),c.add(27,y,11,1),c.add(157,y,4,8),c.addMany([152,158,159],y,0,7),c.add(155,y,11,3),c.add(144,y,11,9);return c.addMany(_,0,3,0),c.addMany(_,1,3,1),c.add(127,1,0,1),c.addMany(_,8,0,8),c.addMany(_,3,3,3),c.add(127,3,0,3),c.addMany(_,4,3,4),c.add(127,4,0,4),c.addMany(_,6,3,6),c.addMany(_,5,3,5),c.add(127,5,0,5),c.addMany(_,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(f,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(l(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(f,7,0,7),c.addMany(_,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(l(64,127),3,7,0),c.addMany(l(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(l(48,60),4,8,4),c.addMany(l(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(l(32,64),6,0,6),c.add(127,6,0,6),c.addMany(l(64,127),6,0,0),c.addMany(l(32,48),3,9,5),c.addMany(l(32,48),5,9,5),c.addMany(l(48,64),5,0,6),c.addMany(l(64,127),5,7,0),c.addMany(l(32,48),4,9,5),c.addMany(l(32,48),1,9,2),c.addMany(l(32,48),2,9,2),c.addMany(l(48,127),2,10,0),c.addMany(l(48,80),1,10,0),c.addMany(l(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(l(96,127),1,10,0),c.add(80,1,11,9),c.addMany(_,9,0,9),c.add(127,9,0,9),c.addMany(l(28,32),9,0,9),c.addMany(l(32,48),9,9,12),c.addMany(l(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(_,11,0,11),c.addMany(l(32,128),11,0,11),c.addMany(l(28,32),11,0,11),c.addMany(_,10,0,10),c.add(127,10,0,10),c.addMany(l(28,32),10,0,10),c.addMany(l(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(l(32,48),10,9,12),c.addMany(_,12,0,12),c.add(127,12,0,12),c.addMany(l(28,32),12,0,12),c.addMany(l(32,48),12,9,12),c.addMany(l(48,64),12,0,11),c.addMany(l(64,127),12,12,13),c.addMany(l(64,127),10,12,13),c.addMany(l(64,127),9,12,13),c.addMany(_,13,13,13),c.addMany(f,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(C,0,2,0),c.add(C,8,5,8),c.add(C,6,0,6),c.add(C,11,0,11),c.add(C,13,13,13),c})();class m extends a.Disposable{constructor(u=n.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,f,_)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,f)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,a.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,l=[64,126]){let f=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=u.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<u.intermediates.length;++E){const y=u.intermediates.charCodeAt(E);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=y}}if(u.final.length!==1)throw new Error("final must be a single byte");const _=u.final.charCodeAt(0);if(l[0]>_||_>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return f<<=8,f|=_,f}identToString(u){const l=[];for(;u;)l.push(String.fromCharCode(255&u)),u>>=8;return l.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,l){const f=this._identifier(u,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const _=this._escHandlers[f];return _.push(l),{dispose:()=>{const E=_.indexOf(l);E!==-1&&_.splice(E,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,l){this._executeHandlers[u.charCodeAt(0)]=l}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,l){const f=this._identifier(u);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const _=this._csiHandlers[f];return _.push(l),{dispose:()=>{const E=_.indexOf(l);E!==-1&&_.splice(E,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,l){return this._dcsParser.registerHandler(this._identifier(u),l)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,l){return this._oscParser.registerHandler(u,l)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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(u,l,f,_,E){this._parseStack.state=u,this._parseStack.handlers=l,this._parseStack.handlerPos=f,this._parseStack.transition=_,this._parseStack.chunkPos=E}parse(u,l,f){let _,E=0,y=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&k>-1){for(;k>=0&&(_=S[k](this._params),_!==!0);k--)if(_ instanceof Promise)return this._parseStack.handlerPos=k,_}this._parseStack.handlers=[];break;case 4:if(f===!1&&k>-1){for(;k>=0&&(_=S[k](),_!==!0);k--)if(_ instanceof Promise)return this._parseStack.handlerPos=k,_}this._parseStack.handlers=[];break;case 6:if(E=u[this._parseStack.chunkPos],_=this._dcsParser.unhook(E!==24&&E!==26,f),_)return _;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=u[this._parseStack.chunkPos],_=this._oscParser.end(E!==24&&E!==26,f),_)return _;E===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 S=w;S<l;++S){switch(E=u[S],y=this._transitions.table[this.currentState<<8|(E<160?E:C)],y>>4){case 2:for(let T=S+1;;++T){if(T>=l||(E=u[T])<32||E>126&&E<C){this._printHandler(u,S,T),S=T-1;break}if(++T>=l||(E=u[T])<32||E>126&&E<C){this._printHandler(u,S,T),S=T-1;break}if(++T>=l||(E=u[T])<32||E>126&&E<C){this._printHandler(u,S,T),S=T-1;break}if(++T>=l||(E=u[T])<32||E>126&&E<C){this._printHandler(u,S,T),S=T-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|E];let R=k?k.length-1:-1;for(;R>=0&&(_=k[R](this._params),_!==!0);R--)if(_ instanceof Promise)return this._preserveStack(3,k,R,y,S),_;R<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++S<l&&(E=u[S])>47&&E<60);S--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let L=B?B.length-1:-1;for(;L>=0&&(_=B[L](),_!==!0);L--)if(_ instanceof Promise)return this._preserveStack(4,B,L,y,S),_;L<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let T=S+1;;++T)if(T>=l||(E=u[T])===24||E===26||E===27||E>127&&E<C){this._dcsParser.put(u,S,T),S=T-1;break}break;case 14:if(_=this._dcsParser.unhook(E!==24&&E!==26),_)return this._preserveStack(6,[],0,y,S),_;E===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let T=S+1;;T++)if(T>=l||(E=u[T])<32||E>127&&E<C){this._oscParser.put(u,S,T),S=T-1;break}break;case 6:if(_=this._oscParser.end(E!==24&&E!==26),_)return this._preserveStack(5,[],0,y,S),_;E===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}n.EscapeSequenceParser=m},6242:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const a=o(5770),g=o(482),d=[];n.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,b){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(b),{dispose:()=>{const m=C.indexOf(b);m!==-1&&C.splice(m,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,b,C){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(v,b,C);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,b,C))}start(){this.reset(),this._state=1}put(v,b,C){if(this._state!==3){if(this._state===1)for(;b<C;){const m=v[b++];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&&C-b>0&&this._put(v,b,C)}}end(v,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,m=this._active.length-1,c=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,C=b,c=this._stack.fallThrough,this._stack.paused=!1),!c&&C===!1){for(;m>=0&&(C=this._active[m].end(v),C!==!0);m--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,C;m--}for(;m>=0;m--)if(C=this._active[m].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,b,C){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,b,C),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let b=!1;if(this._hitLimit)b=!1;else if(v&&(b=this._handler(this._data),b instanceof Promise))return b.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,b}}},8742:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const o=2147483647;class a{static fromArray(d){const v=new a;if(!d.length)return v;for(let b=Array.isArray(d[0])?1:0;b<d.length;++b){const C=d[b];if(Array.isArray(C))for(let m=0;m<C.length;++m)v.addSubParam(C[m]);else v.addParam(C)}return v}constructor(d=32,v=32){if(this.maxLength=d,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new a(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v<this.length;++v){d.push(this.params[v]);const b=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-b>0&&d.push(Array.prototype.slice.call(this._subParams,b,C))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>o?o:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>o?o:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,b=255&this._subParamsIdx[d];return b-v>0?this._subParams.subarray(v,b):null}getSubParamsAll(){const d={};for(let v=0;v<this.length;++v){const b=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-b>0&&(d[v]=this._subParams.slice(b,C))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,C=b[v-1];b[v-1]=~C?Math.min(10*C+d,o):d}}n.Params=a},5741:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,a){const g={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(g),a.dispose=()=>this._wrappedAddonDispose(g),a.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let a=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===o){a=g;break}if(a===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(a,1)}}},8771:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const a=o(3785),g=o(511);n.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,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(d){const v=this._buffer.lines.get(d);if(v)return new a.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const a=o(511);n.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new a.CellData)}translateToString(g,d,v){return this._line.translateToString(g,d,v)}}},8285:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const a=o(8771),g=o(8460),d=o(844);class v extends d.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new a.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new a.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=v},7975:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,a){return this._core.registerCsiHandler(o,(g=>a(g.toArray())))}addCsiHandler(o,a){return this.registerCsiHandler(o,a)}registerDcsHandler(o,a){return this._core.registerDcsHandler(o,((g,d)=>a(g,d.toArray())))}addDcsHandler(o,a){return this.registerDcsHandler(o,a)}registerEscHandler(o,a){return this._core.registerEscHandler(o,a)}addEscHandler(o,a){return this.registerEscHandler(o,a)}registerOscHandler(o,a){return this._core.registerOscHandler(o,a)}addOscHandler(o,a){return this.registerOscHandler(o,a)}}},7090:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(p,n,o){var a=this&&this.__decorate||function(c,u,l,f){var _,E=arguments.length,y=E<3?u:f===null?f=Object.getOwnPropertyDescriptor(u,l):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,l,f);else for(var w=c.length-1;w>=0;w--)(_=c[w])&&(y=(E<3?_(y):E>3?_(u,l,y):_(u,l))||y);return E>3&&y&&Object.defineProperty(u,l,y),y},g=this&&this.__param||function(c,u){return function(l,f){u(l,f,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const d=o(8460),v=o(844),b=o(5295),C=o(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let m=n.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(c,this))}resize(c,u){this.cols=c,this.rows=u,this.buffers.resize(c,u),this._onResize.fire({cols:c,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,u=!1){const l=this.buffer;let f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===c.fg&&f.getBg(0)===c.bg||(f=l.getBlankLine(c,u),this._cachedBlankLine=f),f.isWrapped=u;const _=l.ybase+l.scrollTop,E=l.ybase+l.scrollBottom;if(l.scrollTop===0){const y=l.lines.isFull;E===l.lines.length-1?y?l.lines.recycle().copyFrom(f):l.lines.push(f.clone()):l.lines.splice(E+1,0,f.clone()),y?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const y=E-_+1;l.lines.shiftElements(_+1,y-1,-1),l.lines.set(E,f.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(c,u,l){const f=this.buffer;if(c<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else c+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);const _=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+c,f.ybase),0),_!==f.ydisp&&(u||this._onScroll.fire(f.ydisp))}};n.BufferService=m=a([g(0,C.IOptionsService)],m)},7994:(p,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(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,a){this._charsets[o]=a,this.glevel===o&&(this.charset=a)}}},1753:function(p,n,o){var a=this&&this.__decorate||function(f,_,E,y){var w,S=arguments.length,k=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,y);else for(var R=f.length-1;R>=0;R--)(w=f[R])&&(k=(S<3?w(k):S>3?w(_,E,k):w(_,E))||k);return S>3&&k&&Object.defineProperty(_,E,k),k},g=this&&this.__param||function(f,_){return function(E,y){_(E,y,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const d=o(2585),v=o(8460),b=o(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function m(f,_){let E=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(E|=64,E|=f.action):(E|=3&f.button,4&f.button&&(E|=64),8&f.button&&(E|=128),f.action===32?E|=32:f.action!==0||_||(E|=3)),E}const c=String.fromCharCode,u={DEFAULT:f=>{const _=[m(f,!1)+32,f.col+32,f.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${c(_[0])}${c(_[1])}${c(_[2])}`},SGR:f=>{const _=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${m(f,!0)};${f.col};${f.row}${_}`},SGR_PIXELS:f=>{const _=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${m(f,!0)};${f.x};${f.y}${_}`}};let l=n.CoreMouseService=class extends b.Disposable{constructor(f,_){super(),this._bufferService=f,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(C))this.addProtocol(E,C[E]);for(const E of Object.keys(u))this.addEncoding(E,u[E]);this.reset()}addProtocol(f,_){this._protocols[f]=_}addEncoding(f,_){this._encodings[f]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;const _=this._encodings[this._activeEncoding](f);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,_,E){if(E){if(f.x!==_.x||f.y!==_.y)return!1}else if(f.col!==_.col||f.row!==_.row)return!1;return f.button===_.button&&f.action===_.action&&f.ctrl===_.ctrl&&f.alt===_.alt&&f.shift===_.shift}};n.CoreMouseService=l=a([g(0,d.IBufferService),g(1,d.ICoreService)],l)},6975:function(p,n,o){var a=this&&this.__decorate||function(l,f,_,E){var y,w=arguments.length,S=w<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,f,_,E);else for(var k=l.length-1;k>=0;k--)(y=l[k])&&(S=(w<3?y(S):w>3?y(f,_,S):y(f,_))||S);return w>3&&S&&Object.defineProperty(f,_,S),S},g=this&&this.__param||function(l,f){return function(_,E){f(_,E,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const d=o(1439),v=o(8460),b=o(844),C=o(2585),m=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=n.CoreService=class extends b.Disposable{constructor(l,f,_){super(),this._bufferService=l,this._logService=f,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(m),this.decPrivateModes=(0,d.clone)(c)}reset(){this.modes=(0,d.clone)(m),this.decPrivateModes=(0,d.clone)(c)}triggerDataEvent(l,f=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((f=>f.charCodeAt(0))))),this._onBinary.fire(l))}};n.CoreService=u=a([g(0,C.IBufferService),g(1,C.ILogService),g(2,C.IOptionsService)],u)},9074:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const a=o(8055),g=o(8460),d=o(844),v=o(6106);let b=0,C=0;class m extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((l=>l==null?void 0:l.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const f=new c(l);if(f){const _=f.marker.onDispose((()=>f.dispose()));f.onDispose((()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),_.dispose())})),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,f,_){let E=0,y=0;for(const w of this._decorations.getKeyIterator(f))E=w.options.x??0,y=E+(w.options.width??1),l>=E&&l<y&&(!_||(w.options.layer??"bottom")===_)&&(yield w)}forEachDecorationAtCell(l,f,_,E){this._decorations.forEachByKey(f,(y=>{b=y.options.x??0,C=b+(y.options.width??1),l>=b&&l<C&&(!_||(y.options.layer??"bottom")===_)&&E(y)}))}}n.DecorationService=m;class c extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=a.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=a.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const a=o(2585),g=o(8343);class d{constructor(...b){this._entries=new Map;for(const[C,m]of b)this.set(C,m)}set(b,C){const m=this._entries.get(b);return this._entries.set(b,C),m}forEach(b){for(const[C,m]of this._entries.entries())b(C,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}n.ServiceCollection=d,n.InstantiationService=class{constructor(){this._services=new d,this._services.set(a.IInstantiationService,this)}setService(v,b){this._services.set(v,b)}getService(v){return this._services.get(v)}createInstance(v,...b){const C=(0,g.getServiceDependencies)(v).sort(((u,l)=>u.index-l.index)),m=[];for(const u of C){const l=this._services.get(u.id);if(!l)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${u.id}.`);m.push(l)}const c=C.length>0?C[0].index:b.length;if(b.length!==c)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${c+1} conflicts with ${b.length} static arguments`);return new v(...b,...m)}}},7866:function(p,n,o){var a=this&&this.__decorate||function(c,u,l,f){var _,E=arguments.length,y=E<3?u:f===null?f=Object.getOwnPropertyDescriptor(u,l):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,l,f);else for(var w=c.length-1;w>=0;w--)(_=c[w])&&(y=(E<3?_(y):E>3?_(u,l,y):_(u,l))||y);return E>3&&y&&Object.defineProperty(u,l,y),y},g=this&&this.__param||function(c,u){return function(l,f){u(l,f,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const d=o(844),v=o(2585),b={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,m=n.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let u=0;u<c.length;u++)typeof c[u]=="function"&&(c[u]=c[u]())}_log(c,u,l){this._evalLazyOptionalParams(l),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...l)}trace(c,...u){var l;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,c,u)}debug(c,...u){var l;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,c,u)}info(c,...u){var l;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,c,u)}warn(c,...u){var l;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,c,u)}error(c,...u){var l;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,c,u)}};n.LogService=m=a([g(0,v.IOptionsService)],m),n.setTraceLogger=function(c){C=c},n.traceCall=function(c,u,l){if(typeof l.value!="function")throw new Error("not supported");const f=l.value;l.value=function(..._){if(C.logLevel!==v.LogLevelEnum.TRACE)return f.apply(this,_);C.trace(`GlyphRenderer#${f.name}(${_.map((y=>JSON.stringify(y))).join(", ")})`);const E=f.apply(this,_);return C.trace(`GlyphRenderer#${f.name} return`,E),E}}},7302:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const a=o(8460),g=o(844),d=o(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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends g.Disposable{constructor(m){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...n.DEFAULT_OPTIONS};for(const u in m)if(u in c)try{const l=m[u];c[u]=this._sanitizeAndValidateOption(u,l)}catch(l){console.error(l)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,c){return this.onOptionChange((u=>{u===m&&c(this.rawOptions[m])}))}onMultipleOptionChange(m,c){return this.onOptionChange((u=>{m.indexOf(u)!==-1&&c()}))}_setupOptions(){const m=u=>{if(!(u in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},c=(u,l)=>{if(!(u in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);l=this._sanitizeAndValidateOption(u,l),this.rawOptions[u]!==l&&(this.rawOptions[u]=l,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const l={get:m.bind(this,u),set:c.bind(this,u)};Object.defineProperty(this.options,u,l)}}_sanitizeAndValidateOption(m,c){switch(m){case"cursorStyle":if(c||(c=n.DEFAULT_OPTIONS[m]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(c))throw new Error(`"${c}" is not a valid value for ${m}`);break;case"wordSeparator":c||(c=n.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=v.includes(c)?c:n.DEFAULT_OPTIONS[m];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${m} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${m} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}n.OptionsService=b},2660:function(p,n,o){var a=this&&this.__decorate||function(b,C,m,c){var u,l=arguments.length,f=l<3?C:c===null?c=Object.getOwnPropertyDescriptor(C,m):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(b,C,m,c);else for(var _=b.length-1;_>=0;_--)(u=b[_])&&(f=(l<3?u(f):l>3?u(C,m,f):u(C,m))||f);return l>3&&f&&Object.defineProperty(C,m,f),f},g=this&&this.__param||function(b,C){return function(m,c){C(m,c,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const d=o(2585);let v=n.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const C=this._bufferService.buffer;if(b.id===void 0){const _=C.addMarker(C.ybase+C.y),E={data:b,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(E,_))),this._dataByLinkId.set(E.id,E),E.id}const m=b,c=this._getEntryIdKey(m),u=this._entriesWithId.get(c);if(u)return this.addLineToLink(u.id,C.ybase+C.y),u.id;const l=C.addMarker(C.ybase+C.y),f={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(f,l))),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(b,C){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((c=>c.line!==C))){const c=this._bufferService.buffer.addMarker(C);m.lines.push(c),c.onDispose((()=>this._removeMarkerFromLink(m,c)))}}getLinkData(b){var C;return(C=this._dataByLinkId.get(b))==null?void 0:C.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,C){const m=b.lines.indexOf(C);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};n.OscLinkService=v=a([g(0,d.IBufferService)],v)},8343:(p,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const o="di$target",a="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(g){return g[a]||[]},n.createDecorator=function(g){if(n.serviceRegistry.has(g))return n.serviceRegistry.get(g);const d=function(v,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,c,u){c[o]===c?c[a].push({id:m,index:u}):(c[a]=[{id:m,index:u}],c[o]=c)})(d,v,C)};return d.toString=()=>g,n.serviceRegistry.set(g,d),d}},2585:(p,n,o)=>{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 a=o(8343);var g;n.IBufferService=(0,a.createDecorator)("BufferService"),n.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),n.ICoreService=(0,a.createDecorator)("CoreService"),n.ICharsetService=(0,a.createDecorator)("CharsetService"),n.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(g||(n.LogLevelEnum=g={})),n.ILogService=(0,a.createDecorator)("LogService"),n.IOptionsService=(0,a.createDecorator)("OptionsService"),n.IOscLinkService=(0,a.createDecorator)("OscLinkService"),n.IUnicodeService=(0,a.createDecorator)("UnicodeService"),n.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(p,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const a=o(8460),g=o(225);class d{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,C,m=!1){return(16777215&b)<<3|(3&C)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let C=0,m=0;const c=b.length;for(let u=0;u<c;++u){let l=b.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=c)return C+this.wcwidth(l);const E=b.charCodeAt(u);56320<=E&&E<=57343?l=1024*(l-55296)+E-56320+65536:C+=this.wcwidth(E)}const f=this.charProperties(l,m);let _=d.extractWidth(f);d.extractShouldJoin(f)&&(_-=d.extractWidth(m)),C+=_,m=f}return C}charProperties(b,C){return this._activeProvider.charProperties(b,C)}}n.UnicodeService=d}},i={};function s(p){var n=i[p];if(n!==void 0)return n.exports;var o=i[p]={exports:{}};return r[p].call(o.exports,o,o.exports,s),o.exports}var h={};return(()=>{var p=h;Object.defineProperty(p,"__esModule",{value:!0}),p.Terminal=void 0;const n=s(9042),o=s(3236),a=s(844),g=s(5741),d=s(8285),v=s(7975),b=s(7090),C=["cols","rows"];class m extends a.Disposable{constructor(u){super(),this._core=this.register(new o.Terminal(u)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const l=_=>this._core.options[_],f=(_,E)=>{this._checkReadonlyOptions(_),this._core.options[_]=E};for(const _ in this._core.options){const E={get:l.bind(this,_),set:f.bind(this,_)};Object.defineProperty(this._publicOptions,_,E)}}_checkReadonlyOptions(u){if(C.includes(u))throw new Error(`Option "${u}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,l=!0){this._core.input(u,l)}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,f){this._verifyIntegers(u,l,f),this._core.select(u,l,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
166
- `,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return n}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}p.Terminal=m})(),h})()))})(Vs)),Vs.exports}var Gu=Zu();/**
164
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),T=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(T&&R&&k)&&this._areCoordsInSelection(k,T,R)}isCellInSelection(S,k){const T=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!T||!R)&&this._areCoordsInSelection([S,k],T,R)}_areCoordsInSelection(S,k,T){return S[1]>k[1]&&S[1]<T[1]||k[1]===T[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<T[0]||k[1]<T[1]&&S[1]===T[1]&&S[0]<T[0]||k[1]<T[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var T,R;const L=(R=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:R.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,u.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const N=this._getMouseBufferCoords(S);return!!N&&(this._selectWordAt(N,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=T?0:(k>T&&(k-=T),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return h.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!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(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.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(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const R=T.lines.get(this._model.selectionEnd[1]);R&&R.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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const R=(0,m.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,T=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);T?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,T)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,T)}_fireOnSelectionChange(S,k,T){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(S,k){let T=k;for(let R=0;k>=R;R++){const L=S.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:L>1&&k!==R&&(T+=L-1)}return T}setSelection(S,k,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,T=!0,R=!0){if(S[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,N=L.lines.get(S[1]);if(!N)return;const U=L.translateBufferLineToString(S[1],!1);let P=this._convertViewportColToCharacterIndex(N,S[0]),H=P;const J=S[0]-P;let G=0,I=0,B=0,x=0;if(U.charAt(P)===" "){for(;P>0&&U.charAt(P-1)===" ";)P--;for(;H<U.length&&U.charAt(H+1)===" ";)H++}else{let K=S[0],z=S[0];N.getWidth(K)===0&&(G++,K--),N.getWidth(z)===2&&(I++,z++);const Q=N.getString(z).length;for(Q>1&&(x+=Q-1,H+=Q-1);K>0&&P>0&&!this._isCharWordSeparator(N.loadCell(K-1,this._workCell));){N.loadCell(K-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,K--):O>1&&(B+=O-1,P-=O-1),P--,K--}for(;z<N.length&&H+1<U.length&&!this._isCharWordSeparator(N.loadCell(z+1,this._workCell));){N.loadCell(z+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,z++):O>1&&(x+=O-1,H+=O-1),H++,z++}}H++;let D=P+J-G+B,W=Math.min(this._bufferService.cols,H-P+G+I-B-x);if(k||U.slice(P,H).trim()!==""){if(T&&D===0&&N.getCodePoint(0)!==32){const K=L.lines.get(S[1]-1);if(K&&N.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const z=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(z){const Q=this._bufferService.cols-z.start;D-=Q,W+=Q}}}if(R&&D+W===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const K=L.lines.get(S[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const z=this._getWordAt([0,S[1]+1],!1,!1,!0);z&&(W+=z.length)}}return{start:D,length:W}}}_selectWordAt(S,k){const T=this._getWordAt(S,k);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[T.start,S[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let T=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,T]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),T={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,u.getRangeLength)(T,this._bufferService.cols)}};s.SelectionService=C=c([g(3,b.IBufferService),g(4,b.ICoreService),g(5,w.IMouseService),g(6,b.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],C)},4725:(d,s,o)=>{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 c=o(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(d,s,o){var c=this&&this.__decorate||function(C,S,k,T){var R,L=arguments.length,N=L<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(C,S,k,T);else for(var U=C.length-1;U>=0;U--)(R=C[U])&&(N=(L<3?R(N):L>3?R(S,k,N):R(S,k))||N);return L>3&&N&&Object.defineProperty(S,k,N),N},g=this&&this.__param||function(C,S){return function(k,T){S(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=o(7239),m=o(8055),_=o(8460),w=o(844),v=o(2585),l=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),u=m.css.toColor("#ffffff"),p=m.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=S[k/36%6|0],R=S[k/6%6|0],L=S[k%6];C.push({css:m.channels.toCss(T,R,L),rgba:m.channels.toRgba(T,R,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:m.channels.toCss(T,T,T),rgba:m.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:h,cursor:u,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:m.color.blend(h,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:m.color.blend(h,b),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(C={}){const S=this._colors;if(S.foreground=y(C.foreground,l),S.background=y(C.background,h),S.cursor=y(C.cursor,u),S.cursorAccent=y(C.cursorAccent,p),S.selectionBackgroundTransparent=y(C.selectionBackground,b),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=y(C.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=C.selectionForeground?y(C.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=s.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=y(C.black,s.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=y(C.red,s.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=y(C.green,s.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=y(C.yellow,s.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=y(C.blue,s.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=y(C.magenta,s.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=y(C.cyan,s.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=y(C.white,s.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=y(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=y(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=y(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=y(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=y(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=y(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=y(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=y(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(S.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)S.ansi[T+16]=y(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[C]=this._restoreColors.ansi[C]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(C){C(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(C,S){if(C!==void 0)try{return m.css.toColor(C)}catch{}return S}s.ThemeService=E=c([g(0,v.IOptionsService)],E)},6349:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=o(8460),g=o(844);class f extends g.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const w=new Array(_);for(let v=0;v<Math.min(_,this.length);v++)w[v]=this._array[this._getCyclicIndex(v)];this._array=w,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let w=this._length;w<_;w++)this._array[w]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,w){this._array[this._getCyclicIndex(_)]=w}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,w,...v){if(w){for(let l=_;l<this._length-w;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+w)];this._length-=w,this.onDeleteEmitter.fire({index:_,amount:w})}for(let l=this._length-1;l>=_;l--)this._array[this._getCyclicIndex(l+v.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<v.length;l++)this._array[this._getCyclicIndex(_+l)]=v[l];if(v.length&&this.onInsertEmitter.fire({index:_,amount:v.length}),this._length+v.length>this._maxLength){const l=this._length+v.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=v.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,w,v){if(!(w<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let h=w-1;h>=0;h--)this.set(_+h+v,this.get(_+h));const l=_+w+v-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<w;l++)this.set(_+l+v,this.get(_+l))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=f},1439:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(c,g=5){if(typeof c!="object")return c;const f=Array.isArray(c)?[]:{};for(const m in c)f[m]=g<=1?c[m]:c[m]&&o(c[m],g-1);return f}},8055:(d,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 o=0,c=0,g=0,f=0;var m,_,w,v,l;function h(p){const b=p.toString(16);return b.length<2?"0"+b:b}function u(p,b){return p<b?(b+.05)/(p+.05):(p+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(b,E,y,C){return C!==void 0?`#${h(b)}${h(E)}${h(y)}${h(C)}`:`#${h(b)}${h(E)}${h(y)}`},p.toRgba=function(b,E,y,C=255){return(b<<24|E<<16|y<<8|C)>>>0},p.toColor=function(b,E,y,C){return{css:p.toCss(b,E,y,C),rgba:p.toRgba(b,E,y,C)}}})(m||(s.channels=m={})),(function(p){function b(E,y){return f=Math.round(255*y),[o,c,g]=l.toChannels(E.rgba),{css:m.toCss(o,c,g,f),rgba:m.toRgba(o,c,g,f)}}p.blend=function(E,y){if(f=(255&y.rgba)/255,f===1)return{css:y.css,rgba:y.rgba};const C=y.rgba>>24&255,S=y.rgba>>16&255,k=y.rgba>>8&255,T=E.rgba>>24&255,R=E.rgba>>16&255,L=E.rgba>>8&255;return o=T+Math.round((C-T)*f),c=R+Math.round((S-R)*f),g=L+Math.round((k-L)*f),{css:m.toCss(o,c,g),rgba:m.toRgba(o,c,g)}},p.isOpaque=function(E){return(255&E.rgba)==255},p.ensureContrastRatio=function(E,y,C){const S=l.ensureContrastRatio(E.rgba,y.rgba,C);if(S)return m.toColor(S>>24&255,S>>16&255,S>>8&255)},p.opaque=function(E){const y=(255|E.rgba)>>>0;return[o,c,g]=l.toChannels(y),{css:m.toCss(o,c,g),rgba:y}},p.opacity=b,p.multiplyOpacity=function(E,y){return f=255&E.rgba,b(E,f*y/255)},p.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(_||(s.color=_={})),(function(p){let b,E;try{const y=document.createElement("canvas");y.width=1,y.height=1;const C=y.getContext("2d",{willReadFrequently:!0});C&&(b=C,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return o=parseInt(y.slice(1,2).repeat(2),16),c=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),m.toColor(o,c,g);case 5:return o=parseInt(y.slice(1,2).repeat(2),16),c=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),f=parseInt(y.slice(4,5).repeat(2),16),m.toColor(o,c,g,f);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const C=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),g=parseInt(C[3]),f=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),m.toColor(o,c,g,f);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=y,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[o,c,g,f]=b.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,c,g,f),css:y}}})(w||(s.css=w={})),(function(p){function b(E,y,C){const S=E/255,k=y/255,T=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}p.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},p.relativeLuminance2=b})(v||(s.rgb=v={})),(function(p){function b(y,C,S){const k=y>>24&255,T=y>>16&255,R=y>>8&255;let L=C>>24&255,N=C>>16&255,U=C>>8&255,P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));for(;P<S&&(L>0||N>0||U>0);)L-=Math.max(0,Math.ceil(.1*L)),N-=Math.max(0,Math.ceil(.1*N)),U-=Math.max(0,Math.ceil(.1*U)),P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));return(L<<24|N<<16|U<<8|255)>>>0}function E(y,C,S){const k=y>>24&255,T=y>>16&255,R=y>>8&255;let L=C>>24&255,N=C>>16&255,U=C>>8&255,P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));for(;P<S&&(L<255||N<255||U<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),N=Math.min(255,N+Math.ceil(.1*(255-N))),U=Math.min(255,U+Math.ceil(.1*(255-U))),P=u(v.relativeLuminance2(L,N,U),v.relativeLuminance2(k,T,R));return(L<<24|N<<16|U<<8|255)>>>0}p.blend=function(y,C){if(f=(255&C)/255,f===1)return C;const S=C>>24&255,k=C>>16&255,T=C>>8&255,R=y>>24&255,L=y>>16&255,N=y>>8&255;return o=R+Math.round((S-R)*f),c=L+Math.round((k-L)*f),g=N+Math.round((T-N)*f),m.toRgba(o,c,g)},p.ensureContrastRatio=function(y,C,S){const k=v.relativeLuminance(y>>8),T=v.relativeLuminance(C>>8);if(u(k,T)<S){if(T<k){const N=b(y,C,S),U=u(k,v.relativeLuminance(N>>8));if(U<S){const P=E(y,C,S);return U>u(k,v.relativeLuminance(P>>8))?N:P}return N}const R=E(y,C,S),L=u(k,v.relativeLuminance(R>>8));if(L<S){const N=b(y,C,S);return L>u(k,v.relativeLuminance(N>>8))?R:N}return R}},p.reduceLuminance=b,p.increaseLuminance=E,p.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(l||(s.rgba=l={})),s.toPaddedHex=h,s.contrastRatio=u},8969:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=o(844),g=o(2585),f=o(4348),m=o(7866),_=o(744),w=o(7302),v=o(6975),l=o(8460),h=o(1753),u=o(1480),p=o(7994),b=o(9282),E=o(5435),y=o(5981),C=o(2660);let S=!1;class k extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((R=>{var L;(L=this._onScrollApi)==null||L.fire(R.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(R){for(const L in R)this.optionsService.options[L]=R[L]}constructor(R){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new w.OptionsService(R)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(u.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.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((L=>{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((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((L,N)=>this._inputHandler.parse(L,N)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(R,L){this._writeBuffer.write(R,L)}writeSync(R,L){this._logService.logLevel<=g.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(R,L)}input(R,L=!0){this.coreService.triggerDataEvent(R,L)}resize(R,L){isNaN(R)||isNaN(L)||(R=Math.max(R,_.MINIMUM_COLS),L=Math.max(L,_.MINIMUM_ROWS),this._bufferService.resize(R,L))}scroll(R,L=!1){this._bufferService.scroll(R,L)}scrollLines(R,L,N){this._bufferService.scrollLines(R,L,N)}scrollPages(R){this.scrollLines(R*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(R){const L=R-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(R,L){return this._inputHandler.registerEscHandler(R,L)}registerDcsHandler(R,L){return this._inputHandler.registerDcsHandler(R,L)}registerCsiHandler(R,L){return this._inputHandler.registerCsiHandler(R,L)}registerOscHandler(R,L){return this._inputHandler.registerOscHandler(R,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let R=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?R=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(R=!0),R?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const R=[];R.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.registerCsiHandler({final:"H"},(()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const L of R)L.dispose()}))}}}s.CoreTerminal=k},8460:(d,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o((g=>c.fire(g)))},s.runAndSubscribe=function(o,c){return c(void 0),o((g=>c(g)))}},5435:function(d,s,o){var c=this&&this.__decorate||function(G,I,B,x){var D,W=arguments.length,K=W<3?I:x===null?x=Object.getOwnPropertyDescriptor(I,B):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(G,I,B,x);else for(var z=G.length-1;z>=0;z--)(D=G[z])&&(K=(W<3?D(K):W>3?D(I,B,K):D(I,B))||K);return W>3&&K&&Object.defineProperty(I,B,K),K},g=this&&this.__param||function(G,I){return function(B,x){I(B,x,G)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const f=o(2584),m=o(7116),_=o(2015),w=o(844),v=o(482),l=o(8437),h=o(8460),u=o(643),p=o(511),b=o(3734),E=o(2585),y=o(1480),C=o(6242),S=o(6351),k=o(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function L(G,I){if(G>24)return I.setWinLines||!1;switch(G){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var N;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(s.WindowsOptionsReportType=N={}));let U=0;class P extends w.Disposable{getAttrData(){return this._curAttrData}constructor(I,B,x,D,W,K,z,Q,O=new _.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=B,this._coreService=x,this._logService=D,this._optionsService=W,this._oscLinkService=K,this._coreMouseService=z,this._unicodeService=Q,this._parser=O,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._parser.setCsiHandlerFallback(((A,$)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:$.toArray()})})),this._parser.setEscHandlerFallback((A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})})),this._parser.setExecuteHandlerFallback((A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})})),this._parser.setOscHandlerFallback(((A,$,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:$,data:M})})),this._parser.setDcsHandlerFallback(((A,$,M)=>{$==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:$,payload:M})})),this._parser.setPrintHandler(((A,$,M)=>this.print(A,$,M))),this._parser.registerCsiHandler({final:"@"},(A=>this.insertChars(A))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(A=>this.scrollLeft(A))),this._parser.registerCsiHandler({final:"A"},(A=>this.cursorUp(A))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(A=>this.scrollRight(A))),this._parser.registerCsiHandler({final:"B"},(A=>this.cursorDown(A))),this._parser.registerCsiHandler({final:"C"},(A=>this.cursorForward(A))),this._parser.registerCsiHandler({final:"D"},(A=>this.cursorBackward(A))),this._parser.registerCsiHandler({final:"E"},(A=>this.cursorNextLine(A))),this._parser.registerCsiHandler({final:"F"},(A=>this.cursorPrecedingLine(A))),this._parser.registerCsiHandler({final:"G"},(A=>this.cursorCharAbsolute(A))),this._parser.registerCsiHandler({final:"H"},(A=>this.cursorPosition(A))),this._parser.registerCsiHandler({final:"I"},(A=>this.cursorForwardTab(A))),this._parser.registerCsiHandler({final:"J"},(A=>this.eraseInDisplay(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(A=>this.eraseInDisplay(A,!0))),this._parser.registerCsiHandler({final:"K"},(A=>this.eraseInLine(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(A=>this.eraseInLine(A,!0))),this._parser.registerCsiHandler({final:"L"},(A=>this.insertLines(A))),this._parser.registerCsiHandler({final:"M"},(A=>this.deleteLines(A))),this._parser.registerCsiHandler({final:"P"},(A=>this.deleteChars(A))),this._parser.registerCsiHandler({final:"S"},(A=>this.scrollUp(A))),this._parser.registerCsiHandler({final:"T"},(A=>this.scrollDown(A))),this._parser.registerCsiHandler({final:"X"},(A=>this.eraseChars(A))),this._parser.registerCsiHandler({final:"Z"},(A=>this.cursorBackwardTab(A))),this._parser.registerCsiHandler({final:"`"},(A=>this.charPosAbsolute(A))),this._parser.registerCsiHandler({final:"a"},(A=>this.hPositionRelative(A))),this._parser.registerCsiHandler({final:"b"},(A=>this.repeatPrecedingCharacter(A))),this._parser.registerCsiHandler({final:"c"},(A=>this.sendDeviceAttributesPrimary(A))),this._parser.registerCsiHandler({prefix:">",final:"c"},(A=>this.sendDeviceAttributesSecondary(A))),this._parser.registerCsiHandler({final:"d"},(A=>this.linePosAbsolute(A))),this._parser.registerCsiHandler({final:"e"},(A=>this.vPositionRelative(A))),this._parser.registerCsiHandler({final:"f"},(A=>this.hVPosition(A))),this._parser.registerCsiHandler({final:"g"},(A=>this.tabClear(A))),this._parser.registerCsiHandler({final:"h"},(A=>this.setMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(A=>this.setModePrivate(A))),this._parser.registerCsiHandler({final:"l"},(A=>this.resetMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(A=>this.resetModePrivate(A))),this._parser.registerCsiHandler({final:"m"},(A=>this.charAttributes(A))),this._parser.registerCsiHandler({final:"n"},(A=>this.deviceStatus(A))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(A=>this.deviceStatusPrivate(A))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(A=>this.softReset(A))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(A=>this.setCursorStyle(A))),this._parser.registerCsiHandler({final:"r"},(A=>this.setScrollRegion(A))),this._parser.registerCsiHandler({final:"s"},(A=>this.saveCursor(A))),this._parser.registerCsiHandler({final:"t"},(A=>this.windowOptions(A))),this._parser.registerCsiHandler({final:"u"},(A=>this.restoreCursor(A))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(A=>this.insertColumns(A))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(A=>this.deleteColumns(A))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(A=>this.selectProtected(A))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(A=>this.requestMode(A,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(A=>this.requestMode(A,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((A=>(this.setTitle(A),this.setIconName(A),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((A=>this.setIconName(A)))),this._parser.registerOscHandler(2,new C.OscHandler((A=>this.setTitle(A)))),this._parser.registerOscHandler(4,new C.OscHandler((A=>this.setOrReportIndexedColor(A)))),this._parser.registerOscHandler(8,new C.OscHandler((A=>this.setHyperlink(A)))),this._parser.registerOscHandler(10,new C.OscHandler((A=>this.setOrReportFgColor(A)))),this._parser.registerOscHandler(11,new C.OscHandler((A=>this.setOrReportBgColor(A)))),this._parser.registerOscHandler(12,new C.OscHandler((A=>this.setOrReportCursorColor(A)))),this._parser.registerOscHandler(104,new C.OscHandler((A=>this.restoreIndexedColor(A)))),this._parser.registerOscHandler(110,new C.OscHandler((A=>this.restoreFgColor(A)))),this._parser.registerOscHandler(111,new C.OscHandler((A=>this.restoreBgColor(A)))),this._parser.registerOscHandler(112,new C.OscHandler((A=>this.restoreCursorColor(A)))),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 A in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},(()=>this.selectCharset("("+A))),this._parser.registerEscHandler({intermediates:")",final:A},(()=>this.selectCharset(")"+A))),this._parser.registerEscHandler({intermediates:"*",final:A},(()=>this.selectCharset("*"+A))),this._parser.registerEscHandler({intermediates:"+",final:A},(()=>this.selectCharset("+"+A))),this._parser.registerEscHandler({intermediates:"-",final:A},(()=>this.selectCharset("-"+A))),this._parser.registerEscHandler({intermediates:".",final:A},(()=>this.selectCharset("."+A))),this._parser.registerEscHandler({intermediates:"/",final:A},(()=>this.selectCharset("/"+A)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((A=>(this._logService.error("Parsing error: ",A),A))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler(((A,$)=>this.requestStatusString(A,$))))}_preserveStack(I,B,x,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=x,this._parseStack.position=D}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((B,x)=>setTimeout((()=>x("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,B){let x,D=this._activeBuffer.x,W=this._activeBuffer.y,K=0;const z=this._parseStack.paused;if(z){if(x=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(x),x;D=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(A=>String.fromCharCode(A))).join("")}"`),typeof I=="string"?I.split("").map((A=>A.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(I.length,R))),z||this._dirtyRowTracker.clearRange(),I.length>R)for(let A=K;A<I.length;A+=R){const $=A+R<I.length?A+R:I.length,M=typeof I=="string"?this._stringDecoder.decode(I.substring(A,$),this._parseBuffer):this._utf8Decoder.decode(I.subarray(A,$),this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,M))return this._preserveStack(D,W,M,A),this._logSlowResolvingAsync(x),x}else if(!z){const A=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,A))return this._preserveStack(D,W,A,0),this._logSlowResolvingAsync(x),x}this._activeBuffer.x===D&&this._activeBuffer.y===W||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),O=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);O<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(O,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(I,B,x){let D,W;const K=this._charsetService.charset,z=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,$=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&x-B>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodepoint(this._activeBuffer.x-1,0,1,$);let X=this._parser.precedingJoinState;for(let Y=B;Y<x;++Y){if(D=I[Y],D<127&&K){const Ue=K[String.fromCharCode(D)];Ue&&(D=Ue.charCodeAt(0))}const te=this._unicodeService.charProperties(D,X);W=y.UnicodeService.extractWidth(te);const me=y.UnicodeService.extractShouldJoin(te),ve=me?y.UnicodeService.extractWidth(X):0;if(X=te,z&&this._onA11yChar.fire((0,v.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ve>Q){if(O){const Ue=M;let q=this._activeBuffer.x-ve;for(this._activeBuffer.x=ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ve>0&&M instanceof l.BufferLine&&M.copyCellsFrom(Ue,q,0,ve,!1);q<Q;)Ue.setCellFromCodepoint(q++,0,1,$)}else if(this._activeBuffer.x=Q-1,W===2)continue}if(me&&this._activeBuffer.x){const Ue=M.getWidth(this._activeBuffer.x-1)?1:2;M.addCodepointToCell(this._activeBuffer.x-Ue,D,W);for(let q=W-ve;--q>=0;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}else if(A&&(M.insertCells(this._activeBuffer.x,W-ve,this._activeBuffer.getNullCell($)),M.getWidth(Q-1)===2&&M.setCellFromCodepoint(Q-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,$)),M.setCellFromCodepoint(this._activeBuffer.x++,D,W,$),W>0)for(;--W;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}this._parser.precedingJoinState=X,this._activeBuffer.x<Q&&x-B>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodepoint(this._activeBuffer.x,0,1,$),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,B){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,B):this._parser.registerCsiHandler(I,(x=>!L(x.params[0],this._optionsService.rawOptions.windowOptions)||B(x)))}registerDcsHandler(I,B){return this._parser.registerDcsHandler(I,new S.DcsHandler(B))}registerEscHandler(I,B){return this._parser.registerEscHandler(I,B)}registerOscHandler(I,B){return this._parser.registerOscHandler(I,new C.OscHandler(B))}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 I;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&&(I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=I,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+B)}cursorUp(I){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const B=I.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=I.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=I.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const B=I.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,B,x,D=!1,W=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);K.replaceCells(B,x,this._activeBuffer.getNullCell(this._eraseAttrData()),W),D&&(K.isWrapped=!1)}_resetBufferLine(I,B=!1){const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);x&&(x.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),x.isWrapped=!1)}eraseInDisplay(I,B=!1){let x;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);x<this._bufferService.rows;x++)this._resetBufferLine(x,B);this._dirtyRowTracker.markDirty(x);break;case 1:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(x+1).isWrapped=!1);x--;)this._resetBufferLine(x,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(x=this._bufferService.rows,this._dirtyRowTracker.markDirty(x-1);x--;)this._resetBufferLine(x,B);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(I,B=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let B=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;B--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(x,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let B=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;B--;)this._activeBuffer.lines.splice(x,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let B=I.params[0]||1;for(;B--;)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(I){let B=I.params[0]||1;for(;B--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);D.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const B=this._parser.precedingJoinState;if(!B)return!0;const x=I.params[0]||1,D=y.UnicodeService.extractWidth(B),W=this._activeBuffer.x-D,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),z=new Uint32Array(K.length*x);let Q=0;for(let A=0;A<K.length;){const $=K.codePointAt(A)||0;z[Q++]=$,A+=$>65535?2:1}let O=Q;for(let A=1;A<x;++A)z.copyWithin(O,0,Q),O+=Q;return this.print(z,0,O),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let B=0;B<I.length;B++)switch(I.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let B=0;B<I.length;B++)switch(I.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(I){for(let B=0;B<I.length;B++)switch(I.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let B=0;B<I.length;B++)switch(I.params[B]){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(),I.params[B]===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(I,B){const x=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:W}=this._coreMouseService,K=this._coreService,{buffers:z,cols:Q}=this._bufferService,{active:O,alt:A}=z,$=this._optionsService.rawOptions,M=me=>me?1:2,X=I.params[0];return Y=X,te=B?X===2?4:X===4?M(K.modes.insertMode):X===12?3:X===20?M($.convertEol):0:X===1?M(x.applicationCursorKeys):X===3?$.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:X===6?M(x.origin):X===7?M(x.wraparound):X===8?3:X===9?M(D==="X10"):X===12?M($.cursorBlink):X===25?M(!K.isCursorHidden):X===45?M(x.reverseWraparound):X===66?M(x.applicationKeypad):X===67?4:X===1e3?M(D==="VT200"):X===1002?M(D==="DRAG"):X===1003?M(D==="ANY"):X===1004?M(x.sendFocus):X===1005?4:X===1006?M(W==="SGR"):X===1015?4:X===1016?M(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?M(O===A):X===2004?M(x.bracketedPasteMode):0,K.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${Y};${te}$y`),!0;var Y,te}_updateAttrColor(I,B,x,D,W){return B===2?(I|=50331648,I&=-16777216,I|=b.AttributeData.fromColorRGB([x,D,W])):B===5&&(I&=-50331904,I|=33554432|255&x),I}_extractColor(I,B,x){const D=[0,0,-1,0,0,0];let W=0,K=0;do{if(D[K+W]=I.params[B+K],I.hasSubParams(B+K)){const z=I.getSubParams(B+K);let Q=0;do D[1]===5&&(W=1),D[K+Q+1+W]=z[Q];while(++Q<z.length&&Q+K+1+W<D.length);break}if(D[1]===5&&K+W>=2||D[1]===2&&K+W>=5)break;D[1]&&(W=1)}while(++K+B<I.length&&K+W<D.length);for(let z=2;z<D.length;++z)D[z]===-1&&(D[z]=0);switch(D[0]){case 38:x.fg=this._updateAttrColor(x.fg,D[1],D[3],D[4],D[5]);break;case 48:x.bg=this._updateAttrColor(x.bg,D[1],D[3],D[4],D[5]);break;case 58:x.extended=x.extended.clone(),x.extended.underlineColor=this._updateAttrColor(x.extended.underlineColor,D[1],D[3],D[4],D[5])}return K}_processUnderline(I,B){B.extended=B.extended.clone(),(!~I||I>5)&&(I=1),B.extended.underlineStyle=I,B.fg|=268435456,I===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(I){I.fg=l.DEFAULT_ATTR_DATA.fg,I.bg=l.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=I.length;let x;const D=this._curAttrData;for(let W=0;W<B;W++)x=I.params[W],x>=30&&x<=37?(D.fg&=-50331904,D.fg|=16777216|x-30):x>=40&&x<=47?(D.bg&=-50331904,D.bg|=16777216|x-40):x>=90&&x<=97?(D.fg&=-50331904,D.fg|=16777224|x-90):x>=100&&x<=107?(D.bg&=-50331904,D.bg|=16777224|x-100):x===0?this._processSGR0(D):x===1?D.fg|=134217728:x===3?D.bg|=67108864:x===4?(D.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,D)):x===5?D.fg|=536870912:x===7?D.fg|=67108864:x===8?D.fg|=1073741824:x===9?D.fg|=2147483648:x===2?D.bg|=134217728:x===21?this._processUnderline(2,D):x===22?(D.fg&=-134217729,D.bg&=-134217729):x===23?D.bg&=-67108865:x===24?(D.fg&=-268435457,this._processUnderline(0,D)):x===25?D.fg&=-536870913:x===27?D.fg&=-67108865:x===28?D.fg&=-1073741825:x===29?D.fg&=2147483647:x===39?(D.fg&=-67108864,D.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):x===49?(D.bg&=-67108864,D.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):x===38||x===48||x===58?W+=this._extractColor(I,W,D):x===53?D.bg|=1073741824:x===55?D.bg&=-1073741825:x===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):x===100?(D.fg&=-67108864,D.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",x);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${x}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const B=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${x}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(I){const B=I.params[0]||1;switch(B){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 x=B%2==1;return this._optionsService.options.cursorBlink=x,!0}setScrollRegion(I){const B=I.params[0]||1;let x;return(I.length<2||(x=I.params[1])>this._bufferService.rows||x===0)&&(x=this._bufferService.rows),x>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=x-1,this._setCursor(0,0)),!0}windowOptions(I){if(!L(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const B=[],x=I.split(";");for(;x.length>1;){const D=x.shift(),W=x.shift();if(/^\d+$/.exec(D)){const K=parseInt(D);if(J(K))if(W==="?")B.push({type:0,index:K});else{const z=(0,k.parseColor)(W);z&&B.push({type:1,index:K,color:z})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(I){const B=I.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(I,B){this._getCurrentLinkId()&&this._finishHyperlink();const x=I.split(":");let D;const W=x.findIndex((K=>K.startsWith("id=")));return W!==-1&&(D=x[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,B){const x=I.split(";");for(let D=0;D<x.length&&!(B>=this._specialColors.length);++D,++B)if(x[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const W=(0,k.parseColor)(x[D]);W&&this._onColor.fire([{type:1,index:this._specialColors[B],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const B=[],x=I.split(";");for(let D=0;D<x.length;++D)if(/^\d+$/.exec(x[D])){const W=parseInt(x[D]);J(W)&&B.push({type:2,index:W})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,m.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(T[I[0]],m.CHARSETS[I[1]]||m.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new p.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const x=this._activeBuffer.ybase+this._activeBuffer.y+B,D=this._activeBuffer.lines.get(x);D&&(D.fill(I),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,B){const x=this._bufferService.buffer,D=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${x.scrollTop+1};${x.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,B){this._dirtyRowTracker.markRangeDirty(I,B)}}s.InputHandler=P;let H=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,I){G>I&&(U=G,G=I,I=U),G<this.start&&(this.start=G),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(G){return 0<=G&&G<256}H=c([g(0,E.IBufferService)],H)},844:(d,s)=>{function o(c){for(const g of c)g.dispose();c.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 c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const g=this._disposables.indexOf(c);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var g;this._isDisposed||c===this._value||((g=this._value)==null||g.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,f,m){this._data[g]||(this._data[g]={}),this._data[g][f]=m}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,g,f,m,_){this._data.get(c,g)||this._data.set(c,g,new o),this._data.get(c,g).set(f,m,_)}get(c,g,f,m){var _;return(_=this._data.get(c,g))==null?void 0:_.get(f,m)}clear(){this._data.clear()}}},6114:(d,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 o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=o.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const g=this._getKey(c);if(g===void 0||(o=this._search(g),o===-1)||this._getKey(this._array[o])!==g)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===g);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,g){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do g(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let g=0,f=this._array.length-1;for(;f>=g;){let m=g+f>>1;const _=this._getKey(this._array[m]);if(_>c)f=m-1;else{if(!(_<c)){for(;m>0&&this._getKey(this._array[m-1])===c;)m--;return m}g=m+1}}return g}}},7226:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let w=0,v=0,l=_.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),v=Math.max(w,v),h=_.timeRemaining(),1.5*v>h)return l-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-w))}ms`),void this._start();l=h}this.clear()}}class f extends g{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const w=Date.now()+_;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=f,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:f,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=o(643);s.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),m=f==null?void 0:f.get(g.cols-1),_=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);_&&m&&(_.isWrapped=m[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&m[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new o;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,m=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=m}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=o(6349),g=o(7226),f=o(3734),m=o(8437),_=o(4634),w=o(511),v=o(643),l=o(4863),h=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(u,p,b){this._hasScrollback=u,this._optionsService=p,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(u){return u?(this._nullCell.fg=u.fg,this._nullCell.bg=u.bg,this._nullCell.extended=u.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(u){return u?(this._whitespaceCell.fg=u.fg,this._whitespaceCell.bg=u.bg,this._whitespaceCell.extended=u.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(u,p){return new m.BufferLine(this._bufferService.cols,this.getNullCell(u),p)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const u=this.ybase+this.y-this.ydisp;return u>=0&&u<this._rows}_getCorrectBufferLength(u){if(!this._hasScrollback)return u;const p=u+this._optionsService.rawOptions.scrollback;return p>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:p}fillViewportRows(u){if(this.lines.length===0){u===void 0&&(u=m.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)this.lines.push(this.getBlankLine(u))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(u,p){const b=this.getNullCell(m.DEFAULT_ATTR_DATA);let E=0;const y=this._getCorrectBufferLength(p);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<u)for(let S=0;S<this.lines.length;S++)E+=+this.lines.get(S).resize(u,b);let C=0;if(this._rows<p)for(let S=this._rows;S<p;S++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(u,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(u,b)));else for(let S=this._rows;S>p;S--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const S=this.lines.length-y;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=y}this.x=Math.min(this.x,u-1),this.y=Math.min(this.y,p-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,u-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(u,p),this._cols>u))for(let C=0;C<this.lines.length;C++)E+=+this.lines.get(C).resize(u,b);this._cols=u,this._rows=p,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let u=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,u=!1);let p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>100)return!0;return u}get _isReflowEnabled(){const u=this._optionsService.rawOptions.windowsPty;return u&&u.buildNumber?this._hasScrollback&&u.backend==="conpty"&&u.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(u,p){this._cols!==u&&(u>this._cols?this._reflowLarger(u,p):this._reflowSmaller(u,p))}_reflowLarger(u,p){const b=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,u,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(b.length>0){const E=(0,_.reflowLargerCreateNewLayout)(this.lines,b);(0,_.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(u,p,E.countRemoved)}}_reflowLargerAdjustViewport(u,p,b){const E=this.getNullCell(m.DEFAULT_ATTR_DATA);let y=b;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new m.BufferLine(u,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(u,p){const b=this.getNullCell(m.DEFAULT_ATTR_DATA),E=[];let y=0;for(let C=this.lines.length-1;C>=0;C--){let S=this.lines.get(C);if(!S||!S.isWrapped&&S.getTrimmedLength()<=u)continue;const k=[S];for(;S.isWrapped&&C>0;)S=this.lines.get(--C),k.unshift(S);const T=this.ybase+this.y;if(T>=C&&T<C+k.length)continue;const R=k[k.length-1].getTrimmedLength(),L=(0,_.reflowSmallerGetNewLineLengths)(k,this._cols,u),N=L.length-k.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const P=[];for(let x=0;x<N;x++){const D=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);P.push(D)}P.length>0&&(E.push({start:C+k.length+y,newLines:P}),y+=P.length),k.push(...P);let H=L.length-1,J=L[H];J===0&&(H--,J=L[H]);let G=k.length-N-1,I=R;for(;G>=0;){const x=Math.min(I,J);if(k[H]===void 0)break;if(k[H].copyCellsFrom(k[G],I-x,J-x,x,!0),J-=x,J===0&&(H--,J=L[H]),I-=x,I===0){G--;const D=Math.max(G,0);I=(0,_.getWrappedLineTrimmedLength)(k,D,this._cols)}}for(let x=0;x<k.length;x++)L[x]<u&&k[x].setCell(L[x],b);let B=N-U;for(;B-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+p-1)}if(E.length>0){const C=[],S=[];for(let H=0;H<this.lines.length;H++)S.push(this.lines.get(H));const k=this.lines.length;let T=k-1,R=0,L=E[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let N=0;for(let H=Math.min(this.lines.maxLength-1,k+y-1);H>=0;H--)if(L&&L.start>T+N){for(let J=L.newLines.length-1;J>=0;J--)this.lines.set(H--,L.newLines[J]);H++,C.push({index:T+1,amount:L.newLines.length}),N+=L.newLines.length,L=E[++R]}else this.lines.set(H,S[T--]);let U=0;for(let H=C.length-1;H>=0;H--)C[H].index+=U,this.lines.onInsertEmitter.fire(C[H]),U+=C[H].amount;const P=Math.max(0,k+y-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}}translateBufferLineToString(u,p,b=0,E){const y=this.lines.get(u);return y?y.translateToString(p,b,E):""}getWrappedRangeForLine(u){let p=u,b=u;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:p,last:b}}setupTabStops(u){for(u!=null?this.tabs[u]||(u=this.prevStop(u)):(this.tabs={},u=0);u<this._cols;u+=this._optionsService.rawOptions.tabStopWidth)this.tabs[u]=!0}prevStop(u){for(u==null&&(u=this.x);!this.tabs[--u]&&u>0;);return u>=this._cols?this._cols-1:u<0?0:u}nextStop(u){for(u==null&&(u=this.x);!this.tabs[++u]&&u<this._cols;);return u>=this._cols?this._cols-1:u<0?0:u}clearMarkers(u){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].line===u&&(this.markers[p].dispose(),this.markers.splice(p--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].dispose(),this.markers.splice(u--,1);this._isClearing=!1}addMarker(u){const p=new l.Marker(u);return this.markers.push(p),p.register(this.lines.onTrim((b=>{p.line-=b,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((b=>{p.line>=b.index&&(p.line+=b.amount)}))),p.register(this.lines.onDelete((b=>{p.line>=b.index&&p.line<b.index+b.amount&&p.dispose(),p.line>b.index&&(p.line-=b.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_removeMarker(u){this._isClearing||this.markers.splice(this.markers.indexOf(u),1)}}},8437:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=o(3734),g=o(511),f=o(643),m=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class w{constructor(l,h,u=!1){this.isWrapped=u,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const p=h||g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let b=0;b<l;++b)this.setCell(b,p);this.length=l}get(l){const h=this._data[3*l+0],u=2097151&h;return[this._data[3*l+1],2097152&h?this._combined[l]:u?(0,m.stringFromCodePoint)(u):"",h>>22,2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):u]}set(l,h){this._data[3*l+1]=h[f.CHAR_DATA_ATTR_INDEX],h[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=h[1],this._data[3*l+0]=2097152|l|h[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=h[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&h}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l]:2097151&h?(0,m.stringFromCodePoint)(2097151&h):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,h){return _=3*l,h.content=this._data[_+0],h.fg=this._data[_+1],h.bg=this._data[_+2],2097152&h.content&&(h.combinedData=this._combined[l]),268435456&h.bg&&(h.extended=this._extendedAttrs[l]),h}setCell(l,h){2097152&h.content&&(this._combined[l]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[l]=h.extended),this._data[3*l+0]=h.content,this._data[3*l+1]=h.fg,this._data[3*l+2]=h.bg}setCellFromCodepoint(l,h,u,p){268435456&p.bg&&(this._extendedAttrs[l]=p.extended),this._data[3*l+0]=h|u<<22,this._data[3*l+1]=p.fg,this._data[3*l+2]=p.bg}addCodepointToCell(l,h,u){let p=this._data[3*l+0];2097152&p?this._combined[l]+=(0,m.stringFromCodePoint)(h):2097151&p?(this._combined[l]=(0,m.stringFromCodePoint)(2097151&p)+(0,m.stringFromCodePoint)(h),p&=-2097152,p|=2097152):p=h|4194304,u&&(p&=-12582913,p|=u<<22),this._data[3*l+0]=p}insertCells(l,h,u){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,u),h<this.length-l){const p=new g.CellData;for(let b=this.length-l-h-1;b>=0;--b)this.setCell(l+h+b,this.loadCell(l+b,p));for(let b=0;b<h;++b)this.setCell(l+b,u)}else for(let p=l;p<this.length;++p)this.setCell(p,u);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,u)}deleteCells(l,h,u){if(l%=this.length,h<this.length-l){const p=new g.CellData;for(let b=0;b<this.length-l-h;++b)this.setCell(l+b,this.loadCell(l+h+b,p));for(let b=this.length-h;b<this.length;++b)this.setCell(b,u)}else for(let p=l;p<this.length;++p)this.setCell(p,u);l&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,u),this.getWidth(l)!==0||this.hasContent(l)||this.setCellFromCodepoint(l,0,1,u)}replaceCells(l,h,u,p=!1){if(p)for(l&&this.getWidth(l-1)===2&&!this.isProtected(l-1)&&this.setCellFromCodepoint(l-1,0,1,u),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,u);l<h&&l<this.length;)this.isProtected(l)||this.setCell(l,u),l++;else for(l&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l-1,0,1,u),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,u);l<h&&l<this.length;)this.setCell(l++,u)}resize(l,h){if(l===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const u=3*l;if(l>this.length){if(this._data.buffer.byteLength>=4*u)this._data=new Uint32Array(this._data.buffer,0,u);else{const p=new Uint32Array(u);p.set(this._data),this._data=p}for(let p=this.length;p<l;++p)this.setCell(p,h)}else{this._data=this._data.subarray(0,u);const p=Object.keys(this._combined);for(let E=0;E<p.length;E++){const y=parseInt(p[E],10);y>=l&&delete this._combined[y]}const b=Object.keys(this._extendedAttrs);for(let E=0;E<b.length;E++){const y=parseInt(b[E],10);y>=l&&delete this._extendedAttrs[y]}}return this.length=l,4*u*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const l=new Uint32Array(this._data.length);return l.set(this._data),this._data=l,1}return 0}fill(l,h=!1){if(h)for(let u=0;u<this.length;++u)this.isProtected(u)||this.setCell(u,l);else{this._combined={},this._extendedAttrs={};for(let u=0;u<this.length;++u)this.setCell(u,l)}}copyFrom(l){this.length!==l.length?this._data=new Uint32Array(l._data):this._data.set(l._data),this.length=l.length,this._combined={};for(const h in l._combined)this._combined[h]=l._combined[h];this._extendedAttrs={};for(const h in l._extendedAttrs)this._extendedAttrs[h]=l._extendedAttrs[h];this.isWrapped=l.isWrapped}clone(){const l=new w(0);l._data=new Uint32Array(this._data),l.length=this.length;for(const h in this._combined)l._combined[h]=this._combined[h];for(const h in this._extendedAttrs)l._extendedAttrs[h]=this._extendedAttrs[h];return l.isWrapped=this.isWrapped,l}getTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,h,u,p,b){const E=l._data;if(b)for(let C=p-1;C>=0;C--){for(let S=0;S<3;S++)this._data[3*(u+C)+S]=E[3*(h+C)+S];268435456&E[3*(h+C)+2]&&(this._extendedAttrs[u+C]=l._extendedAttrs[h+C])}else for(let C=0;C<p;C++){for(let S=0;S<3;S++)this._data[3*(u+C)+S]=E[3*(h+C)+S];268435456&E[3*(h+C)+2]&&(this._extendedAttrs[u+C]=l._extendedAttrs[h+C])}const y=Object.keys(l._combined);for(let C=0;C<y.length;C++){const S=parseInt(y[C],10);S>=h&&(this._combined[S-h+u]=l._combined[S])}}translateToString(l,h,u,p){h=h??0,u=u??this.length,l&&(u=Math.min(u,this.getTrimmedLength())),p&&(p.length=0);let b="";for(;h<u;){const E=this._data[3*h+0],y=2097151&E,C=2097152&E?this._combined[h]:y?(0,m.stringFromCodePoint)(y):f.WHITESPACE_CELL_CHAR;if(b+=C,p)for(let S=0;S<C.length;++S)p.push(h);h+=E>>22||1}return p&&p.push(h),b}}s.BufferLine=w},4841:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(d,s)=>{function o(c,g,f){if(g===c.length-1)return c[g].getTrimmedLength();const m=!c[g].hasContent(f-1)&&c[g].getWidth(f-1)===1,_=c[g+1].getWidth(0)===2;return m&&_?f-1:f}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,g,f,m,_){const w=[];for(let v=0;v<c.length-1;v++){let l=v,h=c.get(++l);if(!h.isWrapped)continue;const u=[c.get(v)];for(;l<c.length&&h.isWrapped;)u.push(h),h=c.get(++l);if(m>=v&&m<l){v+=u.length-1;continue}let p=0,b=o(u,p,g),E=1,y=0;for(;E<u.length;){const S=o(u,E,g),k=S-y,T=f-b,R=Math.min(k,T);u[p].copyCellsFrom(u[E],y,b,R,!1),b+=R,b===f&&(p++,b=0),y+=R,y===S&&(E++,y=0),b===0&&p!==0&&u[p-1].getWidth(f-1)===2&&(u[p].copyCellsFrom(u[p-1],f-1,b++,1,!1),u[p-1].setCell(f-1,_))}u[p].replaceCells(b,f,_);let C=0;for(let S=u.length-1;S>0&&(S>p||u[S].getTrimmedLength()===0);S--)C++;C>0&&(w.push(v+u.length-C),w.push(C)),v+=u.length-1}return w},s.reflowLargerCreateNewLayout=function(c,g){const f=[];let m=0,_=g[m],w=0;for(let v=0;v<c.length;v++)if(_===v){const l=g[++m];c.onDeleteEmitter.fire({index:v-w,amount:l}),v+=l-1,w+=l,_=g[++m]}else f.push(v);return{layout:f,countRemoved:w}},s.reflowLargerApplyNewLayout=function(c,g){const f=[];for(let m=0;m<g.length;m++)f.push(c.get(g[m]));for(let m=0;m<f.length;m++)c.set(m,f[m]);c.length=g.length},s.reflowSmallerGetNewLineLengths=function(c,g,f){const m=[],_=c.map(((h,u)=>o(c,u,g))).reduce(((h,u)=>h+u));let w=0,v=0,l=0;for(;l<_;){if(_-l<f){m.push(_-l);break}w+=f;const h=o(c,v,g);w>h&&(w-=h,v++);const u=c[v].getWidth(w-1)===2;u&&w--;const p=u?f-1:f;m.push(p),l+=p}return m},s.getWrappedLineTrimmedLength=o},5295:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=o(8460),g=o(844),f=o(9092);class m extends g.Disposable{constructor(w,v){super(),this._optionsService=w,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,v){this._normal.resize(w,v),this._alt.resize(w,v),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=m},511:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(482),g=o(643),f=o(3734);class m extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const v=new m;return v.setFromCharData(w),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const l=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const h=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(l-55296)+h-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=m},643:(d,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:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=o(8460),g=o(844);class f{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=f,f._nextId=1},7116:(d,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:(d,s)=>{var o,c,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
165
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(o||(s.C0=o={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(c||(s.C1=c={})),(function(f){f.ST=`${o.ESC}\\`})(g||(s.C1_ESCAPED=g={}))},7399:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=o(2584),g={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(f,m,_,w){const v={type:0,cancel:!1,key:void 0},l=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?v.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?v.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?v.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(v.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:v.key=f.ctrlKey?"\b":c.C0.DEL,f.altKey&&(v.key=c.C0.ESC+v.key);break;case 9:if(f.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=f.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,f.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(f.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(_?"b":"[1;5D"))):v.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(f.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(_?"f":"[1;5C"))):v.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(f.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"A",_||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(f.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"B",_||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=l?c.C0.ESC+"[3;"+(l+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=l?c.C0.ESC+"[1;"+(l+1)+"H":m?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=l?c.C0.ESC+"[1;"+(l+1)+"F":m?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:f.shiftKey?v.type=2:f.ctrlKey?v.key=c.C0.ESC+"[5;"+(l+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:f.shiftKey?v.type=3:f.ctrlKey?v.key=c.C0.ESC+"[6;"+(l+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=l?c.C0.ESC+"[1;"+(l+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=l?c.C0.ESC+"[1;"+(l+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=l?c.C0.ESC+"[1;"+(l+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=l?c.C0.ESC+"[1;"+(l+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=l?c.C0.ESC+"[15;"+(l+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=l?c.C0.ESC+"[17;"+(l+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=l?c.C0.ESC+"[18;"+(l+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=l?c.C0.ESC+"[19;"+(l+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=l?c.C0.ESC+"[20;"+(l+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=l?c.C0.ESC+"[21;"+(l+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=l?c.C0.ESC+"[23;"+(l+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=l?c.C0.ESC+"[24;"+(l+1)+"~":c.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(_&&!w||!f.altKey||f.metaKey)!_||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?v.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(v.key=c.C0.US),f.key==="@"&&(v.key=c.C0.NUL)):f.keyCode===65&&(v.type=1);else{const h=g[f.keyCode],u=h==null?void 0:h[f.shiftKey?1:0];if(u)v.key=c.C0.ESC+u;else if(f.keyCode>=65&&f.keyCode<=90){const p=f.ctrlKey?f.keyCode-64:f.keyCode+32;let b=String.fromCharCode(p);f.shiftKey&&(b=b.toUpperCase()),v.key=c.C0.ESC+b}else if(f.keyCode===32)v.key=c.C0.ESC+(f.ctrlKey?c.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let p=f.code.slice(3,4);f.shiftKey||(p=p.toLowerCase()),v.key=c.C0.ESC+p,v.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?v.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?v.key=c.C0.NUL:f.keyCode>=51&&f.keyCode<=55?v.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?v.key=c.C0.DEL:f.keyCode===219?v.key=c.C0.ESC:f.keyCode===220?v.key=c.C0.FS:f.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,c=0,g=o.length){let f="";for(let m=c;m<g;++m){let _=o[m];_>65535?(_-=65536,f+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):f+=String.fromCharCode(_)}return f},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const g=o.length;if(!g)return 0;let f=0,m=0;if(this._interim){const _=o.charCodeAt(m++);56320<=_&&_<=57343?c[f++]=1024*(this._interim-55296)+_-56320+65536:(c[f++]=this._interim,c[f++]=_),this._interim=0}for(let _=m;_<g;++_){const w=o.charCodeAt(_);if(55296<=w&&w<=56319){if(++_>=g)return this._interim=w,f;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[f++]=1024*(w-55296)+v-56320+65536:(c[f++]=w,c[f++]=v)}else w!==65279&&(c[f++]=w)}return f}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const g=o.length;if(!g)return 0;let f,m,_,w,v=0,l=0,h=0;if(this.interim[0]){let b=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let y,C=0;for(;(y=63&this.interim[++C])&&C<4;)E<<=6,E|=y;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-C;for(;h<k;){if(h>=g)return 0;if(y=o[h++],(192&y)!=128){h--,b=!0;break}this.interim[C++]=y,E<<=6,E|=63&y}b||(S===2?E<128?h--:c[v++]=E:S===3?E<2048||E>=55296&&E<=57343||E===65279||(c[v++]=E):E<65536||E>1114111||(c[v++]=E)),this.interim.fill(0)}const u=g-4;let p=h;for(;p<g;){for(;!(!(p<u)||128&(f=o[p])||128&(m=o[p+1])||128&(_=o[p+2])||128&(w=o[p+3]));)c[v++]=f,c[v++]=m,c[v++]=_,c[v++]=w,p+=4;if(f=o[p++],f<128)c[v++]=f;else if((224&f)==192){if(p>=g)return this.interim[0]=f,v;if(m=o[p++],(192&m)!=128){p--;continue}if(l=(31&f)<<6|63&m,l<128){p--;continue}c[v++]=l}else if((240&f)==224){if(p>=g)return this.interim[0]=f,v;if(m=o[p++],(192&m)!=128){p--;continue}if(p>=g)return this.interim[0]=f,this.interim[1]=m,v;if(_=o[p++],(192&_)!=128){p--;continue}if(l=(15&f)<<12|(63&m)<<6|63&_,l<2048||l>=55296&&l<=57343||l===65279)continue;c[v++]=l}else if((248&f)==240){if(p>=g)return this.interim[0]=f,v;if(m=o[p++],(192&m)!=128){p--;continue}if(p>=g)return this.interim[0]=f,this.interim[1]=m,v;if(_=o[p++],(192&_)!=128){p--;continue}if(p>=g)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=_,v;if(w=o[p++],(192&w)!=128){p--;continue}if(l=(7&f)<<18|(63&m)<<12|(63&_)<<6|63&w,l<65536||l>1114111)continue;c[v++]=l}}return v}}},225:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=o(1480),g=[[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]],f=[[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 m;s.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let _=0;_<g.length;++_)m.fill(0,g[_][0],g[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?m[_]:(function(w,v){let l,h=0,u=v.length-1;if(w<v[0][0]||w>v[u][1])return!1;for(;u>=h;)if(l=h+u>>1,w>v[l][1])h=l+1;else{if(!(w<v[l][0]))return!0;u=l-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,w){let v=this.wcwidth(_),l=v===0&&w!==0;if(l){const h=c.UnicodeService.extractWidth(w);h===0?l=!1:h>v&&(v=h)}return c.UnicodeService.createPropertyValue(0,v,l)}}},5981:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=o(8460),g=o(844);class f extends g.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,w){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(w)}_innerWrite(_=0,w=!0){const v=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],h=this._action(l,w);if(h){const p=b=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,b))):this._innerWrite(v,b);return void h.catch((b=>(queueMicrotask((()=>{throw b})),Promise.resolve(!1)))).then(p)}const u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-v>=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=f},5941:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function g(f,m){const _=f.toString(16),w=_.length<2?"0"+_:_;switch(m){case 4:return _[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(f){if(!f)return;let m=f.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const _=o.exec(m);if(_){const w=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/w*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/w*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/w*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),c.exec(m)&&[3,6,9,12].includes(m.length))){const _=m.length/3,w=[0,0,0];for(let v=0;v<3;++v){const l=parseInt(m.slice(_*v,_*v+_),16);w[v]=_===1?l<<4:_===2?l:_===3?l>>4:l>>8}return w}},s.toRgbString=function(f,m=16){const[_,w,v]=f;return`rgb:${g(_,m)}/${g(w,m)}/${g(v,m)}`}},5770:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=o(482),g=o(8742),f=o(5770),m=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(w,v){this._handlers[w]===void 0&&(this._handlers[w]=[]);const l=this._handlers[w];return l.push(v),{dispose:()=>{const h=l.indexOf(v);h!==-1&&l.splice(h,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(w,v){if(this.reset(),this._ident=w,this._active=this._handlers[w]||m,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(w,v,l){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(w,v,l);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(w,v,l))}unhook(w,v=!0){if(this._active.length){let l=!1,h=this._active.length-1,u=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,l=v,u=this._stack.fallThrough,this._stack.paused=!1),!u&&l===!1){for(;h>=0&&(l=this._active[h].unhook(w),l!==!0);h--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,l;h--}for(;h>=0;h--)if(l=this._active[h].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",w);this._active=m,this._ident=0}};const _=new g.Params;_.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=_,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():_,this._data="",this._hitLimit=!1}put(w,v,l){this._hitLimit||(this._data+=(0,c.utf32ToString)(w,v,l),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let v=!1;if(this._hitLimit)v=!1;else if(w&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((l=>(this._params=_,this._data="",this._hitLimit=!1,l)));return this._params=_,this._data="",this._hitLimit=!1,v}}},2015:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=o(844),g=o(8742),f=o(6242),m=o(6351);class _{constructor(h){this.table=new Uint8Array(h)}setDefault(h,u){this.table.fill(h<<4|u)}add(h,u,p,b){this.table[u<<8|h]=p<<4|b}addMany(h,u,p,b){for(let E=0;E<h.length;E++)this.table[u<<8|h[E]]=p<<4|b}}s.TransitionTable=_;const w=160;s.VT500_TRANSITION_TABLE=(function(){const l=new _(4095),h=Array.apply(null,Array(256)).map(((C,S)=>S)),u=(C,S)=>h.slice(C,S),p=u(32,127),b=u(0,24);b.push(25),b.push.apply(b,u(28,32));const E=u(0,14);let y;for(y in l.setDefault(1,0),l.addMany(p,0,2,0),E)l.addMany([24,26,153,154],y,3,0),l.addMany(u(128,144),y,3,0),l.addMany(u(144,152),y,3,0),l.add(156,y,0,0),l.add(27,y,11,1),l.add(157,y,4,8),l.addMany([152,158,159],y,0,7),l.add(155,y,11,3),l.add(144,y,11,9);return l.addMany(b,0,3,0),l.addMany(b,1,3,1),l.add(127,1,0,1),l.addMany(b,8,0,8),l.addMany(b,3,3,3),l.add(127,3,0,3),l.addMany(b,4,3,4),l.add(127,4,0,4),l.addMany(b,6,3,6),l.addMany(b,5,3,5),l.add(127,5,0,5),l.addMany(b,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(p,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(u(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(p,7,0,7),l.addMany(b,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(u(64,127),3,7,0),l.addMany(u(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(u(48,60),4,8,4),l.addMany(u(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(u(32,64),6,0,6),l.add(127,6,0,6),l.addMany(u(64,127),6,0,0),l.addMany(u(32,48),3,9,5),l.addMany(u(32,48),5,9,5),l.addMany(u(48,64),5,0,6),l.addMany(u(64,127),5,7,0),l.addMany(u(32,48),4,9,5),l.addMany(u(32,48),1,9,2),l.addMany(u(32,48),2,9,2),l.addMany(u(48,127),2,10,0),l.addMany(u(48,80),1,10,0),l.addMany(u(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(u(96,127),1,10,0),l.add(80,1,11,9),l.addMany(b,9,0,9),l.add(127,9,0,9),l.addMany(u(28,32),9,0,9),l.addMany(u(32,48),9,9,12),l.addMany(u(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(b,11,0,11),l.addMany(u(32,128),11,0,11),l.addMany(u(28,32),11,0,11),l.addMany(b,10,0,10),l.add(127,10,0,10),l.addMany(u(28,32),10,0,10),l.addMany(u(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(u(32,48),10,9,12),l.addMany(b,12,0,12),l.add(127,12,0,12),l.addMany(u(28,32),12,0,12),l.addMany(u(32,48),12,9,12),l.addMany(u(48,64),12,0,11),l.addMany(u(64,127),12,12,13),l.addMany(u(64,127),10,12,13),l.addMany(u(64,127),9,12,13),l.addMany(b,13,13,13),l.addMany(p,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(w,0,2,0),l.add(w,8,5,8),l.add(w,6,0,6),l.add(w,11,0,11),l.add(w,13,13,13),l})();class v extends c.Disposable{constructor(h=s.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(u,p,b)=>{},this._executeHandlerFb=u=>{},this._csiHandlerFb=(u,p)=>{},this._escHandlerFb=u=>{},this._errorHandlerFb=u=>u,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,u=[64,126]){let p=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=h.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<h.intermediates.length;++E){const y=h.intermediates.charCodeAt(E);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=y}}if(h.final.length!==1)throw new Error("final must be a single byte");const b=h.final.charCodeAt(0);if(u[0]>b||b>u[1])throw new Error(`final must be in range ${u[0]} .. ${u[1]}`);return p<<=8,p|=b,p}identToString(h){const u=[];for(;h;)u.push(String.fromCharCode(255&h)),h>>=8;return u.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,u){const p=this._identifier(h,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);const b=this._escHandlers[p];return b.push(u),{dispose:()=>{const E=b.indexOf(u);E!==-1&&b.splice(E,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,u){this._executeHandlers[h.charCodeAt(0)]=u}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,u){const p=this._identifier(h);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);const b=this._csiHandlers[p];return b.push(u),{dispose:()=>{const E=b.indexOf(u);E!==-1&&b.splice(E,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,u){return this._dcsParser.registerHandler(this._identifier(h),u)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,u){return this._oscParser.registerHandler(h,u)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,u,p,b,E){this._parseStack.state=h,this._parseStack.handlers=u,this._parseStack.handlerPos=p,this._parseStack.transition=b,this._parseStack.chunkPos=E}parse(h,u,p){let b,E=0,y=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(p===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&k>-1){for(;k>=0&&(b=S[k](this._params),b!==!0);k--)if(b instanceof Promise)return this._parseStack.handlerPos=k,b}this._parseStack.handlers=[];break;case 4:if(p===!1&&k>-1){for(;k>=0&&(b=S[k](),b!==!0);k--)if(b instanceof Promise)return this._parseStack.handlerPos=k,b}this._parseStack.handlers=[];break;case 6:if(E=h[this._parseStack.chunkPos],b=this._dcsParser.unhook(E!==24&&E!==26,p),b)return b;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=h[this._parseStack.chunkPos],b=this._oscParser.end(E!==24&&E!==26,p),b)return b;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=C;S<u;++S){switch(E=h[S],y=this._transitions.table[this.currentState<<8|(E<160?E:w)],y>>4){case 2:for(let N=S+1;;++N){if(N>=u||(E=h[N])<32||E>126&&E<w){this._printHandler(h,S,N),S=N-1;break}if(++N>=u||(E=h[N])<32||E>126&&E<w){this._printHandler(h,S,N),S=N-1;break}if(++N>=u||(E=h[N])<32||E>126&&E<w){this._printHandler(h,S,N),S=N-1;break}if(++N>=u||(E=h[N])<32||E>126&&E<w){this._printHandler(h,S,N),S=N-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|E];let T=k?k.length-1:-1;for(;T>=0&&(b=k[T](this._params),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(3,k,T,y,S),b;T<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++S<u&&(E=h[S])>47&&E<60);S--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const R=this._escHandlers[this._collect<<8|E];let L=R?R.length-1:-1;for(;L>=0&&(b=R[L](),b!==!0);L--)if(b instanceof Promise)return this._preserveStack(4,R,L,y,S),b;L<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let N=S+1;;++N)if(N>=u||(E=h[N])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(h,S,N),S=N-1;break}break;case 14:if(b=this._dcsParser.unhook(E!==24&&E!==26),b)return this._preserveStack(6,[],0,y,S),b;E===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let N=S+1;;N++)if(N>=u||(E=h[N])<32||E>127&&E<w){this._oscParser.put(h,S,N),S=N-1;break}break;case 6:if(b=this._oscParser.end(E!==24&&E!==26),b)return this._preserveStack(5,[],0,y,S),b;E===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}s.EscapeSequenceParser=v},6242:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=o(5770),g=o(482),f=[];s.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,_){this._handlers[m]===void 0&&(this._handlers[m]=[]);const w=this._handlers[m];return w.push(_),{dispose:()=>{const v=w.indexOf(_);v!==-1&&w.splice(v,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,_,w){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(m,_,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(m,_,w))}start(){this.reset(),this._state=1}put(m,_,w){if(this._state!==3){if(this._state===1)for(;_<w;){const v=m[_++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&w-_>0&&this._put(m,_,w)}}end(m,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,v=this._active.length-1,l=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,w=_,l=this._stack.fallThrough,this._stack.paused=!1),!l&&w===!1){for(;v>=0&&(w=this._active[v].end(m),w!==!0);v--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,w;v--}for(;v>=0;v--)if(w=this._active[v].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",m);this._active=f,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,_,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(m,_,w),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let _=!1;if(this._hitLimit)_=!1;else if(m&&(_=this._handler(this._data),_ instanceof Promise))return _.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,_}}},8742:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class c{static fromArray(f){const m=new c;if(!f.length)return m;for(let _=Array.isArray(f[0])?1:0;_<f.length;++_){const w=f[_];if(Array.isArray(w))for(let v=0;v<w.length;++v)m.addSubParam(w[v]);else m.addParam(w)}return m}constructor(f=32,m=32){if(this.maxLength=f,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new c(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let m=0;m<this.length;++m){f.push(this.params[m]);const _=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-_>0&&f.push(Array.prototype.slice.call(this._subParams,_,w))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>o?o:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>o?o:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const m=this._subParamsIdx[f]>>8,_=255&this._subParamsIdx[f];return _-m>0?this._subParams.subarray(m,_):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const _=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-_>0&&(f[m]=this._subParams.slice(_,w))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,w=_[m-1];_[m-1]=~w?Math.min(10*w+f,o):f}}s.Params=c},5741:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const g={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(g),c.dispose=()=>this._wrappedAddonDispose(g),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===o){c=g;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=o(3785),g=o(511);s.BufferApiView=class{constructor(f,m){this._buffer=f,this.type=m}init(f){return this._buffer=f,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(f){const m=this._buffer.lines.get(f);if(m)return new c.BufferLineApiView(m)}getNullCell(){return new g.CellData}}},3785:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=o(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new c.CellData)}translateToString(g,f,m){return this._line.translateToString(g,f,m)}}},8285:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=o(8771),g=o(8460),f=o(844);class m extends f.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=m},7975:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,(g=>c(g.toArray())))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,((g,f)=>c(g,f.toArray())))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(d,s,o){var c=this&&this.__decorate||function(l,h,u,p){var b,E=arguments.length,y=E<3?h:p===null?p=Object.getOwnPropertyDescriptor(h,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,h,u,p);else for(var C=l.length-1;C>=0;C--)(b=l[C])&&(y=(E<3?b(y):E>3?b(h,u,y):b(h,u))||y);return E>3&&y&&Object.defineProperty(h,u,y),y},g=this&&this.__param||function(l,h){return function(u,p){h(u,p,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const f=o(8460),m=o(844),_=o(5295),w=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let v=s.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(l,this))}resize(l,h){this.cols=l,this.rows=h,this.buffers.resize(l,h),this._onResize.fire({cols:l,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,h=!1){const u=this.buffer;let p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===l.fg&&p.getBg(0)===l.bg||(p=u.getBlankLine(l,h),this._cachedBlankLine=p),p.isWrapped=h;const b=u.ybase+u.scrollTop,E=u.ybase+u.scrollBottom;if(u.scrollTop===0){const y=u.lines.isFull;E===u.lines.length-1?y?u.lines.recycle().copyFrom(p):u.lines.push(p.clone()):u.lines.splice(E+1,0,p.clone()),y?this.isUserScrolling&&(u.ydisp=Math.max(u.ydisp-1,0)):(u.ybase++,this.isUserScrolling||u.ydisp++)}else{const y=E-b+1;u.lines.shiftElements(b+1,y-1,-1),u.lines.set(E,p.clone())}this.isUserScrolling||(u.ydisp=u.ybase),this._onScroll.fire(u.ydisp)}scrollLines(l,h,u){const p=this.buffer;if(l<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else l+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);const b=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+l,p.ybase),0),b!==p.ydisp&&(h||this._onScroll.fire(p.ydisp))}};s.BufferService=v=c([g(0,w.IOptionsService)],v)},7994:(d,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(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(d,s,o){var c=this&&this.__decorate||function(p,b,E,y){var C,S=arguments.length,k=S<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,b,E,y);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(S<3?C(k):S>3?C(b,E,k):C(b,E))||k);return S>3&&k&&Object.defineProperty(b,E,k),k},g=this&&this.__param||function(p,b){return function(E,y){b(E,y,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const f=o(2585),m=o(8460),_=o(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function v(p,b){let E=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(E|=64,E|=p.action):(E|=3&p.button,4&p.button&&(E|=64),8&p.button&&(E|=128),p.action===32?E|=32:p.action!==0||b||(E|=3)),E}const l=String.fromCharCode,h={DEFAULT:p=>{const b=[v(p,!1)+32,p.col+32,p.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${l(b[0])}${l(b[1])}${l(b[2])}`},SGR:p=>{const b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${v(p,!0)};${p.col};${p.row}${b}`},SGR_PIXELS:p=>{const b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${v(p,!0)};${p.x};${p.y}${b}`}};let u=s.CoreMouseService=class extends _.Disposable{constructor(p,b){super(),this._bufferService=p,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(h))this.addEncoding(E,h[E]);this.reset()}addProtocol(p,b){this._protocols[p]=b}addEncoding(p,b){this._encodings[p]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;const b=this._encodings[this._activeEncoding](p);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,b,E){if(E){if(p.x!==b.x||p.y!==b.y)return!1}else if(p.col!==b.col||p.row!==b.row)return!1;return p.button===b.button&&p.action===b.action&&p.ctrl===b.ctrl&&p.alt===b.alt&&p.shift===b.shift}};s.CoreMouseService=u=c([g(0,f.IBufferService),g(1,f.ICoreService)],u)},6975:function(d,s,o){var c=this&&this.__decorate||function(u,p,b,E){var y,C=arguments.length,S=C<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,p,b,E);else for(var k=u.length-1;k>=0;k--)(y=u[k])&&(S=(C<3?y(S):C>3?y(p,b,S):y(p,b))||S);return C>3&&S&&Object.defineProperty(p,b,S),S},g=this&&this.__param||function(u,p){return function(b,E){p(b,E,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const f=o(1439),m=o(8460),_=o(844),w=o(2585),v=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=s.CoreService=class extends _.Disposable{constructor(u,p,b){super(),this._bufferService=u,this._logService=p,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(v),this.decPrivateModes=(0,f.clone)(l)}reset(){this.modes=(0,f.clone)(v),this.decPrivateModes=(0,f.clone)(l)}triggerDataEvent(u,p=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),p&&this._onUserInput.fire(),this._logService.debug(`sending data "${u}"`,(()=>u.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(u)}triggerBinaryEvent(u){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${u}"`,(()=>u.split("").map((p=>p.charCodeAt(0))))),this._onBinary.fire(u))}};s.CoreService=h=c([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],h)},9074:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=o(8055),g=o(8460),f=o(844),m=o(6106);let _=0,w=0;class v extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((u=>u==null?void 0:u.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(u){if(u.marker.isDisposed)return;const p=new l(u);if(p){const b=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),b.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(const u of this._decorations.values())u.dispose();this._decorations.clear()}*getDecorationsAtCell(u,p,b){let E=0,y=0;for(const C of this._decorations.getKeyIterator(p))E=C.options.x??0,y=E+(C.options.width??1),u>=E&&u<y&&(!b||(C.options.layer??"bottom")===b)&&(yield C)}forEachDecorationAtCell(u,p,b,E){this._decorations.forEachByKey(p,(y=>{_=y.options.x??0,w=_+(y.options.width??1),u>=_&&u<w&&(!b||(y.options.layer??"bottom")===b)&&E(y)}))}}s.DecorationService=v;class l extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(u){super(),this.options=u,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=u.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=o(2585),g=o(8343);class f{constructor(..._){this._entries=new Map;for(const[w,v]of _)this.set(w,v)}set(_,w){const v=this._entries.get(_);return this._entries.set(_,w),v}forEach(_){for(const[w,v]of this._entries.entries())_(w,v)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=f,s.InstantiationService=class{constructor(){this._services=new f,this._services.set(c.IInstantiationService,this)}setService(m,_){this._services.set(m,_)}getService(m){return this._services.get(m)}createInstance(m,..._){const w=(0,g.getServiceDependencies)(m).sort(((h,u)=>h.index-u.index)),v=[];for(const h of w){const u=this._services.get(h.id);if(!u)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${h.id}.`);v.push(u)}const l=w.length>0?w[0].index:_.length;if(_.length!==l)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${l+1} conflicts with ${_.length} static arguments`);return new m(..._,...v)}}},7866:function(d,s,o){var c=this&&this.__decorate||function(l,h,u,p){var b,E=arguments.length,y=E<3?h:p===null?p=Object.getOwnPropertyDescriptor(h,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,h,u,p);else for(var C=l.length-1;C>=0;C--)(b=l[C])&&(y=(E<3?b(y):E>3?b(h,u,y):b(h,u))||y);return E>3&&y&&Object.defineProperty(h,u,y),y},g=this&&this.__param||function(l,h){return function(u,p){h(u,p,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const f=o(844),m=o(2585),_={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let w,v=s.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let h=0;h<l.length;h++)typeof l[h]=="function"&&(l[h]=l[h]())}_log(l,h,u){this._evalLazyOptionalParams(u),l.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...u)}trace(l,...h){var u;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((u=this._optionsService.options.logger)==null?void 0:u.trace.bind(this._optionsService.options.logger))??console.log,l,h)}debug(l,...h){var u;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((u=this._optionsService.options.logger)==null?void 0:u.debug.bind(this._optionsService.options.logger))??console.log,l,h)}info(l,...h){var u;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((u=this._optionsService.options.logger)==null?void 0:u.info.bind(this._optionsService.options.logger))??console.info,l,h)}warn(l,...h){var u;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((u=this._optionsService.options.logger)==null?void 0:u.warn.bind(this._optionsService.options.logger))??console.warn,l,h)}error(l,...h){var u;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((u=this._optionsService.options.logger)==null?void 0:u.error.bind(this._optionsService.options.logger))??console.error,l,h)}};s.LogService=v=c([g(0,m.IOptionsService)],v),s.setTraceLogger=function(l){w=l},s.traceCall=function(l,h,u){if(typeof u.value!="function")throw new Error("not supported");const p=u.value;u.value=function(...b){if(w.logLevel!==m.LogLevelEnum.TRACE)return p.apply(this,b);w.trace(`GlyphRenderer#${p.name}(${b.map((y=>JSON.stringify(y))).join(", ")})`);const E=p.apply(this,b);return w.trace(`GlyphRenderer#${p.name} return`,E),E}}},7302:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=o(8460),g=o(844),f=o(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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends g.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l={...s.DEFAULT_OPTIONS};for(const h in v)if(h in l)try{const u=v[h];l[h]=this._sanitizeAndValidateOption(h,u)}catch(u){console.error(u)}this.rawOptions=l,this.options={...l},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,l){return this.onOptionChange((h=>{h===v&&l(this.rawOptions[v])}))}onMultipleOptionChange(v,l){return this.onOptionChange((h=>{v.indexOf(h)!==-1&&l()}))}_setupOptions(){const v=h=>{if(!(h in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},l=(h,u)=>{if(!(h in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);u=this._sanitizeAndValidateOption(h,u),this.rawOptions[h]!==u&&(this.rawOptions[h]=u,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const u={get:v.bind(this,h),set:l.bind(this,h)};Object.defineProperty(this.options,h,u)}}_sanitizeAndValidateOption(v,l){switch(v){case"cursorStyle":if(l||(l=s.DEFAULT_OPTIONS[v]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(l))throw new Error(`"${l}" is not a valid value for ${v}`);break;case"wordSeparator":l||(l=s.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=m.includes(l)?l:s.DEFAULT_OPTIONS[v];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${v} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${v} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}s.OptionsService=_},2660:function(d,s,o){var c=this&&this.__decorate||function(_,w,v,l){var h,u=arguments.length,p=u<3?w:l===null?l=Object.getOwnPropertyDescriptor(w,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(_,w,v,l);else for(var b=_.length-1;b>=0;b--)(h=_[b])&&(p=(u<3?h(p):u>3?h(w,v,p):h(w,v))||p);return u>3&&p&&Object.defineProperty(w,v,p),p},g=this&&this.__param||function(_,w){return function(v,l){w(v,l,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const f=o(2585);let m=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const w=this._bufferService.buffer;if(_.id===void 0){const b=w.addMarker(w.ybase+w.y),E={data:_,id:this._nextId++,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(E,b))),this._dataByLinkId.set(E.id,E),E.id}const v=_,l=this._getEntryIdKey(v),h=this._entriesWithId.get(l);if(h)return this.addLineToLink(h.id,w.ybase+w.y),h.id;const u=w.addMarker(w.ybase+w.y),p={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[u]};return u.onDispose((()=>this._removeMarkerFromLink(p,u))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(_,w){const v=this._dataByLinkId.get(_);if(v&&v.lines.every((l=>l.line!==w))){const l=this._bufferService.buffer.addMarker(w);v.lines.push(l),l.onDispose((()=>this._removeMarkerFromLink(v,l)))}}getLinkData(_){var w;return(w=this._dataByLinkId.get(_))==null?void 0:w.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,w){const v=_.lines.indexOf(w);v!==-1&&(_.lines.splice(v,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=m=c([g(0,f.IBufferService)],m)},8343:(d,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[c]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const f=function(m,_,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(f,m,w)};return f.toString=()=>g,s.serviceRegistry.set(g,f),f}},2585:(d,s,o)=>{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 c=o(8343);var g;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=o(8460),g=o(225);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,w,v=!1){return(16777215&_)<<3|(3&w)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new g.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let w=0,v=0;const l=_.length;for(let h=0;h<l;++h){let u=_.charCodeAt(h);if(55296<=u&&u<=56319){if(++h>=l)return w+this.wcwidth(u);const E=_.charCodeAt(h);56320<=E&&E<=57343?u=1024*(u-55296)+E-56320+65536:w+=this.wcwidth(E)}const p=this.charProperties(u,v);let b=f.extractWidth(p);f.extractShouldJoin(p)&&(b-=f.extractWidth(v)),w+=b,v=p}return w}charProperties(_,w){return this._activeProvider.charProperties(_,w)}}s.UnicodeService=f}},i={};function n(d){var s=i[d];if(s!==void 0)return s.exports;var o=i[d]={exports:{}};return r[d].call(o.exports,o,o.exports,n),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const s=n(9042),o=n(3236),c=n(844),g=n(5741),f=n(8285),m=n(7975),_=n(7090),w=["cols","rows"];class v extends c.Disposable{constructor(h){super(),this._core=this.register(new o.Terminal(h)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const u=b=>this._core.options[b],p=(b,E)=>{this._checkReadonlyOptions(b),this._core.options[b]=E};for(const b in this._core.options){const E={get:u.bind(this,b),set:p.bind(this,b)};Object.defineProperty(this._publicOptions,b,E)}}_checkReadonlyOptions(h){if(w.includes(h))throw new Error(`Option "${h}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let u="none";switch(this._core.coreMouseService.activeProtocol){case"X10":u="x10";break;case"VT200":u="vt200";break;case"DRAG":u="drag";break;case"ANY":u="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:u,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const u in h)this._publicOptions[u]=h[u]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,u=!0){this._core.input(h,u)}resize(h,u){this._verifyIntegers(h,u),this._core.resize(h,u)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,u,p){this._verifyIntegers(h,u,p),this._core.select(h,u,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,u){this._verifyIntegers(h,u),this._core.selectLines(h,u)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,u){this._core.write(h,u)}writeln(h,u){this._core.write(h),this._core.write(`\r
166
+ `,u)}paste(h){this._core.paste(h)}refresh(h,u){this._verifyIntegers(h,u),this._core.refresh(h,u)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return s}_verifyIntegers(...h){for(const u of h)if(u===1/0||isNaN(u)||u%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const u of h)if(u&&(u===1/0||isNaN(u)||u%1!=0||u<0))throw new Error("This API only accepts positive integers")}}d.Terminal=v})(),a})()))})(Vo)),Vo.exports}var Jh=Xh();/**
167
167
  * @license
168
168
  * Copyright 2021 Google LLC
169
169
  * SPDX-License-Identifier: BSD-3-Clause
170
- */function ve(e,t,r){return e?t(e):r==null?void 0:r(e)}function oe(e){return typeof e=="function"}function Ha(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Ui=Ha(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
170
+ */function be(e,t,r){return e?t(e):r==null?void 0:r(e)}function oe(e){return typeof e=="function"}function el(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var dn=el(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
171
171
  `+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
172
- `):"",this.name="UnsubscriptionError",this.errors=t}});function di(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var xr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,s,h;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var n=Ft(p),o=n.next();!o.done;o=n.next()){var a=o.value;a.remove(this)}}catch(m){t={error:m}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}else p.remove(this);var g=this.initialTeardown;if(oe(g))try{g()}catch(m){h=m instanceof Ui?m.errors:[m]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=Ft(d),b=v.next();!b.done;b=v.next()){var C=b.value;try{Ws(C)}catch(m){h=h??[],m instanceof Ui?h=dt(dt([],rt(h)),rt(m.errors)):h.push(m)}}}catch(m){i={error:m}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(i)throw i.error}}}if(h)throw new Ui(h)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Ws(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&di(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&di(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),$a=xr.EMPTY;function Za(e){return e instanceof xr||e&&"closed"in e&&oe(e.remove)&&oe(e.add)&&oe(e.unsubscribe)}function Ws(e){oe(e)?e():e.unsubscribe()}var Yu={Promise:void 0},Xu={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,dt([e,t],rt(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Ga(e){Xu.setTimeout(function(){throw e})}function mr(){}function ei(e){e()}var xn=(function(e){pt(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Za(r)&&r.add(i)):i.destination=zu,i}return t.create=function(r,i,s){return new _r(r,i,s)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(xr),Ku=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){Hr(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){Hr(i)}else Hr(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Hr(r)}},e})(),_r=(function(e){pt(t,e);function t(r,i,s){var h=e.call(this)||this,p;return oe(r)||!r?p={next:r??void 0,error:i??void 0,complete:s??void 0}:p=r,h.destination=new Ku(p),h}return t})(xn);function Hr(e){Ga(e)}function ju(e){throw e}var zu={closed:!0,next:mr,error:ju,complete:mr},Dn=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Dr(e){return e}function Ju(e){return e.length===0?Dr:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var _e=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var s=this,h=qu(t)?t:new _r(t,r,i);return ei(function(){var p=s,n=p.operator,o=p.source;h.add(n?n.call(h,o):o?s._subscribe(h):s._trySubscribe(h))}),h},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Hs(r),new r(function(s,h){var p=new _r({next:function(n){try{t(n)}catch(o){h(o),p.unsubscribe()}},error:h,complete:s});i.subscribe(p)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Dn]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Ju(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Hs(t),new t(function(i,s){var h;r.subscribe(function(p){return h=p},function(p){return s(p)},function(){return i(h)})})},e.create=function(t){return new e(t)},e})();function Hs(e){var t;return(t=e??Yu.Promise)!==null&&t!==void 0?t:Promise}function Qu(e){return e&&oe(e.next)&&oe(e.error)&&oe(e.complete)}function qu(e){return e&&e instanceof xn||Qu(e)&&Za(e)}function ed(e){return oe(e==null?void 0:e.lift)}function Se(e){return function(t){if(ed(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function he(e,t,r,i,s){return new td(e,t,r,i,s)}var td=(function(e){pt(t,e);function t(r,i,s,h,p,n){var o=e.call(this,r)||this;return o.onFinalize=p,o.shouldUnsubscribe=n,o._next=i?function(a){try{i(a)}catch(g){r.error(g)}}:e.prototype._next,o._error=h?function(a){try{h(a)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=s?function(){try{s()}catch(a){r.error(a)}finally{this.unsubscribe()}}:e.prototype._complete,o}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(xn),rd=Ha(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),We=(function(e){pt(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new $s(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new rd},t.prototype.next=function(r){var i=this;ei(function(){var s,h;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var p=Ft(i.currentObservers),n=p.next();!n.done;n=p.next()){var o=n.value;o.next(r)}}catch(a){s={error:a}}finally{try{n&&!n.done&&(h=p.return)&&h.call(p)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var i=this;ei(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;ei(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,s=this,h=s.hasError,p=s.isStopped,n=s.observers;return h||p?$a:(this.currentObservers=null,n.push(r),new xr(function(){i.currentObservers=null,di(n,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,h=i.thrownError,p=i.isStopped;s?r.error(h):p&&r.complete()},t.prototype.asObservable=function(){var r=new _e;return r.source=this,r},t.create=function(r,i){return new $s(r,i)},t})(_e),$s=(function(e){pt(t,e);function t(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return t.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},t.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:$a},t})(We),id={now:function(){return Date.now()}},nd=(function(e){pt(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(xr),Zs={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,dt([e,t],rt(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},sd=(function(e){pt(t,e);function t(r,i){var s=e.call(this,r,i)||this;return s.scheduler=r,s.work=i,s.pending=!1,s}return t.prototype.schedule=function(r,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var h=this.id,p=this.scheduler;return h!=null&&(this.id=this.recycleAsyncId(p,h,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(p,this.id,i),this},t.prototype.requestAsyncId=function(r,i,s){return s===void 0&&(s=0),Zs.setInterval(r.flush.bind(r,this),s)},t.prototype.recycleAsyncId=function(r,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&Zs.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(r,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var s=!1,h;try{this.work(r)}catch(p){s=!0,h=p||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),h},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,s=r.scheduler,h=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,di(h,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(nd),Gs=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=id.now,e})(),od=(function(e){pt(t,e);function t(r,i){i===void 0&&(i=Gs.now);var s=e.call(this,r,i)||this;return s.actions=[],s._active=!1,s}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var s;this._active=!0;do if(s=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,s){for(;r=i.shift();)r.unsubscribe();throw s}},t})(Gs),Or=new od(sd),ad=Or,Ya=new _e(function(e){return e.complete()});function Xa(e){return e&&oe(e.schedule)}function On(e){return e[e.length-1]}function cd(e){return oe(On(e))?e.pop():void 0}function Ka(e){return Xa(On(e))?e.pop():void 0}function ld(e,t){return typeof On(e)=="number"?e.pop():t}var Fn=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function ja(e){return oe(e==null?void 0:e.then)}function za(e){return oe(e[Dn])}function Ja(e){return Symbol.asyncIterator&&oe(e==null?void 0:e[Symbol.asyncIterator])}function Qa(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ud(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var qa=ud();function ec(e){return oe(e==null?void 0:e[qa])}function tc(e){return uu(this,arguments,function(){var t,r,i,s;return xa(this,function(h){switch(h.label){case 0:t=e.getReader(),h.label=1;case 1:h.trys.push([1,,9,10]),h.label=2;case 2:return[4,xt(t.read())];case 3:return r=h.sent(),i=r.value,s=r.done,s?[4,xt(void 0)]:[3,5];case 4:return[2,h.sent()];case 5:return[4,xt(i)];case 6:return[4,h.sent()];case 7:return h.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function rc(e){return oe(e==null?void 0:e.getReader)}function Ee(e){if(e instanceof _e)return e;if(e!=null){if(za(e))return dd(e);if(Fn(e))return hd(e);if(ja(e))return fd(e);if(Ja(e))return ic(e);if(ec(e))return pd(e);if(rc(e))return gd(e)}throw Qa(e)}function dd(e){return new _e(function(t){var r=e[Dn]();if(oe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function hd(e){return new _e(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function fd(e){return new _e(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Ga)})}function pd(e){return new _e(function(t){var r,i;try{for(var s=Ft(e),h=s.next();!h.done;h=s.next()){var p=h.value;if(t.next(p),t.closed)return}}catch(n){r={error:n}}finally{try{h&&!h.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}t.complete()})}function ic(e){return new _e(function(t){vd(e,t).catch(function(r){return t.error(r)})})}function gd(e){return ic(tc(e))}function vd(e,t){var r,i,s,h;return lu(this,void 0,void 0,function(){var p,n;return xa(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=du(e),o.label=1;case 1:return[4,r.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(p=i.value,t.next(p),t.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return n=o.sent(),s={error:n},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(h=r.return)?[4,h.call(r)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function wt(e,t,r,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var h=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(h),!s)return h}function nc(e,t){return t===void 0&&(t=0),Se(function(r,i){r.subscribe(he(i,function(s){return wt(i,e,function(){return i.next(s)},t)},function(){return wt(i,e,function(){return i.complete()},t)},function(s){return wt(i,e,function(){return i.error(s)},t)}))})}function sc(e,t){return t===void 0&&(t=0),Se(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function md(e,t){return Ee(e).pipe(sc(t),nc(t))}function _d(e,t){return Ee(e).pipe(sc(t),nc(t))}function bd(e,t){return new _e(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function yd(e,t){return new _e(function(r){var i;return wt(r,t,function(){i=e[qa](),wt(r,t,function(){var s,h,p;try{s=i.next(),h=s.value,p=s.done}catch(n){r.error(n);return}p?r.complete():r.next(h)},0,!0)}),function(){return oe(i==null?void 0:i.return)&&i.return()}})}function oc(e,t){if(!e)throw new Error("Iterable cannot be null");return new _e(function(r){wt(r,t,function(){var i=e[Symbol.asyncIterator]();wt(r,t,function(){i.next().then(function(s){s.done?r.complete():r.next(s.value)})},0,!0)})})}function Sd(e,t){return oc(tc(e),t)}function Ed(e,t){if(e!=null){if(za(e))return md(e,t);if(Fn(e))return bd(e,t);if(ja(e))return _d(e,t);if(Ja(e))return oc(e,t);if(ec(e))return yd(e,t);if(rc(e))return Sd(e,t)}throw Qa(e)}function ac(e,t){return t?Ed(e,t):Ee(e)}function Cd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ka(e);return ac(e,r)}function wd(e){return e instanceof Date&&!isNaN(e)}function Oe(e,t){return Se(function(r,i){var s=0;r.subscribe(he(i,function(h){i.next(e.call(t,h,s++))}))})}var kd=Array.isArray;function Id(e,t){return kd(t)?e.apply(void 0,dt([],rt(t))):e(t)}function Ad(e){return Oe(function(t){return Id(e,t)})}function Td(e,t,r,i,s,h,p,n){var o=[],a=0,g=0,d=!1,v=function(){d&&!o.length&&!a&&t.complete()},b=function(m){return a<i?C(m):o.push(m)},C=function(m){a++;var c=!1;Ee(r(m,g++)).subscribe(he(t,function(u){t.next(u)},function(){c=!0},void 0,function(){if(c)try{a--;for(var u=function(){var l=o.shift();p||C(l)};o.length&&a<i;)u();v()}catch(l){t.error(l)}}))};return e.subscribe(he(t,b,function(){d=!0,v()})),function(){}}function yt(e,t,r){return r===void 0&&(r=1/0),oe(t)?yt(function(i,s){return Oe(function(h,p){return t(i,h,s,p)})(Ee(e(i,s)))},r):(typeof t=="number"&&(r=t),Se(function(i,s){return Td(i,s,e,r)}))}function Rd(e){return e===void 0&&(e=1/0),yt(Dr,e)}function Bd(e){return new _e(function(t){Ee(e()).subscribe(t)})}var Nd={connector:function(){return new We},resetOnDisconnect:!0};function mt(e,t){t===void 0&&(t=Nd);var r=null,i=t.connector,s=t.resetOnDisconnect,h=s===void 0?!0:s,p=i(),n=new _e(function(o){return p.subscribe(o)});return n.connect=function(){return(!r||r.closed)&&(r=Bd(function(){return e}).subscribe(p),h&&r.add(function(){return p=i()})),r},n}var Ld=["addListener","removeListener"],xd=["addEventListener","removeEventListener"],Dd=["on","off"];function an(e,t,r,i){if(oe(r)&&(i=r,r=void 0),i)return an(e,t,r).pipe(Ad(i));var s=rt(Md(e)?xd.map(function(n){return function(o){return e[n](t,o,r)}}):Od(e)?Ld.map(Ys(e,t)):Fd(e)?Dd.map(Ys(e,t)):[],2),h=s[0],p=s[1];if(!h&&Fn(e))return yt(function(n){return an(n,t,r)})(Ee(e));if(!h)throw new TypeError("Invalid event target");return new _e(function(n){var o=function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];return n.next(1<a.length?a:a[0])};return h(o),function(){return p(o)}})}function Ys(e,t){return function(r){return function(i){return e[r](t,i)}}}function Od(e){return oe(e.addListener)&&oe(e.removeListener)}function Fd(e){return oe(e.on)&&oe(e.off)}function Md(e){return oe(e.addEventListener)&&oe(e.removeEventListener)}function lr(e,t,r){e===void 0&&(e=0),r===void 0&&(r=ad);var i=-1;return t!=null&&(Xa(t)?r=t:i=t),new _e(function(s){var h=wd(e)?+e-r.now():e;h<0&&(h=0);var p=0;return r.schedule(function(){s.closed||(s.next(p++),0<=i?this.schedule(void 0,i):s.complete())},h)})}function Ud(e,t){return t===void 0&&(t=Or),lr(e,e,t)}function Vd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ka(e),i=ld(e,1/0),s=e;return s.length?s.length===1?Ee(s[0]):Rd(i)(ac(s,r)):Ya}var Pd=Array.isArray;function Wd(e){return e.length===1&&Pd(e[0])?e[0]:e}function je(e,t){return Se(function(r,i){var s=0;r.subscribe(he(i,function(h){return e.call(t,h,s++)&&i.next(h)}))})}function Hd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=Wd(e),e.length===1?Ee(e[0]):new _e($d(e))}function $d(e){return function(t){for(var r=[],i=function(h){r.push(Ee(e[h]).subscribe(he(t,function(p){if(r){for(var n=0;n<r.length;n++)n!==h&&r[n].unsubscribe();r=null}t.next(p)})))},s=0;r&&!t.closed&&s<e.length;s++)i(s)}}function Zd(e){return Se(function(t,r){var i=null,s=null,h=function(){s==null||s.unsubscribe();var p=i;i=[],p&&r.next(p),Ee(e()).subscribe(s=he(r,h,mr))};h(),t.subscribe(he(r,function(p){return i==null?void 0:i.push(p)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=s=null}))})}function cc(e){return Se(function(t,r){var i=null,s=!1,h;i=t.subscribe(he(r,void 0,void 0,function(p){h=Ee(e(p,cc(e)(t))),i?(i.unsubscribe(),i=null,h.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,h.subscribe(r))})}function Gd(e,t,r,i,s){return function(h,p){var n=r,o=t,a=0;h.subscribe(he(p,function(g){var d=a++;o=n?e(o,g,d):(n=!0,g),p.next(o)},s))}}function lc(e,t){return t===void 0&&(t=Or),Se(function(r,i){var s=null,h=null,p=null,n=function(){if(s){s.unsubscribe(),s=null;var a=h;h=null,i.next(a)}};function o(){var a=p+e,g=t.now();if(g<a){s=this.schedule(void 0,a-g),i.add(s);return}n()}r.subscribe(he(i,function(a){h=a,p=t.now(),s||(s=t.schedule(o,e),i.add(s))},function(){n(),i.complete()},void 0,function(){h=s=null}))})}function Xs(e){return e<=0?function(){return Ya}:Se(function(t,r){var i=0;t.subscribe(he(r,function(s){++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function uc(e,t){return t===void 0&&(t=Dr),e=e??Yd,Se(function(r,i){var s,h=!0;r.subscribe(he(i,function(p){var n=t(p);(h||!e(s,n))&&(h=!1,s=n,i.next(p))}))})}function Yd(e,t){return e===t}function Xd(e){return Se(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function Kd(e,t){return Se(Gd(e,t,arguments.length>=2,!0))}function dc(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new We}:t,i=e.resetOnError,s=i===void 0?!0:i,h=e.resetOnComplete,p=h===void 0?!0:h,n=e.resetOnRefCountZero,o=n===void 0?!0:n;return function(a){var g,d,v,b=0,C=!1,m=!1,c=function(){d==null||d.unsubscribe(),d=void 0},u=function(){c(),g=v=void 0,C=m=!1},l=function(){var f=g;u(),f==null||f.unsubscribe()};return Se(function(f,_){b++,!m&&!C&&c();var E=v=v??r();_.add(function(){b--,b===0&&!m&&!C&&(d=Vi(l,o))}),E.subscribe(_),!g&&b>0&&(g=new _r({next:function(y){return E.next(y)},error:function(y){m=!0,c(),d=Vi(u,s,y),E.error(y)},complete:function(){C=!0,c(),d=Vi(u,p),E.complete()}}),Ee(f).subscribe(g))})(a)}}function Vi(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var s=new _r({next:function(){s.unsubscribe(),e()}});return Ee(t.apply(void 0,dt([],rt(r)))).subscribe(s)}}function jd(e){return Se(function(t,r){var i=!1,s=he(r,function(){s==null||s.unsubscribe(),i=!0},mr);Ee(e).subscribe(s),t.subscribe(he(r,function(h){return i&&r.next(h)}))})}function Ks(e,t){return Se(function(r,i){var s=null,h=0,p=!1,n=function(){return p&&!s&&i.complete()};r.subscribe(he(i,function(o){s==null||s.unsubscribe();var a=0,g=h++;Ee(e(o,g)).subscribe(s=he(i,function(d){return i.next(t?t(o,d,g,a++):d)},function(){s=null,n()}))},function(){p=!0,n()}))})}function $r(e,t){return t===void 0&&(t=!1),Se(function(r,i){var s=0;r.subscribe(he(i,function(h){var p=e(h,s++);(p||t)&&i.next(h),!p&&i.complete()}))})}function zd(e,t,r){var i=oe(e)||t||r?{next:e,error:t,complete:r}:e;return i?Se(function(s,h){var p;(p=i.subscribe)===null||p===void 0||p.call(i);var n=!0;s.subscribe(he(h,function(o){var a;(a=i.next)===null||a===void 0||a.call(i,o),h.next(o)},function(){var o;n=!1,(o=i.complete)===null||o===void 0||o.call(i),h.complete()},function(o){var a;n=!1,(a=i.error)===null||a===void 0||a.call(i,o),h.error(o)},function(){var o,a;n&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(a=i.finalize)===null||a===void 0||a.call(i)}))}):Dr}function Jd(e,t){return Se(function(r,i){var s=t??{},h=s.leading,p=h===void 0?!0:h,n=s.trailing,o=n===void 0?!1:n,a=!1,g=null,d=null,v=!1,b=function(){d==null||d.unsubscribe(),d=null,o&&(c(),v&&i.complete())},C=function(){d=null,v&&i.complete()},m=function(u){return d=Ee(e(u)).subscribe(he(i,b,C))},c=function(){if(a){a=!1;var u=g;g=null,i.next(u),!v&&m(u)}};r.subscribe(he(i,function(u){a=!0,g=u,!(d&&!d.closed)&&(p?c():m(u))},function(){v=!0,!(o&&a&&d&&!d.closed)&&i.complete()}))})}function js(e,t,r){t===void 0&&(t=Or);var i=lr(e,t);return Jd(function(){return i},r)}function Pi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=cd(e);return Se(function(i,s){for(var h=e.length,p=new Array(h),n=e.map(function(){return!1}),o=!1,a=function(d){Ee(e[d]).subscribe(he(s,function(v){p[d]=v,!o&&!n[d]&&(n[d]=!0,(o=n.every(Dr))&&(n=null))},mr))},g=0;g<h;g++)a(g);i.subscribe(he(s,function(d){if(o){var v=dt([d],rt(p));s.next(r?r.apply(void 0,dt([],rt(v))):v)}}))})}/**
172
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Ai(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Yr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,a;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var s=qt(d),o=s.next();!o.done;o=s.next()){var c=o.value;c.remove(this)}}catch(v){t={error:v}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else d.remove(this);var g=this.initialTeardown;if(oe(g))try{g()}catch(v){a=v instanceof dn?v.errors:[v]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var m=qt(f),_=m.next();!_.done;_=m.next()){var w=_.value;try{Mo(w)}catch(v){a=a??[],v instanceof dn?a=_t(_t([],ut(a)),ut(v.errors)):a.push(v)}}}catch(v){i={error:v}}finally{try{_&&!_.done&&(n=m.return)&&n.call(m)}finally{if(i)throw i.error}}}if(a)throw new dn(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Mo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Ai(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ai(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),tl=Yr.EMPTY;function rl(e){return e instanceof Yr||e&&"closed"in e&&oe(e.remove)&&oe(e.add)&&oe(e.unsubscribe)}function Mo(e){oe(e)?e():e.unsubscribe()}var jh={Promise:void 0},zh={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,_t([e,t],ut(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function il(e){zh.setTimeout(function(){throw e})}function Br(){}function mi(e){e()}var fs=(function(e){Ct(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,rl(r)&&r.add(i)):i.destination=ef,i}return t.create=function(r,i,n){return new Lr(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Yr),Qh=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){ni(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){ni(i)}else ni(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ni(r)}},e})(),Lr=(function(e){Ct(t,e);function t(r,i,n){var a=e.call(this)||this,d;return oe(r)||!r?d={next:r??void 0,error:i??void 0,complete:n??void 0}:d=r,a.destination=new Qh(d),a}return t})(fs);function ni(e){il(e)}function qh(e){throw e}var ef={closed:!0,next:Br,error:qh,complete:Br},ps=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Xr(e){return e}function tf(e){return e.length===0?Xr:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var Ee=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,a=nf(t)?t:new Lr(t,r,i);return mi(function(){var d=n,s=d.operator,o=d.source;a.add(s?s.call(a,o):o?n._subscribe(a):n._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Po(r),new r(function(n,a){var d=new Lr({next:function(s){try{t(s)}catch(o){a(o),d.unsubscribe()}},error:a,complete:n});i.subscribe(d)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[ps]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return tf(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Po(t),new t(function(i,n){var a;r.subscribe(function(d){return a=d},function(d){return n(d)},function(){return i(a)})})},e.create=function(t){return new e(t)},e})();function Po(e){var t;return(t=e??jh.Promise)!==null&&t!==void 0?t:Promise}function rf(e){return e&&oe(e.next)&&oe(e.error)&&oe(e.complete)}function nf(e){return e&&e instanceof fs||rf(e)&&rl(e)}function sf(e){return oe(e==null?void 0:e.lift)}function ke(e){return function(t){if(sf(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function pe(e,t,r,i,n){return new of(e,t,r,i,n)}var of=(function(e){Ct(t,e);function t(r,i,n,a,d,s){var o=e.call(this,r)||this;return o.onFinalize=d,o.shouldUnsubscribe=s,o._next=i?function(c){try{i(c)}catch(g){r.error(g)}}:e.prototype._next,o._error=a?function(c){try{a(c)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=n?function(){try{n()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,o}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(fs),af=el(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ye=(function(e){Ct(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Wo(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new af},t.prototype.next=function(r){var i=this;mi(function(){var n,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=qt(i.currentObservers),s=d.next();!s.done;s=d.next()){var o=s.value;o.next(r)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(a=d.return)&&a.call(d)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;mi(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;mi(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,a=n.hasError,d=n.isStopped,s=n.observers;return a||d?tl:(this.currentObservers=null,s.push(r),new Yr(function(){i.currentObservers=null,Ai(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,a=i.thrownError,d=i.isStopped;n?r.error(a):d&&r.complete()},t.prototype.asObservable=function(){var r=new Ee;return r.source=this,r},t.create=function(r,i){return new Wo(r,i)},t})(Ee),Wo=(function(e){Ct(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:tl},t})(Ye),cf={now:function(){return Date.now()}},lf=(function(e){Ct(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(Yr),$o={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,_t([e,t],ut(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},uf=(function(e){Ct(t,e);function t(r,i){var n=e.call(this,r,i)||this;return n.scheduler=r,n.work=i,n.pending=!1,n}return t.prototype.schedule=function(r,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var a=this.id,d=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(d,a,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(d,this.id,i),this},t.prototype.requestAsyncId=function(r,i,n){return n===void 0&&(n=0),$o.setInterval(r.flush.bind(r,this),n)},t.prototype.recycleAsyncId=function(r,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&$o.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(r,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var n=!1,a;try{this.work(r)}catch(d){n=!0,a=d||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,n=r.scheduler,a=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ai(a,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(lf),Ho=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=cf.now,e})(),df=(function(e){Ct(t,e);function t(r,i){i===void 0&&(i=Ho.now);var n=e.call(this,r,i)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var n;this._active=!0;do if(n=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,n){for(;r=i.shift();)r.unsubscribe();throw n}},t})(Ho),Jr=new df(uf),hf=Jr,nl=new Ee(function(e){return e.complete()});function sl(e){return e&&oe(e.schedule)}function gs(e){return e[e.length-1]}function ff(e){return oe(gs(e))?e.pop():void 0}function ol(e){return sl(gs(e))?e.pop():void 0}function pf(e,t){return typeof gs(e)=="number"?e.pop():t}var ms=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function al(e){return oe(e==null?void 0:e.then)}function cl(e){return oe(e[ps])}function ll(e){return Symbol.asyncIterator&&oe(e==null?void 0:e[Symbol.asyncIterator])}function ul(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function gf(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dl=gf();function hl(e){return oe(e==null?void 0:e[dl])}function fl(e){return ph(this,arguments,function(){var t,r,i,n;return Zc(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,jt(t.read())];case 3:return r=a.sent(),i=r.value,n=r.done,n?[4,jt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,jt(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function pl(e){return oe(e==null?void 0:e.getReader)}function Te(e){if(e instanceof Ee)return e;if(e!=null){if(cl(e))return mf(e);if(ms(e))return vf(e);if(al(e))return bf(e);if(ll(e))return gl(e);if(hl(e))return _f(e);if(pl(e))return yf(e)}throw ul(e)}function mf(e){return new Ee(function(t){var r=e[ps]();if(oe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function vf(e){return new Ee(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function bf(e){return new Ee(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,il)})}function _f(e){return new Ee(function(t){var r,i;try{for(var n=qt(e),a=n.next();!a.done;a=n.next()){var d=a.value;if(t.next(d),t.closed)return}}catch(s){r={error:s}}finally{try{a&&!a.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function gl(e){return new Ee(function(t){Sf(e,t).catch(function(r){return t.error(r)})})}function yf(e){return gl(fl(e))}function Sf(e,t){var r,i,n,a;return fh(this,void 0,void 0,function(){var d,s;return Zc(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=gh(e),o.label=1;case 1:return[4,r.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(d=i.value,t.next(d),t.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=o.sent(),n={error:s},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Ut(e,t,r,i,n){i===void 0&&(i=0),n===void 0&&(n=!1);var a=t.schedule(function(){r(),n?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(a),!n)return a}function ml(e,t){return t===void 0&&(t=0),ke(function(r,i){r.subscribe(pe(i,function(n){return Ut(i,e,function(){return i.next(n)},t)},function(){return Ut(i,e,function(){return i.complete()},t)},function(n){return Ut(i,e,function(){return i.error(n)},t)}))})}function vl(e,t){return t===void 0&&(t=0),ke(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function Ef(e,t){return Te(e).pipe(vl(t),ml(t))}function wf(e,t){return Te(e).pipe(vl(t),ml(t))}function Cf(e,t){return new Ee(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function kf(e,t){return new Ee(function(r){var i;return Ut(r,t,function(){i=e[dl](),Ut(r,t,function(){var n,a,d;try{n=i.next(),a=n.value,d=n.done}catch(s){r.error(s);return}d?r.complete():r.next(a)},0,!0)}),function(){return oe(i==null?void 0:i.return)&&i.return()}})}function bl(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ee(function(r){Ut(r,t,function(){var i=e[Symbol.asyncIterator]();Ut(r,t,function(){i.next().then(function(n){n.done?r.complete():r.next(n.value)})},0,!0)})})}function If(e,t){return bl(fl(e),t)}function Af(e,t){if(e!=null){if(cl(e))return Ef(e,t);if(ms(e))return Cf(e,t);if(al(e))return wf(e,t);if(ll(e))return bl(e,t);if(hl(e))return kf(e,t);if(pl(e))return If(e,t)}throw ul(e)}function _l(e,t){return t?Af(e,t):Te(e)}function Nf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ol(e);return _l(e,r)}function Tf(e){return e instanceof Date&&!isNaN(e)}function We(e,t){return ke(function(r,i){var n=0;r.subscribe(pe(i,function(a){i.next(e.call(t,a,n++))}))})}var Rf=Array.isArray;function Bf(e,t){return Rf(t)?e.apply(void 0,_t([],ut(t))):e(t)}function Lf(e){return We(function(t){return Bf(e,t)})}function xf(e,t,r,i,n,a,d,s){var o=[],c=0,g=0,f=!1,m=function(){f&&!o.length&&!c&&t.complete()},_=function(v){return c<i?w(v):o.push(v)},w=function(v){c++;var l=!1;Te(r(v,g++)).subscribe(pe(t,function(h){t.next(h)},function(){l=!0},void 0,function(){if(l)try{c--;for(var h=function(){var u=o.shift();d||w(u)};o.length&&c<i;)h();m()}catch(u){t.error(u)}}))};return e.subscribe(pe(t,_,function(){f=!0,m()})),function(){}}function Dt(e,t,r){return r===void 0&&(r=1/0),oe(t)?Dt(function(i,n){return We(function(a,d){return t(i,a,n,d)})(Te(e(i,n)))},r):(typeof t=="number"&&(r=t),ke(function(i,n){return xf(i,n,e,r)}))}function Df(e){return e===void 0&&(e=1/0),Dt(Xr,e)}function Of(e){return new Ee(function(t){Te(e()).subscribe(t)})}var Ff={connector:function(){return new Ye},resetOnDisconnect:!0};function Tt(e,t){t===void 0&&(t=Ff);var r=null,i=t.connector,n=t.resetOnDisconnect,a=n===void 0?!0:n,d=i(),s=new Ee(function(o){return d.subscribe(o)});return s.connect=function(){return(!r||r.closed)&&(r=Of(function(){return e}).subscribe(d),a&&r.add(function(){return d=i()})),r},s}var Vf=["addListener","removeListener"],Uf=["addEventListener","removeEventListener"],Mf=["on","off"];function Vn(e,t,r,i){if(oe(r)&&(i=r,r=void 0),i)return Vn(e,t,r).pipe(Lf(i));var n=ut($f(e)?Uf.map(function(s){return function(o){return e[s](t,o,r)}}):Pf(e)?Vf.map(Go(e,t)):Wf(e)?Mf.map(Go(e,t)):[],2),a=n[0],d=n[1];if(!a&&ms(e))return Dt(function(s){return Vn(s,t,r)})(Te(e));if(!a)throw new TypeError("Invalid event target");return new Ee(function(s){var o=function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];return s.next(1<c.length?c:c[0])};return a(o),function(){return d(o)}})}function Go(e,t){return function(r){return function(i){return e[r](t,i)}}}function Pf(e){return oe(e.addListener)&&oe(e.removeListener)}function Wf(e){return oe(e.on)&&oe(e.off)}function $f(e){return oe(e.addEventListener)&&oe(e.removeEventListener)}function wr(e,t,r){e===void 0&&(e=0),r===void 0&&(r=hf);var i=-1;return t!=null&&(sl(t)?r=t:i=t),new Ee(function(n){var a=Tf(e)?+e-r.now():e;a<0&&(a=0);var d=0;return r.schedule(function(){n.closed||(n.next(d++),0<=i?this.schedule(void 0,i):n.complete())},a)})}function Hf(e,t){return t===void 0&&(t=Jr),wr(e,e,t)}function Gf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ol(e),i=pf(e,1/0),n=e;return n.length?n.length===1?Te(n[0]):Df(i)(_l(n,r)):nl}var Zf=Array.isArray;function Kf(e){return e.length===1&&Zf(e[0])?e[0]:e}function rt(e,t){return ke(function(r,i){var n=0;r.subscribe(pe(i,function(a){return e.call(t,a,n++)&&i.next(a)}))})}function Yf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=Kf(e),e.length===1?Te(e[0]):new Ee(Xf(e))}function Xf(e){return function(t){for(var r=[],i=function(a){r.push(Te(e[a]).subscribe(pe(t,function(d){if(r){for(var s=0;s<r.length;s++)s!==a&&r[s].unsubscribe();r=null}t.next(d)})))},n=0;r&&!t.closed&&n<e.length;n++)i(n)}}function Jf(e){return ke(function(t,r){var i=null,n=null,a=function(){n==null||n.unsubscribe();var d=i;i=[],d&&r.next(d),Te(e()).subscribe(n=pe(r,a,Br))};a(),t.subscribe(pe(r,function(d){return i==null?void 0:i.push(d)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=n=null}))})}function yl(e){return ke(function(t,r){var i=null,n=!1,a;i=t.subscribe(pe(r,void 0,void 0,function(d){a=Te(e(d,yl(e)(t))),i?(i.unsubscribe(),i=null,a.subscribe(r)):n=!0})),n&&(i.unsubscribe(),i=null,a.subscribe(r))})}function jf(e,t,r,i,n){return function(a,d){var s=r,o=t,c=0;a.subscribe(pe(d,function(g){var f=c++;o=s?e(o,g,f):(s=!0,g),d.next(o)},n))}}function Sl(e,t){return t===void 0&&(t=Jr),ke(function(r,i){var n=null,a=null,d=null,s=function(){if(n){n.unsubscribe(),n=null;var c=a;a=null,i.next(c)}};function o(){var c=d+e,g=t.now();if(g<c){n=this.schedule(void 0,c-g),i.add(n);return}s()}r.subscribe(pe(i,function(c){a=c,d=t.now(),n||(n=t.schedule(o,e),i.add(n))},function(){s(),i.complete()},void 0,function(){a=n=null}))})}function Zo(e){return e<=0?function(){return nl}:ke(function(t,r){var i=0;t.subscribe(pe(r,function(n){++i<=e&&(r.next(n),e<=i&&r.complete())}))})}function El(e,t){return t===void 0&&(t=Xr),e=e??zf,ke(function(r,i){var n,a=!0;r.subscribe(pe(i,function(d){var s=t(d);(a||!e(n,s))&&(a=!1,n=s,i.next(d))}))})}function zf(e,t){return e===t}function Qf(e){return ke(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function qf(e,t){return ke(jf(e,t,arguments.length>=2,!0))}function wl(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Ye}:t,i=e.resetOnError,n=i===void 0?!0:i,a=e.resetOnComplete,d=a===void 0?!0:a,s=e.resetOnRefCountZero,o=s===void 0?!0:s;return function(c){var g,f,m,_=0,w=!1,v=!1,l=function(){f==null||f.unsubscribe(),f=void 0},h=function(){l(),g=m=void 0,w=v=!1},u=function(){var p=g;h(),p==null||p.unsubscribe()};return ke(function(p,b){_++,!v&&!w&&l();var E=m=m??r();b.add(function(){_--,_===0&&!v&&!w&&(f=hn(u,o))}),E.subscribe(b),!g&&_>0&&(g=new Lr({next:function(y){return E.next(y)},error:function(y){v=!0,l(),f=hn(h,n,y),E.error(y)},complete:function(){w=!0,l(),f=hn(h,d),E.complete()}}),Te(p).subscribe(g))})(c)}}function hn(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var n=new Lr({next:function(){n.unsubscribe(),e()}});return Te(t.apply(void 0,_t([],ut(r)))).subscribe(n)}}function ep(e){return ke(function(t,r){var i=!1,n=pe(r,function(){n==null||n.unsubscribe(),i=!0},Br);Te(e).subscribe(n),t.subscribe(pe(r,function(a){return i&&r.next(a)}))})}function Ko(e,t){return ke(function(r,i){var n=null,a=0,d=!1,s=function(){return d&&!n&&i.complete()};r.subscribe(pe(i,function(o){n==null||n.unsubscribe();var c=0,g=a++;Te(e(o,g)).subscribe(n=pe(i,function(f){return i.next(t?t(o,f,g,c++):f)},function(){n=null,s()}))},function(){d=!0,s()}))})}function si(e,t){return t===void 0&&(t=!1),ke(function(r,i){var n=0;r.subscribe(pe(i,function(a){var d=e(a,n++);(d||t)&&i.next(a),!d&&i.complete()}))})}function tp(e,t,r){var i=oe(e)||t||r?{next:e,error:t,complete:r}:e;return i?ke(function(n,a){var d;(d=i.subscribe)===null||d===void 0||d.call(i);var s=!0;n.subscribe(pe(a,function(o){var c;(c=i.next)===null||c===void 0||c.call(i,o),a.next(o)},function(){var o;s=!1,(o=i.complete)===null||o===void 0||o.call(i),a.complete()},function(o){var c;s=!1,(c=i.error)===null||c===void 0||c.call(i,o),a.error(o)},function(){var o,c;s&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(c=i.finalize)===null||c===void 0||c.call(i)}))}):Xr}function rp(e,t){return ke(function(r,i){var n=t??{},a=n.leading,d=a===void 0?!0:a,s=n.trailing,o=s===void 0?!1:s,c=!1,g=null,f=null,m=!1,_=function(){f==null||f.unsubscribe(),f=null,o&&(l(),m&&i.complete())},w=function(){f=null,m&&i.complete()},v=function(h){return f=Te(e(h)).subscribe(pe(i,_,w))},l=function(){if(c){c=!1;var h=g;g=null,i.next(h),!m&&v(h)}};r.subscribe(pe(i,function(h){c=!0,g=h,!(f&&!f.closed)&&(d?l():v(h))},function(){m=!0,!(o&&c&&f&&!f.closed)&&i.complete()}))})}function Yo(e,t,r){t===void 0&&(t=Jr);var i=wr(e,t);return rp(function(){return i},r)}function fn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ff(e);return ke(function(i,n){for(var a=e.length,d=new Array(a),s=e.map(function(){return!1}),o=!1,c=function(f){Te(e[f]).subscribe(pe(n,function(m){d[f]=m,!o&&!s[f]&&(s[f]=!0,(o=s.every(Xr))&&(s=null))},Br))},g=0;g<a;g++)c(g);i.subscribe(pe(n,function(f){if(o){var m=_t([f],ut(d));n.next(r?r.apply(void 0,_t([],ut(m))):m)}}))})}/**
173
173
  * Copyright (c) 2017 The xterm.js authors. All rights reserved.
174
174
  * @license MIT
175
- */const Qd=2,qd=1;class eh{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const i=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(s.getPropertyValue("height")),p=Math.max(0,parseInt(s.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,g=o.right+o.left,d=h-a,v=p-g-i,{width:b,height:C}=this.getCellSize();return{cols:Math.max(Qd,Math.floor(v/b)),rows:Math.max(qd,Math.floor(d/C))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}let cn;async function Ie(e,t,r){var i;const s={type:t,output:r};return await((i=e.postMessage)==null?void 0:i.call(e,s))}function th(e,t){var r;return((r=e.onDidReceiveMessage)==null?void 0:r.call(e,t))??{dispose:()=>{}}}function Me(){if(!cn)throw new Error("Renderer context not defined");return cn}function rh(e){cn=e}var ee=(e=>(e.infoMessage="common:infoMessage",e.errorMessage="common:errorMessage",e.closeCellOutput="common:closeCellOutput",e.displayPrompt="common:displayPrompt",e.onPrompt="common:onPrompt",e.setState="common:setState",e.getState="common:getState",e.onGetState="common:onGetState",e.onCategoryChange="common:onCategoryChange",e.platformApiRequest="common:platformApiRequest",e.platformApiResponse="common:platformApiResponse",e.optionsMessage="common:optionsMessage",e.optionsModal="common:optionsModal",e.openExternalLink="common:openExternalLink",e.onOptionsMessage="common:onOptionsMessage",e.copyTextToClipboard="common:copyTextToClipboard",e.onCopyTextToClipboard="common:onCopyTextToClipboard",e.onProgramClose="common:onProgramClose",e.denoUpdate="deno:deploymentUpdate",e.denoPromote="deno:promoteDeployment",e.vercelProd="vercel:promotePreview",e.mutateAnnotations="annotations:mutate",e.terminalStdout="terminal:stdout",e.terminalStderr="terminal:stderr",e.terminalStdin="terminal:stdin",e.terminalResize="terminal:resize",e.terminalFocus="terminal:focus",e.terminalOpen="terminal:open",e.openLink="terminal:openLink",e.activeThemeChanged="theme:changed",e.githubWorkflowDispatch="github:workflowDispatch",e.githubWorkflowDeploy="github:workflowDeploy",e.githubWorkflowStatusUpdate="github:workflowStatusUpdate",e.tangleEvent="tangle:event",e.gcpResourceStatusChanged="gcp:resourceStatusChanged",e.gcpClusterCheckStatus="gcp:clusterCheckStatus",e.gcpClusterDetails="gcp:clusterDetails",e.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",e.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",e.gcpVMInstanceAction="gcp:gceVMInstanceAction",e.awsEC2Instances="aws:ec2Instances",e.awsEC2InstanceAction="aws:ec2InstanceAction",e.awsEKSClusterAction="aws:eksClusterAction",e.onAuthorModeChange="common:onAuthorModeChange",e.gistCell="gist:cell",e.gcpCloudRunAction="gcp:cloudRunAction",e.gcpLoadServices="gcp:loadServices",e.gcpServicesLoaded="gcp:servicesLoaded",e.daggerSyncState="dagger:syncState",e.daggerCliAction="dagger:cliAction",e.featuresUpdateAction="features:updateAction",e.featuresRequest="features:request",e.featuresResponse="features:response",e))(ee||{}),hc=(e=>(e.vercel="stateful.runme/vercel-stdout",e.deno="stateful.runme/deno-stdout",e.outputItems="stateful.runme/output-items",e.annotations="stateful.runme/annotations",e.terminal="stateful.runme/terminal",e.error="stateful.runme/error",e.github="stateful.runme/github-stdout",e.stdout="application/vnd.code.notebook.stdout",e.gcp="stateful.runme/gcp",e.aws="stateful.runme/aws",e.daggerCall="stateful.runme/dagger",e.daggerShell="stateful.runme/dagger",e))(hc||{}),fc=(e=>(e.RunmeCloud="runme.cloud",e.RunmeChat="runme.chat",e.RunmeSearch="runme.search",e.NotebookEnvStore="runme.notebook.envStore",e))(fc||{});function ih({}){}function nh(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function sh(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,i=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?i.format(Math.round(r),"second"):Math.abs(r)<3600?i.format(Math.round(r/60),"minute"):Math.abs(r)<86400?i.format(Math.round(r/3600),"hour"):i.format(Math.round(r/86400),"day")}const oh=z`
175
+ */const ip=2,np=1;class sp{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const i=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),d=Math.max(0,parseInt(n.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},c=o.top+o.bottom,g=o.right+o.left,f=a-c,m=d-g-i,{width:_,height:w}=this.getCellSize();return{cols:Math.max(ip,Math.floor(m/_)),rows:Math.max(np,Math.floor(f/w))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}let Un;async function xe(e,t,r){var i;const n={type:t,output:r};return await((i=e.postMessage)==null?void 0:i.call(e,n))}function op(e,t){var r;return((r=e.onDidReceiveMessage)==null?void 0:r.call(e,t))??{dispose:()=>{}}}function He(){if(!Un)throw new Error("Renderer context not defined");return Un}function ap(e){Un=e}var ee=(e=>(e.infoMessage="common:infoMessage",e.errorMessage="common:errorMessage",e.closeCellOutput="common:closeCellOutput",e.displayPrompt="common:displayPrompt",e.onPrompt="common:onPrompt",e.setState="common:setState",e.getState="common:getState",e.onGetState="common:onGetState",e.onCategoryChange="common:onCategoryChange",e.platformApiRequest="common:platformApiRequest",e.platformApiResponse="common:platformApiResponse",e.optionsMessage="common:optionsMessage",e.optionsModal="common:optionsModal",e.openExternalLink="common:openExternalLink",e.onOptionsMessage="common:onOptionsMessage",e.copyTextToClipboard="common:copyTextToClipboard",e.onCopyTextToClipboard="common:onCopyTextToClipboard",e.onProgramClose="common:onProgramClose",e.denoUpdate="deno:deploymentUpdate",e.denoPromote="deno:promoteDeployment",e.vercelProd="vercel:promotePreview",e.mutateAnnotations="annotations:mutate",e.terminalStdout="terminal:stdout",e.terminalStderr="terminal:stderr",e.terminalStdin="terminal:stdin",e.terminalResize="terminal:resize",e.terminalFocus="terminal:focus",e.terminalOpen="terminal:open",e.openLink="terminal:openLink",e.activeThemeChanged="theme:changed",e.githubWorkflowDispatch="github:workflowDispatch",e.githubWorkflowDeploy="github:workflowDeploy",e.githubWorkflowStatusUpdate="github:workflowStatusUpdate",e.tangleEvent="tangle:event",e.gcpResourceStatusChanged="gcp:resourceStatusChanged",e.gcpClusterCheckStatus="gcp:clusterCheckStatus",e.gcpClusterDetails="gcp:clusterDetails",e.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",e.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",e.gcpVMInstanceAction="gcp:gceVMInstanceAction",e.awsEC2Instances="aws:ec2Instances",e.awsEC2InstanceAction="aws:ec2InstanceAction",e.awsEKSClusterAction="aws:eksClusterAction",e.onAuthorModeChange="common:onAuthorModeChange",e.gistCell="gist:cell",e.gcpCloudRunAction="gcp:cloudRunAction",e.gcpLoadServices="gcp:loadServices",e.gcpServicesLoaded="gcp:servicesLoaded",e.daggerSyncState="dagger:syncState",e.daggerCliAction="dagger:cliAction",e.featuresUpdateAction="features:updateAction",e.featuresRequest="features:request",e.featuresResponse="features:response",e))(ee||{}),Cl=(e=>(e.vercel="stateful.runme/vercel-stdout",e.deno="stateful.runme/deno-stdout",e.outputItems="stateful.runme/output-items",e.annotations="stateful.runme/annotations",e.terminal="stateful.runme/terminal",e.error="stateful.runme/error",e.github="stateful.runme/github-stdout",e.stdout="application/vnd.code.notebook.stdout",e.gcp="stateful.runme/gcp",e.aws="stateful.runme/aws",e.daggerCall="stateful.runme/dagger",e.daggerShell="stateful.runme/dagger",e))(Cl||{}),kl=(e=>(e.RunmeCloud="runme.cloud",e.RunmeChat="runme.chat",e.RunmeSearch="runme.search",e.NotebookEnvStore="runme.notebook.envStore",e))(kl||{});function cp({}){}function lp(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function up(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,i=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?i.format(Math.round(r),"second"):Math.abs(r)<3600?i.format(Math.round(r/60),"minute"):Math.abs(r)<86400?i.format(Math.round(r/3600),"hour"):i.format(Math.round(r/86400),"day")}const dp=j`
176
176
  <svg
177
177
  class="icon"
178
178
  width="16"
@@ -187,7 +187,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
187
187
  d="M13.353 1.146L14.853 2.646L15 3V14.5L14.5 15H1.5L1 14.5V1.5L1.5 1H13L13.353 1.146ZM2 2V14H14V3.208L12.793 2H11V6H4V2H2ZM8 2V5H10V2H8Z"
188
188
  />
189
189
  </svg>
190
- `,ah=z`<svg
190
+ `,hp=j`<svg
191
191
  class="icon"
192
192
  width="16"
193
193
  height="16"
@@ -200,18 +200,18 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
200
200
  clip-rule="evenodd"
201
201
  d="M11.9564 6H12.0063C12.8003 6 13.5617 6.31607 14.1231 6.87868C14.6845 7.44129 14.9999 8.20435 14.9999 9C14.9999 9.79565 14.6845 10.5587 14.1231 11.1213C13.5617 11.6839 12.8003 12 12.0063 12H10.0106V11H12.0063C12.5356 11 13.0432 10.7893 13.4175 10.4142C13.7918 10.0391 14.002 9.53044 14.002 9C14.002 8.46957 13.7918 7.96086 13.4175 7.58579C13.0432 7.21072 12.5356 7 12.0063 7H11.0923L10.9686 6.143C10.8937 5.60541 10.6455 5.10711 10.2617 4.72407C9.87792 4.34103 9.37968 4.09427 8.84295 4.02143C8.30621 3.94859 7.76044 4.05365 7.28883 4.3206C6.81723 4.58754 6.44567 5.00173 6.23082 5.5L5.89754 6.262L5.08929 6.073C4.90378 6.02699 4.71361 6.0025 4.52251 6C3.8609 6 3.22639 6.2634 2.75856 6.73224C2.29073 7.20108 2.02791 7.83696 2.02791 8.5C2.02791 9.16304 2.29073 9.79893 2.75856 10.2678C3.22639 10.7366 3.8609 11 4.52251 11H7.01712V12H4.52251C4.02742 12.0043 3.53708 11.903 3.08401 11.7029C2.63095 11.5028 2.22551 11.2084 1.8946 10.8394C1.56369 10.4703 1.31487 10.0349 1.16465 9.56211C1.01442 9.08932 0.966218 8.58992 1.02324 8.09704C1.08026 7.60416 1.24121 7.12906 1.49539 6.70326C1.74958 6.27745 2.0912 5.91068 2.4976 5.62727C2.904 5.34385 3.36588 5.15027 3.85261 5.05937C4.33935 4.96847 4.8398 4.98232 5.32079 5.1C5.62405 4.40501 6.14506 3.82799 6.8049 3.45635C7.46474 3.08472 8.22745 2.9387 8.97752 3.04044C9.72759 3.14217 10.4241 3.4861 10.9617 4.02014C11.4992 4.55418 11.8484 5.24923 11.9564 6ZM10.2928 9.85348L8.97879 8.53944L8.97879 13.9749H7.98492L7.98493 8.57568L6.7071 9.85347L5.99999 9.14636L8.14643 6.99998H8.85354L10.9999 9.14637L10.2928 9.85348Z"
202
202
  />
203
- </svg>`;var ch=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,At=(e,t,r,i)=>{for(var s=i>1?void 0:i?lh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&ch(t,r,s),s};let it=class extends Be{constructor(){super(...arguments),this.text="Copy",this.loadingText="Saving...",this.loading=!1,this.disabled=!1}onClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent(this.disabled?"onClickDisabled":"onClick");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return z`
203
+ </svg>`;var fp=Object.defineProperty,pp=Object.getOwnPropertyDescriptor,Ht=(e,t,r,i)=>{for(var n=i>1?void 0:i?pp(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&fp(t,r,n),n};let dt=class extends Oe{constructor(){super(...arguments),this.text="Copy",this.loadingText="Saving...",this.loading=!1,this.disabled=!1}onClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent(this.disabled?"onClickDisabled":"onClick");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return j`
204
204
  <vscode-button
205
205
  ?disabled=${this.loading}
206
206
  class=${e}
207
207
  appearance="secondary"
208
208
  @click=${this.onClick}
209
209
  >
210
- ${ve(this.shareIcon,()=>ah)}
211
- ${ve(this.saveIcon,()=>oh)}
212
- ${ve(this.loading,()=>z`${this.loadingText}`,()=>z`${this.text}`)}
210
+ ${be(this.shareIcon,()=>hp)}
211
+ ${be(this.saveIcon,()=>dp)}
212
+ ${be(this.loading,()=>j`${this.loadingText}`,()=>j`${this.text}`)}
213
213
  </vscode-button>
214
- `}};it.styles=Xe`
214
+ `}};dt.styles=et`
215
215
  vscode-button {
216
216
  color: var(--vscode-button-foreground);
217
217
  background-color: var(--vscode-button-background);
@@ -231,7 +231,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
231
231
  margin: 0 5px 0 -5px;
232
232
  padding: 0;
233
233
  }
234
- `;At([G({type:String})],it.prototype,"text",2);At([G({type:String})],it.prototype,"loadingText",2);At([G({type:Boolean,reflect:!0})],it.prototype,"loading",2);At([G({type:Boolean,reflect:!0})],it.prototype,"disabled",2);At([G({type:Boolean,reflect:!0})],it.prototype,"shareIcon",2);At([G({type:Boolean,reflect:!0})],it.prototype,"saveIcon",2);it=At([Ue("action-button")],it);const zs=z`
234
+ `;Ht([Z({type:String})],dt.prototype,"text",2);Ht([Z({type:String})],dt.prototype,"loadingText",2);Ht([Z({type:Boolean,reflect:!0})],dt.prototype,"loading",2);Ht([Z({type:Boolean,reflect:!0})],dt.prototype,"disabled",2);Ht([Z({type:Boolean,reflect:!0})],dt.prototype,"shareIcon",2);Ht([Z({type:Boolean,reflect:!0})],dt.prototype,"saveIcon",2);dt=Ht([Ge("action-button")],dt);const Xo=j`
235
235
  <svg
236
236
  height="16"
237
237
  aria-hidden="true"
@@ -246,19 +246,19 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
246
246
  d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
247
247
  ></path>
248
248
  </svg>
249
- `;var uh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,Mn=(e,t,r,i)=>{for(var s=i>1?void 0:i?dh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&uh(t,r,s),s};let br=class extends Be{constructor(){super(...arguments),this.text="Preview & Gist",this.disabled=!1}onGistClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onGist");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return ve(this.disabled,()=>z`
249
+ `;var gp=Object.defineProperty,mp=Object.getOwnPropertyDescriptor,vs=(e,t,r,i)=>{for(var n=i>1?void 0:i?mp(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&gp(t,r,n),n};let xr=class extends Oe{constructor(){super(...arguments),this.text="Preview & Gist",this.disabled=!1}onGistClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onGist");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return be(this.disabled,()=>j`
250
250
  <vscode-button class=${e} disabled appearance="secondary">
251
- ${zs} ${this.text}
251
+ ${Xo} ${this.text}
252
252
  </vscode-button>
253
- `,()=>z`
253
+ `,()=>j`
254
254
  <vscode-button
255
255
  class=${e}
256
256
  appearance="secondary"
257
257
  @click=${this.onGistClick}
258
258
  >
259
- ${zs} ${this.text}
259
+ ${Xo} ${this.text}
260
260
  </vscode-button>
261
- `)}};br.styles=Xe`
261
+ `)}};xr.styles=et`
262
262
  vscode-button {
263
263
  color: var(--vscode-button-foreground);
264
264
  background-color: var(--vscode-button-background);
@@ -278,7 +278,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
278
278
  margin: 0 5px 0 -5px;
279
279
  padding: 0;
280
280
  }
281
- `;Mn([G({type:String})],br.prototype,"text",2);Mn([G({type:Boolean,reflect:!0})],br.prototype,"disabled",2);br=Mn([Ue("gist-cell")],br);const pc=z`
281
+ `;vs([Z({type:String})],xr.prototype,"text",2);vs([Z({type:Boolean,reflect:!0})],xr.prototype,"disabled",2);xr=vs([Ge("gist-cell")],xr);const Il=j`
282
282
  <svg
283
283
  width="16"
284
284
  height="16"
@@ -294,15 +294,15 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
294
294
  fill="currentColor"
295
295
  />
296
296
  </svg>
297
- `;var hh=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,Un=(e,t,r,i)=>{for(var s=i>1?void 0:i?fh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&hh(t,r,s),s};let yr=class extends Be{constructor(){super(...arguments),this.openText="Open",this.disabled=!1}onOpenClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onOpen");this.dispatchEvent(t)}render(){const e=this.openText.toLocaleLowerCase();return ve(this.disabled,()=>{},()=>z`
297
+ `;var vp=Object.defineProperty,bp=Object.getOwnPropertyDescriptor,bs=(e,t,r,i)=>{for(var n=i>1?void 0:i?bp(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&vp(t,r,n),n};let Dr=class extends Oe{constructor(){super(...arguments),this.openText="Open",this.disabled=!1}onOpenClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onOpen");this.dispatchEvent(t)}render(){const e=this.openText.toLocaleLowerCase();return be(this.disabled,()=>{},()=>j`
298
298
  <vscode-button
299
299
  class=${e}
300
300
  appearance="secondary"
301
301
  @click=${this.onOpenClick}
302
302
  >
303
- ${pc} ${this.openText}
303
+ ${Il} ${this.openText}
304
304
  </vscode-button>
305
- `)}};yr.styles=Xe`
305
+ `)}};Dr.styles=et`
306
306
  vscode-button {
307
307
  color: var(--vscode-button-foreground);
308
308
  background-color: var(--vscode-button-background);
@@ -319,7 +319,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
319
319
  margin: 0 5px 0 -5px;
320
320
  padding: 0;
321
321
  }
322
- `;Un([G({type:String})],yr.prototype,"openText",2);Un([G({type:Boolean,reflect:!0})],yr.prototype,"disabled",2);yr=Un([Ue("open-cell")],yr);var ph=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,Vn=(e,t,r,i)=>{for(var s=i>1?void 0:i?gh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&ph(t,r,s),s};let hi=class extends Be{constructor(){super(...arguments),this.loading=!1,this.signedIn=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){let e=this.signedIn?"Save":"Save to Cloud";return z`
322
+ `;bs([Z({type:String})],Dr.prototype,"openText",2);bs([Z({type:Boolean,reflect:!0})],Dr.prototype,"disabled",2);Dr=bs([Ge("open-cell")],Dr);var _p=Object.defineProperty,yp=Object.getOwnPropertyDescriptor,_s=(e,t,r,i)=>{for(var n=i>1?void 0:i?yp(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&_p(t,r,n),n};let Ni=class extends Oe{constructor(){super(...arguments),this.loading=!1,this.signedIn=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){let e=this.signedIn?"Save":"Save to Cloud";return j`
323
323
  <action-button
324
324
  ?loading=${this.loading}
325
325
  text="${e}"
@@ -327,7 +327,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
327
327
  @onClick="${this.handleClick}"
328
328
  >
329
329
  </action-button>
330
- `}};Vn([G({type:Boolean,reflect:!0})],hi.prototype,"loading",2);Vn([G({type:Boolean,reflect:!0})],hi.prototype,"signedIn",2);hi=Vn([Ue("save-button")],hi);var vh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,gc=(e,t,r,i)=>{for(var s=i>1?void 0:i?mh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&vh(t,r,s),s};let ln=class extends Be{constructor(){super(...arguments),this.loading=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){return z`
330
+ `}};_s([Z({type:Boolean,reflect:!0})],Ni.prototype,"loading",2);_s([Z({type:Boolean,reflect:!0})],Ni.prototype,"signedIn",2);Ni=_s([Ge("save-button")],Ni);var Sp=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,Al=(e,t,r,i)=>{for(var n=i>1?void 0:i?Ep(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&Sp(t,r,n),n};let Mn=class extends Oe{constructor(){super(...arguments),this.loading=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){return j`
331
331
  <action-button
332
332
  ?loading=${this.loading}
333
333
  text="Share"
@@ -335,7 +335,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
335
335
  @onClick="${this.handleClick}"
336
336
  >
337
337
  </action-button>
338
- `}};gc([G({type:Boolean,reflect:!0})],ln.prototype,"loading",2);ln=gc([Ue("share-button")],ln);const _h=Xe`
338
+ `}};Al([Z({type:Boolean,reflect:!0})],Mn.prototype,"loading",2);Mn=Al([Ge("share-button")],Mn);const wp=et`
339
339
  :host {
340
340
  --vscode-font-weight: normal;
341
341
  --vscode-font-size: 13px;
@@ -943,7 +943,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
943
943
  --vscode-widget-border: #303031;
944
944
  --vscode-activityBarBadge-background: #007acc;
945
945
  }
946
- `,bh=Xe`
946
+ `,Cp=et`
947
947
  :host {
948
948
  --vscode-font-weight: normal;
949
949
  --vscode-font-size: 13px;
@@ -1486,53 +1486,53 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
1486
1486
  --vscode-widget-border: #e5e5e5;
1487
1487
  --vscode-activityBarBadge-background: #005fb8;
1488
1488
  }
1489
- `;var yh=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,vc=e=>{throw TypeError(e)},fe=(e,t,r,i)=>{for(var s=i>1?void 0:i?Sh(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&yh(t,r,s),s},Eh=(e,t,r)=>t.has(e)||vc("Cannot "+r),Ch=(e,t,r)=>t.has(e)?vc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r)=>(Eh(e,t,"access private method"),r),re,wi,mc,_c,ti,ct,un,bc,yc,dn,Sc,hn,Ec,Cc,wc,kc,Ic,Ac,Tc,Rc,Bc=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(Bc||{});const Dt=(...e)=>`--vscode-${e.join("-")}`,Lt=e=>Dt("terminal",e),wh=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,kh=["terminal:","theme:",ee.platformApiRequest,ee.platformApiResponse,ee.onOptionsMessage,ee.optionsMessage,ee.onCopyTextToClipboard,ee.onProgramClose,ee.featuresResponse,ee.featuresUpdateAction],Ih=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ah="console-view";let le=class extends Be{constructor(){super(),Ch(this,re),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(_h.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(bh.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:i,cursorStyle:s,cursorWidth:h,fontFamily:p,smoothScrollDuration:n,scrollback:o}=this;this.terminal=new Gu.Terminal({rows:t,fontSize:i,fontFamily:p,scrollback:o,cursorWidth:h,cursorBlink:r,cursorStyle:s,smoothScrollDuration:n,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new eh,this.fitAddon.activate(this.terminal),this.serializer=new Uu.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new Wu.Unicode11Addon),this.terminal.loadAddon(new $u.WebLinksAddon(ie(this,re,Ic).bind(this))),this.terminal.attachCustomKeyEventHandler(g=>{var d;if(g.shiftKey&&g.ctrlKey&&g.code==="KeyC"){const v=(d=this==null?void 0:this.terminal)==null?void 0:d.getSelection();if(v)return navigator.clipboard.writeText(v),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const a=Me();this.disposables.push(th(a,async g=>{var d;if(kh.some(v=>g.type.startsWith(v)))switch(g.type){case ee.activeThemeChanged:ie(this,re,ti).call(this);break;case ee.terminalStdout:case ee.terminalStderr:{const{"runme.dev/id":v,data:b}=g.output;if(v!==this.id)return;this.isShareReady=!1,this.terminal.write(b),this.requestUpdate()}break;case ee.platformApiResponse:{if(g.output.id!==this.id)return;if(this.isLoading=!1,g.output.hasErrors)return Ie(a,ee.errorMessage,g.output.data);if(g.output.data.hasOwnProperty("displayShare")&&g.output.data.displayShare===!1)return;const v=((d=g.output.data)==null?void 0:d.data)||{};if(v.createExtensionCellOutput||v.createCellExecution){const b=v.createCellExecution||v.createExtensionCellOutput||{},{exitCode:C,id:m,htmlUrl:c,isSlackReady:u}=b;return this.platformId=m,this.shareUrl=c||"",this.exitCode=C,this.isSlackReady=!!u,this.isShareReady=!0,Ie(a,ee.tangleEvent,{webviewId:fc.RunmeCloud,data:{cellId:m}})}if(v.updateCellOutput){const{updateCellOutput:{exitCode:b,isSlackReady:C}}=v;this.isUpdatedReady=!0,this.exitCode=b,this.isSlackReady=!!C,ie(this,re,Sc).call(this)}v.createEscalation&&(this.escalationUrl=v.createEscalation.escalationUrl)}break;case ee.onOptionsMessage:{if(g.output.id!==this.id)return;const v=g.output.option;switch(this.isLoading=!1,v){case"Open":return Ie(a,ee.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return Ie(a,ee.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case ee.onCopyTextToClipboard:return g.output.id!==this.id?void 0:Ie(a,ee.infoMessage,"Link copied!");case ee.onProgramClose:{const{"runme.dev/id":v,code:b}=g.output;if(v!==this.id)return;this.exitCode=b;return}}}),this.terminal.onData(g=>Ie(a,ee.terminalStdin,{"runme.dev/id":this.id,input:g}))),Ie(a,ee.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),ie(this,re,ti).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=ie(this,re,_c).call(this);this.takeFocus&&window.addEventListener("focus",()=>{ie(this,re,dn).call(this)}),window.addEventListener("click",()=>{ie(this,re,dn).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),ie(this,re,wi).call(this),ie(this,re,ti).call(this);const i=ie(this,re,mc).call(this),s=new _e(p=>{window.addEventListener("resize",()=>p.next(ie(this,re,un).call(this,!0))),r.addEventListener("mouseup",()=>p.next(ie(this,re,un).call(this,!1)))}).pipe(dc());ie(this,re,bc).call(this,s),ie(this,re,yc).call(this,s),r.appendChild(i);const h=Me();h.postMessage&&Ie(h,ee.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:Nc((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=z`
1489
+ `;var kp=Object.defineProperty,Ip=Object.getOwnPropertyDescriptor,Nl=e=>{throw TypeError(e)},ge=(e,t,r,i)=>{for(var n=i>1?void 0:i?Ip(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&kp(t,r,n),n},Ap=(e,t,r)=>t.has(e)||Nl("Cannot "+r),Np=(e,t,r)=>t.has(e)?Nl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r)=>(Ap(e,t,"access private method"),r),re,Pi,Tl,Rl,vi,mt,Pn,Bl,Ll,Wn,xl,$n,Dl,Ol,Fl,Vl,Ul,Ml,Pl,Wl,$l=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))($l||{});const zt=(...e)=>`--vscode-${e.join("-")}`,Jt=e=>zt("terminal",e),Tp=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,Rp=["terminal:","theme:",ee.platformApiRequest,ee.platformApiResponse,ee.onOptionsMessage,ee.optionsMessage,ee.onCopyTextToClipboard,ee.onProgramClose,ee.featuresResponse,ee.featuresUpdateAction],Bp=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Lp="console-view";let le=class extends Oe{constructor(){super(),Np(this,re),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(wp.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(Cp.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:i,cursorStyle:n,cursorWidth:a,fontFamily:d,smoothScrollDuration:s,scrollback:o}=this;this.terminal=new Jh.Terminal({rows:t,fontSize:i,fontFamily:d,scrollback:o,cursorWidth:a,cursorBlink:r,cursorStyle:n,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new sp,this.fitAddon.activate(this.terminal),this.serializer=new $h.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new Zh.Unicode11Addon),this.terminal.loadAddon(new Yh.WebLinksAddon(ie(this,re,Ul).bind(this))),this.terminal.attachCustomKeyEventHandler(g=>{var f;if(g.shiftKey&&g.ctrlKey&&g.code==="KeyC"){const m=(f=this==null?void 0:this.terminal)==null?void 0:f.getSelection();if(m)return navigator.clipboard.writeText(m),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const c=He();this.disposables.push(op(c,async g=>{var f;if(Rp.some(m=>g.type.startsWith(m)))switch(g.type){case ee.activeThemeChanged:ie(this,re,vi).call(this);break;case ee.terminalStdout:case ee.terminalStderr:{const{"runme.dev/id":m,data:_}=g.output;if(m!==this.id)return;this.isShareReady=!1,this.terminal.write(_),this.requestUpdate()}break;case ee.platformApiResponse:{if(g.output.id!==this.id)return;if(this.isLoading=!1,g.output.hasErrors)return xe(c,ee.errorMessage,g.output.data);if(g.output.data.hasOwnProperty("displayShare")&&g.output.data.displayShare===!1)return;const m=((f=g.output.data)==null?void 0:f.data)||{};if(m.createExtensionCellOutput||m.createCellExecution){const _=m.createCellExecution||m.createExtensionCellOutput||{},{exitCode:w,id:v,htmlUrl:l,isSlackReady:h}=_;return this.platformId=v,this.shareUrl=l||"",this.exitCode=w,this.isSlackReady=!!h,this.isShareReady=!0,xe(c,ee.tangleEvent,{webviewId:kl.RunmeCloud,data:{cellId:v}})}if(m.updateCellOutput){const{updateCellOutput:{exitCode:_,isSlackReady:w}}=m;this.isUpdatedReady=!0,this.exitCode=_,this.isSlackReady=!!w,ie(this,re,xl).call(this)}m.createEscalation&&(this.escalationUrl=m.createEscalation.escalationUrl)}break;case ee.onOptionsMessage:{if(g.output.id!==this.id)return;const m=g.output.option;switch(this.isLoading=!1,m){case"Open":return xe(c,ee.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return xe(c,ee.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case ee.onCopyTextToClipboard:return g.output.id!==this.id?void 0:xe(c,ee.infoMessage,"Link copied!");case ee.onProgramClose:{const{"runme.dev/id":m,code:_}=g.output;if(m!==this.id)return;this.exitCode=_;return}}}),this.terminal.onData(g=>xe(c,ee.terminalStdin,{"runme.dev/id":this.id,input:g}))),xe(c,ee.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),ie(this,re,vi).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=ie(this,re,Rl).call(this);this.takeFocus&&window.addEventListener("focus",()=>{ie(this,re,Wn).call(this)}),window.addEventListener("click",()=>{ie(this,re,Wn).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),ie(this,re,Pi).call(this),ie(this,re,vi).call(this);const i=ie(this,re,Tl).call(this),n=new Ee(d=>{window.addEventListener("resize",()=>d.next(ie(this,re,Pn).call(this,!0))),r.addEventListener("mouseup",()=>d.next(ie(this,re,Pn).call(this,!1)))}).pipe(wl());ie(this,re,Bl).call(this,n),ie(this,re,Ll).call(this,n),r.appendChild(i);const a=He();a.postMessage&&xe(a,ee.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:Hl((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=j`
1490
1490
  <close-cell-button
1491
- @closed="${()=>ih({id:this.id,outputType:hc.terminal})}"
1491
+ @closed="${()=>cp({id:this.id,outputType:Cl.terminal})}"
1492
1492
  ></close-cell-button>
1493
1493
  <div class="button-group">
1494
1494
  <copy-button
1495
1495
  copyText="${this.copyText}"
1496
- @onCopy="${async()=>ie(this,re,Rc).call(this)}"
1496
+ @onCopy="${async()=>ie(this,re,Wl).call(this)}"
1497
1497
  ></copy-button>
1498
- ${ve(!0,()=>z`<gist-cell
1499
- @onGist="${ie(this,re,wc)}"
1498
+ ${be(!0,()=>j`<gist-cell
1499
+ @onGist="${ie(this,re,Fl)}"
1500
1500
  ></gist-cell>`,()=>{})}
1501
- ${ve(this.shouldRenderSaveButton(),()=>z`<save-button
1501
+ ${be(this.shouldRenderSaveButton(),()=>j`<save-button
1502
1502
  ?loading=${this.isLoading}
1503
1503
  ?signedIn=${!1}
1504
- @onClick="${ie(this,re,hn)}"
1504
+ @onClick="${ie(this,re,$n)}"
1505
1505
  >
1506
1506
  </save-button>`,()=>{})}
1507
- ${ve(this.shouldRenderShareButton(),()=>z`<share-button
1507
+ ${be(this.shouldRenderShareButton(),()=>j`<share-button
1508
1508
  ?loading=${this.isLoading}
1509
- @onClick="${ie(this,re,hn)}"
1509
+ @onClick="${ie(this,re,$n)}"
1510
1510
  >
1511
1511
  </share-button>`,()=>{})}
1512
- ${ve(!1,()=>z`<action-button
1512
+ ${be(!1,()=>j`<action-button
1513
1513
  ?loading=${this.isCreatingEscalation}
1514
1514
  ?saveIcon="${!0}"
1515
1515
  text="Escalate"
1516
- @onClick="${ie(this,re,Ec)}"
1517
- @onClickDisabled=${ie(this,re,Tc)}
1516
+ @onClick="${ie(this,re,Dl)}"
1517
+ @onClickDisabled=${ie(this,re,Pl)}
1518
1518
  >
1519
1519
  </action-button>`,()=>{})}
1520
- ${ve(!1,()=>z`<action-button
1520
+ ${be(!1,()=>j`<action-button
1521
1521
  ?saveIcon="${!0}"
1522
1522
  text="Open Escalation"
1523
- @onClick="${ie(this,re,Cc)}"
1523
+ @onClick="${ie(this,re,Ol)}"
1524
1524
  >
1525
1525
  </action-button>`,()=>{})}
1526
- ${ve(this.platformId&&!this.isLoading,()=>z`<open-cell
1526
+ ${be(this.platformId&&!this.isLoading,()=>j`<open-cell
1527
1527
  ?disabled=${!this.isPlatformAuthEnabled}
1528
- @onOpen="${ie(this,re,Ac)}"
1528
+ @onOpen="${ie(this,re,Ml)}"
1529
1529
  ></open-cell>`,()=>{})}
1530
1530
  </div>
1531
- `;return z`<section>
1531
+ `;return j`<section>
1532
1532
  <div id="terminal"></div>
1533
- ${ve(this.buttons,()=>e)}
1534
- </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};re=new WeakSet;wi=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};mc=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=h=>{var p;t={initialClientY:h.clientY,initialRows:this.rows},h.preventDefault(),(p=this.terminal)==null||p.focus()},i=()=>{t!==void 0&&(t=void 0)},s=h=>{var p;if(t===void 0||!this.fitAddon)return;const n=(h.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,o=Math.round(t.initialRows+n);o!==this.rows&&(ie(this,re,wi).call(this,o),(p=this.terminal)==null||p.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",i),window.addEventListener("mousemove",s),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",s)}}),e};_c=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};ti=function(){const e=ie(this,re,ct).call(this,Lt("foreground")),t={foreground:e,cursor:ie(this,re,ct).call(this,Dt("terminalCursor","foreground"))||e,cursorAccent:ie(this,re,ct).call(this,Dt("terminalCursor","background")),selectionForeground:ie(this,re,ct).call(this,Lt("selectionForeground")),selectionBackground:ie(this,re,ct).call(this,Lt("selectionBackground")),selectionInactiveBackground:ie(this,re,ct).call(this,Lt("inactiveSelectionBackground")),...Object.fromEntries(Ih.map(r=>[r,ie(this,re,ct).call(this,Lt(wh(r)))]))};this.terminal.options.theme=t};ct=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};un=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const i=ie(this,re,wi).call(this);if(i)return Nc(i)};bc=async function(e){const t=e.pipe(je(r=>!!r),uc(),lc(100)).subscribe(async r=>{const i=Me();i.postMessage&&await Ie(i,ee.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};yc=async function(e){const t=e.pipe(Oe(r=>r==null?void 0:r.rows),je(r=>!!r),uc(),lc(100)).subscribe(async r=>{const i=Me();i.postMessage&&i.postMessage({type:ee.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};dn=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=Me();r.postMessage&&await Ie(r,ee.terminalFocus,{"runme.dev/id":this.id})};Sc=async function(){const e=Me();if(!(!e.postMessage||!this.shareUrl))return Ie(e,ee.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(Bc),id:this.id,telemetryEvent:"app.share"})};hn=async function(){return ie(this,re,kc).call(this,!0)};Ec=async function(){this.isCreatingEscalation=!0};Cc=async function(){const e=Me();if(this.escalationUrl)return Ie(e,ee.openLink,this.escalationUrl)};wc=function(){const e=Me();if(e.postMessage)return Ie(e,ee.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};kc=async function(e){Me().postMessage};Ic=function(e,t){Ie(Me(),ee.openLink,t)};Ac=function(){Ie(Me(),ee.openLink,this.shareUrl)};Tc=function(){Ie(Me(),ee.errorMessage,`There is no Slack integration configured yet.
1535
- Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMessage)return;const r=Th(((e=this.serializer)==null?void 0:e.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(r).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(i=>Ie(t,ee.infoMessage,`Failed to copy to clipboard: ${i.message}!`))};le.styles=Xe`
1533
+ ${be(this.buttons,()=>e)}
1534
+ </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};re=new WeakSet;Pi=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};Tl=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=a=>{var d;t={initialClientY:a.clientY,initialRows:this.rows},a.preventDefault(),(d=this.terminal)==null||d.focus()},i=()=>{t!==void 0&&(t=void 0)},n=a=>{var d;if(t===void 0||!this.fitAddon)return;const s=(a.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,o=Math.round(t.initialRows+s);o!==this.rows&&(ie(this,re,Pi).call(this,o),(d=this.terminal)==null||d.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",i),window.addEventListener("mousemove",n),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",n)}}),e};Rl=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};vi=function(){const e=ie(this,re,mt).call(this,Jt("foreground")),t={foreground:e,cursor:ie(this,re,mt).call(this,zt("terminalCursor","foreground"))||e,cursorAccent:ie(this,re,mt).call(this,zt("terminalCursor","background")),selectionForeground:ie(this,re,mt).call(this,Jt("selectionForeground")),selectionBackground:ie(this,re,mt).call(this,Jt("selectionBackground")),selectionInactiveBackground:ie(this,re,mt).call(this,Jt("inactiveSelectionBackground")),...Object.fromEntries(Bp.map(r=>[r,ie(this,re,mt).call(this,Jt(Tp(r)))]))};this.terminal.options.theme=t};mt=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};Pn=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const i=ie(this,re,Pi).call(this);if(i)return Hl(i)};Bl=async function(e){const t=e.pipe(rt(r=>!!r),El(),Sl(100)).subscribe(async r=>{const i=He();i.postMessage&&await xe(i,ee.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};Ll=async function(e){const t=e.pipe(We(r=>r==null?void 0:r.rows),rt(r=>!!r),El(),Sl(100)).subscribe(async r=>{const i=He();i.postMessage&&i.postMessage({type:ee.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};Wn=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=He();r.postMessage&&await xe(r,ee.terminalFocus,{"runme.dev/id":this.id})};xl=async function(){const e=He();if(!(!e.postMessage||!this.shareUrl))return xe(e,ee.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values($l),id:this.id,telemetryEvent:"app.share"})};$n=async function(){return ie(this,re,Vl).call(this,!0)};Dl=async function(){this.isCreatingEscalation=!0};Ol=async function(){const e=He();if(this.escalationUrl)return xe(e,ee.openLink,this.escalationUrl)};Fl=function(){const e=He();if(e.postMessage)return xe(e,ee.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};Vl=async function(e){He().postMessage};Ul=function(e,t){xe(He(),ee.openLink,t)};Ml=function(){xe(He(),ee.openLink,this.shareUrl)};Pl=function(){xe(He(),ee.errorMessage,`There is no Slack integration configured yet.
1535
+ Open Dashboard to configure it`)};Wl=function(){var e;const t=He();if(!t.postMessage)return;const r=xp(((e=this.serializer)==null?void 0:e.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(r).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(i=>xe(t,ee.infoMessage,`Failed to copy to clipboard: ${i.message}!`))};le.styles=et`
1536
1536
  .xterm {
1537
1537
  cursor: text;
1538
1538
  position: relative;
@@ -1588,7 +1588,7 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1588
1588
  }
1589
1589
 
1590
1590
  .xterm .xterm-viewport {
1591
- background-color: var(${sr(Lt("background"))}) !important;
1591
+ background-color: var(${_r(Jt("background"))}) !important;
1592
1592
  border: solid 1px var(--vscode-terminal-border);
1593
1593
  /* On OS X this is required in order for the scroll bar to appear fully opaque */
1594
1594
  overflow-y: scroll;
@@ -1621,19 +1621,19 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1621
1621
 
1622
1622
  .xterm:hover .xterm-viewport::-webkit-scrollbar-thumb {
1623
1623
  background-color: var(
1624
- ${sr(Dt("scrollbarSlider","background"))}
1624
+ ${_r(zt("scrollbarSlider","background"))}
1625
1625
  );
1626
1626
  }
1627
1627
 
1628
1628
  .xterm:hover .xterm-viewport::-webkit-scrollbar-thumb:hover {
1629
1629
  background-color: var(
1630
- ${sr(Dt("scrollbarSlider","hoverBackground"))}
1630
+ ${_r(zt("scrollbarSlider","hoverBackground"))}
1631
1631
  );
1632
1632
  }
1633
1633
 
1634
1634
  .xterm:hover .xterm-viewport::-webkit-scrollbar-thumb:active {
1635
1635
  background-color: var(
1636
- ${sr(Dt("scrollbarSlider","activeBackground"))}
1636
+ ${_r(zt("scrollbarSlider","activeBackground"))}
1637
1637
  );
1638
1638
  }
1639
1639
 
@@ -1772,24 +1772,24 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1772
1772
  .xterm-bg-7 {
1773
1773
  background-color: var(--vscode-editor-selectionBackground) !important;
1774
1774
  }
1775
- `;fe([G({type:String})],le.prototype,"id",2);fe([G({type:Boolean,converter:e=>e!=="false"})],le.prototype,"buttons",2);fe([G({type:Boolean,converter:e=>e!=="false"})],le.prototype,"takeFocus",2);fe([G({type:String})],le.prototype,"theme",2);fe([G({type:String})],le.prototype,"fontFamily",2);fe([G({type:Number})],le.prototype,"fontSize",2);fe([G({type:String})],le.prototype,"cursorStyle",2);fe([G({type:Boolean})],le.prototype,"cursorBlink",2);fe([G({type:Number})],le.prototype,"cursorWidth",2);fe([G({type:Number})],le.prototype,"smoothScrollDuration",2);fe([G({type:Number})],le.prototype,"scrollback",2);fe([G({type:String})],le.prototype,"initialContent",2);fe([G({type:Number})],le.prototype,"initialRows",2);fe([G({type:Number})],le.prototype,"lastLine",2);fe([G({type:Boolean})],le.prototype,"isLoading",2);fe([G({type:Boolean})],le.prototype,"isCreatingEscalation",2);fe([G()],le.prototype,"shareUrl",2);fe([G()],le.prototype,"escalationUrl",2);fe([G({type:Boolean})],le.prototype,"isUpdatedReady",2);fe([G({type:Boolean})],le.prototype,"isAutoSaveEnabled",2);fe([G({type:Boolean})],le.prototype,"isPlatformAuthEnabled",2);fe([G({type:Boolean})],le.prototype,"isDaggerOutput",2);le=fe([Ue(Ah)],le);function Nc(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function Th(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function fi(e){let t=!1;const r=[];for(let i=0;i<e.length;i++){let s=e.charAt(i);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),r.push(s);break}}return r.join("")}const Rh=new Set(["constructor","toString","toJSON","valueOf"]);function Sr(e){return Rh.has(e)?e+"$":e}function Bh(){let e=0,t=0;for(let i=0;i<28;i+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<i,(s&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let s=this.buf[this.pos++];if(t|=(s&127)<<i,(s&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}const ri=4294967296;function Js(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let i=0,s=0;function h(p,n){const o=Number(e.slice(p,n));s*=r,i=i*r+o,i>=ri&&(s=s+(i/ri|0),i=i%ri)}return h(-24,-18),h(-18,-12),h(-12,-6),h(-6),t?xc(i,s):Pn(i,s)}function Nh(e,t){let r=Pn(e,t);const i=r.hi&2147483648;i&&(r=xc(r.lo,r.hi));const s=Lc(r.lo,r.hi);return i?"-"+s:s}function Lc(e,t){if({lo:e,hi:t}=Lh(e,t),t<=2097151)return String(ri*t+e);const r=e&16777215,i=(e>>>24|t<<8)&16777215,s=t>>16&65535;let h=r+i*6777216+s*6710656,p=i+s*8147497,n=s*2;const o=1e7;return h>=o&&(p+=Math.floor(h/o),h%=o),p>=o&&(n+=Math.floor(p/o),p%=o),n.toString()+Qs(p)+Qs(h)}function Lh(e,t){return{lo:e>>>0,hi:t>>>0}}function Pn(e,t){return{lo:e|0,hi:t|0}}function xc(e,t){return t=~t,e?e=~e+1:t+=1,Pn(e,t)}const Qs=e=>{const t=String(e);return"0000000".slice(t.length)+t};function xh(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function Dh(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const Te=Oh();function Oh(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),i=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(h){const p=typeof h=="bigint"?h:BigInt(h);if(p>r||p<t)throw new Error(`invalid int64: ${h}`);return p},uParse(h){const p=typeof h=="bigint"?h:BigInt(h);if(p>s||p<i)throw new Error(`invalid uint64: ${h}`);return p},enc(h){return e.setBigInt64(0,this.parse(h),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(h){return e.setBigInt64(0,this.uParse(h),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(h,p){return e.setInt32(0,h,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(h,p){return e.setInt32(0,h,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(t){return typeof t!="string"&&(t=t.toString()),qs(t),t},uParse(t){return typeof t!="string"&&(t=t.toString()),eo(t),t},enc(t){return typeof t!="string"&&(t=t.toString()),qs(t),Js(t)},uEnc(t){return typeof t!="string"&&(t=t.toString()),eo(t),Js(t)},dec(t,r){return Nh(t,r)},uDec(t,r){return Lc(t,r)}}}function qs(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function eo(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var V;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(V||(V={}));function Er(e,t){switch(e){case V.STRING:return"";case V.BOOL:return!1;case V.DOUBLE:case V.FLOAT:return 0;case V.INT64:case V.UINT64:case V.SFIXED64:case V.FIXED64:case V.SINT64:return t?"0":Te.zero;case V.BYTES:return new Uint8Array(0);default:return 0}}function Fh(e,t){switch(e){case V.BOOL:return t===!1;case V.STRING:return t==="";case V.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Dc=2,et=Symbol.for("reflect unsafe local");function Mh(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(i=>i.localName===r)}function Uh(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Dc)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!Fh(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Cr(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Vh(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Ph(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function Wh(e,t){const r=t.localName;if(t.oneof){const i=t.oneof.localName;e[i].case===r&&(e[i]={case:void 0})}else if(t.presence!=Dc)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=Er(t.scalar,t.longAsString);break}}function Wn(e){for(const t of e.field)Cr(t,"jsonName")||(t.jsonName=fi(t.name));e.nestedType.forEach(Wn)}function Hh(e,t){const r=e.values.find(i=>i.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function $h(e,t){switch(e){case V.STRING:return t;case V.BYTES:{const r=Zh(t);if(r===!1)throw new Error(`cannot parse ${V[e]} default value: ${t}`);return r}case V.INT64:case V.SFIXED64:case V.SINT64:return Te.parse(t);case V.UINT64:case V.FIXED64:return Te.uParse(t);case V.DOUBLE:case V.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case V.BOOL:return t==="true";case V.INT32:case V.UINT32:case V.SINT32:case V.FIXED32:case V.SFIXED32:return parseInt(t,10)}}function Zh(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(i){if(this.tail.length>=i){const s=this.tail.substring(0,i);return this.tail=this.tail.substring(i),s}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const i=r.c,s=r.take(2);if(s===!1)return!1;const h=parseInt(i+s,8);if(Number.isNaN(h))return!1;t.push(h);break}case"x":{const i=r.c,s=r.take(2);if(s===!1)return!1;const h=parseInt(i+s,16);if(Number.isNaN(h))return!1;t.push(h);break}case"u":{const i=r.c,s=r.take(4);if(s===!1)return!1;const h=parseInt(i+s,16);if(Number.isNaN(h))return!1;const p=new Uint8Array(4);new DataView(p.buffer).setInt32(0,h,!0),t.push(p[0],p[1],p[2],p[3]);break}case"U":{const i=r.c,s=r.take(8);if(s===!1)return!1;const h=Te.uEnc(i+s),p=new Uint8Array(8),n=new DataView(p.buffer);n.setInt32(0,h.lo,!0),n.setInt32(4,h.hi,!0),t.push(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*fn(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*fn(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*fn(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function Oc(...e){const t=Gh();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)so(r,t);return t}if("$typeName"in e[0]){let r=function(p){const n=[];for(const o of p.dependency){if(t.getFile(o)!=null||h.has(o))continue;const a=s(o);if(!a)throw new Error(`Unable to resolve ${o}, imported by ${p.name}`);"kind"in a?t.addFile(a,!1,!0):(h.add(a.name),n.push(a))}return n.concat(...n.map(r))};const i=e[0],s=e[1],h=new Set;for(const p of[i,...r(i)].reverse())so(p,t)}else for(const r of e)for(const i of r.files)t.addFile(i);return t}function Gh(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(i,s,h){if(r.set(i.proto.name,i),!s)for(const p of fn(i))this.add(p);if(h)for(const p of i.dependencies)this.addFile(p,s,h)},add(i){if(i.kind=="extension"){let s=t.get(i.extendee.typeName);s||t.set(i.extendee.typeName,s=new Map),s.set(i.number,i)}e.set(i.typeName,i)},get(i){return e.get(i)},getFile(i){return r.get(i)},getMessage(i){const s=e.get(i);return(s==null?void 0:s.kind)=="message"?s:void 0},getEnum(i){const s=e.get(i);return(s==null?void 0:s.kind)=="enum"?s:void 0},getExtension(i){const s=e.get(i);return(s==null?void 0:s.kind)=="extension"?s:void 0},getExtensionFor(i,s){var h;return(h=t.get(i.typeName))===null||h===void 0?void 0:h.get(s)},getService(i){const s=e.get(i);return(s==null?void 0:s.kind)=="service"?s:void 0}}}const Yh=998,Xh=999,Kh=9,wr=10,ur=11,jh=12,to=14,Hn=3,zh=2,ro=1,Jh=0,io=1,no=2,Qh=3,qh=1,ef=2,tf=1,Fc={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function so(e,t){var r,i;const s={kind:"file",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,edition:of(e),name:e.name.replace(/\.proto$/,""),dependencies:af(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},h=new Map,p={get(n){return h.get(n)},add(n){var o;$e(((o=n.proto.options)===null||o===void 0?void 0:o.mapEntry)===!0),h.set(n.typeName,n)}};for(const n of e.enumType)Mc(n,s,void 0,t);for(const n of e.messageType)Uc(n,s,void 0,t,p);for(const n of e.service)rf(n,s,t);pn(s,t);for(const n of h.values())gn(n,t,p);for(const n of s.messages)gn(n,t,p),pn(n,t);t.addFile(s,!0)}function pn(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const i=vn(r,e,t);e.extensions.push(i),t.add(i)}break;case"message":for(const r of e.proto.extension){const i=vn(r,e,t);e.nestedExtensions.push(i),t.add(i)}for(const r of e.nestedMessages)pn(r,t);break}}function gn(e,t,r){const i=e.proto.oneofDecl.map(h=>sf(h,e)),s=new Set;for(const h of e.proto.field){const p=uf(h,i),n=vn(h,e,t,p,r);e.fields.push(n),e.field[n.localName]=n,p===void 0?e.members.push(n):(p.fields.push(n),s.has(p)||(s.add(p),e.members.push(p)))}for(const h of i.filter(p=>s.has(p)))e.oneofs.push(h);for(const h of e.nestedMessages)gn(h,t,r)}function Mc(e,t,r,i){var s,h,p,n,o;const a=cf(e.name,e.value),g={kind:"enum",proto:e,deprecated:(h=(s=e.options)===null||s===void 0?void 0:s.deprecated)!==null&&h!==void 0?h:!1,file:t,parent:r,open:!0,name:e.name,typeName:ki(e,r,t),value:{},values:[],sharedPrefix:a,toString(){return`enum ${this.typeName}`}};g.open=pf(g),i.add(g);for(const d of e.value){const v=d.name;g.values.push(g.value[d.number]={kind:"enum_value",proto:d,deprecated:(n=(p=d.options)===null||p===void 0?void 0:p.deprecated)!==null&&n!==void 0?n:!1,parent:g,name:v,localName:Sr(a==null?v:v.substring(a.length)),number:d.number,toString(){return`enum value ${g.typeName}.${v}`}})}((o=r==null?void 0:r.nestedEnums)!==null&&o!==void 0?o:t.enums).push(g)}function Uc(e,t,r,i,s){var h,p,n,o;const a={kind:"message",proto:e,deprecated:(p=(h=e.options)===null||h===void 0?void 0:h.deprecated)!==null&&p!==void 0?p:!1,file:t,parent:r,name:e.name,typeName:ki(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((n=e.options)===null||n===void 0?void 0:n.mapEntry)===!0?s.add(a):(((o=r==null?void 0:r.nestedMessages)!==null&&o!==void 0?o:t.messages).push(a),i.add(a));for(const g of e.enumType)Mc(g,t,a,i);for(const g of e.nestedType)Uc(g,t,a,i,s)}function rf(e,t,r){var i,s;const h={kind:"service",proto:e,deprecated:(s=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,file:t,name:e.name,typeName:ki(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(h),r.add(h);for(const p of e.method){const n=nf(p,h,r);h.methods.push(n),h.method[n.localName]=n}}function nf(e,t,r){var i,s,h,p;let n;e.clientStreaming&&e.serverStreaming?n="bidi_streaming":e.clientStreaming?n="client_streaming":e.serverStreaming?n="server_streaming":n="unary";const o=r.getMessage(Je(e.inputType)),a=r.getMessage(Je(e.outputType));$e(o,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),$e(a,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(s=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,parent:t,name:g,localName:Sr(g.length?Sr(g[0].toLowerCase()+g.substring(1)):g),methodKind:n,input:o,output:a,idempotency:(p=(h=e.options)===null||h===void 0?void 0:h.idempotencyLevel)!==null&&p!==void 0?p:Jh,toString(){return`rpc ${t.typeName}.${g}`}}}function sf(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Sr(fi(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function vn(e,t,r,i,s){var h,p,n;const o=s===void 0,a={kind:"field",proto:e,deprecated:(p=(h=e.options)===null||h===void 0?void 0:h.deprecated)!==null&&p!==void 0?p:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:df(e,i,o,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(o){const b=t.kind=="file"?t:t.file,C=t.kind=="file"?void 0:t,m=ki(e,C,b);a.kind="extension",a.file=b,a.parent=C,a.oneof=void 0,a.typeName=m,a.jsonName=`[${m}]`,a.toString=()=>`extension ${m}`;const c=r.getMessage(Je(e.extendee));$e(c,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),a.extendee=c}else{const b=t;$e(b.kind=="message"),a.parent=b,a.oneof=i,a.localName=i?fi(e.name):Sr(fi(e.name)),a.jsonName=e.jsonName,a.toString=()=>`field ${b.typeName}.${e.name}`}const g=e.label,d=e.type,v=(n=e.options)===null||n===void 0?void 0:n.jstype;if(g===Hn){const b=d==ur?s==null?void 0:s.get(Je(e.typeName)):void 0;if(b){a.fieldKind="map";const{key:C,value:m}=ff(b);return a.mapKey=C.scalar,a.mapKind=m.fieldKind,a.message=m.message,a.delimitedEncoding=!1,a.enum=m.enum,a.scalar=m.scalar,a}switch(a.fieldKind="list",d){case ur:case wr:a.listKind="message",a.message=r.getMessage(Je(e.typeName)),$e(a.message),a.delimitedEncoding=oo(e,t);break;case to:a.listKind="enum",a.enum=r.getEnum(Je(e.typeName)),$e(a.enum);break;default:a.listKind="scalar",a.scalar=d,a.longAsString=v==ro;break}return a.packed=hf(e,t),a}switch(d){case ur:case wr:a.fieldKind="message",a.message=r.getMessage(Je(e.typeName)),$e(a.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),a.delimitedEncoding=oo(e,t),a.getDefaultValue=()=>{};break;case to:{const b=r.getEnum(Je(e.typeName));$e(b!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),a.fieldKind="enum",a.enum=r.getEnum(Je(e.typeName)),a.getDefaultValue=()=>Cr(e,"defaultValue")?Hh(b,e.defaultValue):void 0;break}default:{a.fieldKind="scalar",a.scalar=d,a.longAsString=v==ro,a.getDefaultValue=()=>Cr(e,"defaultValue")?$h(d,e.defaultValue):void 0;break}}return a}function of(e){switch(e.syntax){case"":case"proto2":return Yh;case"proto3":return Xh;case"editions":if(e.edition in Fc)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function af(e,t){return e.dependency.map(r=>{const i=t.getFile(r);if(!i)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return i})}function cf(e,t){const r=lf(e)+"_";for(const i of t){if(!i.name.toLowerCase().startsWith(r))return;const s=i.name.substring(r.length);if(s.length==0||/^\d/.test(s))return}return r}function lf(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function ki(e,t,r){let i;return t?i=`${t.typeName}.${e.name}`:r.proto.package.length>0?i=`${r.proto.package}.${e.name}`:i=`${e.name}`,i}function Je(e){return e.startsWith(".")?e.substring(1):e}function uf(e,t){if(!Cr(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return $e(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function df(e,t,r,i){if(e.label==zh)return Qh;if(e.label==Hn)return no;if(t||e.proto3Optional||r)return io;const s=Pt("fieldPresence",{proto:e,parent:i});return s==no&&(e.type==ur||e.type==wr)?io:s}function hf(e,t){if(e.label!=Hn)return!1;switch(e.type){case Kh:case jh:case wr:case ur:return!1}const r=e.options;return r&&Cr(r,"packed")?r.packed:qh==Pt("repeatedFieldEncoding",{proto:e,parent:t})}function ff(e){const t=e.fields.find(i=>i.number===1),r=e.fields.find(i=>i.number===2);return $e(t&&t.fieldKind=="scalar"&&t.scalar!=V.BYTES&&t.scalar!=V.FLOAT&&t.scalar!=V.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function pf(e){var t;return tf==Pt("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function oo(e,t){return e.type==wr?!0:ef==Pt("messageEncoding",{proto:e,parent:t})}function Pt(e,t){var r,i;const s=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(s){const h=s[e];if(h!=0)return h}if("kind"in t){if(t.kind=="message")return Pt(e,(i=t.parent)!==null&&i!==void 0?i:t.file);const h=Fc[t.edition];if(!h)throw new Error(`feature default for edition ${t.edition} not found`);return h[e]}return Pt(e,t.parent)}function $e(e,t){if(!e)throw new Error(t)}function gf(e){const t=vf(e);return t.messageType.forEach(Wn),Oc(t,()=>{}).getFile(t.name)}function vf(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Vc),enumType:e.enumType.map(Pc)}))}function Vc(e){var t,r,i,s,h,p,n,o;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(mf))!==null&&r!==void 0?r:[],extension:[],nestedType:(s=(i=e.nestedType)===null||i===void 0?void 0:i.map(Vc))!==null&&s!==void 0?s:[],enumType:(p=(h=e.enumType)===null||h===void 0?void 0:h.map(Pc))!==null&&p!==void 0?p:[],extensionRange:(o=(n=e.extensionRange)===null||n===void 0?void 0:n.map(a=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},a)))!==null&&o!==void 0?o:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function mf(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?_f(e.options):void 0}))}function _f(e){var t,r,i;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(i=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(s=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},s)))!==null&&i!==void 0?i:[],uninterpretedOption:[]}))}function Pc(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(t=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},t))})}function bf(e){const t=Sf();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let i=new Uint8Array(r),s=0,h=0,p,n=0;for(let o=0;o<e.length;o++){if(p=t[e.charCodeAt(o)],p===void 0)switch(e[o]){case"=":h=0;case`
1776
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(h){case 0:n=p,h=1;break;case 1:i[s++]=n<<2|(p&48)>>4,n=p,h=2;break;case 2:i[s++]=(n&15)<<4|(p&60)>>2,n=p,h=3;break;case 3:i[s++]=(n&3)<<6|p,h=0;break}}if(h==1)throw Error("invalid base64 string");return i.subarray(0,s)}let Zr,Tt;function yf(e){return Zr||(Zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Zr.slice(0,-2).concat("-","_")),Zr}function Sf(){if(!Tt){Tt=[];const e=yf();for(let t=0;t<e.length;t++)Tt[e[t].charCodeAt(0)]=t;Tt[45]=e.indexOf("+"),Tt[95]=e.indexOf("/")}return Tt}function Wc(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}class Wt extends Error{constructor(t,r,i="FieldValueInvalidError"){super(r),this.name=i,this.field=()=>t}}function Ht(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $n(e,t){var r,i,s,h;if(Ht(e)&&et in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const p=t,n=e.field();return p.listKind==n.listKind&&p.scalar===n.scalar&&((r=p.message)===null||r===void 0?void 0:r.typeName)===((i=n.message)===null||i===void 0?void 0:i.typeName)&&((s=p.enum)===null||s===void 0?void 0:s.typeName)===((h=n.enum)===null||h===void 0?void 0:h.typeName)}return!0}return!1}function Zn(e,t){var r,i,s,h;if(Ht(e)&&et in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const p=t,n=e.field();return p.mapKey===n.mapKey&&p.mapKind==n.mapKind&&p.scalar===n.scalar&&((r=p.message)===null||r===void 0?void 0:r.typeName)===((i=n.message)===null||i===void 0?void 0:i.typeName)&&((s=p.enum)===null||s===void 0?void 0:s.typeName)===((h=n.enum)===null||h===void 0?void 0:h.typeName)}return!0}return!1}function Gn(e,t){return Ht(e)&&et in e&&"desc"in e&&Ht(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Wi=Symbol.for("@bufbuild/protobuf/text-encoding");function Hc(){if(globalThis[Wi]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Wi]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Wi]}var Ze;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Ze||(Ze={}));const Ef=34028234663852886e22,Cf=-34028234663852886e22,wf=4294967295,kf=2147483647,If=-2147483648;class Af{constructor(t,r=Hc().decodeUtf8){this.decodeUtf8=r,this.varint64=Bh,this.uint32=Dh,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,i=t&7;if(r<=0||i<0||i>5)throw new Error("illegal tag: field no "+r+" wire type "+i);return[r,i]}skip(t,r){let i=this.pos;switch(t){case Ze.Varint:for(;this.buf[this.pos++]&128;);break;case Ze.Bit64:this.pos+=4;case Ze.Bit32:this.pos+=4;break;case Ze.LengthDelimited:let s=this.uint32();this.pos+=s;break;case Ze.StartGroup:for(;;){const[h,p]=this.tag();if(p===Ze.EndGroup){if(r!==void 0&&h!==r)throw new Error("invalid end group tag");break}this.skip(p,h)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Te.dec(...this.varint64())}uint64(){return Te.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),i=-(t&1);return t=(t>>>1|(r&1)<<31)^i,r=r>>>1^i,Te.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Te.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Te.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function Tf(e,t){const r=e.fieldKind=="list"?$n(t,e):e.fieldKind=="map"?Zn(t,e):Yn(e,t);if(r===!0)return;let i;switch(e.fieldKind){case"list":i=`expected ${Gc(e)}, got ${gi(t)}`;break;case"map":i=`expected ${Yc(e)}, got ${gi(t)}`;break;default:i=pi(e,t,r)}return new Wt(e,i)}function ao(e,t,r){const i=Yn(e,r);if(i!==!0)return new Wt(e,`list item #${t+1}: ${pi(e,r,i)}`)}function Rf(e,t,r){const i=$c(t,e.mapKey);if(i!==!0)return new Wt(e,`invalid map key: ${pi({scalar:e.mapKey},t,i)}`);const s=Yn(e,r);if(s!==!0)return new Wt(e,`map entry ${gi(t)}: ${pi(e,r,s)}`)}function Yn(e,t){return e.scalar!==void 0?$c(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):Gn(t,e.message)}function $c(e,t){switch(t){case V.DOUBLE:return typeof e=="number";case V.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>Ef||e<Cf?`${e.toFixed()} out of range`:!0;case V.INT32:case V.SFIXED32:case V.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>kf||e<If?`${e.toFixed()} out of range`:!0;case V.FIXED32:case V.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>wf||e<0?`${e.toFixed()} out of range`:!0;case V.BOOL:return typeof e=="boolean";case V.STRING:return typeof e!="string"?!1:Hc().checkUtf8(e)||"invalid UTF8";case V.BYTES:return e instanceof Uint8Array;case V.INT64:case V.SFIXED64:case V.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Te.parse(e),!0}catch{return`${e} out of range`}return!1;case V.FIXED64:case V.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Te.uParse(e),!0}catch{return`${e} out of range`}return!1}}function pi(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${gi(t)}`,e.scalar!==void 0?`expected ${Bf(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${Zc(e.message)}`+r}function gi(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:$n(e)?Gc(e.field()):Zn(e)?Yc(e.field()):Gn(e)?Zc(e.desc):Wc(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Zc(e){return`ReflectMessage (${e.typeName})`}function Gc(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${V[e.scalar]})`}}function Yc(e){switch(e.mapKind){case"message":return`ReflectMap (${V[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${V[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${V[e.mapKey]}, ${V[e.scalar]})`}}function Bf(e){switch(e){case V.STRING:return"string";case V.BOOL:return"boolean";case V.INT64:case V.SINT64:case V.SFIXED64:return"bigint (int64)";case V.UINT64:case V.FIXED64:return"bigint (uint64)";case V.BYTES:return"Uint8Array";case V.DOUBLE:return"number (float64)";case V.FLOAT:return"number (float32)";case V.FIXED32:case V.UINT32:return"number (uint32)";case V.INT32:case V.SFIXED32:case V.SINT32:return"number (int32)"}}function Nf(e){return Xc(e.$typeName)}function Lf(e){const t=e.fields[0];return Xc(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function Xc(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const xf=999,Df=998,ii=2;function Of(e,t){return Wc(t,e)?t:Mf(e)}const Ff=Symbol(),co=new WeakMap;function Mf(e){let t;if(Uf(e)){const r=co.get(e);let i,s;if(r)({prototype:i,members:s}=r);else{i={},s=new Set;for(const h of e.members)h.kind!="oneof"&&(h.fieldKind!="scalar"&&h.fieldKind!="enum"||h.presence!=ii&&(s.add(h),i[h.localName]=Hi(h)));co.set(e,{prototype:i,members:s})}t=Object.create(i),t.$typeName=e.typeName;for(const h of e.members)s.has(h)||h.kind=="field"&&(h.fieldKind=="message"||(h.fieldKind=="scalar"||h.fieldKind=="enum")&&h.presence!=ii)||(t[h.localName]=Hi(h))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==ii)&&(t[r.localName]=Hi(r))}return t}function Uf(e){switch(e.file.edition){case xf:return!1;case Df:return!0;default:return e.fields.some(t=>t.presence!=ii&&t.fieldKind!="message"&&!t.oneof)}}function Hi(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return Ff;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?Er(e.scalar,e.longAsString):e.enum.values[0].number}function Xn(e,t,r=!0){return new Kc(e,t,r)}class Kc{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,i)=>r.number-i.number)}constructor(t,r,i=!0){this.lists=new Map,this.maps=new Map,this.check=i,this.desc=t,this.message=this[et]=r??Of(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return ir(this.message,t),Mh(this.message,t)}isSet(t){return ir(this.message,t),Uh(this.message,t)}clear(t){ir(this.message,t),Wh(this.message,t)}get(t){ir(this.message,t);const r=Vh(this.message,t);switch(t.fieldKind){case"list":let i=this.lists.get(t);return(!i||i[et]!==r)&&this.lists.set(t,i=new Vf(t,r,this.check)),i;case"map":let s=this.maps.get(t);return(!s||s[et]!==r)&&this.maps.set(t,s=new Pf(t,r,this.check)),s;case"message":return jn(t,r,this.check);case"scalar":return r===void 0?Er(t.scalar,!1):zn(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(ir(this.message,t),this.check){const s=Tf(t,r);if(s)throw s}let i;t.fieldKind=="message"?i=Kn(t,r):Zn(r)||$n(r)?i=r[et]:i=Jn(t,r),Ph(this.message,t,i)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function ir(e,t){if(t.parent.typeName!==e.$typeName)throw new Wt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class Vf{field(){return this._field}get size(){return this._arr.length}constructor(t,r,i){this._field=t,this._arr=this[et]=r,this.check=i}get(t){const r=this._arr[t];return r===void 0?void 0:$i(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Wt(this._field,`list item #${t+1}: out of range`);if(this.check){const i=ao(this._field,t,r);if(i)throw i}this._arr[t]=lo(this._field,r)}add(t){if(this.check){const r=ao(this._field,this._arr.length,t);if(r)throw r}this._arr.push(lo(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield $i(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,$i(this._field,this._arr[t],this.check)]}}class Pf{constructor(t,r,i=!0){this.obj=this[et]=r??{},this.check=i,this._field=t}field(){return this._field}set(t,r){if(this.check){const i=Rf(this._field,t,r);if(i)throw i}return this.obj[Gr(t)]=Wf(this._field,r),this}delete(t){const r=Gr(t),i=Object.prototype.hasOwnProperty.call(this.obj,r);return i&&delete this.obj[r],i}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[Gr(t)];return r!==void 0&&(r=Zi(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Gr(t))}*keys(){for(const t of Object.keys(this.obj))yield uo(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[uo(t[0],this._field.mapKey),Zi(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Zi(this._field,t,this.check)}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}}function Kn(e,t){return Gn(t)?Nf(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?zc(t.message):t.message:t}function jn(e,t,r){return t!==void 0&&(Lf(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:zn(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Ht(t)&&(t=jc(t))),new Kc(e.message,t,r)}function lo(e,t){return e.listKind=="message"?Kn(e,t):Jn(e,t)}function $i(e,t,r){return e.listKind=="message"?jn(e,t,r):zn(e,t)}function Wf(e,t){return e.mapKind=="message"?Kn(e,t):Jn(e,t)}function Zi(e,t,r){return e.mapKind=="message"?jn(e,t,r):t}function Gr(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function uo(e,t){switch(t){case V.STRING:return e;case V.INT32:case V.FIXED32:case V.UINT32:case V.SFIXED32:case V.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case V.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case V.UINT64:case V.FIXED64:try{return Te.uParse(e)}catch{}break;default:try{return Te.parse(e)}catch{}break}return e}function zn(e,t){switch(e.scalar){case V.INT64:case V.SFIXED64:case V.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Te.parse(t));break;case V.FIXED64:case V.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Te.uParse(t));break}return t}function Jn(e,t){switch(e.scalar){case V.INT64:case V.SFIXED64:case V.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Te.parse(t));break;case V.FIXED64:case V.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Te.uParse(t));break}return t}function jc(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Ht(e))for(const[r,i]of Object.entries(e))t.fields[r]=Qc(i);return t}function zc(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=Jc(i);return t}function Jc(e){switch(e.kind.case){case"structValue":return zc(e.kind.value);case"listValue":return e.kind.value.values.map(Jc);case"nullValue":case void 0:return null;default:return e.kind.value}}function Qc(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const i of e)r.values.push(Qc(i));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:jc(e)};break}return t}function zt(e,t,...r){return r.reduce((i,s)=>i.nestedMessages[s],e.messages[t])}function Ii(e,t,...r){if(r.length==0)return e.enums[t];const i=r.pop();return r.reduce((s,h)=>s.nestedMessages[h],e.messages[t]).nestedEnums[i]}function Ai(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const Hf=gf({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),$f=zt(Hf,1);var ho;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(ho||(ho={}));var fo;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(fo||(fo={}));var po;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(po||(po={}));var go;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(go||(go={}));var vo;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(vo||(vo={}));var mo;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(mo||(mo={}));var _o;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(_o||(_o={}));var bo;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(bo||(bo={}));var yo;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(yo||(yo={}));var So;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(So||(So={}));var Eo;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Eo||(Eo={}));var Co;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(Co||(Co={}));var wo;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(wo||(wo={}));var ko;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(ko||(ko={}));var Io;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(Io||(Io={}));var Ao;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Ao||(Ao={}));var To;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(To||(To={}));var Ro;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Ro||(Ro={}));var Bo;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(Bo||(Bo={}));var No;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(No||(No={}));const Lo={readUnknownFields:!0};function Zf(e){return e?Object.assign(Object.assign({},Lo),e):Lo}function Gf(e,t,r){const i=Xn(e,void 0,!1);return qc(i,new Af(t),Zf(r),!1,t.byteLength),i.message}function qc(e,t,r,i,s){var h;const p=i?t.len:t.pos+s;let n,o;const a=(h=e.getUnknown())!==null&&h!==void 0?h:[];for(;t.pos<p&&([n,o]=t.tag(),!(i&&o==Ze.EndGroup));){const g=e.findNumber(n);if(!g){const d=t.skip(o,n);r.readUnknownFields&&a.push({no:n,wireType:o,data:d});continue}Yf(e,t,g,o,r)}if(i&&(o!=Ze.EndGroup||n!==s))throw new Error("invalid end group tag");a.length>0&&e.setUnknown(a)}function Yf(e,t,r,i,s){var h;switch(r.fieldKind){case"scalar":e.set(r,$t(t,r.scalar));break;case"enum":const p=$t(t,V.INT32);if(r.enum.open)e.set(r,p);else if(r.enum.values.some(n=>n.number===p))e.set(r,p);else if(s.readUnknownFields){const n=[];xh(p,n);const o=(h=e.getUnknown())!==null&&h!==void 0?h:[];o.push({no:r.number,wireType:i,data:new Uint8Array(n)}),e.setUnknown(o)}break;case"message":e.set(r,Qn(t,s,r,e.get(r)));break;case"list":Kf(t,i,e.get(r),s);break;case"map":Xf(t,e.get(r),s);break}}function Xf(e,t,r){const i=t.field();let s,h;const p=e.uint32(),n=e.pos+p;for(;e.pos<n;){const[o]=e.tag();switch(o){case 1:s=$t(e,i.mapKey);break;case 2:switch(i.mapKind){case"scalar":h=$t(e,i.scalar);break;case"enum":h=e.int32();break;case"message":h=Qn(e,r,i);break}break}}if(s===void 0&&(s=Er(i.mapKey,!1)),h===void 0)switch(i.mapKind){case"scalar":h=Er(i.scalar,!1);break;case"enum":h=i.enum.values[0].number;break;case"message":h=Xn(i.message,void 0,!1);break}t.set(s,h)}function Kf(e,t,r,i){var s;const h=r.field();if(h.listKind==="message"){r.add(Qn(e,i,h));return}const p=(s=h.scalar)!==null&&s!==void 0?s:V.INT32;if(!(t==Ze.LengthDelimited&&p!=V.STRING&&p!=V.BYTES)){r.add($t(e,p));return}const n=e.uint32()+e.pos;for(;e.pos<n;)r.add($t(e,p))}function Qn(e,t,r,i){const s=r.delimitedEncoding,h=i??Xn(r.message,void 0,!1);return qc(h,e,t,s,s?r.number:e.uint32()),h}function $t(e,t){switch(t){case V.STRING:return e.string();case V.BOOL:return e.bool();case V.DOUBLE:return e.double();case V.FLOAT:return e.float();case V.INT32:return e.int32();case V.INT64:return e.int64();case V.UINT64:return e.uint64();case V.FIXED64:return e.fixed64();case V.BYTES:return e.bytes();case V.FIXED32:return e.fixed32();case V.SFIXED32:return e.sfixed32();case V.SFIXED64:return e.sfixed64();case V.SINT64:return e.sint64();case V.UINT32:return e.uint32();case V.SINT32:return e.sint32()}}function Fr(e,t){var r;const i=Gf($f,bf(e));return i.messageType.forEach(Wn),i.dependency=(r=t==null?void 0:t.map(s=>s.proto.name))!==null&&r!==void 0?r:[],Oc(i,s=>t==null?void 0:t.find(h=>h.proto.name===s)).getFile(i.name)}const qn=Fr("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),xo=zt(qn,0,0),jf=Ii(qn,0),Gi=Ai(jf),Mr=Fr("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[La.file_google_protobuf_wrappers,qn]),el=zt(Mr,12),mn=zt(Mr,13),zf=Ii(Mr,19,0),qe=Ai(zf),Jf=Ii(Mr,2),Qf=Ai(Jf),qf=Fr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),ep=Ii(qf,0),tp=Ai(ep),rp=Fr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),tl=Fr("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[rp,Mr]),_n=zt(tl,3),ip=zt(tl,4),we=[];for(let e=0;e<256;++e)we.push((e+256).toString(16).slice(1));function np(e,t=0){return(we[e[t+0]]+we[e[t+1]]+we[e[t+2]]+we[e[t+3]]+"-"+we[e[t+4]]+we[e[t+5]]+"-"+we[e[t+6]]+we[e[t+7]]+"-"+we[e[t+8]]+we[e[t+9]]+"-"+we[e[t+10]]+we[e[t+11]]+we[e[t+12]]+we[e[t+13]]+we[e[t+14]]+we[e[t+15]]).toLowerCase()}let Yi;const sp=new Uint8Array(16);function op(){if(!Yi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yi=crypto.getRandomValues.bind(crypto)}return Yi(sp)}const ap=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Do={randomUUID:ap};function cp(e,t,r){var i;if(Do.randomUUID&&!e)return Do.randomUUID();e=e||{};const s=e.random??((i=e.rng)==null?void 0:i.call(e))??op();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,np(s)}const lp=5e3,up=1e3,Yr=4e3,Oo=1e3;class dp{constructor({knownID:t,runID:r,sequence:i,options:s}){this.queue=new We,this.subscriptions=[],this.reconnect=new We,this.client=new _e,this._latencies=new We,this._latenciesConnectable=mt(this._latencies.asObservable().pipe(Kd((h,p)=>{if(p.latency<0){const n=h.get(p.streamID);n&&h.set(p.streamID,{...n,readyState:p.readyState})}else h.set(p.streamID,p);return h},new Map))),this._errors=new We,this._errorsConnectable=mt(this._errors.asObservable()),this._stdout=new We,this._stderr=new We,this._exitCode=new We,this._pid=new We,this._mimeType=new We,this._stdoutConnectable=mt(this._stdout.asObservable()),this._stderrConnectable=mt(this._stderr.asObservable()),this._exitCodeConnectable=mt(this._exitCode.asObservable()),this._pidConnectable=mt(this._pid.asObservable()),this._mimeTypeConnectable=mt(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=s.runnerEndpoint,this.interceptors=s.interceptors,this.autoReconnect=s.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(js(Oo,Or,{leading:!0,trailing:!0}),Ks(h=>this.useSocketClient(h.streamID).pipe(Ks(p=>this.useHeartbeat(p,h))))).pipe(dc()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return Ud(up).pipe(je(()=>this.autoReconnect),Pi(this.reconnect),je(([,t])=>t.heartbeat==="CONTINUOUS"),Pi(this.latencies),Oe(([,t])=>Array.from(t.values()).filter(r=>r.readyState===WebSocket.OPEN&&r.latency>=Yr)),je(t=>t.length>0),js(Oo)).subscribe({next:t=>{console.log(new Date,"Triggering reconnect",t),this.connect()},complete:()=>{console.log("Monitor complete")},error:t=>{console.error("Error in monitor",t)}})}process(){const t=this.client.pipe(je(s=>(s==null?void 0:s.readyState)===WebSocket.OPEN),Xs(1)),r=this.queue.pipe(Zd(()=>t),je(s=>s.length>0),Oe(s=>s.sort((h,p)=>{const n=o=>{var a;return!!((a=o.payload.value)!=null&&a.config)};return n(p)?1:n(h)?-1:0}))),i=this.queue.pipe(jd(t));return Vd(r.pipe(yt(s=>s)),i).pipe(Pi(this.client),$r(([,s])=>s.readyState===WebSocket.OPEN),yt(async([s,h])=>{await Mo({req:s,interceptors:this.interceptors,socket:h,knownID:this.knownID,runID:this.runID})})).subscribe({error:s=>{this._errors.next(s)}})}useSocketClient(t){return new _e(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const s=new WebSocket(i.toString()),h=a=>{if(console.log(new Date,`WebSocket transport ${t} closed`,a),a.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},p=a=>{console.log(new Date,`WebSocket transport ${t} error`,a),this.autoReconnect||r.error(a)},n=a=>{var g,d;if(typeof a.data!="string"){console.warn("Unexpected WebSocket message type:",typeof a.data);return}let v;try{v=Fo(a.data),console.log("Received WebsocketResponse:",v)}catch(m){console.error("Failed to parse WebsocketResponse:",m)}const b=v.status;if(b&&b.code!==tp.OK){r.error(b);return}if(v.pong)return;const C=v.payload.value;if(C.stdoutData&&C.stdoutData.length>0&&((g=this.callback)==null||g.call(this,{type:ee.terminalStdout,output:{"runme.dev/id":this.knownID,data:C.stdoutData}}),this._stdout.next(C.stdoutData)),C.stderrData&&C.stderrData.length>0&&((d=this.callback)==null||d.call(this,{type:ee.terminalStderr,output:{"runme.dev/id":this.knownID,data:C.stderrData}}),this._stderr.next(C.stderrData)),C.exitCode!==void 0&&(this._exitCode.next(C.exitCode),r.complete()),C.pid!==void 0&&this._pid.next(C.pid),C.mimeType){const m=C.mimeType.split(";")[0];this._mimeType.next(m)}},o=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(s)};return s.addEventListener("close",h),s.addEventListener("error",p),s.addEventListener("message",n),s.addEventListener("open",o),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),s.removeEventListener("close",h),s.removeEventListener("error",p),s.removeEventListener("message",n),s.removeEventListener("open",o),s.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(xe.create(_n,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new _e(s=>{const h=an(t,"message").pipe($r(()=>t.readyState===WebSocket.OPEN),Oe(o=>Fo(o.data)),Oe(o=>o.pong),je(o=>o!==void 0),Oe(o=>({receivedAt:BigInt(Date.now()),pong:o}))),p=(i==="INITIAL"?lr(0):lr(0,lp)).pipe($r(()=>t.readyState===WebSocket.OPEN),Oe(()=>{const o={timestamp:BigInt(Date.now())};return xe.create(_n,{ping:o})}),yt(async o=>(await Mo({req:o,interceptors:this.interceptors,socket:t}),o)),Oe(o=>o.ping)).pipe(je(o=>(o==null?void 0:o.timestamp)!==void 0),yt(o=>Hd(h.pipe(je(a=>a.pong.timestamp===o.timestamp),Xs(1),Oe(a=>{const g=o.timestamp,d=a.receivedAt;return Number(d-g)})),lr(Yr).pipe(Oe(()=>{throw new Error(`Pong not received within ${Yr}ms for stream ${r}`)}))).pipe(cc(a=>(this._latencies.next({streamID:r,latency:Yr,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",a.message),Cd(null))))),Xd(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),zd(o=>{o!==null&&this._latencies.next({streamID:r,latency:o,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),n=[];return n.push(p.subscribe({error:o=>{console.error("Unexpected error sending heartbeat",o)}})),s.next(t),()=>{n.forEach(o=>o.unsubscribe())}})}connect(t="CONTINUOUS"){const r=hp(),i=this.latencies.pipe(Oe(s=>{const h=s.get(r);return h===void 0?null:h}),$r(s=>(s==null?void 0:s.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Fo(e){const t=JSON.parse(e);return xe.fromJson(ip,t)}async function Mo({req:e,interceptors:t,socket:r,knownID:i,runID:s}){i&&(e.knownId=i),s&&(e.runId=s);const h={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let p=async o=>({stream:!1,message:{},method:{},service:{},header:o.header});for(const o of t.concat().reverse())p=o(p);const n=(await p(h)).header.get("Authorization");n&&e&&(e.authorization=n),r.send(JSON.stringify(xe.toJson(_n,e)))}function hp(){return cp().replace(/-/g,"")}var fp=Object.defineProperty,pp=Object.getOwnPropertyDescriptor,rl=e=>{throw TypeError(e)},se=(e,t,r,i)=>{for(var s=i>1?void 0:i?pp(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&fp(t,r,s),s},es=(e,t,r)=>t.has(e)||rl("Cannot "+r),ue=(e,t,r)=>(es(e,t,"read from private field"),t.get(e)),Xr=(e,t,r)=>t.has(e)?rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),vi=(e,t,r,i)=>(es(e,t,"write to private field"),t.set(e,r),r),Fe=(e,t,r)=>(es(e,t,"access private method"),r),Ae,ze,St,Le,il,ts,nl,bn,mi,yn,sl,ol;const gp="runme-console";let ne=class extends Be{constructor(){super(),Xr(this,Le),this.disposables=[],Xr(this,Ae),Xr(this,ze,[]),Xr(this,St,{rows:34,cols:100,x:0,y:0}),this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.reconnect=!0,this.interceptors=[],Fe(this,Le,ol).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");Fe(this,Le,il).call(this),Fe(this,Le,bn).call(this),Fe(this,Le,yn).call(this)}disconnectedCallback(){super.disconnectedCallback(),Fe(this,Le,mi).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&Fe(this,Le,ts).call(this),(e.has("knownId")||e.has("runId")||e.has("sequence")||e.has("runnerEndpoint")||e.has("interceptors")||e.has("commands")||e.has("languageId"))&&(Fe(this,Le,bn).call(this),Fe(this,Le,yn).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return z`<div></div>`}dispose(){Fe(this,Le,mi).call(this),this.disposables.forEach(({dispose:e})=>e())}};Ae=new WeakMap;ze=new WeakMap;St=new WeakMap;Le=new WeakSet;il=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),Fe(this,Le,ts).call(this),this.shadowRoot.appendChild(this.consoleView),Fe(this,Le,nl).call(this))};ts=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons",this.buttons.toString()),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.theme),this.fontFamily&&this.consoleView.setAttribute("fontFamily",this.fontFamily),this.fontSize!==void 0&&this.consoleView.setAttribute("fontSize",this.fontSize.toString()),this.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.cursorStyle),this.cursorBlink!==void 0&&this.consoleView.setAttribute("cursorBlink",this.cursorBlink.toString()),this.cursorWidth!==void 0&&this.consoleView.setAttribute("cursorWidth",this.cursorWidth.toString()),this.smoothScrollDuration!==void 0&&this.consoleView.setAttribute("smoothScrollDuration",this.smoothScrollDuration.toString()),this.scrollback!==void 0&&this.consoleView.setAttribute("scrollback",this.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()),this.lastLine!==void 0&&this.consoleView.setAttribute("lastLine",this.lastLine.toString()),this.isLoading!==void 0&&this.consoleView.setAttribute("isLoading",this.isLoading.toString()),this.isCreatingEscalation!==void 0&&this.consoleView.setAttribute("isCreatingEscalation",this.isCreatingEscalation.toString()),this.shareUrl&&this.consoleView.setAttribute("shareUrl",this.shareUrl),this.escalationUrl&&this.consoleView.setAttribute("escalationUrl",this.escalationUrl),this.isUpdatedReady!==void 0&&this.consoleView.setAttribute("isUpdatedReady",this.isUpdatedReady.toString()),this.isAutoSaveEnabled!==void 0&&this.consoleView.setAttribute("isAutoSaveEnabled",this.isAutoSaveEnabled.toString()),this.isPlatformAuthEnabled!==void 0&&this.consoleView.setAttribute("isPlatformAuthEnabled",this.isPlatformAuthEnabled.toString()),this.isDaggerOutput!==void 0&&this.consoleView.setAttribute("isDaggerOutput",this.isDaggerOutput.toString()))};nl=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};bn=function(){if(ue(this,Ae))return;const e=this.knownId??this.id;if(!e||!this.runId||!this.runnerEndpoint)return;vi(this,Ae,new dp({knownID:e,runID:this.runId,sequence:this.sequence??0,options:{runnerEndpoint:this.runnerEndpoint,interceptors:this.interceptors??[],autoReconnect:this.reconnect}}));const t=ue(this,Ae).connect().subscribe();ue(this,ze).push(()=>t.unsubscribe());const r=ue(this,Ae).stdout.subscribe(n=>{this.dispatchEvent(new CustomEvent("stdout",{detail:n})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(n)}),i=ue(this,Ae).stderr.subscribe(n=>{this.dispatchEvent(new CustomEvent("stderr",{detail:n}))}),s=ue(this,Ae).exitCode.subscribe(n=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:n})),Fe(this,Le,mi).call(this)}),h=ue(this,Ae).pid.subscribe(n=>{this.dispatchEvent(new CustomEvent("pid",{detail:n}))}),p=ue(this,Ae).mimeType.subscribe(n=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:n}))});ue(this,ze).push(()=>r.unsubscribe()),ue(this,ze).push(()=>i.unsubscribe()),ue(this,ze).push(()=>s.unsubscribe()),ue(this,ze).push(()=>h.unsubscribe()),ue(this,ze).push(()=>p.unsubscribe())};mi=function(){var e;ue(this,ze).forEach(t=>{try{t()}catch{}}),vi(this,ze,[]),(e=ue(this,Ae))==null||e.close(),vi(this,Ae,void 0)};yn=function(){if(!ue(this,Ae)||!this.commands||!this.runId)return;const e=Fe(this,Le,sl).call(this);e&&ue(this,Ae).sendExecuteRequest(e)};sl=function(){var e;const t=this.languageId||"sh",r=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(t),i=xe.create(mn,{sessionStrategy:Qf.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:t,background:!1,fileExtension:"",env:[`RUNME_ID=${this.knownId??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:this.runId,knownId:this.knownId??this.id},winsize:xe.create(el,ue(this,St))});return((e=this.commands)==null?void 0:e.length)===0?(i.config.mode=Gi.INLINE,i.config.source={case:"commands",value:xe.create(xo,{items:["zsh -l"]})}):r?(i.config.source={case:"commands",value:xe.create(xo,{items:this.commands??[]})},i.config.mode=Gi.INLINE):(i.config.source={case:"script",value:(this.commands??[]).join(`
1777
- `)},i.config.mode=Gi.FILE,i.config.fileExtension=this.languageId||""),i};ol=function(){const e=new TextEncoder,t={postMessage:r=>{var i,s;if(r.type===ee.terminalOpen||r.type===ee.terminalResize){const h=Number(r.output.terminalDimensions.columns),p=Number(r.output.terminalDimensions.rows);if(Number.isFinite(h)&&Number.isFinite(p)){if(ue(this,St).cols===h&&ue(this,St).rows===p)return;vi(this,St,xe.create(el,{cols:h,rows:p,x:0,y:0}));const n=xe.create(mn,{winsize:ue(this,St)});(i=ue(this,Ae))==null||i.sendExecuteRequest(n)}}if(r.type===ee.terminalStdin){const h=e.encode(r.output.input),p=xe.create(mn,{inputData:h});(s=ue(this,Ae))==null||s.sendExecuteRequest(p)}},onDidReceiveMessage:r=>{var i;(i=ue(this,Ae))==null||i.setCallback(r)}};try{rh(t)}catch{console.error("Failed to set context bridge")}};se([G({type:String})],ne.prototype,"id",2);se([G({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"buttons",2);se([G({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"takeFocus",2);se([G({type:String})],ne.prototype,"theme",2);se([G({type:String})],ne.prototype,"fontFamily",2);se([G({type:Number})],ne.prototype,"fontSize",2);se([G({type:String})],ne.prototype,"cursorStyle",2);se([G({type:Boolean})],ne.prototype,"cursorBlink",2);se([G({type:Number})],ne.prototype,"cursorWidth",2);se([G({type:Number})],ne.prototype,"smoothScrollDuration",2);se([G({type:Number})],ne.prototype,"scrollback",2);se([G({type:String})],ne.prototype,"initialContent",2);se([G({type:Number})],ne.prototype,"initialRows",2);se([G({type:Number})],ne.prototype,"lastLine",2);se([G({type:Boolean})],ne.prototype,"isLoading",2);se([G({type:Boolean})],ne.prototype,"isCreatingEscalation",2);se([G()],ne.prototype,"shareUrl",2);se([G()],ne.prototype,"escalationUrl",2);se([G({type:Boolean})],ne.prototype,"isUpdatedReady",2);se([G({type:Boolean})],ne.prototype,"isAutoSaveEnabled",2);se([G({type:Boolean})],ne.prototype,"isPlatformAuthEnabled",2);se([G({type:Boolean})],ne.prototype,"isDaggerOutput",2);se([G({type:String})],ne.prototype,"knownId",2);se([G({type:String})],ne.prototype,"runId",2);se([G({type:Number})],ne.prototype,"sequence",2);se([G({type:String})],ne.prototype,"languageId",2);se([G({type:Array,attribute:!1})],ne.prototype,"commands",2);se([G({type:String})],ne.prototype,"runnerEndpoint",2);se([G({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"reconnect",2);se([G({attribute:!1})],ne.prototype,"interceptors",2);ne=se([Ue(gp)],ne);var vp=Object.defineProperty,mp=Object.getOwnPropertyDescriptor,Ti=(e,t,r,i)=>{for(var s=i>1?void 0:i?mp(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&vp(t,r,s),s};let Zt=class extends Be{constructor(){super(...arguments),this.columns=[],this.rows=[],this.renderer=(e,t)=>z`${e[t]}`,this.displayable=()=>!0,this.hasErrors=()=>!1}get heading(){var e,t;return(e=this.columns)!=null&&e.length?z`
1775
+ `;ge([Z({type:String})],le.prototype,"id",2);ge([Z({type:Boolean,converter:e=>e!=="false"})],le.prototype,"buttons",2);ge([Z({type:Boolean,converter:e=>e!=="false"})],le.prototype,"takeFocus",2);ge([Z({type:String})],le.prototype,"theme",2);ge([Z({type:String})],le.prototype,"fontFamily",2);ge([Z({type:Number})],le.prototype,"fontSize",2);ge([Z({type:String})],le.prototype,"cursorStyle",2);ge([Z({type:Boolean})],le.prototype,"cursorBlink",2);ge([Z({type:Number})],le.prototype,"cursorWidth",2);ge([Z({type:Number})],le.prototype,"smoothScrollDuration",2);ge([Z({type:Number})],le.prototype,"scrollback",2);ge([Z({type:String})],le.prototype,"initialContent",2);ge([Z({type:Number})],le.prototype,"initialRows",2);ge([Z({type:Number})],le.prototype,"lastLine",2);ge([Z({type:Boolean})],le.prototype,"isLoading",2);ge([Z({type:Boolean})],le.prototype,"isCreatingEscalation",2);ge([Z()],le.prototype,"shareUrl",2);ge([Z()],le.prototype,"escalationUrl",2);ge([Z({type:Boolean})],le.prototype,"isUpdatedReady",2);ge([Z({type:Boolean})],le.prototype,"isAutoSaveEnabled",2);ge([Z({type:Boolean})],le.prototype,"isPlatformAuthEnabled",2);ge([Z({type:Boolean})],le.prototype,"isDaggerOutput",2);le=ge([Ge(Lp)],le);function Hl(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function xp(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function Or(e){let t=!1;const r=[];for(let i=0;i<e.length;i++){let n=e.charAt(i);switch(n){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(n),t=!1;break;default:t&&(t=!1,n=n.toUpperCase()),r.push(n);break}}return r.join("")}const Dp=new Set(["constructor","toString","toJSON","valueOf"]);function Fr(e){return Dp.has(e)?e+"$":e}function Op(){let e=0,t=0;for(let i=0;i<28;i+=7){let n=this.buf[this.pos++];if(e|=(n&127)<<i,(n&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let n=this.buf[this.pos++];if(t|=(n&127)<<i,(n&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function pn(e,t,r){for(let a=0;a<28;a=a+7){const d=e>>>a,s=!(!(d>>>7)&&t==0),o=(s?d|128:d)&255;if(r.push(o),!s)return}const i=e>>>28&15|(t&7)<<4,n=t>>3!=0;if(r.push((n?i|128:i)&255),!!n){for(let a=3;a<31;a=a+7){const d=t>>>a,s=!!(d>>>7),o=(s?d|128:d)&255;if(r.push(o),!s)return}r.push(t>>>31&1)}}const bi=4294967296;function Jo(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let i=0,n=0;function a(d,s){const o=Number(e.slice(d,s));n*=r,i=i*r+o,i>=bi&&(n=n+(i/bi|0),i=i%bi)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Zl(i,n):ys(i,n)}function Fp(e,t){let r=ys(e,t);const i=r.hi&2147483648;i&&(r=Zl(r.lo,r.hi));const n=Gl(r.lo,r.hi);return i?"-"+n:n}function Gl(e,t){if({lo:e,hi:t}=Vp(e,t),t<=2097151)return String(bi*t+e);const r=e&16777215,i=(e>>>24|t<<8)&16777215,n=t>>16&65535;let a=r+i*6777216+n*6710656,d=i+n*8147497,s=n*2;const o=1e7;return a>=o&&(d+=Math.floor(a/o),a%=o),d>=o&&(s+=Math.floor(d/o),d%=o),s.toString()+jo(d)+jo(a)}function Vp(e,t){return{lo:e>>>0,hi:t>>>0}}function ys(e,t){return{lo:e|0,hi:t|0}}function Zl(e,t){return t=~t,e?e=~e+1:t+=1,ys(e,t)}const jo=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Hn(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function Up(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const de=Mp();function Mp(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),i=BigInt("0"),n=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const d=typeof a=="bigint"?a:BigInt(a);if(d>r||d<t)throw new Error(`invalid int64: ${a}`);return d},uParse(a){const d=typeof a=="bigint"?a:BigInt(a);if(d>n||d<i)throw new Error(`invalid uint64: ${a}`);return d},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,d){return e.setInt32(0,a,!0),e.setInt32(4,d,!0),e.getBigInt64(0,!0)},uDec(a,d){return e.setInt32(0,a,!0),e.setInt32(4,d,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(t){return typeof t!="string"&&(t=t.toString()),zo(t),t},uParse(t){return typeof t!="string"&&(t=t.toString()),Qo(t),t},enc(t){return typeof t!="string"&&(t=t.toString()),zo(t),Jo(t)},uEnc(t){return typeof t!="string"&&(t=t.toString()),Qo(t),Jo(t)},dec(t,r){return Fp(t,r)},uDec(t,r){return Gl(t,r)}}}function zo(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Qo(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var F;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(F||(F={}));function Wt(e,t){switch(e){case F.STRING:return"";case F.BOOL:return!1;case F.DOUBLE:case F.FLOAT:return 0;case F.INT64:case F.UINT64:case F.SFIXED64:case F.FIXED64:case F.SINT64:return t?"0":de.zero;case F.BYTES:return new Uint8Array(0);default:return 0}}function Pp(e,t){switch(e){case F.BOOL:return t===!1;case F.STRING:return t==="";case F.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Kl=2,ct=Symbol.for("reflect unsafe local");function Yl(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(i=>i.localName===r)}function Wp(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Kl)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!Pp(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Vr(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Xl(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Jl(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function $p(e,t){const r=t.localName;if(t.oneof){const i=t.oneof.localName;e[i].case===r&&(e[i]={case:void 0})}else if(t.presence!=Kl)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=Wt(t.scalar,t.longAsString);break}}function Ss(e){for(const t of e.field)Vr(t,"jsonName")||(t.jsonName=Or(t.name));e.nestedType.forEach(Ss)}function Hp(e,t){const r=e.values.find(i=>i.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function Gp(e,t){switch(e){case F.STRING:return t;case F.BYTES:{const r=Zp(t);if(r===!1)throw new Error(`cannot parse ${F[e]} default value: ${t}`);return r}case F.INT64:case F.SFIXED64:case F.SINT64:return de.parse(t);case F.UINT64:case F.FIXED64:return de.uParse(t);case F.DOUBLE:case F.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case F.BOOL:return t==="true";case F.INT32:case F.UINT32:case F.SINT32:case F.FIXED32:case F.SFIXED32:return parseInt(t,10)}}function Zp(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(i){if(this.tail.length>=i){const n=this.tail.substring(0,i);return this.tail=this.tail.substring(i),n}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const i=r.c,n=r.take(2);if(n===!1)return!1;const a=parseInt(i+n,8);if(Number.isNaN(a))return!1;t.push(a);break}case"x":{const i=r.c,n=r.take(2);if(n===!1)return!1;const a=parseInt(i+n,16);if(Number.isNaN(a))return!1;t.push(a);break}case"u":{const i=r.c,n=r.take(4);if(n===!1)return!1;const a=parseInt(i+n,16);if(Number.isNaN(a))return!1;const d=new Uint8Array(4);new DataView(d.buffer).setInt32(0,a,!0),t.push(d[0],d[1],d[2],d[3]);break}case"U":{const i=r.c,n=r.take(8);if(n===!1)return!1;const a=de.uEnc(i+n),d=new Uint8Array(8),s=new DataView(d.buffer);s.setInt32(0,a.lo,!0),s.setInt32(4,a.hi,!0),t.push(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*Gn(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Gn(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Gn(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function jl(...e){const t=Kp();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)ia(r,t);return t}if("$typeName"in e[0]){let r=function(d){const s=[];for(const o of d.dependency){if(t.getFile(o)!=null||a.has(o))continue;const c=n(o);if(!c)throw new Error(`Unable to resolve ${o}, imported by ${d.name}`);"kind"in c?t.addFile(c,!1,!0):(a.add(c.name),s.push(c))}return s.concat(...s.map(r))};const i=e[0],n=e[1],a=new Set;for(const d of[i,...r(i)].reverse())ia(d,t)}else for(const r of e)for(const i of r.files)t.addFile(i);return t}function Kp(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(i,n,a){if(r.set(i.proto.name,i),!n)for(const d of Gn(i))this.add(d);if(a)for(const d of i.dependencies)this.addFile(d,n,a)},add(i){if(i.kind=="extension"){let n=t.get(i.extendee.typeName);n||t.set(i.extendee.typeName,n=new Map),n.set(i.number,i)}e.set(i.typeName,i)},get(i){return e.get(i)},getFile(i){return r.get(i)},getMessage(i){const n=e.get(i);return(n==null?void 0:n.kind)=="message"?n:void 0},getEnum(i){const n=e.get(i);return(n==null?void 0:n.kind)=="enum"?n:void 0},getExtension(i){const n=e.get(i);return(n==null?void 0:n.kind)=="extension"?n:void 0},getExtensionFor(i,n){var a;return(a=t.get(i.typeName))===null||a===void 0?void 0:a.get(n)},getService(i){const n=e.get(i);return(n==null?void 0:n.kind)=="service"?n:void 0}}}const Yp=998,Xp=999,Jp=9,Ur=10,Cr=11,jp=12,qo=14,Es=3,zp=2,ea=1,Qp=0,ta=1,ra=2,qp=3,eg=1,tg=2,rg=1,zl={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function ia(e,t){var r,i;const n={kind:"file",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,edition:og(e),name:e.name.replace(/\.proto$/,""),dependencies:ag(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},a=new Map,d={get(s){return a.get(s)},add(s){var o;ze(((o=s.proto.options)===null||o===void 0?void 0:o.mapEntry)===!0),a.set(s.typeName,s)}};for(const s of e.enumType)Ql(s,n,void 0,t);for(const s of e.messageType)ql(s,n,void 0,t,d);for(const s of e.service)ig(s,n,t);Zn(n,t);for(const s of a.values())Kn(s,t,d);for(const s of n.messages)Kn(s,t,d),Zn(s,t);t.addFile(n,!0)}function Zn(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const i=Yn(r,e,t);e.extensions.push(i),t.add(i)}break;case"message":for(const r of e.proto.extension){const i=Yn(r,e,t);e.nestedExtensions.push(i),t.add(i)}for(const r of e.nestedMessages)Zn(r,t);break}}function Kn(e,t,r){const i=e.proto.oneofDecl.map(a=>sg(a,e)),n=new Set;for(const a of e.proto.field){const d=ug(a,i),s=Yn(a,e,t,d,r);e.fields.push(s),e.field[s.localName]=s,d===void 0?e.members.push(s):(d.fields.push(s),n.has(d)||(n.add(d),e.members.push(d)))}for(const a of i.filter(d=>n.has(d)))e.oneofs.push(a);for(const a of e.nestedMessages)Kn(a,t,r)}function Ql(e,t,r,i){var n,a,d,s,o;const c=cg(e.name,e.value),g={kind:"enum",proto:e,deprecated:(a=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&a!==void 0?a:!1,file:t,parent:r,open:!0,name:e.name,typeName:Wi(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};g.open=pg(g),i.add(g);for(const f of e.value){const m=f.name;g.values.push(g.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(d=f.options)===null||d===void 0?void 0:d.deprecated)!==null&&s!==void 0?s:!1,parent:g,name:m,localName:Fr(c==null?m:m.substring(c.length)),number:f.number,toString(){return`enum value ${g.typeName}.${m}`}})}((o=r==null?void 0:r.nestedEnums)!==null&&o!==void 0?o:t.enums).push(g)}function ql(e,t,r,i,n){var a,d,s,o;const c={kind:"message",proto:e,deprecated:(d=(a=e.options)===null||a===void 0?void 0:a.deprecated)!==null&&d!==void 0?d:!1,file:t,parent:r,name:e.name,typeName:Wi(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?n.add(c):(((o=r==null?void 0:r.nestedMessages)!==null&&o!==void 0?o:t.messages).push(c),i.add(c));for(const g of e.enumType)Ql(g,t,c,i);for(const g of e.nestedType)ql(g,t,c,i,n)}function ig(e,t,r){var i,n;const a={kind:"service",proto:e,deprecated:(n=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&n!==void 0?n:!1,file:t,name:e.name,typeName:Wi(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(a),r.add(a);for(const d of e.method){const s=ng(d,a,r);a.methods.push(s),a.method[s.localName]=s}}function ng(e,t,r){var i,n,a,d;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const o=r.getMessage(st(e.inputType)),c=r.getMessage(st(e.outputType));ze(o,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),ze(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(n=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&n!==void 0?n:!1,parent:t,name:g,localName:Fr(g.length?Fr(g[0].toLowerCase()+g.substring(1)):g),methodKind:s,input:o,output:c,idempotency:(d=(a=e.options)===null||a===void 0?void 0:a.idempotencyLevel)!==null&&d!==void 0?d:Qp,toString(){return`rpc ${t.typeName}.${g}`}}}function sg(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Fr(Or(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function Yn(e,t,r,i,n){var a,d,s;const o=n===void 0,c={kind:"field",proto:e,deprecated:(d=(a=e.options)===null||a===void 0?void 0:a.deprecated)!==null&&d!==void 0?d:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:dg(e,i,o,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(o){const _=t.kind=="file"?t:t.file,w=t.kind=="file"?void 0:t,v=Wi(e,w,_);c.kind="extension",c.file=_,c.parent=w,c.oneof=void 0,c.typeName=v,c.jsonName=`[${v}]`,c.toString=()=>`extension ${v}`;const l=r.getMessage(st(e.extendee));ze(l,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=l}else{const _=t;ze(_.kind=="message"),c.parent=_,c.oneof=i,c.localName=i?Or(e.name):Fr(Or(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const g=e.label,f=e.type,m=(s=e.options)===null||s===void 0?void 0:s.jstype;if(g===Es){const _=f==Cr?n==null?void 0:n.get(st(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:w,value:v}=fg(_);return c.mapKey=w.scalar,c.mapKind=v.fieldKind,c.message=v.message,c.delimitedEncoding=!1,c.enum=v.enum,c.scalar=v.scalar,c}switch(c.fieldKind="list",f){case Cr:case Ur:c.listKind="message",c.message=r.getMessage(st(e.typeName)),ze(c.message),c.delimitedEncoding=na(e,t);break;case qo:c.listKind="enum",c.enum=r.getEnum(st(e.typeName)),ze(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=m==ea;break}return c.packed=hg(e,t),c}switch(f){case Cr:case Ur:c.fieldKind="message",c.message=r.getMessage(st(e.typeName)),ze(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=na(e,t),c.getDefaultValue=()=>{};break;case qo:{const _=r.getEnum(st(e.typeName));ze(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(st(e.typeName)),c.getDefaultValue=()=>Vr(e,"defaultValue")?Hp(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=m==ea,c.getDefaultValue=()=>Vr(e,"defaultValue")?Gp(f,e.defaultValue):void 0;break}}return c}function og(e){switch(e.syntax){case"":case"proto2":return Yp;case"proto3":return Xp;case"editions":if(e.edition in zl)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function ag(e,t){return e.dependency.map(r=>{const i=t.getFile(r);if(!i)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return i})}function cg(e,t){const r=lg(e)+"_";for(const i of t){if(!i.name.toLowerCase().startsWith(r))return;const n=i.name.substring(r.length);if(n.length==0||/^\d/.test(n))return}return r}function lg(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function Wi(e,t,r){let i;return t?i=`${t.typeName}.${e.name}`:r.proto.package.length>0?i=`${r.proto.package}.${e.name}`:i=`${e.name}`,i}function st(e){return e.startsWith(".")?e.substring(1):e}function ug(e,t){if(!Vr(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return ze(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function dg(e,t,r,i){if(e.label==zp)return qp;if(e.label==Es)return ra;if(t||e.proto3Optional||r)return ta;const n=ir("fieldPresence",{proto:e,parent:i});return n==ra&&(e.type==Cr||e.type==Ur)?ta:n}function hg(e,t){if(e.label!=Es)return!1;switch(e.type){case Jp:case jp:case Ur:case Cr:return!1}const r=e.options;return r&&Vr(r,"packed")?r.packed:eg==ir("repeatedFieldEncoding",{proto:e,parent:t})}function fg(e){const t=e.fields.find(i=>i.number===1),r=e.fields.find(i=>i.number===2);return ze(t&&t.fieldKind=="scalar"&&t.scalar!=F.BYTES&&t.scalar!=F.FLOAT&&t.scalar!=F.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function pg(e){var t;return rg==ir("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function na(e,t){return e.type==Ur?!0:tg==ir("messageEncoding",{proto:e,parent:t})}function ir(e,t){var r,i;const n=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(n){const a=n[e];if(a!=0)return a}if("kind"in t){if(t.kind=="message")return ir(e,(i=t.parent)!==null&&i!==void 0?i:t.file);const a=zl[t.edition];if(!a)throw new Error(`feature default for edition ${t.edition} not found`);return a[e]}return ir(e,t.parent)}function ze(e,t){if(!e)throw new Error(t)}function gg(e){const t=mg(e);return t.messageType.forEach(Ss),jl(t,()=>{}).getFile(t.name)}function mg(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(eu),enumType:e.enumType.map(tu)}))}function eu(e){var t,r,i,n,a,d,s,o;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(vg))!==null&&r!==void 0?r:[],extension:[],nestedType:(n=(i=e.nestedType)===null||i===void 0?void 0:i.map(eu))!==null&&n!==void 0?n:[],enumType:(d=(a=e.enumType)===null||a===void 0?void 0:a.map(tu))!==null&&d!==void 0?d:[],extensionRange:(o=(s=e.extensionRange)===null||s===void 0?void 0:s.map(c=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},c)))!==null&&o!==void 0?o:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function vg(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?bg(e.options):void 0}))}function bg(e){var t,r,i;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(i=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(n=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},n)))!==null&&i!==void 0?i:[],uninterpretedOption:[]}))}function tu(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(t=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},t))})}function ru(e){const t=yg();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let i=new Uint8Array(r),n=0,a=0,d,s=0;for(let o=0;o<e.length;o++){if(d=t[e.charCodeAt(o)],d===void 0)switch(e[o]){case"=":a=0;case`
1776
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(a){case 0:s=d,a=1;break;case 1:i[n++]=s<<2|(d&48)>>4,s=d,a=2;break;case 2:i[n++]=(s&15)<<4|(d&60)>>2,s=d,a=3;break;case 3:i[n++]=(s&3)<<6|d,a=0;break}}if(a==1)throw Error("invalid base64 string");return i.subarray(0,n)}function _g(e,t="std"){const r=iu(t),i=t=="std";let n="",a=0,d,s=0;for(let o=0;o<e.length;o++)switch(d=e[o],a){case 0:n+=r[d>>2],s=(d&3)<<4,a=1;break;case 1:n+=r[s|d>>4],s=(d&15)<<2,a=2;break;case 2:n+=r[s|d>>6],n+=r[d&63],a=0;break}return a&&(n+=r[s],i&&(n+="=",a==1&&(n+="="))),n}let oi,sa,Zt;function iu(e){return oi||(oi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),sa=oi.slice(0,-2).concat("-","_")),e=="url"?sa:oi}function yg(){if(!Zt){Zt=[];const e=iu("std");for(let t=0;t<e.length;t++)Zt[e[t].charCodeAt(0)]=t;Zt[45]=e.indexOf("+"),Zt[95]=e.indexOf("/")}return Zt}function ws(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const Sg=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Me extends Error{constructor(t,r,i="FieldValueInvalidError"){super(r),this.name=i,this.field=()=>t}}function Eg(e){return e instanceof Error&&Sg.includes(e.name)&&"field"in e&&typeof e.field=="function"}function yt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cs(e,t){var r,i,n,a;if(yt(e)&&ct in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const d=t,s=e.field();return d.listKind==s.listKind&&d.scalar===s.scalar&&((r=d.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((n=d.enum)===null||n===void 0?void 0:n.typeName)===((a=s.enum)===null||a===void 0?void 0:a.typeName)}return!0}return!1}function ks(e,t){var r,i,n,a;if(yt(e)&&ct in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const d=t,s=e.field();return d.mapKey===s.mapKey&&d.mapKind==s.mapKind&&d.scalar===s.scalar&&((r=d.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((n=d.enum)===null||n===void 0?void 0:n.typeName)===((a=s.enum)===null||a===void 0?void 0:a.typeName)}return!0}return!1}function Is(e,t){return yt(e)&&ct in e&&"desc"in e&&yt(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const gn=Symbol.for("@bufbuild/protobuf/text-encoding");function As(){if(globalThis[gn]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[gn]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[gn]}var ye;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(ye||(ye={}));const nu=34028234663852886e22,su=-34028234663852886e22,ou=4294967295,au=2147483647,cu=-2147483648;class lu{constructor(t=As().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let n=0;n<this.chunks.length;n++)t+=this.chunks[n].length;let r=new Uint8Array(t),i=0;for(let n=0;n<this.chunks.length;n++)r.set(this.chunks[n],i),i+=this.chunks[n].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(oa(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return mn(t),Hn(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){wg(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){oa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){mn(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return mn(t),t=(t<<1^t>>31)>>>0,Hn(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),n=de.enc(t);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),n=de.uEnc(t);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(r)}int64(t){let r=de.enc(t);return pn(r.lo,r.hi,this.buf),this}sint64(t){const r=de.enc(t),i=r.hi>>31,n=r.lo<<1^i,a=(r.hi<<1|r.lo>>>31)^i;return pn(n,a,this.buf),this}uint64(t){const r=de.uEnc(t);return pn(r.lo,r.hi,this.buf),this}}class Ns{constructor(t,r=As().decodeUtf8){this.decodeUtf8=r,this.varint64=Op,this.uint32=Up,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,i=t&7;if(r<=0||i<0||i>5)throw new Error("illegal tag: field no "+r+" wire type "+i);return[r,i]}skip(t,r){let i=this.pos;switch(t){case ye.Varint:for(;this.buf[this.pos++]&128;);break;case ye.Bit64:this.pos+=4;case ye.Bit32:this.pos+=4;break;case ye.LengthDelimited:let n=this.uint32();this.pos+=n;break;case ye.StartGroup:for(;;){const[a,d]=this.tag();if(d===ye.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(d,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return de.dec(...this.varint64())}uint64(){return de.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),i=-(t&1);return t=(t>>>1|(r&1)<<31)^i,r=r>>>1^i,de.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return de.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return de.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function mn(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>au||e<cu)throw new Error("invalid int32: "+e)}function oa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>ou||e<0)throw new Error("invalid uint32: "+e)}function wg(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>nu||e<su))throw new Error("invalid float32: "+e)}function Bt(e,t){const r=e.fieldKind=="list"?Cs(t,e):e.fieldKind=="map"?ks(t,e):Ts(e,t);if(r===!0)return;let i;switch(e.fieldKind){case"list":i=`expected ${hu(e)}, got ${Ae(t)}`;break;case"map":i=`expected ${fu(e)}, got ${Ae(t)}`;break;default:i=Ti(e,t,r)}return new Me(e,i)}function aa(e,t,r){const i=Ts(e,r);if(i!==!0)return new Me(e,`list item #${t+1}: ${Ti(e,r,i)}`)}function Cg(e,t,r){const i=uu(t,e.mapKey);if(i!==!0)return new Me(e,`invalid map key: ${Ti({scalar:e.mapKey},t,i)}`);const n=Ts(e,r);if(n!==!0)return new Me(e,`map entry ${Ae(t)}: ${Ti(e,r,n)}`)}function Ts(e,t){return e.scalar!==void 0?uu(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):Is(t,e.message)}function uu(e,t){switch(t){case F.DOUBLE:return typeof e=="number";case F.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>nu||e<su?`${e.toFixed()} out of range`:!0;case F.INT32:case F.SFIXED32:case F.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>au||e<cu?`${e.toFixed()} out of range`:!0;case F.FIXED32:case F.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>ou||e<0?`${e.toFixed()} out of range`:!0;case F.BOOL:return typeof e=="boolean";case F.STRING:return typeof e!="string"?!1:As().checkUtf8(e)||"invalid UTF8";case F.BYTES:return e instanceof Uint8Array;case F.INT64:case F.SFIXED64:case F.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return de.parse(e),!0}catch{return`${e} out of range`}return!1;case F.FIXED64:case F.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return de.uParse(e),!0}catch{return`${e} out of range`}return!1}}function Ti(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${Ae(t)}`,e.scalar!==void 0?`expected ${kg(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${du(e.message)}`+r}function Ae(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:Cs(e)?hu(e.field()):ks(e)?fu(e.field()):Is(e)?du(e.desc):ws(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function du(e){return`ReflectMessage (${e.typeName})`}function hu(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${F[e.scalar]})`}}function fu(e){switch(e.mapKind){case"message":return`ReflectMap (${F[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${F[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${F[e.mapKey]}, ${F[e.scalar]})`}}function kg(e){switch(e){case F.STRING:return"string";case F.BOOL:return"boolean";case F.INT64:case F.SINT64:case F.SFIXED64:return"bigint (int64)";case F.UINT64:case F.FIXED64:return"bigint (uint64)";case F.BYTES:return"Uint8Array";case F.DOUBLE:return"number (float64)";case F.FLOAT:return"number (float32)";case F.FIXED32:case F.UINT32:return"number (uint32)";case F.INT32:case F.SFIXED32:case F.SINT32:return"number (int32)"}}function Ig(e){return pu(e.$typeName)}function jr(e){const t=e.fields[0];return pu(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function pu(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const Ag=999,Ng=998,_i=2;function Ie(e,t){if(ws(t,e))return t;const r=xg(e);return t!==void 0&&Tg(e,r,t),r}function Tg(e,t,r){for(const i of e.members){let n=r[i.localName];if(n==null)continue;let a;if(i.kind=="oneof"){const d=Yl(r,i);if(!d)continue;a=d,n=Xl(r,d)}else a=i;switch(a.fieldKind){case"message":n=Rs(a,n);break;case"scalar":n=gu(a,n);break;case"list":n=Bg(a,n);break;case"map":n=Rg(a,n);break}Jl(t,a,n)}return t}function gu(e,t){return e.scalar==F.BYTES?Bs(t):t}function Rg(e,t){if(yt(t)){if(e.scalar==F.BYTES)return ca(t,Bs);if(e.mapKind=="message")return ca(t,r=>Rs(e,r))}return t}function Bg(e,t){if(Array.isArray(t)){if(e.scalar==F.BYTES)return t.map(Bs);if(e.listKind=="message")return t.map(r=>Rs(e,r))}return t}function Rs(e,t){if(e.fieldKind=="message"&&!e.oneof&&jr(e.message))return gu(e.message.fields[0],t);if(yt(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!ws(t,e.message))return Ie(e.message,t)}return t}function Bs(e){return Array.isArray(e)?new Uint8Array(e):e}function ca(e,t){const r={};for(const i of Object.entries(e))r[i[0]]=t(i[1]);return r}const Lg=Symbol(),la=new WeakMap;function xg(e){let t;if(Dg(e)){const r=la.get(e);let i,n;if(r)({prototype:i,members:n}=r);else{i={},n=new Set;for(const a of e.members)a.kind!="oneof"&&(a.fieldKind!="scalar"&&a.fieldKind!="enum"||a.presence!=_i&&(n.add(a),i[a.localName]=vn(a)));la.set(e,{prototype:i,members:n})}t=Object.create(i),t.$typeName=e.typeName;for(const a of e.members)n.has(a)||a.kind=="field"&&(a.fieldKind=="message"||(a.fieldKind=="scalar"||a.fieldKind=="enum")&&a.presence!=_i)||(t[a.localName]=vn(a))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==_i)&&(t[r.localName]=vn(r))}return t}function Dg(e){switch(e.file.edition){case Ag:return!1;case Ng:return!0;default:return e.fields.some(t=>t.presence!=_i&&t.fieldKind!="message"&&!t.oneof)}}function vn(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return Lg;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?Wt(e.scalar,e.longAsString):e.enum.values[0].number}function Je(e,t,r=!0){return new mu(e,t,r)}class mu{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,i)=>r.number-i.number)}constructor(t,r,i=!0){this.lists=new Map,this.maps=new Map,this.check=i,this.desc=t,this.message=this[ct]=r??Ie(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return vr(this.message,t),Yl(this.message,t)}isSet(t){return vr(this.message,t),Wp(this.message,t)}clear(t){vr(this.message,t),$p(this.message,t)}get(t){vr(this.message,t);const r=Xl(this.message,t);switch(t.fieldKind){case"list":let i=this.lists.get(t);return(!i||i[ct]!==r)&&this.lists.set(t,i=new Og(t,r,this.check)),i;case"map":let n=this.maps.get(t);return(!n||n[ct]!==r)&&this.maps.set(t,n=new Fg(t,r,this.check)),n;case"message":return xs(t,r,this.check);case"scalar":return r===void 0?Wt(t.scalar,!1):Ds(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(vr(this.message,t),this.check){const n=Bt(t,r);if(n)throw n}let i;t.fieldKind=="message"?i=Ls(t,r):ks(r)||Cs(r)?i=r[ct]:i=Os(t,r),Jl(this.message,t,i)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function vr(e,t){if(t.parent.typeName!==e.$typeName)throw new Me(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class Og{field(){return this._field}get size(){return this._arr.length}constructor(t,r,i){this._field=t,this._arr=this[ct]=r,this.check=i}get(t){const r=this._arr[t];return r===void 0?void 0:bn(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Me(this._field,`list item #${t+1}: out of range`);if(this.check){const i=aa(this._field,t,r);if(i)throw i}this._arr[t]=ua(this._field,r)}add(t){if(this.check){const r=aa(this._field,this._arr.length,t);if(r)throw r}this._arr.push(ua(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield bn(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,bn(this._field,this._arr[t],this.check)]}}class Fg{constructor(t,r,i=!0){this.obj=this[ct]=r??{},this.check=i,this._field=t}field(){return this._field}set(t,r){if(this.check){const i=Cg(this._field,t,r);if(i)throw i}return this.obj[ai(t)]=Vg(this._field,r),this}delete(t){const r=ai(t),i=Object.prototype.hasOwnProperty.call(this.obj,r);return i&&delete this.obj[r],i}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[ai(t)];return r!==void 0&&(r=_n(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,ai(t))}*keys(){for(const t of Object.keys(this.obj))yield da(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[da(t[0],this._field.mapKey),_n(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield _n(this._field,t,this.check)}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}}function Ls(e,t){return Is(t)?Ig(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?bu(t.message):t.message:t}function xs(e,t,r){return t!==void 0&&(jr(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Ds(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&yt(t)&&(t=vu(t))),new mu(e.message,t,r)}function ua(e,t){return e.listKind=="message"?Ls(e,t):Os(e,t)}function bn(e,t,r){return e.listKind=="message"?xs(e,t,r):Ds(e,t)}function Vg(e,t){return e.mapKind=="message"?Ls(e,t):Os(e,t)}function _n(e,t,r){return e.mapKind=="message"?xs(e,t,r):t}function ai(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function da(e,t){switch(t){case F.STRING:return e;case F.INT32:case F.FIXED32:case F.UINT32:case F.SFIXED32:case F.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case F.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case F.UINT64:case F.FIXED64:try{return de.uParse(e)}catch{}break;default:try{return de.parse(e)}catch{}break}return e}function Ds(e,t){switch(e.scalar){case F.INT64:case F.SFIXED64:case F.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=de.parse(t));break;case F.FIXED64:case F.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=de.uParse(t));break}return t}function Os(e,t){switch(e.scalar){case F.INT64:case F.SFIXED64:case F.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=de.parse(t));break;case F.FIXED64:case F.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=de.uParse(t));break}return t}function vu(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(yt(e))for(const[r,i]of Object.entries(e))t.fields[r]=yu(i);return t}function bu(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=_u(i);return t}function _u(e){switch(e.kind.case){case"structValue":return bu(e.kind.value);case"listValue":return e.kind.value.values.map(_u);case"nullValue":case void 0:return null;default:return e.kind.value}}function yu(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const i of e)r.values.push(yu(i));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:vu(e)};break}return t}const Ug=3,ha={writeUnknownFields:!0};function Mg(e){return e?Object.assign(Object.assign({},ha),e):ha}function Pg(e,t,r){return Ri(new lu,Mg(r),Je(e,t)).finish()}function Ri(e,t,r){var i;for(const n of r.sortedFields){if(!r.isSet(n)){if(n.presence==Ug)throw new Error(`cannot encode ${n} to binary: required field not set`);continue}Su(e,t,r,n)}if(t.writeUnknownFields)for(const{no:n,wireType:a,data:d}of(i=r.getUnknown())!==null&&i!==void 0?i:[])e.tag(n,a).raw(d);return e}function Su(e,t,r,i){var n;switch(i.fieldKind){case"scalar":case"enum":Bi(e,r.desc.typeName,i.name,(n=i.scalar)!==null&&n!==void 0?n:F.INT32,i.number,r.get(i));break;case"list":Wg(e,t,i,r.get(i));break;case"message":Eu(e,t,i,r.get(i));break;case"map":for(const[a,d]of r.get(i))$g(e,t,i,a,d);break}}function Bi(e,t,r,i,n,a){wu(e.tag(n,Hg(i)),t,r,i,a)}function Eu(e,t,r,i){r.delimitedEncoding?Ri(e.tag(r.number,ye.StartGroup),t,i).tag(r.number,ye.EndGroup):Ri(e.tag(r.number,ye.LengthDelimited).fork(),t,i).join()}function Wg(e,t,r,i){var n;if(r.listKind=="message"){for(const d of i)Eu(e,t,r,d);return}const a=(n=r.scalar)!==null&&n!==void 0?n:F.INT32;if(r.packed){if(!i.size)return;e.tag(r.number,ye.LengthDelimited).fork();for(const d of i)wu(e,r.parent.typeName,r.name,a,d);e.join();return}for(const d of i)Bi(e,r.parent.typeName,r.name,a,r.number,d)}function $g(e,t,r,i,n){var a;switch(e.tag(r.number,ye.LengthDelimited).fork(),Bi(e,r.parent.typeName,r.name,r.mapKey,1,i),r.mapKind){case"scalar":case"enum":Bi(e,r.parent.typeName,r.name,(a=r.scalar)!==null&&a!==void 0?a:F.INT32,2,n);break;case"message":Ri(e.tag(2,ye.LengthDelimited).fork(),t,n).join();break}e.join()}function wu(e,t,r,i,n){try{switch(i){case F.STRING:e.string(n);break;case F.BOOL:e.bool(n);break;case F.DOUBLE:e.double(n);break;case F.FLOAT:e.float(n);break;case F.INT32:e.int32(n);break;case F.INT64:e.int64(n);break;case F.UINT64:e.uint64(n);break;case F.FIXED64:e.fixed64(n);break;case F.BYTES:e.bytes(n);break;case F.FIXED32:e.fixed32(n);break;case F.SFIXED32:e.sfixed32(n);break;case F.SFIXED64:e.sfixed64(n);break;case F.SINT64:e.sint64(n);break;case F.UINT32:e.uint32(n);break;case F.SINT32:e.sint32(n);break}}catch(a){throw a instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${a.message}`):a}}function Hg(e){switch(e){case F.BYTES:case F.STRING:return ye.LengthDelimited;case F.DOUBLE:case F.FIXED64:case F.SFIXED64:return ye.Bit64;case F.FIXED32:case F.SFIXED32:case F.FLOAT:return ye.Bit32;default:return ye.Varint}}function nt(e,t,...r){return r.reduce((i,n)=>i.nestedMessages[n],e.messages[t])}function $i(e,t,...r){if(r.length==0)return e.enums[t];const i=r.pop();return r.reduce((n,a)=>n.nestedMessages[a],e.messages[t]).nestedEnums[i]}function Hi(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const Gg=gg({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Zg=nt(Gg,1);var fa;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(fa||(fa={}));var pa;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(pa||(pa={}));var ga;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(ga||(ga={}));var ma;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(ma||(ma={}));var va;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(va||(va={}));var ba;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(ba||(ba={}));var _a;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(_a||(_a={}));var ya;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(ya||(ya={}));var Sa;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(Sa||(Sa={}));var Ea;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(Ea||(Ea={}));var wa;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(wa||(wa={}));var Ca;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(Ca||(Ca={}));var ka;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(ka||(ka={}));var Ia;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(Ia||(Ia={}));var Aa;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(Aa||(Aa={}));var Na;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Na||(Na={}));var Ta;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(Ta||(Ta={}));var Ra;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Ra||(Ra={}));var Ba;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(Ba||(Ba={}));var La;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(La||(La={}));const xa={readUnknownFields:!0};function Kg(e){return e?Object.assign(Object.assign({},xa),e):xa}function Cu(e,t,r){const i=Je(e,void 0,!1);return ku(i,new Ns(t),Kg(r),!1,t.byteLength),i.message}function ku(e,t,r,i,n){var a;const d=i?t.len:t.pos+n;let s,o;const c=(a=e.getUnknown())!==null&&a!==void 0?a:[];for(;t.pos<d&&([s,o]=t.tag(),!(i&&o==ye.EndGroup));){const g=e.findNumber(s);if(!g){const f=t.skip(o,s);r.readUnknownFields&&c.push({no:s,wireType:o,data:f});continue}Iu(e,t,g,o,r)}if(i&&(o!=ye.EndGroup||s!==n))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function Iu(e,t,r,i,n){var a;switch(r.fieldKind){case"scalar":e.set(r,nr(t,r.scalar));break;case"enum":const d=nr(t,F.INT32);if(r.enum.open)e.set(r,d);else if(r.enum.values.some(s=>s.number===d))e.set(r,d);else if(n.readUnknownFields){const s=[];Hn(d,s);const o=(a=e.getUnknown())!==null&&a!==void 0?a:[];o.push({no:r.number,wireType:i,data:new Uint8Array(s)}),e.setUnknown(o)}break;case"message":e.set(r,Fs(t,n,r,e.get(r)));break;case"list":Xg(t,i,e.get(r),n);break;case"map":Yg(t,e.get(r),n);break}}function Yg(e,t,r){const i=t.field();let n,a;const d=e.uint32(),s=e.pos+d;for(;e.pos<s;){const[o]=e.tag();switch(o){case 1:n=nr(e,i.mapKey);break;case 2:switch(i.mapKind){case"scalar":a=nr(e,i.scalar);break;case"enum":a=e.int32();break;case"message":a=Fs(e,r,i);break}break}}if(n===void 0&&(n=Wt(i.mapKey,!1)),a===void 0)switch(i.mapKind){case"scalar":a=Wt(i.scalar,!1);break;case"enum":a=i.enum.values[0].number;break;case"message":a=Je(i.message,void 0,!1);break}t.set(n,a)}function Xg(e,t,r,i){var n;const a=r.field();if(a.listKind==="message"){r.add(Fs(e,i,a));return}const d=(n=a.scalar)!==null&&n!==void 0?n:F.INT32;if(!(t==ye.LengthDelimited&&d!=F.STRING&&d!=F.BYTES)){r.add(nr(e,d));return}const s=e.uint32()+e.pos;for(;e.pos<s;)r.add(nr(e,d))}function Fs(e,t,r,i){const n=r.delimitedEncoding,a=i??Je(r.message,void 0,!1);return ku(a,e,t,n,n?r.number:e.uint32()),a}function nr(e,t){switch(t){case F.STRING:return e.string();case F.BOOL:return e.bool();case F.DOUBLE:return e.double();case F.FLOAT:return e.float();case F.INT32:return e.int32();case F.INT64:return e.int64();case F.UINT64:return e.uint64();case F.FIXED64:return e.fixed64();case F.BYTES:return e.bytes();case F.FIXED32:return e.fixed32();case F.SFIXED32:return e.sfixed32();case F.SFIXED64:return e.sfixed64();case F.SINT64:return e.sint64();case F.UINT32:return e.uint32();case F.SINT32:return e.sint32()}}function kt(e,t){var r;const i=Cu(Zg,ru(e));return i.messageType.forEach(Ss),i.dependency=(r=t==null?void 0:t.map(n=>n.proto.name))!==null&&r!==void 0?r:[],jl(i,n=>t==null?void 0:t.find(a=>a.proto.name===n)).getFile(i.name)}const Vs=kt("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),Da=nt(Vs,0,0),Jg=$i(Vs,0),yn=Hi(Jg),jg=kt("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),zg=nt(jg,0);function Qg(e,t,r){let i=!1;return r||(r=Ie(zg),i=!0),r.value=Pg(e,t),r.typeUrl=tm(t.$typeName),i?r:void 0}function qg(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,i=Au(e.typeUrl);return r===i}function em(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(Au(e.typeUrl));if(!(!r||!qg(e,r)))return Cu(r,e.value)}function tm(e){return`type.googleapis.com/${e}`}function Au(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const Us=kt("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),rm=nt(Us,0),Nu=nt(Us,1),im=nt(Us,2);var Xn;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(Xn||(Xn={}));const nm=kt("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),zr=kt("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[nm,Vs]),Tu=nt(zr,12),Jn=nt(zr,13),sm=$i(zr,19,0),at=Hi(sm),om=$i(zr,2),am=Hi(om);function cm(e,t){Ru(t,e);const r=um(e.$unknown,t),[i,n,a]=Gi(t);for(const d of r)Iu(i,new Ns(d.data),n,d.wireType,{readUnknownFields:!0});return a()}function lm(e,t,r){var i;Ru(t,e);const n=((i=e.$unknown)!==null&&i!==void 0?i:[]).filter(c=>c.no!==t.number),[a,d]=Gi(t,r),s=new lu;Su(s,{writeUnknownFields:!0},a,d);const o=new Ns(s.finish());for(;o.pos<o.len;){const[c,g]=o.tag(),f=o.skip(g,c);n.push({no:c,wireType:g,data:f})}e.$unknown=n}function um(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function Gi(e,t){const r=e.typeName,i=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),n=Object.assign(Object.assign({},e.extendee),{fields:[i],members:[i],oneofs:[]}),a=Ie(n,t!==void 0?{[r]:t}:void 0);return[Je(n,a),i,()=>{const d=a[r];if(d===void 0){const s=e.message;return jr(s)?Wt(s.fields[0].scalar,s.fields[0].longAsString):Ie(s)}return d}]}function Ru(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const dm=3,hm=2,Oa={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function fm(e){return e?Object.assign(Object.assign({},Oa),e):Oa}function pm(e,t,r){return Qr(Je(e,t),fm(r))}function Qr(e,t){var r;const i=bm(e,t);if(i!==void 0)return i;const n={};for(const a of e.sortedFields){if(!e.isSet(a)){if(a.presence==dm)throw new Error(`cannot encode ${a} to JSON: required field not set`);if(!t.alwaysEmitImplicit||a.presence!==hm)continue}const d=Fa(a,e.get(a),t);d!==void 0&&(n[vm(a,t)]=d)}if(t.registry){const a=new Set;for(const{no:d}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!a.has(d)){a.add(d);const s=t.registry.getExtensionFor(e.desc,d);if(!s)continue;const o=cm(e.message,s),[c,g]=Gi(s,o),f=Fa(g,c.get(g),t);f!==void 0&&(n[s.jsonName]=f)}}return n}function Fa(e,t,r){switch(e.fieldKind){case"scalar":return Zi(e,t);case"message":return Qr(t,r);case"enum":return Ms(e.enum,t,r.enumAsInteger);case"list":return mm(t,r);case"map":return gm(t,r)}}function gm(e,t){const r=e.field(),i={};switch(r.mapKind){case"scalar":for(const[n,a]of e)i[n]=Zi(r,a);break;case"message":for(const[n,a]of e)i[n]=Qr(a,t);break;case"enum":for(const[n,a]of e)i[n]=Ms(r.enum,a,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?i:void 0}function mm(e,t){const r=e.field(),i=[];switch(r.listKind){case"scalar":for(const n of e)i.push(Zi(r,n));break;case"enum":for(const n of e)i.push(Ms(r.enum,n,t.enumAsInteger));break;case"message":for(const n of e)i.push(Qr(n,t));break}return t.alwaysEmitImplicit||i.length>0?i:void 0}function Ms(e,t,r){var i;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${Ae(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const n=e.value[t];return(i=n==null?void 0:n.name)!==null&&i!==void 0?i:t}function Zi(e,t){var r,i,n,a,d,s;switch(e.scalar){case F.INT32:case F.SFIXED32:case F.SINT32:case F.FIXED32:case F.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=Bt(e,t))===null||r===void 0?void 0:r.message}`);return t;case F.FLOAT:case F.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(i=Bt(e,t))===null||i===void 0?void 0:i.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case F.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(n=Bt(e,t))===null||n===void 0?void 0:n.message}`);return t;case F.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(a=Bt(e,t))===null||a===void 0?void 0:a.message}`);return t;case F.UINT64:case F.FIXED64:case F.INT64:case F.SFIXED64:case F.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(d=Bt(e,t))===null||d===void 0?void 0:d.message}`);return t.toString();case F.BYTES:if(t instanceof Uint8Array)return _g(t);throw new Error(`cannot encode ${e} to JSON: ${(s=Bt(e,t))===null||s===void 0?void 0:s.message}`)}}function vm(e,t){return t.useProtoFieldName?e.name:e.jsonName}function bm(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return _m(e.message,t);case"google.protobuf.Timestamp":return Em(e.message);case"google.protobuf.Duration":return ym(e.message);case"google.protobuf.FieldMask":return Sm(e.message);case"google.protobuf.Struct":return Bu(e.message);case"google.protobuf.Value":return Ps(e.message);case"google.protobuf.ListValue":return Lu(e.message);default:if(jr(e.desc)){const r=e.desc.fields[0];return Zi(r,e.get(r))}return}}function _m(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let i,n;if(r&&(i=em(e,r),i&&(n=r.getMessage(i.$typeName))),!n||!i)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let a=Qr(Je(n,i),t);return(n.typeName.startsWith("google.protobuf.")||a===null||Array.isArray(a)||typeof a!="object")&&(a={value:a}),a["@type"]=e.typeUrl,a}function ym(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function Sm(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Or(t)}).join(",")}function Bu(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=Ps(i);return t}function Ps(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return Bu(e.kind.value);case"listValue":return Lu(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function Lu(e){return e.values.map(Ps)}function Em(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const Va={ignoreUnknownFields:!1};function wm(e){return e?Object.assign(Object.assign({},Va),e):Va}function Cm(e,t,r){const i=Je(e);try{sr(i,t,wm(r))}catch(n){throw Eg(n)?new Error(`cannot decode ${n.field()} from JSON: ${n.message}`,{cause:n}):n}return i.message}function sr(e,t,r){var i;if(Bm(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${Ae(t)}`);const n=new Map,a=new Map;for(const d of e.desc.fields)a.set(d.name,d).set(d.jsonName,d);for(const[d,s]of Object.entries(t)){const o=a.get(d);if(o){if(o.oneof){if(s===null&&o.fieldKind=="scalar")continue;const c=n.get(o.oneof);if(c!==void 0)throw new Me(o.oneof,`oneof set multiple times by ${c.name} and ${o.name}`);n.set(o.oneof,o)}Ua(e,o,s,r)}else{let c;if(d.startsWith("[")&&d.endsWith("]")&&(c=(i=r.registry)===null||i===void 0?void 0:i.getExtension(d.substring(1,d.length-1)))&&c.extendee.typeName===e.desc.typeName){const[g,f,m]=Gi(c);Ua(g,f,s,r),lm(e.message,c,m())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${d}" is unknown`)}}}function Ua(e,t,r,i){switch(t.fieldKind){case"scalar":Tm(e,t,r);break;case"enum":Nm(e,t,r,i);break;case"message":Am(e,t,r,i);break;case"list":Im(e.get(t),r,i);break;case"map":km(e.get(t),r,i);break}}function km(e,t,r){if(t===null)return;const i=e.field();if(typeof t!="object"||Array.isArray(t))throw new Me(i,"expected object, got "+Ae(t));for(const[n,a]of Object.entries(t)){if(a===null)throw new Me(i,"map value must not be null");let d;switch(i.mapKind){case"message":const o=Je(i.message);sr(o,a,r),d=o;break;case"enum":if(d=Ws(i.enum,a,r.ignoreUnknownFields,!0),d===Ki)return;break;case"scalar":d=Xi(i,a,!0);break}const s=Rm(i.mapKey,n);e.set(s,d)}}function Im(e,t,r){if(t===null)return;const i=e.field();if(!Array.isArray(t))throw new Me(i,"expected Array, got "+Ae(t));for(const n of t){if(n===null)throw new Me(i,"list item must not be null");switch(i.listKind){case"message":const a=Je(i.message);sr(a,n,r),e.add(a);break;case"enum":const d=Ws(i.enum,n,r.ignoreUnknownFields,!0);d!==Ki&&e.add(d);break;case"scalar":e.add(Xi(i,n,!0));break}}}function Am(e,t,r,i){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const n=e.isSet(t)?e.get(t):Je(t.message);sr(n,r,i),e.set(t,n)}function Nm(e,t,r,i){const n=Ws(t.enum,r,i.ignoreUnknownFields,!1);n===Yi?e.clear(t):n!==Ki&&e.set(t,n)}function Tm(e,t,r){const i=Xi(t,r,!1);i===Yi?e.clear(t):e.set(t,i)}const Ki=Symbol();function Ws(e,t,r,i){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:i?e.values[0].number:Yi;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const n=e.values.find(a=>a.name===t);if(n!==void 0)return n.number;if(r)return Ki;break}throw new Error(`cannot decode ${e} from JSON: ${Ae(t)}`)}const Yi=Symbol();function Xi(e,t,r){if(t===null)return r?Wt(e.scalar,!1):Yi;switch(e.scalar){case F.DOUBLE:case F.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Me(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Me(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const i=Number(t);if(!Number.isFinite(i))break;return i}break;case F.INT32:case F.FIXED32:case F.SFIXED32:case F.SINT32:case F.UINT32:return xu(t);case F.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return ru(t)}catch(i){const n=i instanceof Error?i.message:String(i);throw new Me(e,n)}}break}return t}function Rm(e,t){switch(e){case F.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case F.INT32:case F.FIXED32:case F.UINT32:case F.SFIXED32:case F.SINT32:return xu(t);default:return t}}function xu(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function Bm(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return Lm(e.message,t,r),!0;case"google.protobuf.Timestamp":return xm(e.message,t),!0;case"google.protobuf.Duration":return Dm(e.message,t),!0;case"google.protobuf.FieldMask":return Om(e.message,t),!0;case"google.protobuf.Struct":return Du(e.message,t),!0;case"google.protobuf.Value":return $s(e.message,t),!0;case"google.protobuf.ListValue":return Ou(e.message,t),!0;default:if(jr(e.desc)){const i=e.desc.fields[0];return t===null?e.clear(i):e.set(i,Xi(i,t,!0)),!0}return!1}}function Lm(e,t,r){var i;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${Ae(t)}`);if(Object.keys(t).length==0)return;const n=t["@type"];if(typeof n!="string"||n=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const a=n.includes("/")?n.substring(n.lastIndexOf("/")+1):n;if(!a.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const d=(i=r.registry)===null||i===void 0?void 0:i.getMessage(a);if(!d)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${n} is not in the type registry`);const s=Je(d);if(a.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const o=t.value;sr(s,o,r)}else{const o=Object.assign({},t);delete o["@type"],sr(s,o,r)}Qg(s.desc,s.message,e)}function xm(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ae(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=de.parse(i/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function Dm(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ae(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ae(t)}`);const i=Number(r[1]);if(i>315576e6||i<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ae(t)}`);if(e.seconds=de.parse(i),typeof r[2]!="string")return;const n=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(n),(i<0||Object.is(i,-0))&&(e.nanos=-e.nanos)}function Om(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ae(t)}`);if(t==="")return;function r(i){if(i.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const n=i.replace(/[A-Z]/g,a=>"_"+a.toLowerCase());return n[0]==="_"?n.substring(1):n}e.paths=t.split(",").map(r)}function Du(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ae(t)}`);for(const[r,i]of Object.entries(t)){const n=Ie(Nu);$s(n,i),e.fields[r]=n}}function $s(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:Xn.NULL_VALUE};else if(Array.isArray(t)){const r=Ie(im);Ou(r,t),e.kind={case:"listValue",value:r}}else{const r=Ie(rm);Du(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ae(t)}`)}return e}function Ou(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ae(t)}`);for(const r of t){const i=Ie(Nu);$s(i,r),e.values.push(i)}}const Fm=kt("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Vm=$i(Fm,0),Um=Hi(Vm),Mm=kt("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Fu=kt("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[Mm,zr]),jn=nt(Fu,3),Pm=nt(Fu,4),Be=[];for(let e=0;e<256;++e)Be.push((e+256).toString(16).slice(1));function Wm(e,t=0){return(Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]).toLowerCase()}let Sn;const $m=new Uint8Array(16);function Hm(){if(!Sn){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Sn=crypto.getRandomValues.bind(crypto)}return Sn($m)}const Gm=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ma={randomUUID:Gm};function Zm(e,t,r){var i;if(Ma.randomUUID&&!e)return Ma.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??Hm();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Wm(n)}const Km=5e3,Ym=1e3,ci=4e3,Pa=1e3;class Xm{constructor({knownID:t,runID:r,sequence:i,options:n}){this.queue=new Ye,this.subscriptions=[],this.reconnect=new Ye,this.client=new Ee,this._latencies=new Ye,this._latenciesConnectable=Tt(this._latencies.asObservable().pipe(qf((a,d)=>{if(d.latency<0){const s=a.get(d.streamID);s&&a.set(d.streamID,{...s,readyState:d.readyState})}else a.set(d.streamID,d);return a},new Map))),this._errors=new Ye,this._errorsConnectable=Tt(this._errors.asObservable()),this._stdout=new Ye,this._stderr=new Ye,this._exitCode=new Ye,this._pid=new Ye,this._mimeType=new Ye,this._stdoutConnectable=Tt(this._stdout.asObservable()),this._stderrConnectable=Tt(this._stderr.asObservable()),this._exitCodeConnectable=Tt(this._exitCode.asObservable()),this._pidConnectable=Tt(this._pid.asObservable()),this._mimeTypeConnectable=Tt(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=n.runnerEndpoint,this.interceptors=n.interceptors,this.autoReconnect=n.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Yo(Pa,Jr,{leading:!0,trailing:!0}),Ko(a=>this.useSocketClient(a.streamID).pipe(Ko(d=>this.useHeartbeat(d,a))))).pipe(wl()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return Hf(Ym).pipe(rt(()=>this.autoReconnect),fn(this.reconnect),rt(([,t])=>t.heartbeat==="CONTINUOUS"),fn(this.latencies),We(([,t])=>Array.from(t.values()).filter(r=>r.readyState===WebSocket.OPEN&&r.latency>=ci)),rt(t=>t.length>0),Yo(Pa)).subscribe({next:t=>{console.log(new Date,"Triggering reconnect",t),this.connect()},complete:()=>{console.log("Monitor complete")},error:t=>{console.error("Error in monitor",t)}})}process(){const t=this.client.pipe(rt(n=>(n==null?void 0:n.readyState)===WebSocket.OPEN),Zo(1)),r=this.queue.pipe(Jf(()=>t),rt(n=>n.length>0),We(n=>n.sort((a,d)=>{const s=o=>{var c;return!!((c=o.payload.value)!=null&&c.config)};return s(d)?1:s(a)?-1:0}))),i=this.queue.pipe(ep(t));return Gf(r.pipe(Dt(n=>n)),i).pipe(fn(this.client),si(([,n])=>n.readyState===WebSocket.OPEN),Dt(async([n,a])=>{await $a({req:n,interceptors:this.interceptors,socket:a,knownID:this.knownID,runID:this.runID})})).subscribe({error:n=>{this._errors.next(n)}})}useSocketClient(t){return new Ee(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const n=new WebSocket(i.toString()),a=c=>{if(console.log(new Date,`WebSocket transport ${t} closed`,c),c.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},d=c=>{console.log(new Date,`WebSocket transport ${t} error`,c),this.autoReconnect||r.error(c)},s=c=>{var g,f;if(typeof c.data!="string"){console.warn("Unexpected WebSocket message type:",typeof c.data);return}let m;try{m=Wa(c.data),console.log("Received WebsocketResponse:",m)}catch(v){console.error("Failed to parse WebsocketResponse:",v)}const _=m.status;if(_&&_.code!==Um.OK){r.error(_);return}if(m.pong)return;const w=m.payload.value;if(w.stdoutData&&w.stdoutData.length>0&&((g=this.callback)==null||g.call(this,{type:ee.terminalStdout,output:{"runme.dev/id":this.knownID,data:w.stdoutData}}),this._stdout.next(w.stdoutData)),w.stderrData&&w.stderrData.length>0&&((f=this.callback)==null||f.call(this,{type:ee.terminalStderr,output:{"runme.dev/id":this.knownID,data:w.stderrData}}),this._stderr.next(w.stderrData)),w.exitCode!==void 0&&(this._exitCode.next(w.exitCode),r.complete()),w.pid!==void 0&&this._pid.next(w.pid),w.mimeType){const v=w.mimeType.split(";")[0];this._mimeType.next(v)}},o=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(n)};return n.addEventListener("close",a),n.addEventListener("error",d),n.addEventListener("message",s),n.addEventListener("open",o),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),n.removeEventListener("close",a),n.removeEventListener("error",d),n.removeEventListener("message",s),n.removeEventListener("open",o),n.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(Ie(jn,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new Ee(n=>{const a=Vn(t,"message").pipe(si(()=>t.readyState===WebSocket.OPEN),We(o=>Wa(o.data)),We(o=>o.pong),rt(o=>o!==void 0),We(o=>({receivedAt:BigInt(Date.now()),pong:o}))),d=(i==="INITIAL"?wr(0):wr(0,Km)).pipe(si(()=>t.readyState===WebSocket.OPEN),We(()=>{const o={timestamp:BigInt(Date.now())};return Ie(jn,{ping:o})}),Dt(async o=>(await $a({req:o,interceptors:this.interceptors,socket:t}),o)),We(o=>o.ping)).pipe(rt(o=>(o==null?void 0:o.timestamp)!==void 0),Dt(o=>Yf(a.pipe(rt(c=>c.pong.timestamp===o.timestamp),Zo(1),We(c=>{const g=o.timestamp,f=c.receivedAt;return Number(f-g)})),wr(ci).pipe(We(()=>{throw new Error(`Pong not received within ${ci}ms for stream ${r}`)}))).pipe(yl(c=>(this._latencies.next({streamID:r,latency:ci,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",c.message),Nf(null))))),Qf(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),tp(o=>{o!==null&&this._latencies.next({streamID:r,latency:o,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),s=[];return s.push(d.subscribe({error:o=>{console.error("Unexpected error sending heartbeat",o)}})),n.next(t),()=>{s.forEach(o=>o.unsubscribe())}})}connect(t="CONTINUOUS"){const r=Jm(),i=this.latencies.pipe(We(n=>{const a=n.get(r);return a===void 0?null:a}),si(n=>(n==null?void 0:n.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Wa(e){const t=JSON.parse(e);return Cm(Pm,t)}async function $a({req:e,interceptors:t,socket:r,knownID:i,runID:n}){i&&(e.knownId=i),n&&(e.runId=n);const a={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let d=async o=>({stream:!1,message:{},method:{},service:{},header:o.header});for(const o of t.concat().reverse())d=o(d);const s=(await d(a)).header.get("Authorization");s&&e&&(e.authorization=s),r.send(JSON.stringify(pm(jn,e)))}function Jm(){return Zm().replace(/-/g,"")}var jm=Object.defineProperty,zm=Object.getOwnPropertyDescriptor,Vu=e=>{throw TypeError(e)},se=(e,t,r,i)=>{for(var n=i>1?void 0:i?zm(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&jm(t,r,n),n},Hs=(e,t,r)=>t.has(e)||Vu("Cannot "+r),ue=(e,t,r)=>(Hs(e,t,"read from private field"),t.get(e)),li=(e,t,r)=>t.has(e)?Vu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Li=(e,t,r,i)=>(Hs(e,t,"write to private field"),t.set(e,r),r),$e=(e,t,r)=>(Hs(e,t,"access private method"),r),De,it,Ot,Ve,Uu,Gs,Mu,zn,xi,Qn,Pu,Wu;const Qm="runme-console";let ne=class extends Oe{constructor(){super(),li(this,Ve),this.disposables=[],li(this,De),li(this,it,[]),li(this,Ot,{rows:34,cols:100,x:0,y:0}),this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.reconnect=!0,this.interceptors=[],$e(this,Ve,Wu).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");$e(this,Ve,Uu).call(this),$e(this,Ve,zn).call(this),$e(this,Ve,Qn).call(this)}disconnectedCallback(){super.disconnectedCallback(),$e(this,Ve,xi).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&$e(this,Ve,Gs).call(this),(e.has("knownId")||e.has("runId")||e.has("sequence")||e.has("runnerEndpoint")||e.has("interceptors")||e.has("commands")||e.has("languageId"))&&($e(this,Ve,zn).call(this),$e(this,Ve,Qn).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return j`<div></div>`}dispose(){$e(this,Ve,xi).call(this),this.disposables.forEach(({dispose:e})=>e())}};De=new WeakMap;it=new WeakMap;Ot=new WeakMap;Ve=new WeakSet;Uu=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),$e(this,Ve,Gs).call(this),this.shadowRoot.appendChild(this.consoleView),$e(this,Ve,Mu).call(this))};Gs=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons",this.buttons.toString()),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.theme),this.fontFamily&&this.consoleView.setAttribute("fontFamily",this.fontFamily),this.fontSize!==void 0&&this.consoleView.setAttribute("fontSize",this.fontSize.toString()),this.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.cursorStyle),this.cursorBlink!==void 0&&this.consoleView.setAttribute("cursorBlink",this.cursorBlink.toString()),this.cursorWidth!==void 0&&this.consoleView.setAttribute("cursorWidth",this.cursorWidth.toString()),this.smoothScrollDuration!==void 0&&this.consoleView.setAttribute("smoothScrollDuration",this.smoothScrollDuration.toString()),this.scrollback!==void 0&&this.consoleView.setAttribute("scrollback",this.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()),this.lastLine!==void 0&&this.consoleView.setAttribute("lastLine",this.lastLine.toString()),this.isLoading!==void 0&&this.consoleView.setAttribute("isLoading",this.isLoading.toString()),this.isCreatingEscalation!==void 0&&this.consoleView.setAttribute("isCreatingEscalation",this.isCreatingEscalation.toString()),this.shareUrl&&this.consoleView.setAttribute("shareUrl",this.shareUrl),this.escalationUrl&&this.consoleView.setAttribute("escalationUrl",this.escalationUrl),this.isUpdatedReady!==void 0&&this.consoleView.setAttribute("isUpdatedReady",this.isUpdatedReady.toString()),this.isAutoSaveEnabled!==void 0&&this.consoleView.setAttribute("isAutoSaveEnabled",this.isAutoSaveEnabled.toString()),this.isPlatformAuthEnabled!==void 0&&this.consoleView.setAttribute("isPlatformAuthEnabled",this.isPlatformAuthEnabled.toString()),this.isDaggerOutput!==void 0&&this.consoleView.setAttribute("isDaggerOutput",this.isDaggerOutput.toString()))};Mu=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};zn=function(){if(ue(this,De))return;const e=this.knownId??this.id;if(!e||!this.runId||!this.runnerEndpoint)return;Li(this,De,new Xm({knownID:e,runID:this.runId,sequence:this.sequence??0,options:{runnerEndpoint:this.runnerEndpoint,interceptors:this.interceptors??[],autoReconnect:this.reconnect}}));const t=ue(this,De).connect().subscribe();ue(this,it).push(()=>t.unsubscribe());const r=ue(this,De).stdout.subscribe(s=>{this.dispatchEvent(new CustomEvent("stdout",{detail:s})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(s)}),i=ue(this,De).stderr.subscribe(s=>{this.dispatchEvent(new CustomEvent("stderr",{detail:s}))}),n=ue(this,De).exitCode.subscribe(s=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:s})),$e(this,Ve,xi).call(this)}),a=ue(this,De).pid.subscribe(s=>{this.dispatchEvent(new CustomEvent("pid",{detail:s}))}),d=ue(this,De).mimeType.subscribe(s=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:s}))});ue(this,it).push(()=>r.unsubscribe()),ue(this,it).push(()=>i.unsubscribe()),ue(this,it).push(()=>n.unsubscribe()),ue(this,it).push(()=>a.unsubscribe()),ue(this,it).push(()=>d.unsubscribe())};xi=function(){var e;ue(this,it).forEach(t=>{try{t()}catch{}}),Li(this,it,[]),(e=ue(this,De))==null||e.close(),Li(this,De,void 0)};Qn=function(){if(!ue(this,De)||!this.commands||!this.runId)return;const e=$e(this,Ve,Pu).call(this);e&&ue(this,De).sendExecuteRequest(e)};Pu=function(){var e;const t=this.languageId||"sh",r=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(t),i=Ie(Jn,{sessionStrategy:am.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:t,background:!1,fileExtension:"",env:[`RUNME_ID=${this.knownId??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:this.runId,knownId:this.knownId??this.id},winsize:Ie(Tu,ue(this,Ot))});return((e=this.commands)==null?void 0:e.length)===0?(i.config.mode=yn.INLINE,i.config.source={case:"commands",value:Ie(Da,{items:["zsh -l"]})}):r?(i.config.source={case:"commands",value:Ie(Da,{items:this.commands??[]})},i.config.mode=yn.INLINE):(i.config.source={case:"script",value:(this.commands??[]).join(`
1777
+ `)},i.config.mode=yn.FILE,i.config.fileExtension=this.languageId||""),i};Wu=function(){const e=new TextEncoder,t={postMessage:r=>{var i,n;if(r.type===ee.terminalOpen||r.type===ee.terminalResize){const a=Number(r.output.terminalDimensions.columns),d=Number(r.output.terminalDimensions.rows);if(Number.isFinite(a)&&Number.isFinite(d)){if(ue(this,Ot).cols===a&&ue(this,Ot).rows===d)return;Li(this,Ot,Ie(Tu,{cols:a,rows:d,x:0,y:0}));const s=Ie(Jn,{winsize:ue(this,Ot)});(i=ue(this,De))==null||i.sendExecuteRequest(s)}}if(r.type===ee.terminalStdin){const a=e.encode(r.output.input),d=Ie(Jn,{inputData:a});(n=ue(this,De))==null||n.sendExecuteRequest(d)}},onDidReceiveMessage:r=>{var i;(i=ue(this,De))==null||i.setCallback(r)}};try{ap(t)}catch{console.error("Failed to set context bridge")}};se([Z({type:String})],ne.prototype,"id",2);se([Z({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"buttons",2);se([Z({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"takeFocus",2);se([Z({type:String})],ne.prototype,"theme",2);se([Z({type:String})],ne.prototype,"fontFamily",2);se([Z({type:Number})],ne.prototype,"fontSize",2);se([Z({type:String})],ne.prototype,"cursorStyle",2);se([Z({type:Boolean})],ne.prototype,"cursorBlink",2);se([Z({type:Number})],ne.prototype,"cursorWidth",2);se([Z({type:Number})],ne.prototype,"smoothScrollDuration",2);se([Z({type:Number})],ne.prototype,"scrollback",2);se([Z({type:String})],ne.prototype,"initialContent",2);se([Z({type:Number})],ne.prototype,"initialRows",2);se([Z({type:Number})],ne.prototype,"lastLine",2);se([Z({type:Boolean})],ne.prototype,"isLoading",2);se([Z({type:Boolean})],ne.prototype,"isCreatingEscalation",2);se([Z()],ne.prototype,"shareUrl",2);se([Z()],ne.prototype,"escalationUrl",2);se([Z({type:Boolean})],ne.prototype,"isUpdatedReady",2);se([Z({type:Boolean})],ne.prototype,"isAutoSaveEnabled",2);se([Z({type:Boolean})],ne.prototype,"isPlatformAuthEnabled",2);se([Z({type:Boolean})],ne.prototype,"isDaggerOutput",2);se([Z({type:String})],ne.prototype,"knownId",2);se([Z({type:String})],ne.prototype,"runId",2);se([Z({type:Number})],ne.prototype,"sequence",2);se([Z({type:String})],ne.prototype,"languageId",2);se([Z({type:Array,attribute:!1})],ne.prototype,"commands",2);se([Z({type:String})],ne.prototype,"runnerEndpoint",2);se([Z({type:Boolean,converter:e=>e!=="false"})],ne.prototype,"reconnect",2);se([Z({attribute:!1})],ne.prototype,"interceptors",2);ne=se([Ge(Qm)],ne);var qm=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,Ji=(e,t,r,i)=>{for(var n=i>1?void 0:i?ev(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&qm(t,r,n),n};let or=class extends Oe{constructor(){super(...arguments),this.columns=[],this.rows=[],this.renderer=(e,t)=>j`${e[t]}`,this.displayable=()=>!0,this.hasErrors=()=>!1}get heading(){var e,t;return(e=this.columns)!=null&&e.length?j`
1778
1778
  <thead>
1779
1779
  <tr>
1780
- ${(t=this.columns)==null?void 0:t.map(r=>{if(typeof r=="string")return z`<th>${r}</th>`;if(typeof r=="object"){const{text:i,colspan:s}=r;return z`<th colspan="${s||1}">${i}</th>`}})}
1780
+ ${(t=this.columns)==null?void 0:t.map(r=>{if(typeof r=="string")return j`<th>${r}</th>`;if(typeof r=="object"){const{text:i,colspan:n}=r;return j`<th colspan="${n||1}">${i}</th>`}})}
1781
1781
  </tr>
1782
1782
  </thead>
1783
- `:me}render(){var e,t,r;return!((e=this.rows)!=null&&e.length)&&!((t=this.columns)!=null&&t.length)?me:z`<table>
1783
+ `:_e}render(){var e,t,r;return!((e=this.rows)!=null&&e.length)&&!((t=this.columns)!=null&&t.length)?_e:j`<table>
1784
1784
  ${this.heading}
1785
1785
  <tbody>
1786
- ${(r=this.rows)==null?void 0:r.map(i=>z`<tr
1787
- class="${ve(this.hasErrors&&this.hasErrors(i),()=>"row-error",()=>"")}"
1786
+ ${(r=this.rows)==null?void 0:r.map(i=>j`<tr
1787
+ class="${be(this.hasErrors&&this.hasErrors(i),()=>"row-error",()=>"")}"
1788
1788
  >
1789
- ${Object.keys(i).map(s=>{var h;return ve((h=this.displayable)==null?void 0:h.call(this,i,s),()=>{var p;return z`<td>${((p=this.renderer)==null?void 0:p.call(this,i,s))||i[s]}</td>`},()=>me)})}
1789
+ ${Object.keys(i).map(n=>{var a;return be((a=this.displayable)==null?void 0:a.call(this,i,n),()=>{var d;return j`<td>${((d=this.renderer)==null?void 0:d.call(this,i,n))||i[n]}</td>`},()=>_e)})}
1790
1790
  </tr>`)}
1791
1791
  </tbody>
1792
- </table>`}};Zt.styles=Xe`
1792
+ </table>`}};or.styles=et`
1793
1793
  :host {
1794
1794
  width: 100%;
1795
1795
  }
@@ -1930,7 +1930,7 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1930
1930
  .flex-center {
1931
1931
  align-items: center;
1932
1932
  }
1933
- `;Ti([G({type:Array})],Zt.prototype,"columns",2);Ti([G({type:Array})],Zt.prototype,"rows",2);Ti([G({type:Object})],Zt.prototype,"renderer",2);Zt=Ti([Ue("table-view")],Zt);const _p=z`
1933
+ `;Ji([Z({type:Array})],or.prototype,"columns",2);Ji([Z({type:Array})],or.prototype,"rows",2);Ji([Z({type:Object})],or.prototype,"renderer",2);or=Ji([Ge("table-view")],or);const tv=j`
1934
1934
  <svg
1935
1935
  width="16"
1936
1936
  height="16"
@@ -1945,7 +1945,7 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1945
1945
  fill="currentColor"
1946
1946
  />
1947
1947
  </svg>
1948
- `,bp=z`
1948
+ `,rv=j`
1949
1949
  <svg
1950
1950
  width="16"
1951
1951
  height="16"
@@ -1960,14 +1960,14 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
1960
1960
  fill="currentColor"
1961
1961
  />
1962
1962
  </svg>
1963
- `;var yp=Object.defineProperty,Sp=Object.getOwnPropertyDescriptor,rs=(e,t,r,i)=>{for(var s=i>1?void 0:i?Sp(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&yp(t,r,s),s};let kr=class extends Be{render(){return z`<div class="tooltip">
1963
+ `;var iv=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,Zs=(e,t,r,i)=>{for(var n=i>1?void 0:i?nv(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&iv(t,r,n),n};let Mr=class extends Oe{render(){return j`<div class="tooltip">
1964
1964
  <div
1965
- .class="${ve(this.classList,()=>this.classList,()=>"")}"
1965
+ .class="${be(this.classList,()=>this.classList,()=>"")}"
1966
1966
  >
1967
1967
  ${this.value}
1968
1968
  </div>
1969
1969
  <div class="tooltiptext">${this.tooltipText}</div>
1970
- </div>`}};kr.styles=Xe`
1970
+ </div>`}};Mr.styles=et`
1971
1971
  .tooltip .tooltiptext {
1972
1972
  background-color: var(--vscode-notifications-background);
1973
1973
  box-shadow: 2px 2px 4px -2px var(--vscode-notifications-border);
@@ -2016,34 +2016,34 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
2016
2016
  .optional {
2017
2017
  font-weight: 400;
2018
2018
  }
2019
- `;rs([G({type:String})],kr.prototype,"tooltipText",2);rs([G({type:String})],kr.prototype,"value",2);kr=rs([Ue("tooltip-text")],kr);var Ep=Object.defineProperty,Cp=Object.getOwnPropertyDescriptor,Jt=(e,t,r,i)=>{for(var s=i>1?void 0:i?Cp(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&Ep(t,r,s),s};let ht=class extends Be{constructor(){super(...arguments),this.disposables=[],this.displaySecret=!1,this._copied=!1}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t),this._copied=!0,setTimeout(()=>this._copied=!1,1e3)}toggleVisibility(){this.displaySecret=!this.displaySecret}dispose(){this.disposables.forEach(e=>e.dispose())}render(){const e=[void 0,qe.MASKED,qe.LITERAL,qe.UNSPECIFIED].includes(this.status);return z`
2019
+ `;Zs([Z({type:String})],Mr.prototype,"tooltipText",2);Zs([Z({type:String})],Mr.prototype,"value",2);Mr=Zs([Ge("tooltip-text")],Mr);var sv=Object.defineProperty,ov=Object.getOwnPropertyDescriptor,dr=(e,t,r,i)=>{for(var n=i>1?void 0:i?ov(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&sv(t,r,n),n};let St=class extends Oe{constructor(){super(...arguments),this.disposables=[],this.displaySecret=!1,this._copied=!1}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t),this._copied=!0,setTimeout(()=>this._copied=!1,1e3)}toggleVisibility(){this.displaySecret=!this.displaySecret}dispose(){this.disposables.forEach(e=>e.dispose())}render(){const e=[void 0,at.MASKED,at.LITERAL,at.UNSPECIFIED].includes(this.status);return j`
2020
2020
  <div class="secret-container">
2021
- ${ve(this.displaySecret,()=>z`<span class="secret-text">${this.value}</span>`,()=>ve(this.maskedValue,()=>z`<span class="secret-text"
2021
+ ${be(this.displaySecret,()=>j`<span class="secret-text">${this.value}</span>`,()=>be(this.maskedValue,()=>j`<span class="secret-text"
2022
2022
  >${this.maskedValue}</span
2023
2023
  >`,()=>Array.from({length:20},(t,r)=>r+1).map(()=>"*").join("")))}
2024
2024
  <div class="actions">
2025
- ${ve(e,()=>z``,()=>ve(this.displaySecret,()=>z` <vscode-button
2025
+ ${be(e,()=>j``,()=>be(this.displaySecret,()=>j` <vscode-button
2026
2026
  appearance="icon"
2027
2027
  class="cursor-pointer"
2028
2028
  @click=${this.toggleVisibility}
2029
2029
  >
2030
- ${bp}
2031
- </vscode-button>`,()=>z` <vscode-button
2030
+ ${rv}
2031
+ </vscode-button>`,()=>j` <vscode-button
2032
2032
  appearance="icon"
2033
2033
  class="cursor-pointer"
2034
2034
  @click=${this.toggleVisibility}
2035
2035
  >
2036
- ${pc}
2036
+ ${Il}
2037
2037
  </vscode-button>`))}
2038
- ${ve([qe.LITERAL,qe.HIDDEN].includes(this.status),()=>z` <vscode-button
2038
+ ${be([at.LITERAL,at.HIDDEN].includes(this.status),()=>j` <vscode-button
2039
2039
  appearance="icon"
2040
2040
  class="cursor-pointer"
2041
2041
  @click=${this.onCopy}
2042
- >${ve(this._copied,()=>z`${_p}`,()=>z`${Va}`)}</vscode-button
2043
- >`,()=>z``)}
2042
+ >${be(this._copied,()=>j`${tv}`,()=>j`${zc}`)}</vscode-button
2043
+ >`,()=>j``)}
2044
2044
  </div>
2045
2045
  </div>
2046
- `}};ht.styles=Xe`
2046
+ `}};St.styles=et`
2047
2047
  vscode-button {
2048
2048
  color: var(--vscode-button-foreground);
2049
2049
  background-color: var(--vscode-button-background);
@@ -2075,7 +2075,7 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
2075
2075
  .cursor-pointer {
2076
2076
  cursor: pointer;
2077
2077
  }
2078
- `;Jt([G({type:String})],ht.prototype,"value",2);Jt([G({type:Number})],ht.prototype,"status",2);Jt([G({type:Boolean})],ht.prototype,"displaySecret",2);Jt([G({type:String})],ht.prototype,"maskedValue",2);Jt([Lu()],ht.prototype,"_copied",2);ht=Jt([Ue("env-viewer")],ht);z`
2078
+ `;dr([Z({type:String})],St.prototype,"value",2);dr([Z({type:Number})],St.prototype,"status",2);dr([Z({type:Boolean})],St.prototype,"displaySecret",2);dr([Z({type:String})],St.prototype,"maskedValue",2);dr([Fh()],St.prototype,"_copied",2);St=dr([Ge("env-viewer")],St);j`
2079
2079
  <svg
2080
2080
  width="16"
2081
2081
  height="16"
@@ -2090,7 +2090,7 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
2090
2090
  fill="#A1260D"
2091
2091
  />
2092
2092
  </svg>
2093
- `;const wp=(e,t)=>z`
2093
+ `;const av=(e,t)=>j`
2094
2094
  <svg
2095
2095
  width="${t}px"
2096
2096
  height="${e}px"
@@ -2105,35 +2105,35 @@ Open Dashboard to configure it`)};Rc=function(){var e;const t=Me();if(!t.postMes
2105
2105
  fill="#A1260D"
2106
2106
  />
2107
2107
  </svg>
2108
- `;var kp=Object.defineProperty,Ip=Object.getOwnPropertyDescriptor,al=e=>{throw TypeError(e)},cl=(e,t,r,i)=>{for(var s=i>1?void 0:i?Ip(t,r):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(s=(i?p(t,r,s):p(s))||s);return i&&s&&kp(t,r,s),s},Ap=(e,t,r)=>t.has(e)||al("Cannot "+r),Tp=(e,t,r)=>t.has(e)?al("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Rt=(e,t,r)=>(Ap(e,t,"access private method"),r),lt,ll,ul,or;const Rp="__",Bp=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],Np=["resolvedValue","errors","status","specClass"];let Sn=class extends Be{constructor(){super(...arguments),Tp(this,lt),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return Rt(this,lt,ul).call(this),z` <div>
2108
+ `;var cv=Object.defineProperty,lv=Object.getOwnPropertyDescriptor,$u=e=>{throw TypeError(e)},Hu=(e,t,r,i)=>{for(var n=i>1?void 0:i?lv(t,r):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(n=(i?d(t,r,n):d(n))||n);return i&&n&&cv(t,r,n),n},uv=(e,t,r)=>t.has(e)||$u("Cannot "+r),dv=(e,t,r)=>t.has(e)?$u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Kt=(e,t,r)=>(uv(e,t,"access private method"),r),vt,Gu,Zu,yr;const hv="__",fv=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],pv=["resolvedValue","errors","status","specClass"];let qn=class extends Oe{constructor(){super(...arguments),dv(this,vt),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return Kt(this,vt,Zu).call(this),j` <div>
2109
2109
  <table-view
2110
- .columns="${Bp}"
2111
- .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:nh(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2112
- .displayable="${(t,r)=>!Np.includes(r)}"
2113
- .hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===Rp)}}"
2114
- .renderer="${(t,r)=>{switch(r){case"originalValue":const i=t.status===qe.LITERAL;let s=t.status===qe.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===qe.UNSPECIFIED?s="[unset]":t.status===qe.HIDDEN&&(s="[hidden]"),s=s.replace(/\n/g," ").replace(/\r/g,""),z`<env-viewer
2110
+ .columns="${fv}"
2111
+ .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:lp(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2112
+ .displayable="${(t,r)=>!pv.includes(r)}"
2113
+ .hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===hv)}}"
2114
+ .renderer="${(t,r)=>{switch(r){case"originalValue":const i=t.status===at.LITERAL;let n=t.status===at.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===at.UNSPECIFIED?n="[unset]":t.status===at.HIDDEN&&(n="[hidden]"),n=n.replace(/\n/g," ").replace(/\r/g,""),j`<env-viewer
2115
2115
  .displaySecret="${i}"
2116
2116
  .value="${t.originalValue}"
2117
- .maskedValue="${Rt(this,lt,or).call(this,t,r,()=>s)}"
2117
+ .maskedValue="${Kt(this,vt,yr).call(this,t,r,()=>n)}"
2118
2118
  .status="${t.status}"
2119
- @onCopy="${async()=>Rt(this,lt,ll).call(this,t.originalValue)}"
2120
- ></env-viewer>`;case"updatedAt":return Rt(this,lt,or).call(this,t,r,()=>t[r]?sh(new Date(t[r])):"");case"spec":return Rt(this,lt,or).call(this,t,r,()=>z`<span class="${t.specClass}">${t[r]}</span>`);default:return Rt(this,lt,or).call(this,t,r,()=>t[r])}}}"
2119
+ @onCopy="${async()=>Kt(this,vt,Gu).call(this,t.originalValue)}"
2120
+ ></env-viewer>`;case"updatedAt":return Kt(this,vt,yr).call(this,t,r,()=>t[r]?up(new Date(t[r])):"");case"spec":return Kt(this,vt,yr).call(this,t,r,()=>j`<span class="${t.specClass}">${t[r]}</span>`);default:return Kt(this,vt,yr).call(this,t,r,()=>t[r])}}}"
2121
2121
  ></table-view>
2122
- </div>`}};lt=new WeakSet;ll=function(e){return navigator.clipboard.writeText(e)};ul=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};or=function(e,t,r){var i;const s=t==="name"?z`${wp(10,10)}`:z``;return(i=e.errors)!=null&&i.length?z`<div class="flex">
2122
+ </div>`}};vt=new WeakSet;Gu=function(e){return navigator.clipboard.writeText(e)};Zu=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};yr=function(e,t,r){var i;const n=t==="name"?j`${av(10,10)}`:j``;return(i=e.errors)!=null&&i.length?j`<div class="flex">
2123
2123
  <tooltip-text
2124
- .tooltipText="${z`<div class="flex">
2125
- ${e.errors.map(h=>z`<span>${s}${h.message}</span>`)}
2124
+ .tooltipText="${j`<div class="flex">
2125
+ ${e.errors.map(a=>j`<span>${n}${a.message}</span>`)}
2126
2126
  </div>`}"
2127
- .value="${z`${s} ${r()}`}"
2127
+ .value="${j`${n} ${r()}`}"
2128
2128
  ></tooltip-text>
2129
- </div>`:t==="spec"?z`<div class="flex">
2129
+ </div>`:t==="spec"?j`<div class="flex">
2130
2130
  <tooltip-text
2131
- .tooltipText="${z`<div class="flex">
2131
+ .tooltipText="${j`<div class="flex">
2132
2132
  Info: Variable is ${e.specClass}
2133
2133
  </div>`}"
2134
2134
  .value="${r()}"
2135
2135
  ></tooltip-text>
2136
- </div>`:z`${r()}`};cl([G({type:Array})],Sn.prototype,"variables",2);Sn=cl([Ue("env-store")],Sn);function Lp({cellID:e,runID:t,sequence:r,languageID:i,commands:s,content:h,runner:p,settings:n={},onStdout:o,onStderr:a,onExitCode:g,onPid:d,onMimeType:v}){const{rows:b=20,className:C,fontSize:m=12,fontFamily:c="monospace",takeFocus:u=!0,scrollToFit:l=!0}=n,f=Fi.useRef(null),_=Fi.useMemo(()=>({output:{"runme.dev/id":e,theme:"dark",fontFamily:c||"monospace",fontSize:m||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:u,scrollToFit:l,smoothScrollDuration:0,scrollback:4e3,initialRows:b,content:h||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}),[e,c,m,u,l,b,h]);return Fi.useEffect(()=>{const E=f.current;if(!E)return;const y=B=>o==null?void 0:o(B.detail),w=B=>a==null?void 0:a(B.detail),S=B=>g==null?void 0:g(B.detail),k=B=>d==null?void 0:d(B.detail),R=B=>v==null?void 0:v(B.detail);return E.addEventListener("stdout",y),E.addEventListener("stderr",w),E.addEventListener("exitcode",S),E.addEventListener("pid",k),E.addEventListener("mimetype",R),()=>{E.removeEventListener("stdout",y),E.removeEventListener("stderr",w),E.removeEventListener("exitcode",S),E.removeEventListener("pid",k),E.removeEventListener("mimetype",R)}},[o,a,g,d,v]),cu.jsx("div",{className:C,ref:E=>{if(!E||E.hasChildNodes())return;const y=document.createElement("runme-console");f.current=y,y.setAttribute("buttons","false"),y.setAttribute("id",_.output["runme.dev/id"]),y.setAttribute("theme",_.output.theme),y.setAttribute("fontFamily",_.output.fontFamily),typeof _.output.fontSize=="number"&&y.setAttribute("fontSize",_.output.fontSize.toString()),_.output.cursorStyle&&y.setAttribute("cursorStyle",_.output.cursorStyle),typeof _.output.cursorBlink=="boolean"&&y.setAttribute("cursorBlink",_.output.cursorBlink?"true":"false"),typeof _.output.cursorWidth=="number"&&y.setAttribute("cursorWidth",_.output.cursorWidth.toString()),typeof _.output.takeFocus=="boolean"&&y.setAttribute("takeFocus",_.output.takeFocus?"true":"false"),typeof _.output.smoothScrollDuration=="number"&&y.setAttribute("smoothScrollDuration",_.output.smoothScrollDuration.toString()),typeof _.output.scrollback=="number"&&y.setAttribute("scrollback",_.output.scrollback.toString()),_.output.initialRows!==void 0&&y.setAttribute("initialRows",_.output.initialRows.toString()),_.output.content!==void 0&&y.setAttribute("initialContent",_.output.content),_.output.isAutoSaveEnabled&&y.setAttribute("isAutoSaveEnabled",_.output.isAutoSaveEnabled.toString()),_.output.isPlatformAuthEnabled&&y.setAttribute("isPlatformAuthEnabled",_.output.isPlatformAuthEnabled.toString()),y.setAttribute("knownId",e),y.setAttribute("runId",t),y.setAttribute("sequence",String(r)),i&&y.setAttribute("languageId",i),y.setAttribute("runnerEndpoint",p.endpoint),y.setAttribute("reconnect",p.reconnect?"true":"false"),y.interceptors=p.interceptors,y.commands=s,E.appendChild(y);const w=document.createElement("div");w.setAttribute("className","h-1"),E.appendChild(w),setTimeout(()=>{l&&!xp(w)&&w.scrollIntoView({behavior:"smooth"})},0)}})}function xp(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function _i(e){let t=!1;const r=[];for(let i=0;i<e.length;i++){let s=e.charAt(i);switch(s){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(s),t=!1;break;default:t&&(t=!1,s=s.toUpperCase()),r.push(s);break}}return r.join("")}const Dp=new Set(["constructor","toString","toJSON","valueOf"]);function Ir(e){return Dp.has(e)?e+"$":e}function Op(){let e=0,t=0;for(let i=0;i<28;i+=7){let s=this.buf[this.pos++];if(e|=(s&127)<<i,(s&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let s=this.buf[this.pos++];if(t|=(s&127)<<i,(s&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}const ni=4294967296;function Uo(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let i=0,s=0;function h(p,n){const o=Number(e.slice(p,n));s*=r,i=i*r+o,i>=ni&&(s=s+(i/ni|0),i=i%ni)}return h(-24,-18),h(-18,-12),h(-12,-6),h(-6),t?hl(i,s):is(i,s)}function Fp(e,t){let r=is(e,t);const i=r.hi&2147483648;i&&(r=hl(r.lo,r.hi));const s=dl(r.lo,r.hi);return i?"-"+s:s}function dl(e,t){if({lo:e,hi:t}=Mp(e,t),t<=2097151)return String(ni*t+e);const r=e&16777215,i=(e>>>24|t<<8)&16777215,s=t>>16&65535;let h=r+i*6777216+s*6710656,p=i+s*8147497,n=s*2;const o=1e7;return h>=o&&(p+=Math.floor(h/o),h%=o),p>=o&&(n+=Math.floor(p/o),p%=o),n.toString()+Vo(p)+Vo(h)}function Mp(e,t){return{lo:e>>>0,hi:t>>>0}}function is(e,t){return{lo:e|0,hi:t|0}}function hl(e,t){return t=~t,e?e=~e+1:t+=1,is(e,t)}const Vo=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Up(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function Vp(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const Re=Pp();function Pp(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),s=BigInt("0"),h=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(p){const n=typeof p=="bigint"?p:BigInt(p);if(n>i||n<r)throw new Error(`invalid int64: ${p}`);return n},uParse(p){const n=typeof p=="bigint"?p:BigInt(p);if(n>h||n<s)throw new Error(`invalid uint64: ${p}`);return n},enc(p){return e.setBigInt64(0,this.parse(p),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(p){return e.setBigInt64(0,this.uParse(p),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(p,n){return e.setInt32(0,p,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)},uDec(p,n){return e.setInt32(0,p,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),Po(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),Wo(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),Po(r),Uo(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),Wo(r),Uo(r)},dec(r,i){return Fp(r,i)},uDec(r,i){return dl(r,i)}}}function Po(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Wo(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var P;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(P||(P={}));function Ar(e,t){switch(e){case P.STRING:return"";case P.BOOL:return!1;case P.DOUBLE:case P.FLOAT:return 0;case P.INT64:case P.UINT64:case P.SFIXED64:case P.FIXED64:case P.SINT64:return t?"0":Re.zero;case P.BYTES:return new Uint8Array(0);default:return 0}}function Wp(e,t){switch(e){case P.BOOL:return t===!1;case P.STRING:return t==="";case P.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const fl=2,tt=Symbol.for("reflect unsafe local");function Hp(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(i=>i.localName===r)}function $p(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=fl)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!Wp(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Tr(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Zp(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Gp(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function Yp(e,t){const r=t.localName;if(t.oneof){const i=t.oneof.localName;e[i].case===r&&(e[i]={case:void 0})}else if(t.presence!=fl)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=Ar(t.scalar,t.longAsString);break}}function ns(e){for(const t of e.field)Tr(t,"jsonName")||(t.jsonName=_i(t.name));e.nestedType.forEach(ns)}function Xp(e,t){const r=e.values.find(i=>i.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function Kp(e,t){switch(e){case P.STRING:return t;case P.BYTES:{const r=jp(t);if(r===!1)throw new Error(`cannot parse ${P[e]} default value: ${t}`);return r}case P.INT64:case P.SFIXED64:case P.SINT64:return Re.parse(t);case P.UINT64:case P.FIXED64:return Re.uParse(t);case P.DOUBLE:case P.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case P.BOOL:return t==="true";case P.INT32:case P.UINT32:case P.SINT32:case P.FIXED32:case P.SFIXED32:return parseInt(t,10)}}function jp(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(i){if(this.tail.length>=i){const s=this.tail.substring(0,i);return this.tail=this.tail.substring(i),s}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const i=r.c,s=r.take(2);if(s===!1)return!1;const h=parseInt(i+s,8);if(Number.isNaN(h))return!1;t.push(h);break}case"x":{const i=r.c,s=r.take(2);if(s===!1)return!1;const h=parseInt(i+s,16);if(Number.isNaN(h))return!1;t.push(h);break}case"u":{const i=r.c,s=r.take(4);if(s===!1)return!1;const h=parseInt(i+s,16);if(Number.isNaN(h))return!1;const p=new Uint8Array(4);new DataView(p.buffer).setInt32(0,h,!0),t.push(p[0],p[1],p[2],p[3]);break}case"U":{const i=r.c,s=r.take(8);if(s===!1)return!1;const h=Re.uEnc(i+s),p=new Uint8Array(8),n=new DataView(p.buffer);n.setInt32(0,h.lo,!0),n.setInt32(4,h.hi,!0),t.push(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*En(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*En(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*En(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function pl(...e){const t=zp();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)Go(r,t);return t}if("$typeName"in e[0]){let h=function(p){const n=[];for(const o of p.dependency){if(t.getFile(o)!=null||s.has(o))continue;const a=i(o);if(!a)throw new Error(`Unable to resolve ${o}, imported by ${p.name}`);"kind"in a?t.addFile(a,!1,!0):(s.add(a.name),n.push(a))}return n.concat(...n.map(h))};const r=e[0],i=e[1],s=new Set;for(const p of[r,...h(r)].reverse())Go(p,t)}else for(const r of e)for(const i of r.files)t.addFile(i);return t}function zp(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(i,s,h){if(r.set(i.proto.name,i),!s)for(const p of En(i))this.add(p);if(h)for(const p of i.dependencies)this.addFile(p,s,h)},add(i){if(i.kind=="extension"){let s=t.get(i.extendee.typeName);s||t.set(i.extendee.typeName,s=new Map),s.set(i.number,i)}e.set(i.typeName,i)},get(i){return e.get(i)},getFile(i){return r.get(i)},getMessage(i){const s=e.get(i);return(s==null?void 0:s.kind)=="message"?s:void 0},getEnum(i){const s=e.get(i);return(s==null?void 0:s.kind)=="enum"?s:void 0},getExtension(i){const s=e.get(i);return(s==null?void 0:s.kind)=="extension"?s:void 0},getExtensionFor(i,s){var h;return(h=t.get(i.typeName))===null||h===void 0?void 0:h.get(s)},getService(i){const s=e.get(i);return(s==null?void 0:s.kind)=="service"?s:void 0}}}const Jp=998,Qp=999,qp=9,Rr=10,dr=11,eg=12,Ho=14,ss=3,tg=2,$o=1,rg=0,Xi=1,Zo=2,ig=3,ng=1,sg=2,og=1,gl={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Go(e,t){var r,i;const s={kind:"file",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,edition:ug(e),name:e.name.replace(/\.proto$/,""),dependencies:dg(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},h=new Map,p={get(n){return h.get(n)},add(n){var o;Ge(((o=n.proto.options)===null||o===void 0?void 0:o.mapEntry)===!0),h.set(n.typeName,n)}};for(const n of e.enumType)vl(n,s,void 0,t);for(const n of e.messageType)ml(n,s,void 0,t,p);for(const n of e.service)ag(n,s,t);Cn(s,t);for(const n of h.values())wn(n,t,p);for(const n of s.messages)wn(n,t,p),Cn(n,t);t.addFile(s,!0)}function Cn(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const i=kn(r,e,t);e.extensions.push(i),t.add(i)}break;case"message":for(const r of e.proto.extension){const i=kn(r,e,t);e.nestedExtensions.push(i),t.add(i)}for(const r of e.nestedMessages)Cn(r,t);break}}function wn(e,t,r){const i=e.proto.oneofDecl.map(h=>lg(h,e)),s=new Set;for(const h of e.proto.field){const p=pg(h,i),n=kn(h,e,t,p,r);e.fields.push(n),e.field[n.localName]=n,p===void 0?e.members.push(n):(p.fields.push(n),s.has(p)||(s.add(p),e.members.push(p)))}for(const h of i.filter(p=>s.has(p)))e.oneofs.push(h);for(const h of e.nestedMessages)wn(h,t,r)}function vl(e,t,r,i){var s,h,p,n,o;const a=hg(e.name,e.value),g={kind:"enum",proto:e,deprecated:(h=(s=e.options)===null||s===void 0?void 0:s.deprecated)!==null&&h!==void 0?h:!1,file:t,parent:r,open:!0,name:e.name,typeName:Ri(e,r,t),value:{},values:[],sharedPrefix:a,toString(){return`enum ${this.typeName}`}};g.open=_g(g),i.add(g);for(const d of e.value){const v=d.name;g.values.push(g.value[d.number]={kind:"enum_value",proto:d,deprecated:(n=(p=d.options)===null||p===void 0?void 0:p.deprecated)!==null&&n!==void 0?n:!1,parent:g,name:v,localName:Ir(a==null?v:v.substring(a.length)),number:d.number,toString(){return`enum value ${g.typeName}.${v}`}})}((o=r==null?void 0:r.nestedEnums)!==null&&o!==void 0?o:t.enums).push(g)}function ml(e,t,r,i,s){var h,p,n,o;const a={kind:"message",proto:e,deprecated:(p=(h=e.options)===null||h===void 0?void 0:h.deprecated)!==null&&p!==void 0?p:!1,file:t,parent:r,name:e.name,typeName:Ri(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((n=e.options)===null||n===void 0?void 0:n.mapEntry)===!0?s.add(a):(((o=r==null?void 0:r.nestedMessages)!==null&&o!==void 0?o:t.messages).push(a),i.add(a));for(const g of e.enumType)vl(g,t,a,i);for(const g of e.nestedType)ml(g,t,a,i,s)}function ag(e,t,r){var i,s;const h={kind:"service",proto:e,deprecated:(s=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,file:t,name:e.name,typeName:Ri(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(h),r.add(h);for(const p of e.method){const n=cg(p,h,r);h.methods.push(n),h.method[n.localName]=n}}function cg(e,t,r){var i,s,h,p;let n;e.clientStreaming&&e.serverStreaming?n="bidi_streaming":e.clientStreaming?n="client_streaming":e.serverStreaming?n="server_streaming":n="unary";const o=r.getMessage(Qe(e.inputType)),a=r.getMessage(Qe(e.outputType));Ge(o,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Ge(a,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(s=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,parent:t,name:g,localName:Ir(g.length?Ir(g[0].toLowerCase()+g.substring(1)):g),methodKind:n,input:o,output:a,idempotency:(p=(h=e.options)===null||h===void 0?void 0:h.idempotencyLevel)!==null&&p!==void 0?p:rg,toString(){return`rpc ${t.typeName}.${g}`}}}function lg(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Ir(_i(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function kn(e,t,r,i,s){var h,p,n;const o=s===void 0,a={kind:"field",proto:e,deprecated:(p=(h=e.options)===null||h===void 0?void 0:h.deprecated)!==null&&p!==void 0?p:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:gg(e,i,o,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(o){const b=t.kind=="file"?t:t.file,C=t.kind=="file"?void 0:t,m=Ri(e,C,b);a.kind="extension",a.file=b,a.parent=C,a.oneof=void 0,a.typeName=m,a.jsonName=`[${m}]`,a.toString=()=>`extension ${m}`;const c=r.getMessage(Qe(e.extendee));Ge(c,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),a.extendee=c}else{const b=t;Ge(b.kind=="message"),a.parent=b,a.oneof=i,a.localName=i?_i(e.name):Ir(_i(e.name)),a.jsonName=e.jsonName,a.toString=()=>`field ${b.typeName}.${e.name}`}const g=e.label,d=e.type,v=(n=e.options)===null||n===void 0?void 0:n.jstype;if(g===ss){const b=d==dr?s==null?void 0:s.get(Qe(e.typeName)):void 0;if(b){a.fieldKind="map";const{key:C,value:m}=mg(b);return a.mapKey=C.scalar,a.mapKind=m.fieldKind,a.message=m.message,a.delimitedEncoding=!1,a.enum=m.enum,a.scalar=m.scalar,a}switch(a.fieldKind="list",d){case dr:case Rr:a.listKind="message",a.message=r.getMessage(Qe(e.typeName)),Ge(a.message),a.delimitedEncoding=Yo(e,t);break;case Ho:a.listKind="enum",a.enum=r.getEnum(Qe(e.typeName)),Ge(a.enum);break;default:a.listKind="scalar",a.scalar=d,a.longAsString=v==$o;break}return a.packed=vg(e,t),a}switch(d){case dr:case Rr:a.fieldKind="message",a.message=r.getMessage(Qe(e.typeName)),Ge(a.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),a.delimitedEncoding=Yo(e,t),a.getDefaultValue=()=>{};break;case Ho:{const b=r.getEnum(Qe(e.typeName));Ge(b!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),a.fieldKind="enum",a.enum=r.getEnum(Qe(e.typeName)),a.getDefaultValue=()=>Tr(e,"defaultValue")?Xp(b,e.defaultValue):void 0;break}default:{a.fieldKind="scalar",a.scalar=d,a.longAsString=v==$o,a.getDefaultValue=()=>Tr(e,"defaultValue")?Kp(d,e.defaultValue):void 0;break}}return a}function ug(e){switch(e.syntax){case"":case"proto2":return Jp;case"proto3":return Qp;case"editions":if(e.edition in gl)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function dg(e,t){return e.dependency.map(r=>{const i=t.getFile(r);if(!i)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return i})}function hg(e,t){const r=fg(e)+"_";for(const i of t){if(!i.name.toLowerCase().startsWith(r))return;const s=i.name.substring(r.length);if(s.length==0||/^\d/.test(s))return}return r}function fg(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function Ri(e,t,r){let i;return t?i=`${t.typeName}.${e.name}`:r.proto.package.length>0?i=`${r.proto.package}.${e.name}`:i=`${e.name}`,i}function Qe(e){return e.startsWith(".")?e.substring(1):e}function pg(e,t){if(!Tr(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return Ge(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function gg(e,t,r,i){if(e.label==tg)return ig;if(e.label==ss)return Zo;if(t||e.proto3Optional||r)return Xi;const s=Gt("fieldPresence",{proto:e,parent:i});return s==Zo&&(e.type==dr||e.type==Rr)?Xi:s}function vg(e,t){if(e.label!=ss)return!1;switch(e.type){case qp:case eg:case Rr:case dr:return!1}const r=e.options;return r&&Tr(r,"packed")?r.packed:ng==Gt("repeatedFieldEncoding",{proto:e,parent:t})}function mg(e){const t=e.fields.find(i=>i.number===1),r=e.fields.find(i=>i.number===2);return Ge(t&&t.fieldKind=="scalar"&&t.scalar!=P.BYTES&&t.scalar!=P.FLOAT&&t.scalar!=P.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function _g(e){var t;return og==Gt("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function Yo(e,t){return e.type==Rr?!0:sg==Gt("messageEncoding",{proto:e,parent:t})}function Gt(e,t){var r,i;const s=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(s){const h=s[e];if(h!=0)return h}if("kind"in t){if(t.kind=="message")return Gt(e,(i=t.parent)!==null&&i!==void 0?i:t.file);const h=gl[t.edition];if(!h)throw new Error(`feature default for edition ${t.edition} not found`);return h[e]}return Gt(e,t.parent)}function Ge(e,t){if(!e)throw new Error(t)}function bg(e){const t=yg(e);return t.messageType.forEach(ns),pl(t,()=>{}).getFile(t.name)}function yg(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(_l),enumType:e.enumType.map(bl)}))}function _l(e){var t,r,i,s,h,p,n,o;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(Sg))!==null&&r!==void 0?r:[],extension:[],nestedType:(s=(i=e.nestedType)===null||i===void 0?void 0:i.map(_l))!==null&&s!==void 0?s:[],enumType:(p=(h=e.enumType)===null||h===void 0?void 0:h.map(bl))!==null&&p!==void 0?p:[],extensionRange:(o=(n=e.extensionRange)===null||n===void 0?void 0:n.map(g=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},g)))!==null&&o!==void 0?o:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Sg(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?Eg(e.options):void 0}))}function Eg(e){var t,r,i;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(i=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(h=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},h)))!==null&&i!==void 0?i:[],uninterpretedOption:[]}))}function bl(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function Cg(e){const t=kg();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let i=new Uint8Array(r),s=0,h=0,p,n=0;for(let o=0;o<e.length;o++){if(p=t[e.charCodeAt(o)],p===void 0)switch(e[o]){case"=":h=0;case`
2137
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(h){case 0:n=p,h=1;break;case 1:i[s++]=n<<2|(p&48)>>4,n=p,h=2;break;case 2:i[s++]=(n&15)<<4|(p&60)>>2,n=p,h=3;break;case 3:i[s++]=(n&3)<<6|p,h=0;break}}if(h==1)throw Error("invalid base64 string");return i.subarray(0,s)}let Kr,Bt;function wg(e){return Kr||(Kr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Kr.slice(0,-2).concat("-","_")),Kr}function kg(){if(!Bt){Bt=[];const e=wg();for(let t=0;t<e.length;t++)Bt[e[t].charCodeAt(0)]=t;Bt[45]=e.indexOf("+"),Bt[95]=e.indexOf("/")}return Bt}function yl(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}class Yt extends Error{constructor(t,r,i="FieldValueInvalidError"){super(r),this.name=i,this.field=()=>t}}function Xt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function os(e,t){var r,i,s,h;if(Xt(e)&&tt in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const p=t,n=e.field();return p.listKind==n.listKind&&p.scalar===n.scalar&&((r=p.message)===null||r===void 0?void 0:r.typeName)===((i=n.message)===null||i===void 0?void 0:i.typeName)&&((s=p.enum)===null||s===void 0?void 0:s.typeName)===((h=n.enum)===null||h===void 0?void 0:h.typeName)}return!0}return!1}function as(e,t){var r,i,s,h;if(Xt(e)&&tt in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const p=t,n=e.field();return p.mapKey===n.mapKey&&p.mapKind==n.mapKind&&p.scalar===n.scalar&&((r=p.message)===null||r===void 0?void 0:r.typeName)===((i=n.message)===null||i===void 0?void 0:i.typeName)&&((s=p.enum)===null||s===void 0?void 0:s.typeName)===((h=n.enum)===null||h===void 0?void 0:h.typeName)}return!0}return!1}function cs(e,t){return Xt(e)&&tt in e&&"desc"in e&&Xt(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Ki=Symbol.for("@bufbuild/protobuf/text-encoding");function Sl(){if(globalThis[Ki]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ki]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Ki]}var Ye;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Ye||(Ye={}));const Ig=34028234663852886e22,Ag=-34028234663852886e22,Tg=4294967295,Rg=2147483647,Bg=-2147483648;class Ng{constructor(t,r=Sl().decodeUtf8){this.decodeUtf8=r,this.varint64=Op,this.uint32=Vp,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,i=t&7;if(r<=0||i<0||i>5)throw new Error("illegal tag: field no "+r+" wire type "+i);return[r,i]}skip(t,r){let i=this.pos;switch(t){case Ye.Varint:for(;this.buf[this.pos++]&128;);break;case Ye.Bit64:this.pos+=4;case Ye.Bit32:this.pos+=4;break;case Ye.LengthDelimited:let s=this.uint32();this.pos+=s;break;case Ye.StartGroup:for(;;){const[h,p]=this.tag();if(p===Ye.EndGroup){if(r!==void 0&&h!==r)throw new Error("invalid end group tag");break}this.skip(p,h)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Re.dec(...this.varint64())}uint64(){return Re.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),i=-(t&1);return t=(t>>>1|(r&1)<<31)^i,r=r>>>1^i,Re.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Re.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Re.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function Lg(e,t){const r=e.fieldKind=="list"?os(t,e):e.fieldKind=="map"?as(t,e):ls(e,t);if(r===!0)return;let i;switch(e.fieldKind){case"list":i=`expected ${wl(e)}, got ${yi(t)}`;break;case"map":i=`expected ${kl(e)}, got ${yi(t)}`;break;default:i=bi(e,t,r)}return new Yt(e,i)}function Xo(e,t,r){const i=ls(e,r);if(i!==!0)return new Yt(e,`list item #${t+1}: ${bi(e,r,i)}`)}function xg(e,t,r){const i=El(t,e.mapKey);if(i!==!0)return new Yt(e,`invalid map key: ${bi({scalar:e.mapKey},t,i)}`);const s=ls(e,r);if(s!==!0)return new Yt(e,`map entry ${yi(t)}: ${bi(e,r,s)}`)}function ls(e,t){return e.scalar!==void 0?El(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):cs(t,e.message)}function El(e,t){switch(t){case P.DOUBLE:return typeof e=="number";case P.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>Ig||e<Ag?`${e.toFixed()} out of range`:!0;case P.INT32:case P.SFIXED32:case P.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Rg||e<Bg?`${e.toFixed()} out of range`:!0;case P.FIXED32:case P.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Tg||e<0?`${e.toFixed()} out of range`:!0;case P.BOOL:return typeof e=="boolean";case P.STRING:return typeof e!="string"?!1:Sl().checkUtf8(e)||"invalid UTF8";case P.BYTES:return e instanceof Uint8Array;case P.INT64:case P.SFIXED64:case P.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Re.parse(e),!0}catch{return`${e} out of range`}return!1;case P.FIXED64:case P.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Re.uParse(e),!0}catch{return`${e} out of range`}return!1}}function bi(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${yi(t)}`,e.scalar!==void 0?`expected ${Dg(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${Cl(e.message)}`+r}function yi(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:os(e)?wl(e.field()):as(e)?kl(e.field()):cs(e)?Cl(e.desc):yl(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Cl(e){return`ReflectMessage (${e.typeName})`}function wl(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${P[e.scalar]})`}}function kl(e){switch(e.mapKind){case"message":return`ReflectMap (${P[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${P[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${P[e.mapKey]}, ${P[e.scalar]})`}}function Dg(e){switch(e){case P.STRING:return"string";case P.BOOL:return"boolean";case P.INT64:case P.SINT64:case P.SFIXED64:return"bigint (int64)";case P.UINT64:case P.FIXED64:return"bigint (uint64)";case P.BYTES:return"Uint8Array";case P.DOUBLE:return"number (float64)";case P.FLOAT:return"number (float32)";case P.FIXED32:case P.UINT32:return"number (uint32)";case P.INT32:case P.SFIXED32:case P.SINT32:return"number (int32)"}}function Og(e){return Il(e.$typeName)}function Fg(e){const t=e.fields[0];return Il(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function Il(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const Mg=999,Ug=998,si=2;function Vg(e,t){return yl(t,e)?t:Wg(e)}const Pg=Symbol(),Ko=new WeakMap;function Wg(e){let t;if(Hg(e)){const r=Ko.get(e);let i,s;if(r)({prototype:i,members:s}=r);else{i={},s=new Set;for(const h of e.members)h.kind!="oneof"&&(h.fieldKind!="scalar"&&h.fieldKind!="enum"||h.presence!=si&&(s.add(h),i[h.localName]=ji(h)));Ko.set(e,{prototype:i,members:s})}t=Object.create(i),t.$typeName=e.typeName;for(const h of e.members)s.has(h)||h.kind=="field"&&(h.fieldKind=="message"||(h.fieldKind=="scalar"||h.fieldKind=="enum")&&h.presence!=si)||(t[h.localName]=ji(h))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==si)&&(t[r.localName]=ji(r))}return t}function Hg(e){switch(e.file.edition){case Mg:return!1;case Ug:return!0;default:return e.fields.some(t=>t.presence!=si&&t.fieldKind!="message"&&!t.oneof)}}function ji(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return Pg;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?Ar(e.scalar,e.longAsString):e.enum.values[0].number}function us(e,t,r=!0){return new Al(e,t,r)}class Al{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,i)=>r.number-i.number)}constructor(t,r,i=!0){this.lists=new Map,this.maps=new Map,this.check=i,this.desc=t,this.message=this[tt]=r??Vg(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return nr(this.message,t),Hp(this.message,t)}isSet(t){return nr(this.message,t),$p(this.message,t)}clear(t){nr(this.message,t),Yp(this.message,t)}get(t){nr(this.message,t);const r=Zp(this.message,t);switch(t.fieldKind){case"list":let i=this.lists.get(t);return(!i||i[tt]!==r)&&this.lists.set(t,i=new $g(t,r,this.check)),i;case"map":let s=this.maps.get(t);return(!s||s[tt]!==r)&&this.maps.set(t,s=new Zg(t,r,this.check)),s;case"message":return hs(t,r,this.check);case"scalar":return r===void 0?Ar(t.scalar,!1):fs(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(nr(this.message,t),this.check){const s=Lg(t,r);if(s)throw s}let i;t.fieldKind=="message"?i=ds(t,r):as(r)||os(r)?i=r[tt]:i=ps(t,r),Gp(this.message,t,i)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function nr(e,t){if(t.parent.typeName!==e.$typeName)throw new Yt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class $g{field(){return this._field}get size(){return this._arr.length}constructor(t,r,i){this._field=t,this._arr=this[tt]=r,this.check=i}get(t){const r=this._arr[t];return r===void 0?void 0:zi(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Yt(this._field,`list item #${t+1}: out of range`);if(this.check){const i=Xo(this._field,t,r);if(i)throw i}this._arr[t]=jo(this._field,r)}add(t){if(this.check){const r=Xo(this._field,this._arr.length,t);if(r)throw r}this._arr.push(jo(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield zi(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,zi(this._field,this._arr[t],this.check)]}}class Zg{constructor(t,r,i=!0){this.obj=this[tt]=r??{},this.check=i,this._field=t}field(){return this._field}set(t,r){if(this.check){const i=xg(this._field,t,r);if(i)throw i}return this.obj[jr(t)]=Gg(this._field,r),this}delete(t){const r=jr(t),i=Object.prototype.hasOwnProperty.call(this.obj,r);return i&&delete this.obj[r],i}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[jr(t)];return r!==void 0&&(r=Ji(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,jr(t))}*keys(){for(const t of Object.keys(this.obj))yield zo(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[zo(t[0],this._field.mapKey),Ji(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Ji(this._field,t,this.check)}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}}function ds(e,t){return cs(t)?Og(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?Rl(t.message):t.message:t}function hs(e,t,r){return t!==void 0&&(Fg(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:fs(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Xt(t)&&(t=Tl(t))),new Al(e.message,t,r)}function jo(e,t){return e.listKind=="message"?ds(e,t):ps(e,t)}function zi(e,t,r){return e.listKind=="message"?hs(e,t,r):fs(e,t)}function Gg(e,t){return e.mapKind=="message"?ds(e,t):ps(e,t)}function Ji(e,t,r){return e.mapKind=="message"?hs(e,t,r):t}function jr(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function zo(e,t){switch(t){case P.STRING:return e;case P.INT32:case P.FIXED32:case P.UINT32:case P.SFIXED32:case P.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case P.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case P.UINT64:case P.FIXED64:try{return Re.uParse(e)}catch{}break;default:try{return Re.parse(e)}catch{}break}return e}function fs(e,t){switch(e.scalar){case P.INT64:case P.SFIXED64:case P.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Re.parse(t));break;case P.FIXED64:case P.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Re.uParse(t));break}return t}function ps(e,t){switch(e.scalar){case P.INT64:case P.SFIXED64:case P.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Re.parse(t));break;case P.FIXED64:case P.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Re.uParse(t));break}return t}function Tl(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Xt(e))for(const[r,i]of Object.entries(e))t.fields[r]=Nl(i);return t}function Rl(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=Bl(i);return t}function Bl(e){switch(e.kind.case){case"structValue":return Rl(e.kind.value);case"listValue":return e.kind.value.values.map(Bl);case"nullValue":case void 0:return null;default:return e.kind.value}}function Nl(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const i of e)r.values.push(Nl(i));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:Tl(e)};break}return t}function gs(e,t,...r){return r.reduce((i,s)=>i.nestedMessages[s],e.messages[t])}function Yg(e,t,...r){if(r.length==0)return e.enums[t];const i=r.pop();return r.reduce((s,h)=>s.nestedMessages[h],e.messages[t]).nestedEnums[i]}function Xg(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const Kg=bg({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),jg=gs(Kg,1);var Jo;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(Jo||(Jo={}));var Qo;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Qo||(Qo={}));var qo;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(qo||(qo={}));var ea;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(ea||(ea={}));var ta;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(ta||(ta={}));var ra;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(ra||(ra={}));var ia;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(ia||(ia={}));var na;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(na||(na={}));var sa;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(sa||(sa={}));var oa;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(oa||(oa={}));var aa;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(aa||(aa={}));var ca;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(ca||(ca={}));var la;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(la||(la={}));var ua;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(ua||(ua={}));var da;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(da||(da={}));var ha;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(ha||(ha={}));var fa;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(fa||(fa={}));var pa;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(pa||(pa={}));var ga;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(ga||(ga={}));var va;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(va||(va={}));const ma={readUnknownFields:!0};function zg(e){return e?Object.assign(Object.assign({},ma),e):ma}function Jg(e,t,r){const i=us(e,void 0,!1);return Ll(i,new Ng(t),zg(r),!1,t.byteLength),i.message}function Ll(e,t,r,i,s){var h;const p=i?t.len:t.pos+s;let n,o;const a=(h=e.getUnknown())!==null&&h!==void 0?h:[];for(;t.pos<p&&([n,o]=t.tag(),!(i&&o==Ye.EndGroup));){const g=e.findNumber(n);if(!g){const d=t.skip(o,n);r.readUnknownFields&&a.push({no:n,wireType:o,data:d});continue}Qg(e,t,g,o,r)}if(i&&(o!=Ye.EndGroup||n!==s))throw new Error("invalid end group tag");a.length>0&&e.setUnknown(a)}function Qg(e,t,r,i,s){var h;switch(r.fieldKind){case"scalar":e.set(r,Kt(t,r.scalar));break;case"enum":const p=Kt(t,P.INT32);if(r.enum.open)e.set(r,p);else if(r.enum.values.some(o=>o.number===p))e.set(r,p);else if(s.readUnknownFields){const o=[];Up(p,o);const a=(h=e.getUnknown())!==null&&h!==void 0?h:[];a.push({no:r.number,wireType:i,data:new Uint8Array(o)}),e.setUnknown(a)}break;case"message":e.set(r,vs(t,s,r,e.get(r)));break;case"list":ev(t,i,e.get(r),s);break;case"map":qg(t,e.get(r),s);break}}function qg(e,t,r){const i=t.field();let s,h;const p=e.uint32(),n=e.pos+p;for(;e.pos<n;){const[o]=e.tag();switch(o){case 1:s=Kt(e,i.mapKey);break;case 2:switch(i.mapKind){case"scalar":h=Kt(e,i.scalar);break;case"enum":h=e.int32();break;case"message":h=vs(e,r,i);break}break}}if(s===void 0&&(s=Ar(i.mapKey,!1)),h===void 0)switch(i.mapKind){case"scalar":h=Ar(i.scalar,!1);break;case"enum":h=i.enum.values[0].number;break;case"message":h=us(i.message,void 0,!1);break}t.set(s,h)}function ev(e,t,r,i){var s;const h=r.field();if(h.listKind==="message"){r.add(vs(e,i,h));return}const p=(s=h.scalar)!==null&&s!==void 0?s:P.INT32;if(!(t==Ye.LengthDelimited&&p!=P.STRING&&p!=P.BYTES)){r.add(Kt(e,p));return}const o=e.uint32()+e.pos;for(;e.pos<o;)r.add(Kt(e,p))}function vs(e,t,r,i){const s=r.delimitedEncoding,h=i??us(r.message,void 0,!1);return Ll(h,e,t,s,s?r.number:e.uint32()),h}function Kt(e,t){switch(t){case P.STRING:return e.string();case P.BOOL:return e.bool();case P.DOUBLE:return e.double();case P.FLOAT:return e.float();case P.INT32:return e.int32();case P.INT64:return e.int64();case P.UINT64:return e.uint64();case P.FIXED64:return e.fixed64();case P.BYTES:return e.bytes();case P.FIXED32:return e.fixed32();case P.SFIXED32:return e.sfixed32();case P.SFIXED64:return e.sfixed64();case P.SINT64:return e.sint64();case P.UINT32:return e.uint32();case P.SINT32:return e.sint32()}}function Ur(e,t){var r;const i=Jg(jg,Cg(e));return i.messageType.forEach(ns),i.dependency=(r=t==null?void 0:t.map(h=>h.proto.name))!==null&&r!==void 0?r:[],pl(i,h=>t==null?void 0:t.find(p=>p.proto.name===h)).getFile(i.name)}const tv=Ur("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),rv=Yg(tv,0),iv=Xg(rv),nv=Ur("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),sv=Ur("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),ov=Ur("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[La.file_google_protobuf_wrappers,sv]),xl=Ur("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[nv,ov]),In=gs(xl,3),av=gs(xl,4);var An=function(e,t){return An=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},An(e,t)};function gt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");An(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function cv(e,t,r,i){function s(h){return h instanceof r?h:new r(function(p){p(h)})}return new(r||(r=Promise))(function(h,p){function n(g){try{a(i.next(g))}catch(d){p(d)}}function o(g){try{a(i.throw(g))}catch(d){p(d)}}function a(g){g.done?h(g.value):s(g.value).then(n,o)}a((i=i.apply(e,t||[])).next())})}function Dl(e,t){var r={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},i,s,h,p=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return p.next=n(0),p.throw=n(1),p.return=n(2),typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function n(a){return function(g){return o([a,g])}}function o(a){if(i)throw new TypeError("Generator is already executing.");for(;p&&(p=0,a[0]&&(r=0)),r;)try{if(i=1,s&&(h=a[0]&2?s.return:a[0]?s.throw||((h=s.return)&&h.call(s),0):s.next)&&!(h=h.call(s,a[1])).done)return h;switch(s=0,h&&(a=[a[0]&2,h.value]),a[0]){case 0:case 1:h=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,s=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(h=r.trys,!(h=h.length>0&&h[h.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!h||a[1]>h[0]&&a[1]<h[3])){r.label=a[1];break}if(a[0]===6&&r.label<h[1]){r.label=h[1],h=a;break}if(h&&r.label<h[2]){r.label=h[2],r.ops.push(a);break}h[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(g){a=[6,g],s=0}finally{i=h=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function jt(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function nt(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),s,h=[],p;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)h.push(s.value)}catch(n){p={error:n}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(p)throw p.error}}return h}function ft(e,t,r){if(r||arguments.length===2)for(var i=0,s=t.length,h;i<s;i++)(h||!(i in t))&&(h||(h=Array.prototype.slice.call(t,0,i)),h[i]=t[i]);return e.concat(h||Array.prototype.slice.call(t))}function Ot(e){return this instanceof Ot?(this.v=e,this):new Ot(e)}function lv(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),s,h=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),n("next"),n("throw"),n("return",p),s[Symbol.asyncIterator]=function(){return this},s;function p(b){return function(C){return Promise.resolve(C).then(b,d)}}function n(b,C){i[b]&&(s[b]=function(m){return new Promise(function(c,u){h.push([b,m,c,u])>1||o(b,m)})},C&&(s[b]=C(s[b])))}function o(b,C){try{a(i[b](C))}catch(m){v(h[0][3],m)}}function a(b){b.value instanceof Ot?Promise.resolve(b.value.v).then(g,d):v(h[0][2],b)}function g(b){o("next",b)}function d(b){o("throw",b)}function v(b,C){b(C),h.shift(),h.length&&o(h[0][0],h[0][1])}}function uv(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof jt=="function"?jt(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(h){r[h]=e[h]&&function(p){return new Promise(function(n,o){p=e[h](p),s(n,o,p.done,p.value)})}}function s(h,p,n,o){Promise.resolve(o).then(function(a){h({value:a,done:n})},p)}}function ae(e){return typeof e=="function"}function Ol(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Qi=Ol(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
2138
- `+r.map(function(i,s){return s+1+") "+i.toString()}).join(`
2139
- `):"",this.name="UnsubscriptionError",this.errors=r}});function Si(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Vr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,s,h;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var n=jt(p),o=n.next();!o.done;o=n.next()){var a=o.value;a.remove(this)}}catch(m){t={error:m}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}else p.remove(this);var g=this.initialTeardown;if(ae(g))try{g()}catch(m){h=m instanceof Qi?m.errors:[m]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=jt(d),b=v.next();!b.done;b=v.next()){var C=b.value;try{_a(C)}catch(m){h=h??[],m instanceof Qi?h=ft(ft([],nt(h)),nt(m.errors)):h.push(m)}}}catch(m){i={error:m}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(i)throw i.error}}}if(h)throw new Qi(h)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)_a(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Si(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Si(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Fl=Vr.EMPTY;function Ml(e){return e instanceof Vr||e&&"closed"in e&&ae(e.remove)&&ae(e.add)&&ae(e.unsubscribe)}function _a(e){ae(e)?e():e.unsubscribe()}var dv={Promise:void 0},hv={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,ft([e,t],nt(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Ul(e){hv.setTimeout(function(){throw e})}function Br(){}function oi(e){e()}var ms=(function(e){gt(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Ml(r)&&r.add(i)):i.destination=gv,i}return t.create=function(r,i,s){return new Nr(r,i,s)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Vr),fv=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){zr(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){zr(i)}else zr(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){zr(r)}},e})(),Nr=(function(e){gt(t,e);function t(r,i,s){var h=e.call(this)||this,p;return ae(r)||!r?p={next:r??void 0,error:i??void 0,complete:s??void 0}:p=r,h.destination=new fv(p),h}return t})(ms);function zr(e){Ul(e)}function pv(e){throw e}var gv={closed:!0,next:Br,error:pv,complete:Br},_s=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Bi(e){return e}function vv(e){return e.length===0?Bi:e.length===1?e[0]:function(r){return e.reduce(function(i,s){return s(i)},r)}}var ye=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var s=this,h=_v(t)?t:new Nr(t,r,i);return oi(function(){var p=s,n=p.operator,o=p.source;h.add(n?n.call(h,o):o?s._subscribe(h):s._trySubscribe(h))}),h},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=ba(r),new r(function(s,h){var p=new Nr({next:function(n){try{t(n)}catch(o){h(o),p.unsubscribe()}},error:h,complete:s});i.subscribe(p)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[_s]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return vv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=ba(t),new t(function(i,s){var h;r.subscribe(function(p){return h=p},function(p){return s(p)},function(){return i(h)})})},e.create=function(t){return new e(t)},e})();function ba(e){var t;return(t=e??dv.Promise)!==null&&t!==void 0?t:Promise}function mv(e){return e&&ae(e.next)&&ae(e.error)&&ae(e.complete)}function _v(e){return e&&e instanceof ms||mv(e)&&Ml(e)}function bv(e){return ae(e==null?void 0:e.lift)}function Ne(e){return function(t){if(bv(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function be(e,t,r,i,s){return new yv(e,t,r,i,s)}var yv=(function(e){gt(t,e);function t(r,i,s,h,p,n){var o=e.call(this,r)||this;return o.onFinalize=p,o.shouldUnsubscribe=n,o._next=i?function(a){try{i(a)}catch(g){r.error(g)}}:e.prototype._next,o._error=h?function(a){try{h(a)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=s?function(){try{s()}catch(a){r.error(a)}finally{this.unsubscribe()}}:e.prototype._complete,o}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(ms),Sv=Ol(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),He=(function(e){gt(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new ya(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new Sv},t.prototype.next=function(r){var i=this;oi(function(){var s,h;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var p=jt(i.currentObservers),n=p.next();!n.done;n=p.next()){var o=n.value;o.next(r)}}catch(a){s={error:a}}finally{try{n&&!n.done&&(h=p.return)&&h.call(p)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var i=this;oi(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;oi(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,s=this,h=s.hasError,p=s.isStopped,n=s.observers;return h||p?Fl:(this.currentObservers=null,n.push(r),new Vr(function(){i.currentObservers=null,Si(n,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,h=i.thrownError,p=i.isStopped;s?r.error(h):p&&r.complete()},t.prototype.asObservable=function(){var r=new ye;return r.source=this,r},t.create=function(r,i){return new ya(r,i)},t})(ye),ya=(function(e){gt(t,e);function t(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return t.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},t.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:Fl},t})(He),Ev={now:function(){return Date.now()}},Cv=(function(e){gt(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(Vr),Sa={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,ft([e,t],nt(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},wv=(function(e){gt(t,e);function t(r,i){var s=e.call(this,r,i)||this;return s.scheduler=r,s.work=i,s.pending=!1,s}return t.prototype.schedule=function(r,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var h=this.id,p=this.scheduler;return h!=null&&(this.id=this.recycleAsyncId(p,h,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(p,this.id,i),this},t.prototype.requestAsyncId=function(r,i,s){return s===void 0&&(s=0),Sa.setInterval(r.flush.bind(r,this),s)},t.prototype.recycleAsyncId=function(r,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&Sa.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(r,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var s=!1,h;try{this.work(r)}catch(p){s=!0,h=p||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),h},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,s=r.scheduler,h=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Si(h,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Cv),Ea=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=Ev.now,e})(),kv=(function(e){gt(t,e);function t(r,i){i===void 0&&(i=Ea.now);var s=e.call(this,r,i)||this;return s.actions=[],s._active=!1,s}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var s;this._active=!0;do if(s=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,s){for(;r=i.shift();)r.unsubscribe();throw s}},t})(Ea),Ni=new kv(wv),Iv=Ni,Vl=new ye(function(e){return e.complete()});function Pl(e){return e&&ae(e.schedule)}function bs(e){return e[e.length-1]}function Av(e){return ae(bs(e))?e.pop():void 0}function Wl(e){return Pl(bs(e))?e.pop():void 0}function Tv(e,t){return typeof bs(e)=="number"?e.pop():t}var ys=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Hl(e){return ae(e==null?void 0:e.then)}function $l(e){return ae(e[_s])}function Zl(e){return Symbol.asyncIterator&&ae(e==null?void 0:e[Symbol.asyncIterator])}function Gl(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Rv(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yl=Rv();function Xl(e){return ae(e==null?void 0:e[Yl])}function Kl(e){return lv(this,arguments,function(){var r,i,s,h;return Dl(this,function(p){switch(p.label){case 0:r=e.getReader(),p.label=1;case 1:p.trys.push([1,,9,10]),p.label=2;case 2:return[4,Ot(r.read())];case 3:return i=p.sent(),s=i.value,h=i.done,h?[4,Ot(void 0)]:[3,5];case 4:return[2,p.sent()];case 5:return[4,Ot(s)];case 6:return[4,p.sent()];case 7:return p.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function jl(e){return ae(e==null?void 0:e.getReader)}function Ce(e){if(e instanceof ye)return e;if(e!=null){if($l(e))return Bv(e);if(ys(e))return Nv(e);if(Hl(e))return Lv(e);if(Zl(e))return zl(e);if(Xl(e))return xv(e);if(jl(e))return Dv(e)}throw Gl(e)}function Bv(e){return new ye(function(t){var r=e[_s]();if(ae(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Nv(e){return new ye(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Lv(e){return new ye(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Ul)})}function xv(e){return new ye(function(t){var r,i;try{for(var s=jt(e),h=s.next();!h.done;h=s.next()){var p=h.value;if(t.next(p),t.closed)return}}catch(n){r={error:n}}finally{try{h&&!h.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}t.complete()})}function zl(e){return new ye(function(t){Ov(e,t).catch(function(r){return t.error(r)})})}function Dv(e){return zl(Kl(e))}function Ov(e,t){var r,i,s,h;return cv(this,void 0,void 0,function(){var p,n;return Dl(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=uv(e),o.label=1;case 1:return[4,r.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(p=i.value,t.next(p),t.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return n=o.sent(),s={error:n},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(h=r.return)?[4,h.call(r)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function kt(e,t,r,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var h=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(h),!s)return h}function Jl(e,t){return t===void 0&&(t=0),Ne(function(r,i){r.subscribe(be(i,function(s){return kt(i,e,function(){return i.next(s)},t)},function(){return kt(i,e,function(){return i.complete()},t)},function(s){return kt(i,e,function(){return i.error(s)},t)}))})}function Ql(e,t){return t===void 0&&(t=0),Ne(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function Fv(e,t){return Ce(e).pipe(Ql(t),Jl(t))}function Mv(e,t){return Ce(e).pipe(Ql(t),Jl(t))}function Uv(e,t){return new ye(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function Vv(e,t){return new ye(function(r){var i;return kt(r,t,function(){i=e[Yl](),kt(r,t,function(){var s,h,p;try{s=i.next(),h=s.value,p=s.done}catch(n){r.error(n);return}p?r.complete():r.next(h)},0,!0)}),function(){return ae(i==null?void 0:i.return)&&i.return()}})}function ql(e,t){if(!e)throw new Error("Iterable cannot be null");return new ye(function(r){kt(r,t,function(){var i=e[Symbol.asyncIterator]();kt(r,t,function(){i.next().then(function(s){s.done?r.complete():r.next(s.value)})},0,!0)})})}function Pv(e,t){return ql(Kl(e),t)}function Wv(e,t){if(e!=null){if($l(e))return Fv(e,t);if(ys(e))return Uv(e,t);if(Hl(e))return Mv(e,t);if(Zl(e))return ql(e,t);if(Xl(e))return Vv(e,t);if(jl(e))return Pv(e,t)}throw Gl(e)}function eu(e,t){return t?Wv(e,t):Ce(e)}function Hv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Wl(e);return eu(e,r)}function $v(e){return e instanceof Date&&!isNaN(e)}function Pe(e,t){return Ne(function(r,i){var s=0;r.subscribe(be(i,function(h){i.next(e.call(t,h,s++))}))})}var Zv=Array.isArray;function Gv(e,t){return Zv(t)?e.apply(void 0,ft([],nt(t))):e(t)}function Yv(e){return Pe(function(t){return Gv(e,t)})}function Xv(e,t,r,i,s,h,p,n){var o=[],a=0,g=0,d=!1,v=function(){d&&!o.length&&!a&&t.complete()},b=function(m){return a<i?C(m):o.push(m)},C=function(m){a++;var c=!1;Ce(r(m,g++)).subscribe(be(t,function(u){t.next(u)},function(){c=!0},void 0,function(){if(c)try{a--;for(var u=function(){var l=o.shift();p||C(l)};o.length&&a<i;)u();v()}catch(l){t.error(l)}}))};return e.subscribe(be(t,b,function(){d=!0,v()})),function(){}}function Et(e,t,r){return r===void 0&&(r=1/0),ae(t)?Et(function(i,s){return Pe(function(h,p){return t(i,h,s,p)})(Ce(e(i,s)))},r):(typeof t=="number"&&(r=t),Ne(function(i,s){return Xv(i,s,e,r)}))}function Kv(e){return e===void 0&&(e=1/0),Et(Bi,e)}function jv(e){return new ye(function(t){Ce(e()).subscribe(t)})}var zv={connector:function(){return new He},resetOnDisconnect:!0};function _t(e,t){t===void 0&&(t=zv);var r=null,i=t.connector,s=t.resetOnDisconnect,h=s===void 0?!0:s,p=i(),n=new ye(function(o){return p.subscribe(o)});return n.connect=function(){return(!r||r.closed)&&(r=jv(function(){return e}).subscribe(p),h&&r.add(function(){return p=i()})),r},n}var Jv=["addListener","removeListener"],Qv=["addEventListener","removeEventListener"],qv=["on","off"];function Tn(e,t,r,i){if(ae(r)&&(i=r,r=void 0),i)return Tn(e,t,r).pipe(Yv(i));var s=nt(r0(e)?Qv.map(function(n){return function(o){return e[n](t,o,r)}}):e0(e)?Jv.map(Ca(e,t)):t0(e)?qv.map(Ca(e,t)):[],2),h=s[0],p=s[1];if(!h&&ys(e))return Et(function(n){return Tn(n,t,r)})(Ce(e));if(!h)throw new TypeError("Invalid event target");return new ye(function(n){var o=function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];return n.next(1<a.length?a:a[0])};return h(o),function(){return p(o)}})}function Ca(e,t){return function(r){return function(i){return e[r](t,i)}}}function e0(e){return ae(e.addListener)&&ae(e.removeListener)}function t0(e){return ae(e.on)&&ae(e.off)}function r0(e){return ae(e.addEventListener)&&ae(e.removeEventListener)}function hr(e,t,r){e===void 0&&(e=0),r===void 0&&(r=Iv);var i=-1;return t!=null&&(Pl(t)?r=t:i=t),new ye(function(s){var h=$v(e)?+e-r.now():e;h<0&&(h=0);var p=0;return r.schedule(function(){s.closed||(s.next(p++),0<=i?this.schedule(void 0,i):s.complete())},h)})}function i0(e,t){return t===void 0&&(t=Ni),hr(e,e,t)}function n0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Wl(e),i=Tv(e,1/0),s=e;return s.length?s.length===1?Ce(s[0]):Kv(i)(eu(s,r)):Vl}var s0=Array.isArray;function o0(e){return e.length===1&&s0(e[0])?e[0]:e}function at(e,t){return Ne(function(r,i){var s=0;r.subscribe(be(i,function(h){return e.call(t,h,s++)&&i.next(h)}))})}function a0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=o0(e),e.length===1?Ce(e[0]):new ye(c0(e))}function c0(e){return function(t){for(var r=[],i=function(h){r.push(Ce(e[h]).subscribe(be(t,function(p){if(r){for(var n=0;n<r.length;n++)n!==h&&r[n].unsubscribe();r=null}t.next(p)})))},s=0;r&&!t.closed&&s<e.length;s++)i(s)}}function l0(e){return Ne(function(t,r){var i=null,s=null,h=function(){s==null||s.unsubscribe();var p=i;i=[],p&&r.next(p),Ce(e()).subscribe(s=be(r,h,Br))};h(),t.subscribe(be(r,function(p){return i==null?void 0:i.push(p)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=s=null}))})}function tu(e){return Ne(function(t,r){var i=null,s=!1,h;i=t.subscribe(be(r,void 0,void 0,function(p){h=Ce(e(p,tu(e)(t))),i?(i.unsubscribe(),i=null,h.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,h.subscribe(r))})}function u0(e,t,r,i,s){return function(h,p){var n=r,o=t,a=0;h.subscribe(be(p,function(g){var d=a++;o=n?e(o,g,d):(n=!0,g),p.next(o)},s))}}function wa(e){return e<=0?function(){return Vl}:Ne(function(t,r){var i=0;t.subscribe(be(r,function(s){++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function d0(e){return Ne(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function h0(e,t){return Ne(u0(e,t,arguments.length>=2,!0))}function f0(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new He}:t,i=e.resetOnError,s=i===void 0?!0:i,h=e.resetOnComplete,p=h===void 0?!0:h,n=e.resetOnRefCountZero,o=n===void 0?!0:n;return function(a){var g,d,v,b=0,C=!1,m=!1,c=function(){d==null||d.unsubscribe(),d=void 0},u=function(){c(),g=v=void 0,C=m=!1},l=function(){var f=g;u(),f==null||f.unsubscribe()};return Ne(function(f,_){b++,!m&&!C&&c();var E=v=v??r();_.add(function(){b--,b===0&&!m&&!C&&(d=qi(l,o))}),E.subscribe(_),!g&&b>0&&(g=new Nr({next:function(y){return E.next(y)},error:function(y){m=!0,c(),d=qi(u,s,y),E.error(y)},complete:function(){C=!0,c(),d=qi(u,p),E.complete()}}),Ce(f).subscribe(g))})(a)}}function qi(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var s=new Nr({next:function(){s.unsubscribe(),e()}});return Ce(t.apply(void 0,ft([],nt(r)))).subscribe(s)}}function p0(e){return Ne(function(t,r){var i=!1,s=be(r,function(){s==null||s.unsubscribe(),i=!0},Br);Ce(e).subscribe(s),t.subscribe(be(r,function(h){return i&&r.next(h)}))})}function ka(e,t){return Ne(function(r,i){var s=null,h=0,p=!1,n=function(){return p&&!s&&i.complete()};r.subscribe(be(i,function(o){s==null||s.unsubscribe();var a=0,g=h++;Ce(e(o,g)).subscribe(s=be(i,function(d){return i.next(t?t(o,d,g,a++):d)},function(){s=null,n()}))},function(){p=!0,n()}))})}function Jr(e,t){return t===void 0&&(t=!1),Ne(function(r,i){var s=0;r.subscribe(be(i,function(h){var p=e(h,s++);(p||t)&&i.next(h),!p&&i.complete()}))})}function g0(e,t,r){var i=ae(e)||t||r?{next:e,error:t,complete:r}:e;return i?Ne(function(s,h){var p;(p=i.subscribe)===null||p===void 0||p.call(i);var n=!0;s.subscribe(be(h,function(o){var a;(a=i.next)===null||a===void 0||a.call(i,o),h.next(o)},function(){var o;n=!1,(o=i.complete)===null||o===void 0||o.call(i),h.complete()},function(o){var a;n=!1,(a=i.error)===null||a===void 0||a.call(i,o),h.error(o)},function(){var o,a;n&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(a=i.finalize)===null||a===void 0||a.call(i)}))}):Bi}function v0(e,t){return Ne(function(r,i){var s=t??{},h=s.leading,p=h===void 0?!0:h,n=s.trailing,o=n===void 0?!1:n,a=!1,g=null,d=null,v=!1,b=function(){d==null||d.unsubscribe(),d=null,o&&(c(),v&&i.complete())},C=function(){d=null,v&&i.complete()},m=function(u){return d=Ce(e(u)).subscribe(be(i,b,C))},c=function(){if(a){a=!1;var u=g;g=null,i.next(u),!v&&m(u)}};r.subscribe(be(i,function(u){a=!0,g=u,!(d&&!d.closed)&&(p?c():m(u))},function(){v=!0,!(o&&a&&d&&!d.closed)&&i.complete()}))})}function Ia(e,t,r){t===void 0&&(t=Ni);var i=hr(e,t);return v0(function(){return i},r)}function en(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Av(e);return Ne(function(i,s){for(var h=e.length,p=new Array(h),n=e.map(function(){return!1}),o=!1,a=function(d){Ce(e[d]).subscribe(be(s,function(v){p[d]=v,!o&&!n[d]&&(n[d]=!0,(o=n.every(Bi))&&(n=null))},Br))},g=0;g<h;g++)a(g);i.subscribe(be(s,function(d){if(o){var v=ft([d],nt(p));s.next(r?r.apply(void 0,ft([],nt(v))):v)}}))})}const ru="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ei=32,m0=16,iu=10,Aa=0xffffffffffff;var Ct;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(Ct||(Ct={}));class ar extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function _0(e){const t=Math.floor(e()*Ei)%Ei;return ru.charAt(t)}function b0(e){const t=y0(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const i=new Uint8Array(1);return r.getRandomValues(i),i[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new ar(Ct.PRNGDetectFailure,"Failed to find a reliable PRNG")}function y0(){return C0()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function S0(e,t){let r="";for(;e>0;e--)r=_0(t)+r;return r}function E0(e,t=iu){if(isNaN(e))throw new ar(Ct.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Aa)throw new ar(Ct.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Aa}: ${e}`);if(e<0)throw new ar(Ct.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new ar(Ct.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,i="";for(let s=t;s>0;s--)r=e%Ei,i=ru.charAt(r)+i,e=(e-r)/Ei;return i}function C0(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function w0(e,t){const r=b0(),i=Date.now();return E0(i,iu)+S0(m0,r)}const ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));function k0(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}let tn;const I0=new Uint8Array(16);function A0(){if(!tn){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tn=crypto.getRandomValues.bind(crypto)}return tn(I0)}const T0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ta={randomUUID:T0};function R0(e,t,r){var s;if(Ta.randomUUID&&!e)return Ta.randomUUID();e=e||{};const i=e.random??((s=e.rng)==null?void 0:s.call(e))??A0();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,k0(i)}const B0=5e3,N0=1e3,Qr=4e3,Ra=1e3;var nu=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(nu||{});class L0{constructor({knownID:t,runID:r,sequence:i,options:s}){ce(this,"callback");ce(this,"queue",new He);ce(this,"subscriptions",[]);ce(this,"reconnect",new He);ce(this,"client",new ye);ce(this,"_latencies",new He);ce(this,"_latenciesConnectable",_t(this._latencies.asObservable().pipe(h0((t,r)=>{if(r.latency<0){const i=t.get(r.streamID);i&&t.set(r.streamID,{...i,readyState:r.readyState})}else t.set(r.streamID,r);return t},new Map))));ce(this,"_errors",new He);ce(this,"_errorsConnectable",_t(this._errors.asObservable()));ce(this,"_stdout",new He);ce(this,"_stderr",new He);ce(this,"_exitCode",new He);ce(this,"_pid",new He);ce(this,"_mimeType",new He);ce(this,"_stdoutConnectable",_t(this._stdout.asObservable()));ce(this,"_stderrConnectable",_t(this._stderr.asObservable()));ce(this,"_exitCodeConnectable",_t(this._exitCode.asObservable()));ce(this,"_pidConnectable",_t(this._pid.asObservable()));ce(this,"_mimeTypeConnectable",_t(this._mimeType.asObservable()));ce(this,"knownID");ce(this,"runID");ce(this,"sequence");ce(this,"runnerEndpoint");ce(this,"interceptors");ce(this,"autoReconnect");this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=s.runnerEndpoint,this.interceptors=s.interceptors,this.autoReconnect=s.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Ia(Ra,Ni,{leading:!0,trailing:!0}),ka(h=>this.useSocketClient(h.streamID).pipe(ka(p=>this.useHeartbeat(p,h))))).pipe(f0()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return i0(N0).pipe(at(()=>this.autoReconnect),en(this.reconnect),at(([,r])=>r.heartbeat==="CONTINUOUS"),en(this.latencies),Pe(([,r])=>Array.from(r.values()).filter(i=>i.readyState===WebSocket.OPEN&&i.latency>=Qr)),at(r=>r.length>0),Ia(Ra)).subscribe({next:r=>{console.log(new Date,"Triggering reconnect",r),this.connect()},complete:()=>{console.log("Monitor complete")},error:r=>{console.error("Error in monitor",r)}})}process(){const t=this.client.pipe(at(p=>(p==null?void 0:p.readyState)===WebSocket.OPEN),wa(1)),r=this.queue.pipe(l0(()=>t),at(p=>p.length>0),Pe(p=>p.sort((n,o)=>{const a=g=>{var d;return!!((d=g.payload.value)!=null&&d.config)};return a(o)?1:a(n)?-1:0}))),i=this.queue.pipe(p0(t));return n0(r.pipe(Et(p=>p)),i).pipe(en(this.client),Jr(([,p])=>p.readyState===WebSocket.OPEN),Et(async([p,n])=>{await Na({req:p,interceptors:this.interceptors,socket:n,knownID:this.knownID,runID:this.runID})})).subscribe({error:p=>{this._errors.next(p)}})}useSocketClient(t){return new ye(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const s=new WebSocket(i.toString()),h=a=>{if(console.log(new Date,`WebSocket transport ${t} closed`,a),a.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},p=a=>{console.log(new Date,`WebSocket transport ${t} error`,a),this.autoReconnect||r.error(a)},n=a=>{var b,C;if(typeof a.data!="string"){console.warn("Unexpected WebSocket message type:",typeof a.data);return}let g;try{g=Ba(a.data),console.log("Received WebsocketResponse:",g)}catch(m){console.error("Failed to parse WebsocketResponse:",m)}const d=g.status;if(d&&d.code!==iv.OK){r.error(d);return}if(g.pong)return;const v=g.payload.value;if(v.stdoutData&&v.stdoutData.length>0&&((b=this.callback)==null||b.call(this,{type:ee.terminalStdout,output:{"runme.dev/id":this.knownID,data:v.stdoutData}}),this._stdout.next(v.stdoutData)),v.stderrData&&v.stderrData.length>0&&((C=this.callback)==null||C.call(this,{type:ee.terminalStderr,output:{"runme.dev/id":this.knownID,data:v.stderrData}}),this._stderr.next(v.stderrData)),v.exitCode!==void 0&&(this._exitCode.next(v.exitCode),r.complete()),v.pid!==void 0&&this._pid.next(v.pid),v.mimeType){const c=v.mimeType.split(";")[0];this._mimeType.next(c)}},o=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(s)};return s.addEventListener("close",h),s.addEventListener("error",p),s.addEventListener("message",n),s.addEventListener("open",o),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),s.removeEventListener("close",h),s.removeEventListener("error",p),s.removeEventListener("message",n),s.removeEventListener("open",o),s.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(xe.create(In,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new ye(s=>{const h=Tn(t,"message").pipe(Jr(()=>t.readyState===WebSocket.OPEN),Pe(g=>Ba(g.data)),Pe(g=>g.pong),at(g=>g!==void 0),Pe(g=>({receivedAt:BigInt(Date.now()),pong:g}))),o=(i==="INITIAL"?hr(0):hr(0,B0)).pipe(Jr(()=>t.readyState===WebSocket.OPEN),Pe(()=>{const g={timestamp:BigInt(Date.now())};return xe.create(In,{ping:g})}),Et(async g=>(await Na({req:g,interceptors:this.interceptors,socket:t}),g)),Pe(g=>g.ping)).pipe(at(g=>(g==null?void 0:g.timestamp)!==void 0),Et(g=>a0(h.pipe(at(d=>d.pong.timestamp===g.timestamp),wa(1),Pe(d=>{const v=g.timestamp,b=d.receivedAt;return Number(b-v)})),hr(Qr).pipe(Pe(()=>{throw new Error(`Pong not received within ${Qr}ms for stream ${r}`)}))).pipe(tu(d=>(this._latencies.next({streamID:r,latency:Qr,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",d.message),Hv(null))))),d0(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),g0(g=>{g!==null&&this._latencies.next({streamID:r,latency:g,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),a=[];return a.push(o.subscribe({error:g=>{console.error("Unexpected error sending heartbeat",g)}})),s.next(t),()=>{a.forEach(g=>g.unsubscribe())}})}connect(t="CONTINUOUS"){const r=x0(),i=this.latencies.pipe(Pe(s=>{const h=s.get(r);return h===void 0?null:h}),Jr(s=>(s==null?void 0:s.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Ba(e){const t=JSON.parse(e);return xe.fromJson(av,t)}async function Na({req:e,interceptors:t,socket:r,knownID:i,runID:s}){i&&(e.knownId=i),s&&(e.runId=s);const h={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let p=async a=>({stream:!1,message:{},method:{},service:{},header:a.header});for(const a of t.concat().reverse())p=a(p);const o=(await p(h)).header.get("Authorization");o&&e&&(e.authorization=o),r.send(JSON.stringify(xe.toJson(In,e)))}function x0(){return R0().replace(/-/g,"")}function D0(){return`run_${w0()}`}exports.Console=Lp;exports.Heartbeat=nu;exports.Streams=L0;exports.genRunID=D0;
2136
+ </div>`:j`${r()}`};Hu([Z({type:Array})],qn.prototype,"variables",2);qn=Hu([Ge("env-store")],qn);function gv({cellID:e,runID:t,sequence:r,languageID:i,commands:n,content:a,runner:d,settings:s={},onStdout:o,onStderr:c,onExitCode:g,onPid:f,onMimeType:m}){const{rows:_=20,className:w,fontSize:v=12,fontFamily:l="monospace",takeFocus:h=!0,scrollToFit:u=!0}=s,p=ln.useRef(null),b=ln.useMemo(()=>({output:{"runme.dev/id":e,theme:"dark",fontFamily:l||"monospace",fontSize:v||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:h,scrollToFit:u,smoothScrollDuration:0,scrollback:4e3,initialRows:_,content:a||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}),[e,l,v,h,u,_,a]);return ln.useEffect(()=>{const E=p.current;if(!E)return;const y=R=>o==null?void 0:o(R.detail),C=R=>c==null?void 0:c(R.detail),S=R=>g==null?void 0:g(R.detail),k=R=>f==null?void 0:f(R.detail),T=R=>m==null?void 0:m(R.detail);return E.addEventListener("stdout",y),E.addEventListener("stderr",C),E.addEventListener("exitcode",S),E.addEventListener("pid",k),E.addEventListener("mimetype",T),()=>{E.removeEventListener("stdout",y),E.removeEventListener("stderr",C),E.removeEventListener("exitcode",S),E.removeEventListener("pid",k),E.removeEventListener("mimetype",T)}},[o,c,g,f,m]),hh.jsx("div",{className:w,ref:E=>{if(!E||E.hasChildNodes())return;const y=document.createElement("runme-console");p.current=y,y.setAttribute("buttons","false"),y.setAttribute("id",b.output["runme.dev/id"]),y.setAttribute("theme",b.output.theme),y.setAttribute("fontFamily",b.output.fontFamily),typeof b.output.fontSize=="number"&&y.setAttribute("fontSize",b.output.fontSize.toString()),b.output.cursorStyle&&y.setAttribute("cursorStyle",b.output.cursorStyle),typeof b.output.cursorBlink=="boolean"&&y.setAttribute("cursorBlink",b.output.cursorBlink?"true":"false"),typeof b.output.cursorWidth=="number"&&y.setAttribute("cursorWidth",b.output.cursorWidth.toString()),typeof b.output.takeFocus=="boolean"&&y.setAttribute("takeFocus",b.output.takeFocus?"true":"false"),typeof b.output.smoothScrollDuration=="number"&&y.setAttribute("smoothScrollDuration",b.output.smoothScrollDuration.toString()),typeof b.output.scrollback=="number"&&y.setAttribute("scrollback",b.output.scrollback.toString()),b.output.initialRows!==void 0&&y.setAttribute("initialRows",b.output.initialRows.toString()),b.output.content!==void 0&&y.setAttribute("initialContent",b.output.content),b.output.isAutoSaveEnabled&&y.setAttribute("isAutoSaveEnabled",b.output.isAutoSaveEnabled.toString()),b.output.isPlatformAuthEnabled&&y.setAttribute("isPlatformAuthEnabled",b.output.isPlatformAuthEnabled.toString()),y.setAttribute("knownId",e),y.setAttribute("runId",t),y.setAttribute("sequence",String(r)),i&&y.setAttribute("languageId",i),y.setAttribute("runnerEndpoint",d.endpoint),y.setAttribute("reconnect",d.reconnect?"true":"false"),y.interceptors=d.interceptors,y.commands=n,E.appendChild(y);const C=document.createElement("div");C.setAttribute("className","h-1"),E.appendChild(C),setTimeout(()=>{u&&!mv(C)&&C.scrollIntoView({behavior:"smooth"})},0)}})}function mv(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function Pr(e){let t=!1;const r=[];for(let i=0;i<e.length;i++){let n=e.charAt(i);switch(n){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(n),t=!1;break;default:t&&(t=!1,n=n.toUpperCase()),r.push(n);break}}return r.join("")}const vv=new Set(["constructor","toString","toJSON","valueOf"]);function Wr(e){return vv.has(e)?e+"$":e}function bv(){let e=0,t=0;for(let i=0;i<28;i+=7){let n=this.buf[this.pos++];if(e|=(n&127)<<i,(n&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let n=this.buf[this.pos++];if(t|=(n&127)<<i,(n&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function En(e,t,r){for(let a=0;a<28;a=a+7){const d=e>>>a,s=!(!(d>>>7)&&t==0),o=(s?d|128:d)&255;if(r.push(o),!s)return}const i=e>>>28&15|(t&7)<<4,n=t>>3!=0;if(r.push((n?i|128:i)&255),!!n){for(let a=3;a<31;a=a+7){const d=t>>>a,s=!!(d>>>7),o=(s?d|128:d)&255;if(r.push(o),!s)return}r.push(t>>>31&1)}}const yi=4294967296;function Ha(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let i=0,n=0;function a(d,s){const o=Number(e.slice(d,s));n*=r,i=i*r+o,i>=yi&&(n=n+(i/yi|0),i=i%yi)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Yu(i,n):Ks(i,n)}function _v(e,t){let r=Ks(e,t);const i=r.hi&2147483648;i&&(r=Yu(r.lo,r.hi));const n=Ku(r.lo,r.hi);return i?"-"+n:n}function Ku(e,t){if({lo:e,hi:t}=yv(e,t),t<=2097151)return String(yi*t+e);const r=e&16777215,i=(e>>>24|t<<8)&16777215,n=t>>16&65535;let a=r+i*6777216+n*6710656,d=i+n*8147497,s=n*2;const o=1e7;return a>=o&&(d+=Math.floor(a/o),a%=o),d>=o&&(s+=Math.floor(d/o),d%=o),s.toString()+Ga(d)+Ga(a)}function yv(e,t){return{lo:e>>>0,hi:t>>>0}}function Ks(e,t){return{lo:e|0,hi:t|0}}function Yu(e,t){return t=~t,e?e=~e+1:t+=1,Ks(e,t)}const Ga=e=>{const t=String(e);return"0000000".slice(t.length)+t};function es(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function Sv(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const he=Ev();function Ev(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),n=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(d){const s=typeof d=="bigint"?d:BigInt(d);if(s>i||s<r)throw new Error(`invalid int64: ${d}`);return s},uParse(d){const s=typeof d=="bigint"?d:BigInt(d);if(s>a||s<n)throw new Error(`invalid uint64: ${d}`);return s},enc(d){return e.setBigInt64(0,this.parse(d),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(d){return e.setBigInt64(0,this.uParse(d),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(d,s){return e.setInt32(0,d,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(d,s){return e.setInt32(0,d,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),Za(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),Ka(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),Za(r),Ha(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),Ka(r),Ha(r)},dec(r,i){return _v(r,i)},uDec(r,i){return Ku(r,i)}}}function Za(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Ka(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var V;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(V||(V={}));function $t(e,t){switch(e){case V.STRING:return"";case V.BOOL:return!1;case V.DOUBLE:case V.FLOAT:return 0;case V.INT64:case V.UINT64:case V.SFIXED64:case V.FIXED64:case V.SINT64:return t?"0":he.zero;case V.BYTES:return new Uint8Array(0);default:return 0}}function wv(e,t){switch(e){case V.BOOL:return t===!1;case V.STRING:return t==="";case V.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Xu=2,lt=Symbol.for("reflect unsafe local");function Ju(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(i=>i.localName===r)}function Cv(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Xu)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!wv(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function $r(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function ju(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function zu(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function kv(e,t){const r=t.localName;if(t.oneof){const i=t.oneof.localName;e[i].case===r&&(e[i]={case:void 0})}else if(t.presence!=Xu)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=$t(t.scalar,t.longAsString);break}}function Ys(e){for(const t of e.field)$r(t,"jsonName")||(t.jsonName=Pr(t.name));e.nestedType.forEach(Ys)}function Iv(e,t){const r=e.values.find(i=>i.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function Av(e,t){switch(e){case V.STRING:return t;case V.BYTES:{const r=Nv(t);if(r===!1)throw new Error(`cannot parse ${V[e]} default value: ${t}`);return r}case V.INT64:case V.SFIXED64:case V.SINT64:return he.parse(t);case V.UINT64:case V.FIXED64:return he.uParse(t);case V.DOUBLE:case V.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case V.BOOL:return t==="true";case V.INT32:case V.UINT32:case V.SINT32:case V.FIXED32:case V.SFIXED32:return parseInt(t,10)}}function Nv(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(i){if(this.tail.length>=i){const n=this.tail.substring(0,i);return this.tail=this.tail.substring(i),n}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const i=r.c,n=r.take(2);if(n===!1)return!1;const a=parseInt(i+n,8);if(Number.isNaN(a))return!1;t.push(a);break}case"x":{const i=r.c,n=r.take(2);if(n===!1)return!1;const a=parseInt(i+n,16);if(Number.isNaN(a))return!1;t.push(a);break}case"u":{const i=r.c,n=r.take(4);if(n===!1)return!1;const a=parseInt(i+n,16);if(Number.isNaN(a))return!1;const d=new Uint8Array(4);new DataView(d.buffer).setInt32(0,a,!0),t.push(d[0],d[1],d[2],d[3]);break}case"U":{const i=r.c,n=r.take(8);if(n===!1)return!1;const a=he.uEnc(i+n),d=new Uint8Array(8),s=new DataView(d.buffer);s.setInt32(0,a.lo,!0),s.setInt32(4,a.hi,!0),t.push(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*ts(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*ts(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*ts(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function Qu(...e){const t=Tv();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)ja(r,t);return t}if("$typeName"in e[0]){let a=function(d){const s=[];for(const o of d.dependency){if(t.getFile(o)!=null||n.has(o))continue;const c=i(o);if(!c)throw new Error(`Unable to resolve ${o}, imported by ${d.name}`);"kind"in c?t.addFile(c,!1,!0):(n.add(c.name),s.push(c))}return s.concat(...s.map(a))};const r=e[0],i=e[1],n=new Set;for(const d of[r,...a(r)].reverse())ja(d,t)}else for(const r of e)for(const i of r.files)t.addFile(i);return t}function Tv(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(i,n,a){if(r.set(i.proto.name,i),!n)for(const d of ts(i))this.add(d);if(a)for(const d of i.dependencies)this.addFile(d,n,a)},add(i){if(i.kind=="extension"){let n=t.get(i.extendee.typeName);n||t.set(i.extendee.typeName,n=new Map),n.set(i.number,i)}e.set(i.typeName,i)},get(i){return e.get(i)},getFile(i){return r.get(i)},getMessage(i){const n=e.get(i);return(n==null?void 0:n.kind)=="message"?n:void 0},getEnum(i){const n=e.get(i);return(n==null?void 0:n.kind)=="enum"?n:void 0},getExtension(i){const n=e.get(i);return(n==null?void 0:n.kind)=="extension"?n:void 0},getExtensionFor(i,n){var a;return(a=t.get(i.typeName))===null||a===void 0?void 0:a.get(n)},getService(i){const n=e.get(i);return(n==null?void 0:n.kind)=="service"?n:void 0}}}const Rv=998,Bv=999,Lv=9,Hr=10,kr=11,xv=12,Ya=14,Xs=3,Dv=2,Xa=1,Ov=0,wn=1,Ja=2,Fv=3,Vv=1,Uv=2,Mv=1,qu={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function ja(e,t){var r,i;const n={kind:"file",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,edition:Hv(e),name:e.name.replace(/\.proto$/,""),dependencies:Gv(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},a=new Map,d={get(s){return a.get(s)},add(s){var o;Qe(((o=s.proto.options)===null||o===void 0?void 0:o.mapEntry)===!0),a.set(s.typeName,s)}};for(const s of e.enumType)ed(s,n,void 0,t);for(const s of e.messageType)td(s,n,void 0,t,d);for(const s of e.service)Pv(s,n,t);rs(n,t);for(const s of a.values())is(s,t,d);for(const s of n.messages)is(s,t,d),rs(s,t);t.addFile(n,!0)}function rs(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const i=ns(r,e,t);e.extensions.push(i),t.add(i)}break;case"message":for(const r of e.proto.extension){const i=ns(r,e,t);e.nestedExtensions.push(i),t.add(i)}for(const r of e.nestedMessages)rs(r,t);break}}function is(e,t,r){const i=e.proto.oneofDecl.map(a=>$v(a,e)),n=new Set;for(const a of e.proto.field){const d=Yv(a,i),s=ns(a,e,t,d,r);e.fields.push(s),e.field[s.localName]=s,d===void 0?e.members.push(s):(d.fields.push(s),n.has(d)||(n.add(d),e.members.push(d)))}for(const a of i.filter(d=>n.has(d)))e.oneofs.push(a);for(const a of e.nestedMessages)is(a,t,r)}function ed(e,t,r,i){var n,a,d,s,o;const c=Zv(e.name,e.value),g={kind:"enum",proto:e,deprecated:(a=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&a!==void 0?a:!1,file:t,parent:r,open:!0,name:e.name,typeName:ji(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};g.open=zv(g),i.add(g);for(const f of e.value){const m=f.name;g.values.push(g.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(d=f.options)===null||d===void 0?void 0:d.deprecated)!==null&&s!==void 0?s:!1,parent:g,name:m,localName:Wr(c==null?m:m.substring(c.length)),number:f.number,toString(){return`enum value ${g.typeName}.${m}`}})}((o=r==null?void 0:r.nestedEnums)!==null&&o!==void 0?o:t.enums).push(g)}function td(e,t,r,i,n){var a,d,s,o;const c={kind:"message",proto:e,deprecated:(d=(a=e.options)===null||a===void 0?void 0:a.deprecated)!==null&&d!==void 0?d:!1,file:t,parent:r,name:e.name,typeName:ji(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?n.add(c):(((o=r==null?void 0:r.nestedMessages)!==null&&o!==void 0?o:t.messages).push(c),i.add(c));for(const g of e.enumType)ed(g,t,c,i);for(const g of e.nestedType)td(g,t,c,i,n)}function Pv(e,t,r){var i,n;const a={kind:"service",proto:e,deprecated:(n=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&n!==void 0?n:!1,file:t,name:e.name,typeName:ji(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(a),r.add(a);for(const d of e.method){const s=Wv(d,a,r);a.methods.push(s),a.method[s.localName]=s}}function Wv(e,t,r){var i,n,a,d;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const o=r.getMessage(ot(e.inputType)),c=r.getMessage(ot(e.outputType));Qe(o,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Qe(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(n=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&n!==void 0?n:!1,parent:t,name:g,localName:Wr(g.length?Wr(g[0].toLowerCase()+g.substring(1)):g),methodKind:s,input:o,output:c,idempotency:(d=(a=e.options)===null||a===void 0?void 0:a.idempotencyLevel)!==null&&d!==void 0?d:Ov,toString(){return`rpc ${t.typeName}.${g}`}}}function $v(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Wr(Pr(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function ns(e,t,r,i,n){var a,d,s;const o=n===void 0,c={kind:"field",proto:e,deprecated:(d=(a=e.options)===null||a===void 0?void 0:a.deprecated)!==null&&d!==void 0?d:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Xv(e,i,o,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(o){const _=t.kind=="file"?t:t.file,w=t.kind=="file"?void 0:t,v=ji(e,w,_);c.kind="extension",c.file=_,c.parent=w,c.oneof=void 0,c.typeName=v,c.jsonName=`[${v}]`,c.toString=()=>`extension ${v}`;const l=r.getMessage(ot(e.extendee));Qe(l,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=l}else{const _=t;Qe(_.kind=="message"),c.parent=_,c.oneof=i,c.localName=i?Pr(e.name):Wr(Pr(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const g=e.label,f=e.type,m=(s=e.options)===null||s===void 0?void 0:s.jstype;if(g===Xs){const _=f==kr?n==null?void 0:n.get(ot(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:w,value:v}=jv(_);return c.mapKey=w.scalar,c.mapKind=v.fieldKind,c.message=v.message,c.delimitedEncoding=!1,c.enum=v.enum,c.scalar=v.scalar,c}switch(c.fieldKind="list",f){case kr:case Hr:c.listKind="message",c.message=r.getMessage(ot(e.typeName)),Qe(c.message),c.delimitedEncoding=za(e,t);break;case Ya:c.listKind="enum",c.enum=r.getEnum(ot(e.typeName)),Qe(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=m==Xa;break}return c.packed=Jv(e,t),c}switch(f){case kr:case Hr:c.fieldKind="message",c.message=r.getMessage(ot(e.typeName)),Qe(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=za(e,t),c.getDefaultValue=()=>{};break;case Ya:{const _=r.getEnum(ot(e.typeName));Qe(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(ot(e.typeName)),c.getDefaultValue=()=>$r(e,"defaultValue")?Iv(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=m==Xa,c.getDefaultValue=()=>$r(e,"defaultValue")?Av(f,e.defaultValue):void 0;break}}return c}function Hv(e){switch(e.syntax){case"":case"proto2":return Rv;case"proto3":return Bv;case"editions":if(e.edition in qu)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Gv(e,t){return e.dependency.map(r=>{const i=t.getFile(r);if(!i)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return i})}function Zv(e,t){const r=Kv(e)+"_";for(const i of t){if(!i.name.toLowerCase().startsWith(r))return;const n=i.name.substring(r.length);if(n.length==0||/^\d/.test(n))return}return r}function Kv(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function ji(e,t,r){let i;return t?i=`${t.typeName}.${e.name}`:r.proto.package.length>0?i=`${r.proto.package}.${e.name}`:i=`${e.name}`,i}function ot(e){return e.startsWith(".")?e.substring(1):e}function Yv(e,t){if(!$r(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return Qe(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function Xv(e,t,r,i){if(e.label==Dv)return Fv;if(e.label==Xs)return Ja;if(t||e.proto3Optional||r)return wn;const n=ar("fieldPresence",{proto:e,parent:i});return n==Ja&&(e.type==kr||e.type==Hr)?wn:n}function Jv(e,t){if(e.label!=Xs)return!1;switch(e.type){case Lv:case xv:case Hr:case kr:return!1}const r=e.options;return r&&$r(r,"packed")?r.packed:Vv==ar("repeatedFieldEncoding",{proto:e,parent:t})}function jv(e){const t=e.fields.find(i=>i.number===1),r=e.fields.find(i=>i.number===2);return Qe(t&&t.fieldKind=="scalar"&&t.scalar!=V.BYTES&&t.scalar!=V.FLOAT&&t.scalar!=V.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function zv(e){var t;return Mv==ar("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function za(e,t){return e.type==Hr?!0:Uv==ar("messageEncoding",{proto:e,parent:t})}function ar(e,t){var r,i;const n=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(n){const a=n[e];if(a!=0)return a}if("kind"in t){if(t.kind=="message")return ar(e,(i=t.parent)!==null&&i!==void 0?i:t.file);const a=qu[t.edition];if(!a)throw new Error(`feature default for edition ${t.edition} not found`);return a[e]}return ar(e,t.parent)}function Qe(e,t){if(!e)throw new Error(t)}function Qv(e){const t=qv(e);return t.messageType.forEach(Ys),Qu(t,()=>{}).getFile(t.name)}function qv(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(rd),enumType:e.enumType.map(id)}))}function rd(e){var t,r,i,n,a,d,s,o;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(e0))!==null&&r!==void 0?r:[],extension:[],nestedType:(n=(i=e.nestedType)===null||i===void 0?void 0:i.map(rd))!==null&&n!==void 0?n:[],enumType:(d=(a=e.enumType)===null||a===void 0?void 0:a.map(id))!==null&&d!==void 0?d:[],extensionRange:(o=(s=e.extensionRange)===null||s===void 0?void 0:s.map(g=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},g)))!==null&&o!==void 0?o:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function e0(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?t0(e.options):void 0}))}function t0(e){var t,r,i;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(i=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(a=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},a)))!==null&&i!==void 0?i:[],uninterpretedOption:[]}))}function id(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function nd(e){const t=i0();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let i=new Uint8Array(r),n=0,a=0,d,s=0;for(let o=0;o<e.length;o++){if(d=t[e.charCodeAt(o)],d===void 0)switch(e[o]){case"=":a=0;case`
2137
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(a){case 0:s=d,a=1;break;case 1:i[n++]=s<<2|(d&48)>>4,s=d,a=2;break;case 2:i[n++]=(s&15)<<4|(d&60)>>2,s=d,a=3;break;case 3:i[n++]=(s&3)<<6|d,a=0;break}}if(a==1)throw Error("invalid base64 string");return i.subarray(0,n)}function r0(e,t="std"){const r=sd(t),i=t=="std";let n="",a=0,d,s=0;for(let o=0;o<e.length;o++)switch(d=e[o],a){case 0:n+=r[d>>2],s=(d&3)<<4,a=1;break;case 1:n+=r[s|d>>4],s=(d&15)<<2,a=2;break;case 2:n+=r[s|d>>6],n+=r[d&63],a=0;break}return a&&(n+=r[s],i&&(n+="=",a==1&&(n+="="))),n}let ui,Qa,Yt;function sd(e){return ui||(ui="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Qa=ui.slice(0,-2).concat("-","_")),e=="url"?Qa:ui}function i0(){if(!Yt){Yt=[];const e=sd("std");for(let t=0;t<e.length;t++)Yt[e[t].charCodeAt(0)]=t;Yt[45]=e.indexOf("+"),Yt[95]=e.indexOf("/")}return Yt}function Js(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const n0=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Pe extends Error{constructor(t,r,i="FieldValueInvalidError"){super(r),this.name=i,this.field=()=>t}}function s0(e){return e instanceof Error&&n0.includes(e.name)&&"field"in e&&typeof e.field=="function"}function Et(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function js(e,t){var r,i,n,a;if(Et(e)&&lt in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const d=t,s=e.field();return d.listKind==s.listKind&&d.scalar===s.scalar&&((r=d.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((n=d.enum)===null||n===void 0?void 0:n.typeName)===((a=s.enum)===null||a===void 0?void 0:a.typeName)}return!0}return!1}function zs(e,t){var r,i,n,a;if(Et(e)&&lt in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const d=t,s=e.field();return d.mapKey===s.mapKey&&d.mapKind==s.mapKind&&d.scalar===s.scalar&&((r=d.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((n=d.enum)===null||n===void 0?void 0:n.typeName)===((a=s.enum)===null||a===void 0?void 0:a.typeName)}return!0}return!1}function Qs(e,t){return Et(e)&&lt in e&&"desc"in e&&Et(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Cn=Symbol.for("@bufbuild/protobuf/text-encoding");function qs(){if(globalThis[Cn]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Cn]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Cn]}var Se;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Se||(Se={}));const od=34028234663852886e22,ad=-34028234663852886e22,cd=4294967295,ld=2147483647,ud=-2147483648;class dd{constructor(t=qs().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let n=0;n<this.chunks.length;n++)t+=this.chunks[n].length;let r=new Uint8Array(t),i=0;for(let n=0;n<this.chunks.length;n++)r.set(this.chunks[n],i),i+=this.chunks[n].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(qa(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return kn(t),es(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){o0(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){qa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){kn(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return kn(t),t=(t<<1^t>>31)>>>0,es(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),n=he.enc(t);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),n=he.uEnc(t);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(r)}int64(t){let r=he.enc(t);return En(r.lo,r.hi,this.buf),this}sint64(t){const r=he.enc(t),i=r.hi>>31,n=r.lo<<1^i,a=(r.hi<<1|r.lo>>>31)^i;return En(n,a,this.buf),this}uint64(t){const r=he.uEnc(t);return En(r.lo,r.hi,this.buf),this}}class eo{constructor(t,r=qs().decodeUtf8){this.decodeUtf8=r,this.varint64=bv,this.uint32=Sv,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,i=t&7;if(r<=0||i<0||i>5)throw new Error("illegal tag: field no "+r+" wire type "+i);return[r,i]}skip(t,r){let i=this.pos;switch(t){case Se.Varint:for(;this.buf[this.pos++]&128;);break;case Se.Bit64:this.pos+=4;case Se.Bit32:this.pos+=4;break;case Se.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Se.StartGroup:for(;;){const[a,d]=this.tag();if(d===Se.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(d,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return he.dec(...this.varint64())}uint64(){return he.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),i=-(t&1);return t=(t>>>1|(r&1)<<31)^i,r=r>>>1^i,he.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return he.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return he.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function kn(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>ld||e<ud)throw new Error("invalid int32: "+e)}function qa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>cd||e<0)throw new Error("invalid uint32: "+e)}function o0(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>od||e<ad))throw new Error("invalid float32: "+e)}function Lt(e,t){const r=e.fieldKind=="list"?js(t,e):e.fieldKind=="map"?zs(t,e):to(e,t);if(r===!0)return;let i;switch(e.fieldKind){case"list":i=`expected ${pd(e)}, got ${Ne(t)}`;break;case"map":i=`expected ${gd(e)}, got ${Ne(t)}`;break;default:i=Di(e,t,r)}return new Pe(e,i)}function ec(e,t,r){const i=to(e,r);if(i!==!0)return new Pe(e,`list item #${t+1}: ${Di(e,r,i)}`)}function a0(e,t,r){const i=hd(t,e.mapKey);if(i!==!0)return new Pe(e,`invalid map key: ${Di({scalar:e.mapKey},t,i)}`);const n=to(e,r);if(n!==!0)return new Pe(e,`map entry ${Ne(t)}: ${Di(e,r,n)}`)}function to(e,t){return e.scalar!==void 0?hd(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):Qs(t,e.message)}function hd(e,t){switch(t){case V.DOUBLE:return typeof e=="number";case V.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>od||e<ad?`${e.toFixed()} out of range`:!0;case V.INT32:case V.SFIXED32:case V.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>ld||e<ud?`${e.toFixed()} out of range`:!0;case V.FIXED32:case V.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>cd||e<0?`${e.toFixed()} out of range`:!0;case V.BOOL:return typeof e=="boolean";case V.STRING:return typeof e!="string"?!1:qs().checkUtf8(e)||"invalid UTF8";case V.BYTES:return e instanceof Uint8Array;case V.INT64:case V.SFIXED64:case V.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return he.parse(e),!0}catch{return`${e} out of range`}return!1;case V.FIXED64:case V.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return he.uParse(e),!0}catch{return`${e} out of range`}return!1}}function Di(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${Ne(t)}`,e.scalar!==void 0?`expected ${c0(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${fd(e.message)}`+r}function Ne(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:js(e)?pd(e.field()):zs(e)?gd(e.field()):Qs(e)?fd(e.desc):Js(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function fd(e){return`ReflectMessage (${e.typeName})`}function pd(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${V[e.scalar]})`}}function gd(e){switch(e.mapKind){case"message":return`ReflectMap (${V[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${V[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${V[e.mapKey]}, ${V[e.scalar]})`}}function c0(e){switch(e){case V.STRING:return"string";case V.BOOL:return"boolean";case V.INT64:case V.SINT64:case V.SFIXED64:return"bigint (int64)";case V.UINT64:case V.FIXED64:return"bigint (uint64)";case V.BYTES:return"Uint8Array";case V.DOUBLE:return"number (float64)";case V.FLOAT:return"number (float32)";case V.FIXED32:case V.UINT32:return"number (uint32)";case V.INT32:case V.SFIXED32:case V.SINT32:return"number (int32)"}}function l0(e){return md(e.$typeName)}function qr(e){const t=e.fields[0];return md(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function md(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const u0=999,d0=998,Si=2;function qe(e,t){if(Js(t,e))return t;const r=m0(e);return t!==void 0&&h0(e,r,t),r}function h0(e,t,r){for(const i of e.members){let n=r[i.localName];if(n==null)continue;let a;if(i.kind=="oneof"){const d=Ju(r,i);if(!d)continue;a=d,n=ju(r,d)}else a=i;switch(a.fieldKind){case"message":n=ro(a,n);break;case"scalar":n=vd(a,n);break;case"list":n=p0(a,n);break;case"map":n=f0(a,n);break}zu(t,a,n)}return t}function vd(e,t){return e.scalar==V.BYTES?io(t):t}function f0(e,t){if(Et(t)){if(e.scalar==V.BYTES)return tc(t,io);if(e.mapKind=="message")return tc(t,r=>ro(e,r))}return t}function p0(e,t){if(Array.isArray(t)){if(e.scalar==V.BYTES)return t.map(io);if(e.listKind=="message")return t.map(r=>ro(e,r))}return t}function ro(e,t){if(e.fieldKind=="message"&&!e.oneof&&qr(e.message))return vd(e.message.fields[0],t);if(Et(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!Js(t,e.message))return qe(e.message,t)}return t}function io(e){return Array.isArray(e)?new Uint8Array(e):e}function tc(e,t){const r={};for(const i of Object.entries(e))r[i[0]]=t(i[1]);return r}const g0=Symbol(),rc=new WeakMap;function m0(e){let t;if(v0(e)){const r=rc.get(e);let i,n;if(r)({prototype:i,members:n}=r);else{i={},n=new Set;for(const a of e.members)a.kind!="oneof"&&(a.fieldKind!="scalar"&&a.fieldKind!="enum"||a.presence!=Si&&(n.add(a),i[a.localName]=In(a)));rc.set(e,{prototype:i,members:n})}t=Object.create(i),t.$typeName=e.typeName;for(const a of e.members)n.has(a)||a.kind=="field"&&(a.fieldKind=="message"||(a.fieldKind=="scalar"||a.fieldKind=="enum")&&a.presence!=Si)||(t[a.localName]=In(a))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==Si)&&(t[r.localName]=In(r))}return t}function v0(e){switch(e.file.edition){case u0:return!1;case d0:return!0;default:return e.fields.some(t=>t.presence!=Si&&t.fieldKind!="message"&&!t.oneof)}}function In(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return g0;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?$t(e.scalar,e.longAsString):e.enum.values[0].number}function je(e,t,r=!0){return new bd(e,t,r)}class bd{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,i)=>r.number-i.number)}constructor(t,r,i=!0){this.lists=new Map,this.maps=new Map,this.check=i,this.desc=t,this.message=this[lt]=r??qe(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return br(this.message,t),Ju(this.message,t)}isSet(t){return br(this.message,t),Cv(this.message,t)}clear(t){br(this.message,t),kv(this.message,t)}get(t){br(this.message,t);const r=ju(this.message,t);switch(t.fieldKind){case"list":let i=this.lists.get(t);return(!i||i[lt]!==r)&&this.lists.set(t,i=new b0(t,r,this.check)),i;case"map":let n=this.maps.get(t);return(!n||n[lt]!==r)&&this.maps.set(t,n=new _0(t,r,this.check)),n;case"message":return so(t,r,this.check);case"scalar":return r===void 0?$t(t.scalar,!1):oo(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(br(this.message,t),this.check){const n=Lt(t,r);if(n)throw n}let i;t.fieldKind=="message"?i=no(t,r):zs(r)||js(r)?i=r[lt]:i=ao(t,r),zu(this.message,t,i)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function br(e,t){if(t.parent.typeName!==e.$typeName)throw new Pe(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class b0{field(){return this._field}get size(){return this._arr.length}constructor(t,r,i){this._field=t,this._arr=this[lt]=r,this.check=i}get(t){const r=this._arr[t];return r===void 0?void 0:An(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Pe(this._field,`list item #${t+1}: out of range`);if(this.check){const i=ec(this._field,t,r);if(i)throw i}this._arr[t]=ic(this._field,r)}add(t){if(this.check){const r=ec(this._field,this._arr.length,t);if(r)throw r}this._arr.push(ic(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield An(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,An(this._field,this._arr[t],this.check)]}}class _0{constructor(t,r,i=!0){this.obj=this[lt]=r??{},this.check=i,this._field=t}field(){return this._field}set(t,r){if(this.check){const i=a0(this._field,t,r);if(i)throw i}return this.obj[di(t)]=y0(this._field,r),this}delete(t){const r=di(t),i=Object.prototype.hasOwnProperty.call(this.obj,r);return i&&delete this.obj[r],i}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[di(t)];return r!==void 0&&(r=Nn(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,di(t))}*keys(){for(const t of Object.keys(this.obj))yield nc(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[nc(t[0],this._field.mapKey),Nn(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Nn(this._field,t,this.check)}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}}function no(e,t){return Qs(t)?l0(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?yd(t.message):t.message:t}function so(e,t,r){return t!==void 0&&(qr(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:oo(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Et(t)&&(t=_d(t))),new bd(e.message,t,r)}function ic(e,t){return e.listKind=="message"?no(e,t):ao(e,t)}function An(e,t,r){return e.listKind=="message"?so(e,t,r):oo(e,t)}function y0(e,t){return e.mapKind=="message"?no(e,t):ao(e,t)}function Nn(e,t,r){return e.mapKind=="message"?so(e,t,r):t}function di(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function nc(e,t){switch(t){case V.STRING:return e;case V.INT32:case V.FIXED32:case V.UINT32:case V.SFIXED32:case V.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case V.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case V.UINT64:case V.FIXED64:try{return he.uParse(e)}catch{}break;default:try{return he.parse(e)}catch{}break}return e}function oo(e,t){switch(e.scalar){case V.INT64:case V.SFIXED64:case V.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=he.parse(t));break;case V.FIXED64:case V.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=he.uParse(t));break}return t}function ao(e,t){switch(e.scalar){case V.INT64:case V.SFIXED64:case V.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=he.parse(t));break;case V.FIXED64:case V.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=he.uParse(t));break}return t}function _d(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Et(e))for(const[r,i]of Object.entries(e))t.fields[r]=Ed(i);return t}function yd(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=Sd(i);return t}function Sd(e){switch(e.kind.case){case"structValue":return yd(e.kind.value);case"listValue":return e.kind.value.values.map(Sd);case"nullValue":case void 0:return null;default:return e.kind.value}}function Ed(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const i of e)r.values.push(Ed(i));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:_d(e)};break}return t}const S0=3,sc={writeUnknownFields:!0};function E0(e){return e?Object.assign(Object.assign({},sc),e):sc}function w0(e,t,r){return Oi(new dd,E0(r),je(e,t)).finish()}function Oi(e,t,r){var i;for(const n of r.sortedFields){if(!r.isSet(n)){if(n.presence==S0)throw new Error(`cannot encode ${n} to binary: required field not set`);continue}wd(e,t,r,n)}if(t.writeUnknownFields)for(const{no:n,wireType:a,data:d}of(i=r.getUnknown())!==null&&i!==void 0?i:[])e.tag(n,a).raw(d);return e}function wd(e,t,r,i){var n;switch(i.fieldKind){case"scalar":case"enum":Fi(e,r.desc.typeName,i.name,(n=i.scalar)!==null&&n!==void 0?n:V.INT32,i.number,r.get(i));break;case"list":C0(e,t,i,r.get(i));break;case"message":Cd(e,t,i,r.get(i));break;case"map":for(const[a,d]of r.get(i))k0(e,t,i,a,d);break}}function Fi(e,t,r,i,n,a){kd(e.tag(n,I0(i)),t,r,i,a)}function Cd(e,t,r,i){r.delimitedEncoding?Oi(e.tag(r.number,Se.StartGroup),t,i).tag(r.number,Se.EndGroup):Oi(e.tag(r.number,Se.LengthDelimited).fork(),t,i).join()}function C0(e,t,r,i){var n;if(r.listKind=="message"){for(const d of i)Cd(e,t,r,d);return}const a=(n=r.scalar)!==null&&n!==void 0?n:V.INT32;if(r.packed){if(!i.size)return;e.tag(r.number,Se.LengthDelimited).fork();for(const d of i)kd(e,r.parent.typeName,r.name,a,d);e.join();return}for(const d of i)Fi(e,r.parent.typeName,r.name,a,r.number,d)}function k0(e,t,r,i,n){var a;switch(e.tag(r.number,Se.LengthDelimited).fork(),Fi(e,r.parent.typeName,r.name,r.mapKey,1,i),r.mapKind){case"scalar":case"enum":Fi(e,r.parent.typeName,r.name,(a=r.scalar)!==null&&a!==void 0?a:V.INT32,2,n);break;case"message":Oi(e.tag(2,Se.LengthDelimited).fork(),t,n).join();break}e.join()}function kd(e,t,r,i,n){try{switch(i){case V.STRING:e.string(n);break;case V.BOOL:e.bool(n);break;case V.DOUBLE:e.double(n);break;case V.FLOAT:e.float(n);break;case V.INT32:e.int32(n);break;case V.INT64:e.int64(n);break;case V.UINT64:e.uint64(n);break;case V.FIXED64:e.fixed64(n);break;case V.BYTES:e.bytes(n);break;case V.FIXED32:e.fixed32(n);break;case V.SFIXED32:e.sfixed32(n);break;case V.SFIXED64:e.sfixed64(n);break;case V.SINT64:e.sint64(n);break;case V.UINT32:e.uint32(n);break;case V.SINT32:e.sint32(n);break}}catch(a){throw a instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${a.message}`):a}}function I0(e){switch(e){case V.BYTES:case V.STRING:return Se.LengthDelimited;case V.DOUBLE:case V.FIXED64:case V.SFIXED64:return Se.Bit64;case V.FIXED32:case V.SFIXED32:case V.FLOAT:return Se.Bit32;default:return Se.Varint}}function Gt(e,t,...r){return r.reduce((i,n)=>i.nestedMessages[n],e.messages[t])}function A0(e,t,...r){if(r.length==0)return e.enums[t];const i=r.pop();return r.reduce((n,a)=>n.nestedMessages[a],e.messages[t]).nestedEnums[i]}function N0(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const T0=Qv({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),R0=Gt(T0,1);var oc;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(oc||(oc={}));var ac;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(ac||(ac={}));var cc;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(cc||(cc={}));var lc;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(lc||(lc={}));var uc;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(uc||(uc={}));var dc;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(dc||(dc={}));var hc;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(hc||(hc={}));var fc;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(fc||(fc={}));var pc;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(pc||(pc={}));var gc;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(gc||(gc={}));var mc;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(mc||(mc={}));var vc;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(vc||(vc={}));var bc;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(bc||(bc={}));var _c;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(_c||(_c={}));var yc;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(yc||(yc={}));var Sc;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Sc||(Sc={}));var Ec;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(Ec||(Ec={}));var wc;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(wc||(wc={}));var Cc;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(Cc||(Cc={}));var kc;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(kc||(kc={}));const Ic={readUnknownFields:!0};function B0(e){return e?Object.assign(Object.assign({},Ic),e):Ic}function Id(e,t,r){const i=je(e,void 0,!1);return Ad(i,new eo(t),B0(r),!1,t.byteLength),i.message}function Ad(e,t,r,i,n){var a;const d=i?t.len:t.pos+n;let s,o;const c=(a=e.getUnknown())!==null&&a!==void 0?a:[];for(;t.pos<d&&([s,o]=t.tag(),!(i&&o==Se.EndGroup));){const g=e.findNumber(s);if(!g){const f=t.skip(o,s);r.readUnknownFields&&c.push({no:s,wireType:o,data:f});continue}Nd(e,t,g,o,r)}if(i&&(o!=Se.EndGroup||s!==n))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function Nd(e,t,r,i,n){var a;switch(r.fieldKind){case"scalar":e.set(r,cr(t,r.scalar));break;case"enum":const d=cr(t,V.INT32);if(r.enum.open)e.set(r,d);else if(r.enum.values.some(o=>o.number===d))e.set(r,d);else if(n.readUnknownFields){const o=[];es(d,o);const c=(a=e.getUnknown())!==null&&a!==void 0?a:[];c.push({no:r.number,wireType:i,data:new Uint8Array(o)}),e.setUnknown(c)}break;case"message":e.set(r,co(t,n,r,e.get(r)));break;case"list":x0(t,i,e.get(r),n);break;case"map":L0(t,e.get(r),n);break}}function L0(e,t,r){const i=t.field();let n,a;const d=e.uint32(),s=e.pos+d;for(;e.pos<s;){const[o]=e.tag();switch(o){case 1:n=cr(e,i.mapKey);break;case 2:switch(i.mapKind){case"scalar":a=cr(e,i.scalar);break;case"enum":a=e.int32();break;case"message":a=co(e,r,i);break}break}}if(n===void 0&&(n=$t(i.mapKey,!1)),a===void 0)switch(i.mapKind){case"scalar":a=$t(i.scalar,!1);break;case"enum":a=i.enum.values[0].number;break;case"message":a=je(i.message,void 0,!1);break}t.set(n,a)}function x0(e,t,r,i){var n;const a=r.field();if(a.listKind==="message"){r.add(co(e,i,a));return}const d=(n=a.scalar)!==null&&n!==void 0?n:V.INT32;if(!(t==Se.LengthDelimited&&d!=V.STRING&&d!=V.BYTES)){r.add(cr(e,d));return}const o=e.uint32()+e.pos;for(;e.pos<o;)r.add(cr(e,d))}function co(e,t,r,i){const n=r.delimitedEncoding,a=i??je(r.message,void 0,!1);return Ad(a,e,t,n,n?r.number:e.uint32()),a}function cr(e,t){switch(t){case V.STRING:return e.string();case V.BOOL:return e.bool();case V.DOUBLE:return e.double();case V.FLOAT:return e.float();case V.INT32:return e.int32();case V.INT64:return e.int64();case V.UINT64:return e.uint64();case V.FIXED64:return e.fixed64();case V.BYTES:return e.bytes();case V.FIXED32:return e.fixed32();case V.SFIXED32:return e.sfixed32();case V.SFIXED64:return e.sfixed64();case V.SINT64:return e.sint64();case V.UINT32:return e.uint32();case V.SINT32:return e.sint32()}}function It(e,t){var r;const i=Id(R0,nd(e));return i.messageType.forEach(Ys),i.dependency=(r=t==null?void 0:t.map(a=>a.proto.name))!==null&&r!==void 0?r:[],Qu(i,a=>t==null?void 0:t.find(d=>d.proto.name===a)).getFile(i.name)}const D0=It("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),O0=A0(D0,0),F0=N0(O0),V0=It("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),U0=It("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),M0=Gt(U0,0);function P0(e,t,r){let i=!1;return r||(r=qe(M0),i=!0),r.value=w0(e,t),r.typeUrl=H0(t.$typeName),i?r:void 0}function W0(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,i=Td(e.typeUrl);return r===i}function $0(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(Td(e.typeUrl));if(!(!r||!W0(e,r)))return Id(r,e.value)}function H0(e){return`type.googleapis.com/${e}`}function Td(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const lo=It("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),G0=Gt(lo,0),Rd=Gt(lo,1),Z0=Gt(lo,2);var ss;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(ss||(ss={}));const K0=It("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Y0=It("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),X0=It("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[K0,Y0]),Bd=It("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[V0,X0]),os=Gt(Bd,3),J0=Gt(Bd,4);function j0(e,t){Ld(t,e);const r=Q0(e.$unknown,t),[i,n,a]=zi(t);for(const d of r)Nd(i,new eo(d.data),n,d.wireType,{readUnknownFields:!0});return a()}function z0(e,t,r){var i;Ld(t,e);const n=((i=e.$unknown)!==null&&i!==void 0?i:[]).filter(c=>c.no!==t.number),[a,d]=zi(t,r),s=new dd;wd(s,{writeUnknownFields:!0},a,d);const o=new eo(s.finish());for(;o.pos<o.len;){const[c,g]=o.tag(),f=o.skip(g,c);n.push({no:c,wireType:g,data:f})}e.$unknown=n}function Q0(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function zi(e,t){const r=e.typeName,i=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),n=Object.assign(Object.assign({},e.extendee),{fields:[i],members:[i],oneofs:[]}),a=qe(n,t!==void 0?{[r]:t}:void 0);return[je(n,a),i,()=>{const d=a[r];if(d===void 0){const s=e.message;return qr(s)?$t(s.fields[0].scalar,s.fields[0].longAsString):qe(s)}return d}]}function Ld(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const q0=3,eb=2,Ac={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function tb(e){return e?Object.assign(Object.assign({},Ac),e):Ac}function rb(e,t,r){return ei(je(e,t),tb(r))}function ei(e,t){var r;const i=ob(e,t);if(i!==void 0)return i;const n={};for(const a of e.sortedFields){if(!e.isSet(a)){if(a.presence==q0)throw new Error(`cannot encode ${a} to JSON: required field not set`);if(!t.alwaysEmitImplicit||a.presence!==eb)continue}const d=Nc(a,e.get(a),t);d!==void 0&&(n[sb(a,t)]=d)}if(t.registry){const a=new Set;for(const{no:d}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!a.has(d)){a.add(d);const s=t.registry.getExtensionFor(e.desc,d);if(!s)continue;const o=j0(e.message,s),[c,g]=zi(s,o),f=Nc(g,c.get(g),t);f!==void 0&&(n[s.jsonName]=f)}}return n}function Nc(e,t,r){switch(e.fieldKind){case"scalar":return Qi(e,t);case"message":return ei(t,r);case"enum":return uo(e.enum,t,r.enumAsInteger);case"list":return nb(t,r);case"map":return ib(t,r)}}function ib(e,t){const r=e.field(),i={};switch(r.mapKind){case"scalar":for(const[n,a]of e)i[n]=Qi(r,a);break;case"message":for(const[n,a]of e)i[n]=ei(a,t);break;case"enum":for(const[n,a]of e)i[n]=uo(r.enum,a,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?i:void 0}function nb(e,t){const r=e.field(),i=[];switch(r.listKind){case"scalar":for(const n of e)i.push(Qi(r,n));break;case"enum":for(const n of e)i.push(uo(r.enum,n,t.enumAsInteger));break;case"message":for(const n of e)i.push(ei(n,t));break}return t.alwaysEmitImplicit||i.length>0?i:void 0}function uo(e,t,r){var i;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${Ne(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const n=e.value[t];return(i=n==null?void 0:n.name)!==null&&i!==void 0?i:t}function Qi(e,t){var r,i,n,a,d,s;switch(e.scalar){case V.INT32:case V.SFIXED32:case V.SINT32:case V.FIXED32:case V.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=Lt(e,t))===null||r===void 0?void 0:r.message}`);return t;case V.FLOAT:case V.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(i=Lt(e,t))===null||i===void 0?void 0:i.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case V.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(n=Lt(e,t))===null||n===void 0?void 0:n.message}`);return t;case V.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(a=Lt(e,t))===null||a===void 0?void 0:a.message}`);return t;case V.UINT64:case V.FIXED64:case V.INT64:case V.SFIXED64:case V.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(d=Lt(e,t))===null||d===void 0?void 0:d.message}`);return t.toString();case V.BYTES:if(t instanceof Uint8Array)return r0(t);throw new Error(`cannot encode ${e} to JSON: ${(s=Lt(e,t))===null||s===void 0?void 0:s.message}`)}}function sb(e,t){return t.useProtoFieldName?e.name:e.jsonName}function ob(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return ab(e.message,t);case"google.protobuf.Timestamp":return ub(e.message);case"google.protobuf.Duration":return cb(e.message);case"google.protobuf.FieldMask":return lb(e.message);case"google.protobuf.Struct":return xd(e.message);case"google.protobuf.Value":return ho(e.message);case"google.protobuf.ListValue":return Dd(e.message);default:if(qr(e.desc)){const r=e.desc.fields[0];return Qi(r,e.get(r))}return}}function ab(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let i,n;if(r&&(i=$0(e,r),i&&(n=r.getMessage(i.$typeName))),!n||!i)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let a=ei(je(n,i),t);return(n.typeName.startsWith("google.protobuf.")||a===null||Array.isArray(a)||typeof a!="object")&&(a={value:a}),a["@type"]=e.typeUrl,a}function cb(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function lb(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Pr(t)}).join(",")}function xd(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=ho(i);return t}function ho(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return xd(e.kind.value);case"listValue":return Dd(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function Dd(e){return e.values.map(ho)}function ub(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const Tc={ignoreUnknownFields:!1};function db(e){return e?Object.assign(Object.assign({},Tc),e):Tc}function hb(e,t,r){const i=je(e);try{lr(i,t,db(r))}catch(n){throw s0(n)?new Error(`cannot decode ${n.field()} from JSON: ${n.message}`,{cause:n}):n}return i.message}function lr(e,t,r){var i;if(_b(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${Ne(t)}`);const n=new Map,a=new Map;for(const d of e.desc.fields)a.set(d.name,d).set(d.jsonName,d);for(const[d,s]of Object.entries(t)){const o=a.get(d);if(o){if(o.oneof){if(s===null&&o.fieldKind=="scalar")continue;const c=n.get(o.oneof);if(c!==void 0)throw new Pe(o.oneof,`oneof set multiple times by ${c.name} and ${o.name}`);n.set(o.oneof,o)}Rc(e,o,s,r)}else{let c;if(d.startsWith("[")&&d.endsWith("]")&&(c=(i=r.registry)===null||i===void 0?void 0:i.getExtension(d.substring(1,d.length-1)))&&c.extendee.typeName===e.desc.typeName){const[g,f,m]=zi(c);Rc(g,f,s,r),z0(e.message,c,m())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${d}" is unknown`)}}}function Rc(e,t,r,i){switch(t.fieldKind){case"scalar":vb(e,t,r);break;case"enum":mb(e,t,r,i);break;case"message":gb(e,t,r,i);break;case"list":pb(e.get(t),r,i);break;case"map":fb(e.get(t),r,i);break}}function fb(e,t,r){if(t===null)return;const i=e.field();if(typeof t!="object"||Array.isArray(t))throw new Pe(i,"expected object, got "+Ne(t));for(const[n,a]of Object.entries(t)){if(a===null)throw new Pe(i,"map value must not be null");let d;switch(i.mapKind){case"message":const o=je(i.message);lr(o,a,r),d=o;break;case"enum":if(d=fo(i.enum,a,r.ignoreUnknownFields,!0),d===qi)return;break;case"scalar":d=tn(i,a,!0);break}const s=bb(i.mapKey,n);e.set(s,d)}}function pb(e,t,r){if(t===null)return;const i=e.field();if(!Array.isArray(t))throw new Pe(i,"expected Array, got "+Ne(t));for(const n of t){if(n===null)throw new Pe(i,"list item must not be null");switch(i.listKind){case"message":const a=je(i.message);lr(a,n,r),e.add(a);break;case"enum":const d=fo(i.enum,n,r.ignoreUnknownFields,!0);d!==qi&&e.add(d);break;case"scalar":e.add(tn(i,n,!0));break}}}function gb(e,t,r,i){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const n=e.isSet(t)?e.get(t):je(t.message);lr(n,r,i),e.set(t,n)}function mb(e,t,r,i){const n=fo(t.enum,r,i.ignoreUnknownFields,!1);n===en?e.clear(t):n!==qi&&e.set(t,n)}function vb(e,t,r){const i=tn(t,r,!1);i===en?e.clear(t):e.set(t,i)}const qi=Symbol();function fo(e,t,r,i){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:i?e.values[0].number:en;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const n=e.values.find(a=>a.name===t);if(n!==void 0)return n.number;if(r)return qi;break}throw new Error(`cannot decode ${e} from JSON: ${Ne(t)}`)}const en=Symbol();function tn(e,t,r){if(t===null)return r?$t(e.scalar,!1):en;switch(e.scalar){case V.DOUBLE:case V.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Pe(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Pe(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const i=Number(t);if(!Number.isFinite(i))break;return i}break;case V.INT32:case V.FIXED32:case V.SFIXED32:case V.SINT32:case V.UINT32:return Od(t);case V.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return nd(t)}catch(i){const n=i instanceof Error?i.message:String(i);throw new Pe(e,n)}}break}return t}function bb(e,t){switch(e){case V.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case V.INT32:case V.FIXED32:case V.UINT32:case V.SFIXED32:case V.SINT32:return Od(t);default:return t}}function Od(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function _b(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return yb(e.message,t,r),!0;case"google.protobuf.Timestamp":return Sb(e.message,t),!0;case"google.protobuf.Duration":return Eb(e.message,t),!0;case"google.protobuf.FieldMask":return wb(e.message,t),!0;case"google.protobuf.Struct":return Fd(e.message,t),!0;case"google.protobuf.Value":return po(e.message,t),!0;case"google.protobuf.ListValue":return Vd(e.message,t),!0;default:if(qr(e.desc)){const i=e.desc.fields[0];return t===null?e.clear(i):e.set(i,tn(i,t,!0)),!0}return!1}}function yb(e,t,r){var i;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${Ne(t)}`);if(Object.keys(t).length==0)return;const n=t["@type"];if(typeof n!="string"||n=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const a=n.includes("/")?n.substring(n.lastIndexOf("/")+1):n;if(!a.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const d=(i=r.registry)===null||i===void 0?void 0:i.getMessage(a);if(!d)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${n} is not in the type registry`);const s=je(d);if(a.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const o=t.value;lr(s,o,r)}else{const o=Object.assign({},t);delete o["@type"],lr(s,o,r)}P0(s.desc,s.message,e)}function Sb(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ne(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=he.parse(i/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function Eb(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ne(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ne(t)}`);const i=Number(r[1]);if(i>315576e6||i<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ne(t)}`);if(e.seconds=he.parse(i),typeof r[2]!="string")return;const n=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(n),(i<0||Object.is(i,-0))&&(e.nanos=-e.nanos)}function wb(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${Ne(t)}`);if(t==="")return;function r(i){if(i.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const n=i.replace(/[A-Z]/g,a=>"_"+a.toLowerCase());return n[0]==="_"?n.substring(1):n}e.paths=t.split(",").map(r)}function Fd(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ne(t)}`);for(const[r,i]of Object.entries(t)){const n=qe(Rd);po(n,i),e.fields[r]=n}}function po(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:ss.NULL_VALUE};else if(Array.isArray(t)){const r=qe(Z0);Vd(r,t),e.kind={case:"listValue",value:r}}else{const r=qe(G0);Fd(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ne(t)}`)}return e}function Vd(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${Ne(t)}`);for(const r of t){const i=qe(Rd);po(i,r),e.values.push(i)}}var as=function(e,t){return as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},as(e,t)};function At(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");as(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Cb(e,t,r,i){function n(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function s(g){try{c(i.next(g))}catch(f){d(f)}}function o(g){try{c(i.throw(g))}catch(f){d(f)}}function c(g){g.done?a(g.value):n(g.value).then(s,o)}c((i=i.apply(e,t||[])).next())})}function Ud(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,d=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return d.next=s(0),d.throw=s(1),d.return=s(2),typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function s(c){return function(g){return o([c,g])}}function o(c){if(i)throw new TypeError("Generator is already executing.");for(;d&&(d=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(a=c[0]&2?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(g){c=[6,g],n=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ur(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ht(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,a=[],d;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){d={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(d)throw d.error}}return a}function wt(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}function Qt(e){return this instanceof Qt?(this.v=e,this):new Qt(e)}function kb(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",d),n[Symbol.asyncIterator]=function(){return this},n;function d(_){return function(w){return Promise.resolve(w).then(_,f)}}function s(_,w){i[_]&&(n[_]=function(v){return new Promise(function(l,h){a.push([_,v,l,h])>1||o(_,v)})},w&&(n[_]=w(n[_])))}function o(_,w){try{c(i[_](w))}catch(v){m(a[0][3],v)}}function c(_){_.value instanceof Qt?Promise.resolve(_.value.v).then(g,f):m(a[0][2],_)}function g(_){o("next",_)}function f(_){o("throw",_)}function m(_,w){_(w),a.shift(),a.length&&o(a[0][0],a[0][1])}}function Ib(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof ur=="function"?ur(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(a){r[a]=e[a]&&function(d){return new Promise(function(s,o){d=e[a](d),n(s,o,d.done,d.value)})}}function n(a,d,s,o){Promise.resolve(o).then(function(c){a({value:c,done:s})},d)}}function ae(e){return typeof e=="function"}function Md(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Tn=Md(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
2138
+ `+r.map(function(i,n){return n+1+") "+i.toString()}).join(`
2139
+ `):"",this.name="UnsubscriptionError",this.errors=r}});function Vi(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ti=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,a;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var s=ur(d),o=s.next();!o.done;o=s.next()){var c=o.value;c.remove(this)}}catch(v){t={error:v}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else d.remove(this);var g=this.initialTeardown;if(ae(g))try{g()}catch(v){a=v instanceof Tn?v.errors:[v]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var m=ur(f),_=m.next();!_.done;_=m.next()){var w=_.value;try{Bc(w)}catch(v){a=a??[],v instanceof Tn?a=wt(wt([],ht(a)),ht(v.errors)):a.push(v)}}}catch(v){i={error:v}}finally{try{_&&!_.done&&(n=m.return)&&n.call(m)}finally{if(i)throw i.error}}}if(a)throw new Tn(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Bc(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Vi(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Vi(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Pd=ti.EMPTY;function Wd(e){return e instanceof ti||e&&"closed"in e&&ae(e.remove)&&ae(e.add)&&ae(e.unsubscribe)}function Bc(e){ae(e)?e():e.unsubscribe()}var Ab={Promise:void 0},Nb={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,wt([e,t],ht(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function $d(e){Nb.setTimeout(function(){throw e})}function Gr(){}function Ei(e){e()}var go=(function(e){At(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Wd(r)&&r.add(i)):i.destination=Bb,i}return t.create=function(r,i,n){return new Zr(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(ti),Tb=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){hi(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){hi(i)}else hi(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){hi(r)}},e})(),Zr=(function(e){At(t,e);function t(r,i,n){var a=e.call(this)||this,d;return ae(r)||!r?d={next:r??void 0,error:i??void 0,complete:n??void 0}:d=r,a.destination=new Tb(d),a}return t})(go);function hi(e){$d(e)}function Rb(e){throw e}var Bb={closed:!0,next:Gr,error:Rb,complete:Gr},mo=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function rn(e){return e}function Lb(e){return e.length===0?rn:e.length===1?e[0]:function(r){return e.reduce(function(i,n){return n(i)},r)}}var Ce=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,a=Db(t)?t:new Zr(t,r,i);return Ei(function(){var d=n,s=d.operator,o=d.source;a.add(s?s.call(a,o):o?n._subscribe(a):n._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Lc(r),new r(function(n,a){var d=new Zr({next:function(s){try{t(s)}catch(o){a(o),d.unsubscribe()}},error:a,complete:n});i.subscribe(d)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[mo]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Lb(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Lc(t),new t(function(i,n){var a;r.subscribe(function(d){return a=d},function(d){return n(d)},function(){return i(a)})})},e.create=function(t){return new e(t)},e})();function Lc(e){var t;return(t=e??Ab.Promise)!==null&&t!==void 0?t:Promise}function xb(e){return e&&ae(e.next)&&ae(e.error)&&ae(e.complete)}function Db(e){return e&&e instanceof go||xb(e)&&Wd(e)}function Ob(e){return ae(e==null?void 0:e.lift)}function Fe(e){return function(t){if(Ob(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function we(e,t,r,i,n){return new Fb(e,t,r,i,n)}var Fb=(function(e){At(t,e);function t(r,i,n,a,d,s){var o=e.call(this,r)||this;return o.onFinalize=d,o.shouldUnsubscribe=s,o._next=i?function(c){try{i(c)}catch(g){r.error(g)}}:e.prototype._next,o._error=a?function(c){try{a(c)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=n?function(){try{n()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,o}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(go),Vb=Md(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Xe=(function(e){At(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new xc(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new Vb},t.prototype.next=function(r){var i=this;Ei(function(){var n,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=ur(i.currentObservers),s=d.next();!s.done;s=d.next()){var o=s.value;o.next(r)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(a=d.return)&&a.call(d)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;Ei(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;Ei(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,a=n.hasError,d=n.isStopped,s=n.observers;return a||d?Pd:(this.currentObservers=null,s.push(r),new ti(function(){i.currentObservers=null,Vi(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,a=i.thrownError,d=i.isStopped;n?r.error(a):d&&r.complete()},t.prototype.asObservable=function(){var r=new Ce;return r.source=this,r},t.create=function(r,i){return new xc(r,i)},t})(Ce),xc=(function(e){At(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Pd},t})(Xe),Ub={now:function(){return Date.now()}},Mb=(function(e){At(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(ti),Dc={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,wt([e,t],ht(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Pb=(function(e){At(t,e);function t(r,i){var n=e.call(this,r,i)||this;return n.scheduler=r,n.work=i,n.pending=!1,n}return t.prototype.schedule=function(r,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var a=this.id,d=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(d,a,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(d,this.id,i),this},t.prototype.requestAsyncId=function(r,i,n){return n===void 0&&(n=0),Dc.setInterval(r.flush.bind(r,this),n)},t.prototype.recycleAsyncId=function(r,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&Dc.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(r,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var n=!1,a;try{this.work(r)}catch(d){n=!0,a=d||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),a},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,n=r.scheduler,a=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Vi(a,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Mb),Oc=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=Ub.now,e})(),Wb=(function(e){At(t,e);function t(r,i){i===void 0&&(i=Oc.now);var n=e.call(this,r,i)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var n;this._active=!0;do if(n=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,n){for(;r=i.shift();)r.unsubscribe();throw n}},t})(Oc),nn=new Wb(Pb),$b=nn,Hd=new Ce(function(e){return e.complete()});function Gd(e){return e&&ae(e.schedule)}function vo(e){return e[e.length-1]}function Hb(e){return ae(vo(e))?e.pop():void 0}function Zd(e){return Gd(vo(e))?e.pop():void 0}function Gb(e,t){return typeof vo(e)=="number"?e.pop():t}var bo=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Kd(e){return ae(e==null?void 0:e.then)}function Yd(e){return ae(e[mo])}function Xd(e){return Symbol.asyncIterator&&ae(e==null?void 0:e[Symbol.asyncIterator])}function Jd(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Zb(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var jd=Zb();function zd(e){return ae(e==null?void 0:e[jd])}function Qd(e){return kb(this,arguments,function(){var r,i,n,a;return Ud(this,function(d){switch(d.label){case 0:r=e.getReader(),d.label=1;case 1:d.trys.push([1,,9,10]),d.label=2;case 2:return[4,Qt(r.read())];case 3:return i=d.sent(),n=i.value,a=i.done,a?[4,Qt(void 0)]:[3,5];case 4:return[2,d.sent()];case 5:return[4,Qt(n)];case 6:return[4,d.sent()];case 7:return d.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function qd(e){return ae(e==null?void 0:e.getReader)}function Re(e){if(e instanceof Ce)return e;if(e!=null){if(Yd(e))return Kb(e);if(bo(e))return Yb(e);if(Kd(e))return Xb(e);if(Xd(e))return eh(e);if(zd(e))return Jb(e);if(qd(e))return jb(e)}throw Jd(e)}function Kb(e){return new Ce(function(t){var r=e[mo]();if(ae(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Yb(e){return new Ce(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Xb(e){return new Ce(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,$d)})}function Jb(e){return new Ce(function(t){var r,i;try{for(var n=ur(e),a=n.next();!a.done;a=n.next()){var d=a.value;if(t.next(d),t.closed)return}}catch(s){r={error:s}}finally{try{a&&!a.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function eh(e){return new Ce(function(t){zb(e,t).catch(function(r){return t.error(r)})})}function jb(e){return eh(Qd(e))}function zb(e,t){var r,i,n,a;return Cb(this,void 0,void 0,function(){var d,s;return Ud(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=Ib(e),o.label=1;case 1:return[4,r.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(d=i.value,t.next(d),t.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=o.sent(),n={error:s},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Mt(e,t,r,i,n){i===void 0&&(i=0),n===void 0&&(n=!1);var a=t.schedule(function(){r(),n?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(a),!n)return a}function th(e,t){return t===void 0&&(t=0),Fe(function(r,i){r.subscribe(we(i,function(n){return Mt(i,e,function(){return i.next(n)},t)},function(){return Mt(i,e,function(){return i.complete()},t)},function(n){return Mt(i,e,function(){return i.error(n)},t)}))})}function rh(e,t){return t===void 0&&(t=0),Fe(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function Qb(e,t){return Re(e).pipe(rh(t),th(t))}function qb(e,t){return Re(e).pipe(rh(t),th(t))}function e_(e,t){return new Ce(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function t_(e,t){return new Ce(function(r){var i;return Mt(r,t,function(){i=e[jd](),Mt(r,t,function(){var n,a,d;try{n=i.next(),a=n.value,d=n.done}catch(s){r.error(s);return}d?r.complete():r.next(a)},0,!0)}),function(){return ae(i==null?void 0:i.return)&&i.return()}})}function ih(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ce(function(r){Mt(r,t,function(){var i=e[Symbol.asyncIterator]();Mt(r,t,function(){i.next().then(function(n){n.done?r.complete():r.next(n.value)})},0,!0)})})}function r_(e,t){return ih(Qd(e),t)}function i_(e,t){if(e!=null){if(Yd(e))return Qb(e,t);if(bo(e))return e_(e,t);if(Kd(e))return qb(e,t);if(Xd(e))return ih(e,t);if(zd(e))return t_(e,t);if(qd(e))return r_(e,t)}throw Jd(e)}function nh(e,t){return t?i_(e,t):Re(e)}function n_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Zd(e);return nh(e,r)}function s_(e){return e instanceof Date&&!isNaN(e)}function Ke(e,t){return Fe(function(r,i){var n=0;r.subscribe(we(i,function(a){i.next(e.call(t,a,n++))}))})}var o_=Array.isArray;function a_(e,t){return o_(t)?e.apply(void 0,wt([],ht(t))):e(t)}function c_(e){return Ke(function(t){return a_(e,t)})}function l_(e,t,r,i,n,a,d,s){var o=[],c=0,g=0,f=!1,m=function(){f&&!o.length&&!c&&t.complete()},_=function(v){return c<i?w(v):o.push(v)},w=function(v){c++;var l=!1;Re(r(v,g++)).subscribe(we(t,function(h){t.next(h)},function(){l=!0},void 0,function(){if(l)try{c--;for(var h=function(){var u=o.shift();d||w(u)};o.length&&c<i;)h();m()}catch(u){t.error(u)}}))};return e.subscribe(we(t,_,function(){f=!0,m()})),function(){}}function Ft(e,t,r){return r===void 0&&(r=1/0),ae(t)?Ft(function(i,n){return Ke(function(a,d){return t(i,a,n,d)})(Re(e(i,n)))},r):(typeof t=="number"&&(r=t),Fe(function(i,n){return l_(i,n,e,r)}))}function u_(e){return e===void 0&&(e=1/0),Ft(rn,e)}function d_(e){return new Ce(function(t){Re(e()).subscribe(t)})}var h_={connector:function(){return new Xe},resetOnDisconnect:!0};function Rt(e,t){t===void 0&&(t=h_);var r=null,i=t.connector,n=t.resetOnDisconnect,a=n===void 0?!0:n,d=i(),s=new Ce(function(o){return d.subscribe(o)});return s.connect=function(){return(!r||r.closed)&&(r=d_(function(){return e}).subscribe(d),a&&r.add(function(){return d=i()})),r},s}var f_=["addListener","removeListener"],p_=["addEventListener","removeEventListener"],g_=["on","off"];function cs(e,t,r,i){if(ae(r)&&(i=r,r=void 0),i)return cs(e,t,r).pipe(c_(i));var n=ht(b_(e)?p_.map(function(s){return function(o){return e[s](t,o,r)}}):m_(e)?f_.map(Fc(e,t)):v_(e)?g_.map(Fc(e,t)):[],2),a=n[0],d=n[1];if(!a&&bo(e))return Ft(function(s){return cs(s,t,r)})(Re(e));if(!a)throw new TypeError("Invalid event target");return new Ce(function(s){var o=function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];return s.next(1<c.length?c:c[0])};return a(o),function(){return d(o)}})}function Fc(e,t){return function(r){return function(i){return e[r](t,i)}}}function m_(e){return ae(e.addListener)&&ae(e.removeListener)}function v_(e){return ae(e.on)&&ae(e.off)}function b_(e){return ae(e.addEventListener)&&ae(e.removeEventListener)}function Ir(e,t,r){e===void 0&&(e=0),r===void 0&&(r=$b);var i=-1;return t!=null&&(Gd(t)?r=t:i=t),new Ce(function(n){var a=s_(e)?+e-r.now():e;a<0&&(a=0);var d=0;return r.schedule(function(){n.closed||(n.next(d++),0<=i?this.schedule(void 0,i):n.complete())},a)})}function __(e,t){return t===void 0&&(t=nn),Ir(e,e,t)}function y_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Zd(e),i=Gb(e,1/0),n=e;return n.length?n.length===1?Re(n[0]):u_(i)(nh(n,r)):Hd}var S_=Array.isArray;function E_(e){return e.length===1&&S_(e[0])?e[0]:e}function gt(e,t){return Fe(function(r,i){var n=0;r.subscribe(we(i,function(a){return e.call(t,a,n++)&&i.next(a)}))})}function w_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=E_(e),e.length===1?Re(e[0]):new Ce(C_(e))}function C_(e){return function(t){for(var r=[],i=function(a){r.push(Re(e[a]).subscribe(we(t,function(d){if(r){for(var s=0;s<r.length;s++)s!==a&&r[s].unsubscribe();r=null}t.next(d)})))},n=0;r&&!t.closed&&n<e.length;n++)i(n)}}function k_(e){return Fe(function(t,r){var i=null,n=null,a=function(){n==null||n.unsubscribe();var d=i;i=[],d&&r.next(d),Re(e()).subscribe(n=we(r,a,Gr))};a(),t.subscribe(we(r,function(d){return i==null?void 0:i.push(d)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=n=null}))})}function sh(e){return Fe(function(t,r){var i=null,n=!1,a;i=t.subscribe(we(r,void 0,void 0,function(d){a=Re(e(d,sh(e)(t))),i?(i.unsubscribe(),i=null,a.subscribe(r)):n=!0})),n&&(i.unsubscribe(),i=null,a.subscribe(r))})}function I_(e,t,r,i,n){return function(a,d){var s=r,o=t,c=0;a.subscribe(we(d,function(g){var f=c++;o=s?e(o,g,f):(s=!0,g),d.next(o)},n))}}function Vc(e){return e<=0?function(){return Hd}:Fe(function(t,r){var i=0;t.subscribe(we(r,function(n){++i<=e&&(r.next(n),e<=i&&r.complete())}))})}function A_(e){return Fe(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function N_(e,t){return Fe(I_(e,t,arguments.length>=2,!0))}function T_(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Xe}:t,i=e.resetOnError,n=i===void 0?!0:i,a=e.resetOnComplete,d=a===void 0?!0:a,s=e.resetOnRefCountZero,o=s===void 0?!0:s;return function(c){var g,f,m,_=0,w=!1,v=!1,l=function(){f==null||f.unsubscribe(),f=void 0},h=function(){l(),g=m=void 0,w=v=!1},u=function(){var p=g;h(),p==null||p.unsubscribe()};return Fe(function(p,b){_++,!v&&!w&&l();var E=m=m??r();b.add(function(){_--,_===0&&!v&&!w&&(f=Rn(u,o))}),E.subscribe(b),!g&&_>0&&(g=new Zr({next:function(y){return E.next(y)},error:function(y){v=!0,l(),f=Rn(h,n,y),E.error(y)},complete:function(){w=!0,l(),f=Rn(h,d),E.complete()}}),Re(p).subscribe(g))})(c)}}function Rn(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var n=new Zr({next:function(){n.unsubscribe(),e()}});return Re(t.apply(void 0,wt([],ht(r)))).subscribe(n)}}function R_(e){return Fe(function(t,r){var i=!1,n=we(r,function(){n==null||n.unsubscribe(),i=!0},Gr);Re(e).subscribe(n),t.subscribe(we(r,function(a){return i&&r.next(a)}))})}function Uc(e,t){return Fe(function(r,i){var n=null,a=0,d=!1,s=function(){return d&&!n&&i.complete()};r.subscribe(we(i,function(o){n==null||n.unsubscribe();var c=0,g=a++;Re(e(o,g)).subscribe(n=we(i,function(f){return i.next(t?t(o,f,g,c++):f)},function(){n=null,s()}))},function(){d=!0,s()}))})}function fi(e,t){return t===void 0&&(t=!1),Fe(function(r,i){var n=0;r.subscribe(we(i,function(a){var d=e(a,n++);(d||t)&&i.next(a),!d&&i.complete()}))})}function B_(e,t,r){var i=ae(e)||t||r?{next:e,error:t,complete:r}:e;return i?Fe(function(n,a){var d;(d=i.subscribe)===null||d===void 0||d.call(i);var s=!0;n.subscribe(we(a,function(o){var c;(c=i.next)===null||c===void 0||c.call(i,o),a.next(o)},function(){var o;s=!1,(o=i.complete)===null||o===void 0||o.call(i),a.complete()},function(o){var c;s=!1,(c=i.error)===null||c===void 0||c.call(i,o),a.error(o)},function(){var o,c;s&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(c=i.finalize)===null||c===void 0||c.call(i)}))}):rn}function L_(e,t){return Fe(function(r,i){var n=t??{},a=n.leading,d=a===void 0?!0:a,s=n.trailing,o=s===void 0?!1:s,c=!1,g=null,f=null,m=!1,_=function(){f==null||f.unsubscribe(),f=null,o&&(l(),m&&i.complete())},w=function(){f=null,m&&i.complete()},v=function(h){return f=Re(e(h)).subscribe(we(i,_,w))},l=function(){if(c){c=!1;var h=g;g=null,i.next(h),!m&&v(h)}};r.subscribe(we(i,function(h){c=!0,g=h,!(f&&!f.closed)&&(d?l():v(h))},function(){m=!0,!(o&&c&&f&&!f.closed)&&i.complete()}))})}function Mc(e,t,r){t===void 0&&(t=nn);var i=Ir(e,t);return L_(function(){return i},r)}function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Hb(e);return Fe(function(i,n){for(var a=e.length,d=new Array(a),s=e.map(function(){return!1}),o=!1,c=function(f){Re(e[f]).subscribe(we(n,function(m){d[f]=m,!o&&!s[f]&&(s[f]=!0,(o=s.every(rn))&&(s=null))},Gr))},g=0;g<a;g++)c(g);i.subscribe(we(n,function(f){if(o){var m=wt([f],ht(d));n.next(r?r.apply(void 0,wt([],ht(m))):m)}}))})}const oh="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ui=32,x_=16,ah=10,Pc=0xffffffffffff;var Vt;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(Vt||(Vt={}));class Sr extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function D_(e){const t=Math.floor(e()*Ui)%Ui;return oh.charAt(t)}function O_(e){const t=F_(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const i=new Uint8Array(1);return r.getRandomValues(i),i[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new Sr(Vt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function F_(){return M_()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function V_(e,t){let r="";for(;e>0;e--)r=D_(t)+r;return r}function U_(e,t=ah){if(isNaN(e))throw new Sr(Vt.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Pc)throw new Sr(Vt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Pc}: ${e}`);if(e<0)throw new Sr(Vt.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Sr(Vt.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,i="";for(let n=t;n>0;n--)r=e%Ui,i=oh.charAt(r)+i,e=(e-r)/Ui;return i}function M_(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function P_(e,t){const r=O_(),i=Date.now();return U_(i,ah)+V_(x_,r)}const Le=[];for(let e=0;e<256;++e)Le.push((e+256).toString(16).slice(1));function W_(e,t=0){return(Le[e[t+0]]+Le[e[t+1]]+Le[e[t+2]]+Le[e[t+3]]+"-"+Le[e[t+4]]+Le[e[t+5]]+"-"+Le[e[t+6]]+Le[e[t+7]]+"-"+Le[e[t+8]]+Le[e[t+9]]+"-"+Le[e[t+10]]+Le[e[t+11]]+Le[e[t+12]]+Le[e[t+13]]+Le[e[t+14]]+Le[e[t+15]]).toLowerCase()}let Ln;const $_=new Uint8Array(16);function H_(){if(!Ln){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ln=crypto.getRandomValues.bind(crypto)}return Ln($_)}const G_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wc={randomUUID:G_};function Z_(e,t,r){var n;if(Wc.randomUUID&&!e)return Wc.randomUUID();e=e||{};const i=e.random??((n=e.rng)==null?void 0:n.call(e))??H_();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,W_(i)}const K_=5e3,Y_=1e3,pi=4e3,$c=1e3;var ch=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(ch||{});class X_{constructor({knownID:t,runID:r,sequence:i,options:n}){ce(this,"callback");ce(this,"queue",new Xe);ce(this,"subscriptions",[]);ce(this,"reconnect",new Xe);ce(this,"client",new Ce);ce(this,"_latencies",new Xe);ce(this,"_latenciesConnectable",Rt(this._latencies.asObservable().pipe(N_((t,r)=>{if(r.latency<0){const i=t.get(r.streamID);i&&t.set(r.streamID,{...i,readyState:r.readyState})}else t.set(r.streamID,r);return t},new Map))));ce(this,"_errors",new Xe);ce(this,"_errorsConnectable",Rt(this._errors.asObservable()));ce(this,"_stdout",new Xe);ce(this,"_stderr",new Xe);ce(this,"_exitCode",new Xe);ce(this,"_pid",new Xe);ce(this,"_mimeType",new Xe);ce(this,"_stdoutConnectable",Rt(this._stdout.asObservable()));ce(this,"_stderrConnectable",Rt(this._stderr.asObservable()));ce(this,"_exitCodeConnectable",Rt(this._exitCode.asObservable()));ce(this,"_pidConnectable",Rt(this._pid.asObservable()));ce(this,"_mimeTypeConnectable",Rt(this._mimeType.asObservable()));ce(this,"knownID");ce(this,"runID");ce(this,"sequence");ce(this,"runnerEndpoint");ce(this,"interceptors");ce(this,"autoReconnect");this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=n.runnerEndpoint,this.interceptors=n.interceptors,this.autoReconnect=n.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Mc($c,nn,{leading:!0,trailing:!0}),Uc(a=>this.useSocketClient(a.streamID).pipe(Uc(d=>this.useHeartbeat(d,a))))).pipe(T_()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return __(Y_).pipe(gt(()=>this.autoReconnect),Bn(this.reconnect),gt(([,r])=>r.heartbeat==="CONTINUOUS"),Bn(this.latencies),Ke(([,r])=>Array.from(r.values()).filter(i=>i.readyState===WebSocket.OPEN&&i.latency>=pi)),gt(r=>r.length>0),Mc($c)).subscribe({next:r=>{console.log(new Date,"Triggering reconnect",r),this.connect()},complete:()=>{console.log("Monitor complete")},error:r=>{console.error("Error in monitor",r)}})}process(){const t=this.client.pipe(gt(d=>(d==null?void 0:d.readyState)===WebSocket.OPEN),Vc(1)),r=this.queue.pipe(k_(()=>t),gt(d=>d.length>0),Ke(d=>d.sort((s,o)=>{const c=g=>{var f;return!!((f=g.payload.value)!=null&&f.config)};return c(o)?1:c(s)?-1:0}))),i=this.queue.pipe(R_(t));return y_(r.pipe(Ft(d=>d)),i).pipe(Bn(this.client),fi(([,d])=>d.readyState===WebSocket.OPEN),Ft(async([d,s])=>{await Gc({req:d,interceptors:this.interceptors,socket:s,knownID:this.knownID,runID:this.runID})})).subscribe({error:d=>{this._errors.next(d)}})}useSocketClient(t){return new Ce(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const n=new WebSocket(i.toString()),a=c=>{if(console.log(new Date,`WebSocket transport ${t} closed`,c),c.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},d=c=>{console.log(new Date,`WebSocket transport ${t} error`,c),this.autoReconnect||r.error(c)},s=c=>{var _,w;if(typeof c.data!="string"){console.warn("Unexpected WebSocket message type:",typeof c.data);return}let g;try{g=Hc(c.data),console.log("Received WebsocketResponse:",g)}catch(v){console.error("Failed to parse WebsocketResponse:",v)}const f=g.status;if(f&&f.code!==F0.OK){r.error(f);return}if(g.pong)return;const m=g.payload.value;if(m.stdoutData&&m.stdoutData.length>0&&((_=this.callback)==null||_.call(this,{type:ee.terminalStdout,output:{"runme.dev/id":this.knownID,data:m.stdoutData}}),this._stdout.next(m.stdoutData)),m.stderrData&&m.stderrData.length>0&&((w=this.callback)==null||w.call(this,{type:ee.terminalStderr,output:{"runme.dev/id":this.knownID,data:m.stderrData}}),this._stderr.next(m.stderrData)),m.exitCode!==void 0&&(this._exitCode.next(m.exitCode),r.complete()),m.pid!==void 0&&this._pid.next(m.pid),m.mimeType){const l=m.mimeType.split(";")[0];this._mimeType.next(l)}},o=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(n)};return n.addEventListener("close",a),n.addEventListener("error",d),n.addEventListener("message",s),n.addEventListener("open",o),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),n.removeEventListener("close",a),n.removeEventListener("error",d),n.removeEventListener("message",s),n.removeEventListener("open",o),n.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(qe(os,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new Ce(n=>{const a=cs(t,"message").pipe(fi(()=>t.readyState===WebSocket.OPEN),Ke(g=>Hc(g.data)),Ke(g=>g.pong),gt(g=>g!==void 0),Ke(g=>({receivedAt:BigInt(Date.now()),pong:g}))),o=(i==="INITIAL"?Ir(0):Ir(0,K_)).pipe(fi(()=>t.readyState===WebSocket.OPEN),Ke(()=>{const g={timestamp:BigInt(Date.now())};return qe(os,{ping:g})}),Ft(async g=>(await Gc({req:g,interceptors:this.interceptors,socket:t}),g)),Ke(g=>g.ping)).pipe(gt(g=>(g==null?void 0:g.timestamp)!==void 0),Ft(g=>w_(a.pipe(gt(f=>f.pong.timestamp===g.timestamp),Vc(1),Ke(f=>{const m=g.timestamp,_=f.receivedAt;return Number(_-m)})),Ir(pi).pipe(Ke(()=>{throw new Error(`Pong not received within ${pi}ms for stream ${r}`)}))).pipe(sh(f=>(this._latencies.next({streamID:r,latency:pi,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",f.message),n_(null))))),A_(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),B_(g=>{g!==null&&this._latencies.next({streamID:r,latency:g,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),c=[];return c.push(o.subscribe({error:g=>{console.error("Unexpected error sending heartbeat",g)}})),n.next(t),()=>{c.forEach(g=>g.unsubscribe())}})}connect(t="CONTINUOUS"){const r=J_(),i=this.latencies.pipe(Ke(n=>{const a=n.get(r);return a===void 0?null:a}),fi(n=>(n==null?void 0:n.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Hc(e){const t=JSON.parse(e);return hb(J0,t)}async function Gc({req:e,interceptors:t,socket:r,knownID:i,runID:n}){i&&(e.knownId=i),n&&(e.runId=n);const a={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let d=async c=>({stream:!1,message:{},method:{},service:{},header:c.header});for(const c of t.concat().reverse())d=c(d);const o=(await d(a)).header.get("Authorization");o&&e&&(e.authorization=o),r.send(JSON.stringify(rb(os,e)))}function J_(){return Z_().replace(/-/g,"")}function j_(){return`run_${P_()}`}exports.Console=gv;exports.Heartbeat=ch;exports.Streams=X_;exports.genRunID=j_;