@runmedev/react-console 3.14.0 → 3.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Console.d.ts +1 -1
- package/dist/components/Console.d.ts.map +1 -1
- package/dist/react-console.cjs +6 -6
- package/dist/react-console.mjs +2357 -2357
- package/dist/streams.d.ts +1 -1
- package/dist/streams.d.ts.map +1 -1
- package/package.json +35 -35
package/dist/react-console.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";var ra=Object.defineProperty;var ia=(u,e,t)=>e in u?ra(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var Ue=(u,e,t)=>ia(u,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oa=require("react/jsx-runtime"),ft=require("react");function Cs(u){let e=!1;const t=[];for(let l=0;l<u.length;l++){let h=u.charAt(l);switch(h){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(h),e=!1;break;default:e&&(e=!1,h=h.toUpperCase()),t.push(h);break}}return t.join("")}const aa=new Set(["constructor","toString","toJSON","valueOf"]);function Es(u){return aa.has(u)?u+"$":u}function la(){let u=0,e=0;for(let l=0;l<28;l+=7){let h=this.buf[this.pos++];if(u|=(h&127)<<l,(h&128)==0)return this.assertBounds(),[u,e]}let t=this.buf[this.pos++];if(u|=(t&15)<<28,e=(t&112)>>4,(t&128)==0)return this.assertBounds(),[u,e];for(let l=3;l<=31;l+=7){let h=this.buf[this.pos++];if(e|=(h&127)<<l,(h&128)==0)return this.assertBounds(),[u,e]}throw new Error("invalid varint")}function an(u,e,t){for(let v=0;v<28;v=v+7){const o=u>>>v,r=!(!(o>>>7)&&e==0),a=(r?o|128:o)&255;if(t.push(a),!r)return}const l=u>>>28&15|(e&7)<<4,h=e>>3!=0;if(t.push((h?l|128:l)&255),!!h){for(let v=3;v<31;v=v+7){const o=e>>>v,r=!!(o>>>7),a=(r?o|128:o)&255;if(t.push(a),!r)return}t.push(e>>>31&1)}}const Ns=4294967296;function er(u){const e=u[0]==="-";e&&(u=u.slice(1));const t=1e6;let l=0,h=0;function v(o,r){const a=Number(u.slice(o,r));h*=t,l=l*t+a,l>=Ns&&(h=h+(l/Ns|0),l=l%Ns)}return v(-24,-18),v(-18,-12),v(-12,-6),v(-6),e?ii(l,h):In(l,h)}function ca(u,e){let t=In(u,e);const l=t.hi&2147483648;l&&(t=ii(t.lo,t.hi));const h=ri(t.lo,t.hi);return l?"-"+h:h}function ri(u,e){if({lo:u,hi:e}=da(u,e),e<=2097151)return String(Ns*e+u);const t=u&16777215,l=(u>>>24|e<<8)&16777215,h=e>>16&65535;let v=t+l*6777216+h*6710656,o=l+h*8147497,r=h*2;const a=1e7;return v>=a&&(o+=Math.floor(v/a),v%=a),o>=a&&(r+=Math.floor(o/a),o%=a),r.toString()+tr(o)+tr(v)}function da(u,e){return{lo:u>>>0,hi:e>>>0}}function In(u,e){return{lo:u|0,hi:e|0}}function ii(u,e){return e=~e,u?u=~u+1:e+=1,In(u,e)}const tr=u=>{const e=String(u);return"0000000".slice(e.length)+e};function sr(u,e){if(u>=0){for(;u>127;)e.push(u&127|128),u=u>>>7;e.push(u)}else{for(let t=0;t<9;t++)e.push(u&127|128),u=u>>7;e.push(1)}}function ua(){let u=this.buf[this.pos++],e=u&127;if((u&128)==0)return this.assertBounds(),e;if(u=this.buf[this.pos++],e|=(u&127)<<7,(u&128)==0)return this.assertBounds(),e;if(u=this.buf[this.pos++],e|=(u&127)<<14,(u&128)==0)return this.assertBounds(),e;if(u=this.buf[this.pos++],e|=(u&127)<<21,(u&128)==0)return this.assertBounds(),e;u=this.buf[this.pos++],e|=(u&15)<<28;for(let t=5;(u&128)!==0&&t<10;t++)u=this.buf[this.pos++];if((u&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const Ve=ha();function ha(){const u=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof u.getBigInt64=="function"&&typeof u.getBigUint64=="function"&&typeof u.setBigInt64=="function"&&typeof u.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const t=BigInt("-9223372036854775808"),l=BigInt("9223372036854775807"),h=BigInt("0"),v=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const r=typeof o=="bigint"?o:BigInt(o);if(r>l||r<t)throw new Error(`invalid int64: ${o}`);return r},uParse(o){const r=typeof o=="bigint"?o:BigInt(o);if(r>v||r<h)throw new Error(`invalid uint64: ${o}`);return r},enc(o){return u.setBigInt64(0,this.parse(o),!0),{lo:u.getInt32(0,!0),hi:u.getInt32(4,!0)}},uEnc(o){return u.setBigInt64(0,this.uParse(o),!0),{lo:u.getInt32(0,!0),hi:u.getInt32(4,!0)}},dec(o,r){return u.setInt32(0,o,!0),u.setInt32(4,r,!0),u.getBigInt64(0,!0)},uDec(o,r){return u.setInt32(0,o,!0),u.setInt32(4,r,!0),u.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(t){return typeof t!="string"&&(t=t.toString()),nr(t),t},uParse(t){return typeof t!="string"&&(t=t.toString()),rr(t),t},enc(t){return typeof t!="string"&&(t=t.toString()),nr(t),er(t)},uEnc(t){return typeof t!="string"&&(t=t.toString()),rr(t),er(t)},dec(t,l){return ca(t,l)},uDec(t,l){return ri(t,l)}}}function nr(u){if(!/^-?[0-9]+$/.test(u))throw new Error("invalid int64: "+u)}function rr(u){if(!/^[0-9]+$/.test(u))throw new Error("invalid uint64: "+u)}var ie;(function(u){u[u.DOUBLE=1]="DOUBLE",u[u.FLOAT=2]="FLOAT",u[u.INT64=3]="INT64",u[u.UINT64=4]="UINT64",u[u.INT32=5]="INT32",u[u.FIXED64=6]="FIXED64",u[u.FIXED32=7]="FIXED32",u[u.BOOL=8]="BOOL",u[u.STRING=9]="STRING",u[u.BYTES=12]="BYTES",u[u.UINT32=13]="UINT32",u[u.SFIXED32=15]="SFIXED32",u[u.SFIXED64=16]="SFIXED64",u[u.SINT32=17]="SINT32",u[u.SINT64=18]="SINT64"})(ie||(ie={}));function es(u,e){switch(u){case ie.STRING:return"";case ie.BOOL:return!1;case ie.DOUBLE:case ie.FLOAT:return 0;case ie.INT64:case ie.UINT64:case ie.SFIXED64:case ie.FIXED64:case ie.SINT64:return e?"0":Ve.zero;case ie.BYTES:return new Uint8Array(0);default:return 0}}function fa(u,e){switch(u){case ie.BOOL:return e===!1;case ie.STRING:return e==="";case ie.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}const oi=2,vt=Symbol.for("reflect unsafe local");function ai(u,e){const t=u[e.localName].case;return t===void 0?t:e.fields.find(l=>l.localName===t)}function ma(u,e){const t=e.localName;if(e.oneof)return u[e.oneof.localName].case===t;if(e.presence!=oi)return u[t]!==void 0&&Object.prototype.hasOwnProperty.call(u,t);switch(e.fieldKind){case"list":return u[t].length>0;case"map":return Object.keys(u[t]).length>0;case"scalar":return!fa(e.scalar,u[t]);case"enum":return u[t]!==e.enum.values[0].number}throw new Error("message field with implicit presence")}function Ss(u,e){return Object.prototype.hasOwnProperty.call(u,e)&&u[e]!==void 0}function li(u,e){if(e.oneof){const t=u[e.oneof.localName];return t.case===e.localName?t.value:void 0}return u[e.localName]}function ci(u,e,t){e.oneof?u[e.oneof.localName]={case:e.localName,value:t}:u[e.localName]=t}function pa(u,e){const t=e.localName;if(e.oneof){const l=e.oneof.localName;u[l].case===t&&(u[l]={case:void 0})}else if(e.presence!=oi)delete u[t];else switch(e.fieldKind){case"map":u[t]={};break;case"list":u[t]=[];break;case"enum":u[t]=e.enum.values[0].number;break;case"scalar":u[t]=es(e.scalar,e.longAsString);break}}function Tn(u){for(const e of u.field)Ss(e,"jsonName")||(e.jsonName=Cs(e.name));u.nestedType.forEach(Tn)}function va(u,e){const t=u.values.find(l=>l.name===e);if(!t)throw new Error(`cannot parse ${u} default value: ${e}`);return t.number}function ga(u,e){switch(u){case ie.STRING:return e;case ie.BYTES:{const t=_a(e);if(t===!1)throw new Error(`cannot parse ${ie[u]} default value: ${e}`);return t}case ie.INT64:case ie.SFIXED64:case ie.SINT64:return Ve.parse(e);case ie.UINT64:case ie.FIXED64:return Ve.uParse(e);case ie.DOUBLE:case ie.FLOAT:switch(e){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(e)}case ie.BOOL:return e==="true";case ie.INT32:case ie.UINT32:case ie.SINT32:case ie.FIXED32:case ie.SFIXED32:return parseInt(e,10)}}function _a(u){const e=[],t={tail:u,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(l){if(this.tail.length>=l){const h=this.tail.substring(0,l);return this.tail=this.tail.substring(l),h}return!1}};for(;t.next();)switch(t.c){case"\\":if(t.next())switch(t.c){case"\\":e.push(t.c.charCodeAt(0));break;case"b":e.push(8);break;case"f":e.push(12);break;case"n":e.push(10);break;case"r":e.push(13);break;case"t":e.push(9);break;case"v":e.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const l=t.c,h=t.take(2);if(h===!1)return!1;const v=parseInt(l+h,8);if(Number.isNaN(v))return!1;e.push(v);break}case"x":{const l=t.c,h=t.take(2);if(h===!1)return!1;const v=parseInt(l+h,16);if(Number.isNaN(v))return!1;e.push(v);break}case"u":{const l=t.c,h=t.take(4);if(h===!1)return!1;const v=parseInt(l+h,16);if(Number.isNaN(v))return!1;const o=new Uint8Array(4);new DataView(o.buffer).setInt32(0,v,!0),e.push(o[0],o[1],o[2],o[3]);break}case"U":{const l=t.c,h=t.take(8);if(h===!1)return!1;const v=Ve.uEnc(l+h),o=new Uint8Array(8),r=new DataView(o.buffer);r.setInt32(0,v.lo,!0),r.setInt32(4,v.hi,!0),e.push(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7]);break}}break;default:e.push(t.c.charCodeAt(0))}return new Uint8Array(e)}function*bn(u){switch(u.kind){case"file":for(const e of u.messages)yield e,yield*bn(e);yield*u.enums,yield*u.services,yield*u.extensions;break;case"message":for(const e of u.nestedMessages)yield e,yield*bn(e);yield*u.nestedEnums,yield*u.nestedExtensions;break}}function di(...u){const e=ba();if(!u.length)return e;if("$typeName"in u[0]&&u[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const t of u[0].file)lr(t,e);return e}if("$typeName"in u[0]){let v=function(o){const r=[];for(const a of o.dependency){if(e.getFile(a)!=null||h.has(a))continue;const n=l(a);if(!n)throw new Error(`Unable to resolve ${a}, imported by ${o.name}`);"kind"in n?e.addFile(n,!1,!0):(h.add(n.name),r.push(n))}return r.concat(...r.map(v))};const t=u[0],l=u[1],h=new Set;for(const o of[t,...v(t)].reverse())lr(o,e)}else for(const t of u)for(const l of t.files)e.addFile(l);return e}function ba(){const u=new Map,e=new Map,t=new Map;return{kind:"registry",types:u,extendees:e,[Symbol.iterator](){return u.values()},get files(){return t.values()},addFile(l,h,v){if(t.set(l.proto.name,l),!h)for(const o of bn(l))this.add(o);if(v)for(const o of l.dependencies)this.addFile(o,h,v)},add(l){if(l.kind=="extension"){let h=e.get(l.extendee.typeName);h||e.set(l.extendee.typeName,h=new Map),h.set(l.number,l)}u.set(l.typeName,l)},get(l){return u.get(l)},getFile(l){return t.get(l)},getMessage(l){const h=u.get(l);return(h==null?void 0:h.kind)=="message"?h:void 0},getEnum(l){const h=u.get(l);return(h==null?void 0:h.kind)=="enum"?h:void 0},getExtension(l){const h=u.get(l);return(h==null?void 0:h.kind)=="extension"?h:void 0},getExtensionFor(l,h){var v;return(v=e.get(l.typeName))===null||v===void 0?void 0:v.get(h)},getService(l){const h=u.get(l);return(h==null?void 0:h.kind)=="service"?h:void 0}}}const ya=998,Ca=999,Ea=9,js=10,_s=11,Sa=12,ir=14,xn=3,ja=2,or=1,wa=0,ln=1,ar=2,Oa=3,Ia=1,Ta=2,xa=1,ui={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2}};function lr(u,e){var t,l;const h={kind:"file",proto:u,deprecated:(l=(t=u.options)===null||t===void 0?void 0:t.deprecated)!==null&&l!==void 0?l:!1,edition:Da(u),name:u.name.replace(/\.proto$/,""),dependencies:Ma(u,e),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${u.name}`}},v=new Map,o={get(r){return v.get(r)},add(r){var a;ht(((a=r.proto.options)===null||a===void 0?void 0:a.mapEntry)===!0),v.set(r.typeName,r)}};for(const r of u.enumType)hi(r,h,void 0,e);for(const r of u.messageType)fi(r,h,void 0,e,o);for(const r of u.service)Aa(r,h,e);yn(h,e);for(const r of v.values())Cn(r,e,o);for(const r of h.messages)Cn(r,e,o),yn(r,e);e.addFile(h,!0)}function yn(u,e){switch(u.kind){case"file":for(const t of u.proto.extension){const l=En(t,u,e);u.extensions.push(l),e.add(l)}break;case"message":for(const t of u.proto.extension){const l=En(t,u,e);u.nestedExtensions.push(l),e.add(l)}for(const t of u.nestedMessages)yn(t,e);break}}function Cn(u,e,t){const l=u.proto.oneofDecl.map(v=>Ra(v,u)),h=new Set;for(const v of u.proto.field){const o=Ba(v,l),r=En(v,u,e,o,t);u.fields.push(r),u.field[r.localName]=r,o===void 0?u.members.push(r):(o.fields.push(r),h.has(o)||(h.add(o),u.members.push(o)))}for(const v of l.filter(o=>h.has(o)))u.oneofs.push(v);for(const v of u.nestedMessages)Cn(v,e,t)}function hi(u,e,t,l){var h,v,o,r,a;const n=La(u.name,u.value),s={kind:"enum",proto:u,deprecated:(v=(h=u.options)===null||h===void 0?void 0:h.deprecated)!==null&&v!==void 0?v:!1,file:e,parent:t,open:!0,name:u.name,typeName:Gs(u,t,e),value:{},values:[],sharedPrefix:n,toString(){return`enum ${this.typeName}`}};s.open=Fa(s),l.add(s);for(const i of u.value){const d=i.name;s.values.push(s.value[i.number]={kind:"enum_value",proto:i,deprecated:(r=(o=i.options)===null||o===void 0?void 0:o.deprecated)!==null&&r!==void 0?r:!1,parent:s,name:d,localName:Es(n==null?d:d.substring(n.length)),number:i.number,toString(){return`enum value ${s.typeName}.${d}`}})}((a=t==null?void 0:t.nestedEnums)!==null&&a!==void 0?a:e.enums).push(s)}function fi(u,e,t,l,h){var v,o,r,a;const n={kind:"message",proto:u,deprecated:(o=(v=u.options)===null||v===void 0?void 0:v.deprecated)!==null&&o!==void 0?o:!1,file:e,parent:t,name:u.name,typeName:Gs(u,t,e),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((r=u.options)===null||r===void 0?void 0:r.mapEntry)===!0?h.add(n):(((a=t==null?void 0:t.nestedMessages)!==null&&a!==void 0?a:e.messages).push(n),l.add(n));for(const s of u.enumType)hi(s,e,n,l);for(const s of u.nestedType)fi(s,e,n,l,h)}function Aa(u,e,t){var l,h;const v={kind:"service",proto:u,deprecated:(h=(l=u.options)===null||l===void 0?void 0:l.deprecated)!==null&&h!==void 0?h:!1,file:e,name:u.name,typeName:Gs(u,void 0,e),methods:[],method:{},toString(){return`service ${this.typeName}`}};e.services.push(v),t.add(v);for(const o of u.method){const r=Pa(o,v,t);v.methods.push(r),v.method[r.localName]=r}}function Pa(u,e,t){var l,h,v,o;let r;u.clientStreaming&&u.serverStreaming?r="bidi_streaming":u.clientStreaming?r="client_streaming":u.serverStreaming?r="server_streaming":r="unary";const a=t.getMessage(pt(u.inputType)),n=t.getMessage(pt(u.outputType));ht(a,`invalid MethodDescriptorProto: input_type ${u.inputType} not found`),ht(n,`invalid MethodDescriptorProto: output_type ${u.inputType} not found`);const s=u.name;return{kind:"rpc",proto:u,deprecated:(h=(l=u.options)===null||l===void 0?void 0:l.deprecated)!==null&&h!==void 0?h:!1,parent:e,name:s,localName:Es(s.length?Es(s[0].toLowerCase()+s.substring(1)):s),methodKind:r,input:a,output:n,idempotency:(o=(v=u.options)===null||v===void 0?void 0:v.idempotencyLevel)!==null&&o!==void 0?o:wa,toString(){return`rpc ${e.typeName}.${s}`}}}function Ra(u,e){return{kind:"oneof",proto:u,deprecated:!1,parent:e,fields:[],name:u.name,localName:Es(Cs(u.name)),toString(){return`oneof ${e.typeName}.${this.name}`}}}function En(u,e,t,l,h){var v,o,r;const a=h===void 0,n={kind:"field",proto:u,deprecated:(o=(v=u.options)===null||v===void 0?void 0:v.deprecated)!==null&&o!==void 0?o:!1,name:u.name,number:u.number,scalar:void 0,message:void 0,enum:void 0,presence:Na(u,l,a,e),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){const p=e.kind=="file"?e:e.file,m=e.kind=="file"?void 0:e,c=Gs(u,m,p);n.kind="extension",n.file=p,n.parent=m,n.oneof=void 0,n.typeName=c,n.jsonName=`[${c}]`,n.toString=()=>`extension ${c}`;const f=t.getMessage(pt(u.extendee));ht(f,`invalid FieldDescriptorProto: extendee ${u.extendee} not found`),n.extendee=f}else{const p=e;ht(p.kind=="message"),n.parent=p,n.oneof=l,n.localName=l?Cs(u.name):Es(Cs(u.name)),n.jsonName=u.jsonName,n.toString=()=>`field ${p.typeName}.${u.name}`}const s=u.label,i=u.type,d=(r=u.options)===null||r===void 0?void 0:r.jstype;if(s===xn){const p=i==_s?h==null?void 0:h.get(pt(u.typeName)):void 0;if(p){n.fieldKind="map";const{key:m,value:c}=Ua(p);return n.mapKey=m.scalar,n.mapKind=c.fieldKind,n.message=c.message,n.delimitedEncoding=!1,n.enum=c.enum,n.scalar=c.scalar,n}switch(n.fieldKind="list",i){case _s:case js:n.listKind="message",n.message=t.getMessage(pt(u.typeName)),ht(n.message),n.delimitedEncoding=cr(u,e);break;case ir:n.listKind="enum",n.enum=t.getEnum(pt(u.typeName)),ht(n.enum);break;default:n.listKind="scalar",n.scalar=i,n.longAsString=d==or;break}return n.packed=$a(u,e),n}switch(i){case _s:case js:n.fieldKind="message",n.message=t.getMessage(pt(u.typeName)),ht(n.message,`invalid FieldDescriptorProto: type_name ${u.typeName} not found`),n.delimitedEncoding=cr(u,e),n.getDefaultValue=()=>{};break;case ir:{const p=t.getEnum(pt(u.typeName));ht(p!==void 0,`invalid FieldDescriptorProto: type_name ${u.typeName} not found`),n.fieldKind="enum",n.enum=t.getEnum(pt(u.typeName)),n.getDefaultValue=()=>Ss(u,"defaultValue")?va(p,u.defaultValue):void 0;break}default:{n.fieldKind="scalar",n.scalar=i,n.longAsString=d==or,n.getDefaultValue=()=>Ss(u,"defaultValue")?ga(i,u.defaultValue):void 0;break}}return n}function Da(u){switch(u.syntax){case"":case"proto2":return ya;case"proto3":return Ca;case"editions":if(u.edition in ui)return u.edition;throw new Error(`${u.name}: unsupported edition`);default:throw new Error(`${u.name}: unsupported syntax "${u.syntax}"`)}}function Ma(u,e){return u.dependency.map(t=>{const l=e.getFile(t);if(!l)throw new Error(`Cannot find ${t}, imported by ${u.name}`);return l})}function La(u,e){const t=ka(u)+"_";for(const l of e){if(!l.name.toLowerCase().startsWith(t))return;const h=l.name.substring(t.length);if(h.length==0||/^\d/.test(h))return}return t}function ka(u){return(u.substring(0,1)+u.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()}function Gs(u,e,t){let l;return e?l=`${e.typeName}.${u.name}`:t.proto.package.length>0?l=`${t.proto.package}.${u.name}`:l=`${u.name}`,l}function pt(u){return u.startsWith(".")?u.substring(1):u}function Ba(u,e){if(!Ss(u,"oneofIndex")||u.proto3Optional)return;const t=e[u.oneofIndex];return ht(t,`invalid FieldDescriptorProto: oneof #${u.oneofIndex} for field #${u.number} not found`),t}function Na(u,e,t,l){if(u.label==ja)return Oa;if(u.label==xn)return ar;if(e||u.proto3Optional||t)return ln;const h=os("fieldPresence",{proto:u,parent:l});return h==ar&&(u.type==_s||u.type==js)?ln:h}function $a(u,e){if(u.label!=xn)return!1;switch(u.type){case Ea:case Sa:case js:case _s:return!1}const t=u.options;return t&&Ss(t,"packed")?t.packed:Ia==os("repeatedFieldEncoding",{proto:u,parent:e})}function Ua(u){const e=u.fields.find(l=>l.number===1),t=u.fields.find(l=>l.number===2);return ht(e&&e.fieldKind=="scalar"&&e.scalar!=ie.BYTES&&e.scalar!=ie.FLOAT&&e.scalar!=ie.DOUBLE&&t&&t.fieldKind!="list"&&t.fieldKind!="map"),{key:e,value:t}}function Fa(u){var e;return xa==os("enumType",{proto:u.proto,parent:(e=u.parent)!==null&&e!==void 0?e:u.file})}function cr(u,e){return u.type==js?!0:Ta==os("messageEncoding",{proto:u,parent:e})}function os(u,e){var t,l;const h=(t=e.proto.options)===null||t===void 0?void 0:t.features;if(h){const v=h[u];if(v!=0)return v}if("kind"in e){if(e.kind=="message")return os(u,(l=e.parent)!==null&&l!==void 0?l:e.file);const v=ui[e.edition];if(!v)throw new Error(`feature default for edition ${e.edition} not found`);return v[u]}return os(u,e.parent)}function ht(u,e){if(!u)throw new Error(e)}function Va(u){const e=Wa(u);return e.messageType.forEach(Tn),di(e,()=>{}).getFile(e.name)}function Wa(u){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],service:[],extension:[]},u),{messageType:u.messageType.map(mi),enumType:u.enumType.map(pi)}))}function mi(u){var e,t,l,h,v,o,r,a;return{$typeName:"google.protobuf.DescriptorProto",name:u.name,field:(t=(e=u.field)===null||e===void 0?void 0:e.map(Ha))!==null&&t!==void 0?t:[],extension:[],nestedType:(h=(l=u.nestedType)===null||l===void 0?void 0:l.map(mi))!==null&&h!==void 0?h:[],enumType:(o=(v=u.enumType)===null||v===void 0?void 0:v.map(pi))!==null&&o!==void 0?o:[],extensionRange:(a=(r=u.extensionRange)===null||r===void 0?void 0:r.map(n=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},n)))!==null&&a!==void 0?a:[],oneofDecl:[],reservedRange:[],reservedName:[]}}function Ha(u){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},u),{options:u.options?Ka(u.options):void 0}))}function Ka(u){var e,t,l;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"},u),{targets:(e=u.targets)!==null&&e!==void 0?e:[],editionDefaults:(l=(t=u.editionDefaults)===null||t===void 0?void 0:t.map(v=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},v)))!==null&&l!==void 0?l:[],uninterpretedOption:[]}))}function pi(u){return{$typeName:"google.protobuf.EnumDescriptorProto",name:u.name,reservedName:[],reservedRange:[],value:u.value.map(e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e))}}function vi(u){const e=za();let t=u.length*3/4;u[u.length-2]=="="?t-=2:u[u.length-1]=="="&&(t-=1);let l=new Uint8Array(t),h=0,v=0,o,r=0;for(let a=0;a<u.length;a++){if(o=e[u.charCodeAt(a)],o===void 0)switch(u[a]){case"=":v=0;case`
|
|
2
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(v){case 0:r=o,v=1;break;case 1:l[h++]=r<<2|(o&48)>>4,r=o,v=2;break;case 2:l[h++]=(r&15)<<4|(o&60)>>2,r=o,v=3;break;case 3:l[h++]=(r&3)<<6|o,v=0;break}}if(v==1)throw Error("invalid base64 string");return l.subarray(0,h)}function Ga(u,e="std"){const t=gi(e),l=e=="std";let h="",v=0,o,r=0;for(let a=0;a<u.length;a++)switch(o=u[a],v){case 0:h+=t[o>>2],r=(o&3)<<4,v=1;break;case 1:h+=t[r|o>>4],r=(o&15)<<2,v=2;break;case 2:h+=t[r|o>>6],h+=t[o&63],v=0;break}return v&&(h+=t[r],l&&(h+="=",v==1&&(h+="="))),h}let Ds,dr,rs;function gi(u){return Ds||(Ds="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),dr=Ds.slice(0,-2).concat("-","_")),u=="url"?dr:Ds}function za(){if(!rs){rs=[];const u=gi("std");for(let e=0;e<u.length;e++)rs[u[e].charCodeAt(0)]=e;rs[45]=u.indexOf("+"),rs[95]=u.indexOf("/")}return rs}function An(u,e){return u!==null&&typeof u=="object"&&"$typeName"in u&&typeof u.$typeName=="string"?e===void 0?!0:e.typeName===u.$typeName:!1}const Za=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class ot extends Error{constructor(e,t,l="FieldValueInvalidError"){super(t),this.name=l,this.field=()=>e}}function Xa(u){return u instanceof Error&&Za.includes(u.name)&&"field"in u&&typeof u.field=="function"}function Ct(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)}function Pn(u,e){var t,l,h,v;if(Ct(u)&&vt in u&&"add"in u&&"field"in u&&typeof u.field=="function"){if(e!==void 0){const o=e,r=u.field();return o.listKind==r.listKind&&o.scalar===r.scalar&&((t=o.message)===null||t===void 0?void 0:t.typeName)===((l=r.message)===null||l===void 0?void 0:l.typeName)&&((h=o.enum)===null||h===void 0?void 0:h.typeName)===((v=r.enum)===null||v===void 0?void 0:v.typeName)}return!0}return!1}function Rn(u,e){var t,l,h,v;if(Ct(u)&&vt in u&&"has"in u&&"field"in u&&typeof u.field=="function"){if(e!==void 0){const o=e,r=u.field();return o.mapKey===r.mapKey&&o.mapKind==r.mapKind&&o.scalar===r.scalar&&((t=o.message)===null||t===void 0?void 0:t.typeName)===((l=r.message)===null||l===void 0?void 0:l.typeName)&&((h=o.enum)===null||h===void 0?void 0:h.typeName)===((v=r.enum)===null||v===void 0?void 0:v.typeName)}return!0}return!1}function Dn(u,e){return Ct(u)&&vt in u&&"desc"in u&&Ct(u.desc)&&u.desc.kind==="message"&&(e===void 0||u.desc.typeName==e.typeName)}const cn=Symbol.for("@bufbuild/protobuf/text-encoding");function Mn(){if(globalThis[cn]==null){const u=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[cn]={encodeUtf8(t){return u.encode(t)},decodeUtf8(t){return e.decode(t)},checkUtf8(t){try{return encodeURIComponent(t),!0}catch{return!1}}}}return globalThis[cn]}var Ge;(function(u){u[u.Varint=0]="Varint",u[u.Bit64=1]="Bit64",u[u.LengthDelimited=2]="LengthDelimited",u[u.StartGroup=3]="StartGroup",u[u.EndGroup=4]="EndGroup",u[u.Bit32=5]="Bit32"})(Ge||(Ge={}));const _i=34028234663852886e22,bi=-34028234663852886e22,yi=4294967295,Ci=2147483647,Ei=-2147483648;class Si{constructor(e=Mn().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let h=0;h<this.chunks.length;h++)e+=this.chunks[h].length;let t=new Uint8Array(e),l=0;for(let h=0;h<this.chunks.length;h++)t.set(this.chunks[h],l),l+=this.chunks[h].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ur(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return dn(e),sr(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Ya(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ur(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){dn(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return dn(e),e=(e<<1^e>>31)>>>0,sr(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),l=new DataView(t.buffer),h=Ve.enc(e);return l.setInt32(0,h.lo,!0),l.setInt32(4,h.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),l=new DataView(t.buffer),h=Ve.uEnc(e);return l.setInt32(0,h.lo,!0),l.setInt32(4,h.hi,!0),this.raw(t)}int64(e){let t=Ve.enc(e);return an(t.lo,t.hi,this.buf),this}sint64(e){const t=Ve.enc(e),l=t.hi>>31,h=t.lo<<1^l,v=(t.hi<<1|t.lo>>>31)^l;return an(h,v,this.buf),this}uint64(e){const t=Ve.uEnc(e);return an(t.lo,t.hi,this.buf),this}}class Ln{constructor(e,t=Mn().decodeUtf8){this.decodeUtf8=t,this.varint64=la,this.uint32=ua,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,l=e&7;if(t<=0||l<0||l>5)throw new Error("illegal tag: field no "+t+" wire type "+l);return[t,l]}skip(e,t){let l=this.pos;switch(e){case Ge.Varint:for(;this.buf[this.pos++]&128;);break;case Ge.Bit64:this.pos+=4;case Ge.Bit32:this.pos+=4;break;case Ge.LengthDelimited:let h=this.uint32();this.pos+=h;break;case Ge.StartGroup:for(;;){const[v,o]=this.tag();if(o===Ge.EndGroup){if(t!==void 0&&v!==t)throw new Error("invalid end group tag");break}this.skip(o,v)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(l,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Ve.dec(...this.varint64())}uint64(){return Ve.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),l=-(e&1);return e=(e>>>1|(t&1)<<31)^l,t=t>>>1^l,Ve.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ve.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ve.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 e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function dn(u){if(typeof u=="string")u=Number(u);else if(typeof u!="number")throw new Error("invalid int32: "+typeof u);if(!Number.isInteger(u)||u>Ci||u<Ei)throw new Error("invalid int32: "+u)}function ur(u){if(typeof u=="string")u=Number(u);else if(typeof u!="number")throw new Error("invalid uint32: "+typeof u);if(!Number.isInteger(u)||u>yi||u<0)throw new Error("invalid uint32: "+u)}function Ya(u){if(typeof u=="string"){const e=u;if(u=Number(u),Number.isNaN(u)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof u!="number")throw new Error("invalid float32: "+typeof u);if(Number.isFinite(u)&&(u>_i||u<bi))throw new Error("invalid float32: "+u)}function Jt(u,e){const t=u.fieldKind=="list"?Pn(e,u):u.fieldKind=="map"?Rn(e,u):kn(u,e);if(t===!0)return;let l;switch(u.fieldKind){case"list":l=`expected ${Oi(u)}, got ${Qe(e)}`;break;case"map":l=`expected ${Ii(u)}, got ${Qe(e)}`;break;default:l=Fs(u,e,t)}return new ot(u,l)}function hr(u,e,t){const l=kn(u,t);if(l!==!0)return new ot(u,`list item #${e+1}: ${Fs(u,t,l)}`)}function Ja(u,e,t){const l=ji(e,u.mapKey);if(l!==!0)return new ot(u,`invalid map key: ${Fs({scalar:u.mapKey},e,l)}`);const h=kn(u,t);if(h!==!0)return new ot(u,`map entry ${Qe(e)}: ${Fs(u,t,h)}`)}function kn(u,e){return u.scalar!==void 0?ji(e,u.scalar):u.enum!==void 0?u.enum.open?Number.isInteger(e):u.enum.values.some(t=>t.number===e):Dn(e,u.message)}function ji(u,e){switch(e){case ie.DOUBLE:return typeof u=="number";case ie.FLOAT:return typeof u!="number"?!1:Number.isNaN(u)||!Number.isFinite(u)?!0:u>_i||u<bi?`${u.toFixed()} out of range`:!0;case ie.INT32:case ie.SFIXED32:case ie.SINT32:return typeof u!="number"||!Number.isInteger(u)?!1:u>Ci||u<Ei?`${u.toFixed()} out of range`:!0;case ie.FIXED32:case ie.UINT32:return typeof u!="number"||!Number.isInteger(u)?!1:u>yi||u<0?`${u.toFixed()} out of range`:!0;case ie.BOOL:return typeof u=="boolean";case ie.STRING:return typeof u!="string"?!1:Mn().checkUtf8(u)||"invalid UTF8";case ie.BYTES:return u instanceof Uint8Array;case ie.INT64:case ie.SFIXED64:case ie.SINT64:if(typeof u=="bigint"||typeof u=="number"||typeof u=="string"&&u.length>0)try{return Ve.parse(u),!0}catch{return`${u} out of range`}return!1;case ie.FIXED64:case ie.UINT64:if(typeof u=="bigint"||typeof u=="number"||typeof u=="string"&&u.length>0)try{return Ve.uParse(u),!0}catch{return`${u} out of range`}return!1}}function Fs(u,e,t){return t=typeof t=="string"?`: ${t}`:`, got ${Qe(e)}`,u.scalar!==void 0?`expected ${Qa(u.scalar)}`+t:u.enum!==void 0?`expected ${u.enum.toString()}`+t:`expected ${wi(u.message)}`+t}function Qe(u){switch(typeof u){case"object":return u===null?"null":u instanceof Uint8Array?`Uint8Array(${u.length})`:Array.isArray(u)?`Array(${u.length})`:Pn(u)?Oi(u.field()):Rn(u)?Ii(u.field()):Dn(u)?wi(u.desc):An(u)?`message ${u.$typeName}`:"object";case"string":return u.length>30?"string":`"${u.split('"').join('\\"')}"`;case"boolean":return String(u);case"number":return String(u);case"bigint":return String(u)+"n";default:return typeof u}}function wi(u){return`ReflectMessage (${u.typeName})`}function Oi(u){switch(u.listKind){case"message":return`ReflectList (${u.message.toString()})`;case"enum":return`ReflectList (${u.enum.toString()})`;case"scalar":return`ReflectList (${ie[u.scalar]})`}}function Ii(u){switch(u.mapKind){case"message":return`ReflectMap (${ie[u.mapKey]}, ${u.message.toString()})`;case"enum":return`ReflectMap (${ie[u.mapKey]}, ${u.enum.toString()})`;case"scalar":return`ReflectMap (${ie[u.mapKey]}, ${ie[u.scalar]})`}}function Qa(u){switch(u){case ie.STRING:return"string";case ie.BOOL:return"boolean";case ie.INT64:case ie.SINT64:case ie.SFIXED64:return"bigint (int64)";case ie.UINT64:case ie.FIXED64:return"bigint (uint64)";case ie.BYTES:return"Uint8Array";case ie.DOUBLE:return"number (float64)";case ie.FLOAT:return"number (float32)";case ie.FIXED32:case ie.UINT32:return"number (uint32)";case ie.INT32:case ie.SFIXED32:case ie.SINT32:return"number (int32)"}}function qa(u){return Ti(u.$typeName)}function Ts(u){const e=u.fields[0];return Ti(u.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function Ti(u){return u.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(u.substring(16))}const el=999,tl=998,$s=2;function it(u,e){if(An(e,u))return e;const t=ol(u);return e!==void 0&&sl(u,t,e),t}function sl(u,e,t){for(const l of u.members){let h=t[l.localName];if(h==null)continue;let v;if(l.kind=="oneof"){const o=ai(t,l);if(!o)continue;v=o,h=li(t,o)}else v=l;switch(v.fieldKind){case"message":h=Bn(v,h);break;case"scalar":h=xi(v,h);break;case"list":h=rl(v,h);break;case"map":h=nl(v,h);break}ci(e,v,h)}return e}function xi(u,e){return u.scalar==ie.BYTES?Nn(e):e}function nl(u,e){if(Ct(e)){if(u.scalar==ie.BYTES)return fr(e,Nn);if(u.mapKind=="message")return fr(e,t=>Bn(u,t))}return e}function rl(u,e){if(Array.isArray(e)){if(u.scalar==ie.BYTES)return e.map(Nn);if(u.listKind=="message")return e.map(t=>Bn(u,t))}return e}function Bn(u,e){if(u.fieldKind=="message"&&!u.oneof&&Ts(u.message))return xi(u.message.fields[0],e);if(Ct(e)){if(u.message.typeName=="google.protobuf.Struct"&&u.parent.typeName!=="google.protobuf.Value")return e;if(!An(e,u.message))return it(u.message,e)}return e}function Nn(u){return Array.isArray(u)?new Uint8Array(u):u}function fr(u,e){const t={};for(const l of Object.entries(u))t[l[0]]=e(l[1]);return t}const il=Symbol(),mr=new WeakMap;function ol(u){let e;if(al(u)){const t=mr.get(u);let l,h;if(t)({prototype:l,members:h}=t);else{l={},h=new Set;for(const v of u.members)v.kind!="oneof"&&(v.fieldKind!="scalar"&&v.fieldKind!="enum"||v.presence!=$s&&(h.add(v),l[v.localName]=un(v)));mr.set(u,{prototype:l,members:h})}e=Object.create(l),e.$typeName=u.typeName;for(const v of u.members)h.has(v)||v.kind=="field"&&(v.fieldKind=="message"||(v.fieldKind=="scalar"||v.fieldKind=="enum")&&v.presence!=$s)||(e[v.localName]=un(v))}else{e={$typeName:u.typeName};for(const t of u.members)(t.kind=="oneof"||t.presence==$s)&&(e[t.localName]=un(t))}return e}function al(u){switch(u.file.edition){case el:return!1;case tl:return!0;default:return u.fields.some(e=>e.presence!=$s&&e.fieldKind!="message"&&!e.oneof)}}function un(u){if(u.kind=="oneof")return{case:void 0};if(u.fieldKind=="list")return[];if(u.fieldKind=="map")return{};if(u.fieldKind=="message")return il;const e=u.getDefaultValue();return e!==void 0?u.fieldKind=="scalar"&&u.longAsString?e.toString():e:u.fieldKind=="scalar"?es(u.scalar,u.longAsString):u.enum.values[0].number}function ut(u,e,t=!0){return new Ai(u,e,t)}class Ai{get sortedFields(){var e;return(e=this._sortedFields)!==null&&e!==void 0?e:this._sortedFields=this.desc.fields.concat().sort((t,l)=>t.number-l.number)}constructor(e,t,l=!0){this.lists=new Map,this.maps=new Map,this.check=l,this.desc=e,this.message=this[vt]=t??it(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(t=>[t.number,t]))),this._fieldsByNumber.get(e)}oneofCase(e){return vs(this.message,e),ai(this.message,e)}isSet(e){return vs(this.message,e),ma(this.message,e)}clear(e){vs(this.message,e),pa(this.message,e)}get(e){vs(this.message,e);const t=li(this.message,e);switch(e.fieldKind){case"list":let l=this.lists.get(e);return(!l||l[vt]!==t)&&this.lists.set(e,l=new ll(e,t,this.check)),l;case"map":let h=this.maps.get(e);return(!h||h[vt]!==t)&&this.maps.set(e,h=new cl(e,t,this.check)),h;case"message":return Un(e,t,this.check);case"scalar":return t===void 0?es(e.scalar,!1):Fn(e,t);case"enum":return t??e.enum.values[0].number}}set(e,t){if(vs(this.message,e),this.check){const h=Jt(e,t);if(h)throw h}let l;e.fieldKind=="message"?l=$n(e,t):Rn(t)||Pn(t)?l=t[vt]:l=Vn(e,t),ci(this.message,e,l)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function vs(u,e){if(e.parent.typeName!==u.$typeName)throw new ot(e,`cannot use ${e.toString()} with message ${u.$typeName}`,"ForeignFieldError")}class ll{field(){return this._field}get size(){return this._arr.length}constructor(e,t,l){this._field=e,this._arr=this[vt]=t,this.check=l}get(e){const t=this._arr[e];return t===void 0?void 0:hn(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new ot(this._field,`list item #${e+1}: out of range`);if(this.check){const l=hr(this._field,e,t);if(l)throw l}this._arr[e]=pr(this._field,t)}add(e){if(this.check){const t=hr(this._field,this._arr.length,e);if(t)throw t}this._arr.push(pr(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield hn(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,hn(this._field,this._arr[e],this.check)]}}class cl{constructor(e,t,l=!0){this.obj=this[vt]=t??{},this.check=l,this._field=e}field(){return this._field}set(e,t){if(this.check){const l=Ja(this._field,e,t);if(l)throw l}return this.obj[Ms(e)]=dl(this._field,t),this}delete(e){const t=Ms(e),l=Object.prototype.hasOwnProperty.call(this.obj,t);return l&&delete this.obj[t],l}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[Ms(e)];return t!==void 0&&(t=fn(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Ms(e))}*keys(){for(const e of Object.keys(this.obj))yield vr(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[vr(e[0],this._field.mapKey),fn(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield fn(this._field,e,this.check)}forEach(e,t){for(const l of this.entries())e.call(t,l[1],l[0],this)}}function $n(u,e){return Dn(e)?qa(e.message)&&!u.oneof&&u.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&u.parent.typeName!="google.protobuf.Value"?Ri(e.message):e.message:e}function Un(u,e,t){return e!==void 0&&(Ts(u.message)&&!u.oneof&&u.fieldKind=="message"?e={$typeName:u.message.typeName,value:Fn(u.message.fields[0],e)}:u.message.typeName=="google.protobuf.Struct"&&u.parent.typeName!="google.protobuf.Value"&&Ct(e)&&(e=Pi(e))),new Ai(u.message,e,t)}function pr(u,e){return u.listKind=="message"?$n(u,e):Vn(u,e)}function hn(u,e,t){return u.listKind=="message"?Un(u,e,t):Fn(u,e)}function dl(u,e){return u.mapKind=="message"?$n(u,e):Vn(u,e)}function fn(u,e,t){return u.mapKind=="message"?Un(u,e,t):e}function Ms(u){return typeof u=="string"||typeof u=="number"?u:String(u)}function vr(u,e){switch(e){case ie.STRING:return u;case ie.INT32:case ie.FIXED32:case ie.UINT32:case ie.SFIXED32:case ie.SINT32:{const t=Number.parseInt(u);if(Number.isFinite(t))return t;break}case ie.BOOL:switch(u){case"true":return!0;case"false":return!1}break;case ie.UINT64:case ie.FIXED64:try{return Ve.uParse(u)}catch{}break;default:try{return Ve.parse(u)}catch{}break}return u}function Fn(u,e){switch(u.scalar){case ie.INT64:case ie.SFIXED64:case ie.SINT64:"longAsString"in u&&u.longAsString&&typeof e=="string"&&(e=Ve.parse(e));break;case ie.FIXED64:case ie.UINT64:"longAsString"in u&&u.longAsString&&typeof e=="string"&&(e=Ve.uParse(e));break}return e}function Vn(u,e){switch(u.scalar){case ie.INT64:case ie.SFIXED64:case ie.SINT64:"longAsString"in u&&u.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Ve.parse(e));break;case ie.FIXED64:case ie.UINT64:"longAsString"in u&&u.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Ve.uParse(e));break}return e}function Pi(u){const e={$typeName:"google.protobuf.Struct",fields:{}};if(Ct(u))for(const[t,l]of Object.entries(u))e.fields[t]=Mi(l);return e}function Ri(u){const e={};for(const[t,l]of Object.entries(u.fields))e[t]=Di(l);return e}function Di(u){switch(u.kind.case){case"structValue":return Ri(u.kind.value);case"listValue":return u.kind.value.values.map(Di);case"nullValue":case void 0:return null;default:return u.kind.value}}function Mi(u){const e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof u){case"number":e.kind={case:"numberValue",value:u};break;case"string":e.kind={case:"stringValue",value:u};break;case"boolean":e.kind={case:"boolValue",value:u};break;case"object":if(u===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(u)){const t={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(u))for(const l of u)t.values.push(Mi(l));e.kind={case:"listValue",value:t}}else e.kind={case:"structValue",value:Pi(u)};break}return e}const ul=3,gr={writeUnknownFields:!0};function hl(u){return u?Object.assign(Object.assign({},gr),u):gr}function fl(u,e,t){return Vs(new Si,hl(t),ut(u,e)).finish()}function Vs(u,e,t){var l;for(const h of t.sortedFields){if(!t.isSet(h)){if(h.presence==ul)throw new Error(`cannot encode ${h} to binary: required field not set`);continue}Li(u,e,t,h)}if(e.writeUnknownFields)for(const{no:h,wireType:v,data:o}of(l=t.getUnknown())!==null&&l!==void 0?l:[])u.tag(h,v).raw(o);return u}function Li(u,e,t,l){var h;switch(l.fieldKind){case"scalar":case"enum":Ws(u,t.desc.typeName,l.name,(h=l.scalar)!==null&&h!==void 0?h:ie.INT32,l.number,t.get(l));break;case"list":ml(u,e,l,t.get(l));break;case"message":ki(u,e,l,t.get(l));break;case"map":for(const[v,o]of t.get(l))pl(u,e,l,v,o);break}}function Ws(u,e,t,l,h,v){Bi(u.tag(h,vl(l)),e,t,l,v)}function ki(u,e,t,l){t.delimitedEncoding?Vs(u.tag(t.number,Ge.StartGroup),e,l).tag(t.number,Ge.EndGroup):Vs(u.tag(t.number,Ge.LengthDelimited).fork(),e,l).join()}function ml(u,e,t,l){var h;if(t.listKind=="message"){for(const o of l)ki(u,e,t,o);return}const v=(h=t.scalar)!==null&&h!==void 0?h:ie.INT32;if(t.packed){if(!l.size)return;u.tag(t.number,Ge.LengthDelimited).fork();for(const o of l)Bi(u,t.parent.typeName,t.name,v,o);u.join();return}for(const o of l)Ws(u,t.parent.typeName,t.name,v,t.number,o)}function pl(u,e,t,l,h){var v;switch(u.tag(t.number,Ge.LengthDelimited).fork(),Ws(u,t.parent.typeName,t.name,t.mapKey,1,l),t.mapKind){case"scalar":case"enum":Ws(u,t.parent.typeName,t.name,(v=t.scalar)!==null&&v!==void 0?v:ie.INT32,2,h);break;case"message":Vs(u.tag(2,Ge.LengthDelimited).fork(),e,h).join();break}u.join()}function Bi(u,e,t,l,h){try{switch(l){case ie.STRING:u.string(h);break;case ie.BOOL:u.bool(h);break;case ie.DOUBLE:u.double(h);break;case ie.FLOAT:u.float(h);break;case ie.INT32:u.int32(h);break;case ie.INT64:u.int64(h);break;case ie.UINT64:u.uint64(h);break;case ie.FIXED64:u.fixed64(h);break;case ie.BYTES:u.bytes(h);break;case ie.FIXED32:u.fixed32(h);break;case ie.SFIXED32:u.sfixed32(h);break;case ie.SFIXED64:u.sfixed64(h);break;case ie.SINT64:u.sint64(h);break;case ie.UINT32:u.uint32(h);break;case ie.SINT32:u.sint32(h);break}}catch(v){throw v instanceof Error?new Error(`cannot encode field ${e}.${t} to binary: ${v.message}`):v}}function vl(u){switch(u){case ie.BYTES:case ie.STRING:return Ge.LengthDelimited;case ie.DOUBLE:case ie.FIXED64:case ie.SFIXED64:return Ge.Bit64;case ie.FIXED32:case ie.SFIXED32:case ie.FLOAT:return Ge.Bit32;default:return Ge.Varint}}function xs(u,e,...t){return t.reduce((l,h)=>l.nestedMessages[h],u.messages[e])}function gl(u,e,...t){if(t.length==0)return u.enums[e];const l=t.pop();return t.reduce((h,v)=>h.nestedMessages[v],u.messages[e]).nestedEnums[l]}function Wn(u){const e={};for(const t of u.values)e[t.localName]=t.number,e[t.number]=t.localName;return e}const _l=Va({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:"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}],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}],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"},{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}]}}],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}]}]}),bl=xs(_l,1);var _r;(function(u){u[u.DECLARATION=0]="DECLARATION",u[u.UNVERIFIED=1]="UNVERIFIED"})(_r||(_r={}));var br;(function(u){u[u.DOUBLE=1]="DOUBLE",u[u.FLOAT=2]="FLOAT",u[u.INT64=3]="INT64",u[u.UINT64=4]="UINT64",u[u.INT32=5]="INT32",u[u.FIXED64=6]="FIXED64",u[u.FIXED32=7]="FIXED32",u[u.BOOL=8]="BOOL",u[u.STRING=9]="STRING",u[u.GROUP=10]="GROUP",u[u.MESSAGE=11]="MESSAGE",u[u.BYTES=12]="BYTES",u[u.UINT32=13]="UINT32",u[u.ENUM=14]="ENUM",u[u.SFIXED32=15]="SFIXED32",u[u.SFIXED64=16]="SFIXED64",u[u.SINT32=17]="SINT32",u[u.SINT64=18]="SINT64"})(br||(br={}));var yr;(function(u){u[u.OPTIONAL=1]="OPTIONAL",u[u.REPEATED=3]="REPEATED",u[u.REQUIRED=2]="REQUIRED"})(yr||(yr={}));var Cr;(function(u){u[u.SPEED=1]="SPEED",u[u.CODE_SIZE=2]="CODE_SIZE",u[u.LITE_RUNTIME=3]="LITE_RUNTIME"})(Cr||(Cr={}));var Er;(function(u){u[u.STRING=0]="STRING",u[u.CORD=1]="CORD",u[u.STRING_PIECE=2]="STRING_PIECE"})(Er||(Er={}));var Sr;(function(u){u[u.JS_NORMAL=0]="JS_NORMAL",u[u.JS_STRING=1]="JS_STRING",u[u.JS_NUMBER=2]="JS_NUMBER"})(Sr||(Sr={}));var jr;(function(u){u[u.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",u[u.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",u[u.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(jr||(jr={}));var wr;(function(u){u[u.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",u[u.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",u[u.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",u[u.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",u[u.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",u[u.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",u[u.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",u[u.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",u[u.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",u[u.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(wr||(wr={}));var Or;(function(u){u[u.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",u[u.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",u[u.IDEMPOTENT=2]="IDEMPOTENT"})(Or||(Or={}));var Ir;(function(u){u[u.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",u[u.EXPLICIT=1]="EXPLICIT",u[u.IMPLICIT=2]="IMPLICIT",u[u.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Ir||(Ir={}));var Tr;(function(u){u[u.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",u[u.OPEN=1]="OPEN",u[u.CLOSED=2]="CLOSED"})(Tr||(Tr={}));var xr;(function(u){u[u.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",u[u.PACKED=1]="PACKED",u[u.EXPANDED=2]="EXPANDED"})(xr||(xr={}));var Ar;(function(u){u[u.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",u[u.VERIFY=2]="VERIFY",u[u.NONE=3]="NONE"})(Ar||(Ar={}));var Pr;(function(u){u[u.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",u[u.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",u[u.DELIMITED=2]="DELIMITED"})(Pr||(Pr={}));var Rr;(function(u){u[u.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",u[u.ALLOW=1]="ALLOW",u[u.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Rr||(Rr={}));var Dr;(function(u){u[u.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",u[u.STYLE2024=1]="STYLE2024",u[u.STYLE_LEGACY=2]="STYLE_LEGACY"})(Dr||(Dr={}));var Mr;(function(u){u[u.NONE=0]="NONE",u[u.SET=1]="SET",u[u.ALIAS=2]="ALIAS"})(Mr||(Mr={}));var Lr;(function(u){u[u.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",u[u.EDITION_LEGACY=900]="EDITION_LEGACY",u[u.EDITION_PROTO2=998]="EDITION_PROTO2",u[u.EDITION_PROTO3=999]="EDITION_PROTO3",u[u.EDITION_2023=1e3]="EDITION_2023",u[u.EDITION_2024=1001]="EDITION_2024",u[u.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",u[u.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",u[u.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",u[u.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",u[u.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",u[u.EDITION_MAX=2147483647]="EDITION_MAX"})(Lr||(Lr={}));function Ni(u,e,...t){if(t.length==0)return u.enums[e];const l=t.pop();return t.reduce((h,v)=>h.nestedMessages[v],u.messages[e]).nestedEnums[l]}const kr={readUnknownFields:!0};function yl(u){return u?Object.assign(Object.assign({},kr),u):kr}function $i(u,e,t){const l=ut(u,void 0,!1);return Ui(l,new Ln(e),yl(t),!1,e.byteLength),l.message}function Ui(u,e,t,l,h){var v;const o=l?e.len:e.pos+h;let r,a;const n=(v=u.getUnknown())!==null&&v!==void 0?v:[];for(;e.pos<o&&([r,a]=e.tag(),!(l&&a==Ge.EndGroup));){const s=u.findNumber(r);if(!s){const i=e.skip(a,r);t.readUnknownFields&&n.push({no:r,wireType:a,data:i});continue}Fi(u,e,s,a,t)}if(l&&(a!=Ge.EndGroup||r!==h))throw new Error("invalid end group tag");n.length>0&&u.setUnknown(n)}function Fi(u,e,t,l,h){switch(t.fieldKind){case"scalar":u.set(t,as(e,t.scalar));break;case"enum":u.set(t,as(e,ie.INT32));break;case"message":u.set(t,Hn(e,h,t,u.get(t)));break;case"list":El(e,l,u.get(t),h);break;case"map":Cl(e,u.get(t),h);break}}function Cl(u,e,t){const l=e.field();let h,v;const o=u.pos+u.uint32();for(;u.pos<o;){const[r]=u.tag();switch(r){case 1:h=as(u,l.mapKey);break;case 2:switch(l.mapKind){case"scalar":v=as(u,l.scalar);break;case"enum":v=u.int32();break;case"message":v=Hn(u,t,l);break}break}}if(h===void 0&&(h=es(l.mapKey,!1)),v===void 0)switch(l.mapKind){case"scalar":v=es(l.scalar,!1);break;case"enum":v=l.enum.values[0].number;break;case"message":v=ut(l.message,void 0,!1);break}e.set(h,v)}function El(u,e,t,l){var h;const v=t.field();if(v.listKind==="message"){t.add(Hn(u,l,v));return}const o=(h=v.scalar)!==null&&h!==void 0?h:ie.INT32;if(!(e==Ge.LengthDelimited&&o!=ie.STRING&&o!=ie.BYTES)){t.add(as(u,o));return}const a=u.uint32()+u.pos;for(;u.pos<a;)t.add(as(u,o))}function Hn(u,e,t,l){const h=t.delimitedEncoding,v=l??ut(t.message,void 0,!1);return Ui(v,u,e,h,h?t.number:u.uint32()),v}function as(u,e){switch(e){case ie.STRING:return u.string();case ie.BOOL:return u.bool();case ie.DOUBLE:return u.double();case ie.FLOAT:return u.float();case ie.INT32:return u.int32();case ie.INT64:return u.int64();case ie.UINT64:return u.uint64();case ie.FIXED64:return u.fixed64();case ie.BYTES:return u.bytes();case ie.FIXED32:return u.fixed32();case ie.SFIXED32:return u.sfixed32();case ie.SFIXED64:return u.sfixed64();case ie.SINT64:return u.sint64();case ie.UINT32:return u.uint32();case ie.SINT32:return u.sint32()}}function St(u,e){var t;const l=$i(bl,vi(u));return l.messageType.forEach(Tn),l.dependency=(t=e==null?void 0:e.map(v=>v.proto.name))!==null&&t!==void 0?t:[],di(l,v=>e==null?void 0:e.find(o=>o.proto.name===v)).getFile(l.name)}function zs(u,e,...t){return t.reduce((l,h)=>l.nestedMessages[h],u.messages[e])}const Vi=St("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),Sl=Ni(Vi,0),jl=Wn(Sl),wl=St("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Ol=xs(wl,0);function Il(u,e,t){let l=!1;return t||(t=it(Ol),l=!0),t.value=fl(u,e),t.typeUrl=Al(e.$typeName),l?t:void 0}function Tl(u,e){if(u.typeUrl==="")return!1;const t=typeof e=="string"?e:e.typeName,l=Wi(u.typeUrl);return t===l}function xl(u,e){if(u.typeUrl==="")return;const t=e.kind=="message"?e:e.getMessage(Wi(u.typeUrl));if(!(!t||!Tl(u,t)))return $i(t,u.value)}function Al(u){return`type.googleapis.com/${u}`}function Wi(u){const e=u.lastIndexOf("/"),t=e>=0?u.substring(e+1):u;if(!t.length)throw new Error(`invalid type url: ${u}`);return t}const Kn=St("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Pl=xs(Kn,0),Hi=xs(Kn,1),Rl=xs(Kn,2);var Sn;(function(u){u[u.NULL_VALUE=0]="NULL_VALUE"})(Sn||(Sn={}));const Dl=St("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Zs=St("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[Dl,Vi]),Br=zs(Zs,12),mn=zs(Zs,13),Ml=Ni(Zs,2),Ll=Wn(Ml);function kl(u,e){Ki(e,u);const t=Nl(u.$unknown,e),[l,h,v]=Xs(e);for(const o of t)Fi(l,new Ln(o.data),h,o.wireType,{readUnknownFields:!0});return v()}function Bl(u,e,t){var l;Ki(e,u);const h=((l=u.$unknown)!==null&&l!==void 0?l:[]).filter(n=>n.no!==e.number),[v,o]=Xs(e,t),r=new Si;Li(r,{writeUnknownFields:!0},v,o);const a=new Ln(r.finish());for(;a.pos<a.len;){const[n,s]=a.tag(),i=a.skip(s,n);h.push({no:n,wireType:s,data:i})}u.$unknown=h}function Nl(u,e){if(u===void 0)return[];if(e.fieldKind==="enum"||e.fieldKind==="scalar"){for(let t=u.length-1;t>=0;--t)if(u[t].no==e.number)return[u[t]];return[]}return u.filter(t=>t.no===e.number)}function Xs(u,e){const t=u.typeName,l=Object.assign(Object.assign({},u),{kind:"field",parent:u.extendee,localName:t}),h=Object.assign(Object.assign({},u.extendee),{fields:[l],members:[l],oneofs:[]}),v=it(h,e!==void 0?{[t]:e}:void 0);return[ut(h,v),l,()=>{const o=v[t];if(o===void 0){const r=u.message;return Ts(r)?es(r.fields[0].scalar,r.fields[0].longAsString):it(r)}return o}]}function Ki(u,e){if(u.extendee.typeName!=e.$typeName)throw new Error(`extension ${u.typeName} can only be applied to message ${u.extendee.typeName}`)}const $l=3,Ul=2,Nr={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Fl(u){return u?Object.assign(Object.assign({},Nr),u):Nr}function Vl(u,e,t){return As(ut(u,e),Fl(t))}function As(u,e){var t;const l=Gl(u,e);if(l!==void 0)return l;const h={};for(const v of u.sortedFields){if(!u.isSet(v)){if(v.presence==$l)throw new Error(`cannot encode ${v} to JSON: required field not set`);if(!e.alwaysEmitImplicit||v.presence!==Ul)continue}const o=$r(v,u.get(v),e);o!==void 0&&(h[Kl(v,e)]=o)}if(e.registry){const v=new Set;for(const{no:o}of(t=u.getUnknown())!==null&&t!==void 0?t:[])if(!v.has(o)){v.add(o);const r=e.registry.getExtensionFor(u.desc,o);if(!r)continue;const a=kl(u.message,r),[n,s]=Xs(r,a),i=$r(s,n.get(s),e);i!==void 0&&(h[r.jsonName]=i)}}return h}function $r(u,e,t){switch(u.fieldKind){case"scalar":return Ys(u,e);case"message":return As(e,t);case"enum":return Gn(u.enum,e,t.enumAsInteger);case"list":return Hl(e,t);case"map":return Wl(e,t)}}function Wl(u,e){const t=u.field(),l={};switch(t.mapKind){case"scalar":for(const[h,v]of u)l[h]=Ys(t,v);break;case"message":for(const[h,v]of u)l[h]=As(v,e);break;case"enum":for(const[h,v]of u)l[h]=Gn(t.enum,v,e.enumAsInteger);break}return e.alwaysEmitImplicit||u.size>0?l:void 0}function Hl(u,e){const t=u.field(),l=[];switch(t.listKind){case"scalar":for(const h of u)l.push(Ys(t,h));break;case"enum":for(const h of u)l.push(Gn(t.enum,h,e.enumAsInteger));break;case"message":for(const h of u)l.push(As(h,e));break}return e.alwaysEmitImplicit||l.length>0?l:void 0}function Gn(u,e,t){var l;if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: expected number, got ${Qe(e)}`);if(u.typeName=="google.protobuf.NullValue")return null;if(t)return e;const h=u.value[e];return(l=h==null?void 0:h.name)!==null&&l!==void 0?l:e}function Ys(u,e){var t,l,h,v,o,r;switch(u.scalar){case ie.INT32:case ie.SFIXED32:case ie.SINT32:case ie.FIXED32:case ie.UINT32:if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: ${(t=Jt(u,e))===null||t===void 0?void 0:t.message}`);return e;case ie.FLOAT:case ie.DOUBLE:if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: ${(l=Jt(u,e))===null||l===void 0?void 0:l.message}`);return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case ie.STRING:if(typeof e!="string")throw new Error(`cannot encode ${u} to JSON: ${(h=Jt(u,e))===null||h===void 0?void 0:h.message}`);return e;case ie.BOOL:if(typeof e!="boolean")throw new Error(`cannot encode ${u} to JSON: ${(v=Jt(u,e))===null||v===void 0?void 0:v.message}`);return e;case ie.UINT64:case ie.FIXED64:case ie.INT64:case ie.SFIXED64:case ie.SINT64:if(typeof e!="bigint"&&typeof e!="string")throw new Error(`cannot encode ${u} to JSON: ${(o=Jt(u,e))===null||o===void 0?void 0:o.message}`);return e.toString();case ie.BYTES:if(e instanceof Uint8Array)return Ga(e);throw new Error(`cannot encode ${u} to JSON: ${(r=Jt(u,e))===null||r===void 0?void 0:r.message}`)}}function Kl(u,e){return e.useProtoFieldName?u.name:u.jsonName}function Gl(u,e){if(u.desc.typeName.startsWith("google.protobuf."))switch(u.desc.typeName){case"google.protobuf.Any":return zl(u.message,e);case"google.protobuf.Timestamp":return Yl(u.message);case"google.protobuf.Duration":return Zl(u.message);case"google.protobuf.FieldMask":return Xl(u.message);case"google.protobuf.Struct":return Gi(u.message);case"google.protobuf.Value":return zn(u.message);case"google.protobuf.ListValue":return zi(u.message);default:if(Ts(u.desc)){const t=u.desc.fields[0];return Ys(t,u.get(t))}return}}function zl(u,e){if(u.typeUrl==="")return{};const{registry:t}=e;let l,h;if(t&&(l=xl(u,t),l&&(h=t.getMessage(l.$typeName))),!h||!l)throw new Error(`cannot encode message ${u.$typeName} to JSON: "${u.typeUrl}" is not in the type registry`);let v=As(ut(h,l),e);return(h.typeName.startsWith("google.protobuf.")||v===null||Array.isArray(v)||typeof v!="object")&&(v={value:v}),v["@type"]=u.typeUrl,v}function Zl(u){if(Number(u.seconds)>315576e6||Number(u.seconds)<-315576e6)throw new Error(`cannot encode message ${u.$typeName} to JSON: value out of range`);let e=u.seconds.toString();if(u.nanos!==0){let t=Math.abs(u.nanos).toString();t="0".repeat(9-t.length)+t,t.substring(3)==="000000"?t=t.substring(0,3):t.substring(6)==="000"&&(t=t.substring(0,6)),e+="."+t,u.nanos<0&&Number(u.seconds)==0&&(e="-"+e)}return e+"s"}function Xl(u){return u.paths.map(e=>{if(e.match(/_[0-9]?_/g)||e.match(/[A-Z]/g))throw new Error(`cannot encode message ${u.$typeName} to JSON: lowerCamelCase of path name "`+e+'" is irreversible');return Cs(e)}).join(",")}function Gi(u){const e={};for(const[t,l]of Object.entries(u.fields))e[t]=zn(l);return e}function zn(u){switch(u.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(u.kind.value))throw new Error(`${u.$typeName} cannot be NaN or Infinity`);return u.kind.value;case"boolValue":return u.kind.value;case"stringValue":return u.kind.value;case"structValue":return Gi(u.kind.value);case"listValue":return zi(u.kind.value);default:throw new Error(`${u.$typeName} must have a value`)}}function zi(u){return u.values.map(zn)}function Yl(u){const e=Number(u.seconds)*1e3;if(e<Date.parse("0001-01-01T00:00:00Z")||e>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${u.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(u.nanos<0)throw new Error(`cannot encode message ${u.$typeName} to JSON: nanos must not be negative`);let t="Z";if(u.nanos>0){const l=(u.nanos+1e9).toString().substring(1);l.substring(3)==="000000"?t="."+l.substring(0,3)+"Z":l.substring(6)==="000"?t="."+l.substring(0,6)+"Z":t="."+l+"Z"}return new Date(e).toISOString().replace(".000Z",t)}const Ur={ignoreUnknownFields:!1};function Jl(u){return u?Object.assign(Object.assign({},Ur),u):Ur}function Ql(u,e,t){const l=ut(u);try{ls(l,e,Jl(t))}catch(h){throw Xa(h)?new Error(`cannot decode ${h.field()} from JSON: ${h.message}`,{cause:h}):h}return l.message}function ls(u,e,t){var l;if(ic(u,e,t))return;if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode ${u.desc} from JSON: ${Qe(e)}`);const h=new Map,v=new Map;for(const o of u.desc.fields)v.set(o.name,o).set(o.jsonName,o);for(const[o,r]of Object.entries(e)){const a=v.get(o);if(a){if(a.oneof){if(r===null&&a.fieldKind=="scalar")continue;const n=h.get(a.oneof);if(n!==void 0)throw new ot(a.oneof,`oneof set multiple times by ${n.name} and ${a.name}`);h.set(a.oneof,a)}Fr(u,a,r,t)}else{let n;if(o.startsWith("[")&&o.endsWith("]")&&(n=(l=t.registry)===null||l===void 0?void 0:l.getExtension(o.substring(1,o.length-1)))&&n.extendee.typeName===u.desc.typeName){const[s,i,d]=Xs(n);Fr(s,i,r,t),Bl(u.message,n,d())}if(!n&&!t.ignoreUnknownFields)throw new Error(`cannot decode ${u.desc} from JSON: key "${o}" is unknown`)}}}function Fr(u,e,t,l){switch(e.fieldKind){case"scalar":nc(u,e,t);break;case"enum":sc(u,e,t,l);break;case"message":tc(u,e,t,l);break;case"list":ec(u.get(e),t,l);break;case"map":ql(u.get(e),t,l);break}}function ql(u,e,t){if(e===null)return;const l=u.field();if(typeof e!="object"||Array.isArray(e))throw new ot(l,"expected object, got "+Qe(e));for(const[h,v]of Object.entries(e)){if(v===null)throw new ot(l,"map value must not be null");let o;switch(l.mapKind){case"message":const a=ut(l.message);ls(a,v,t),o=a;break;case"enum":if(o=Zn(l.enum,v,t.ignoreUnknownFields,!0),o===Js)return;break;case"scalar":o=qs(l,v,!0);break}const r=rc(l.mapKey,h);u.set(r,o)}}function ec(u,e,t){if(e===null)return;const l=u.field();if(!Array.isArray(e))throw new ot(l,"expected Array, got "+Qe(e));for(const h of e){if(h===null)throw new ot(l,"list item must not be null");switch(l.listKind){case"message":const v=ut(l.message);ls(v,h,t),u.add(v);break;case"enum":const o=Zn(l.enum,h,t.ignoreUnknownFields,!0);o!==Js&&u.add(o);break;case"scalar":u.add(qs(l,h,!0));break}}}function tc(u,e,t,l){if(t===null&&e.message.typeName!="google.protobuf.Value"){u.clear(e);return}const h=u.isSet(e)?u.get(e):ut(e.message);ls(h,t,l),u.set(e,h)}function sc(u,e,t,l){const h=Zn(e.enum,t,l.ignoreUnknownFields,!1);h===Qs?u.clear(e):h!==Js&&u.set(e,h)}function nc(u,e,t){const l=qs(e,t,!1);l===Qs?u.clear(e):u.set(e,l)}const Js=Symbol();function Zn(u,e,t,l){if(e===null)return u.typeName=="google.protobuf.NullValue"?0:l?u.values[0].number:Qs;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const h=u.values.find(v=>v.name===e);if(h!==void 0)return h.number;if(t)return Js;break}throw new Error(`cannot decode ${u} from JSON: ${Qe(e)}`)}const Qs=Symbol();function qs(u,e,t){if(e===null)return t?es(u.scalar,!1):Qs;switch(u.scalar){case ie.DOUBLE:case ie.FLOAT:if(e==="NaN")return NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof e=="number"){if(Number.isNaN(e))throw new ot(u,"unexpected NaN number");if(!Number.isFinite(e))throw new ot(u,"unexpected infinite number");break}if(typeof e=="string"){if(e===""||e.trim().length!==e.length)break;const l=Number(e);if(!Number.isFinite(l))break;return l}break;case ie.INT32:case ie.FIXED32:case ie.SFIXED32:case ie.SINT32:case ie.UINT32:return Zi(e);case ie.BYTES:if(typeof e=="string"){if(e==="")return new Uint8Array(0);try{return vi(e)}catch(l){const h=l instanceof Error?l.message:String(l);throw new ot(u,h)}}break}return e}function rc(u,e){switch(u){case ie.BOOL:switch(e){case"true":return!0;case"false":return!1}return e;case ie.INT32:case ie.FIXED32:case ie.UINT32:case ie.SFIXED32:case ie.SINT32:return Zi(e);default:return e}}function Zi(u){if(typeof u=="string"){if(u===""||u.trim().length!==u.length)return u;const e=Number(u);return Number.isNaN(e)?u:e}return u}function ic(u,e,t){if(!u.desc.typeName.startsWith("google.protobuf."))return!1;switch(u.desc.typeName){case"google.protobuf.Any":return oc(u.message,e,t),!0;case"google.protobuf.Timestamp":return ac(u.message,e),!0;case"google.protobuf.Duration":return lc(u.message,e),!0;case"google.protobuf.FieldMask":return cc(u.message,e),!0;case"google.protobuf.Struct":return Xi(u.message,e),!0;case"google.protobuf.Value":return Xn(u.message,e),!0;case"google.protobuf.ListValue":return Yi(u.message,e),!0;default:if(Ts(u.desc)){const l=u.desc.fields[0];return e===null?u.clear(l):u.set(l,qs(l,e,!0)),!0}return!1}}function oc(u,e,t){var l;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${u.$typeName} from JSON: expected object but got ${Qe(e)}`);if(Object.keys(e).length==0)return;const h=e["@type"];if(typeof h!="string"||h=="")throw new Error(`cannot decode message ${u.$typeName} from JSON: "@type" is empty`);const v=h.includes("/")?h.substring(h.lastIndexOf("/")+1):h;if(!v.length)throw new Error(`cannot decode message ${u.$typeName} from JSON: "@type" is invalid`);const o=(l=t.registry)===null||l===void 0?void 0:l.getMessage(v);if(!o)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${h} is not in the type registry`);const r=ut(o);if(v.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value")){const a=e.value;ls(r,a,t)}else{const a=Object.assign({},e);delete a["@type"],ls(r,a,t)}Il(r.desc,r.message,u)}function ac(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const t=e.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(!t)throw new Error(`cannot decode message ${u.$typeName} from JSON: invalid RFC 3339 string`);const l=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(l))throw new Error(`cannot decode message ${u.$typeName} from JSON: invalid RFC 3339 string`);if(l<Date.parse("0001-01-01T00:00:00Z")||l>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${u.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);u.seconds=Ve.parse(l/1e3),u.nanos=0,t[7]&&(u.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9)}function lc(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const t=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(t===null)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const l=Number(t[1]);if(l>315576e6||l<-315576e6)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);if(u.seconds=Ve.parse(l),typeof t[2]!="string")return;const h=t[2]+"0".repeat(9-t[2].length);u.nanos=parseInt(h),(l<0||Object.is(l,-0))&&(u.nanos=-u.nanos)}function cc(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);if(e==="")return;function t(l){if(l.includes("_"))throw new Error(`cannot decode message ${u.$typeName} from JSON: path names must be lowerCamelCase`);const h=l.replace(/[A-Z]/g,v=>"_"+v.toLowerCase());return h[0]==="_"?h.substring(1):h}u.paths=e.split(",").map(t)}function Xi(u,e){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`);for(const[t,l]of Object.entries(e)){const h=it(Hi);Xn(h,l),u.fields[t]=h}}function Xn(u,e){switch(typeof e){case"number":u.kind={case:"numberValue",value:e};break;case"string":u.kind={case:"stringValue",value:e};break;case"boolean":u.kind={case:"boolValue",value:e};break;case"object":if(e===null)u.kind={case:"nullValue",value:Sn.NULL_VALUE};else if(Array.isArray(e)){const t=it(Rl);Yi(t,e),u.kind={case:"listValue",value:t}}else{const t=it(Pl);Xi(t,e),u.kind={case:"structValue",value:t}}break;default:throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`)}return u}function Yi(u,e){if(!Array.isArray(e))throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`);for(const t of e){const l=it(Hi);Xn(l,t),u.values.push(l)}}var jn=function(u,e){return jn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,l){t.__proto__=l}||function(t,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(t[h]=l[h])},jn(u,e)};function jt(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jn(u,e);function t(){this.constructor=u}u.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function dc(u,e,t,l){function h(v){return v instanceof t?v:new t(function(o){o(v)})}return new(t||(t=Promise))(function(v,o){function r(s){try{n(l.next(s))}catch(i){o(i)}}function a(s){try{n(l.throw(s))}catch(i){o(i)}}function n(s){s.done?v(s.value):h(s.value).then(r,a)}n((l=l.apply(u,e||[])).next())})}function Ji(u,e){var t={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},l,h,v,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=r(0),o.throw=r(1),o.return=r(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function r(n){return function(s){return a([n,s])}}function a(n){if(l)throw new TypeError("Generator is already executing.");for(;o&&(o=0,n[0]&&(t=0)),t;)try{if(l=1,h&&(v=n[0]&2?h.return:n[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,n[1])).done)return v;switch(h=0,v&&(n=[n[0]&2,v.value]),n[0]){case 0:case 1:v=n;break;case 4:return t.label++,{value:n[1],done:!1};case 5:t.label++,h=n[1],n=[0];continue;case 7:n=t.ops.pop(),t.trys.pop();continue;default:if(v=t.trys,!(v=v.length>0&&v[v.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!v||n[1]>v[0]&&n[1]<v[3])){t.label=n[1];break}if(n[0]===6&&t.label<v[1]){t.label=v[1],v=n;break}if(v&&t.label<v[2]){t.label=v[2],t.ops.push(n);break}v[2]&&t.ops.pop(),t.trys.pop();continue}n=e.call(u,t)}catch(s){n=[6,s],h=0}finally{l=v=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}function cs(u){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&u[e],l=0;if(t)return t.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&l>=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _t(u,e){var t=typeof Symbol=="function"&&u[Symbol.iterator];if(!t)return u;var l=t.call(u),h,v=[],o;try{for(;(e===void 0||e-- >0)&&!(h=l.next()).done;)v.push(h.value)}catch(r){o={error:r}}finally{try{h&&!h.done&&(t=l.return)&&t.call(l)}finally{if(o)throw o.error}}return v}function Et(u,e,t){if(t||arguments.length===2)for(var l=0,h=e.length,v;l<h;l++)(v||!(l in e))&&(v||(v=Array.prototype.slice.call(e,0,l)),v[l]=e[l]);return u.concat(v||Array.prototype.slice.call(e))}function is(u){return this instanceof is?(this.v=u,this):new is(u)}function uc(u,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=t.apply(u,e||[]),h,v=[];return h=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),r("next"),r("throw"),r("return",o),h[Symbol.asyncIterator]=function(){return this},h;function o(p){return function(m){return Promise.resolve(m).then(p,i)}}function r(p,m){l[p]&&(h[p]=function(c){return new Promise(function(f,g){v.push([p,c,f,g])>1||a(p,c)})},m&&(h[p]=m(h[p])))}function a(p,m){try{n(l[p](m))}catch(c){d(v[0][3],c)}}function n(p){p.value instanceof is?Promise.resolve(p.value.v).then(s,i):d(v[0][2],p)}function s(p){a("next",p)}function i(p){a("throw",p)}function d(p,m){p(m),v.shift(),v.length&&a(v[0][0],v[0][1])}}function hc(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=u[Symbol.asyncIterator],t;return e?e.call(u):(u=typeof cs=="function"?cs(u):u[Symbol.iterator](),t={},l("next"),l("throw"),l("return"),t[Symbol.asyncIterator]=function(){return this},t);function l(v){t[v]=u[v]&&function(o){return new Promise(function(r,a){o=u[v](o),h(r,a,o.done,o.value)})}}function h(v,o,r,a){Promise.resolve(a).then(function(n){v({value:n,done:r})},o)}}function Ne(u){return typeof u=="function"}function Qi(u){var e=function(l){Error.call(l),l.stack=new Error().stack},t=u(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var pn=Qi(function(u){return function(t){u(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
3
|
-
`+t.map(function(l,h){return h+1+") "+l.toString()}).join(`
|
|
4
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function Hs(u,e){if(u){var t=u.indexOf(e);0<=t&&u.splice(t,1)}}var Ps=function(){function u(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return u.prototype.unsubscribe=function(){var e,t,l,h,v;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var r=cs(o),a=r.next();!a.done;a=r.next()){var n=a.value;n.remove(this)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}else o.remove(this);var s=this.initialTeardown;if(Ne(s))try{s()}catch(c){v=c instanceof pn?c.errors:[c]}var i=this._finalizers;if(i){this._finalizers=null;try{for(var d=cs(i),p=d.next();!p.done;p=d.next()){var m=p.value;try{Vr(m)}catch(c){v=v??[],c instanceof pn?v=Et(Et([],_t(v)),_t(c.errors)):v.push(c)}}}catch(c){l={error:c}}finally{try{p&&!p.done&&(h=d.return)&&h.call(d)}finally{if(l)throw l.error}}}if(v)throw new pn(v)}},u.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Vr(e);else{if(e instanceof u){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},u.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},u.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},u.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Hs(t,e)},u.prototype.remove=function(e){var t=this._finalizers;t&&Hs(t,e),e instanceof u&&e._removeParent(this)},u.EMPTY=function(){var e=new u;return e.closed=!0,e}(),u}(),qi=Ps.EMPTY;function eo(u){return u instanceof Ps||u&&"closed"in u&&Ne(u.remove)&&Ne(u.add)&&Ne(u.unsubscribe)}function Vr(u){Ne(u)?u():u.unsubscribe()}var fc={Promise:void 0},mc={setTimeout:function(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];return setTimeout.apply(void 0,Et([u,e],_t(t)))},clearTimeout:function(u){return clearTimeout(u)},delegate:void 0};function to(u){mc.setTimeout(function(){throw u})}function ws(){}function Us(u){u()}var Yn=function(u){jt(e,u);function e(t){var l=u.call(this)||this;return l.isStopped=!1,t?(l.destination=t,eo(t)&&t.add(l)):l.destination=gc,l}return e.create=function(t,l,h){return new Os(t,l,h)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,u.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ps),pc=function(){function u(e){this.partialObserver=e}return u.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(l){Ls(l)}},u.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(l){Ls(l)}else Ls(e)},u.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Ls(t)}},u}(),Os=function(u){jt(e,u);function e(t,l,h){var v=u.call(this)||this,o;return Ne(t)||!t?o={next:t??void 0,error:l??void 0,complete:h??void 0}:o=t,v.destination=new pc(o),v}return e}(Yn);function Ls(u){to(u)}function vc(u){throw u}var gc={closed:!0,next:ws,error:vc,complete:ws},Jn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function en(u){return u}function _c(u){return u.length===0?en:u.length===1?u[0]:function(t){return u.reduce(function(l,h){return h(l)},t)}}var Xe=function(){function u(e){e&&(this._subscribe=e)}return u.prototype.lift=function(e){var t=new u;return t.source=this,t.operator=e,t},u.prototype.subscribe=function(e,t,l){var h=this,v=yc(e)?e:new Os(e,t,l);return Us(function(){var o=h,r=o.operator,a=o.source;v.add(r?r.call(v,a):a?h._subscribe(v):h._trySubscribe(v))}),v},u.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},u.prototype.forEach=function(e,t){var l=this;return t=Wr(t),new t(function(h,v){var o=new Os({next:function(r){try{e(r)}catch(a){v(a),o.unsubscribe()}},error:v,complete:h});l.subscribe(o)})},u.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},u.prototype[Jn]=function(){return this},u.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _c(e)(this)},u.prototype.toPromise=function(e){var t=this;return e=Wr(e),new e(function(l,h){var v;t.subscribe(function(o){return v=o},function(o){return h(o)},function(){return l(v)})})},u.create=function(e){return new u(e)},u}();function Wr(u){var e;return(e=u??fc.Promise)!==null&&e!==void 0?e:Promise}function bc(u){return u&&Ne(u.next)&&Ne(u.error)&&Ne(u.complete)}function yc(u){return u&&u instanceof Yn||bc(u)&&eo(u)}function Cc(u){return Ne(u==null?void 0:u.lift)}function st(u){return function(e){if(Cc(e))return e.lift(function(t){try{return u(t,this)}catch(l){this.error(l)}});throw new TypeError("Unable to lift unknown Observable type")}}function ze(u,e,t,l,h){return new Ec(u,e,t,l,h)}var Ec=function(u){jt(e,u);function e(t,l,h,v,o,r){var a=u.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=r,a._next=l?function(n){try{l(n)}catch(s){t.error(s)}}:u.prototype._next,a._error=v?function(n){try{v(n)}catch(s){t.error(s)}finally{this.unsubscribe()}}:u.prototype._error,a._complete=h?function(){try{h()}catch(n){t.error(n)}finally{this.unsubscribe()}}:u.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var l=this.closed;u.prototype.unsubscribe.call(this),!l&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(Yn),Sc=Qi(function(u){return function(){u(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),dt=function(u){jt(e,u);function e(){var t=u.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var l=new Hr(this,this);return l.operator=t,l},e.prototype._throwIfClosed=function(){if(this.closed)throw new Sc},e.prototype.next=function(t){var l=this;Us(function(){var h,v;if(l._throwIfClosed(),!l.isStopped){l.currentObservers||(l.currentObservers=Array.from(l.observers));try{for(var o=cs(l.currentObservers),r=o.next();!r.done;r=o.next()){var a=r.value;a.next(t)}}catch(n){h={error:n}}finally{try{r&&!r.done&&(v=o.return)&&v.call(o)}finally{if(h)throw h.error}}}})},e.prototype.error=function(t){var l=this;Us(function(){if(l._throwIfClosed(),!l.isStopped){l.hasError=l.isStopped=!0,l.thrownError=t;for(var h=l.observers;h.length;)h.shift().error(t)}})},e.prototype.complete=function(){var t=this;Us(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var l=t.observers;l.length;)l.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),u.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var l=this,h=this,v=h.hasError,o=h.isStopped,r=h.observers;return v||o?qi:(this.currentObservers=null,r.push(t),new Ps(function(){l.currentObservers=null,Hs(r,t)}))},e.prototype._checkFinalizedStatuses=function(t){var l=this,h=l.hasError,v=l.thrownError,o=l.isStopped;h?t.error(v):o&&t.complete()},e.prototype.asObservable=function(){var t=new Xe;return t.source=this,t},e.create=function(t,l){return new Hr(t,l)},e}(Xe),Hr=function(u){jt(e,u);function e(t,l){var h=u.call(this)||this;return h.destination=t,h.source=l,h}return e.prototype.next=function(t){var l,h;(h=(l=this.destination)===null||l===void 0?void 0:l.next)===null||h===void 0||h.call(l,t)},e.prototype.error=function(t){var l,h;(h=(l=this.destination)===null||l===void 0?void 0:l.error)===null||h===void 0||h.call(l,t)},e.prototype.complete=function(){var t,l;(l=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||l===void 0||l.call(t)},e.prototype._subscribe=function(t){var l,h;return(h=(l=this.source)===null||l===void 0?void 0:l.subscribe(t))!==null&&h!==void 0?h:qi},e}(dt),jc={now:function(){return Date.now()}},wc=function(u){jt(e,u);function e(t,l){return u.call(this)||this}return e.prototype.schedule=function(t,l){return this},e}(Ps),Kr={setInterval:function(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];return setInterval.apply(void 0,Et([u,e],_t(t)))},clearInterval:function(u){return clearInterval(u)},delegate:void 0},Oc=function(u){jt(e,u);function e(t,l){var h=u.call(this,t,l)||this;return h.scheduler=t,h.work=l,h.pending=!1,h}return e.prototype.schedule=function(t,l){var h;if(l===void 0&&(l=0),this.closed)return this;this.state=t;var v=this.id,o=this.scheduler;return v!=null&&(this.id=this.recycleAsyncId(o,v,l)),this.pending=!0,this.delay=l,this.id=(h=this.id)!==null&&h!==void 0?h:this.requestAsyncId(o,this.id,l),this},e.prototype.requestAsyncId=function(t,l,h){return h===void 0&&(h=0),Kr.setInterval(t.flush.bind(t,this),h)},e.prototype.recycleAsyncId=function(t,l,h){if(h===void 0&&(h=0),h!=null&&this.delay===h&&this.pending===!1)return l;l!=null&&Kr.clearInterval(l)},e.prototype.execute=function(t,l){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var h=this._execute(t,l);if(h)return h;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,l){var h=!1,v;try{this.work(t)}catch(o){h=!0,v=o||new Error("Scheduled action threw falsy error")}if(h)return this.unsubscribe(),v},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,l=t.id,h=t.scheduler,v=h.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Hs(v,this),l!=null&&(this.id=this.recycleAsyncId(h,l,null)),this.delay=null,u.prototype.unsubscribe.call(this)}},e}(wc),Gr=function(){function u(e,t){t===void 0&&(t=u.now),this.schedulerActionCtor=e,this.now=t}return u.prototype.schedule=function(e,t,l){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(l,t)},u.now=jc.now,u}(),Ic=function(u){jt(e,u);function e(t,l){l===void 0&&(l=Gr.now);var h=u.call(this,t,l)||this;return h.actions=[],h._active=!1,h}return e.prototype.flush=function(t){var l=this.actions;if(this._active){l.push(t);return}var h;this._active=!0;do if(h=t.execute(t.state,t.delay))break;while(t=l.shift());if(this._active=!1,h){for(;t=l.shift();)t.unsubscribe();throw h}},e}(Gr),tn=new Ic(Oc),Tc=tn,so=new Xe(function(u){return u.complete()});function no(u){return u&&Ne(u.schedule)}function Qn(u){return u[u.length-1]}function xc(u){return Ne(Qn(u))?u.pop():void 0}function ro(u){return no(Qn(u))?u.pop():void 0}function Ac(u,e){return typeof Qn(u)=="number"?u.pop():e}var qn=function(u){return u&&typeof u.length=="number"&&typeof u!="function"};function io(u){return Ne(u==null?void 0:u.then)}function oo(u){return Ne(u[Jn])}function ao(u){return Symbol.asyncIterator&&Ne(u==null?void 0:u[Symbol.asyncIterator])}function lo(u){return new TypeError("You provided "+(u!==null&&typeof u=="object"?"an invalid object":"'"+u+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Pc(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var co=Pc();function uo(u){return Ne(u==null?void 0:u[co])}function ho(u){return uc(this,arguments,function(){var t,l,h,v;return Ji(this,function(o){switch(o.label){case 0:t=u.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,is(t.read())];case 3:return l=o.sent(),h=l.value,v=l.done,v?[4,is(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,is(h)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function fo(u){return Ne(u==null?void 0:u.getReader)}function qe(u){if(u instanceof Xe)return u;if(u!=null){if(oo(u))return Rc(u);if(qn(u))return Dc(u);if(io(u))return Mc(u);if(ao(u))return mo(u);if(uo(u))return Lc(u);if(fo(u))return kc(u)}throw lo(u)}function Rc(u){return new Xe(function(e){var t=u[Jn]();if(Ne(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Dc(u){return new Xe(function(e){for(var t=0;t<u.length&&!e.closed;t++)e.next(u[t]);e.complete()})}function Mc(u){return new Xe(function(e){u.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,to)})}function Lc(u){return new Xe(function(e){var t,l;try{for(var h=cs(u),v=h.next();!v.done;v=h.next()){var o=v.value;if(e.next(o),e.closed)return}}catch(r){t={error:r}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(t)throw t.error}}e.complete()})}function mo(u){return new Xe(function(e){Bc(u,e).catch(function(t){return e.error(t)})})}function kc(u){return mo(ho(u))}function Bc(u,e){var t,l,h,v;return dc(this,void 0,void 0,function(){var o,r;return Ji(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=hc(u),a.label=1;case 1:return[4,t.next()];case 2:if(l=a.sent(),!!l.done)return[3,4];if(o=l.value,e.next(o),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return r=a.sent(),h={error:r},[3,11];case 6:return a.trys.push([6,,9,10]),l&&!l.done&&(v=t.return)?[4,v.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(h)throw h.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function qt(u,e,t,l,h){l===void 0&&(l=0),h===void 0&&(h=!1);var v=e.schedule(function(){t(),h?u.add(this.schedule(null,l)):this.unsubscribe()},l);if(u.add(v),!h)return v}function po(u,e){return e===void 0&&(e=0),st(function(t,l){t.subscribe(ze(l,function(h){return qt(l,u,function(){return l.next(h)},e)},function(){return qt(l,u,function(){return l.complete()},e)},function(h){return qt(l,u,function(){return l.error(h)},e)}))})}function vo(u,e){return e===void 0&&(e=0),st(function(t,l){l.add(u.schedule(function(){return t.subscribe(l)},e))})}function Nc(u,e){return qe(u).pipe(vo(e),po(e))}function $c(u,e){return qe(u).pipe(vo(e),po(e))}function Uc(u,e){return new Xe(function(t){var l=0;return e.schedule(function(){l===u.length?t.complete():(t.next(u[l++]),t.closed||this.schedule())})})}function Fc(u,e){return new Xe(function(t){var l;return qt(t,e,function(){l=u[co](),qt(t,e,function(){var h,v,o;try{h=l.next(),v=h.value,o=h.done}catch(r){t.error(r);return}o?t.complete():t.next(v)},0,!0)}),function(){return Ne(l==null?void 0:l.return)&&l.return()}})}function go(u,e){if(!u)throw new Error("Iterable cannot be null");return new Xe(function(t){qt(t,e,function(){var l=u[Symbol.asyncIterator]();qt(t,e,function(){l.next().then(function(h){h.done?t.complete():t.next(h.value)})},0,!0)})})}function Vc(u,e){return go(ho(u),e)}function Wc(u,e){if(u!=null){if(oo(u))return Nc(u,e);if(qn(u))return Uc(u,e);if(io(u))return $c(u,e);if(ao(u))return go(u,e);if(uo(u))return Fc(u,e);if(fo(u))return Vc(u,e)}throw lo(u)}function _o(u,e){return e?Wc(u,e):qe(u)}function Hc(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=ro(u);return _o(u,t)}function Kc(u){return u instanceof Date&&!isNaN(u)}function at(u,e){return st(function(t,l){var h=0;t.subscribe(ze(l,function(v){l.next(u.call(e,v,h++))}))})}var Gc=Array.isArray;function zc(u,e){return Gc(e)?u.apply(void 0,Et([],_t(e))):u(e)}function Zc(u){return at(function(e){return zc(u,e)})}function Xc(u,e,t,l,h,v,o,r){var a=[],n=0,s=0,i=!1,d=function(){i&&!a.length&&!n&&e.complete()},p=function(c){return n<l?m(c):a.push(c)},m=function(c){n++;var f=!1;qe(t(c,s++)).subscribe(ze(e,function(g){e.next(g)},function(){f=!0},void 0,function(){if(f)try{n--;for(var g=function(){var _=a.shift();o||m(_)};a.length&&n<l;)g();d()}catch(_){e.error(_)}}))};return u.subscribe(ze(e,p,function(){i=!0,d()})),function(){}}function Is(u,e,t){return t===void 0&&(t=1/0),Ne(e)?Is(function(l,h){return at(function(v,o){return e(l,v,h,o)})(qe(u(l,h)))},t):(typeof e=="number"&&(t=e),st(function(l,h){return Xc(l,h,u,t)}))}function Yc(u){return u===void 0&&(u=1/0),Is(en,u)}function Jc(u){return new Xe(function(e){qe(u()).subscribe(e)})}var Qc={connector:function(){return new dt},resetOnDisconnect:!0};function Yt(u,e){e===void 0&&(e=Qc);var t=null,l=e.connector,h=e.resetOnDisconnect,v=h===void 0?!0:h,o=l(),r=new Xe(function(a){return o.subscribe(a)});return r.connect=function(){return(!t||t.closed)&&(t=Jc(function(){return u}).subscribe(o),v&&t.add(function(){return o=l()})),t},r}var qc=["addListener","removeListener"],ed=["addEventListener","removeEventListener"],td=["on","off"];function wn(u,e,t,l){if(Ne(t)&&(l=t,t=void 0),l)return wn(u,e,t).pipe(Zc(l));var h=_t(rd(u)?ed.map(function(r){return function(a){return u[r](e,a,t)}}):sd(u)?qc.map(zr(u,e)):nd(u)?td.map(zr(u,e)):[],2),v=h[0],o=h[1];if(!v&&qn(u))return Is(function(r){return wn(r,e,t)})(qe(u));if(!v)throw new TypeError("Invalid event target");return new Xe(function(r){var a=function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return r.next(1<n.length?n:n[0])};return v(a),function(){return o(a)}})}function zr(u,e){return function(t){return function(l){return u[t](e,l)}}}function sd(u){return Ne(u.addListener)&&Ne(u.removeListener)}function nd(u){return Ne(u.on)&&Ne(u.off)}function rd(u){return Ne(u.addEventListener)&&Ne(u.removeEventListener)}function bs(u,e,t){u===void 0&&(u=0),t===void 0&&(t=Tc);var l=-1;return e!=null&&(no(e)?t=e:l=e),new Xe(function(h){var v=Kc(u)?+u-t.now():u;v<0&&(v=0);var o=0;return t.schedule(function(){h.closed||(h.next(o++),0<=l?this.schedule(void 0,l):h.complete())},v)})}function id(u,e){return e===void 0&&(e=tn),bs(u,u,e)}function od(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=ro(u),l=Ac(u,1/0),h=u;return h.length?h.length===1?qe(h[0]):Yc(l)(_o(h,t)):so}var ad=Array.isArray;function ld(u){return u.length===1&&ad(u[0])?u[0]:u}function yt(u,e){return st(function(t,l){var h=0;t.subscribe(ze(l,function(v){return u.call(e,v,h++)&&l.next(v)}))})}function cd(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return u=ld(u),u.length===1?qe(u[0]):new Xe(dd(u))}function dd(u){return function(e){for(var t=[],l=function(v){t.push(qe(u[v]).subscribe(ze(e,function(o){if(t){for(var r=0;r<t.length;r++)r!==v&&t[r].unsubscribe();t=null}e.next(o)})))},h=0;t&&!e.closed&&h<u.length;h++)l(h)}}function ud(u){return st(function(e,t){var l=null,h=null,v=function(){h==null||h.unsubscribe();var o=l;l=[],o&&t.next(o),qe(u()).subscribe(h=ze(t,v,ws))};v(),e.subscribe(ze(t,function(o){return l==null?void 0:l.push(o)},function(){l&&t.next(l),t.complete()},void 0,function(){return l=h=null}))})}function bo(u){return st(function(e,t){var l=null,h=!1,v;l=e.subscribe(ze(t,void 0,void 0,function(o){v=qe(u(o,bo(u)(e))),l?(l.unsubscribe(),l=null,v.subscribe(t)):h=!0})),h&&(l.unsubscribe(),l=null,v.subscribe(t))})}function hd(u,e,t,l,h){return function(v,o){var r=t,a=e,n=0;v.subscribe(ze(o,function(s){var i=n++;a=r?u(a,s,i):(r=!0,s),o.next(a)},h))}}function Zr(u){return u<=0?function(){return so}:st(function(e,t){var l=0;e.subscribe(ze(t,function(h){++l<=u&&(t.next(h),u<=l&&t.complete())}))})}function fd(u){return st(function(e,t){try{e.subscribe(t)}finally{t.add(u)}})}function md(u,e){return st(hd(u,e,arguments.length>=2,!0))}function pd(u){u===void 0&&(u={});var e=u.connector,t=e===void 0?function(){return new dt}:e,l=u.resetOnError,h=l===void 0?!0:l,v=u.resetOnComplete,o=v===void 0?!0:v,r=u.resetOnRefCountZero,a=r===void 0?!0:r;return function(n){var s,i,d,p=0,m=!1,c=!1,f=function(){i==null||i.unsubscribe(),i=void 0},g=function(){f(),s=d=void 0,m=c=!1},_=function(){var b=s;g(),b==null||b.unsubscribe()};return st(function(b,y){p++,!c&&!m&&f();var C=d=d??t();y.add(function(){p--,p===0&&!c&&!m&&(i=vn(_,a))}),C.subscribe(y),!s&&p>0&&(s=new Os({next:function(S){return C.next(S)},error:function(S){c=!0,f(),i=vn(g,h,S),C.error(S)},complete:function(){m=!0,f(),i=vn(g,o),C.complete()}}),qe(b).subscribe(s))})(n)}}function vn(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];if(e===!0){u();return}if(e!==!1){var h=new Os({next:function(){h.unsubscribe(),u()}});return qe(e.apply(void 0,Et([],_t(t)))).subscribe(h)}}function vd(u){return st(function(e,t){var l=!1,h=ze(t,function(){h==null||h.unsubscribe(),l=!0},ws);qe(u).subscribe(h),e.subscribe(ze(t,function(v){return l&&t.next(v)}))})}function Xr(u,e){return st(function(t,l){var h=null,v=0,o=!1,r=function(){return o&&!h&&l.complete()};t.subscribe(ze(l,function(a){h==null||h.unsubscribe();var n=0,s=v++;qe(u(a,s)).subscribe(h=ze(l,function(i){return l.next(e?e(a,i,s,n++):i)},function(){h=null,r()}))},function(){o=!0,r()}))})}function ks(u,e){return e===void 0&&(e=!1),st(function(t,l){var h=0;t.subscribe(ze(l,function(v){var o=u(v,h++);(o||e)&&l.next(v),!o&&l.complete()}))})}function Yr(u,e,t){var l=Ne(u)||e||t?{next:u,error:e,complete:t}:u;return l?st(function(h,v){var o;(o=l.subscribe)===null||o===void 0||o.call(l);var r=!0;h.subscribe(ze(v,function(a){var n;(n=l.next)===null||n===void 0||n.call(l,a),v.next(a)},function(){var a;r=!1,(a=l.complete)===null||a===void 0||a.call(l),v.complete()},function(a){var n;r=!1,(n=l.error)===null||n===void 0||n.call(l,a),v.error(a)},function(){var a,n;r&&((a=l.unsubscribe)===null||a===void 0||a.call(l)),(n=l.finalize)===null||n===void 0||n.call(l)}))}):en}function gd(u,e){return st(function(t,l){var h=e??{},v=h.leading,o=v===void 0?!0:v,r=h.trailing,a=r===void 0?!1:r,n=!1,s=null,i=null,d=!1,p=function(){i==null||i.unsubscribe(),i=null,a&&(f(),d&&l.complete())},m=function(){i=null,d&&l.complete()},c=function(g){return i=qe(u(g)).subscribe(ze(l,p,m))},f=function(){if(n){n=!1;var g=s;s=null,l.next(g),!d&&c(g)}};t.subscribe(ze(l,function(g){n=!0,s=g,!(i&&!i.closed)&&(o?f():c(g))},function(){d=!0,!(a&&n&&i&&!i.closed)&&l.complete()}))})}function Jr(u,e,t){e===void 0&&(e=tn);var l=bs(u,e);return gd(function(){return l},t)}function gn(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=xc(u);return st(function(l,h){for(var v=u.length,o=new Array(v),r=u.map(function(){return!1}),a=!1,n=function(i){qe(u[i]).subscribe(ze(h,function(d){o[i]=d,!a&&!r[i]&&(r[i]=!0,(a=r.every(en))&&(r=null))},ws))},s=0;s<v;s++)n(s);l.subscribe(ze(h,function(i){if(a){var d=Et([i],_t(o));h.next(t?t.apply(void 0,Et([],_t(d))):d)}}))})}const yo="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ks=32,_d=16,Co=10,Qr=0xffffffffffff;var Qt;(function(u){u.Base32IncorrectEncoding="B32_ENC_INVALID",u.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",u.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",u.EncodeTimeNegative="ENC_TIME_NEG",u.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",u.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",u.PRNGDetectFailure="PRNG_DETECT",u.ULIDInvalid="ULID_INVALID",u.Unexpected="UNEXPECTED",u.UUIDInvalid="UUID_INVALID"})(Qt||(Qt={}));class gs extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function bd(u){const e=Math.floor(u()*Ks)%Ks;return yo.charAt(e)}function yd(u){const e=Cd(),t=e&&(e.crypto||e.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const l=new Uint8Array(1);return t.getRandomValues(l),l[0]/255};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/255;throw new gs(Qt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Cd(){return jd()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Ed(u,e){let t="";for(;u>0;u--)t=bd(e)+t;return t}function Sd(u,e=Co){if(isNaN(u))throw new gs(Qt.EncodeTimeValueMalformed,`Time must be a number: ${u}`);if(u>Qr)throw new gs(Qt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Qr}: ${u}`);if(u<0)throw new gs(Qt.EncodeTimeNegative,`Time must be positive: ${u}`);if(Number.isInteger(u)===!1)throw new gs(Qt.EncodeTimeValueMalformed,`Time must be an integer: ${u}`);let t,l="";for(let h=e;h>0;h--)t=u%Ks,l=yo.charAt(t)+l,u=(u-t)/Ks;return l}function jd(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function wd(u,e){const t=yd(),l=Date.now();return Sd(l,Co)+Ed(_d,t)}const tt=[];for(let u=0;u<256;++u)tt.push((u+256).toString(16).slice(1));function Od(u,e=0){return(tt[u[e+0]]+tt[u[e+1]]+tt[u[e+2]]+tt[u[e+3]]+"-"+tt[u[e+4]]+tt[u[e+5]]+"-"+tt[u[e+6]]+tt[u[e+7]]+"-"+tt[u[e+8]]+tt[u[e+9]]+"-"+tt[u[e+10]]+tt[u[e+11]]+tt[u[e+12]]+tt[u[e+13]]+tt[u[e+14]]+tt[u[e+15]]).toLowerCase()}let _n;const Id=new Uint8Array(16);function Td(){if(!_n){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");_n=crypto.getRandomValues.bind(crypto)}return _n(Id)}const xd=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qr={randomUUID:xd};function Ad(u,e,t){var h;if(qr.randomUUID&&!u)return qr.randomUUID();u=u||{};const l=u.random??((h=u.rng)==null?void 0:h.call(u))??Td();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Od(l)}const Pd=St("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Rd=gl(Pd,0),Dd=Wn(Rd),Md=St("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Eo=St("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[Md,Zs]),On=zs(Eo,3),Ld=zs(Eo,4);var kd={"./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/google/protobuf/wrappers_pb.js":(u,e,t)=>{t.r(e),t.d(e,{BoolValue:()=>_,BytesValue:()=>S,DoubleValue:()=>o,FloatValue:()=>a,Int32Value:()=>m,Int64Value:()=>s,StringValue:()=>y,UInt32Value:()=>f,UInt64Value:()=>d});var l=t("./node_modules/@protobuf-ts/runtime/build/es2015/reflection-info.js"),h=t("./node_modules/@protobuf-ts/runtime/build/es2015/message-type.js");class v extends h.MessageType{constructor(){super("google.protobuf.DoubleValue",[{no:1,name:"value",kind:"scalar",T:1}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(2,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,1,void 0,"value"),I}}const o=new v;class r extends h.MessageType{constructor(){super("google.protobuf.FloatValue",[{no:1,name:"value",kind:"scalar",T:2}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(1,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,1,void 0,"value"),I}}const a=new r;class n extends h.MessageType{constructor(){super("google.protobuf.Int64Value",[{no:1,name:"value",kind:"scalar",T:3}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(l.ScalarType.INT64,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,l.ScalarType.INT64,l.LongType.STRING,"value"),I}}const s=new n;class i extends h.MessageType{constructor(){super("google.protobuf.UInt64Value",[{no:1,name:"value",kind:"scalar",T:4}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(l.ScalarType.UINT64,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,l.ScalarType.UINT64,l.LongType.STRING,"value"),I}}const d=new i;class p extends h.MessageType{constructor(){super("google.protobuf.Int32Value",[{no:1,name:"value",kind:"scalar",T:5}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(5,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,5,void 0,"value"),I}}const m=new p;class c extends h.MessageType{constructor(){super("google.protobuf.UInt32Value",[{no:1,name:"value",kind:"scalar",T:13}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(13,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,13,void 0,"value"),I}}const f=new c;class g extends h.MessageType{constructor(){super("google.protobuf.BoolValue",[{no:1,name:"value",kind:"scalar",T:8}])}internalJsonWrite(j,O){return j.value}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,8,void 0,"value"),I}}const _=new g;class b extends h.MessageType{constructor(){super("google.protobuf.StringValue",[{no:1,name:"value",kind:"scalar",T:9}])}internalJsonWrite(j,O){return j.value}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,9,void 0,"value"),I}}const y=new b;class C extends h.MessageType{constructor(){super("google.protobuf.BytesValue",[{no:1,name:"value",kind:"scalar",T:12}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(12,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,12,void 0,"value"),I}}const S=new C},"./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/runme/runner/v1/runner_pb.js":(u,e,t)=>{t.r(e),t.d(e,{CommandMode:()=>p,CreateSessionRequest:()=>b,CreateSessionResponse:()=>C,DeleteSessionRequest:()=>V,DeleteSessionResponse:()=>K,ExecuteRequest:()=>F,ExecuteResponse:()=>P,ExecuteStop:()=>d,GetSessionRequest:()=>E,GetSessionResponse:()=>O,ListSessionsRequest:()=>T,ListSessionsResponse:()=>M,MonitorEnvStoreRequest:()=>G,MonitorEnvStoreResponse:()=>xe,MonitorEnvStoreResponseSnapshot:()=>Q,MonitorEnvStoreResponseSnapshot_Error:()=>Ee,MonitorEnvStoreResponseSnapshot_SnapshotEnv:()=>ae,MonitorEnvStoreResponseSnapshot_Status:()=>s,MonitorEnvStoreType:()=>c,ProcessPID:()=>X,Project:()=>L,Project_DirEnv:()=>o,ResolveProgramCommandList:()=>q,ResolveProgramRequest:()=>ne,ResolveProgramRequest_Mode:()=>r,ResolveProgramRequest_Retention:()=>a,ResolveProgramResponse:()=>pe,ResolveProgramResponse_Status:()=>n,ResolveProgramResponse_VarResult:()=>ce,RunnerService:()=>Se,Session:()=>g,SessionEnvStoreType:()=>i,SessionStrategy:()=>m,Winsize:()=>U});var l=t("./node_modules/@protobuf-ts/runtime-rpc/build/es2015/service-type.js"),h=t("./node_modules/@protobuf-ts/runtime/build/es2015/message-type.js"),v=t("./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/google/protobuf/wrappers_pb.js"),o;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.ENABLED_WARN=1]="ENABLED_WARN",le[le.ENABLED_ERROR=2]="ENABLED_ERROR",le[le.DISABLED=3]="DISABLED"})(o||(o={}));var r;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.PROMPT_ALL=1]="PROMPT_ALL",le[le.SKIP_ALL=2]="SKIP_ALL"})(r||(r={}));var a;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.FIRST_RUN=1]="FIRST_RUN",le[le.LAST_RUN=2]="LAST_RUN"})(a||(a={}));var n;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.UNRESOLVED_WITH_MESSAGE=1]="UNRESOLVED_WITH_MESSAGE",le[le.UNRESOLVED_WITH_PLACEHOLDER=2]="UNRESOLVED_WITH_PLACEHOLDER",le[le.RESOLVED=3]="RESOLVED",le[le.UNRESOLVED_WITH_SECRET=4]="UNRESOLVED_WITH_SECRET"})(n||(n={}));var s;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.LITERAL=1]="LITERAL",le[le.HIDDEN=2]="HIDDEN",le[le.MASKED=3]="MASKED"})(s||(s={}));var i;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.OWL=1]="OWL"})(i||(i={}));var d;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.INTERRUPT=1]="INTERRUPT",le[le.KILL=2]="KILL"})(d||(d={}));var p;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.INLINE_SHELL=1]="INLINE_SHELL",le[le.TEMP_FILE=2]="TEMP_FILE",le[le.TERMINAL=3]="TERMINAL",le[le.DAGGER=4]="DAGGER"})(p||(p={}));var m;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.MOST_RECENT=1]="MOST_RECENT"})(m||(m={}));var c;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.SNAPSHOT=1]="SNAPSHOT"})(c||(c={}));class f extends h.MessageType{constructor(){super("runme.runner.v1.Session",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"envs",kind:"scalar",repeat:2,T:9},{no:3,name:"metadata",kind:"map",K:9,V:{kind:"scalar",T:9}}])}}const g=new f;class _ extends h.MessageType{constructor(){super("runme.runner.v1.CreateSessionRequest",[{no:1,name:"metadata",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:2,name:"envs",kind:"scalar",repeat:2,T:9},{no:3,name:"project",kind:"message",T:()=>L},{no:4,name:"env_store_type",kind:"enum",T:()=>["runme.runner.v1.SessionEnvStoreType",i,"SESSION_ENV_STORE_TYPE_"]}])}}const b=new _;class y extends h.MessageType{constructor(){super("runme.runner.v1.CreateSessionResponse",[{no:1,name:"session",kind:"message",T:()=>g}])}}const C=new y;class S extends h.MessageType{constructor(){super("runme.runner.v1.GetSessionRequest",[{no:1,name:"id",kind:"scalar",T:9}])}}const E=new S;class j extends h.MessageType{constructor(){super("runme.runner.v1.GetSessionResponse",[{no:1,name:"session",kind:"message",T:()=>g}])}}const O=new j;class I extends h.MessageType{constructor(){super("runme.runner.v1.ListSessionsRequest",[])}}const T=new I;class x extends h.MessageType{constructor(){super("runme.runner.v1.ListSessionsResponse",[{no:1,name:"sessions",kind:"message",repeat:1,T:()=>g}])}}const M=new x;class B extends h.MessageType{constructor(){super("runme.runner.v1.DeleteSessionRequest",[{no:1,name:"id",kind:"scalar",T:9}])}}const V=new B;class J extends h.MessageType{constructor(){super("runme.runner.v1.DeleteSessionResponse",[])}}const K=new J;class A extends h.MessageType{constructor(){super("runme.runner.v1.Project",[{no:1,name:"root",kind:"scalar",T:9},{no:2,name:"env_load_order",kind:"scalar",repeat:2,T:9},{no:3,name:"env_direnv",kind:"enum",T:()=>["runme.runner.v1.Project.DirEnv",o,"DIR_ENV_"]}])}}const L=new A;class D extends h.MessageType{constructor(){super("runme.runner.v1.Winsize",[{no:1,name:"rows",kind:"scalar",T:13},{no:2,name:"cols",kind:"scalar",T:13},{no:3,name:"x",kind:"scalar",T:13},{no:4,name:"y",kind:"scalar",T:13}])}}const U=new D;class k extends h.MessageType{constructor(){super("runme.runner.v1.ExecuteRequest",[{no:1,name:"program_name",kind:"scalar",T:9},{no:2,name:"arguments",kind:"scalar",repeat:2,T:9},{no:3,name:"directory",kind:"scalar",T:9},{no:4,name:"envs",kind:"scalar",repeat:2,T:9},{no:5,name:"commands",kind:"scalar",repeat:2,T:9},{no:6,name:"script",kind:"scalar",T:9},{no:7,name:"tty",kind:"scalar",T:8},{no:8,name:"input_data",kind:"scalar",T:12},{no:9,name:"stop",kind:"enum",T:()=>["runme.runner.v1.ExecuteStop",d,"EXECUTE_STOP_"]},{no:10,name:"winsize",kind:"message",T:()=>U},{no:11,name:"background",kind:"scalar",T:8},{no:20,name:"session_id",kind:"scalar",T:9},{no:21,name:"session_strategy",kind:"enum",T:()=>["runme.runner.v1.SessionStrategy",m,"SESSION_STRATEGY_"]},{no:22,name:"project",kind:"message",T:()=>L},{no:23,name:"store_last_output",kind:"scalar",T:8},{no:24,name:"command_mode",kind:"enum",T:()=>["runme.runner.v1.CommandMode",p,"COMMAND_MODE_"]},{no:25,name:"language_id",kind:"scalar",T:9},{no:26,name:"file_extension",kind:"scalar",T:9},{no:27,name:"known_id",kind:"scalar",T:9},{no:28,name:"known_name",kind:"scalar",T:9}])}}const F=new k;class Z extends h.MessageType{constructor(){super("runme.runner.v1.ProcessPID",[{no:1,name:"pid",kind:"scalar",T:3}])}}const X=new Z;class $ extends h.MessageType{constructor(){super("runme.runner.v1.ExecuteResponse",[{no:1,name:"exit_code",kind:"message",T:()=>v.UInt32Value},{no:2,name:"stdout_data",kind:"scalar",T:12},{no:3,name:"stderr_data",kind:"scalar",T:12},{no:4,name:"pid",kind:"message",T:()=>X},{no:5,name:"mime_type",kind:"scalar",T:9}])}}const P=new $;class ee extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramCommandList",[{no:1,name:"lines",kind:"scalar",repeat:2,T:9}])}}const q=new ee;class de extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramRequest",[{no:1,name:"commands",kind:"message",oneof:"source",T:()=>q},{no:2,name:"script",kind:"scalar",oneof:"source",T:9},{no:3,name:"mode",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramRequest.Mode",r,"MODE_"]},{no:4,name:"env",kind:"scalar",repeat:2,T:9},{no:5,name:"session_id",kind:"scalar",T:9},{no:6,name:"session_strategy",kind:"enum",T:()=>["runme.runner.v1.SessionStrategy",m,"SESSION_STRATEGY_"]},{no:7,name:"project",kind:"message",T:()=>L},{no:8,name:"language_id",kind:"scalar",T:9},{no:9,name:"retention",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramRequest.Retention",a,"RETENTION_"]}])}}const ne=new de;class _e extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramResponse",[{no:1,name:"script",kind:"scalar",T:9},{no:2,name:"commands",kind:"message",T:()=>q},{no:3,name:"vars",kind:"message",repeat:1,T:()=>ce}])}}const pe=new _e;class je extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramResponse.VarResult",[{no:1,name:"status",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramResponse.Status",n,"STATUS_"]},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"original_value",kind:"scalar",T:9},{no:4,name:"resolved_value",kind:"scalar",T:9}])}}const ce=new je;class oe extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreRequest",[{no:1,name:"session",kind:"message",T:()=>g}])}}const G=new oe;class W extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot",[{no:1,name:"envs",kind:"message",repeat:1,T:()=>ae}])}}const Q=new W;class te extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv",[{no:1,name:"status",kind:"enum",T:()=>["runme.runner.v1.MonitorEnvStoreResponseSnapshot.Status",s,"STATUS_"]},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"spec",kind:"scalar",T:9},{no:4,name:"origin",kind:"scalar",T:9},{no:5,name:"original_value",kind:"scalar",T:9},{no:6,name:"resolved_value",kind:"scalar",T:9},{no:7,name:"create_time",kind:"scalar",T:9},{no:8,name:"update_time",kind:"scalar",T:9},{no:9,name:"errors",kind:"message",repeat:1,T:()=>Ee},{no:10,name:"is_required",kind:"scalar",T:8},{no:11,name:"description",kind:"scalar",T:9}])}}const ae=new te;class he extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error",[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9}])}}const Ee=new he;class Ie extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponse",[{no:1,name:"type",kind:"enum",T:()=>["runme.runner.v1.MonitorEnvStoreType",c,"MONITOR_ENV_STORE_TYPE_"]},{no:2,name:"snapshot",kind:"message",oneof:"data",T:()=>Q}])}}const xe=new Ie,Se=new l.ServiceType("runme.runner.v1.RunnerService",[{name:"CreateSession",options:{},I:b,O:C},{name:"GetSession",options:{},I:E,O},{name:"ListSessions",options:{},I:T,O:M},{name:"DeleteSession",options:{},I:V,O:K},{name:"MonitorEnvStore",serverStreaming:!0,options:{},I:G,O:xe},{name:"Execute",serverStreaming:!0,clientStreaming:!0,options:{},I:F,O:P},{name:"ResolveProgram",options:{},I:ne,O:pe}])},"./node_modules/@lit/reactive-element/development/css-tag.js":(u,e,t)=>{t.r(e),t.d(e,{CSSResult:()=>a,adoptStyles:()=>d,css:()=>i,getCompatibleStyle:()=>m,supportsAdoptingStyleSheets:()=>v,unsafeCSS:()=>s});/**
|
|
2
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(v){case 0:r=o,v=1;break;case 1:l[h++]=r<<2|(o&48)>>4,r=o,v=2;break;case 2:l[h++]=(r&15)<<4|(o&60)>>2,r=o,v=3;break;case 3:l[h++]=(r&3)<<6|o,v=0;break}}if(v==1)throw Error("invalid base64 string");return l.subarray(0,h)}function Ga(u,e="std"){const t=gi(e),l=e=="std";let h="",v=0,o,r=0;for(let a=0;a<u.length;a++)switch(o=u[a],v){case 0:h+=t[o>>2],r=(o&3)<<4,v=1;break;case 1:h+=t[r|o>>4],r=(o&15)<<2,v=2;break;case 2:h+=t[r|o>>6],h+=t[o&63],v=0;break}return v&&(h+=t[r],l&&(h+="=",v==1&&(h+="="))),h}let Ds,dr,rs;function gi(u){return Ds||(Ds="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),dr=Ds.slice(0,-2).concat("-","_")),u=="url"?dr:Ds}function za(){if(!rs){rs=[];const u=gi("std");for(let e=0;e<u.length;e++)rs[u[e].charCodeAt(0)]=e;rs[45]=u.indexOf("+"),rs[95]=u.indexOf("/")}return rs}function An(u,e){return u!==null&&typeof u=="object"&&"$typeName"in u&&typeof u.$typeName=="string"?e===void 0?!0:e.typeName===u.$typeName:!1}const Za=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class ot extends Error{constructor(e,t,l="FieldValueInvalidError"){super(t),this.name=l,this.field=()=>e}}function Xa(u){return u instanceof Error&&Za.includes(u.name)&&"field"in u&&typeof u.field=="function"}function Ct(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)}function Pn(u,e){var t,l,h,v;if(Ct(u)&&vt in u&&"add"in u&&"field"in u&&typeof u.field=="function"){if(e!==void 0){const o=e,r=u.field();return o.listKind==r.listKind&&o.scalar===r.scalar&&((t=o.message)===null||t===void 0?void 0:t.typeName)===((l=r.message)===null||l===void 0?void 0:l.typeName)&&((h=o.enum)===null||h===void 0?void 0:h.typeName)===((v=r.enum)===null||v===void 0?void 0:v.typeName)}return!0}return!1}function Rn(u,e){var t,l,h,v;if(Ct(u)&&vt in u&&"has"in u&&"field"in u&&typeof u.field=="function"){if(e!==void 0){const o=e,r=u.field();return o.mapKey===r.mapKey&&o.mapKind==r.mapKind&&o.scalar===r.scalar&&((t=o.message)===null||t===void 0?void 0:t.typeName)===((l=r.message)===null||l===void 0?void 0:l.typeName)&&((h=o.enum)===null||h===void 0?void 0:h.typeName)===((v=r.enum)===null||v===void 0?void 0:v.typeName)}return!0}return!1}function Dn(u,e){return Ct(u)&&vt in u&&"desc"in u&&Ct(u.desc)&&u.desc.kind==="message"&&(e===void 0||u.desc.typeName==e.typeName)}const cn=Symbol.for("@bufbuild/protobuf/text-encoding");function Mn(){if(globalThis[cn]==null){const u=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[cn]={encodeUtf8(t){return u.encode(t)},decodeUtf8(t){return e.decode(t)},checkUtf8(t){try{return encodeURIComponent(t),!0}catch{return!1}}}}return globalThis[cn]}var Ge;(function(u){u[u.Varint=0]="Varint",u[u.Bit64=1]="Bit64",u[u.LengthDelimited=2]="LengthDelimited",u[u.StartGroup=3]="StartGroup",u[u.EndGroup=4]="EndGroup",u[u.Bit32=5]="Bit32"})(Ge||(Ge={}));const _i=34028234663852886e22,bi=-34028234663852886e22,yi=4294967295,Ci=2147483647,Ei=-2147483648;class Si{constructor(e=Mn().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let h=0;h<this.chunks.length;h++)e+=this.chunks[h].length;let t=new Uint8Array(e),l=0;for(let h=0;h<this.chunks.length;h++)t.set(this.chunks[h],l),l+=this.chunks[h].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ur(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return dn(e),sr(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Ya(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ur(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){dn(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return dn(e),e=(e<<1^e>>31)>>>0,sr(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),l=new DataView(t.buffer),h=Ve.enc(e);return l.setInt32(0,h.lo,!0),l.setInt32(4,h.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),l=new DataView(t.buffer),h=Ve.uEnc(e);return l.setInt32(0,h.lo,!0),l.setInt32(4,h.hi,!0),this.raw(t)}int64(e){let t=Ve.enc(e);return an(t.lo,t.hi,this.buf),this}sint64(e){const t=Ve.enc(e),l=t.hi>>31,h=t.lo<<1^l,v=(t.hi<<1|t.lo>>>31)^l;return an(h,v,this.buf),this}uint64(e){const t=Ve.uEnc(e);return an(t.lo,t.hi,this.buf),this}}class Ln{constructor(e,t=Mn().decodeUtf8){this.decodeUtf8=t,this.varint64=la,this.uint32=ua,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,l=e&7;if(t<=0||l<0||l>5)throw new Error("illegal tag: field no "+t+" wire type "+l);return[t,l]}skip(e,t){let l=this.pos;switch(e){case Ge.Varint:for(;this.buf[this.pos++]&128;);break;case Ge.Bit64:this.pos+=4;case Ge.Bit32:this.pos+=4;break;case Ge.LengthDelimited:let h=this.uint32();this.pos+=h;break;case Ge.StartGroup:for(;;){const[v,o]=this.tag();if(o===Ge.EndGroup){if(t!==void 0&&v!==t)throw new Error("invalid end group tag");break}this.skip(o,v)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(l,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Ve.dec(...this.varint64())}uint64(){return Ve.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),l=-(e&1);return e=(e>>>1|(t&1)<<31)^l,t=t>>>1^l,Ve.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ve.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ve.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 e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function dn(u){if(typeof u=="string")u=Number(u);else if(typeof u!="number")throw new Error("invalid int32: "+typeof u);if(!Number.isInteger(u)||u>Ci||u<Ei)throw new Error("invalid int32: "+u)}function ur(u){if(typeof u=="string")u=Number(u);else if(typeof u!="number")throw new Error("invalid uint32: "+typeof u);if(!Number.isInteger(u)||u>yi||u<0)throw new Error("invalid uint32: "+u)}function Ya(u){if(typeof u=="string"){const e=u;if(u=Number(u),Number.isNaN(u)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof u!="number")throw new Error("invalid float32: "+typeof u);if(Number.isFinite(u)&&(u>_i||u<bi))throw new Error("invalid float32: "+u)}function Jt(u,e){const t=u.fieldKind=="list"?Pn(e,u):u.fieldKind=="map"?Rn(e,u):kn(u,e);if(t===!0)return;let l;switch(u.fieldKind){case"list":l=`expected ${Oi(u)}, got ${Qe(e)}`;break;case"map":l=`expected ${Ii(u)}, got ${Qe(e)}`;break;default:l=Fs(u,e,t)}return new ot(u,l)}function hr(u,e,t){const l=kn(u,t);if(l!==!0)return new ot(u,`list item #${e+1}: ${Fs(u,t,l)}`)}function Ja(u,e,t){const l=ji(e,u.mapKey);if(l!==!0)return new ot(u,`invalid map key: ${Fs({scalar:u.mapKey},e,l)}`);const h=kn(u,t);if(h!==!0)return new ot(u,`map entry ${Qe(e)}: ${Fs(u,t,h)}`)}function kn(u,e){return u.scalar!==void 0?ji(e,u.scalar):u.enum!==void 0?u.enum.open?Number.isInteger(e):u.enum.values.some(t=>t.number===e):Dn(e,u.message)}function ji(u,e){switch(e){case ie.DOUBLE:return typeof u=="number";case ie.FLOAT:return typeof u!="number"?!1:Number.isNaN(u)||!Number.isFinite(u)?!0:u>_i||u<bi?`${u.toFixed()} out of range`:!0;case ie.INT32:case ie.SFIXED32:case ie.SINT32:return typeof u!="number"||!Number.isInteger(u)?!1:u>Ci||u<Ei?`${u.toFixed()} out of range`:!0;case ie.FIXED32:case ie.UINT32:return typeof u!="number"||!Number.isInteger(u)?!1:u>yi||u<0?`${u.toFixed()} out of range`:!0;case ie.BOOL:return typeof u=="boolean";case ie.STRING:return typeof u!="string"?!1:Mn().checkUtf8(u)||"invalid UTF8";case ie.BYTES:return u instanceof Uint8Array;case ie.INT64:case ie.SFIXED64:case ie.SINT64:if(typeof u=="bigint"||typeof u=="number"||typeof u=="string"&&u.length>0)try{return Ve.parse(u),!0}catch{return`${u} out of range`}return!1;case ie.FIXED64:case ie.UINT64:if(typeof u=="bigint"||typeof u=="number"||typeof u=="string"&&u.length>0)try{return Ve.uParse(u),!0}catch{return`${u} out of range`}return!1}}function Fs(u,e,t){return t=typeof t=="string"?`: ${t}`:`, got ${Qe(e)}`,u.scalar!==void 0?`expected ${Qa(u.scalar)}`+t:u.enum!==void 0?`expected ${u.enum.toString()}`+t:`expected ${wi(u.message)}`+t}function Qe(u){switch(typeof u){case"object":return u===null?"null":u instanceof Uint8Array?`Uint8Array(${u.length})`:Array.isArray(u)?`Array(${u.length})`:Pn(u)?Oi(u.field()):Rn(u)?Ii(u.field()):Dn(u)?wi(u.desc):An(u)?`message ${u.$typeName}`:"object";case"string":return u.length>30?"string":`"${u.split('"').join('\\"')}"`;case"boolean":return String(u);case"number":return String(u);case"bigint":return String(u)+"n";default:return typeof u}}function wi(u){return`ReflectMessage (${u.typeName})`}function Oi(u){switch(u.listKind){case"message":return`ReflectList (${u.message.toString()})`;case"enum":return`ReflectList (${u.enum.toString()})`;case"scalar":return`ReflectList (${ie[u.scalar]})`}}function Ii(u){switch(u.mapKind){case"message":return`ReflectMap (${ie[u.mapKey]}, ${u.message.toString()})`;case"enum":return`ReflectMap (${ie[u.mapKey]}, ${u.enum.toString()})`;case"scalar":return`ReflectMap (${ie[u.mapKey]}, ${ie[u.scalar]})`}}function Qa(u){switch(u){case ie.STRING:return"string";case ie.BOOL:return"boolean";case ie.INT64:case ie.SINT64:case ie.SFIXED64:return"bigint (int64)";case ie.UINT64:case ie.FIXED64:return"bigint (uint64)";case ie.BYTES:return"Uint8Array";case ie.DOUBLE:return"number (float64)";case ie.FLOAT:return"number (float32)";case ie.FIXED32:case ie.UINT32:return"number (uint32)";case ie.INT32:case ie.SFIXED32:case ie.SINT32:return"number (int32)"}}function qa(u){return Ti(u.$typeName)}function Ts(u){const e=u.fields[0];return Ti(u.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function Ti(u){return u.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(u.substring(16))}const el=999,tl=998,$s=2;function it(u,e){if(An(e,u))return e;const t=ol(u);return e!==void 0&&sl(u,t,e),t}function sl(u,e,t){for(const l of u.members){let h=t[l.localName];if(h==null)continue;let v;if(l.kind=="oneof"){const o=ai(t,l);if(!o)continue;v=o,h=li(t,o)}else v=l;switch(v.fieldKind){case"message":h=Bn(v,h);break;case"scalar":h=xi(v,h);break;case"list":h=rl(v,h);break;case"map":h=nl(v,h);break}ci(e,v,h)}return e}function xi(u,e){return u.scalar==ie.BYTES?Nn(e):e}function nl(u,e){if(Ct(e)){if(u.scalar==ie.BYTES)return fr(e,Nn);if(u.mapKind=="message")return fr(e,t=>Bn(u,t))}return e}function rl(u,e){if(Array.isArray(e)){if(u.scalar==ie.BYTES)return e.map(Nn);if(u.listKind=="message")return e.map(t=>Bn(u,t))}return e}function Bn(u,e){if(u.fieldKind=="message"&&!u.oneof&&Ts(u.message))return xi(u.message.fields[0],e);if(Ct(e)){if(u.message.typeName=="google.protobuf.Struct"&&u.parent.typeName!=="google.protobuf.Value")return e;if(!An(e,u.message))return it(u.message,e)}return e}function Nn(u){return Array.isArray(u)?new Uint8Array(u):u}function fr(u,e){const t={};for(const l of Object.entries(u))t[l[0]]=e(l[1]);return t}const il=Symbol(),mr=new WeakMap;function ol(u){let e;if(al(u)){const t=mr.get(u);let l,h;if(t)({prototype:l,members:h}=t);else{l={},h=new Set;for(const v of u.members)v.kind!="oneof"&&(v.fieldKind!="scalar"&&v.fieldKind!="enum"||v.presence!=$s&&(h.add(v),l[v.localName]=un(v)));mr.set(u,{prototype:l,members:h})}e=Object.create(l),e.$typeName=u.typeName;for(const v of u.members)h.has(v)||v.kind=="field"&&(v.fieldKind=="message"||(v.fieldKind=="scalar"||v.fieldKind=="enum")&&v.presence!=$s)||(e[v.localName]=un(v))}else{e={$typeName:u.typeName};for(const t of u.members)(t.kind=="oneof"||t.presence==$s)&&(e[t.localName]=un(t))}return e}function al(u){switch(u.file.edition){case el:return!1;case tl:return!0;default:return u.fields.some(e=>e.presence!=$s&&e.fieldKind!="message"&&!e.oneof)}}function un(u){if(u.kind=="oneof")return{case:void 0};if(u.fieldKind=="list")return[];if(u.fieldKind=="map")return{};if(u.fieldKind=="message")return il;const e=u.getDefaultValue();return e!==void 0?u.fieldKind=="scalar"&&u.longAsString?e.toString():e:u.fieldKind=="scalar"?es(u.scalar,u.longAsString):u.enum.values[0].number}function ut(u,e,t=!0){return new Ai(u,e,t)}class Ai{get sortedFields(){var e;return(e=this._sortedFields)!==null&&e!==void 0?e:this._sortedFields=this.desc.fields.concat().sort((t,l)=>t.number-l.number)}constructor(e,t,l=!0){this.lists=new Map,this.maps=new Map,this.check=l,this.desc=e,this.message=this[vt]=t??it(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(t=>[t.number,t]))),this._fieldsByNumber.get(e)}oneofCase(e){return vs(this.message,e),ai(this.message,e)}isSet(e){return vs(this.message,e),ma(this.message,e)}clear(e){vs(this.message,e),pa(this.message,e)}get(e){vs(this.message,e);const t=li(this.message,e);switch(e.fieldKind){case"list":let l=this.lists.get(e);return(!l||l[vt]!==t)&&this.lists.set(e,l=new ll(e,t,this.check)),l;case"map":let h=this.maps.get(e);return(!h||h[vt]!==t)&&this.maps.set(e,h=new cl(e,t,this.check)),h;case"message":return Un(e,t,this.check);case"scalar":return t===void 0?es(e.scalar,!1):Fn(e,t);case"enum":return t??e.enum.values[0].number}}set(e,t){if(vs(this.message,e),this.check){const h=Jt(e,t);if(h)throw h}let l;e.fieldKind=="message"?l=$n(e,t):Rn(t)||Pn(t)?l=t[vt]:l=Vn(e,t),ci(this.message,e,l)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function vs(u,e){if(e.parent.typeName!==u.$typeName)throw new ot(e,`cannot use ${e.toString()} with message ${u.$typeName}`,"ForeignFieldError")}class ll{field(){return this._field}get size(){return this._arr.length}constructor(e,t,l){this._field=e,this._arr=this[vt]=t,this.check=l}get(e){const t=this._arr[e];return t===void 0?void 0:hn(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new ot(this._field,`list item #${e+1}: out of range`);if(this.check){const l=hr(this._field,e,t);if(l)throw l}this._arr[e]=pr(this._field,t)}add(e){if(this.check){const t=hr(this._field,this._arr.length,e);if(t)throw t}this._arr.push(pr(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield hn(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,hn(this._field,this._arr[e],this.check)]}}class cl{constructor(e,t,l=!0){this.obj=this[vt]=t??{},this.check=l,this._field=e}field(){return this._field}set(e,t){if(this.check){const l=Ja(this._field,e,t);if(l)throw l}return this.obj[Ms(e)]=dl(this._field,t),this}delete(e){const t=Ms(e),l=Object.prototype.hasOwnProperty.call(this.obj,t);return l&&delete this.obj[t],l}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[Ms(e)];return t!==void 0&&(t=fn(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,Ms(e))}*keys(){for(const e of Object.keys(this.obj))yield vr(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[vr(e[0],this._field.mapKey),fn(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield fn(this._field,e,this.check)}forEach(e,t){for(const l of this.entries())e.call(t,l[1],l[0],this)}}function $n(u,e){return Dn(e)?qa(e.message)&&!u.oneof&&u.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&u.parent.typeName!="google.protobuf.Value"?Ri(e.message):e.message:e}function Un(u,e,t){return e!==void 0&&(Ts(u.message)&&!u.oneof&&u.fieldKind=="message"?e={$typeName:u.message.typeName,value:Fn(u.message.fields[0],e)}:u.message.typeName=="google.protobuf.Struct"&&u.parent.typeName!="google.protobuf.Value"&&Ct(e)&&(e=Pi(e))),new Ai(u.message,e,t)}function pr(u,e){return u.listKind=="message"?$n(u,e):Vn(u,e)}function hn(u,e,t){return u.listKind=="message"?Un(u,e,t):Fn(u,e)}function dl(u,e){return u.mapKind=="message"?$n(u,e):Vn(u,e)}function fn(u,e,t){return u.mapKind=="message"?Un(u,e,t):e}function Ms(u){return typeof u=="string"||typeof u=="number"?u:String(u)}function vr(u,e){switch(e){case ie.STRING:return u;case ie.INT32:case ie.FIXED32:case ie.UINT32:case ie.SFIXED32:case ie.SINT32:{const t=Number.parseInt(u);if(Number.isFinite(t))return t;break}case ie.BOOL:switch(u){case"true":return!0;case"false":return!1}break;case ie.UINT64:case ie.FIXED64:try{return Ve.uParse(u)}catch{}break;default:try{return Ve.parse(u)}catch{}break}return u}function Fn(u,e){switch(u.scalar){case ie.INT64:case ie.SFIXED64:case ie.SINT64:"longAsString"in u&&u.longAsString&&typeof e=="string"&&(e=Ve.parse(e));break;case ie.FIXED64:case ie.UINT64:"longAsString"in u&&u.longAsString&&typeof e=="string"&&(e=Ve.uParse(e));break}return e}function Vn(u,e){switch(u.scalar){case ie.INT64:case ie.SFIXED64:case ie.SINT64:"longAsString"in u&&u.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Ve.parse(e));break;case ie.FIXED64:case ie.UINT64:"longAsString"in u&&u.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Ve.uParse(e));break}return e}function Pi(u){const e={$typeName:"google.protobuf.Struct",fields:{}};if(Ct(u))for(const[t,l]of Object.entries(u))e.fields[t]=Mi(l);return e}function Ri(u){const e={};for(const[t,l]of Object.entries(u.fields))e[t]=Di(l);return e}function Di(u){switch(u.kind.case){case"structValue":return Ri(u.kind.value);case"listValue":return u.kind.value.values.map(Di);case"nullValue":case void 0:return null;default:return u.kind.value}}function Mi(u){const e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof u){case"number":e.kind={case:"numberValue",value:u};break;case"string":e.kind={case:"stringValue",value:u};break;case"boolean":e.kind={case:"boolValue",value:u};break;case"object":if(u===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(u)){const t={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(u))for(const l of u)t.values.push(Mi(l));e.kind={case:"listValue",value:t}}else e.kind={case:"structValue",value:Pi(u)};break}return e}const ul=3,gr={writeUnknownFields:!0};function hl(u){return u?Object.assign(Object.assign({},gr),u):gr}function fl(u,e,t){return Vs(new Si,hl(t),ut(u,e)).finish()}function Vs(u,e,t){var l;for(const h of t.sortedFields){if(!t.isSet(h)){if(h.presence==ul)throw new Error(`cannot encode ${h} to binary: required field not set`);continue}Li(u,e,t,h)}if(e.writeUnknownFields)for(const{no:h,wireType:v,data:o}of(l=t.getUnknown())!==null&&l!==void 0?l:[])u.tag(h,v).raw(o);return u}function Li(u,e,t,l){var h;switch(l.fieldKind){case"scalar":case"enum":Ws(u,t.desc.typeName,l.name,(h=l.scalar)!==null&&h!==void 0?h:ie.INT32,l.number,t.get(l));break;case"list":ml(u,e,l,t.get(l));break;case"message":ki(u,e,l,t.get(l));break;case"map":for(const[v,o]of t.get(l))pl(u,e,l,v,o);break}}function Ws(u,e,t,l,h,v){Bi(u.tag(h,vl(l)),e,t,l,v)}function ki(u,e,t,l){t.delimitedEncoding?Vs(u.tag(t.number,Ge.StartGroup),e,l).tag(t.number,Ge.EndGroup):Vs(u.tag(t.number,Ge.LengthDelimited).fork(),e,l).join()}function ml(u,e,t,l){var h;if(t.listKind=="message"){for(const o of l)ki(u,e,t,o);return}const v=(h=t.scalar)!==null&&h!==void 0?h:ie.INT32;if(t.packed){if(!l.size)return;u.tag(t.number,Ge.LengthDelimited).fork();for(const o of l)Bi(u,t.parent.typeName,t.name,v,o);u.join();return}for(const o of l)Ws(u,t.parent.typeName,t.name,v,t.number,o)}function pl(u,e,t,l,h){var v;switch(u.tag(t.number,Ge.LengthDelimited).fork(),Ws(u,t.parent.typeName,t.name,t.mapKey,1,l),t.mapKind){case"scalar":case"enum":Ws(u,t.parent.typeName,t.name,(v=t.scalar)!==null&&v!==void 0?v:ie.INT32,2,h);break;case"message":Vs(u.tag(2,Ge.LengthDelimited).fork(),e,h).join();break}u.join()}function Bi(u,e,t,l,h){try{switch(l){case ie.STRING:u.string(h);break;case ie.BOOL:u.bool(h);break;case ie.DOUBLE:u.double(h);break;case ie.FLOAT:u.float(h);break;case ie.INT32:u.int32(h);break;case ie.INT64:u.int64(h);break;case ie.UINT64:u.uint64(h);break;case ie.FIXED64:u.fixed64(h);break;case ie.BYTES:u.bytes(h);break;case ie.FIXED32:u.fixed32(h);break;case ie.SFIXED32:u.sfixed32(h);break;case ie.SFIXED64:u.sfixed64(h);break;case ie.SINT64:u.sint64(h);break;case ie.UINT32:u.uint32(h);break;case ie.SINT32:u.sint32(h);break}}catch(v){throw v instanceof Error?new Error(`cannot encode field ${e}.${t} to binary: ${v.message}`):v}}function vl(u){switch(u){case ie.BYTES:case ie.STRING:return Ge.LengthDelimited;case ie.DOUBLE:case ie.FIXED64:case ie.SFIXED64:return Ge.Bit64;case ie.FIXED32:case ie.SFIXED32:case ie.FLOAT:return Ge.Bit32;default:return Ge.Varint}}function xs(u,e,...t){return t.reduce((l,h)=>l.nestedMessages[h],u.messages[e])}function gl(u,e,...t){if(t.length==0)return u.enums[e];const l=t.pop();return t.reduce((h,v)=>h.nestedMessages[v],u.messages[e]).nestedEnums[l]}function Wn(u){const e={};for(const t of u.values)e[t.localName]=t.number,e[t.number]=t.localName;return e}const _l=Va({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:"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}],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}],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"},{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}]}}],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}]}]}),bl=xs(_l,1);var _r;(function(u){u[u.DECLARATION=0]="DECLARATION",u[u.UNVERIFIED=1]="UNVERIFIED"})(_r||(_r={}));var br;(function(u){u[u.DOUBLE=1]="DOUBLE",u[u.FLOAT=2]="FLOAT",u[u.INT64=3]="INT64",u[u.UINT64=4]="UINT64",u[u.INT32=5]="INT32",u[u.FIXED64=6]="FIXED64",u[u.FIXED32=7]="FIXED32",u[u.BOOL=8]="BOOL",u[u.STRING=9]="STRING",u[u.GROUP=10]="GROUP",u[u.MESSAGE=11]="MESSAGE",u[u.BYTES=12]="BYTES",u[u.UINT32=13]="UINT32",u[u.ENUM=14]="ENUM",u[u.SFIXED32=15]="SFIXED32",u[u.SFIXED64=16]="SFIXED64",u[u.SINT32=17]="SINT32",u[u.SINT64=18]="SINT64"})(br||(br={}));var yr;(function(u){u[u.OPTIONAL=1]="OPTIONAL",u[u.REPEATED=3]="REPEATED",u[u.REQUIRED=2]="REQUIRED"})(yr||(yr={}));var Cr;(function(u){u[u.SPEED=1]="SPEED",u[u.CODE_SIZE=2]="CODE_SIZE",u[u.LITE_RUNTIME=3]="LITE_RUNTIME"})(Cr||(Cr={}));var Er;(function(u){u[u.STRING=0]="STRING",u[u.CORD=1]="CORD",u[u.STRING_PIECE=2]="STRING_PIECE"})(Er||(Er={}));var Sr;(function(u){u[u.JS_NORMAL=0]="JS_NORMAL",u[u.JS_STRING=1]="JS_STRING",u[u.JS_NUMBER=2]="JS_NUMBER"})(Sr||(Sr={}));var jr;(function(u){u[u.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",u[u.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",u[u.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(jr||(jr={}));var wr;(function(u){u[u.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",u[u.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",u[u.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",u[u.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",u[u.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",u[u.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",u[u.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",u[u.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",u[u.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",u[u.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(wr||(wr={}));var Or;(function(u){u[u.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",u[u.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",u[u.IDEMPOTENT=2]="IDEMPOTENT"})(Or||(Or={}));var Ir;(function(u){u[u.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",u[u.EXPLICIT=1]="EXPLICIT",u[u.IMPLICIT=2]="IMPLICIT",u[u.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Ir||(Ir={}));var Tr;(function(u){u[u.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",u[u.OPEN=1]="OPEN",u[u.CLOSED=2]="CLOSED"})(Tr||(Tr={}));var xr;(function(u){u[u.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",u[u.PACKED=1]="PACKED",u[u.EXPANDED=2]="EXPANDED"})(xr||(xr={}));var Ar;(function(u){u[u.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",u[u.VERIFY=2]="VERIFY",u[u.NONE=3]="NONE"})(Ar||(Ar={}));var Pr;(function(u){u[u.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",u[u.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",u[u.DELIMITED=2]="DELIMITED"})(Pr||(Pr={}));var Rr;(function(u){u[u.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",u[u.ALLOW=1]="ALLOW",u[u.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Rr||(Rr={}));var Dr;(function(u){u[u.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",u[u.STYLE2024=1]="STYLE2024",u[u.STYLE_LEGACY=2]="STYLE_LEGACY"})(Dr||(Dr={}));var Mr;(function(u){u[u.NONE=0]="NONE",u[u.SET=1]="SET",u[u.ALIAS=2]="ALIAS"})(Mr||(Mr={}));var Lr;(function(u){u[u.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",u[u.EDITION_LEGACY=900]="EDITION_LEGACY",u[u.EDITION_PROTO2=998]="EDITION_PROTO2",u[u.EDITION_PROTO3=999]="EDITION_PROTO3",u[u.EDITION_2023=1e3]="EDITION_2023",u[u.EDITION_2024=1001]="EDITION_2024",u[u.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",u[u.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",u[u.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",u[u.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",u[u.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",u[u.EDITION_MAX=2147483647]="EDITION_MAX"})(Lr||(Lr={}));function Ni(u,e,...t){if(t.length==0)return u.enums[e];const l=t.pop();return t.reduce((h,v)=>h.nestedMessages[v],u.messages[e]).nestedEnums[l]}const kr={readUnknownFields:!0};function yl(u){return u?Object.assign(Object.assign({},kr),u):kr}function $i(u,e,t){const l=ut(u,void 0,!1);return Ui(l,new Ln(e),yl(t),!1,e.byteLength),l.message}function Ui(u,e,t,l,h){var v;const o=l?e.len:e.pos+h;let r,a;const n=(v=u.getUnknown())!==null&&v!==void 0?v:[];for(;e.pos<o&&([r,a]=e.tag(),!(l&&a==Ge.EndGroup));){const s=u.findNumber(r);if(!s){const i=e.skip(a,r);t.readUnknownFields&&n.push({no:r,wireType:a,data:i});continue}Fi(u,e,s,a,t)}if(l&&(a!=Ge.EndGroup||r!==h))throw new Error("invalid end group tag");n.length>0&&u.setUnknown(n)}function Fi(u,e,t,l,h){switch(t.fieldKind){case"scalar":u.set(t,as(e,t.scalar));break;case"enum":u.set(t,as(e,ie.INT32));break;case"message":u.set(t,Hn(e,h,t,u.get(t)));break;case"list":El(e,l,u.get(t),h);break;case"map":Cl(e,u.get(t),h);break}}function Cl(u,e,t){const l=e.field();let h,v;const o=u.pos+u.uint32();for(;u.pos<o;){const[r]=u.tag();switch(r){case 1:h=as(u,l.mapKey);break;case 2:switch(l.mapKind){case"scalar":v=as(u,l.scalar);break;case"enum":v=u.int32();break;case"message":v=Hn(u,t,l);break}break}}if(h===void 0&&(h=es(l.mapKey,!1)),v===void 0)switch(l.mapKind){case"scalar":v=es(l.scalar,!1);break;case"enum":v=l.enum.values[0].number;break;case"message":v=ut(l.message,void 0,!1);break}e.set(h,v)}function El(u,e,t,l){var h;const v=t.field();if(v.listKind==="message"){t.add(Hn(u,l,v));return}const o=(h=v.scalar)!==null&&h!==void 0?h:ie.INT32;if(!(e==Ge.LengthDelimited&&o!=ie.STRING&&o!=ie.BYTES)){t.add(as(u,o));return}const a=u.uint32()+u.pos;for(;u.pos<a;)t.add(as(u,o))}function Hn(u,e,t,l){const h=t.delimitedEncoding,v=l??ut(t.message,void 0,!1);return Ui(v,u,e,h,h?t.number:u.uint32()),v}function as(u,e){switch(e){case ie.STRING:return u.string();case ie.BOOL:return u.bool();case ie.DOUBLE:return u.double();case ie.FLOAT:return u.float();case ie.INT32:return u.int32();case ie.INT64:return u.int64();case ie.UINT64:return u.uint64();case ie.FIXED64:return u.fixed64();case ie.BYTES:return u.bytes();case ie.FIXED32:return u.fixed32();case ie.SFIXED32:return u.sfixed32();case ie.SFIXED64:return u.sfixed64();case ie.SINT64:return u.sint64();case ie.UINT32:return u.uint32();case ie.SINT32:return u.sint32()}}function St(u,e){var t;const l=$i(bl,vi(u));return l.messageType.forEach(Tn),l.dependency=(t=e==null?void 0:e.map(v=>v.proto.name))!==null&&t!==void 0?t:[],di(l,v=>e==null?void 0:e.find(o=>o.proto.name===v)).getFile(l.name)}function zs(u,e,...t){return t.reduce((l,h)=>l.nestedMessages[h],u.messages[e])}const Vi=St("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),Sl=Ni(Vi,0),jl=Wn(Sl),wl=St("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Ol=xs(wl,0);function Il(u,e,t){let l=!1;return t||(t=it(Ol),l=!0),t.value=fl(u,e),t.typeUrl=Al(e.$typeName),l?t:void 0}function Tl(u,e){if(u.typeUrl==="")return!1;const t=typeof e=="string"?e:e.typeName,l=Wi(u.typeUrl);return t===l}function xl(u,e){if(u.typeUrl==="")return;const t=e.kind=="message"?e:e.getMessage(Wi(u.typeUrl));if(!(!t||!Tl(u,t)))return $i(t,u.value)}function Al(u){return`type.googleapis.com/${u}`}function Wi(u){const e=u.lastIndexOf("/"),t=e>=0?u.substring(e+1):u;if(!t.length)throw new Error(`invalid type url: ${u}`);return t}const Kn=St("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Pl=xs(Kn,0),Hi=xs(Kn,1),Rl=xs(Kn,2);var Sn;(function(u){u[u.NULL_VALUE=0]="NULL_VALUE"})(Sn||(Sn={}));const Dl=St("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Zs=St("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[Dl,Vi]),Br=zs(Zs,12),mn=zs(Zs,13),Ml=Ni(Zs,2),Ll=Wn(Ml);function kl(u,e){Ki(e,u);const t=Nl(u.$unknown,e),[l,h,v]=Xs(e);for(const o of t)Fi(l,new Ln(o.data),h,o.wireType,{readUnknownFields:!0});return v()}function Bl(u,e,t){var l;Ki(e,u);const h=((l=u.$unknown)!==null&&l!==void 0?l:[]).filter(n=>n.no!==e.number),[v,o]=Xs(e,t),r=new Si;Li(r,{writeUnknownFields:!0},v,o);const a=new Ln(r.finish());for(;a.pos<a.len;){const[n,s]=a.tag(),i=a.skip(s,n);h.push({no:n,wireType:s,data:i})}u.$unknown=h}function Nl(u,e){if(u===void 0)return[];if(e.fieldKind==="enum"||e.fieldKind==="scalar"){for(let t=u.length-1;t>=0;--t)if(u[t].no==e.number)return[u[t]];return[]}return u.filter(t=>t.no===e.number)}function Xs(u,e){const t=u.typeName,l=Object.assign(Object.assign({},u),{kind:"field",parent:u.extendee,localName:t}),h=Object.assign(Object.assign({},u.extendee),{fields:[l],members:[l],oneofs:[]}),v=it(h,e!==void 0?{[t]:e}:void 0);return[ut(h,v),l,()=>{const o=v[t];if(o===void 0){const r=u.message;return Ts(r)?es(r.fields[0].scalar,r.fields[0].longAsString):it(r)}return o}]}function Ki(u,e){if(u.extendee.typeName!=e.$typeName)throw new Error(`extension ${u.typeName} can only be applied to message ${u.extendee.typeName}`)}const $l=3,Ul=2,Nr={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Fl(u){return u?Object.assign(Object.assign({},Nr),u):Nr}function Vl(u,e,t){return As(ut(u,e),Fl(t))}function As(u,e){var t;const l=Gl(u,e);if(l!==void 0)return l;const h={};for(const v of u.sortedFields){if(!u.isSet(v)){if(v.presence==$l)throw new Error(`cannot encode ${v} to JSON: required field not set`);if(!e.alwaysEmitImplicit||v.presence!==Ul)continue}const o=$r(v,u.get(v),e);o!==void 0&&(h[Kl(v,e)]=o)}if(e.registry){const v=new Set;for(const{no:o}of(t=u.getUnknown())!==null&&t!==void 0?t:[])if(!v.has(o)){v.add(o);const r=e.registry.getExtensionFor(u.desc,o);if(!r)continue;const a=kl(u.message,r),[n,s]=Xs(r,a),i=$r(s,n.get(s),e);i!==void 0&&(h[r.jsonName]=i)}}return h}function $r(u,e,t){switch(u.fieldKind){case"scalar":return Ys(u,e);case"message":return As(e,t);case"enum":return Gn(u.enum,e,t.enumAsInteger);case"list":return Hl(e,t);case"map":return Wl(e,t)}}function Wl(u,e){const t=u.field(),l={};switch(t.mapKind){case"scalar":for(const[h,v]of u)l[h]=Ys(t,v);break;case"message":for(const[h,v]of u)l[h]=As(v,e);break;case"enum":for(const[h,v]of u)l[h]=Gn(t.enum,v,e.enumAsInteger);break}return e.alwaysEmitImplicit||u.size>0?l:void 0}function Hl(u,e){const t=u.field(),l=[];switch(t.listKind){case"scalar":for(const h of u)l.push(Ys(t,h));break;case"enum":for(const h of u)l.push(Gn(t.enum,h,e.enumAsInteger));break;case"message":for(const h of u)l.push(As(h,e));break}return e.alwaysEmitImplicit||l.length>0?l:void 0}function Gn(u,e,t){var l;if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: expected number, got ${Qe(e)}`);if(u.typeName=="google.protobuf.NullValue")return null;if(t)return e;const h=u.value[e];return(l=h==null?void 0:h.name)!==null&&l!==void 0?l:e}function Ys(u,e){var t,l,h,v,o,r;switch(u.scalar){case ie.INT32:case ie.SFIXED32:case ie.SINT32:case ie.FIXED32:case ie.UINT32:if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: ${(t=Jt(u,e))===null||t===void 0?void 0:t.message}`);return e;case ie.FLOAT:case ie.DOUBLE:if(typeof e!="number")throw new Error(`cannot encode ${u} to JSON: ${(l=Jt(u,e))===null||l===void 0?void 0:l.message}`);return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case ie.STRING:if(typeof e!="string")throw new Error(`cannot encode ${u} to JSON: ${(h=Jt(u,e))===null||h===void 0?void 0:h.message}`);return e;case ie.BOOL:if(typeof e!="boolean")throw new Error(`cannot encode ${u} to JSON: ${(v=Jt(u,e))===null||v===void 0?void 0:v.message}`);return e;case ie.UINT64:case ie.FIXED64:case ie.INT64:case ie.SFIXED64:case ie.SINT64:if(typeof e!="bigint"&&typeof e!="string")throw new Error(`cannot encode ${u} to JSON: ${(o=Jt(u,e))===null||o===void 0?void 0:o.message}`);return e.toString();case ie.BYTES:if(e instanceof Uint8Array)return Ga(e);throw new Error(`cannot encode ${u} to JSON: ${(r=Jt(u,e))===null||r===void 0?void 0:r.message}`)}}function Kl(u,e){return e.useProtoFieldName?u.name:u.jsonName}function Gl(u,e){if(u.desc.typeName.startsWith("google.protobuf."))switch(u.desc.typeName){case"google.protobuf.Any":return zl(u.message,e);case"google.protobuf.Timestamp":return Yl(u.message);case"google.protobuf.Duration":return Zl(u.message);case"google.protobuf.FieldMask":return Xl(u.message);case"google.protobuf.Struct":return Gi(u.message);case"google.protobuf.Value":return zn(u.message);case"google.protobuf.ListValue":return zi(u.message);default:if(Ts(u.desc)){const t=u.desc.fields[0];return Ys(t,u.get(t))}return}}function zl(u,e){if(u.typeUrl==="")return{};const{registry:t}=e;let l,h;if(t&&(l=xl(u,t),l&&(h=t.getMessage(l.$typeName))),!h||!l)throw new Error(`cannot encode message ${u.$typeName} to JSON: "${u.typeUrl}" is not in the type registry`);let v=As(ut(h,l),e);return(h.typeName.startsWith("google.protobuf.")||v===null||Array.isArray(v)||typeof v!="object")&&(v={value:v}),v["@type"]=u.typeUrl,v}function Zl(u){if(Number(u.seconds)>315576e6||Number(u.seconds)<-315576e6)throw new Error(`cannot encode message ${u.$typeName} to JSON: value out of range`);let e=u.seconds.toString();if(u.nanos!==0){let t=Math.abs(u.nanos).toString();t="0".repeat(9-t.length)+t,t.substring(3)==="000000"?t=t.substring(0,3):t.substring(6)==="000"&&(t=t.substring(0,6)),e+="."+t,u.nanos<0&&Number(u.seconds)==0&&(e="-"+e)}return e+"s"}function Xl(u){return u.paths.map(e=>{if(e.match(/_[0-9]?_/g)||e.match(/[A-Z]/g))throw new Error(`cannot encode message ${u.$typeName} to JSON: lowerCamelCase of path name "`+e+'" is irreversible');return Cs(e)}).join(",")}function Gi(u){const e={};for(const[t,l]of Object.entries(u.fields))e[t]=zn(l);return e}function zn(u){switch(u.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(u.kind.value))throw new Error(`${u.$typeName} cannot be NaN or Infinity`);return u.kind.value;case"boolValue":return u.kind.value;case"stringValue":return u.kind.value;case"structValue":return Gi(u.kind.value);case"listValue":return zi(u.kind.value);default:throw new Error(`${u.$typeName} must have a value`)}}function zi(u){return u.values.map(zn)}function Yl(u){const e=Number(u.seconds)*1e3;if(e<Date.parse("0001-01-01T00:00:00Z")||e>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${u.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(u.nanos<0)throw new Error(`cannot encode message ${u.$typeName} to JSON: nanos must not be negative`);let t="Z";if(u.nanos>0){const l=(u.nanos+1e9).toString().substring(1);l.substring(3)==="000000"?t="."+l.substring(0,3)+"Z":l.substring(6)==="000"?t="."+l.substring(0,6)+"Z":t="."+l+"Z"}return new Date(e).toISOString().replace(".000Z",t)}const Ur={ignoreUnknownFields:!1};function Jl(u){return u?Object.assign(Object.assign({},Ur),u):Ur}function Ql(u,e,t){const l=ut(u);try{ls(l,e,Jl(t))}catch(h){throw Xa(h)?new Error(`cannot decode ${h.field()} from JSON: ${h.message}`,{cause:h}):h}return l.message}function ls(u,e,t){var l;if(ic(u,e,t))return;if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode ${u.desc} from JSON: ${Qe(e)}`);const h=new Map,v=new Map;for(const o of u.desc.fields)v.set(o.name,o).set(o.jsonName,o);for(const[o,r]of Object.entries(e)){const a=v.get(o);if(a){if(a.oneof){if(r===null&&a.fieldKind=="scalar")continue;const n=h.get(a.oneof);if(n!==void 0)throw new ot(a.oneof,`oneof set multiple times by ${n.name} and ${a.name}`);h.set(a.oneof,a)}Fr(u,a,r,t)}else{let n;if(o.startsWith("[")&&o.endsWith("]")&&(n=(l=t.registry)===null||l===void 0?void 0:l.getExtension(o.substring(1,o.length-1)))&&n.extendee.typeName===u.desc.typeName){const[s,i,d]=Xs(n);Fr(s,i,r,t),Bl(u.message,n,d())}if(!n&&!t.ignoreUnknownFields)throw new Error(`cannot decode ${u.desc} from JSON: key "${o}" is unknown`)}}}function Fr(u,e,t,l){switch(e.fieldKind){case"scalar":nc(u,e,t);break;case"enum":sc(u,e,t,l);break;case"message":tc(u,e,t,l);break;case"list":ec(u.get(e),t,l);break;case"map":ql(u.get(e),t,l);break}}function ql(u,e,t){if(e===null)return;const l=u.field();if(typeof e!="object"||Array.isArray(e))throw new ot(l,"expected object, got "+Qe(e));for(const[h,v]of Object.entries(e)){if(v===null)throw new ot(l,"map value must not be null");let o;switch(l.mapKind){case"message":const a=ut(l.message);ls(a,v,t),o=a;break;case"enum":if(o=Zn(l.enum,v,t.ignoreUnknownFields,!0),o===Js)return;break;case"scalar":o=qs(l,v,!0);break}const r=rc(l.mapKey,h);u.set(r,o)}}function ec(u,e,t){if(e===null)return;const l=u.field();if(!Array.isArray(e))throw new ot(l,"expected Array, got "+Qe(e));for(const h of e){if(h===null)throw new ot(l,"list item must not be null");switch(l.listKind){case"message":const v=ut(l.message);ls(v,h,t),u.add(v);break;case"enum":const o=Zn(l.enum,h,t.ignoreUnknownFields,!0);o!==Js&&u.add(o);break;case"scalar":u.add(qs(l,h,!0));break}}}function tc(u,e,t,l){if(t===null&&e.message.typeName!="google.protobuf.Value"){u.clear(e);return}const h=u.isSet(e)?u.get(e):ut(e.message);ls(h,t,l),u.set(e,h)}function sc(u,e,t,l){const h=Zn(e.enum,t,l.ignoreUnknownFields,!1);h===Qs?u.clear(e):h!==Js&&u.set(e,h)}function nc(u,e,t){const l=qs(e,t,!1);l===Qs?u.clear(e):u.set(e,l)}const Js=Symbol();function Zn(u,e,t,l){if(e===null)return u.typeName=="google.protobuf.NullValue"?0:l?u.values[0].number:Qs;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const h=u.values.find(v=>v.name===e);if(h!==void 0)return h.number;if(t)return Js;break}throw new Error(`cannot decode ${u} from JSON: ${Qe(e)}`)}const Qs=Symbol();function qs(u,e,t){if(e===null)return t?es(u.scalar,!1):Qs;switch(u.scalar){case ie.DOUBLE:case ie.FLOAT:if(e==="NaN")return NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof e=="number"){if(Number.isNaN(e))throw new ot(u,"unexpected NaN number");if(!Number.isFinite(e))throw new ot(u,"unexpected infinite number");break}if(typeof e=="string"){if(e===""||e.trim().length!==e.length)break;const l=Number(e);if(!Number.isFinite(l))break;return l}break;case ie.INT32:case ie.FIXED32:case ie.SFIXED32:case ie.SINT32:case ie.UINT32:return Zi(e);case ie.BYTES:if(typeof e=="string"){if(e==="")return new Uint8Array(0);try{return vi(e)}catch(l){const h=l instanceof Error?l.message:String(l);throw new ot(u,h)}}break}return e}function rc(u,e){switch(u){case ie.BOOL:switch(e){case"true":return!0;case"false":return!1}return e;case ie.INT32:case ie.FIXED32:case ie.UINT32:case ie.SFIXED32:case ie.SINT32:return Zi(e);default:return e}}function Zi(u){if(typeof u=="string"){if(u===""||u.trim().length!==u.length)return u;const e=Number(u);return Number.isNaN(e)?u:e}return u}function ic(u,e,t){if(!u.desc.typeName.startsWith("google.protobuf."))return!1;switch(u.desc.typeName){case"google.protobuf.Any":return oc(u.message,e,t),!0;case"google.protobuf.Timestamp":return ac(u.message,e),!0;case"google.protobuf.Duration":return lc(u.message,e),!0;case"google.protobuf.FieldMask":return cc(u.message,e),!0;case"google.protobuf.Struct":return Xi(u.message,e),!0;case"google.protobuf.Value":return Xn(u.message,e),!0;case"google.protobuf.ListValue":return Yi(u.message,e),!0;default:if(Ts(u.desc)){const l=u.desc.fields[0];return e===null?u.clear(l):u.set(l,qs(l,e,!0)),!0}return!1}}function oc(u,e,t){var l;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${u.$typeName} from JSON: expected object but got ${Qe(e)}`);if(Object.keys(e).length==0)return;const h=e["@type"];if(typeof h!="string"||h=="")throw new Error(`cannot decode message ${u.$typeName} from JSON: "@type" is empty`);const v=h.includes("/")?h.substring(h.lastIndexOf("/")+1):h;if(!v.length)throw new Error(`cannot decode message ${u.$typeName} from JSON: "@type" is invalid`);const o=(l=t.registry)===null||l===void 0?void 0:l.getMessage(v);if(!o)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${h} is not in the type registry`);const r=ut(o);if(v.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value")){const a=e.value;ls(r,a,t)}else{const a=Object.assign({},e);delete a["@type"],ls(r,a,t)}Il(r.desc,r.message,u)}function ac(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const t=e.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(!t)throw new Error(`cannot decode message ${u.$typeName} from JSON: invalid RFC 3339 string`);const l=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(l))throw new Error(`cannot decode message ${u.$typeName} from JSON: invalid RFC 3339 string`);if(l<Date.parse("0001-01-01T00:00:00Z")||l>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${u.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);u.seconds=Ve.parse(l/1e3),u.nanos=0,t[7]&&(u.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9)}function lc(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const t=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(t===null)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);const l=Number(t[1]);if(l>315576e6||l<-315576e6)throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);if(u.seconds=Ve.parse(l),typeof t[2]!="string")return;const h=t[2]+"0".repeat(9-t[2].length);u.nanos=parseInt(h),(l<0||Object.is(l,-0))&&(u.nanos=-u.nanos)}function cc(u,e){if(typeof e!="string")throw new Error(`cannot decode message ${u.$typeName} from JSON: ${Qe(e)}`);if(e==="")return;function t(l){if(l.includes("_"))throw new Error(`cannot decode message ${u.$typeName} from JSON: path names must be lowerCamelCase`);const h=l.replace(/[A-Z]/g,v=>"_"+v.toLowerCase());return h[0]==="_"?h.substring(1):h}u.paths=e.split(",").map(t)}function Xi(u,e){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`);for(const[t,l]of Object.entries(e)){const h=it(Hi);Xn(h,l),u.fields[t]=h}}function Xn(u,e){switch(typeof e){case"number":u.kind={case:"numberValue",value:e};break;case"string":u.kind={case:"stringValue",value:e};break;case"boolean":u.kind={case:"boolValue",value:e};break;case"object":if(e===null)u.kind={case:"nullValue",value:Sn.NULL_VALUE};else if(Array.isArray(e)){const t=it(Rl);Yi(t,e),u.kind={case:"listValue",value:t}}else{const t=it(Pl);Xi(t,e),u.kind={case:"structValue",value:t}}break;default:throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`)}return u}function Yi(u,e){if(!Array.isArray(e))throw new Error(`cannot decode message ${u.$typeName} from JSON ${Qe(e)}`);for(const t of e){const l=it(Hi);Xn(l,t),u.values.push(l)}}var dc={"./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/google/protobuf/wrappers_pb.js":(u,e,t)=>{t.r(e),t.d(e,{BoolValue:()=>_,BytesValue:()=>S,DoubleValue:()=>o,FloatValue:()=>a,Int32Value:()=>m,Int64Value:()=>s,StringValue:()=>y,UInt32Value:()=>f,UInt64Value:()=>d});var l=t("./node_modules/@protobuf-ts/runtime/build/es2015/reflection-info.js"),h=t("./node_modules/@protobuf-ts/runtime/build/es2015/message-type.js");class v extends h.MessageType{constructor(){super("google.protobuf.DoubleValue",[{no:1,name:"value",kind:"scalar",T:1}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(2,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,1,void 0,"value"),I}}const o=new v;class r extends h.MessageType{constructor(){super("google.protobuf.FloatValue",[{no:1,name:"value",kind:"scalar",T:2}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(1,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,1,void 0,"value"),I}}const a=new r;class n extends h.MessageType{constructor(){super("google.protobuf.Int64Value",[{no:1,name:"value",kind:"scalar",T:3}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(l.ScalarType.INT64,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,l.ScalarType.INT64,l.LongType.STRING,"value"),I}}const s=new n;class i extends h.MessageType{constructor(){super("google.protobuf.UInt64Value",[{no:1,name:"value",kind:"scalar",T:4}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(l.ScalarType.UINT64,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,l.ScalarType.UINT64,l.LongType.STRING,"value"),I}}const d=new i;class p extends h.MessageType{constructor(){super("google.protobuf.Int32Value",[{no:1,name:"value",kind:"scalar",T:5}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(5,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,5,void 0,"value"),I}}const m=new p;class c extends h.MessageType{constructor(){super("google.protobuf.UInt32Value",[{no:1,name:"value",kind:"scalar",T:13}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(13,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,13,void 0,"value"),I}}const f=new c;class g extends h.MessageType{constructor(){super("google.protobuf.BoolValue",[{no:1,name:"value",kind:"scalar",T:8}])}internalJsonWrite(j,O){return j.value}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,8,void 0,"value"),I}}const _=new g;class b extends h.MessageType{constructor(){super("google.protobuf.StringValue",[{no:1,name:"value",kind:"scalar",T:9}])}internalJsonWrite(j,O){return j.value}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,9,void 0,"value"),I}}const y=new b;class C extends h.MessageType{constructor(){super("google.protobuf.BytesValue",[{no:1,name:"value",kind:"scalar",T:12}])}internalJsonWrite(j,O){return this.refJsonWriter.scalar(12,j.value,"value",!1,!0)}internalJsonRead(j,O,I){return I||(I=this.create()),I.value=this.refJsonReader.scalar(j,12,void 0,"value"),I}}const S=new C},"./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/runme/runner/v1/runner_pb.js":(u,e,t)=>{t.r(e),t.d(e,{CommandMode:()=>p,CreateSessionRequest:()=>b,CreateSessionResponse:()=>C,DeleteSessionRequest:()=>V,DeleteSessionResponse:()=>K,ExecuteRequest:()=>F,ExecuteResponse:()=>P,ExecuteStop:()=>d,GetSessionRequest:()=>E,GetSessionResponse:()=>O,ListSessionsRequest:()=>T,ListSessionsResponse:()=>M,MonitorEnvStoreRequest:()=>G,MonitorEnvStoreResponse:()=>xe,MonitorEnvStoreResponseSnapshot:()=>Q,MonitorEnvStoreResponseSnapshot_Error:()=>Ee,MonitorEnvStoreResponseSnapshot_SnapshotEnv:()=>ae,MonitorEnvStoreResponseSnapshot_Status:()=>s,MonitorEnvStoreType:()=>c,ProcessPID:()=>X,Project:()=>L,Project_DirEnv:()=>o,ResolveProgramCommandList:()=>q,ResolveProgramRequest:()=>ne,ResolveProgramRequest_Mode:()=>r,ResolveProgramRequest_Retention:()=>a,ResolveProgramResponse:()=>pe,ResolveProgramResponse_Status:()=>n,ResolveProgramResponse_VarResult:()=>ce,RunnerService:()=>Se,Session:()=>g,SessionEnvStoreType:()=>i,SessionStrategy:()=>m,Winsize:()=>U});var l=t("./node_modules/@protobuf-ts/runtime-rpc/build/es2015/service-type.js"),h=t("./node_modules/@protobuf-ts/runtime/build/es2015/message-type.js"),v=t("./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/google/protobuf/wrappers_pb.js"),o;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.ENABLED_WARN=1]="ENABLED_WARN",le[le.ENABLED_ERROR=2]="ENABLED_ERROR",le[le.DISABLED=3]="DISABLED"})(o||(o={}));var r;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.PROMPT_ALL=1]="PROMPT_ALL",le[le.SKIP_ALL=2]="SKIP_ALL"})(r||(r={}));var a;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.FIRST_RUN=1]="FIRST_RUN",le[le.LAST_RUN=2]="LAST_RUN"})(a||(a={}));var n;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.UNRESOLVED_WITH_MESSAGE=1]="UNRESOLVED_WITH_MESSAGE",le[le.UNRESOLVED_WITH_PLACEHOLDER=2]="UNRESOLVED_WITH_PLACEHOLDER",le[le.RESOLVED=3]="RESOLVED",le[le.UNRESOLVED_WITH_SECRET=4]="UNRESOLVED_WITH_SECRET"})(n||(n={}));var s;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.LITERAL=1]="LITERAL",le[le.HIDDEN=2]="HIDDEN",le[le.MASKED=3]="MASKED"})(s||(s={}));var i;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.OWL=1]="OWL"})(i||(i={}));var d;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.INTERRUPT=1]="INTERRUPT",le[le.KILL=2]="KILL"})(d||(d={}));var p;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.INLINE_SHELL=1]="INLINE_SHELL",le[le.TEMP_FILE=2]="TEMP_FILE",le[le.TERMINAL=3]="TERMINAL",le[le.DAGGER=4]="DAGGER"})(p||(p={}));var m;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.MOST_RECENT=1]="MOST_RECENT"})(m||(m={}));var c;(function(le){le[le.UNSPECIFIED=0]="UNSPECIFIED",le[le.SNAPSHOT=1]="SNAPSHOT"})(c||(c={}));class f extends h.MessageType{constructor(){super("runme.runner.v1.Session",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"envs",kind:"scalar",repeat:2,T:9},{no:3,name:"metadata",kind:"map",K:9,V:{kind:"scalar",T:9}}])}}const g=new f;class _ extends h.MessageType{constructor(){super("runme.runner.v1.CreateSessionRequest",[{no:1,name:"metadata",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:2,name:"envs",kind:"scalar",repeat:2,T:9},{no:3,name:"project",kind:"message",T:()=>L},{no:4,name:"env_store_type",kind:"enum",T:()=>["runme.runner.v1.SessionEnvStoreType",i,"SESSION_ENV_STORE_TYPE_"]}])}}const b=new _;class y extends h.MessageType{constructor(){super("runme.runner.v1.CreateSessionResponse",[{no:1,name:"session",kind:"message",T:()=>g}])}}const C=new y;class S extends h.MessageType{constructor(){super("runme.runner.v1.GetSessionRequest",[{no:1,name:"id",kind:"scalar",T:9}])}}const E=new S;class j extends h.MessageType{constructor(){super("runme.runner.v1.GetSessionResponse",[{no:1,name:"session",kind:"message",T:()=>g}])}}const O=new j;class I extends h.MessageType{constructor(){super("runme.runner.v1.ListSessionsRequest",[])}}const T=new I;class x extends h.MessageType{constructor(){super("runme.runner.v1.ListSessionsResponse",[{no:1,name:"sessions",kind:"message",repeat:1,T:()=>g}])}}const M=new x;class B extends h.MessageType{constructor(){super("runme.runner.v1.DeleteSessionRequest",[{no:1,name:"id",kind:"scalar",T:9}])}}const V=new B;class J extends h.MessageType{constructor(){super("runme.runner.v1.DeleteSessionResponse",[])}}const K=new J;class A extends h.MessageType{constructor(){super("runme.runner.v1.Project",[{no:1,name:"root",kind:"scalar",T:9},{no:2,name:"env_load_order",kind:"scalar",repeat:2,T:9},{no:3,name:"env_direnv",kind:"enum",T:()=>["runme.runner.v1.Project.DirEnv",o,"DIR_ENV_"]}])}}const L=new A;class D extends h.MessageType{constructor(){super("runme.runner.v1.Winsize",[{no:1,name:"rows",kind:"scalar",T:13},{no:2,name:"cols",kind:"scalar",T:13},{no:3,name:"x",kind:"scalar",T:13},{no:4,name:"y",kind:"scalar",T:13}])}}const U=new D;class k extends h.MessageType{constructor(){super("runme.runner.v1.ExecuteRequest",[{no:1,name:"program_name",kind:"scalar",T:9},{no:2,name:"arguments",kind:"scalar",repeat:2,T:9},{no:3,name:"directory",kind:"scalar",T:9},{no:4,name:"envs",kind:"scalar",repeat:2,T:9},{no:5,name:"commands",kind:"scalar",repeat:2,T:9},{no:6,name:"script",kind:"scalar",T:9},{no:7,name:"tty",kind:"scalar",T:8},{no:8,name:"input_data",kind:"scalar",T:12},{no:9,name:"stop",kind:"enum",T:()=>["runme.runner.v1.ExecuteStop",d,"EXECUTE_STOP_"]},{no:10,name:"winsize",kind:"message",T:()=>U},{no:11,name:"background",kind:"scalar",T:8},{no:20,name:"session_id",kind:"scalar",T:9},{no:21,name:"session_strategy",kind:"enum",T:()=>["runme.runner.v1.SessionStrategy",m,"SESSION_STRATEGY_"]},{no:22,name:"project",kind:"message",T:()=>L},{no:23,name:"store_last_output",kind:"scalar",T:8},{no:24,name:"command_mode",kind:"enum",T:()=>["runme.runner.v1.CommandMode",p,"COMMAND_MODE_"]},{no:25,name:"language_id",kind:"scalar",T:9},{no:26,name:"file_extension",kind:"scalar",T:9},{no:27,name:"known_id",kind:"scalar",T:9},{no:28,name:"known_name",kind:"scalar",T:9}])}}const F=new k;class Z extends h.MessageType{constructor(){super("runme.runner.v1.ProcessPID",[{no:1,name:"pid",kind:"scalar",T:3}])}}const X=new Z;class $ extends h.MessageType{constructor(){super("runme.runner.v1.ExecuteResponse",[{no:1,name:"exit_code",kind:"message",T:()=>v.UInt32Value},{no:2,name:"stdout_data",kind:"scalar",T:12},{no:3,name:"stderr_data",kind:"scalar",T:12},{no:4,name:"pid",kind:"message",T:()=>X},{no:5,name:"mime_type",kind:"scalar",T:9}])}}const P=new $;class ee extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramCommandList",[{no:1,name:"lines",kind:"scalar",repeat:2,T:9}])}}const q=new ee;class de extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramRequest",[{no:1,name:"commands",kind:"message",oneof:"source",T:()=>q},{no:2,name:"script",kind:"scalar",oneof:"source",T:9},{no:3,name:"mode",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramRequest.Mode",r,"MODE_"]},{no:4,name:"env",kind:"scalar",repeat:2,T:9},{no:5,name:"session_id",kind:"scalar",T:9},{no:6,name:"session_strategy",kind:"enum",T:()=>["runme.runner.v1.SessionStrategy",m,"SESSION_STRATEGY_"]},{no:7,name:"project",kind:"message",T:()=>L},{no:8,name:"language_id",kind:"scalar",T:9},{no:9,name:"retention",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramRequest.Retention",a,"RETENTION_"]}])}}const ne=new de;class _e extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramResponse",[{no:1,name:"script",kind:"scalar",T:9},{no:2,name:"commands",kind:"message",T:()=>q},{no:3,name:"vars",kind:"message",repeat:1,T:()=>ce}])}}const pe=new _e;class je extends h.MessageType{constructor(){super("runme.runner.v1.ResolveProgramResponse.VarResult",[{no:1,name:"status",kind:"enum",T:()=>["runme.runner.v1.ResolveProgramResponse.Status",n,"STATUS_"]},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"original_value",kind:"scalar",T:9},{no:4,name:"resolved_value",kind:"scalar",T:9}])}}const ce=new je;class oe extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreRequest",[{no:1,name:"session",kind:"message",T:()=>g}])}}const G=new oe;class W extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot",[{no:1,name:"envs",kind:"message",repeat:1,T:()=>ae}])}}const Q=new W;class te extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv",[{no:1,name:"status",kind:"enum",T:()=>["runme.runner.v1.MonitorEnvStoreResponseSnapshot.Status",s,"STATUS_"]},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"spec",kind:"scalar",T:9},{no:4,name:"origin",kind:"scalar",T:9},{no:5,name:"original_value",kind:"scalar",T:9},{no:6,name:"resolved_value",kind:"scalar",T:9},{no:7,name:"create_time",kind:"scalar",T:9},{no:8,name:"update_time",kind:"scalar",T:9},{no:9,name:"errors",kind:"message",repeat:1,T:()=>Ee},{no:10,name:"is_required",kind:"scalar",T:8},{no:11,name:"description",kind:"scalar",T:9}])}}const ae=new te;class he extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error",[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9}])}}const Ee=new he;class Ie extends h.MessageType{constructor(){super("runme.runner.v1.MonitorEnvStoreResponse",[{no:1,name:"type",kind:"enum",T:()=>["runme.runner.v1.MonitorEnvStoreType",c,"MONITOR_ENV_STORE_TYPE_"]},{no:2,name:"snapshot",kind:"message",oneof:"data",T:()=>Q}])}}const xe=new Ie,Se=new l.ServiceType("runme.runner.v1.RunnerService",[{name:"CreateSession",options:{},I:b,O:C},{name:"GetSession",options:{},I:E,O},{name:"ListSessions",options:{},I:T,O:M},{name:"DeleteSession",options:{},I:V,O:K},{name:"MonitorEnvStore",serverStreaming:!0,options:{},I:G,O:xe},{name:"Execute",serverStreaming:!0,clientStreaming:!0,options:{},I:F,O:P},{name:"ResolveProgram",options:{},I:ne,O:pe}])},"./node_modules/@lit/reactive-element/development/css-tag.js":(u,e,t)=>{t.r(e),t.d(e,{CSSResult:()=>a,adoptStyles:()=>d,css:()=>i,getCompatibleStyle:()=>m,supportsAdoptingStyleSheets:()=>v,unsafeCSS:()=>s});/**
|
|
5
3
|
* @license
|
|
6
4
|
* Copyright 2019 Google LLC
|
|
7
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1589,7 +1587,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1589
1587
|
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.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,d.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(g){for(let _=0;_<g;_++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
1590
1588
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=s.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,_){this._liveRegionDebouncer.refresh(g,_,this._terminal.rows)}_renderRows(g,_){const b=this._terminal.buffer,y=b.lines.length.toString();for(let C=g;C<=_;C++){const S=b.lines.get(b.ydisp+C),E=[],j=(S==null?void 0:S.translateToString(!0,void 0,void 0,E))||"",O=(b.ydisp+C+1).toString(),I=this._rowElements[C];I&&(j.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=j,this._rowColumns.set(I,E)),I.setAttribute("aria-posinset",O),I.setAttribute("aria-setsize",y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,_){const b=g.target,y=this._rowElements[_===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==y)return;let C,S;if(_===0?(C=b,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(C=this._rowElements.shift(),S=b,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:g.anchorNode,offset:g.anchorOffset},b={node:g.focusNode,offset:g.focusOffset};if((_.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===b.node&&_.offset>b.offset)&&([_,b]=[b,_]),_.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(b.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:y,offset:((j=y.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(b.node))return;const C=({node:O,offset:I})=>{const T=O instanceof Text?O.parentNode:O;let x=parseInt(T==null?void 0:T.getAttribute("aria-posinset"),10)-1;if(isNaN(x))return console.warn("row is invalid. Race condition?"),null;const M=this._rowColumns.get(T);if(!M)return console.warn("columns is null. Race condition?"),null;let B=I<M.length?M[I]:M.slice(-1)[0]+1;return B>=this._terminal.cols&&(++x,B=0),{row:x,column:B}},S=C(_),E=C(b);if(S&&E){if(S.row>E.row||S.row===E.row&&S.column>=E.column)throw new Error("invalid range");this._terminal.select(S.column,S.row,(E.row-S.row)*this._terminal.cols-S.column+E.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_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 g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=f=a([n(1,m.IInstantiationService),n(2,p.ICoreBrowserService),n(3,p.IRenderService)],f)},3614:(v,o)=>{function r(i){return i.replace(/\r?\n/g,"\r")}function a(i,d){return d?"\x1B[200~"+i+"\x1B[201~":i}function n(i,d,p,m){i=a(i=r(i),p.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(i,!0),d.value=""}function s(i,d,p){const m=p.getBoundingClientRect(),c=i.clientX-m.left-10,f=i.clientY-m.top-10;d.style.width="20px",d.style.height="20px",d.style.left=`${c}px`,d.style.top=`${f}px`,d.style.zIndex="1000",d.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=r,o.bracketTextForPaste=a,o.copyHandler=function(i,d){i.clipboardData&&i.clipboardData.setData("text/plain",d.selectionText),i.preventDefault()},o.handlePasteEvent=function(i,d,p,m){i.stopPropagation(),i.clipboardData&&n(i.clipboardData.getData("text/plain"),d,p,m)},o.paste=n,o.moveTextAreaUnderMouseCursor=s,o.rightClickHandler=function(i,d,p,m,c){s(i,d,p),c&&m.rightClickSelect(i),d.value=m.selectionText,d.select()}},7239:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const a=r(1505);o.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(n,s,i){this._css.set(n,s,i)}getCss(n,s){return this._css.get(n,s)}setColor(n,s,i){this._color.set(n,s,i)}getColor(n,s){return this._color.get(n,s)}clear(){this._color.clear(),this._css.clear()}}},3656:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(r,a,n,s){r.addEventListener(a,n,s);let i=!1;return{dispose:()=>{i||(i=!0,r.removeEventListener(a,n,s))}}}},3551:function(v,o,r){var a=this&&this.__decorate||function(f,g,_,b){var y,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,_,b);else for(var E=f.length-1;E>=0;E--)(y=f[E])&&(S=(C<3?y(S):C>3?y(g,_,S):y(g,_))||S);return C>3&&S&&Object.defineProperty(g,_,S),S},n=this&&this.__param||function(f,g){return function(_,b){g(_,b,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const s=r(3656),i=r(8460),d=r(844),p=r(2585),m=r(4725);let c=o.Linkifier=class extends d.Disposable{get currentLink(){return this._currentLink}constructor(f,g,_,b,y){super(),this._element=f,this._mouseService=g,this._renderService=_,this._bufferService=b,this._linkProviderService=y,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new i.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new i.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,d.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,d.toDisposable)(()=>{var C;this._lastMouseEvent=void 0,(C=this._activeProviderReplies)==null||C.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,s.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,s.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){this._lastMouseEvent=f;const g=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const _=f.composedPath();for(let b=0;b<_.length;b++){const y=_[b];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,g){var b,y;this._activeProviderReplies&&g||((b=this._activeProviderReplies)==null||b.forEach(C=>{C==null||C.forEach(S=>{S.link.dispose&&S.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=f.y);let _=!1;for(const[C,S]of this._linkProviderService.linkProviders.entries())g?(y=this._activeProviderReplies)!=null&&y.get(C)&&(_=this._checkLinkProviderResult(C,f,_)):S.provideLinks(f.y,E=>{var O,I;if(this._isMouseOut)return;const j=E==null?void 0:E.map(T=>({link:T}));(O=this._activeProviderReplies)==null||O.set(C,j),_=this._checkLinkProviderResult(C,f,_),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)})}_removeIntersectingLinks(f,g){const _=new Set;for(let b=0;b<g.size;b++){const y=g.get(b);if(y)for(let C=0;C<y.length;C++){const S=y[C],E=S.link.range.start.y<f?0:S.link.range.start.x,j=S.link.range.end.y>f?this._bufferService.cols:S.link.range.end.x;for(let O=E;O<=j;O++){if(_.has(O)){y.splice(C--,1);break}_.add(O)}}}}_checkLinkProviderResult(f,g,_){var C;if(!this._activeProviderReplies)return _;const b=this._activeProviderReplies.get(f);let y=!1;for(let S=0;S<f;S++)this._activeProviderReplies.has(S)&&!this._activeProviderReplies.get(S)||(y=!0);if(!y&&b){const S=b.find(E=>this._linkAtPosition(E.link,g));S&&(_=!0,this._handleNewLink(S))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let S=0;S<this._activeProviderReplies.size;S++){const E=(C=this._activeProviderReplies.get(S))==null?void 0:C.find(j=>this._linkAtPosition(j.link,g));if(E){_=!0,this._handleNewLink(E);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._currentLink)return;const g=this._positionFromMouseEvent(f,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,g){this._currentLink&&this._lastMouseEvent&&(!f||!g||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,d.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(f.link,g)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var _,b;return(b=(_=this._currentLink)==null?void 0:_.state)==null?void 0:b.decorations.pointerCursor},set:_=>{var b;(b=this._currentLink)!=null&&b.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>{var _,b;return(b=(_=this._currentLink)==null?void 0:_.state)==null?void 0:b.decorations.underline},set:_=>{var b,y,C;(b=this._currentLink)!=null&&b.state&&((C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(_=>{if(!this._currentLink)return;const b=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(b,y),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}})))}_linkHover(f,g,_){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(_,g.text)}_fireUnderlineEvent(f,g){const _=f.range,b=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-b-1,_.end.x,_.end.y-b-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(f,g,_){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(_,g.text)}_linkAtPosition(f,g){const _=f.range.start.y*this._bufferService.cols+f.range.start.x,b=f.range.end.y*this._bufferService.cols+f.range.end.x,y=g.y*this._bufferService.cols+g.x;return _<=y&&y<=b}_positionFromMouseEvent(f,g,_){const b=_.getCoords(f,g,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,g,_,b,y){return{x1:f,y1:g,x2:_,y2:b,cols:this._bufferService.cols,fg:y}}};o.Linkifier=c=a([n(1,m.IMouseService),n(2,m.IRenderService),n(3,p.IBufferService),n(4,m.ILinkProviderService)],c)},9042:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(v,o,r){var a=this&&this.__decorate||function(m,c,f,g){var _,b=arguments.length,y=b<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,c,f,g);else for(var C=m.length-1;C>=0;C--)(_=m[C])&&(y=(b<3?_(y):b>3?_(c,f,y):_(c,f))||y);return b>3&&y&&Object.defineProperty(c,f,y),y},n=this&&this.__param||function(m,c){return function(f,g){c(f,g,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const s=r(511),i=r(2585);let d=o.OscLinkProvider=class{constructor(m,c,f){this._bufferService=m,this._optionsService=c,this._oscLinkService=f}provideLinks(m,c){var j;const f=this._bufferService.buffer.lines.get(m-1);if(!f)return void c(void 0);const g=[],_=this._optionsService.rawOptions.linkHandler,b=new s.CellData,y=f.getTrimmedLength();let C=-1,S=-1,E=!1;for(let O=0;O<y;O++)if(S!==-1||f.hasContent(O)){if(f.loadCell(O,b),b.hasExtendedAttrs()&&b.extended.urlId){if(S===-1){S=O,C=b.extended.urlId;continue}E=b.extended.urlId!==C}else S!==-1&&(E=!0);if(E||S!==-1&&O===y-1){const I=(j=this._oscLinkService.getLinkData(C))==null?void 0:j.uri;if(I){const T={start:{x:S+1,y:m},end:{x:O+(E||O!==y-1?0:1),y:m}};let x=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const M=new URL(I);["http:","https:"].includes(M.protocol)||(x=!0)}catch{x=!0}x||g.push({text:I,range:T,activate:(M,B)=>_?_.activate(M,B,T):p(0,B),hover:(M,B)=>{var V;return(V=_==null?void 0:_.hover)==null?void 0:V.call(_,M,B,T)},leave:(M,B)=>{var V;return(V=_==null?void 0:_.leave)==null?void 0:V.call(_,M,B,T)}})}E=!1,b.hasExtendedAttrs()&&b.extended.urlId?(S=O,C=b.extended.urlId):(S=-1,C=-1)}}c(g)}};function p(m,c){if(confirm(`Do you want to navigate to ${c}?
|
|
1591
1589
|
|
|
1592
|
-
WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=d=a([n(0,i.IBufferService),n(1,i.IOptionsService),n(2,i.IOscLinkService)],d)},6193:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(r,a){this._renderCallback=r,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(r){return this._refreshCallbacks.push(r),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(r,a,n){this._rowCount=n,r=r!==void 0?r:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,r):r,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 r=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(r,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const r of this._refreshCallbacks)r(0);this._refreshCallbacks=[]}}},3236:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const a=r(3614),n=r(3656),s=r(3551),i=r(9042),d=r(3730),p=r(1680),m=r(3107),c=r(5744),f=r(2950),g=r(1296),_=r(428),b=r(4269),y=r(5114),C=r(8934),S=r(3230),E=r(9312),j=r(4725),O=r(6731),I=r(8055),T=r(8969),x=r(8460),M=r(844),B=r(6114),V=r(8437),J=r(2584),K=r(7399),A=r(5941),L=r(9074),D=r(2585),U=r(5435),k=r(4567),F=r(779);class Z extends T.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($={}){super($),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new x.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new x.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new x.EventEmitter),this._onBlur=this.register(new x.EventEmitter),this._onA11yCharEmitter=this.register(new x.EventEmitter),this._onA11yTabEmitter=this.register(new x.EventEmitter),this._onWillOpen=this.register(new x.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((P,ee)=>this.refresh(P,ee))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(P=>this._reportWindowsOptions(P))),this.register(this._inputHandler.onColor(P=>this._handleColorEvent(P))),this.register((0,x.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,x.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,x.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,x.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(P=>this._afterResize(P.cols,P.rows))),this.register((0,M.toDisposable)(()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)}))}_handleColorEvent($){if(this._themeService)for(const P of $){let ee,q="";switch(P.index){case 256:ee="foreground",q="10";break;case 257:ee="background",q="11";break;case 258:ee="cursor",q="12";break;default:ee="ansi",q="4;"+P.index}switch(P.type){case 0:const de=I.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${q};${(0,A.toRgbString)(de)}${J.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors(ne=>ne.ansi[P.index]=I.channels.toColor(...P.color));else{const ne=ee;this._themeService.modifyColors(_e=>_e[ne]=I.channels.toColor(...P.color))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange($){$?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(k.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus($){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var $;return($=this.textarea)==null?void 0:$.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 $=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get($);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),q=this._renderService.dimensions.css.cell.height,de=P.getWidth(ee),ne=this._renderService.dimensions.css.cell.width*de,_e=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=_e+"px",this.textarea.style.width=ne+"px",this.textarea.style.height=q+"px",this.textarea.style.lineHeight=q+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,n.addDisposableDomListener)(this.element,"copy",P=>{this.hasSelection()&&(0,a.copyHandler)(P,this._selectionService)}));const $=P=>(0,a.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,n.addDisposableDomListener)(this.textarea,"paste",$)),this.register((0,n.addDisposableDomListener)(this.element,"paste",$)),B.isFirefox?this.register((0,n.addDisposableDomListener)(this.element,"mousedown",P=>{P.button===2&&(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,n.addDisposableDomListener)(this.element,"contextmenu",P=>{(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),B.isLinux&&this.register((0,n.addDisposableDomListener)(this.element,"auxclick",P=>{P.button===1&&(0,a.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,n.addDisposableDomListener)(this.textarea,"keyup",$=>this._keyUp($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"keydown",$=>this._keyDown($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"keypress",$=>this._keyPress($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionupdate",$=>this._compositionHelper.compositionupdate($))),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,n.addDisposableDomListener)(this.textarea,"input",$=>this._inputEvent($),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open($){var ee;if(!$)throw new Error("Terminal requires a parent element.");if($.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=$.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"),$.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.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,n.addDisposableDomListener)(this.screenElement,"mousemove",q=>this.updateCursorStyle(q))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",i.promptLabel),B.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,$.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,n.addDisposableDomListener)(this.textarea,"focus",q=>this._handleTextAreaFocus(q))),this.register((0,n.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(q=>this._onRender.fire(q))),this.onResize(q=>this._renderService.resize(q.cols,q.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(s.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(p.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(q=>this.scrollLines(q.amount,q.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(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(q=>this.scrollLines(q.amount,q.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(q=>this._renderService.handleSelectionChanged(q.start,q.end,q.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(q=>{this.textarea.value=q,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(q=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,n.addDisposableDomListener)(this.element,"mousedown",q=>this._selectionService.handleMouseDown(q))),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(k.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",q=>this._handleScreenReaderModeOptionChange(q))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",q=>{!this._overviewRulerRenderer&&q&&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(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const $=this,P=this.element;function ee(ne){const _e=$._mouseService.getMouseReportCoords(ne,$.screenElement);if(!_e)return!1;let pe,je;switch(ne.overrideType||ne.type){case"mousemove":je=32,ne.buttons===void 0?(pe=3,ne.button!==void 0&&(pe=ne.button<3?ne.button:3)):pe=1&ne.buttons?0:4&ne.buttons?1:2&ne.buttons?2:3;break;case"mouseup":je=0,pe=ne.button<3?ne.button:3;break;case"mousedown":je=1,pe=ne.button<3?ne.button:3;break;case"wheel":if($._customWheelEventHandler&&$._customWheelEventHandler(ne)===!1||$.viewport.getLinesScrolled(ne)===0)return!1;je=ne.deltaY<0?0:1,pe=4;break;default:return!1}return!(je===void 0||pe===void 0||pe>4)&&$.coreMouseService.triggerMouseEvent({col:_e.col,row:_e.row,x:_e.x,y:_e.y,button:pe,action:je,ctrl:ne.ctrlKey,alt:ne.altKey,shift:ne.shiftKey})}const q={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ne=>(ee(ne),ne.buttons||(this._document.removeEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.removeEventListener("mousemove",q.mousedrag)),this.cancel(ne)),wheel:ne=>(ee(ne),this.cancel(ne,!0)),mousedrag:ne=>{ne.buttons&&ee(ne)},mousemove:ne=>{ne.buttons||ee(ne)}};this.register(this.coreMouseService.onProtocolChange(ne=>{ne?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ne)),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&ne?q.mousemove||(P.addEventListener("mousemove",de.mousemove),q.mousemove=de.mousemove):(P.removeEventListener("mousemove",q.mousemove),q.mousemove=null),16&ne?q.wheel||(P.addEventListener("wheel",de.wheel,{passive:!1}),q.wheel=de.wheel):(P.removeEventListener("wheel",q.wheel),q.wheel=null),2&ne?q.mouseup||(q.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",q.mouseup),q.mouseup=null),4&ne?q.mousedrag||(q.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",q.mousedrag),q.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,n.addDisposableDomListener)(P,"mousedown",ne=>{if(ne.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ne))return ee(ne),q.mouseup&&this._document.addEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.addEventListener("mousemove",q.mousedrag),this.cancel(ne)})),this.register((0,n.addDisposableDomListener)(P,"wheel",ne=>{if(!q.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ne)===!1)return!1;if(!this.buffer.hasScrollback){const _e=this.viewport.getLinesScrolled(ne);if(_e===0)return;const pe=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ne.deltaY<0?"A":"B");let je="";for(let ce=0;ce<Math.abs(_e);ce++)je+=pe;return this.coreService.triggerDataEvent(je,!0),this.cancel(ne,!0)}return this.viewport.handleWheel(ne)?this.cancel(ne):void 0}},{passive:!1})),this.register((0,n.addDisposableDomListener)(P,"touchstart",ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ne),this.cancel(ne)},{passive:!0})),this.register((0,n.addDisposableDomListener)(P,"touchmove",ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ne)?void 0:this.cancel(ne)},{passive:!1}))}refresh($,P){var ee;(ee=this._renderService)==null||ee.refreshRows($,P)}updateCursorStyle($){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect($)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines($,P,ee=0){var q;ee===1?(super.scrollLines($,P,ee),this.refresh(0,this.rows-1)):(q=this.viewport)==null||q.scrollLines($)}paste($){(0,a.paste)($,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler($){this._customKeyEventHandler=$}attachCustomWheelEventHandler($){this._customWheelEventHandler=$}registerLinkProvider($){return this._linkProviderService.registerLinkProvider($)}registerCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register($);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister($)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker($){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+$)}registerDecoration($){return this._decorationService.registerDecoration($)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select($,P,ee){this._selectionService.setSelection($,P,ee)}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 $;($=this._selectionService)==null||$.clearSelection()}selectAll(){var $;($=this._selectionService)==null||$.selectAll()}selectLines($,P){var ee;(ee=this._selectionService)==null||ee.selectLines($,P)}_keyDown($){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&$.altKey;if(!P&&!this._compositionHelper.keydown($))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||$.key!=="Dead"&&$.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)($,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle($),ee.type===3||ee.type===2){const q=this.rows-1;return this.scrollLines(ee.type===2?-q:q),this.cancel($,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,$)||(ee.cancel&&this.cancel($,!0),!ee.key||!!($.key&&!$.ctrlKey&&!$.altKey&&!$.metaKey&&$.key.length===1&&$.key.charCodeAt(0)>=65&&$.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==J.C0.ETX&&ee.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||$.altKey||$.ctrlKey?this.cancel($,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift($,P){const ee=$.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||$.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||$.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp($){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1||(function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18}($)||this.focus(),this.updateCursorStyle($),this._keyPressHandled=!1)}_keyPress($){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;if(this.cancel($),$.charCode)P=$.charCode;else if($.which===null||$.which===void 0)P=$.keyCode;else{if($.which===0||$.charCode===0)return!1;P=$.which}return!(!P||($.altKey||$.ctrlKey||$.metaKey)&&!this._isThirdLevelShift(this.browser,$)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent($){if($.data&&$.inputType==="insertText"&&(!$.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=$.data;return this.coreService.triggerDataEvent(P,!0),this.cancel($),!0}return!1}resize($,P){$!==this.cols||P!==this.rows?super.resize($,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize($,P){var ee,q;(ee=this._charSizeService)==null||ee.measure(),(q=this.viewport)==null||q.syncScrollArea(!0)}clear(){var $;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 P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),($=this.viewport)==null||$.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var $;($=this._renderService)==null||$.clearTextureAtlas()}_reportFocus(){var $;($=this.element)!=null&&$.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions($){if(this._renderService)switch($){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${ee};${P}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const q=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${de};${q}t`)}}cancel($,P){if(this.options.cancelEvents||P)return $.preventDefault(),$.stopPropagation(),!1}}o.Terminal=Z},9924:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(r,a=1e3){this._renderCallback=r,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(r,a,n){this._rowCount=n,r=r!==void 0?r:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,r):r,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const i=s-this._lastRefreshMs,d=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},d)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const r=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(r,a)}}},1680:function(v,o,r){var a=this&&this.__decorate||function(f,g,_,b){var y,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,_,b);else for(var E=f.length-1;E>=0;E--)(y=f[E])&&(S=(C<3?y(S):C>3?y(g,_,S):y(g,_))||S);return C>3&&S&&Object.defineProperty(g,_,S),S},n=this&&this.__param||function(f,g){return function(_,b){g(_,b,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const s=r(3656),i=r(4725),d=r(8460),p=r(844),m=r(2585);let c=o.Viewport=class extends p.Disposable{constructor(f,g,_,b,y,C,S,E){super(),this._viewportElement=f,this._scrollArea=g,this._bufferService=_,this._optionsService=b,this._charSizeService=y,this._renderService=C,this._coreBrowserService=S,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,s.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(j=>this._activeBuffer=j.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(j=>this._renderDimensions=j)),this._handleThemeChange(E.colors),this.register(E.onChangeColors(j=>this._handleThemeChange(j))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)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 g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){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 g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,g){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&_<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const g=this._getPixelsScrolled(f);return g!==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+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(f,g))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let g=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(f,g){var E;let _,b="";const y=[],C=g??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let j=f;j<C;j++){const O=S.get(j);if(!O)continue;const I=(E=S.get(j+1))==null?void 0:E.isWrapped;if(b+=O.translateToString(!I),!I||j===S.length-1){const T=document.createElement("div");T.textContent=b,y.push(T),b.length>0&&(_=T),b=""}}return{bufferElements:y,cursorElement:_}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let g=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(f,g){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&g.altKey||_==="ctrl"&&g.ctrlKey||_==="shift"&&g.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const g=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(f,g))}};o.Viewport=c=a([n(2,m.IBufferService),n(3,m.IOptionsService),n(4,i.ICharSizeService),n(5,i.IRenderService),n(6,i.ICoreBrowserService),n(7,i.IThemeService)],c)},3107:function(v,o,r){var a=this&&this.__decorate||function(m,c,f,g){var _,b=arguments.length,y=b<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,c,f,g);else for(var C=m.length-1;C>=0;C--)(_=m[C])&&(y=(b<3?_(y):b>3?_(c,f,y):_(c,f))||y);return b>3&&y&&Object.defineProperty(c,f,y),y},n=this&&this.__param||function(m,c){return function(f,g){c(f,g,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const s=r(4725),i=r(844),d=r(2585);let p=o.BufferDecorationRenderer=class extends i.Disposable{constructor(m,c,f,g,_){super(),this._screenElement=m,this._bufferService=c,this._coreBrowserService=f,this._decorationService=g,this._renderService=_,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,i.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 g;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((g=m==null?void 0:m.options)==null?void 0:g.layer)==="top"),c.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=m.options.x??0;return f&&f>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(m,c),c}_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 f=this._decorationElements.get(m);f||(f=this._createElement(m),m.element=f,this._decorationElements.set(m,f),this._container.appendChild(f),m.onDispose(()=>{this._decorationElements.delete(m),f.remove()})),f.style.top=c*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(f)}}_refreshXPosition(m,c=m.element){if(!c)return;const f=m.options.x??0;(m.options.anchor||"left")==="right"?c.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=f?f*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()}};o.BufferDecorationRenderer=p=a([n(1,d.IBufferService),n(2,s.ICoreBrowserService),n(3,d.IDecorationService),n(4,s.IRenderService)],p)},5871:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(r){if(r.options.overviewRulerOptions){for(const a of this._zones)if(a.color===r.options.overviewRulerOptions.color&&a.position===r.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,r.marker.line))return;if(this._lineAdjacentToZone(a,r.marker.line,r.options.overviewRulerOptions.position))return void this._addLineToZone(a,r.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=r.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=r.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=r.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=r.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:r.options.overviewRulerOptions.color,position:r.options.overviewRulerOptions.position,startBufferLine:r.marker.line,endBufferLine:r.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(r){this._linePadding=r}_lineIntersectsZone(r,a){return a>=r.startBufferLine&&a<=r.endBufferLine}_lineAdjacentToZone(r,a,n){return a>=r.startBufferLine-this._linePadding[n||"full"]&&a<=r.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(r,a){r.startBufferLine=Math.min(r.startBufferLine,a),r.endBufferLine=Math.max(r.endBufferLine,a)}}},5744:function(v,o,r){var a=this&&this.__decorate||function(_,b,y,C){var S,E=arguments.length,j=E<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,b,y,C);else for(var O=_.length-1;O>=0;O--)(S=_[O])&&(j=(E<3?S(j):E>3?S(b,y,j):S(b,y))||j);return E>3&&j&&Object.defineProperty(b,y,j),j},n=this&&this.__param||function(_,b){return function(y,C){b(y,C,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const s=r(5871),i=r(4725),d=r(844),p=r(2585),m={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let g=o.OverviewRulerRenderer=class extends d.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,b,y,C,S,E,j){var I;super(),this._viewportElement=_,this._screenElement=b,this._bufferService=y,this._decorationService=C,this._renderService=S,this._optionsService=E,this._coreBrowserService=j,this._colorZoneStore=new s.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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,d.toDisposable)(()=>{var T;(T=this._canvas)==null||T.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 _=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=_,c.center=b,c.right=_,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=c.left,f.right=c.left+c.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);m.left=b,m.center=b,m.right=b}_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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const b of _)b.position!=="full"&&this._renderColorZone(b);for(const b of _)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(f[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-m[_.position||"full"]/2),c[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[_.position||"full"]))}_queueRefresh(_,b){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=g=a([n(2,p.IBufferService),n(3,p.IDecorationService),n(4,i.IRenderService),n(5,p.IOptionsService),n(6,i.ICoreBrowserService)],g)},2950:function(v,o,r){var a=this&&this.__decorate||function(m,c,f,g){var _,b=arguments.length,y=b<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,c,f,g);else for(var C=m.length-1;C>=0;C--)(_=m[C])&&(y=(b<3?_(y):b>3?_(c,f,y):_(c,f))||y);return b>3&&y&&Object.defineProperty(c,f,y),y},n=this&&this.__param||function(m,c){return function(f,g){c(f,g,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const s=r(4725),i=r(2585),d=r(2584);let p=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,c,f,g,_,b){this._textarea=m,this._compositionView=c,this._bufferService=f,this._optionsService=g,this._coreService=_,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(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 f;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),f.length>0&&this._coreService.triggerDataEvent(f,!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,f=c.replace(m,"");this._dataAlreadySent=f,c.length>m.length?this._coreService.triggerDataEvent(f,!0):c.length<m.length?this._coreService.triggerDataEvent(`${d.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),f=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"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=_+"px",this._textarea.style.top=g+"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"}m||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=p=a([n(2,i.IBufferService),n(3,i.IOptionsService),n(4,i.ICoreService),n(5,s.IRenderService)],p)},9806:(v,o)=>{function r(a,n,s){const i=s.getBoundingClientRect(),d=a.getComputedStyle(s),p=parseInt(d.getPropertyValue("padding-left")),m=parseInt(d.getPropertyValue("padding-top"));return[n.clientX-i.left-p,n.clientY-i.top-m]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=r,o.getCoords=function(a,n,s,i,d,p,m,c,f){if(!p)return;const g=r(a,n,s);return g?(g[0]=Math.ceil((g[0]+(f?m/2:0))/m),g[1]=Math.ceil(g[1]/c),g[0]=Math.min(Math.max(g[0],1),i+(f?1:0)),g[1]=Math.min(Math.max(g[1],1),d),g):void 0}},9504:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const a=r(2584);function n(c,f,g,_){const b=c-s(c,g),y=f-s(f,g),C=Math.abs(b-y)-function(S,E,j){let O=0;const I=S-s(S,j),T=E-s(E,j);for(let x=0;x<Math.abs(I-T);x++){const M=i(S,E)==="A"?-1:1,B=j.buffer.lines.get(I+M*x);B!=null&&B.isWrapped&&O++}return O}(c,f,g);return m(C,p(i(c,f),_))}function s(c,f){let g=0,_=f.buffer.lines.get(c),b=_==null?void 0:_.isWrapped;for(;b&&c>=0&&c<f.rows;)g++,_=f.buffer.lines.get(--c),b=_==null?void 0:_.isWrapped;return g}function i(c,f){return c>f?"A":"B"}function d(c,f,g,_,b,y){let C=c,S=f,E="";for(;C!==g||S!==_;)C+=b?1:-1,b&&C>y.cols-1?(E+=y.buffer.translateBufferLineToString(S,!1,c,C),C=0,c=0,S++):!b&&C<0&&(E+=y.buffer.translateBufferLineToString(S,!1,0,c+1),C=y.cols-1,c=C,S--);return E+y.buffer.translateBufferLineToString(S,!1,c,C)}function p(c,f){const g=f?"O":"[";return a.C0.ESC+g+c}function m(c,f){c=Math.floor(c);let g="";for(let _=0;_<c;_++)g+=f;return g}o.moveToCellSequence=function(c,f,g,_){const b=g.buffer.x,y=g.buffer.y;if(!g.buffer.hasScrollback)return function(E,j,O,I,T,x){return n(j,I,T,x).length===0?"":m(d(E,j,E,j-s(j,T),!1,T).length,p("D",x))}(b,y,0,f,g,_)+n(y,f,g,_)+function(E,j,O,I,T,x){let M;M=n(j,I,T,x).length>0?I-s(I,T):j;const B=I,V=function(J,K,A,L,D,U){let k;return k=n(A,L,D,U).length>0?L-s(L,D):K,J<A&&k<=L||J>=A&&k<L?"C":"D"}(E,j,O,I,T,x);return m(d(E,M,O,B,V==="C",T).length,p(V,x))}(b,y,c,f,g,_);let C;if(y===f)return C=b>c?"D":"C",m(Math.abs(b-c),p(C,_));C=y>f?"D":"C";const S=Math.abs(y-f);return m(function(E,j){return j.cols-E}(y>f?c:b,g)+(S-1)*g.cols+1+((y>f?b:c)-1),p(C,_))}},1296:function(v,o,r){var a=this&&this.__decorate||function(x,M,B,V){var J,K=arguments.length,A=K<3?M:V===null?V=Object.getOwnPropertyDescriptor(M,B):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,M,B,V);else for(var L=x.length-1;L>=0;L--)(J=x[L])&&(A=(K<3?J(A):K>3?J(M,B,A):J(M,B))||A);return K>3&&A&&Object.defineProperty(M,B,A),A},n=this&&this.__param||function(x,M){return function(B,V){M(B,V,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const s=r(3787),i=r(2550),d=r(2223),p=r(6171),m=r(6052),c=r(4725),f=r(8055),g=r(8460),_=r(844),b=r(2585),y="xterm-dom-renderer-owner-",C="xterm-rows",S="xterm-fg-",E="xterm-bg-",j="xterm-focus",O="xterm-selection";let I=1,T=o.DomRenderer=class extends _.Disposable{constructor(x,M,B,V,J,K,A,L,D,U,k,F,Z){super(),this._terminal=x,this._document=M,this._element=B,this._screenElement=V,this._viewportElement=J,this._helperContainer=K,this._linkifier2=A,this._charSizeService=D,this._optionsService=U,this._bufferService=k,this._coreBrowserService=F,this._themeService=Z,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),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(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(X=>this._injectCss(X))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(s.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(X=>this._handleLinkHover(X))),this.register(this._linkifier2.onHideLinkUnderline(X=>this._handleLinkLeave(X))),this.register((0,_.toDisposable)(()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new i.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 x=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*x,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*x),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/x),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/x),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 B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(x){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${C} { color: ${x.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${C} .xterm-dim { color: ${f.color.multiplyOpacity(x.foreground,.5).css};}`,M+=`${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 B=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;M+=`@keyframes ${B} { 50% { border-bottom-style: hidden; }}`,M+=`@keyframes ${V} { 50% { box-shadow: none; }}`,M+=`@keyframes ${J} { 0% { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css}; } 50% { background-color: inherit; color: ${x.cursor.css}; }}`,M+=`${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${x.cursor.css} !important; color: ${x.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${x.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${x.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${x.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${x.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${x.selectionInactiveBackgroundOpaque.css};}`;for(const[K,A]of x.ansi.entries())M+=`${this._terminalSelector} .${S}${K} { color: ${A.css}; }${this._terminalSelector} .${S}${K}.xterm-dim { color: ${f.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${E}${K} { background-color: ${A.css}; }`;M+=`${this._terminalSelector} .${S}${d.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(x.background).css}; }${this._terminalSelector} .${S}${d.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(x.background),.5).css}; }${this._terminalSelector} .${E}${d.INVERTED_DEFAULT_COLOR} { background-color: ${x.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const x=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${x}px`,this._rowFactory.defaultSpacing=x}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(x,M){for(let B=this._rowElements.length;B<=M;B++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(x,M){this._refreshRowElements(x,M),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(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(x,M,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(x,M,B),this.renderRows(0,this._bufferService.rows-1),!x||!M)return;this._selectionRenderModel.update(this._terminal,x,M,B);const V=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||A<0)return;const L=this._document.createDocumentFragment();if(B){const D=x[0]>M[0];L.appendChild(this._createSelectionElement(K,D?M[0]:x[0],D?x[0]:M[0],A-K+1))}else{const D=V===K?x[0]:0,U=K===J?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(K,D,U));const k=A-K-1;if(L.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,k)),K!==A){const F=J===A?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(A,0,F))}}this._selectionContainer.appendChild(L)}_createSelectionElement(x,M,B,V=1){const J=this._document.createElement("div"),K=M*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(B-M);return K+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-K),J.style.height=V*this.dimensions.css.cell.height+"px",J.style.top=x*this.dimensions.css.cell.height+"px",J.style.left=`${K}px`,J.style.width=`${A}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 x of this._rowElements)x.replaceChildren()}renderRows(x,M){const B=this._bufferService.buffer,V=B.ybase+B.y,J=Math.min(B.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=x;D<=M;D++){const U=D+B.ydisp,k=this._rowElements[D],F=B.lines.get(U);if(!k||!F)break;k.replaceChildren(...this._rowFactory.createRow(F,U,U===V,A,L,J,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!0)}_handleLinkLeave(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!1)}_setCellUnderline(x,M,B,V,J,K){B<0&&(x=0),V<0&&(M=0);const A=this._bufferService.rows-1;B=Math.max(Math.min(B,A),0),V=Math.max(Math.min(V,A),0),J=Math.min(J,this._bufferService.cols);const L=this._bufferService.buffer,D=L.ybase+L.y,U=Math.min(L.x,J-1),k=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=B;X<=V;++X){const $=X+L.ydisp,P=this._rowElements[X],ee=L.lines.get($);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,$,$===D,F,Z,U,k,this.dimensions.css.cell.width,this._widthCache,K?X===B?x:0:-1,K?(X===V?M:J)-1:-1))}}};o.DomRenderer=T=a([n(7,b.IInstantiationService),n(8,c.ICharSizeService),n(9,b.IOptionsService),n(10,b.IBufferService),n(11,c.ICoreBrowserService),n(12,c.IThemeService)],T)},3787:function(v,o,r){var a=this&&this.__decorate||function(C,S,E,j){var O,I=arguments.length,T=I<3?S:j===null?j=Object.getOwnPropertyDescriptor(S,E):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,S,E,j);else for(var x=C.length-1;x>=0;x--)(O=C[x])&&(T=(I<3?O(T):I>3?O(S,E,T):O(S,E))||T);return I>3&&T&&Object.defineProperty(S,E,T),T},n=this&&this.__param||function(C,S){return function(E,j){S(E,j,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const s=r(2223),i=r(643),d=r(511),p=r(2585),m=r(8055),c=r(4725),f=r(4269),g=r(6171),_=r(3734);let b=o.DomRendererRowFactory=class{constructor(C,S,E,j,O,I,T){this._document=C,this._characterJoinerService=S,this._optionsService=E,this._coreBrowserService=j,this._coreService=O,this._decorationService=I,this._themeService=T,this._workCell=new d.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,S,E){this._selectionStart=C,this._selectionEnd=S,this._columnSelectMode=E}createRow(C,S,E,j,O,I,T,x,M,B,V){const J=[],K=this._characterJoinerService.getJoinedCharacters(S),A=this._themeService.colors;let L,D=C.getNoBgTrimmedLength();E&&D<I+1&&(D=I+1);let U=0,k="",F=0,Z=0,X=0,$=!1,P=0,ee=!1,q=0;const de=[],ne=B!==-1&&V!==-1;for(let _e=0;_e<D;_e++){C.loadCell(_e,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let je=!1,ce=_e,oe=this._workCell;if(K.length>0&&_e===K[0][0]){je=!0;const Pe=K.shift();oe=new f.JoinedCellData(this._workCell,C.translateToString(!0,Pe[0],Pe[1]),Pe[1]-Pe[0]),ce=Pe[1]-1,pe=oe.getWidth()}const G=this._isCellInSelection(_e,S),W=E&&_e===I,Q=ne&&_e>=B&&_e<=V;let te=!1;this._decorationService.forEachDecorationAtCell(_e,S,void 0,Pe=>{te=!0});let ae=oe.getChars()||i.WHITESPACE_CELL_CHAR;if(ae===" "&&(oe.isUnderline()||oe.isOverline())&&(ae=" "),q=pe*x-M.get(ae,oe.isBold(),oe.isItalic()),L){if(U&&(G&&ee||!G&&!ee&&oe.bg===F)&&(G&&ee&&A.selectionForeground||oe.fg===Z)&&oe.extended.ext===X&&Q===$&&q===P&&!W&&!je&&!te){oe.isInvisible()?k+=i.WHITESPACE_CELL_CHAR:k+=ae,U++;continue}U&&(L.textContent=k),L=this._document.createElement("span"),U=0,k=""}else L=this._document.createElement("span");if(F=oe.bg,Z=oe.fg,X=oe.extended.ext,$=Q,P=q,ee=G,je&&I>=_e&&I<=ce&&(I=_e),!this._coreService.isCursorHidden&&W&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&de.push("xterm-cursor-blink"),de.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(oe.isBold()&&de.push("xterm-bold"),oe.isItalic()&&de.push("xterm-italic"),oe.isDim()&&de.push("xterm-dim"),k=oe.isInvisible()?i.WHITESPACE_CELL_CHAR:oe.getChars()||i.WHITESPACE_CELL_CHAR,oe.isUnderline()&&(de.push(`xterm-underline-${oe.extended.underlineStyle}`),k===" "&&(k=" "),!oe.isUnderlineColorDefault()))if(oe.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(oe.getUnderlineColor()).join(",")})`;else{let Pe=oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&oe.isBold()&&Pe<8&&(Pe+=8),L.style.textDecorationColor=A.ansi[Pe].css}oe.isOverline()&&(de.push("xterm-overline"),k===" "&&(k=" ")),oe.isStrikethrough()&&de.push("xterm-strikethrough"),Q&&(L.style.textDecoration="underline");let he=oe.getFgColor(),Ee=oe.getFgColorMode(),Ie=oe.getBgColor(),xe=oe.getBgColorMode();const Se=!!oe.isInverse();if(Se){const Pe=he;he=Ie,Ie=Pe;const Ye=Ee;Ee=xe,xe=Ye}let le,Ae,De,ke=!1;switch(this._decorationService.forEachDecorationAtCell(_e,S,void 0,Pe=>{Pe.options.layer!=="top"&&ke||(Pe.backgroundColorRGB&&(xe=50331648,Ie=Pe.backgroundColorRGB.rgba>>8&16777215,le=Pe.backgroundColorRGB),Pe.foregroundColorRGB&&(Ee=50331648,he=Pe.foregroundColorRGB.rgba>>8&16777215,Ae=Pe.foregroundColorRGB),ke=Pe.options.layer==="top")}),!ke&&G&&(le=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,Ie=le.rgba>>8&16777215,xe=50331648,ke=!0,A.selectionForeground&&(Ee=50331648,he=A.selectionForeground.rgba>>8&16777215,Ae=A.selectionForeground)),ke&&de.push("xterm-decoration-top"),xe){case 16777216:case 33554432:De=A.ansi[Ie],de.push(`xterm-bg-${Ie}`);break;case 50331648:De=m.channels.toColor(Ie>>16,Ie>>8&255,255&Ie),this._addStyle(L,`background-color:#${y((Ie>>>0).toString(16),"0",6)}`);break;default:Se?(De=A.foreground,de.push(`xterm-bg-${s.INVERTED_DEFAULT_COLOR}`)):De=A.background}switch(le||oe.isDim()&&(le=m.color.multiplyOpacity(De,.5)),Ee){case 16777216:case 33554432:oe.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(L,De,A.ansi[he],oe,le,void 0)||de.push(`xterm-fg-${he}`);break;case 50331648:const Pe=m.channels.toColor(he>>16&255,he>>8&255,255&he);this._applyMinimumContrast(L,De,Pe,oe,le,Ae)||this._addStyle(L,`color:#${y(he.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,De,A.foreground,oe,le,Ae)||Se&&de.push(`xterm-fg-${s.INVERTED_DEFAULT_COLOR}`)}de.length&&(L.className=de.join(" "),de.length=0),W||je||te?L.textContent=k:U++,q!==this.defaultSpacing&&(L.style.letterSpacing=`${q}px`),J.push(L),_e=ce}return L&&U&&(L.textContent=k),J}_applyMinimumContrast(C,S,E,j,O,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const T=this._getContrastCache(j);let x;if(O||I||(x=T.getColor(S.rgba,E.rgba)),x===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);x=m.color.ensureContrastRatio(O||S,I||E,M),T.setColor((O||S).rgba,(I||E).rgba,x??null)}return!!x&&(this._addStyle(C,`color:${x.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,S){C.setAttribute("style",`${C.getAttribute("style")||""}${S};`)}_isCellInSelection(C,S){const E=this._selectionStart,j=this._selectionEnd;return!(!E||!j)&&(this._columnSelectMode?E[0]<=j[0]?C>=E[0]&&S>=E[1]&&C<j[0]&&S<=j[1]:C<E[0]&&S>=E[1]&&C>=j[0]&&S<=j[1]:S>E[1]&&S<j[1]||E[1]===j[1]&&S===E[1]&&C>=E[0]&&C<j[0]||E[1]<j[1]&&S===j[1]&&C<j[0]||E[1]<j[1]&&S===E[1]&&C>=E[0])}};function y(C,S,E){for(;C.length<E;)C=S+C;return C}o.DomRendererRowFactory=b=a([n(1,c.ICharacterJoinerService),n(2,p.IOptionsService),n(3,c.ICoreBrowserService),n(4,p.ICoreService),n(5,p.IDecorationService),n(6,c.IThemeService)],b)},2550:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(r,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=r.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 n=r.createElement("span");n.classList.add("xterm-char-measure-element");const s=r.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";const i=r.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";const d=r.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[n,s,i,d],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(i),this._container.appendChild(d),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(r,a,n,s){r===this._font&&a===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=r,this._fontSize=a,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(r,a,n){let s=0;if(!a&&!n&&r.length===1&&(s=r.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];const p=this._measure(r,0);return p>0&&(this._flat[s]=p),p}let i=r;a&&(i+="B"),n&&(i+="I");let d=this._holey.get(i);if(d===void 0){let p=0;a&&(p|=1),n&&(p|=2),d=this._measure(r,p),d>0&&this._holey.set(i,d)}return d}_measure(r,a){const n=this._measureElements[a];return n.textContent=r.repeat(32),n.offsetWidth/32}}},2223:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const a=r(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(v,o)=>{function r(n){return 57508<=n&&n<=57558}function a(n){return n>=128512&&n<=128591||n>=127744&&n<=128511||n>=128640&&n<=128767||n>=9728&&n<=9983||n>=9984&&n<=10175||n>=65024&&n<=65039||n>=129280&&n<=129535||n>=127462&&n<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(n){if(!n)throw new Error("value must not be falsy");return n},o.isPowerlineGlyph=r,o.isRestrictedPowerlineGlyph=function(n){return 57520<=n&&n<=57527},o.isEmoji=a,o.allowRescaling=function(n,s,i,d){return s===1&&i>Math.ceil(1.5*d)&&n!==void 0&&n>255&&!a(n)&&!r(n)&&!function(p){return 57344<=p&&p<=63743}(n)},o.treatGlyphAsBackgroundColor=function(n){return r(n)||function(s){return 9472<=s&&s<=9631}(n)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(n,s,i=0){return(n-(2*Math.round(s)-i))%(2*Math.round(s))}},6052:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class r{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(n,s,i,d=!1){if(this.selectionStart=s,this.selectionEnd=i,!s||!i||s[0]===i[0]&&s[1]===i[1])return void this.clear();const p=n.buffers.active.ydisp,m=s[1]-p,c=i[1]-p,f=Math.max(m,0),g=Math.min(c,n.rows-1);f>=n.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=d,this.viewportStartRow=m,this.viewportEndRow=c,this.viewportCappedStartRow=f,this.viewportCappedEndRow=g,this.startCol=s[0],this.endCol=i[0])}isCellSelected(n,s,i){return!!this.hasSelection&&(i-=n.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?s>=this.startCol&&i>=this.viewportCappedStartRow&&s<this.endCol&&i<=this.viewportCappedEndRow:s<this.startCol&&i>=this.viewportCappedStartRow&&s>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol)}}o.createSelectionRenderModel=function(){return new r}},456:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(r){this._bufferService=r,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 r=this.selectionStart[0]+this.selectionStartLength;return r>this._bufferService.cols?r%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)-1]:[r%this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)]:[r,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const r=this.selectionStart[0]+this.selectionStartLength;return r>this._bufferService.cols?[r%this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)]:[Math.max(r,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const r=this.selectionStart,a=this.selectionEnd;return!(!r||!a)&&(r[1]>a[1]||r[1]===a[1]&&r[0]>a[0])}handleTrim(r){return this.selectionStart&&(this.selectionStart[1]-=r),this.selectionEnd&&(this.selectionEnd[1]-=r),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,o,r){var a=this&&this.__decorate||function(g,_,b,y){var C,S=arguments.length,E=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,b,y);else for(var j=g.length-1;j>=0;j--)(C=g[j])&&(E=(S<3?C(E):S>3?C(_,b,E):C(_,b))||E);return S>3&&E&&Object.defineProperty(_,b,E),E},n=this&&this.__param||function(g,_){return function(b,y){_(b,y,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const s=r(2585),i=r(8460),d=r(844);let p=o.CharSizeService=class extends d.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,_,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new i.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new c(g,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};o.CharSizeService=p=a([n(2,s.IOptionsService)],p);class m extends d.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,b){_!==void 0&&_>0&&b!==void 0&&b>0&&(this._result.width=_,this._result.height=b)}}class c extends m{constructor(_,b,y){super(),this._document=_,this._parentElement=b,this._optionsService=y,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class f extends m{constructor(_){super(),this._optionsService=_,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 _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(v,o,r){var a=this&&this.__decorate||function(f,g,_,b){var y,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,_,b);else for(var E=f.length-1;E>=0;E--)(y=f[E])&&(S=(C<3?y(S):C>3?y(g,_,S):y(g,_))||S);return C>3&&S&&Object.defineProperty(g,_,S),S},n=this&&this.__param||function(f,g){return function(_,b){g(_,b,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const s=r(3734),i=r(643),d=r(511),p=r(2585);class m extends s.AttributeData{constructor(g,_,b){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=_,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=m;let c=o.CharacterJoinerService=class So{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}register(g){const _={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(_),_.id}deregister(g){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===g)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(g);if(!_||_.length===0)return[];const b=[],y=_.translateToString(!0);let C=0,S=0,E=0,j=_.getFg(0),O=_.getBg(0);for(let I=0;I<_.getTrimmedLength();I++)if(_.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==O){if(I-C>1){const T=this._getJoinedRanges(y,E,S,_,C);for(let x=0;x<T.length;x++)b.push(T[x])}C=I,E=S,j=this._workCell.fg,O=this._workCell.bg}S+=this._workCell.getChars().length||i.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const I=this._getJoinedRanges(y,E,S,_,C);for(let T=0;T<I.length;T++)b.push(I[T])}return b}_getJoinedRanges(g,_,b,y,C){const S=g.substring(_,b);let E=[];try{E=this._characterJoiners[0].handler(S)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const O=this._characterJoiners[j].handler(S);for(let I=0;I<O.length;I++)So._mergeRanges(E,O[I])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,y,C),E}_stringRangesToCellRanges(g,_,b){let y=0,C=!1,S=0,E=g[y];if(E){for(let j=b;j<this._bufferService.cols;j++){const O=_.getWidth(j),I=_.getString(j).length||i.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!C&&E[0]<=S&&(E[0]=j,C=!0),E[1]<=S){if(E[1]=j,E=g[++y],!E)break;E[0]<=S?(E[0]=j,C=!0):C=!1}S+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(g,_){let b=!1;for(let y=0;y<g.length;y++){const C=g[y];if(b){if(_[1]<=C[0])return g[y-1][1]=_[1],g;if(_[1]<=C[1])return g[y-1][1]=Math.max(_[1],C[1]),g.splice(y,1),g;g.splice(y,1),y--}else{if(_[1]<=C[0])return g.splice(y,0,_),g;if(_[1]<=C[1])return C[0]=Math.min(_[0],C[0]),g;_[0]<C[1]&&(C[0]=Math.min(_[0],C[0]),b=!0)}}return b?g[g.length-1][1]=_[1]:g.push(_),g}};o.CharacterJoinerService=c=a([n(0,p.IBufferService)],c)},5114:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const a=r(844),n=r(8460),s=r(3656);class i extends a.Disposable{constructor(m,c,f){super(),this._textarea=m,this._window=c,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new d(this._window),this._onDprChange=this.register(new n.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new n.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(g=>this._screenDprMonitor.setWindow(g))),this.register((0,n.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}}o.CoreBrowserService=i;class d extends a.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new n.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,s.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:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const a=r(844);class n extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(i){return this.linkProviders.push(i),{dispose:()=>{const d=this.linkProviders.indexOf(i);d!==-1&&this.linkProviders.splice(d,1)}}}}o.LinkProviderService=n},8934:function(v,o,r){var a=this&&this.__decorate||function(p,m,c,f){var g,_=arguments.length,b=_<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,m,c,f);else for(var y=p.length-1;y>=0;y--)(g=p[y])&&(b=(_<3?g(b):_>3?g(m,c,b):g(m,c))||b);return _>3&&b&&Object.defineProperty(m,c,b),b},n=this&&this.__param||function(p,m){return function(c,f){m(c,f,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const s=r(4725),i=r(9806);let d=o.MouseService=class{constructor(p,m){this._renderService=p,this._charSizeService=m}getCoords(p,m,c,f,g){return(0,i.getCoords)(window,p,m,c,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(p,m){const c=(0,i.getCoordsRelativeToElement)(window,p,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])}}};o.MouseService=d=a([n(0,s.IRenderService),n(1,s.ICharSizeService)],d)},3230:function(v,o,r){var a=this&&this.__decorate||function(g,_,b,y){var C,S=arguments.length,E=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,b,y);else for(var j=g.length-1;j>=0;j--)(C=g[j])&&(E=(S<3?C(E):S>3?C(_,b,E):C(_,b))||E);return S>3&&E&&Object.defineProperty(_,b,E),E},n=this&&this.__param||function(g,_){return function(b,y){_(b,y,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const s=r(6193),i=r(4725),d=r(8460),p=r(844),m=r(7226),c=r(2585);let f=o.RenderService=class extends p.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,_,b,y,C,S,E,j){super(),this._rowCount=g,this._charSizeService=y,this._renderer=this.register(new p.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new p.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new d.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new d.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new d.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new d.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new s.RenderDebouncer((O,I)=>this._renderRows(O,I),E),this.register(this._renderDebouncer),this.register(E.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(S.onResize(()=>this._fullRefresh())),this.register(S.buffers.onBufferActivate(()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(S.cols,S.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(S.buffer.y,S.buffer.y,!0))),this.register(j.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(E.window,_),this.register(E.onWindowChange(O=>this._registerIntersectionObserver(O,_)))}_registerIntersectionObserver(g,_){if("IntersectionObserver"in g){const b=new g.IntersectionObserver(y=>this._handleIntersectionChange(y[y.length-1]),{threshold:0});b.observe(_),this._observerDisposable.value=(0,p.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,_,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,_,this._rowCount))}_renderRows(g,_){this._renderer.value&&(g=Math.min(g,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(g,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:_}),this._onRender.fire({start:g,end:_}),this._isNextRenderRedrawOnly=!0)}resize(g,_){this._rowCount=_,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw(_=>this.refreshRows(_.start,_.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,_;this._renderer.value&&((_=(g=this._renderer.value).clearTextureAtlas)==null||_.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(g,_)}):this._renderer.value.handleResize(g,_),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,_,b){var y;this._selectionState.start=g,this._selectionState.end=_,this._selectionState.columnSelectMode=b,(y=this._renderer.value)==null||y.handleSelectionChanged(g,_,b)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};o.RenderService=f=a([n(2,c.IOptionsService),n(3,i.ICharSizeService),n(4,c.IDecorationService),n(5,c.IBufferService),n(6,i.ICoreBrowserService),n(7,i.IThemeService)],f)},9312:function(v,o,r){var a=this&&this.__decorate||function(E,j,O,I){var T,x=arguments.length,M=x<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,j,O,I);else for(var B=E.length-1;B>=0;B--)(T=E[B])&&(M=(x<3?T(M):x>3?T(j,O,M):T(j,O))||M);return x>3&&M&&Object.defineProperty(j,O,M),M},n=this&&this.__param||function(E,j){return function(O,I){j(O,I,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const s=r(9806),i=r(9504),d=r(456),p=r(4725),m=r(8460),c=r(844),f=r(6114),g=r(4841),_=r(511),b=r(2585),y=" ",C=new RegExp(y,"g");let S=o.SelectionService=class extends c.Disposable{constructor(E,j,O,I,T,x,M,B,V){super(),this._element=E,this._screenElement=j,this._linkifier=O,this._bufferService=I,this._coreService=T,this._mouseService=x,this._optionsService=M,this._renderService=B,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.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 d.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 E=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!E||!j||E[0]===j[0]&&E[1]===j[1])}get selectionText(){const E=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!E||!j)return"";const O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===j[0])return"";const T=E[0]<j[0]?E[0]:j[0],x=E[0]<j[0]?j[0]:E[0];for(let M=E[1];M<=j[1];M++){const B=O.translateBufferLineToString(M,!0,T,x);I.push(B)}}else{const T=E[1]===j[1]?j[0]:void 0;I.push(O.translateBufferLineToString(E[1],!0,E[0],T));for(let x=E[1]+1;x<=j[1]-1;x++){const M=O.lines.get(x),B=O.translateBufferLineToString(x,!0);M!=null&&M.isWrapped?I[I.length-1]+=B:I.push(B)}if(E[1]!==j[1]){const x=O.lines.get(j[1]),M=O.translateBufferLineToString(j[1],!0,0,j[0]);x&&x.isWrapped?I[I.length-1]+=M:I.push(M)}}return I.map(T=>T.replace(C," ")).join(f.isWindows?`\r
|
|
1590
|
+
WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=d=a([n(0,i.IBufferService),n(1,i.IOptionsService),n(2,i.IOscLinkService)],d)},6193:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(r,a){this._renderCallback=r,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(r){return this._refreshCallbacks.push(r),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(r,a,n){this._rowCount=n,r=r!==void 0?r:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,r):r,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 r=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(r,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const r of this._refreshCallbacks)r(0);this._refreshCallbacks=[]}}},3236:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const a=r(3614),n=r(3656),s=r(3551),i=r(9042),d=r(3730),p=r(1680),m=r(3107),c=r(5744),f=r(2950),g=r(1296),_=r(428),b=r(4269),y=r(5114),C=r(8934),S=r(3230),E=r(9312),j=r(4725),O=r(6731),I=r(8055),T=r(8969),x=r(8460),M=r(844),B=r(6114),V=r(8437),J=r(2584),K=r(7399),A=r(5941),L=r(9074),D=r(2585),U=r(5435),k=r(4567),F=r(779);class Z extends T.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($={}){super($),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new x.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new x.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new x.EventEmitter),this._onBlur=this.register(new x.EventEmitter),this._onA11yCharEmitter=this.register(new x.EventEmitter),this._onA11yTabEmitter=this.register(new x.EventEmitter),this._onWillOpen=this.register(new x.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(d.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((P,ee)=>this.refresh(P,ee))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(P=>this._reportWindowsOptions(P))),this.register(this._inputHandler.onColor(P=>this._handleColorEvent(P))),this.register((0,x.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,x.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,x.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,x.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(P=>this._afterResize(P.cols,P.rows))),this.register((0,M.toDisposable)(()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)}))}_handleColorEvent($){if(this._themeService)for(const P of $){let ee,q="";switch(P.index){case 256:ee="foreground",q="10";break;case 257:ee="background",q="11";break;case 258:ee="cursor",q="12";break;default:ee="ansi",q="4;"+P.index}switch(P.type){case 0:const de=I.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${q};${(0,A.toRgbString)(de)}${J.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors(ne=>ne.ansi[P.index]=I.channels.toColor(...P.color));else{const ne=ee;this._themeService.modifyColors(_e=>_e[ne]=I.channels.toColor(...P.color))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange($){$?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(k.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus($){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var $;return($=this.textarea)==null?void 0:$.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 $=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get($);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),q=this._renderService.dimensions.css.cell.height,de=P.getWidth(ee),ne=this._renderService.dimensions.css.cell.width*de,_e=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=_e+"px",this.textarea.style.width=ne+"px",this.textarea.style.height=q+"px",this.textarea.style.lineHeight=q+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,n.addDisposableDomListener)(this.element,"copy",P=>{this.hasSelection()&&(0,a.copyHandler)(P,this._selectionService)}));const $=P=>(0,a.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,n.addDisposableDomListener)(this.textarea,"paste",$)),this.register((0,n.addDisposableDomListener)(this.element,"paste",$)),B.isFirefox?this.register((0,n.addDisposableDomListener)(this.element,"mousedown",P=>{P.button===2&&(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,n.addDisposableDomListener)(this.element,"contextmenu",P=>{(0,a.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),B.isLinux&&this.register((0,n.addDisposableDomListener)(this.element,"auxclick",P=>{P.button===1&&(0,a.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,n.addDisposableDomListener)(this.textarea,"keyup",$=>this._keyUp($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"keydown",$=>this._keyDown($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"keypress",$=>this._keyPress($),!0)),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionupdate",$=>this._compositionHelper.compositionupdate($))),this.register((0,n.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,n.addDisposableDomListener)(this.textarea,"input",$=>this._inputEvent($),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open($){var ee;if(!$)throw new Error("Terminal requires a parent element.");if($.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=$.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"),$.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.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,n.addDisposableDomListener)(this.screenElement,"mousemove",q=>this.updateCursorStyle(q))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",i.promptLabel),B.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,$.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,n.addDisposableDomListener)(this.textarea,"focus",q=>this._handleTextAreaFocus(q))),this.register((0,n.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(q=>this._onRender.fire(q))),this.onResize(q=>this._renderService.resize(q.cols,q.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(s.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(p.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(q=>this.scrollLines(q.amount,q.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(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(q=>this.scrollLines(q.amount,q.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(q=>this._renderService.handleSelectionChanged(q.start,q.end,q.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(q=>{this.textarea.value=q,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(q=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,n.addDisposableDomListener)(this.element,"mousedown",q=>this._selectionService.handleMouseDown(q))),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(k.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",q=>this._handleScreenReaderModeOptionChange(q))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",q=>{!this._overviewRulerRenderer&&q&&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(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const $=this,P=this.element;function ee(ne){const _e=$._mouseService.getMouseReportCoords(ne,$.screenElement);if(!_e)return!1;let pe,je;switch(ne.overrideType||ne.type){case"mousemove":je=32,ne.buttons===void 0?(pe=3,ne.button!==void 0&&(pe=ne.button<3?ne.button:3)):pe=1&ne.buttons?0:4&ne.buttons?1:2&ne.buttons?2:3;break;case"mouseup":je=0,pe=ne.button<3?ne.button:3;break;case"mousedown":je=1,pe=ne.button<3?ne.button:3;break;case"wheel":if($._customWheelEventHandler&&$._customWheelEventHandler(ne)===!1||$.viewport.getLinesScrolled(ne)===0)return!1;je=ne.deltaY<0?0:1,pe=4;break;default:return!1}return!(je===void 0||pe===void 0||pe>4)&&$.coreMouseService.triggerMouseEvent({col:_e.col,row:_e.row,x:_e.x,y:_e.y,button:pe,action:je,ctrl:ne.ctrlKey,alt:ne.altKey,shift:ne.shiftKey})}const q={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ne=>(ee(ne),ne.buttons||(this._document.removeEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.removeEventListener("mousemove",q.mousedrag)),this.cancel(ne)),wheel:ne=>(ee(ne),this.cancel(ne,!0)),mousedrag:ne=>{ne.buttons&&ee(ne)},mousemove:ne=>{ne.buttons||ee(ne)}};this.register(this.coreMouseService.onProtocolChange(ne=>{ne?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ne)),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&ne?q.mousemove||(P.addEventListener("mousemove",de.mousemove),q.mousemove=de.mousemove):(P.removeEventListener("mousemove",q.mousemove),q.mousemove=null),16&ne?q.wheel||(P.addEventListener("wheel",de.wheel,{passive:!1}),q.wheel=de.wheel):(P.removeEventListener("wheel",q.wheel),q.wheel=null),2&ne?q.mouseup||(q.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",q.mouseup),q.mouseup=null),4&ne?q.mousedrag||(q.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",q.mousedrag),q.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,n.addDisposableDomListener)(P,"mousedown",ne=>{if(ne.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ne))return ee(ne),q.mouseup&&this._document.addEventListener("mouseup",q.mouseup),q.mousedrag&&this._document.addEventListener("mousemove",q.mousedrag),this.cancel(ne)})),this.register((0,n.addDisposableDomListener)(P,"wheel",ne=>{if(!q.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ne)===!1)return!1;if(!this.buffer.hasScrollback){const _e=this.viewport.getLinesScrolled(ne);if(_e===0)return;const pe=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ne.deltaY<0?"A":"B");let je="";for(let ce=0;ce<Math.abs(_e);ce++)je+=pe;return this.coreService.triggerDataEvent(je,!0),this.cancel(ne,!0)}return this.viewport.handleWheel(ne)?this.cancel(ne):void 0}},{passive:!1})),this.register((0,n.addDisposableDomListener)(P,"touchstart",ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ne),this.cancel(ne)},{passive:!0})),this.register((0,n.addDisposableDomListener)(P,"touchmove",ne=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ne)?void 0:this.cancel(ne)},{passive:!1}))}refresh($,P){var ee;(ee=this._renderService)==null||ee.refreshRows($,P)}updateCursorStyle($){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect($)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines($,P,ee=0){var q;ee===1?(super.scrollLines($,P,ee),this.refresh(0,this.rows-1)):(q=this.viewport)==null||q.scrollLines($)}paste($){(0,a.paste)($,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler($){this._customKeyEventHandler=$}attachCustomWheelEventHandler($){this._customWheelEventHandler=$}registerLinkProvider($){return this._linkProviderService.registerLinkProvider($)}registerCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register($);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister($)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker($){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+$)}registerDecoration($){return this._decorationService.registerDecoration($)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select($,P,ee){this._selectionService.setSelection($,P,ee)}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 $;($=this._selectionService)==null||$.clearSelection()}selectAll(){var $;($=this._selectionService)==null||$.selectAll()}selectLines($,P){var ee;(ee=this._selectionService)==null||ee.selectLines($,P)}_keyDown($){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&$.altKey;if(!P&&!this._compositionHelper.keydown($))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||$.key!=="Dead"&&$.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)($,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle($),ee.type===3||ee.type===2){const q=this.rows-1;return this.scrollLines(ee.type===2?-q:q),this.cancel($,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,$)||(ee.cancel&&this.cancel($,!0),!ee.key||!!($.key&&!$.ctrlKey&&!$.altKey&&!$.metaKey&&$.key.length===1&&$.key.charCodeAt(0)>=65&&$.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==J.C0.ETX&&ee.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||$.altKey||$.ctrlKey?this.cancel($,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift($,P){const ee=$.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||$.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||$.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp($){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1||(function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18}($)||this.focus(),this.updateCursorStyle($),this._keyPressHandled=!1)}_keyPress($){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;if(this.cancel($),$.charCode)P=$.charCode;else if($.which===null||$.which===void 0)P=$.keyCode;else{if($.which===0||$.charCode===0)return!1;P=$.which}return!(!P||($.altKey||$.ctrlKey||$.metaKey)&&!this._isThirdLevelShift(this.browser,$)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent($){if($.data&&$.inputType==="insertText"&&(!$.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=$.data;return this.coreService.triggerDataEvent(P,!0),this.cancel($),!0}return!1}resize($,P){$!==this.cols||P!==this.rows?super.resize($,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize($,P){var ee,q;(ee=this._charSizeService)==null||ee.measure(),(q=this.viewport)==null||q.syncScrollArea(!0)}clear(){var $;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 P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),($=this.viewport)==null||$.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var $;($=this._renderService)==null||$.clearTextureAtlas()}_reportFocus(){var $;($=this.element)!=null&&$.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions($){if(this._renderService)switch($){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${ee};${P}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const q=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${de};${q}t`)}}cancel($,P){if(this.options.cancelEvents||P)return $.preventDefault(),$.stopPropagation(),!1}}o.Terminal=Z},9924:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(r,a=1e3){this._renderCallback=r,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(r,a,n){this._rowCount=n,r=r!==void 0?r:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,r):r,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const i=s-this._lastRefreshMs,d=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},d)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const r=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(r,a)}}},1680:function(v,o,r){var a=this&&this.__decorate||function(f,g,_,b){var y,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,_,b);else for(var E=f.length-1;E>=0;E--)(y=f[E])&&(S=(C<3?y(S):C>3?y(g,_,S):y(g,_))||S);return C>3&&S&&Object.defineProperty(g,_,S),S},n=this&&this.__param||function(f,g){return function(_,b){g(_,b,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const s=r(3656),i=r(4725),d=r(8460),p=r(844),m=r(2585);let c=o.Viewport=class extends p.Disposable{constructor(f,g,_,b,y,C,S,E){super(),this._viewportElement=f,this._scrollArea=g,this._bufferService=_,this._optionsService=b,this._charSizeService=y,this._renderService=C,this._coreBrowserService=S,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,s.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(j=>this._activeBuffer=j.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(j=>this._renderDimensions=j)),this._handleThemeChange(E.colors),this.register(E.onChangeColors(j=>this._handleThemeChange(j))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)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 g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){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 g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,g){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&_<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const g=this._getPixelsScrolled(f);return g!==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+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(f,g))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let g=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(f,g){var E;let _,b="";const y=[],C=g??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let j=f;j<C;j++){const O=S.get(j);if(!O)continue;const I=(E=S.get(j+1))==null?void 0:E.isWrapped;if(b+=O.translateToString(!I),!I||j===S.length-1){const T=document.createElement("div");T.textContent=b,y.push(T),b.length>0&&(_=T),b=""}}return{bufferElements:y,cursorElement:_}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let g=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(f,g){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&g.altKey||_==="ctrl"&&g.ctrlKey||_==="shift"&&g.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const g=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(f,g))}};o.Viewport=c=a([n(2,m.IBufferService),n(3,m.IOptionsService),n(4,i.ICharSizeService),n(5,i.IRenderService),n(6,i.ICoreBrowserService),n(7,i.IThemeService)],c)},3107:function(v,o,r){var a=this&&this.__decorate||function(m,c,f,g){var _,b=arguments.length,y=b<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,c,f,g);else for(var C=m.length-1;C>=0;C--)(_=m[C])&&(y=(b<3?_(y):b>3?_(c,f,y):_(c,f))||y);return b>3&&y&&Object.defineProperty(c,f,y),y},n=this&&this.__param||function(m,c){return function(f,g){c(f,g,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const s=r(4725),i=r(844),d=r(2585);let p=o.BufferDecorationRenderer=class extends i.Disposable{constructor(m,c,f,g,_){super(),this._screenElement=m,this._bufferService=c,this._coreBrowserService=f,this._decorationService=g,this._renderService=_,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,i.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 g;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((g=m==null?void 0:m.options)==null?void 0:g.layer)==="top"),c.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=m.options.x??0;return f&&f>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(m,c),c}_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 f=this._decorationElements.get(m);f||(f=this._createElement(m),m.element=f,this._decorationElements.set(m,f),this._container.appendChild(f),m.onDispose(()=>{this._decorationElements.delete(m),f.remove()})),f.style.top=c*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(f)}}_refreshXPosition(m,c=m.element){if(!c)return;const f=m.options.x??0;(m.options.anchor||"left")==="right"?c.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=f?f*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()}};o.BufferDecorationRenderer=p=a([n(1,d.IBufferService),n(2,s.ICoreBrowserService),n(3,d.IDecorationService),n(4,s.IRenderService)],p)},5871:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(r){if(r.options.overviewRulerOptions){for(const a of this._zones)if(a.color===r.options.overviewRulerOptions.color&&a.position===r.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,r.marker.line))return;if(this._lineAdjacentToZone(a,r.marker.line,r.options.overviewRulerOptions.position))return void this._addLineToZone(a,r.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=r.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=r.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=r.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=r.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:r.options.overviewRulerOptions.color,position:r.options.overviewRulerOptions.position,startBufferLine:r.marker.line,endBufferLine:r.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(r){this._linePadding=r}_lineIntersectsZone(r,a){return a>=r.startBufferLine&&a<=r.endBufferLine}_lineAdjacentToZone(r,a,n){return a>=r.startBufferLine-this._linePadding[n||"full"]&&a<=r.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(r,a){r.startBufferLine=Math.min(r.startBufferLine,a),r.endBufferLine=Math.max(r.endBufferLine,a)}}},5744:function(v,o,r){var a=this&&this.__decorate||function(_,b,y,C){var S,E=arguments.length,j=E<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,b,y,C);else for(var O=_.length-1;O>=0;O--)(S=_[O])&&(j=(E<3?S(j):E>3?S(b,y,j):S(b,y))||j);return E>3&&j&&Object.defineProperty(b,y,j),j},n=this&&this.__param||function(_,b){return function(y,C){b(y,C,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const s=r(5871),i=r(4725),d=r(844),p=r(2585),m={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let g=o.OverviewRulerRenderer=class extends d.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,b,y,C,S,E,j){var I;super(),this._viewportElement=_,this._screenElement=b,this._bufferService=y,this._decorationService=C,this._renderService=S,this._optionsService=E,this._coreBrowserService=j,this._colorZoneStore=new s.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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,d.toDisposable)(()=>{var T;(T=this._canvas)==null||T.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 _=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=_,c.center=b,c.right=_,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=c.left,f.right=c.left+c.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);m.left=b,m.center=b,m.right=b}_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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const b of _)b.position!=="full"&&this._renderColorZone(b);for(const b of _)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(f[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-m[_.position||"full"]/2),c[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[_.position||"full"]))}_queueRefresh(_,b){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=g=a([n(2,p.IBufferService),n(3,p.IDecorationService),n(4,i.IRenderService),n(5,p.IOptionsService),n(6,i.ICoreBrowserService)],g)},2950:function(v,o,r){var a=this&&this.__decorate||function(m,c,f,g){var _,b=arguments.length,y=b<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,c,f,g);else for(var C=m.length-1;C>=0;C--)(_=m[C])&&(y=(b<3?_(y):b>3?_(c,f,y):_(c,f))||y);return b>3&&y&&Object.defineProperty(c,f,y),y},n=this&&this.__param||function(m,c){return function(f,g){c(f,g,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const s=r(4725),i=r(2585),d=r(2584);let p=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,c,f,g,_,b){this._textarea=m,this._compositionView=c,this._bufferService=f,this._optionsService=g,this._coreService=_,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(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 f;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),f.length>0&&this._coreService.triggerDataEvent(f,!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,f=c.replace(m,"");this._dataAlreadySent=f,c.length>m.length?this._coreService.triggerDataEvent(f,!0):c.length<m.length?this._coreService.triggerDataEvent(`${d.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),f=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"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=_+"px",this._textarea.style.top=g+"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"}m||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=p=a([n(2,i.IBufferService),n(3,i.IOptionsService),n(4,i.ICoreService),n(5,s.IRenderService)],p)},9806:(v,o)=>{function r(a,n,s){const i=s.getBoundingClientRect(),d=a.getComputedStyle(s),p=parseInt(d.getPropertyValue("padding-left")),m=parseInt(d.getPropertyValue("padding-top"));return[n.clientX-i.left-p,n.clientY-i.top-m]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=r,o.getCoords=function(a,n,s,i,d,p,m,c,f){if(!p)return;const g=r(a,n,s);return g?(g[0]=Math.ceil((g[0]+(f?m/2:0))/m),g[1]=Math.ceil(g[1]/c),g[0]=Math.min(Math.max(g[0],1),i+(f?1:0)),g[1]=Math.min(Math.max(g[1],1),d),g):void 0}},9504:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const a=r(2584);function n(c,f,g,_){const b=c-s(c,g),y=f-s(f,g),C=Math.abs(b-y)-function(S,E,j){let O=0;const I=S-s(S,j),T=E-s(E,j);for(let x=0;x<Math.abs(I-T);x++){const M=i(S,E)==="A"?-1:1,B=j.buffer.lines.get(I+M*x);B!=null&&B.isWrapped&&O++}return O}(c,f,g);return m(C,p(i(c,f),_))}function s(c,f){let g=0,_=f.buffer.lines.get(c),b=_==null?void 0:_.isWrapped;for(;b&&c>=0&&c<f.rows;)g++,_=f.buffer.lines.get(--c),b=_==null?void 0:_.isWrapped;return g}function i(c,f){return c>f?"A":"B"}function d(c,f,g,_,b,y){let C=c,S=f,E="";for(;C!==g||S!==_;)C+=b?1:-1,b&&C>y.cols-1?(E+=y.buffer.translateBufferLineToString(S,!1,c,C),C=0,c=0,S++):!b&&C<0&&(E+=y.buffer.translateBufferLineToString(S,!1,0,c+1),C=y.cols-1,c=C,S--);return E+y.buffer.translateBufferLineToString(S,!1,c,C)}function p(c,f){const g=f?"O":"[";return a.C0.ESC+g+c}function m(c,f){c=Math.floor(c);let g="";for(let _=0;_<c;_++)g+=f;return g}o.moveToCellSequence=function(c,f,g,_){const b=g.buffer.x,y=g.buffer.y;if(!g.buffer.hasScrollback)return function(E,j,O,I,T,x){return n(j,I,T,x).length===0?"":m(d(E,j,E,j-s(j,T),!1,T).length,p("D",x))}(b,y,0,f,g,_)+n(y,f,g,_)+function(E,j,O,I,T,x){let M;M=n(j,I,T,x).length>0?I-s(I,T):j;const B=I,V=function(J,K,A,L,D,U){let k;return k=n(A,L,D,U).length>0?L-s(L,D):K,J<A&&k<=L||J>=A&&k<L?"C":"D"}(E,j,O,I,T,x);return m(d(E,M,O,B,V==="C",T).length,p(V,x))}(b,y,c,f,g,_);let C;if(y===f)return C=b>c?"D":"C",m(Math.abs(b-c),p(C,_));C=y>f?"D":"C";const S=Math.abs(y-f);return m(function(E,j){return j.cols-E}(y>f?c:b,g)+(S-1)*g.cols+1+((y>f?b:c)-1),p(C,_))}},1296:function(v,o,r){var a=this&&this.__decorate||function(x,M,B,V){var J,K=arguments.length,A=K<3?M:V===null?V=Object.getOwnPropertyDescriptor(M,B):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,M,B,V);else for(var L=x.length-1;L>=0;L--)(J=x[L])&&(A=(K<3?J(A):K>3?J(M,B,A):J(M,B))||A);return K>3&&A&&Object.defineProperty(M,B,A),A},n=this&&this.__param||function(x,M){return function(B,V){M(B,V,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const s=r(3787),i=r(2550),d=r(2223),p=r(6171),m=r(6052),c=r(4725),f=r(8055),g=r(8460),_=r(844),b=r(2585),y="xterm-dom-renderer-owner-",C="xterm-rows",S="xterm-fg-",E="xterm-bg-",j="xterm-focus",O="xterm-selection";let I=1,T=o.DomRenderer=class extends _.Disposable{constructor(x,M,B,V,J,K,A,L,D,U,k,F,Z){super(),this._terminal=x,this._document=M,this._element=B,this._screenElement=V,this._viewportElement=J,this._helperContainer=K,this._linkifier2=A,this._charSizeService=D,this._optionsService=U,this._bufferService=k,this._coreBrowserService=F,this._themeService=Z,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),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(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(X=>this._injectCss(X))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(s.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(X=>this._handleLinkHover(X))),this.register(this._linkifier2.onHideLinkUnderline(X=>this._handleLinkLeave(X))),this.register((0,_.toDisposable)(()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new i.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 x=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*x,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*x),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/x),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/x),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 B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(x){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${C} { color: ${x.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${C} .xterm-dim { color: ${f.color.multiplyOpacity(x.foreground,.5).css};}`,M+=`${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 B=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;M+=`@keyframes ${B} { 50% { border-bottom-style: hidden; }}`,M+=`@keyframes ${V} { 50% { box-shadow: none; }}`,M+=`@keyframes ${J} { 0% { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css}; } 50% { background-color: inherit; color: ${x.cursor.css}; }}`,M+=`${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${C}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${x.cursor.css}; color: ${x.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${x.cursor.css} !important; color: ${x.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${x.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${x.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${x.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${x.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${x.selectionInactiveBackgroundOpaque.css};}`;for(const[K,A]of x.ansi.entries())M+=`${this._terminalSelector} .${S}${K} { color: ${A.css}; }${this._terminalSelector} .${S}${K}.xterm-dim { color: ${f.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${E}${K} { background-color: ${A.css}; }`;M+=`${this._terminalSelector} .${S}${d.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(x.background).css}; }${this._terminalSelector} .${S}${d.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(x.background),.5).css}; }${this._terminalSelector} .${E}${d.INVERTED_DEFAULT_COLOR} { background-color: ${x.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const x=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${x}px`,this._rowFactory.defaultSpacing=x}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(x,M){for(let B=this._rowElements.length;B<=M;B++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(x,M){this._refreshRowElements(x,M),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(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(x,M,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(x,M,B),this.renderRows(0,this._bufferService.rows-1),!x||!M)return;this._selectionRenderModel.update(this._terminal,x,M,B);const V=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||A<0)return;const L=this._document.createDocumentFragment();if(B){const D=x[0]>M[0];L.appendChild(this._createSelectionElement(K,D?M[0]:x[0],D?x[0]:M[0],A-K+1))}else{const D=V===K?x[0]:0,U=K===J?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(K,D,U));const k=A-K-1;if(L.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,k)),K!==A){const F=J===A?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(A,0,F))}}this._selectionContainer.appendChild(L)}_createSelectionElement(x,M,B,V=1){const J=this._document.createElement("div"),K=M*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(B-M);return K+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-K),J.style.height=V*this.dimensions.css.cell.height+"px",J.style.top=x*this.dimensions.css.cell.height+"px",J.style.left=`${K}px`,J.style.width=`${A}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 x of this._rowElements)x.replaceChildren()}renderRows(x,M){const B=this._bufferService.buffer,V=B.ybase+B.y,J=Math.min(B.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=x;D<=M;D++){const U=D+B.ydisp,k=this._rowElements[D],F=B.lines.get(U);if(!k||!F)break;k.replaceChildren(...this._rowFactory.createRow(F,U,U===V,A,L,J,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!0)}_handleLinkLeave(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!1)}_setCellUnderline(x,M,B,V,J,K){B<0&&(x=0),V<0&&(M=0);const A=this._bufferService.rows-1;B=Math.max(Math.min(B,A),0),V=Math.max(Math.min(V,A),0),J=Math.min(J,this._bufferService.cols);const L=this._bufferService.buffer,D=L.ybase+L.y,U=Math.min(L.x,J-1),k=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=B;X<=V;++X){const $=X+L.ydisp,P=this._rowElements[X],ee=L.lines.get($);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,$,$===D,F,Z,U,k,this.dimensions.css.cell.width,this._widthCache,K?X===B?x:0:-1,K?(X===V?M:J)-1:-1))}}};o.DomRenderer=T=a([n(7,b.IInstantiationService),n(8,c.ICharSizeService),n(9,b.IOptionsService),n(10,b.IBufferService),n(11,c.ICoreBrowserService),n(12,c.IThemeService)],T)},3787:function(v,o,r){var a=this&&this.__decorate||function(C,S,E,j){var O,I=arguments.length,T=I<3?S:j===null?j=Object.getOwnPropertyDescriptor(S,E):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,S,E,j);else for(var x=C.length-1;x>=0;x--)(O=C[x])&&(T=(I<3?O(T):I>3?O(S,E,T):O(S,E))||T);return I>3&&T&&Object.defineProperty(S,E,T),T},n=this&&this.__param||function(C,S){return function(E,j){S(E,j,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const s=r(2223),i=r(643),d=r(511),p=r(2585),m=r(8055),c=r(4725),f=r(4269),g=r(6171),_=r(3734);let b=o.DomRendererRowFactory=class{constructor(C,S,E,j,O,I,T){this._document=C,this._characterJoinerService=S,this._optionsService=E,this._coreBrowserService=j,this._coreService=O,this._decorationService=I,this._themeService=T,this._workCell=new d.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,S,E){this._selectionStart=C,this._selectionEnd=S,this._columnSelectMode=E}createRow(C,S,E,j,O,I,T,x,M,B,V){const J=[],K=this._characterJoinerService.getJoinedCharacters(S),A=this._themeService.colors;let L,D=C.getNoBgTrimmedLength();E&&D<I+1&&(D=I+1);let U=0,k="",F=0,Z=0,X=0,$=!1,P=0,ee=!1,q=0;const de=[],ne=B!==-1&&V!==-1;for(let _e=0;_e<D;_e++){C.loadCell(_e,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let je=!1,ce=_e,oe=this._workCell;if(K.length>0&&_e===K[0][0]){je=!0;const Pe=K.shift();oe=new f.JoinedCellData(this._workCell,C.translateToString(!0,Pe[0],Pe[1]),Pe[1]-Pe[0]),ce=Pe[1]-1,pe=oe.getWidth()}const G=this._isCellInSelection(_e,S),W=E&&_e===I,Q=ne&&_e>=B&&_e<=V;let te=!1;this._decorationService.forEachDecorationAtCell(_e,S,void 0,Pe=>{te=!0});let ae=oe.getChars()||i.WHITESPACE_CELL_CHAR;if(ae===" "&&(oe.isUnderline()||oe.isOverline())&&(ae=" "),q=pe*x-M.get(ae,oe.isBold(),oe.isItalic()),L){if(U&&(G&&ee||!G&&!ee&&oe.bg===F)&&(G&&ee&&A.selectionForeground||oe.fg===Z)&&oe.extended.ext===X&&Q===$&&q===P&&!W&&!je&&!te){oe.isInvisible()?k+=i.WHITESPACE_CELL_CHAR:k+=ae,U++;continue}U&&(L.textContent=k),L=this._document.createElement("span"),U=0,k=""}else L=this._document.createElement("span");if(F=oe.bg,Z=oe.fg,X=oe.extended.ext,$=Q,P=q,ee=G,je&&I>=_e&&I<=ce&&(I=_e),!this._coreService.isCursorHidden&&W&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&de.push("xterm-cursor-blink"),de.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(oe.isBold()&&de.push("xterm-bold"),oe.isItalic()&&de.push("xterm-italic"),oe.isDim()&&de.push("xterm-dim"),k=oe.isInvisible()?i.WHITESPACE_CELL_CHAR:oe.getChars()||i.WHITESPACE_CELL_CHAR,oe.isUnderline()&&(de.push(`xterm-underline-${oe.extended.underlineStyle}`),k===" "&&(k=" "),!oe.isUnderlineColorDefault()))if(oe.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(oe.getUnderlineColor()).join(",")})`;else{let Pe=oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&oe.isBold()&&Pe<8&&(Pe+=8),L.style.textDecorationColor=A.ansi[Pe].css}oe.isOverline()&&(de.push("xterm-overline"),k===" "&&(k=" ")),oe.isStrikethrough()&&de.push("xterm-strikethrough"),Q&&(L.style.textDecoration="underline");let he=oe.getFgColor(),Ee=oe.getFgColorMode(),Ie=oe.getBgColor(),xe=oe.getBgColorMode();const Se=!!oe.isInverse();if(Se){const Pe=he;he=Ie,Ie=Pe;const Ye=Ee;Ee=xe,xe=Ye}let le,Ae,De,ke=!1;switch(this._decorationService.forEachDecorationAtCell(_e,S,void 0,Pe=>{Pe.options.layer!=="top"&&ke||(Pe.backgroundColorRGB&&(xe=50331648,Ie=Pe.backgroundColorRGB.rgba>>8&16777215,le=Pe.backgroundColorRGB),Pe.foregroundColorRGB&&(Ee=50331648,he=Pe.foregroundColorRGB.rgba>>8&16777215,Ae=Pe.foregroundColorRGB),ke=Pe.options.layer==="top")}),!ke&&G&&(le=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,Ie=le.rgba>>8&16777215,xe=50331648,ke=!0,A.selectionForeground&&(Ee=50331648,he=A.selectionForeground.rgba>>8&16777215,Ae=A.selectionForeground)),ke&&de.push("xterm-decoration-top"),xe){case 16777216:case 33554432:De=A.ansi[Ie],de.push(`xterm-bg-${Ie}`);break;case 50331648:De=m.channels.toColor(Ie>>16,Ie>>8&255,255&Ie),this._addStyle(L,`background-color:#${y((Ie>>>0).toString(16),"0",6)}`);break;default:Se?(De=A.foreground,de.push(`xterm-bg-${s.INVERTED_DEFAULT_COLOR}`)):De=A.background}switch(le||oe.isDim()&&(le=m.color.multiplyOpacity(De,.5)),Ee){case 16777216:case 33554432:oe.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(L,De,A.ansi[he],oe,le,void 0)||de.push(`xterm-fg-${he}`);break;case 50331648:const Pe=m.channels.toColor(he>>16&255,he>>8&255,255&he);this._applyMinimumContrast(L,De,Pe,oe,le,Ae)||this._addStyle(L,`color:#${y(he.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,De,A.foreground,oe,le,Ae)||Se&&de.push(`xterm-fg-${s.INVERTED_DEFAULT_COLOR}`)}de.length&&(L.className=de.join(" "),de.length=0),W||je||te?L.textContent=k:U++,q!==this.defaultSpacing&&(L.style.letterSpacing=`${q}px`),J.push(L),_e=ce}return L&&U&&(L.textContent=k),J}_applyMinimumContrast(C,S,E,j,O,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const T=this._getContrastCache(j);let x;if(O||I||(x=T.getColor(S.rgba,E.rgba)),x===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);x=m.color.ensureContrastRatio(O||S,I||E,M),T.setColor((O||S).rgba,(I||E).rgba,x??null)}return!!x&&(this._addStyle(C,`color:${x.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,S){C.setAttribute("style",`${C.getAttribute("style")||""}${S};`)}_isCellInSelection(C,S){const E=this._selectionStart,j=this._selectionEnd;return!(!E||!j)&&(this._columnSelectMode?E[0]<=j[0]?C>=E[0]&&S>=E[1]&&C<j[0]&&S<=j[1]:C<E[0]&&S>=E[1]&&C>=j[0]&&S<=j[1]:S>E[1]&&S<j[1]||E[1]===j[1]&&S===E[1]&&C>=E[0]&&C<j[0]||E[1]<j[1]&&S===j[1]&&C<j[0]||E[1]<j[1]&&S===E[1]&&C>=E[0])}};function y(C,S,E){for(;C.length<E;)C=S+C;return C}o.DomRendererRowFactory=b=a([n(1,c.ICharacterJoinerService),n(2,p.IOptionsService),n(3,c.ICoreBrowserService),n(4,p.ICoreService),n(5,p.IDecorationService),n(6,c.IThemeService)],b)},2550:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(r,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=r.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 n=r.createElement("span");n.classList.add("xterm-char-measure-element");const s=r.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";const i=r.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";const d=r.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[n,s,i,d],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(i),this._container.appendChild(d),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(r,a,n,s){r===this._font&&a===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=r,this._fontSize=a,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(r,a,n){let s=0;if(!a&&!n&&r.length===1&&(s=r.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];const p=this._measure(r,0);return p>0&&(this._flat[s]=p),p}let i=r;a&&(i+="B"),n&&(i+="I");let d=this._holey.get(i);if(d===void 0){let p=0;a&&(p|=1),n&&(p|=2),d=this._measure(r,p),d>0&&this._holey.set(i,d)}return d}_measure(r,a){const n=this._measureElements[a];return n.textContent=r.repeat(32),n.offsetWidth/32}}},2223:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const a=r(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(v,o)=>{function r(n){return 57508<=n&&n<=57558}function a(n){return n>=128512&&n<=128591||n>=127744&&n<=128511||n>=128640&&n<=128767||n>=9728&&n<=9983||n>=9984&&n<=10175||n>=65024&&n<=65039||n>=129280&&n<=129535||n>=127462&&n<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(n){if(!n)throw new Error("value must not be falsy");return n},o.isPowerlineGlyph=r,o.isRestrictedPowerlineGlyph=function(n){return 57520<=n&&n<=57527},o.isEmoji=a,o.allowRescaling=function(n,s,i,d){return s===1&&i>Math.ceil(1.5*d)&&n!==void 0&&n>255&&!a(n)&&!r(n)&&!function(p){return 57344<=p&&p<=63743}(n)},o.treatGlyphAsBackgroundColor=function(n){return r(n)||function(s){return 9472<=s&&s<=9631}(n)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(n,s,i=0){return(n-(2*Math.round(s)-i))%(2*Math.round(s))}},6052:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class r{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(n,s,i,d=!1){if(this.selectionStart=s,this.selectionEnd=i,!s||!i||s[0]===i[0]&&s[1]===i[1])return void this.clear();const p=n.buffers.active.ydisp,m=s[1]-p,c=i[1]-p,f=Math.max(m,0),g=Math.min(c,n.rows-1);f>=n.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=d,this.viewportStartRow=m,this.viewportEndRow=c,this.viewportCappedStartRow=f,this.viewportCappedEndRow=g,this.startCol=s[0],this.endCol=i[0])}isCellSelected(n,s,i){return!!this.hasSelection&&(i-=n.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?s>=this.startCol&&i>=this.viewportCappedStartRow&&s<this.endCol&&i<=this.viewportCappedEndRow:s<this.startCol&&i>=this.viewportCappedStartRow&&s>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&s<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&s>=this.startCol)}}o.createSelectionRenderModel=function(){return new r}},456:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(r){this._bufferService=r,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 r=this.selectionStart[0]+this.selectionStartLength;return r>this._bufferService.cols?r%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)-1]:[r%this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)]:[r,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const r=this.selectionStart[0]+this.selectionStartLength;return r>this._bufferService.cols?[r%this._bufferService.cols,this.selectionStart[1]+Math.floor(r/this._bufferService.cols)]:[Math.max(r,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const r=this.selectionStart,a=this.selectionEnd;return!(!r||!a)&&(r[1]>a[1]||r[1]===a[1]&&r[0]>a[0])}handleTrim(r){return this.selectionStart&&(this.selectionStart[1]-=r),this.selectionEnd&&(this.selectionEnd[1]-=r),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,o,r){var a=this&&this.__decorate||function(g,_,b,y){var C,S=arguments.length,E=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,b,y);else for(var j=g.length-1;j>=0;j--)(C=g[j])&&(E=(S<3?C(E):S>3?C(_,b,E):C(_,b))||E);return S>3&&E&&Object.defineProperty(_,b,E),E},n=this&&this.__param||function(g,_){return function(b,y){_(b,y,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const s=r(2585),i=r(8460),d=r(844);let p=o.CharSizeService=class extends d.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,_,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new i.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new c(g,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};o.CharSizeService=p=a([n(2,s.IOptionsService)],p);class m extends d.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,b){_!==void 0&&_>0&&b!==void 0&&b>0&&(this._result.width=_,this._result.height=b)}}class c extends m{constructor(_,b,y){super(),this._document=_,this._parentElement=b,this._optionsService=y,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class f extends m{constructor(_){super(),this._optionsService=_,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 _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(v,o,r){var a=this&&this.__decorate||function(f,g,_,b){var y,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,_,b);else for(var E=f.length-1;E>=0;E--)(y=f[E])&&(S=(C<3?y(S):C>3?y(g,_,S):y(g,_))||S);return C>3&&S&&Object.defineProperty(g,_,S),S},n=this&&this.__param||function(f,g){return function(_,b){g(_,b,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const s=r(3734),i=r(643),d=r(511),p=r(2585);class m extends s.AttributeData{constructor(g,_,b){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=_,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=m;let c=o.CharacterJoinerService=class Ji{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}register(g){const _={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(_),_.id}deregister(g){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===g)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(g);if(!_||_.length===0)return[];const b=[],y=_.translateToString(!0);let C=0,S=0,E=0,j=_.getFg(0),O=_.getBg(0);for(let I=0;I<_.getTrimmedLength();I++)if(_.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==O){if(I-C>1){const T=this._getJoinedRanges(y,E,S,_,C);for(let x=0;x<T.length;x++)b.push(T[x])}C=I,E=S,j=this._workCell.fg,O=this._workCell.bg}S+=this._workCell.getChars().length||i.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const I=this._getJoinedRanges(y,E,S,_,C);for(let T=0;T<I.length;T++)b.push(I[T])}return b}_getJoinedRanges(g,_,b,y,C){const S=g.substring(_,b);let E=[];try{E=this._characterJoiners[0].handler(S)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const O=this._characterJoiners[j].handler(S);for(let I=0;I<O.length;I++)Ji._mergeRanges(E,O[I])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,y,C),E}_stringRangesToCellRanges(g,_,b){let y=0,C=!1,S=0,E=g[y];if(E){for(let j=b;j<this._bufferService.cols;j++){const O=_.getWidth(j),I=_.getString(j).length||i.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!C&&E[0]<=S&&(E[0]=j,C=!0),E[1]<=S){if(E[1]=j,E=g[++y],!E)break;E[0]<=S?(E[0]=j,C=!0):C=!1}S+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(g,_){let b=!1;for(let y=0;y<g.length;y++){const C=g[y];if(b){if(_[1]<=C[0])return g[y-1][1]=_[1],g;if(_[1]<=C[1])return g[y-1][1]=Math.max(_[1],C[1]),g.splice(y,1),g;g.splice(y,1),y--}else{if(_[1]<=C[0])return g.splice(y,0,_),g;if(_[1]<=C[1])return C[0]=Math.min(_[0],C[0]),g;_[0]<C[1]&&(C[0]=Math.min(_[0],C[0]),b=!0)}}return b?g[g.length-1][1]=_[1]:g.push(_),g}};o.CharacterJoinerService=c=a([n(0,p.IBufferService)],c)},5114:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const a=r(844),n=r(8460),s=r(3656);class i extends a.Disposable{constructor(m,c,f){super(),this._textarea=m,this._window=c,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new d(this._window),this._onDprChange=this.register(new n.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new n.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(g=>this._screenDprMonitor.setWindow(g))),this.register((0,n.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}}o.CoreBrowserService=i;class d extends a.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new n.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,s.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:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const a=r(844);class n extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(i){return this.linkProviders.push(i),{dispose:()=>{const d=this.linkProviders.indexOf(i);d!==-1&&this.linkProviders.splice(d,1)}}}}o.LinkProviderService=n},8934:function(v,o,r){var a=this&&this.__decorate||function(p,m,c,f){var g,_=arguments.length,b=_<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,m,c,f);else for(var y=p.length-1;y>=0;y--)(g=p[y])&&(b=(_<3?g(b):_>3?g(m,c,b):g(m,c))||b);return _>3&&b&&Object.defineProperty(m,c,b),b},n=this&&this.__param||function(p,m){return function(c,f){m(c,f,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const s=r(4725),i=r(9806);let d=o.MouseService=class{constructor(p,m){this._renderService=p,this._charSizeService=m}getCoords(p,m,c,f,g){return(0,i.getCoords)(window,p,m,c,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(p,m){const c=(0,i.getCoordsRelativeToElement)(window,p,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])}}};o.MouseService=d=a([n(0,s.IRenderService),n(1,s.ICharSizeService)],d)},3230:function(v,o,r){var a=this&&this.__decorate||function(g,_,b,y){var C,S=arguments.length,E=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,b,y);else for(var j=g.length-1;j>=0;j--)(C=g[j])&&(E=(S<3?C(E):S>3?C(_,b,E):C(_,b))||E);return S>3&&E&&Object.defineProperty(_,b,E),E},n=this&&this.__param||function(g,_){return function(b,y){_(b,y,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const s=r(6193),i=r(4725),d=r(8460),p=r(844),m=r(7226),c=r(2585);let f=o.RenderService=class extends p.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,_,b,y,C,S,E,j){super(),this._rowCount=g,this._charSizeService=y,this._renderer=this.register(new p.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new p.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new d.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new d.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new d.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new d.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new s.RenderDebouncer((O,I)=>this._renderRows(O,I),E),this.register(this._renderDebouncer),this.register(E.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(S.onResize(()=>this._fullRefresh())),this.register(S.buffers.onBufferActivate(()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(S.cols,S.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(S.buffer.y,S.buffer.y,!0))),this.register(j.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(E.window,_),this.register(E.onWindowChange(O=>this._registerIntersectionObserver(O,_)))}_registerIntersectionObserver(g,_){if("IntersectionObserver"in g){const b=new g.IntersectionObserver(y=>this._handleIntersectionChange(y[y.length-1]),{threshold:0});b.observe(_),this._observerDisposable.value=(0,p.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,_,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,_,this._rowCount))}_renderRows(g,_){this._renderer.value&&(g=Math.min(g,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(g,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:_}),this._onRender.fire({start:g,end:_}),this._isNextRenderRedrawOnly=!0)}resize(g,_){this._rowCount=_,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw(_=>this.refreshRows(_.start,_.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,_;this._renderer.value&&((_=(g=this._renderer.value).clearTextureAtlas)==null||_.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(g,_)}):this._renderer.value.handleResize(g,_),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,_,b){var y;this._selectionState.start=g,this._selectionState.end=_,this._selectionState.columnSelectMode=b,(y=this._renderer.value)==null||y.handleSelectionChanged(g,_,b)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};o.RenderService=f=a([n(2,c.IOptionsService),n(3,i.ICharSizeService),n(4,c.IDecorationService),n(5,c.IBufferService),n(6,i.ICoreBrowserService),n(7,i.IThemeService)],f)},9312:function(v,o,r){var a=this&&this.__decorate||function(E,j,O,I){var T,x=arguments.length,M=x<3?j:I===null?I=Object.getOwnPropertyDescriptor(j,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,j,O,I);else for(var B=E.length-1;B>=0;B--)(T=E[B])&&(M=(x<3?T(M):x>3?T(j,O,M):T(j,O))||M);return x>3&&M&&Object.defineProperty(j,O,M),M},n=this&&this.__param||function(E,j){return function(O,I){j(O,I,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const s=r(9806),i=r(9504),d=r(456),p=r(4725),m=r(8460),c=r(844),f=r(6114),g=r(4841),_=r(511),b=r(2585),y=" ",C=new RegExp(y,"g");let S=o.SelectionService=class extends c.Disposable{constructor(E,j,O,I,T,x,M,B,V){super(),this._element=E,this._screenElement=j,this._linkifier=O,this._bufferService=I,this._coreService=T,this._mouseService=x,this._optionsService=M,this._renderService=B,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.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 d.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 E=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!E||!j||E[0]===j[0]&&E[1]===j[1])}get selectionText(){const E=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!E||!j)return"";const O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===j[0])return"";const T=E[0]<j[0]?E[0]:j[0],x=E[0]<j[0]?j[0]:E[0];for(let M=E[1];M<=j[1];M++){const B=O.translateBufferLineToString(M,!0,T,x);I.push(B)}}else{const T=E[1]===j[1]?j[0]:void 0;I.push(O.translateBufferLineToString(E[1],!0,E[0],T));for(let x=E[1]+1;x<=j[1]-1;x++){const M=O.lines.get(x),B=O.translateBufferLineToString(x,!0);M!=null&&M.isWrapped?I[I.length-1]+=B:I.push(B)}if(E[1]!==j[1]){const x=O.lines.get(j[1]),M=O.translateBufferLineToString(j[1],!0,0,j[0]);x&&x.isWrapped?I[I.length-1]+=M:I.push(M)}}return I.map(T=>T.replace(C," ")).join(f.isWindows?`\r
|
|
1593
1591
|
`:`
|
|
1594
1592
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.isLinux&&E&&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(E){const j=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(O&&I&&j)&&this._areCoordsInSelection(j,O,I)}isCellInSelection(E,j){const O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!O||!I)&&this._areCoordsInSelection([E,j],O,I)}_areCoordsInSelection(E,j,O){return E[1]>j[1]&&E[1]<O[1]||j[1]===O[1]&&E[1]===j[1]&&E[0]>=j[0]&&E[0]<O[0]||j[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||j[1]<O[1]&&E[1]===j[1]&&E[0]>=j[0]}_selectWordAtCursor(E,j){var T,x;const O=(x=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:x.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,j){this._model.clearSelection(),E=Math.max(E,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const j=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(E){let j=(0,s.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=O?0:(j>O&&(j-=O),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(E){return f.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const j=this._getMouseBufferCoords(E);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(E){return E.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const I=O.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const j=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const I=(0,i.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,O=!(!E||!j||E[0]===j[0]&&E[1]===j[1]);O?E&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,j,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,j,O)}_fireOnSelectionChange(E,j,O){this._oldSelectionStart=E,this._oldSelectionEnd=j,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim(j=>this._handleTrim(j))}_convertViewportColToCharacterIndex(E,j){let O=j;for(let I=0;j>=I;I++){const T=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:T>1&&j!==I&&(O+=T-1)}return O}setSelection(E,j,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,j],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,j,O=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,x=T.lines.get(E[1]);if(!x)return;const M=T.translateBufferLineToString(E[1],!1);let B=this._convertViewportColToCharacterIndex(x,E[0]),V=B;const J=E[0]-B;let K=0,A=0,L=0,D=0;if(M.charAt(B)===" "){for(;B>0&&M.charAt(B-1)===" ";)B--;for(;V<M.length&&M.charAt(V+1)===" ";)V++}else{let F=E[0],Z=E[0];x.getWidth(F)===0&&(K++,F--),x.getWidth(Z)===2&&(A++,Z++);const X=x.getString(Z).length;for(X>1&&(D+=X-1,V+=X-1);F>0&&B>0&&!this._isCharWordSeparator(x.loadCell(F-1,this._workCell));){x.loadCell(F-1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,F--):$>1&&(L+=$-1,B-=$-1),B--,F--}for(;Z<x.length&&V+1<M.length&&!this._isCharWordSeparator(x.loadCell(Z+1,this._workCell));){x.loadCell(Z+1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,Z++):$>1&&(D+=$-1,V+=$-1),V++,Z++}}V++;let U=B+J-K+L,k=Math.min(this._bufferService.cols,V-B+K+A-L-D);if(j||M.slice(B,V).trim()!==""){if(O&&U===0&&x.getCodePoint(0)!==32){const F=T.lines.get(E[1]-1);if(F&&x.isWrapped&&F.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(Z){const X=this._bufferService.cols-Z.start;U-=X,k+=X}}}if(I&&U+k===this._bufferService.cols&&x.getCodePoint(this._bufferService.cols-1)!==32){const F=T.lines.get(E[1]+1);if(F!=null&&F.isWrapped&&F.getCodePoint(0)!==32){const Z=this._getWordAt([0,E[1]+1],!1,!1,!0);Z&&(k+=Z.length)}}return{start:U,length:k}}}_selectWordAt(E,j){const O=this._getWordAt(E,j);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[O.start,E[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(E){const j=this._getWordAt(E,!0);if(j){let O=E[1];for(;j.start<0;)j.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const j=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=S=a([n(3,b.IBufferService),n(4,b.ICoreService),n(5,p.IMouseService),n(6,b.IOptionsService),n(7,p.IRenderService),n(8,p.ICoreBrowserService)],S)},4725:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const a=r(8343);o.ICharSizeService=(0,a.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),o.IMouseService=(0,a.createDecorator)("MouseService"),o.IRenderService=(0,a.createDecorator)("RenderService"),o.ISelectionService=(0,a.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,a.createDecorator)("ThemeService"),o.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(v,o,r){var a=this&&this.__decorate||function(S,E,j,O){var I,T=arguments.length,x=T<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,j):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,E,j,O);else for(var M=S.length-1;M>=0;M--)(I=S[M])&&(x=(T<3?I(x):T>3?I(E,j,x):I(E,j))||x);return T>3&&x&&Object.defineProperty(E,j,x),x},n=this&&this.__param||function(S,E){return function(j,O){E(j,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const s=r(7239),i=r(8055),d=r(8460),p=r(844),m=r(2585),c=i.css.toColor("#ffffff"),f=i.css.toColor("#000000"),g=i.css.toColor("#ffffff"),_=i.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const S=[i.css.toColor("#2e3436"),i.css.toColor("#cc0000"),i.css.toColor("#4e9a06"),i.css.toColor("#c4a000"),i.css.toColor("#3465a4"),i.css.toColor("#75507b"),i.css.toColor("#06989a"),i.css.toColor("#d3d7cf"),i.css.toColor("#555753"),i.css.toColor("#ef2929"),i.css.toColor("#8ae234"),i.css.toColor("#fce94f"),i.css.toColor("#729fcf"),i.css.toColor("#ad7fa8"),i.css.toColor("#34e2e2"),i.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let j=0;j<216;j++){const O=E[j/36%6|0],I=E[j/6%6|0],T=E[j%6];S.push({css:i.channels.toCss(O,I,T),rgba:i.channels.toRgba(O,I,T)})}for(let j=0;j<24;j++){const O=8+10*j;S.push({css:i.channels.toCss(O,O,O),rgba:i.channels.toRgba(O,O,O)})}return S})());let y=o.ThemeService=class extends p.Disposable{get colors(){return this._colors}constructor(S){super(),this._optionsService=S,this._contrastCache=new s.ColorContrastCache,this._halfContrastCache=new s.ColorContrastCache,this._onChangeColors=this.register(new d.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:f,cursor:g,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:i.color.blend(f,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:i.color.blend(f,b),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(S={}){const E=this._colors;if(E.foreground=C(S.foreground,c),E.background=C(S.background,f),E.cursor=C(S.cursor,g),E.cursorAccent=C(S.cursorAccent,_),E.selectionBackgroundTransparent=C(S.selectionBackground,b),E.selectionBackgroundOpaque=i.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=C(S.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=i.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=S.selectionForeground?C(S.selectionForeground,i.NULL_COLOR):void 0,E.selectionForeground===i.NULL_COLOR&&(E.selectionForeground=void 0),i.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=i.color.opacity(E.selectionBackgroundTransparent,.3)),i.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=i.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=o.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=C(S.black,o.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=C(S.red,o.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=C(S.green,o.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=C(S.yellow,o.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=C(S.blue,o.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=C(S.magenta,o.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=C(S.cyan,o.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=C(S.white,o.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=C(S.brightBlack,o.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=C(S.brightRed,o.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=C(S.brightGreen,o.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=C(S.brightYellow,o.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=C(S.brightBlue,o.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=C(S.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=C(S.brightCyan,o.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=C(S.brightWhite,o.DEFAULT_ANSI_COLORS[15]),S.extendedAnsi){const j=Math.min(E.ansi.length-16,S.extendedAnsi.length);for(let O=0;O<j;O++)E.ansi[O+16]=C(S.extendedAnsi[O],o.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(S){this._restoreColor(S),this._onChangeColors.fire(this.colors)}_restoreColor(S){if(S!==void 0)switch(S){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[S]=this._restoreColors.ansi[S]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(S){S(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 C(S,E){if(S!==void 0)try{return i.css.toColor(S)}catch{}return E}o.ThemeService=y=a([n(0,m.IOptionsService)],y)},6349:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const a=r(8460),n=r(844);class s extends n.Disposable{constructor(d){super(),this._maxLength=d,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(d){if(this._maxLength===d)return;const p=new Array(d);for(let m=0;m<Math.min(d,this.length);m++)p[m]=this._array[this._getCyclicIndex(m)];this._array=p,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let p=this._length;p<d;p++)this._array[p]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,p){this._array[this._getCyclicIndex(d)]=p}push(d){this._array[this._getCyclicIndex(this._length)]=d,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(d,p,...m){if(p){for(let c=d;c<this._length-p;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+p)];this._length-=p,this.onDeleteEmitter.fire({index:d,amount:p})}for(let c=this._length-1;c>=d;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(d+c)]=m[c];if(m.length&&this.onInsertEmitter.fire({index:d,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(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,p,m){if(!(p<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let f=p-1;f>=0;f--)this.set(d+f+m,this.get(d+f));const c=d+p+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<p;c++)this.set(d+c+m,this.get(d+c))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}o.CircularList=s},1439:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function r(a,n=5){if(typeof a!="object")return a;const s=Array.isArray(a)?[]:{};for(const i in a)s[i]=n<=1?a[i]:a[i]&&r(a[i],n-1);return s}},8055:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let r=0,a=0,n=0,s=0;var i,d,p,m,c;function f(_){const b=_.toString(16);return b.length<2?"0"+b:b}function g(_,b){return _<b?(b+.05)/(_+.05):(_+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(_){_.toCss=function(b,y,C,S){return S!==void 0?`#${f(b)}${f(y)}${f(C)}${f(S)}`:`#${f(b)}${f(y)}${f(C)}`},_.toRgba=function(b,y,C,S=255){return(b<<24|y<<16|C<<8|S)>>>0},_.toColor=function(b,y,C,S){return{css:_.toCss(b,y,C,S),rgba:_.toRgba(b,y,C,S)}}}(i||(o.channels=i={})),function(_){function b(y,C){return s=Math.round(255*C),[r,a,n]=c.toChannels(y.rgba),{css:i.toCss(r,a,n,s),rgba:i.toRgba(r,a,n,s)}}_.blend=function(y,C){if(s=(255&C.rgba)/255,s===1)return{css:C.css,rgba:C.rgba};const S=C.rgba>>24&255,E=C.rgba>>16&255,j=C.rgba>>8&255,O=y.rgba>>24&255,I=y.rgba>>16&255,T=y.rgba>>8&255;return r=O+Math.round((S-O)*s),a=I+Math.round((E-I)*s),n=T+Math.round((j-T)*s),{css:i.toCss(r,a,n),rgba:i.toRgba(r,a,n)}},_.isOpaque=function(y){return(255&y.rgba)==255},_.ensureContrastRatio=function(y,C,S){const E=c.ensureContrastRatio(y.rgba,C.rgba,S);if(E)return i.toColor(E>>24&255,E>>16&255,E>>8&255)},_.opaque=function(y){const C=(255|y.rgba)>>>0;return[r,a,n]=c.toChannels(C),{css:i.toCss(r,a,n),rgba:C}},_.opacity=b,_.multiplyOpacity=function(y,C){return s=255&y.rgba,b(y,s*C/255)},_.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}}(d||(o.color=d={})),function(_){let b,y;try{const C=document.createElement("canvas");C.width=1,C.height=1;const S=C.getContext("2d",{willReadFrequently:!0});S&&(b=S,b.globalCompositeOperation="copy",y=b.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return r=parseInt(C.slice(1,2).repeat(2),16),a=parseInt(C.slice(2,3).repeat(2),16),n=parseInt(C.slice(3,4).repeat(2),16),i.toColor(r,a,n);case 5:return r=parseInt(C.slice(1,2).repeat(2),16),a=parseInt(C.slice(2,3).repeat(2),16),n=parseInt(C.slice(3,4).repeat(2),16),s=parseInt(C.slice(4,5).repeat(2),16),i.toColor(r,a,n,s);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const S=C.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(S)return r=parseInt(S[1]),a=parseInt(S[2]),n=parseInt(S[3]),s=Math.round(255*(S[5]===void 0?1:parseFloat(S[5]))),i.toColor(r,a,n,s);if(!b||!y)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=y,b.fillStyle=C,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[r,a,n,s]=b.getImageData(0,0,1,1).data,s!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:i.toRgba(r,a,n,s),css:C}}}(p||(o.css=p={})),function(_){function b(y,C,S){const E=y/255,j=C/255,O=S/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}_.relativeLuminance=function(y){return b(y>>16&255,y>>8&255,255&y)},_.relativeLuminance2=b}(m||(o.rgb=m={})),function(_){function b(C,S,E){const j=C>>24&255,O=C>>16&255,I=C>>8&255;let T=S>>24&255,x=S>>16&255,M=S>>8&255,B=g(m.relativeLuminance2(T,x,M),m.relativeLuminance2(j,O,I));for(;B<E&&(T>0||x>0||M>0);)T-=Math.max(0,Math.ceil(.1*T)),x-=Math.max(0,Math.ceil(.1*x)),M-=Math.max(0,Math.ceil(.1*M)),B=g(m.relativeLuminance2(T,x,M),m.relativeLuminance2(j,O,I));return(T<<24|x<<16|M<<8|255)>>>0}function y(C,S,E){const j=C>>24&255,O=C>>16&255,I=C>>8&255;let T=S>>24&255,x=S>>16&255,M=S>>8&255,B=g(m.relativeLuminance2(T,x,M),m.relativeLuminance2(j,O,I));for(;B<E&&(T<255||x<255||M<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),x=Math.min(255,x+Math.ceil(.1*(255-x))),M=Math.min(255,M+Math.ceil(.1*(255-M))),B=g(m.relativeLuminance2(T,x,M),m.relativeLuminance2(j,O,I));return(T<<24|x<<16|M<<8|255)>>>0}_.blend=function(C,S){if(s=(255&S)/255,s===1)return S;const E=S>>24&255,j=S>>16&255,O=S>>8&255,I=C>>24&255,T=C>>16&255,x=C>>8&255;return r=I+Math.round((E-I)*s),a=T+Math.round((j-T)*s),n=x+Math.round((O-x)*s),i.toRgba(r,a,n)},_.ensureContrastRatio=function(C,S,E){const j=m.relativeLuminance(C>>8),O=m.relativeLuminance(S>>8);if(g(j,O)<E){if(O<j){const x=b(C,S,E),M=g(j,m.relativeLuminance(x>>8));if(M<E){const B=y(C,S,E);return M>g(j,m.relativeLuminance(B>>8))?x:B}return x}const I=y(C,S,E),T=g(j,m.relativeLuminance(I>>8));if(T<E){const x=b(C,S,E);return T>g(j,m.relativeLuminance(x>>8))?I:x}return I}},_.reduceLuminance=b,_.increaseLuminance=y,_.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(c||(o.rgba=c={})),o.toPaddedHex=f,o.contrastRatio=g},8969:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const a=r(844),n=r(2585),s=r(4348),i=r(7866),d=r(744),p=r(7302),m=r(6975),c=r(8460),f=r(1753),g=r(1480),_=r(7994),b=r(9282),y=r(5435),C=r(5981),S=r(2660);let E=!1;class j extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event(I=>{var T;(T=this._onScrollApi)==null||T.fire(I.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(I){for(const T in I)this.optionsService.options[T]=I[T]}constructor(I){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 s.InstantiationService,this.optionsService=this.register(new p.OptionsService(I)),this._instantiationService.setService(n.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(d.BufferService)),this._instantiationService.setService(n.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(i.LogService)),this._instantiationService.setService(n.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(n.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(n.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(n.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(n.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(n.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,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(T=>{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(T=>{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 C.WriteBuffer((T,x)=>this._inputHandler.parse(T,x))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,T){this._writeBuffer.write(I,T)}writeSync(I,T){this._logService.logLevel<=n.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,T)}input(I,T=!0){this.coreService.triggerDataEvent(I,T)}resize(I,T){isNaN(I)||isNaN(T)||(I=Math.max(I,d.MINIMUM_COLS),T=Math.max(T,d.MINIMUM_ROWS),this._bufferService.resize(I,T))}scroll(I,T=!1){this._bufferService.scroll(I,T)}scrollLines(I,T,x){this._bufferService.scrollLines(I,T,x)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const T=I-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(I,T){return this._inputHandler.registerEscHandler(I,T)}registerDcsHandler(I,T){return this._inputHandler.registerDcsHandler(I,T)}registerCsiHandler(I,T){return this._inputHandler.registerCsiHandler(I,T)}registerOscHandler(I,T){return this._inputHandler.registerOscHandler(I,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?I=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)(()=>{for(const T of I)T.dispose()})}}}o.CoreTerminal=j},8460:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=r=>(this._listeners.push(r),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===r)return void this._listeners.splice(a,1)}}})),this._event}fire(r,a){const n=[];for(let s=0;s<this._listeners.length;s++)n.push(this._listeners[s]);for(let s=0;s<n.length;s++)n[s].call(void 0,r,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(r,a){return r(n=>a.fire(n))},o.runAndSubscribe=function(r,a){return a(void 0),r(n=>a(n))}},5435:function(v,o,r){var a=this&&this.__decorate||function(K,A,L,D){var U,k=arguments.length,F=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(K,A,L,D);else for(var Z=K.length-1;Z>=0;Z--)(U=K[Z])&&(F=(k<3?U(F):k>3?U(A,L,F):U(A,L))||F);return k>3&&F&&Object.defineProperty(A,L,F),F},n=this&&this.__param||function(K,A){return function(L,D){A(L,D,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const s=r(2584),i=r(7116),d=r(2015),p=r(844),m=r(482),c=r(8437),f=r(8460),g=r(643),_=r(511),b=r(3734),y=r(2585),C=r(1480),S=r(6242),E=r(6351),j=r(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function T(K,A){if(K>24)return A.setWinLines||!1;switch(K){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var x;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(x||(o.WindowsOptionsReportType=x={}));let M=0;class B extends p.Disposable{getAttrData(){return this._curAttrData}constructor(A,L,D,U,k,F,Z,X,$=new d.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=L,this._coreService=D,this._logService=U,this._optionsService=k,this._oscLinkService=F,this._coreMouseService=Z,this._unicodeService=X,this._parser=$,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new _.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 f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(P=>this._activeBuffer=P.activeBuffer)),this._parser.setCsiHandlerFallback((P,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ee.toArray()})}),this._parser.setEscHandlerFallback(P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})}),this._parser.setExecuteHandlerFallback(P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})}),this._parser.setOscHandlerFallback((P,ee,q)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ee,data:q})}),this._parser.setDcsHandlerFallback((P,ee,q)=>{ee==="HOOK"&&(q=q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ee,payload:q})}),this._parser.setPrintHandler((P,ee,q)=>this.print(P,ee,q)),this._parser.registerCsiHandler({final:"@"},P=>this.insertChars(P)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},P=>this.scrollLeft(P)),this._parser.registerCsiHandler({final:"A"},P=>this.cursorUp(P)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},P=>this.scrollRight(P)),this._parser.registerCsiHandler({final:"B"},P=>this.cursorDown(P)),this._parser.registerCsiHandler({final:"C"},P=>this.cursorForward(P)),this._parser.registerCsiHandler({final:"D"},P=>this.cursorBackward(P)),this._parser.registerCsiHandler({final:"E"},P=>this.cursorNextLine(P)),this._parser.registerCsiHandler({final:"F"},P=>this.cursorPrecedingLine(P)),this._parser.registerCsiHandler({final:"G"},P=>this.cursorCharAbsolute(P)),this._parser.registerCsiHandler({final:"H"},P=>this.cursorPosition(P)),this._parser.registerCsiHandler({final:"I"},P=>this.cursorForwardTab(P)),this._parser.registerCsiHandler({final:"J"},P=>this.eraseInDisplay(P,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},P=>this.eraseInDisplay(P,!0)),this._parser.registerCsiHandler({final:"K"},P=>this.eraseInLine(P,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},P=>this.eraseInLine(P,!0)),this._parser.registerCsiHandler({final:"L"},P=>this.insertLines(P)),this._parser.registerCsiHandler({final:"M"},P=>this.deleteLines(P)),this._parser.registerCsiHandler({final:"P"},P=>this.deleteChars(P)),this._parser.registerCsiHandler({final:"S"},P=>this.scrollUp(P)),this._parser.registerCsiHandler({final:"T"},P=>this.scrollDown(P)),this._parser.registerCsiHandler({final:"X"},P=>this.eraseChars(P)),this._parser.registerCsiHandler({final:"Z"},P=>this.cursorBackwardTab(P)),this._parser.registerCsiHandler({final:"`"},P=>this.charPosAbsolute(P)),this._parser.registerCsiHandler({final:"a"},P=>this.hPositionRelative(P)),this._parser.registerCsiHandler({final:"b"},P=>this.repeatPrecedingCharacter(P)),this._parser.registerCsiHandler({final:"c"},P=>this.sendDeviceAttributesPrimary(P)),this._parser.registerCsiHandler({prefix:">",final:"c"},P=>this.sendDeviceAttributesSecondary(P)),this._parser.registerCsiHandler({final:"d"},P=>this.linePosAbsolute(P)),this._parser.registerCsiHandler({final:"e"},P=>this.vPositionRelative(P)),this._parser.registerCsiHandler({final:"f"},P=>this.hVPosition(P)),this._parser.registerCsiHandler({final:"g"},P=>this.tabClear(P)),this._parser.registerCsiHandler({final:"h"},P=>this.setMode(P)),this._parser.registerCsiHandler({prefix:"?",final:"h"},P=>this.setModePrivate(P)),this._parser.registerCsiHandler({final:"l"},P=>this.resetMode(P)),this._parser.registerCsiHandler({prefix:"?",final:"l"},P=>this.resetModePrivate(P)),this._parser.registerCsiHandler({final:"m"},P=>this.charAttributes(P)),this._parser.registerCsiHandler({final:"n"},P=>this.deviceStatus(P)),this._parser.registerCsiHandler({prefix:"?",final:"n"},P=>this.deviceStatusPrivate(P)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},P=>this.softReset(P)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},P=>this.setCursorStyle(P)),this._parser.registerCsiHandler({final:"r"},P=>this.setScrollRegion(P)),this._parser.registerCsiHandler({final:"s"},P=>this.saveCursor(P)),this._parser.registerCsiHandler({final:"t"},P=>this.windowOptions(P)),this._parser.registerCsiHandler({final:"u"},P=>this.restoreCursor(P)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},P=>this.insertColumns(P)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},P=>this.deleteColumns(P)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},P=>this.selectProtected(P)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},P=>this.requestMode(P,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},P=>this.requestMode(P,!1)),this._parser.setExecuteHandler(s.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(s.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(s.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(s.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(s.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(s.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(s.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(s.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(s.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(s.C1.IND,()=>this.index()),this._parser.setExecuteHandler(s.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(s.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new S.OscHandler(P=>(this.setTitle(P),this.setIconName(P),!0))),this._parser.registerOscHandler(1,new S.OscHandler(P=>this.setIconName(P))),this._parser.registerOscHandler(2,new S.OscHandler(P=>this.setTitle(P))),this._parser.registerOscHandler(4,new S.OscHandler(P=>this.setOrReportIndexedColor(P))),this._parser.registerOscHandler(8,new S.OscHandler(P=>this.setHyperlink(P))),this._parser.registerOscHandler(10,new S.OscHandler(P=>this.setOrReportFgColor(P))),this._parser.registerOscHandler(11,new S.OscHandler(P=>this.setOrReportBgColor(P))),this._parser.registerOscHandler(12,new S.OscHandler(P=>this.setOrReportCursorColor(P))),this._parser.registerOscHandler(104,new S.OscHandler(P=>this.restoreIndexedColor(P))),this._parser.registerOscHandler(110,new S.OscHandler(P=>this.restoreFgColor(P))),this._parser.registerOscHandler(111,new S.OscHandler(P=>this.restoreBgColor(P))),this._parser.registerOscHandler(112,new S.OscHandler(P=>this.restoreCursorColor(P))),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 P in i.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},()=>this.selectCharset("("+P)),this._parser.registerEscHandler({intermediates:")",final:P},()=>this.selectCharset(")"+P)),this._parser.registerEscHandler({intermediates:"*",final:P},()=>this.selectCharset("*"+P)),this._parser.registerEscHandler({intermediates:"+",final:P},()=>this.selectCharset("+"+P)),this._parser.registerEscHandler({intermediates:"-",final:P},()=>this.selectCharset("-"+P)),this._parser.registerEscHandler({intermediates:".",final:P},()=>this.selectCharset("."+P)),this._parser.registerEscHandler({intermediates:"/",final:P},()=>this.selectCharset("/"+P));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(P=>(this._logService.error("Parsing error: ",P),P)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((P,ee)=>this.requestStatusString(P,ee)))}_preserveStack(A,L,D,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=D,this._parseStack.position=U}_logSlowResolvingAsync(A){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([A,new Promise((L,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,L){let D,U=this._activeBuffer.x,k=this._activeBuffer.y,F=0;const Z=this._parseStack.paused;if(Z){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(D),D;U=this._parseStack.cursorStartX,k=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>I&&(F=this._parseStack.position+I)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,P=>String.fromCharCode(P)).join("")}"`),typeof A=="string"?A.split("").map(P=>P.charCodeAt(0)):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(A.length,I))),Z||this._dirtyRowTracker.clearRange(),A.length>I)for(let P=F;P<A.length;P+=I){const ee=P+I<A.length?P+I:A.length,q=typeof A=="string"?this._stringDecoder.decode(A.substring(P,ee),this._parseBuffer):this._utf8Decoder.decode(A.subarray(P,ee),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,q))return this._preserveStack(U,k,q,P),this._logSlowResolvingAsync(D),D}else if(!Z){const P=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,P))return this._preserveStack(U,k,P,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===U&&this._activeBuffer.y===k||this._onCursorMove.fire();const X=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),$=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);$<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min($,this._bufferService.rows-1),Math.min(X,this._bufferService.rows-1))}print(A,L,D){let U,k;const F=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,$=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ee=this._curAttrData;let q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-L>0&&q.getWidth(this._activeBuffer.x-1)===2&&q.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let de=this._parser.precedingJoinState;for(let ne=L;ne<D;++ne){if(U=A[ne],U<127&&F){const ce=F[String.fromCharCode(U)];ce&&(U=ce.charCodeAt(0))}const _e=this._unicodeService.charProperties(U,de);k=C.UnicodeService.extractWidth(_e);const pe=C.UnicodeService.extractShouldJoin(_e),je=pe?C.UnicodeService.extractWidth(de):0;if(de=_e,Z&&this._onA11yChar.fire((0,m.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+k-je>X){if($){const ce=q;let oe=this._activeBuffer.x-je;for(this._activeBuffer.x=je,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),q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),je>0&&q instanceof c.BufferLine&&q.copyCellsFrom(ce,oe,0,je,!1);oe<X;)ce.setCellFromCodepoint(oe++,0,1,ee)}else if(this._activeBuffer.x=X-1,k===2)continue}if(pe&&this._activeBuffer.x){const ce=q.getWidth(this._activeBuffer.x-1)?1:2;q.addCodepointToCell(this._activeBuffer.x-ce,U,k);for(let oe=k-je;--oe>=0;)q.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(P&&(q.insertCells(this._activeBuffer.x,k-je,this._activeBuffer.getNullCell(ee)),q.getWidth(X-1)===2&&q.setCellFromCodepoint(X-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ee)),q.setCellFromCodepoint(this._activeBuffer.x++,U,k,ee),k>0)for(;--k;)q.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=de,this._activeBuffer.x<X&&D-L>0&&q.getWidth(this._activeBuffer.x)===0&&!q.hasContent(this._activeBuffer.x)&&q.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,L){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,L):this._parser.registerCsiHandler(A,D=>!T(D.params[0],this._optionsService.rawOptions.windowOptions)||L(D))}registerDcsHandler(A,L){return this._parser.registerDcsHandler(A,new E.DcsHandler(L))}registerEscHandler(A,L){return this._parser.registerEscHandler(A,L)}registerOscHandler(A,L){return this._parser.registerOscHandler(A,new S.OscHandler(L))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=A,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+L)}cursorUp(A){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const L=A.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=A.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=A.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const L=A.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,L,D,U=!1,k=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);F.replaceCells(L,D,this._activeBuffer.getNullCell(this._eraseAttrData()),k),U&&(F.isWrapped=!1)}_resetBufferLine(A,L=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),D.isWrapped=!1)}eraseInDisplay(A,L=!1){let D;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);D<this._bufferService.rows;D++)this._resetBufferLine(D,L);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,L);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(A,L=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let L=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;L--;)this._activeBuffer.lines.splice(k-1,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}deleteLines(A){this._restrictCursor();let L=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;L--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let L=A.params[0]||1;for(;L--;)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(A){let L=A.params[0]||1;for(;L--;)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(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=A.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=A.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=A.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=A.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const L=this._parser.precedingJoinState;if(!L)return!0;const D=A.params[0]||1,U=C.UnicodeService.extractWidth(L),k=this._activeBuffer.x-U,F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(k),Z=new Uint32Array(F.length*D);let X=0;for(let P=0;P<F.length;){const ee=F.codePointAt(P)||0;Z[X++]=ee,P+=ee>65535?2:1}let $=X;for(let P=1;P<D;++P)Z.copyWithin($,0,X),$+=X;return this.print(Z,0,$),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let L=0;L<A.length;L++)switch(A.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let L=0;L<A.length;L++)switch(A.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,i.DEFAULT_CHARSET),this._charsetService.setgCharset(1,i.DEFAULT_CHARSET),this._charsetService.setgCharset(2,i.DEFAULT_CHARSET),this._charsetService.setgCharset(3,i.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(A){for(let L=0;L<A.length;L++)switch(A.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let L=0;L<A.length;L++)switch(A.params[L]){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(),A.params[L]===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(A,L){const D=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:k}=this._coreMouseService,F=this._coreService,{buffers:Z,cols:X}=this._bufferService,{active:$,alt:P}=Z,ee=this._optionsService.rawOptions,q=pe=>pe?1:2,de=A.params[0];return ne=de,_e=L?de===2?4:de===4?q(F.modes.insertMode):de===12?3:de===20?q(ee.convertEol):0:de===1?q(D.applicationCursorKeys):de===3?ee.windowOptions.setWinLines?X===80?2:X===132?1:0:0:de===6?q(D.origin):de===7?q(D.wraparound):de===8?3:de===9?q(U==="X10"):de===12?q(ee.cursorBlink):de===25?q(!F.isCursorHidden):de===45?q(D.reverseWraparound):de===66?q(D.applicationKeypad):de===67?4:de===1e3?q(U==="VT200"):de===1002?q(U==="DRAG"):de===1003?q(U==="ANY"):de===1004?q(D.sendFocus):de===1005?4:de===1006?q(k==="SGR"):de===1015?4:de===1016?q(k==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?q($===P):de===2004?q(D.bracketedPasteMode):0,F.triggerDataEvent(`${s.C0.ESC}[${L?"":"?"}${ne};${_e}$y`),!0;var ne,_e}_updateAttrColor(A,L,D,U,k){return L===2?(A|=50331648,A&=-16777216,A|=b.AttributeData.fromColorRGB([D,U,k])):L===5&&(A&=-50331904,A|=33554432|255&D),A}_extractColor(A,L,D){const U=[0,0,-1,0,0,0];let k=0,F=0;do{if(U[F+k]=A.params[L+F],A.hasSubParams(L+F)){const Z=A.getSubParams(L+F);let X=0;do U[1]===5&&(k=1),U[F+X+1+k]=Z[X];while(++X<Z.length&&X+F+1+k<U.length);break}if(U[1]===5&&F+k>=2||U[1]===2&&F+k>=5)break;U[1]&&(k=1)}while(++F+L<A.length&&F+k<U.length);for(let Z=2;Z<U.length;++Z)U[Z]===-1&&(U[Z]=0);switch(U[0]){case 38:D.fg=this._updateAttrColor(D.fg,U[1],U[3],U[4],U[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,U[1],U[3],U[4],U[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,U[1],U[3],U[4],U[5])}return F}_processUnderline(A,L){L.extended=L.extended.clone(),(!~A||A>5)&&(A=1),L.extended.underlineStyle=A,L.fg|=268435456,A===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(A){A.fg=c.DEFAULT_ATTR_DATA.fg,A.bg=c.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=A.length;let D;const U=this._curAttrData;for(let k=0;k<L;k++)D=A.params[k],D>=30&&D<=37?(U.fg&=-50331904,U.fg|=16777216|D-30):D>=40&&D<=47?(U.bg&=-50331904,U.bg|=16777216|D-40):D>=90&&D<=97?(U.fg&=-50331904,U.fg|=16777224|D-90):D>=100&&D<=107?(U.bg&=-50331904,U.bg|=16777224|D-100):D===0?this._processSGR0(U):D===1?U.fg|=134217728:D===3?U.bg|=67108864:D===4?(U.fg|=268435456,this._processUnderline(A.hasSubParams(k)?A.getSubParams(k)[0]:1,U)):D===5?U.fg|=536870912:D===7?U.fg|=67108864:D===8?U.fg|=1073741824:D===9?U.fg|=2147483648:D===2?U.bg|=134217728:D===21?this._processUnderline(2,U):D===22?(U.fg&=-134217729,U.bg&=-134217729):D===23?U.bg&=-67108865:D===24?(U.fg&=-268435457,this._processUnderline(0,U)):D===25?U.fg&=-536870913:D===27?U.fg&=-67108865:D===28?U.fg&=-1073741825:D===29?U.fg&=2147483647:D===39?(U.fg&=-67108864,U.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):D===49?(U.bg&=-67108864,U.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?k+=this._extractColor(A,k,U):D===53?U.bg|=1073741824:D===55?U.bg&=-1073741825:D===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):D===100?(U.fg&=-67108864,U.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${s.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[${L};${D}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const L=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[?${L};${D}R`)}return!0}softReset(A){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(A){const L=A.params[0]||1;switch(L){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 D=L%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(A){const L=A.params[0]||1;let D;return(A.length<2||(D=A.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(A){if(!T(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(x.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(x.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${s.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const L=[],D=A.split(";");for(;D.length>1;){const U=D.shift(),k=D.shift();if(/^\d+$/.exec(U)){const F=parseInt(U);if(J(F))if(k==="?")L.push({type:0,index:F});else{const Z=(0,j.parseColor)(k);Z&&L.push({type:1,index:F,color:Z})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(A){const L=A.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(A,L){this._getCurrentLinkId()&&this._finishHyperlink();const D=A.split(":");let U;const k=D.findIndex(F=>F.startsWith("id="));return k!==-1&&(U=D[k].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,L){const D=A.split(";");for(let U=0;U<D.length&&!(L>=this._specialColors.length);++U,++L)if(D[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const k=(0,j.parseColor)(D[U]);k&&this._onColor.fire([{type:1,index:this._specialColors[L],color:k}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const L=[],D=A.split(";");for(let U=0;U<D.length;++U)if(/^\d+$/.exec(D[U])){const k=parseInt(D[U]);J(k)&&L.push({type:2,index:k})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,i.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(O[A[0]],i.CHARSETS[A[1]]||i.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new _.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const D=this._activeBuffer.ybase+this._activeBuffer.y+L,U=this._activeBuffer.lines.get(D);U&&(U.fill(A),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,L){const D=this._bufferService.buffer,U=this._optionsService.rawOptions;return(k=>(this._coreService.triggerDataEvent(`${s.C0.ESC}${k}${s.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,L){this._dirtyRowTracker.markRangeDirty(A,L)}}o.InputHandler=B;let V=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,A){K>A&&(M=K,K=A,A=M),K<this.start&&(this.start=K),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(K){return 0<=K&&K<256}V=a([n(0,y.IBufferService)],V)},844:(v,o)=>{function r(a){for(const n of a)n.dispose();a.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){const n=this._disposables.indexOf(a);n!==-1&&this._disposables.splice(n,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){var n;this._isDisposed||a===this._value||((n=this._value)==null||n.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}},o.toDisposable=function(a){return{dispose:a}},o.disposeArray=r,o.getDisposeArrayDisposable=function(a){return{dispose:()=>r(a)}}},1505:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class r{constructor(){this._data={}}set(n,s,i){this._data[n]||(this._data[n]={}),this._data[n][s]=i}get(n,s){return this._data[n]?this._data[n][s]:void 0}clear(){this._data={}}}o.TwoKeyMap=r,o.FourKeyMap=class{constructor(){this._data=new r}set(a,n,s,i,d){this._data.get(a,n)||this._data.set(a,n,new r),this._data.get(a,n).set(s,i,d)}get(a,n,s,i){var d;return(d=this._data.get(a,n))==null?void 0:d.get(s,i)}clear(){this._data.clear()}}},6114:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const r=o.isNode?"node":navigator.userAgent,a=o.isNode?"node":navigator.platform;o.isFirefox=r.includes("Firefox"),o.isLegacyEdge=r.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(r),o.getSafariVersion=function(){if(!o.isSafari)return 0;const n=r.match(/Version\/(\d+)/);return n===null||n.length<2?0:parseInt(n[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),o.isIpad=a==="iPad",o.isIphone=a==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),o.isLinux=a.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(r)},6106:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let r=0;o.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(r=this._search(this._getKey(a)),this._array.splice(r,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;const n=this._getKey(a);if(n===void 0||(r=this._search(n),r===-1)||this._getKey(this._array[r])!==n)return!1;do if(this._array[r]===a)return this._array.splice(r,1),!0;while(++r<this._array.length&&this._getKey(this._array[r])===n);return!1}*getKeyIterator(a){if(this._array.length!==0&&(r=this._search(a),!(r<0||r>=this._array.length)&&this._getKey(this._array[r])===a))do yield this._array[r];while(++r<this._array.length&&this._getKey(this._array[r])===a)}forEachByKey(a,n){if(this._array.length!==0&&(r=this._search(a),!(r<0||r>=this._array.length)&&this._getKey(this._array[r])===a))do n(this._array[r]);while(++r<this._array.length&&this._getKey(this._array[r])===a)}values(){return[...this._array].values()}_search(a){let n=0,s=this._array.length-1;for(;s>=n;){let i=n+s>>1;const d=this._getKey(this._array[i]);if(d>a)s=i-1;else{if(!(d<a)){for(;i>0&&this._getKey(this._array[i-1])===a;)i--;return i}n=i+1}}return n}}},7226:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const a=r(6114);class n{constructor(){this._tasks=[],this._i=0}enqueue(d){this._tasks.push(d),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(d){this._idleCallback=void 0;let p=0,m=0,c=d.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(p=Date.now(),this._tasks[this._i]()||this._i++,p=Math.max(1,Date.now()-p),m=Math.max(p,m),f=d.timeRemaining(),1.5*m>f)return c-p<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-p))}ms`),void this._start();c=f}this.clear()}}class s extends n{_requestCallback(d){return setTimeout(()=>d(this._createDeadline(16)))}_cancelCallback(d){clearTimeout(d)}_createDeadline(d){const p=Date.now()+d;return{timeRemaining:()=>Math.max(0,p-Date.now())}}}o.PriorityTaskQueue=s,o.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends n{_requestCallback(i){return requestIdleCallback(i)}_cancelCallback(i){cancelIdleCallback(i)}}:s,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(i){this._queue.clear(),this._queue.enqueue(i)}flush(){this._queue.flush()}}},9282:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const a=r(643);o.updateWindowsModeWrappedState=function(n){const s=n.buffer.lines.get(n.buffer.ybase+n.buffer.y-1),i=s==null?void 0:s.get(n.cols-1),d=n.buffer.lines.get(n.buffer.ybase+n.buffer.y);d&&i&&(d.isWrapped=i[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&i[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class r{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(s){return[s>>>16&255,s>>>8&255,255&s]}static fromColorRGB(s){return(255&s[0])<<16|(255&s[1])<<8|255&s[2]}clone(){const s=new r;return s.fg=this.fg,s.bg=this.bg,s.extended=this.extended.clone(),s}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=r;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(s){this._ext=s}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(s){this._ext&=-469762049,this._ext|=s<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(s){this._ext&=-67108864,this._ext|=67108863&s}get urlId(){return this._urlId}set urlId(s){this._urlId=s}get underlineVariantOffset(){const s=(3758096384&this._ext)>>29;return s<0?4294967288^s:s}set underlineVariantOffset(s){this._ext&=536870911,this._ext|=s<<29&3758096384}constructor(s=0,i=0){this._ext=0,this._urlId=0,this._ext=s,this._urlId=i}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=a},9092:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const a=r(6349),n=r(7226),s=r(3734),i=r(8437),d=r(4634),p=r(511),m=r(643),c=r(4863),f=r(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(g,_,b){this._hasScrollback=g,this._optionsService=_,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=i.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=p.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new n.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(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new s.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new s.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,_){return new i.BufferLine(this._bufferService.cols,this.getNullCell(g),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const _=g+this._optionsService.rawOptions.scrollback;return _>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:_}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=i.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(g))}}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(g,_){const b=this.getNullCell(i.DEFAULT_ATTR_DATA);let y=0;const C=this._getCorrectBufferLength(_);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<g)for(let E=0;E<this.lines.length;E++)y+=+this.lines.get(E).resize(g,b);let S=0;if(this._rows<_)for(let E=this._rows;E<_;E++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new i.BufferLine(g,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+S+1?(this.ybase--,S++,this.ydisp>0&&this.ydisp--):this.lines.push(new i.BufferLine(g,b)));else for(let E=this._rows;E>_;E--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const E=this.lines.length-C;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=C}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,_-1),S&&(this.y+=S),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(g,_),this._cols>g))for(let S=0;S<this.lines.length;S++)y+=+this.lines.get(S).resize(g,b);this._cols=g,this._rows=_,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,_){this._cols!==g&&(g>this._cols?this._reflowLarger(g,_):this._reflowSmaller(g,_))}_reflowLarger(g,_){const b=(0,d.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));if(b.length>0){const y=(0,d.reflowLargerCreateNewLayout)(this.lines,b);(0,d.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(g,_,y.countRemoved)}}_reflowLargerAdjustViewport(g,_,b){const y=this.getNullCell(i.DEFAULT_ATTR_DATA);let C=b;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new i.BufferLine(g,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(g,_){const b=this.getNullCell(i.DEFAULT_ATTR_DATA),y=[];let C=0;for(let S=this.lines.length-1;S>=0;S--){let E=this.lines.get(S);if(!E||!E.isWrapped&&E.getTrimmedLength()<=g)continue;const j=[E];for(;E.isWrapped&&S>0;)E=this.lines.get(--S),j.unshift(E);const O=this.ybase+this.y;if(O>=S&&O<S+j.length)continue;const I=j[j.length-1].getTrimmedLength(),T=(0,d.reflowSmallerGetNewLineLengths)(j,this._cols,g),x=T.length-j.length;let M;M=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+x):Math.max(0,this.lines.length-this.lines.maxLength+x);const B=[];for(let D=0;D<x;D++){const U=this.getBlankLine(i.DEFAULT_ATTR_DATA,!0);B.push(U)}B.length>0&&(y.push({start:S+j.length+C,newLines:B}),C+=B.length),j.push(...B);let V=T.length-1,J=T[V];J===0&&(V--,J=T[V]);let K=j.length-x-1,A=I;for(;K>=0;){const D=Math.min(A,J);if(j[V]===void 0)break;if(j[V].copyCellsFrom(j[K],A-D,J-D,D,!0),J-=D,J===0&&(V--,J=T[V]),A-=D,A===0){K--;const U=Math.max(K,0);A=(0,d.getWrappedLineTrimmedLength)(j,U,this._cols)}}for(let D=0;D<j.length;D++)T[D]<g&&j[D].setCell(T[D],b);let L=x-M;for(;L-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+x,this.ybase+_-1)}if(y.length>0){const S=[],E=[];for(let V=0;V<this.lines.length;V++)E.push(this.lines.get(V));const j=this.lines.length;let O=j-1,I=0,T=y[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let x=0;for(let V=Math.min(this.lines.maxLength-1,j+C-1);V>=0;V--)if(T&&T.start>O+x){for(let J=T.newLines.length-1;J>=0;J--)this.lines.set(V--,T.newLines[J]);V++,S.push({index:O+1,amount:T.newLines.length}),x+=T.newLines.length,T=y[++I]}else this.lines.set(V,E[O--]);let M=0;for(let V=S.length-1;V>=0;V--)S[V].index+=M,this.lines.onInsertEmitter.fire(S[V]),M+=S[V].amount;const B=Math.max(0,j+C-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(g,_,b=0,y){const C=this.lines.get(g);return C?C.translateToString(_,b,y):""}getWrappedRangeForLine(g){let _=g,b=g;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:_,last:b}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===g&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const _=new c.Marker(g);return this.markers.push(_),_.register(this.lines.onTrim(b=>{_.line-=b,_.line<0&&_.dispose()})),_.register(this.lines.onInsert(b=>{_.line>=b.index&&(_.line+=b.amount)})),_.register(this.lines.onDelete(b=>{_.line>=b.index&&_.line<b.index+b.amount&&_.dispose(),_.line>b.index&&(_.line-=b.amount)})),_.register(_.onDispose(()=>this._removeMarker(_))),_}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const a=r(3734),n=r(511),s=r(643),i=r(482);o.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let d=0;class p{constructor(c,f,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const _=f||n.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]);for(let b=0;b<c;++b)this.setCell(b,_);this.length=c}get(c){const f=this._data[3*c+0],g=2097151&f;return[this._data[3*c+1],2097152&f?this._combined[c]:g?(0,i.stringFromCodePoint)(g):"",f>>22,2097152&f?this._combined[c].charCodeAt(this._combined[c].length-1):g]}set(c,f){this._data[3*c+1]=f[s.CHAR_DATA_ATTR_INDEX],f[s.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=f[1],this._data[3*c+0]=2097152|c|f[s.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=f[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[s.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 f=this._data[3*c+0];return 2097152&f?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&f}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const f=this._data[3*c+0];return 2097152&f?this._combined[c]:2097151&f?(0,i.stringFromCodePoint)(2097151&f):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,f){return d=3*c,f.content=this._data[d+0],f.fg=this._data[d+1],f.bg=this._data[d+2],2097152&f.content&&(f.combinedData=this._combined[c]),268435456&f.bg&&(f.extended=this._extendedAttrs[c]),f}setCell(c,f){2097152&f.content&&(this._combined[c]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[c]=f.extended),this._data[3*c+0]=f.content,this._data[3*c+1]=f.fg,this._data[3*c+2]=f.bg}setCellFromCodepoint(c,f,g,_){268435456&_.bg&&(this._extendedAttrs[c]=_.extended),this._data[3*c+0]=f|g<<22,this._data[3*c+1]=_.fg,this._data[3*c+2]=_.bg}addCodepointToCell(c,f,g){let _=this._data[3*c+0];2097152&_?this._combined[c]+=(0,i.stringFromCodePoint)(f):2097151&_?(this._combined[c]=(0,i.stringFromCodePoint)(2097151&_)+(0,i.stringFromCodePoint)(f),_&=-2097152,_|=2097152):_=f|4194304,g&&(_&=-12582913,_|=g<<22),this._data[3*c+0]=_}insertCells(c,f,g){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,g),f<this.length-c){const _=new n.CellData;for(let b=this.length-c-f-1;b>=0;--b)this.setCell(c+f+b,this.loadCell(c+b,_));for(let b=0;b<f;++b)this.setCell(c+b,g)}else for(let _=c;_<this.length;++_)this.setCell(_,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(c,f,g){if(c%=this.length,f<this.length-c){const _=new n.CellData;for(let b=0;b<this.length-c-f;++b)this.setCell(c+b,this.loadCell(c+f+b,_));for(let b=this.length-f;b<this.length;++b)this.setCell(b,g)}else for(let _=c;_<this.length;++_)this.setCell(_,g);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,g),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,g)}replaceCells(c,f,g,_=!1){if(_)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,g),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,g);c<f&&c<this.length;)this.isProtected(c)||this.setCell(c,g),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,g),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,g);c<f&&c<this.length;)this.setCell(c++,g)}resize(c,f){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const _=new Uint32Array(g);_.set(this._data),this._data=_}for(let _=this.length;_<c;++_)this.setCell(_,f)}else{this._data=this._data.subarray(0,g);const _=Object.keys(this._combined);for(let y=0;y<_.length;y++){const C=parseInt(_[y],10);C>=c&&delete this._combined[C]}const b=Object.keys(this._extendedAttrs);for(let y=0;y<b.length;y++){const C=parseInt(b[y],10);C>=c&&delete this._extendedAttrs[C]}}return this.length=c,4*g*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,f=!1){if(f)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,c);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,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 f in c._combined)this._combined[f]=c._combined[f];this._extendedAttrs={};for(const f in c._extendedAttrs)this._extendedAttrs[f]=c._extendedAttrs[f];this.isWrapped=c.isWrapped}clone(){const c=new p(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const f in this._combined)c._combined[f]=this._combined[f];for(const f in this._extendedAttrs)c._extendedAttrs[f]=this._extendedAttrs[f];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,f,g,_,b){const y=c._data;if(b)for(let S=_-1;S>=0;S--){for(let E=0;E<3;E++)this._data[3*(g+S)+E]=y[3*(f+S)+E];268435456&y[3*(f+S)+2]&&(this._extendedAttrs[g+S]=c._extendedAttrs[f+S])}else for(let S=0;S<_;S++){for(let E=0;E<3;E++)this._data[3*(g+S)+E]=y[3*(f+S)+E];268435456&y[3*(f+S)+2]&&(this._extendedAttrs[g+S]=c._extendedAttrs[f+S])}const C=Object.keys(c._combined);for(let S=0;S<C.length;S++){const E=parseInt(C[S],10);E>=f&&(this._combined[E-f+g]=c._combined[E])}}translateToString(c,f,g,_){f=f??0,g=g??this.length,c&&(g=Math.min(g,this.getTrimmedLength())),_&&(_.length=0);let b="";for(;f<g;){const y=this._data[3*f+0],C=2097151&y,S=2097152&y?this._combined[f]:C?(0,i.stringFromCodePoint)(C):s.WHITESPACE_CELL_CHAR;if(b+=S,_)for(let E=0;E<S.length;++E)_.push(f);f+=y>>22||1}return _&&_.push(f),b}}o.BufferLine=p},4841:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(r,a){if(r.start.y>r.end.y)throw new Error(`Buffer range end (${r.end.x}, ${r.end.y}) cannot be before start (${r.start.x}, ${r.start.y})`);return a*(r.end.y-r.start.y)+(r.end.x-r.start.x+1)}},4634:(v,o)=>{function r(a,n,s){if(n===a.length-1)return a[n].getTrimmedLength();const i=!a[n].hasContent(s-1)&&a[n].getWidth(s-1)===1,d=a[n+1].getWidth(0)===2;return i&&d?s-1:s}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(a,n,s,i,d){const p=[];for(let m=0;m<a.length-1;m++){let c=m,f=a.get(++c);if(!f.isWrapped)continue;const g=[a.get(m)];for(;c<a.length&&f.isWrapped;)g.push(f),f=a.get(++c);if(i>=m&&i<c){m+=g.length-1;continue}let _=0,b=r(g,_,n),y=1,C=0;for(;y<g.length;){const E=r(g,y,n),j=E-C,O=s-b,I=Math.min(j,O);g[_].copyCellsFrom(g[y],C,b,I,!1),b+=I,b===s&&(_++,b=0),C+=I,C===E&&(y++,C=0),b===0&&_!==0&&g[_-1].getWidth(s-1)===2&&(g[_].copyCellsFrom(g[_-1],s-1,b++,1,!1),g[_-1].setCell(s-1,d))}g[_].replaceCells(b,s,d);let S=0;for(let E=g.length-1;E>0&&(E>_||g[E].getTrimmedLength()===0);E--)S++;S>0&&(p.push(m+g.length-S),p.push(S)),m+=g.length-1}return p},o.reflowLargerCreateNewLayout=function(a,n){const s=[];let i=0,d=n[i],p=0;for(let m=0;m<a.length;m++)if(d===m){const c=n[++i];a.onDeleteEmitter.fire({index:m-p,amount:c}),m+=c-1,p+=c,d=n[++i]}else s.push(m);return{layout:s,countRemoved:p}},o.reflowLargerApplyNewLayout=function(a,n){const s=[];for(let i=0;i<n.length;i++)s.push(a.get(n[i]));for(let i=0;i<s.length;i++)a.set(i,s[i]);a.length=n.length},o.reflowSmallerGetNewLineLengths=function(a,n,s){const i=[],d=a.map((f,g)=>r(a,g,n)).reduce((f,g)=>f+g);let p=0,m=0,c=0;for(;c<d;){if(d-c<s){i.push(d-c);break}p+=s;const f=r(a,m,n);p>f&&(p-=f,m++);const g=a[m].getWidth(p-1)===2;g&&p--;const _=g?s-1:s;i.push(_),c+=_}return i},o.getWrappedLineTrimmedLength=r},5295:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const a=r(8460),n=r(844),s=r(9092);class i extends n.Disposable{constructor(p,m){super(),this._optionsService=p,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 s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.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(p){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(p),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(p,m){this._normal.resize(p,m),this._alt.resize(p,m),this.setupTabStops(p)}setupTabStops(p){this._normal.setupTabStops(p),this._alt.setupTabStops(p)}}o.BufferSet=i},511:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const a=r(482),n=r(643),s=r(3734);class i extends s.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new s.ExtendedAttrs,this.combinedData=""}static fromCharData(p){const m=new i;return m.setFromCharData(p),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(p){this.fg=p[n.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(p[n.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(p[n.CHAR_DATA_CHAR_INDEX].length===2){const c=p[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const f=p[n.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(c-55296)+f-56320+65536|p[n.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=p[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[n.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=p[n.CHAR_DATA_CHAR_INDEX],this.content=2097152|p[n.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=i},643:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const a=r(8460),n=r(844);class s{get id(){return this._id}constructor(d){this.line=d,this.isDisposed=!1,this._disposables=[],this._id=s._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,n.disposeArray)(this._disposables),this._disposables.length=0)}register(d){return this._disposables.push(d),d}}o.Marker=s,s._nextId=1},7116:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(v,o)=>{var r,a,n;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(s){s.NUL="\0",s.SOH="",s.STX="",s.ETX="",s.EOT="",s.ENQ="",s.ACK="",s.BEL="\x07",s.BS="\b",s.HT=" ",s.LF=`
|
|
1595
1593
|
`,s.VT="\v",s.FF="\f",s.CR="\r",s.SO="",s.SI="",s.DLE="",s.DC1="",s.DC2="",s.DC3="",s.DC4="",s.NAK="",s.SYN="",s.ETB="",s.CAN="",s.EM="",s.SUB="",s.ESC="\x1B",s.FS="",s.GS="",s.RS="",s.US="",s.SP=" ",s.DEL=""}(r||(o.C0=r={})),function(s){s.PAD="",s.HOP="",s.BPH="",s.NBH="",s.IND="",s.NEL="
",s.SSA="",s.ESA="",s.HTS="",s.HTJ="",s.VTS="",s.PLD="",s.PLU="",s.RI="",s.SS2="",s.SS3="",s.DCS="",s.PU1="",s.PU2="",s.STS="",s.CCH="",s.MW="",s.SPA="",s.EPA="",s.SOS="",s.SGCI="",s.SCI="",s.CSI="",s.ST="",s.OSC="",s.PM="",s.APC=""}(a||(o.C1=a={})),function(s){s.ST=`${r.ESC}\\`}(n||(o.C1_ESCAPED=n={}))},7399:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const a=r(2584),n={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(s,i,d,p){const m={type:0,cancel:!1,key:void 0},c=(s.shiftKey?1:0)|(s.altKey?2:0)|(s.ctrlKey?4:0)|(s.metaKey?8:0);switch(s.keyCode){case 0:s.key==="UIKeyInputUpArrow"?m.key=i?a.C0.ESC+"OA":a.C0.ESC+"[A":s.key==="UIKeyInputLeftArrow"?m.key=i?a.C0.ESC+"OD":a.C0.ESC+"[D":s.key==="UIKeyInputRightArrow"?m.key=i?a.C0.ESC+"OC":a.C0.ESC+"[C":s.key==="UIKeyInputDownArrow"&&(m.key=i?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:m.key=s.ctrlKey?"\b":a.C0.DEL,s.altKey&&(m.key=a.C0.ESC+m.key);break;case 9:if(s.shiftKey){m.key=a.C0.ESC+"[Z";break}m.key=a.C0.HT,m.cancel=!0;break;case 13:m.key=s.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,m.cancel=!0;break;case 27:m.key=a.C0.ESC,s.altKey&&(m.key=a.C0.ESC+a.C0.ESC),m.cancel=!0;break;case 37:if(s.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"D",m.key===a.C0.ESC+"[1;3D"&&(m.key=a.C0.ESC+(d?"b":"[1;5D"))):m.key=i?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(s.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"C",m.key===a.C0.ESC+"[1;3C"&&(m.key=a.C0.ESC+(d?"f":"[1;5C"))):m.key=i?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(s.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"A",d||m.key!==a.C0.ESC+"[1;3A"||(m.key=a.C0.ESC+"[1;5A")):m.key=i?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(s.metaKey)break;c?(m.key=a.C0.ESC+"[1;"+(c+1)+"B",d||m.key!==a.C0.ESC+"[1;3B"||(m.key=a.C0.ESC+"[1;5B")):m.key=i?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:s.shiftKey||s.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":i?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:m.key=c?a.C0.ESC+"[1;"+(c+1)+"F":i?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:s.shiftKey?m.type=2:s.ctrlKey?m.key=a.C0.ESC+"[5;"+(c+1)+"~":m.key=a.C0.ESC+"[5~";break;case 34:s.shiftKey?m.type=3:s.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(!s.ctrlKey||s.shiftKey||s.altKey||s.metaKey)if(d&&!p||!s.altKey||s.metaKey)!d||s.altKey||s.ctrlKey||s.shiftKey||!s.metaKey?s.key&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&s.keyCode>=48&&s.key.length===1?m.key=s.key:s.key&&s.ctrlKey&&(s.key==="_"&&(m.key=a.C0.US),s.key==="@"&&(m.key=a.C0.NUL)):s.keyCode===65&&(m.type=1);else{const f=n[s.keyCode],g=f==null?void 0:f[s.shiftKey?1:0];if(g)m.key=a.C0.ESC+g;else if(s.keyCode>=65&&s.keyCode<=90){const _=s.ctrlKey?s.keyCode-64:s.keyCode+32;let b=String.fromCharCode(_);s.shiftKey&&(b=b.toUpperCase()),m.key=a.C0.ESC+b}else if(s.keyCode===32)m.key=a.C0.ESC+(s.ctrlKey?a.C0.NUL:" ");else if(s.key==="Dead"&&s.code.startsWith("Key")){let _=s.code.slice(3,4);s.shiftKey||(_=_.toLowerCase()),m.key=a.C0.ESC+_,m.cancel=!0}}else s.keyCode>=65&&s.keyCode<=90?m.key=String.fromCharCode(s.keyCode-64):s.keyCode===32?m.key=a.C0.NUL:s.keyCode>=51&&s.keyCode<=55?m.key=String.fromCharCode(s.keyCode-51+27):s.keyCode===56?m.key=a.C0.DEL:s.keyCode===219?m.key=a.C0.ESC:s.keyCode===220?m.key=a.C0.FS:s.keyCode===221&&(m.key=a.C0.GS)}return m}},482:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(r){return r>65535?(r-=65536,String.fromCharCode(55296+(r>>10))+String.fromCharCode(r%1024+56320)):String.fromCharCode(r)},o.utf32ToString=function(r,a=0,n=r.length){let s="";for(let i=a;i<n;++i){let d=r[i];d>65535?(d-=65536,s+=String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):s+=String.fromCharCode(d)}return s},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(r,a){const n=r.length;if(!n)return 0;let s=0,i=0;if(this._interim){const d=r.charCodeAt(i++);56320<=d&&d<=57343?a[s++]=1024*(this._interim-55296)+d-56320+65536:(a[s++]=this._interim,a[s++]=d),this._interim=0}for(let d=i;d<n;++d){const p=r.charCodeAt(d);if(55296<=p&&p<=56319){if(++d>=n)return this._interim=p,s;const m=r.charCodeAt(d);56320<=m&&m<=57343?a[s++]=1024*(p-55296)+m-56320+65536:(a[s++]=p,a[s++]=m)}else p!==65279&&(a[s++]=p)}return s}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(r,a){const n=r.length;if(!n)return 0;let s,i,d,p,m=0,c=0,f=0;if(this.interim[0]){let b=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let C,S=0;for(;(C=63&this.interim[++S])&&S<4;)y<<=6,y|=C;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=E-S;for(;f<j;){if(f>=n)return 0;if(C=r[f++],(192&C)!=128){f--,b=!0;break}this.interim[S++]=C,y<<=6,y|=63&C}b||(E===2?y<128?f--:a[m++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(a[m++]=y):y<65536||y>1114111||(a[m++]=y)),this.interim.fill(0)}const g=n-4;let _=f;for(;_<n;){for(;!(!(_<g)||128&(s=r[_])||128&(i=r[_+1])||128&(d=r[_+2])||128&(p=r[_+3]));)a[m++]=s,a[m++]=i,a[m++]=d,a[m++]=p,_+=4;if(s=r[_++],s<128)a[m++]=s;else if((224&s)==192){if(_>=n)return this.interim[0]=s,m;if(i=r[_++],(192&i)!=128){_--;continue}if(c=(31&s)<<6|63&i,c<128){_--;continue}a[m++]=c}else if((240&s)==224){if(_>=n)return this.interim[0]=s,m;if(i=r[_++],(192&i)!=128){_--;continue}if(_>=n)return this.interim[0]=s,this.interim[1]=i,m;if(d=r[_++],(192&d)!=128){_--;continue}if(c=(15&s)<<12|(63&i)<<6|63&d,c<2048||c>=55296&&c<=57343||c===65279)continue;a[m++]=c}else if((248&s)==240){if(_>=n)return this.interim[0]=s,m;if(i=r[_++],(192&i)!=128){_--;continue}if(_>=n)return this.interim[0]=s,this.interim[1]=i,m;if(d=r[_++],(192&d)!=128){_--;continue}if(_>=n)return this.interim[0]=s,this.interim[1]=i,this.interim[2]=d,m;if(p=r[_++],(192&p)!=128){_--;continue}if(c=(7&s)<<18|(63&i)<<12|(63&d)<<6|63&p,c<65536||c>1114111)continue;a[m++]=c}}return m}}},225:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const a=r(1480),n=[[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]],s=[[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 i;o.UnicodeV6=class{constructor(){if(this.version="6",!i){i=new Uint8Array(65536),i.fill(1),i[0]=0,i.fill(0,1,32),i.fill(0,127,160),i.fill(2,4352,4448),i[9001]=2,i[9002]=2,i.fill(2,11904,42192),i[12351]=1,i.fill(2,44032,55204),i.fill(2,63744,64256),i.fill(2,65040,65050),i.fill(2,65072,65136),i.fill(2,65280,65377),i.fill(2,65504,65511);for(let d=0;d<n.length;++d)i.fill(0,n[d][0],n[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?i[d]:function(p,m){let c,f=0,g=m.length-1;if(p<m[0][0]||p>m[g][1])return!1;for(;g>=f;)if(c=f+g>>1,p>m[c][1])f=c+1;else{if(!(p<m[c][0]))return!0;g=c-1}return!1}(d,s)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}charProperties(d,p){let m=this.wcwidth(d),c=m===0&&p!==0;if(c){const f=a.UnicodeService.extractWidth(p);f===0?c=!1:f>m&&(m=f)}return a.UnicodeService.createPropertyValue(0,m,c)}}},5981:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const a=r(8460),n=r(844);class s extends n.Disposable{constructor(d){super(),this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(d,p){if(p!==void 0&&this._syncCalls>p)return void(this._syncCalls=0);if(this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let 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(d,p){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(p),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(p)}_innerWrite(d=0,p=!0){const m=d||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],f=this._action(c,p);if(f){const _=b=>Date.now()-m>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(m,b);return void f.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(_)}const g=this._callbacks[this._bufferOffset];if(g&&g(),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()}}o.WriteBuffer=s},5941:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const r=/^([\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 n(s,i){const d=s.toString(16),p=d.length<2?"0"+d:d;switch(i){case 4:return d[0];case 8:return p;case 12:return(p+p).slice(0,3);default:return p+p}}o.parseColor=function(s){if(!s)return;let i=s.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);const d=r.exec(i);if(d){const p=d[1]?15:d[4]?255:d[7]?4095:65535;return[Math.round(parseInt(d[1]||d[4]||d[7]||d[10],16)/p*255),Math.round(parseInt(d[2]||d[5]||d[8]||d[11],16)/p*255),Math.round(parseInt(d[3]||d[6]||d[9]||d[12],16)/p*255)]}}else if(i.indexOf("#")===0&&(i=i.slice(1),a.exec(i)&&[3,6,9,12].includes(i.length))){const d=i.length/3,p=[0,0,0];for(let m=0;m<3;++m){const c=parseInt(i.slice(d*m,d*m+d),16);p[m]=d===1?c<<4:d===2?c:d===3?c>>4:c>>8}return p}},o.toRgbString=function(s,i=16){const[d,p,m]=s;return`rgb:${n(d,i)}/${n(p,i)}/${n(m,i)}`}},5770:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const a=r(482),n=r(8742),s=r(5770),i=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=i,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=i}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const c=this._handlers[p];return c.push(m),{dispose:()=>{const f=c.indexOf(m);f!==-1&&c.splice(f,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}reset(){if(this._active.length)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].unhook(!1);this._stack.paused=!1,this._active=i,this._ident=0}hook(p,m){if(this.reset(),this._ident=p,this._active=this._handlers[p]||i,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(p,m,c){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(p,m,c);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(p,m,c))}unhook(p,m=!0){if(this._active.length){let c=!1,f=this._active.length-1,g=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,c=m,g=this._stack.fallThrough,this._stack.paused=!1),!g&&c===!1){for(;f>=0&&(c=this._active[f].unhook(p),c!==!0);f--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,c;f--}for(;f>=0;f--)if(c=this._active[f].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",p);this._active=i,this._ident=0}};const d=new n.Params;d.addParam(0),o.DcsHandler=class{constructor(p){this._handler=p,this._data="",this._params=d,this._hitLimit=!1}hook(p){this._params=p.length>1||p.params[0]?p.clone():d,this._data="",this._hitLimit=!1}put(p,m,c){this._hitLimit||(this._data+=(0,a.utf32ToString)(p,m,c),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then(c=>(this._params=d,this._data="",this._hitLimit=!1,c));return this._params=d,this._data="",this._hitLimit=!1,m}}},2015:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const a=r(844),n=r(8742),s=r(6242),i=r(6351);class d{constructor(f){this.table=new Uint8Array(f)}setDefault(f,g){this.table.fill(f<<4|g)}add(f,g,_,b){this.table[g<<8|f]=_<<4|b}addMany(f,g,_,b){for(let y=0;y<f.length;y++)this.table[g<<8|f[y]]=_<<4|b}}o.TransitionTable=d;const p=160;o.VT500_TRANSITION_TABLE=function(){const c=new d(4095),f=Array.apply(null,Array(256)).map((S,E)=>E),g=(S,E)=>f.slice(S,E),_=g(32,127),b=g(0,24);b.push(25),b.push.apply(b,g(28,32));const y=g(0,14);let C;for(C in c.setDefault(1,0),c.addMany(_,0,2,0),y)c.addMany([24,26,153,154],C,3,0),c.addMany(g(128,144),C,3,0),c.addMany(g(144,152),C,3,0),c.add(156,C,0,0),c.add(27,C,11,1),c.add(157,C,4,8),c.addMany([152,158,159],C,0,7),c.add(155,C,11,3),c.add(144,C,11,9);return c.addMany(b,0,3,0),c.addMany(b,1,3,1),c.add(127,1,0,1),c.addMany(b,8,0,8),c.addMany(b,3,3,3),c.add(127,3,0,3),c.addMany(b,4,3,4),c.add(127,4,0,4),c.addMany(b,6,3,6),c.addMany(b,5,3,5),c.add(127,5,0,5),c.addMany(b,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(_,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(g(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(_,7,0,7),c.addMany(b,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(g(64,127),3,7,0),c.addMany(g(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(g(48,60),4,8,4),c.addMany(g(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(g(32,64),6,0,6),c.add(127,6,0,6),c.addMany(g(64,127),6,0,0),c.addMany(g(32,48),3,9,5),c.addMany(g(32,48),5,9,5),c.addMany(g(48,64),5,0,6),c.addMany(g(64,127),5,7,0),c.addMany(g(32,48),4,9,5),c.addMany(g(32,48),1,9,2),c.addMany(g(32,48),2,9,2),c.addMany(g(48,127),2,10,0),c.addMany(g(48,80),1,10,0),c.addMany(g(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(g(96,127),1,10,0),c.add(80,1,11,9),c.addMany(b,9,0,9),c.add(127,9,0,9),c.addMany(g(28,32),9,0,9),c.addMany(g(32,48),9,9,12),c.addMany(g(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(b,11,0,11),c.addMany(g(32,128),11,0,11),c.addMany(g(28,32),11,0,11),c.addMany(b,10,0,10),c.add(127,10,0,10),c.addMany(g(28,32),10,0,10),c.addMany(g(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(g(32,48),10,9,12),c.addMany(b,12,0,12),c.add(127,12,0,12),c.addMany(g(28,32),12,0,12),c.addMany(g(32,48),12,9,12),c.addMany(g(48,64),12,0,11),c.addMany(g(64,127),12,12,13),c.addMany(g(64,127),10,12,13),c.addMany(g(64,127),9,12,13),c.addMany(b,13,13,13),c.addMany(_,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(p,0,2,0),c.add(p,8,5,8),c.add(p,6,0,6),c.add(p,11,0,11),c.add(p,13,13,13),c}();class m extends a.Disposable{constructor(f=o.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,_,b)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,_)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,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 s.OscParser),this._dcsParser=this.register(new i.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,g=[64,126]){let _=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=f.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<f.intermediates.length;++y){const C=f.intermediates.charCodeAt(y);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=C}}if(f.final.length!==1)throw new Error("final must be a single byte");const b=f.final.charCodeAt(0);if(g[0]>b||b>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return _<<=8,_|=b,_}identToString(f){const g=[];for(;f;)g.push(String.fromCharCode(255&f)),f>>=8;return g.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,g){const _=this._identifier(f,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const b=this._escHandlers[_];return b.push(g),{dispose:()=>{const y=b.indexOf(g);y!==-1&&b.splice(y,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,g){this._executeHandlers[f.charCodeAt(0)]=g}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,g){const _=this._identifier(f);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const b=this._csiHandlers[_];return b.push(g),{dispose:()=>{const y=b.indexOf(g);y!==-1&&b.splice(y,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,g){return this._dcsParser.registerHandler(this._identifier(f),g)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,g){return this._oscParser.registerHandler(f,g)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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(f,g,_,b,y){this._parseStack.state=f,this._parseStack.handlers=g,this._parseStack.handlerPos=_,this._parseStack.transition=b,this._parseStack.chunkPos=y}parse(f,g,_){let b,y=0,C=0,S=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,S=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&j>-1){for(;j>=0&&(b=E[j](this._params),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 4:if(_===!1&&j>-1){for(;j>=0&&(b=E[j](),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 6:if(y=f[this._parseStack.chunkPos],b=this._dcsParser.unhook(y!==24&&y!==26,_),b)return b;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=f[this._parseStack.chunkPos],b=this._oscParser.end(y!==24&&y!==26,_),b)return b;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,S=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=S;E<g;++E){switch(y=f[E],C=this._transitions.table[this.currentState<<8|(y<160?y:p)],C>>4){case 2:for(let x=E+1;;++x){if(x>=g||(y=f[x])<32||y>126&&y<p){this._printHandler(f,E,x),E=x-1;break}if(++x>=g||(y=f[x])<32||y>126&&y<p){this._printHandler(f,E,x),E=x-1;break}if(++x>=g||(y=f[x])<32||y>126&&y<p){this._printHandler(f,E,x),E=x-1;break}if(++x>=g||(y=f[x])<32||y>126&&y<p){this._printHandler(f,E,x),E=x-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|y];let O=j?j.length-1:-1;for(;O>=0&&(b=j[O](this._params),b!==!0);O--)if(b instanceof Promise)return this._preserveStack(3,j,O,C,E),b;O<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingJoinState=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++E<g&&(y=f[E])>47&&y<60);E--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const I=this._escHandlers[this._collect<<8|y];let T=I?I.length-1:-1;for(;T>=0&&(b=I[T](),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(4,I,T,C,E),b;T<0&&this._escHandlerFb(this._collect<<8|y),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|y,this._params);break;case 13:for(let x=E+1;;++x)if(x>=g||(y=f[x])===24||y===26||y===27||y>127&&y<p){this._dcsParser.put(f,E,x),E=x-1;break}break;case 14:if(b=this._dcsParser.unhook(y!==24&&y!==26),b)return this._preserveStack(6,[],0,C,E),b;y===27&&(C|=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 x=E+1;;x++)if(x>=g||(y=f[x])<32||y>127&&y<p){this._oscParser.put(f,E,x),E=x-1;break}break;case 6:if(b=this._oscParser.end(y!==24&&y!==26),b)return this._preserveStack(5,[],0,C,E),b;y===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}o.EscapeSequenceParser=m},6242:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const a=r(5770),n=r(482),s=[];o.OscParser=class{constructor(){this._state=0,this._active=s,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(i,d){this._handlers[i]===void 0&&(this._handlers[i]=[]);const p=this._handlers[i];return p.push(d),{dispose:()=>{const m=p.indexOf(d);m!==-1&&p.splice(m,1)}}}clearHandler(i){this._handlers[i]&&delete this._handlers[i]}setHandlerFallback(i){this._handlerFb=i}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=s}reset(){if(this._state===2)for(let i=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;i>=0;--i)this._active[i].end(!1);this._stack.paused=!1,this._active=s,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||s,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].start();else this._handlerFb(this._id,"START")}_put(i,d,p){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(i,d,p);else this._handlerFb(this._id,"PUT",(0,n.utf32ToString)(i,d,p))}start(){this.reset(),this._state=1}put(i,d,p){if(this._state!==3){if(this._state===1)for(;d<p;){const m=i[d++];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&&p-d>0&&this._put(i,d,p)}}end(i,d=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let p=!1,m=this._active.length-1,c=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,p=d,c=this._stack.fallThrough,this._stack.paused=!1),!c&&p===!1){for(;m>=0&&(p=this._active[m].end(i),p!==!0);m--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,p;m--}for(;m>=0;m--)if(p=this._active[m].end(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,p}else this._handlerFb(this._id,"END",i);this._active=s,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(i){this._handler=i,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(i,d,p){this._hitLimit||(this._data+=(0,n.utf32ToString)(i,d,p),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(i){let d=!1;if(this._hitLimit)d=!1;else if(i&&(d=this._handler(this._data),d instanceof Promise))return d.then(p=>(this._data="",this._hitLimit=!1,p));return this._data="",this._hitLimit=!1,d}}},8742:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const r=2147483647;class a{static fromArray(s){const i=new a;if(!s.length)return i;for(let d=Array.isArray(s[0])?1:0;d<s.length;++d){const p=s[d];if(Array.isArray(p))for(let m=0;m<p.length;++m)i.addSubParam(p[m]);else i.addParam(p)}return i}constructor(s=32,i=32){if(this.maxLength=s,this.maxSubParamsLength=i,i>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(s),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(s),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const s=new a(this.maxLength,this.maxSubParamsLength);return s.params.set(this.params),s.length=this.length,s._subParams.set(this._subParams),s._subParamsLength=this._subParamsLength,s._subParamsIdx.set(this._subParamsIdx),s._rejectDigits=this._rejectDigits,s._rejectSubDigits=this._rejectSubDigits,s._digitIsSub=this._digitIsSub,s}toArray(){const s=[];for(let i=0;i<this.length;++i){s.push(this.params[i]);const d=this._subParamsIdx[i]>>8,p=255&this._subParamsIdx[i];p-d>0&&s.push(Array.prototype.slice.call(this._subParams,d,p))}return s}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(s){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=s>r?r:s}}addSubParam(s){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=s>r?r:s,this._subParamsIdx[this.length-1]++}}hasSubParams(s){return(255&this._subParamsIdx[s])-(this._subParamsIdx[s]>>8)>0}getSubParams(s){const i=this._subParamsIdx[s]>>8,d=255&this._subParamsIdx[s];return d-i>0?this._subParams.subarray(i,d):null}getSubParamsAll(){const s={};for(let i=0;i<this.length;++i){const d=this._subParamsIdx[i]>>8,p=255&this._subParamsIdx[i];p-d>0&&(s[i]=this._subParams.slice(d,p))}return s}addDigit(s){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const d=this._digitIsSub?this._subParams:this.params,p=d[i-1];d[i-1]=~p?Math.min(10*p+s,r):s}}o.Params=a},5741:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let r=this._addons.length-1;r>=0;r--)this._addons[r].instance.dispose()}loadAddon(r,a){const n={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(n),a.dispose=()=>this._wrappedAddonDispose(n),a.activate(r)}_wrappedAddonDispose(r){if(r.isDisposed)return;let a=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===r){a=n;break}if(a===-1)throw new Error("Could not dispose an addon that has not been loaded");r.isDisposed=!0,r.dispose.apply(r.instance),this._addons.splice(a,1)}}},8771:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const a=r(3785),n=r(511);o.BufferApiView=class{constructor(s,i){this._buffer=s,this.type=i}init(s){return this._buffer=s,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(s){const i=this._buffer.lines.get(s);if(i)return new a.BufferLineApiView(i)}getNullCell(){return new n.CellData}}},3785:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const a=r(511);o.BufferLineApiView=class{constructor(n){this._line=n}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(n,s){if(!(n<0||n>=this._line.length))return s?(this._line.loadCell(n,s),s):this._line.loadCell(n,new a.CellData)}translateToString(n,s,i){return this._line.translateToString(n,s,i)}}},8285:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const a=r(8771),n=r(8460),s=r(844);class i extends s.Disposable{constructor(p){super(),this._core=p,this._onBufferChange=this.register(new n.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)}}o.BufferNamespaceApi=i},7975:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(r){this._core=r}registerCsiHandler(r,a){return this._core.registerCsiHandler(r,n=>a(n.toArray()))}addCsiHandler(r,a){return this.registerCsiHandler(r,a)}registerDcsHandler(r,a){return this._core.registerDcsHandler(r,(n,s)=>a(n,s.toArray()))}addDcsHandler(r,a){return this.registerDcsHandler(r,a)}registerEscHandler(r,a){return this._core.registerEscHandler(r,a)}addEscHandler(r,a){return this.registerEscHandler(r,a)}registerOscHandler(r,a){return this._core.registerOscHandler(r,a)}addOscHandler(r,a){return this.registerOscHandler(r,a)}}},7090:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(r){this._core=r}register(r){this._core.unicodeService.register(r)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(r){this._core.unicodeService.activeVersion=r}}},744:function(v,o,r){var a=this&&this.__decorate||function(c,f,g,_){var b,y=arguments.length,C=y<3?f:_===null?_=Object.getOwnPropertyDescriptor(f,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(c,f,g,_);else for(var S=c.length-1;S>=0;S--)(b=c[S])&&(C=(y<3?b(C):y>3?b(f,g,C):b(f,g))||C);return y>3&&C&&Object.defineProperty(f,g,C),C},n=this&&this.__param||function(c,f){return function(g,_){f(g,_,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const s=r(8460),i=r(844),d=r(5295),p=r(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let m=o.BufferService=class extends i.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new s.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new d.BufferSet(c,this))}resize(c,f){this.cols=c,this.rows=f,this.buffers.resize(c,f),this._onResize.fire({cols:c,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,f=!1){const g=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===c.fg&&_.getBg(0)===c.bg||(_=g.getBlankLine(c,f),this._cachedBlankLine=_),_.isWrapped=f;const b=g.ybase+g.scrollTop,y=g.ybase+g.scrollBottom;if(g.scrollTop===0){const C=g.lines.isFull;y===g.lines.length-1?C?g.lines.recycle().copyFrom(_):g.lines.push(_.clone()):g.lines.splice(y+1,0,_.clone()),C?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const C=y-b+1;g.lines.shiftElements(b+1,C-1,-1),g.lines.set(y,_.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(c,f,g){const _=this.buffer;if(c<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else c+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const b=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+c,_.ybase),0),b!==_.ydisp&&(f||this._onScroll.fire(_.ydisp))}};o.BufferService=m=a([n(0,p.IOptionsService)],m)},7994:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(r){this.glevel=r,this.charset=this._charsets[r]}setgCharset(r,a){this._charsets[r]=a,this.glevel===r&&(this.charset=a)}}},1753:function(v,o,r){var a=this&&this.__decorate||function(_,b,y,C){var S,E=arguments.length,j=E<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(_,b,y,C);else for(var O=_.length-1;O>=0;O--)(S=_[O])&&(j=(E<3?S(j):E>3?S(b,y,j):S(b,y))||j);return E>3&&j&&Object.defineProperty(b,y,j),j},n=this&&this.__param||function(_,b){return function(y,C){b(y,C,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const s=r(2585),i=r(8460),d=r(844),p={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function m(_,b){let y=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(y|=64,y|=_.action):(y|=3&_.button,4&_.button&&(y|=64),8&_.button&&(y|=128),_.action===32?y|=32:_.action!==0||b||(y|=3)),y}const c=String.fromCharCode,f={DEFAULT:_=>{const b=[m(_,!1)+32,_.col+32,_.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${c(b[0])}${c(b[1])}${c(b[2])}`},SGR:_=>{const b=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${m(_,!0)};${_.col};${_.row}${b}`},SGR_PIXELS:_=>{const b=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${m(_,!0)};${_.x};${_.y}${b}`}};let g=o.CoreMouseService=class extends d.Disposable{constructor(_,b){super(),this._bufferService=_,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new i.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(p))this.addProtocol(y,p[y]);for(const y of Object.keys(f))this.addEncoding(y,f[y]);this.reset()}addProtocol(_,b){this._protocols[_]=b}addEncoding(_,b){this._encodings[_]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const b=this._encodings[this._activeEncoding](_);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,b,y){if(y){if(_.x!==b.x||_.y!==b.y)return!1}else if(_.col!==b.col||_.row!==b.row)return!1;return _.button===b.button&&_.action===b.action&&_.ctrl===b.ctrl&&_.alt===b.alt&&_.shift===b.shift}};o.CoreMouseService=g=a([n(0,s.IBufferService),n(1,s.ICoreService)],g)},6975:function(v,o,r){var a=this&&this.__decorate||function(g,_,b,y){var C,S=arguments.length,E=S<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,b,y);else for(var j=g.length-1;j>=0;j--)(C=g[j])&&(E=(S<3?C(E):S>3?C(_,b,E):C(_,b))||E);return S>3&&E&&Object.defineProperty(_,b,E),E},n=this&&this.__param||function(g,_){return function(b,y){_(b,y,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const s=r(1439),i=r(8460),d=r(844),p=r(2585),m=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=o.CoreService=class extends d.Disposable{constructor(g,_,b){super(),this._bufferService=g,this._logService=_,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new i.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new i.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,s.clone)(m),this.decPrivateModes=(0,s.clone)(c)}reset(){this.modes=(0,s.clone)(m),this.decPrivateModes=(0,s.clone)(c)}triggerDataEvent(g,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,()=>g.split("").map(y=>y.charCodeAt(0))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,()=>g.split("").map(_=>_.charCodeAt(0))),this._onBinary.fire(g))}};o.CoreService=f=a([n(0,p.IBufferService),n(1,p.ILogService),n(2,p.IOptionsService)],f)},9074:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const a=r(8055),n=r(8460),s=r(844),i=r(6106);let d=0,p=0;class m extends s.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new i.SortedList(g=>g==null?void 0:g.marker.line),this._onDecorationRegistered=this.register(new n.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new n.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,s.toDisposable)(()=>this.reset()))}registerDecoration(g){if(g.marker.isDisposed)return;const _=new c(g);if(_){const b=_.marker.onDispose(()=>_.dispose());_.onDispose(()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),b.dispose())}),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,_,b){let y=0,C=0;for(const S of this._decorations.getKeyIterator(_))y=S.options.x??0,C=y+(S.options.width??1),g>=y&&g<C&&(!b||(S.options.layer??"bottom")===b)&&(yield S)}forEachDecorationAtCell(g,_,b,y){this._decorations.forEachByKey(_,C=>{d=C.options.x??0,p=d+(C.options.width??1),g>=d&&g<p&&(!b||(C.options.layer??"bottom")===b)&&y(C)})}}o.DecorationService=m;class c extends s.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(g){super(),this.options=g,this.onRenderEmitter=this.register(new n.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new n.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const a=r(2585),n=r(8343);class s{constructor(...d){this._entries=new Map;for(const[p,m]of d)this.set(p,m)}set(d,p){const m=this._entries.get(d);return this._entries.set(d,p),m}forEach(d){for(const[p,m]of this._entries.entries())d(p,m)}has(d){return this._entries.has(d)}get(d){return this._entries.get(d)}}o.ServiceCollection=s,o.InstantiationService=class{constructor(){this._services=new s,this._services.set(a.IInstantiationService,this)}setService(i,d){this._services.set(i,d)}getService(i){return this._services.get(i)}createInstance(i,...d){const p=(0,n.getServiceDependencies)(i).sort((f,g)=>f.index-g.index),m=[];for(const f of p){const g=this._services.get(f.id);if(!g)throw new Error(`[createInstance] ${i.name} depends on UNKNOWN service ${f.id}.`);m.push(g)}const c=p.length>0?p[0].index:d.length;if(d.length!==c)throw new Error(`[createInstance] First service dependency of ${i.name} at position ${c+1} conflicts with ${d.length} static arguments`);return new i(...d,...m)}}},7866:function(v,o,r){var a=this&&this.__decorate||function(c,f,g,_){var b,y=arguments.length,C=y<3?f:_===null?_=Object.getOwnPropertyDescriptor(f,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(c,f,g,_);else for(var S=c.length-1;S>=0;S--)(b=c[S])&&(C=(y<3?b(C):y>3?b(f,g,C):b(f,g))||C);return y>3&&C&&Object.defineProperty(f,g,C),C},n=this&&this.__param||function(c,f){return function(g,_){f(g,_,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const s=r(844),i=r(2585),d={trace:i.LogLevelEnum.TRACE,debug:i.LogLevelEnum.DEBUG,info:i.LogLevelEnum.INFO,warn:i.LogLevelEnum.WARN,error:i.LogLevelEnum.ERROR,off:i.LogLevelEnum.OFF};let p,m=o.LogService=class extends s.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=i.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),p=this}_updateLogLevel(){this._logLevel=d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let f=0;f<c.length;f++)typeof c[f]=="function"&&(c[f]=c[f]())}_log(c,f,g){this._evalLazyOptionalParams(g),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...g)}trace(c,...f){var g;this._logLevel<=i.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,c,f)}debug(c,...f){var g;this._logLevel<=i.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,c,f)}info(c,...f){var g;this._logLevel<=i.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,c,f)}warn(c,...f){var g;this._logLevel<=i.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,c,f)}error(c,...f){var g;this._logLevel<=i.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,c,f)}};o.LogService=m=a([n(0,i.IOptionsService)],m),o.setTraceLogger=function(c){p=c},o.traceCall=function(c,f,g){if(typeof g.value!="function")throw new Error("not supported");const _=g.value;g.value=function(...b){if(p.logLevel!==i.LogLevelEnum.TRACE)return _.apply(this,b);p.trace(`GlyphRenderer#${_.name}(${b.map(C=>JSON.stringify(C)).join(", ")})`);const y=_.apply(this,b);return p.trace(`GlyphRenderer#${_.name} return`,y),y}}},7302:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const a=r(8460),n=r(844),s=r(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:s.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const i=["normal","bold","100","200","300","400","500","600","700","800","900"];class d extends n.Disposable{constructor(m){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...o.DEFAULT_OPTIONS};for(const f in m)if(f in c)try{const g=m[f];c[f]=this._sanitizeAndValidateOption(f,g)}catch(g){console.error(g)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,n.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(m,c){return this.onOptionChange(f=>{f===m&&c(this.rawOptions[m])})}onMultipleOptionChange(m,c){return this.onOptionChange(f=>{m.indexOf(f)!==-1&&c()})}_setupOptions(){const m=f=>{if(!(f in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},c=(f,g)=>{if(!(f in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);g=this._sanitizeAndValidateOption(f,g),this.rawOptions[f]!==g&&(this.rawOptions[f]=g,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const g={get:m.bind(this,f),set:c.bind(this,f)};Object.defineProperty(this.options,f,g)}}_sanitizeAndValidateOption(m,c){switch(m){case"cursorStyle":if(c||(c=o.DEFAULT_OPTIONS[m]),!function(f){return f==="block"||f==="underline"||f==="bar"}(c))throw new Error(`"${c}" is not a valid value for ${m}`);break;case"wordSeparator":c||(c=o.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=i.includes(c)?c:o.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}}o.OptionsService=d},2660:function(v,o,r){var a=this&&this.__decorate||function(d,p,m,c){var f,g=arguments.length,_=g<3?p:c===null?c=Object.getOwnPropertyDescriptor(p,m):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,p,m,c);else for(var b=d.length-1;b>=0;b--)(f=d[b])&&(_=(g<3?f(_):g>3?f(p,m,_):f(p,m))||_);return g>3&&_&&Object.defineProperty(p,m,_),_},n=this&&this.__param||function(d,p){return function(m,c){p(m,c,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const s=r(2585);let i=o.OscLinkService=class{constructor(d){this._bufferService=d,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(d){const p=this._bufferService.buffer;if(d.id===void 0){const b=p.addMarker(p.ybase+p.y),y={data:d,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(y,b)),this._dataByLinkId.set(y.id,y),y.id}const m=d,c=this._getEntryIdKey(m),f=this._entriesWithId.get(c);if(f)return this.addLineToLink(f.id,p.ybase+p.y),f.id;const g=p.addMarker(p.ybase+p.y),_={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[g]};return g.onDispose(()=>this._removeMarkerFromLink(_,g)),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(d,p){const m=this._dataByLinkId.get(d);if(m&&m.lines.every(c=>c.line!==p)){const c=this._bufferService.buffer.addMarker(p);m.lines.push(c),c.onDispose(()=>this._removeMarkerFromLink(m,c))}}getLinkData(d){var p;return(p=this._dataByLinkId.get(d))==null?void 0:p.data}_getEntryIdKey(d){return`${d.id};;${d.uri}`}_removeMarkerFromLink(d,p){const m=d.lines.indexOf(p);m!==-1&&(d.lines.splice(m,1),d.lines.length===0&&(d.data.id!==void 0&&this._entriesWithId.delete(d.key),this._dataByLinkId.delete(d.id)))}};o.OscLinkService=i=a([n(0,s.IBufferService)],i)},8343:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const r="di$target",a="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(n){return n[a]||[]},o.createDecorator=function(n){if(o.serviceRegistry.has(n))return o.serviceRegistry.get(n);const s=function(i,d,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,c,f){c[r]===c?c[a].push({id:m,index:f}):(c[a]=[{id:m,index:f}],c[r]=c)})(s,i,p)};return s.toString=()=>n,o.serviceRegistry.set(n,s),s}},2585:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const a=r(8343);var n;o.IBufferService=(0,a.createDecorator)("BufferService"),o.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),o.ICoreService=(0,a.createDecorator)("CoreService"),o.ICharsetService=(0,a.createDecorator)("CharsetService"),o.IInstantiationService=(0,a.createDecorator)("InstantiationService"),function(s){s[s.TRACE=0]="TRACE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARN=3]="WARN",s[s.ERROR=4]="ERROR",s[s.OFF=5]="OFF"}(n||(o.LogLevelEnum=n={})),o.ILogService=(0,a.createDecorator)("LogService"),o.IOptionsService=(0,a.createDecorator)("OptionsService"),o.IOscLinkService=(0,a.createDecorator)("OscLinkService"),o.IUnicodeService=(0,a.createDecorator)("UnicodeService"),o.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(v,o,r)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const a=r(8460),n=r(225);class s{static extractShouldJoin(d){return(1&d)!=0}static extractWidth(d){return d>>1&3}static extractCharKind(d){return d>>3}static createPropertyValue(d,p,m=!1){return(16777215&d)<<3|(3&p)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;const d=new n.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let p=0,m=0;const c=d.length;for(let f=0;f<c;++f){let g=d.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=c)return p+this.wcwidth(g);const y=d.charCodeAt(f);56320<=y&&y<=57343?g=1024*(g-55296)+y-56320+65536:p+=this.wcwidth(y)}const _=this.charProperties(g,m);let b=s.extractWidth(_);s.extractShouldJoin(_)&&(b-=s.extractWidth(m)),p+=b,m=_}return p}charProperties(d,p){return this._activeProvider.charProperties(d,p)}}o.UnicodeService=s}},t={};function l(v){var o=t[v];if(o!==void 0)return o.exports;var r=t[v]={exports:{}};return e[v].call(r.exports,r,r.exports,l),r.exports}var h={};return(()=>{var v=h;Object.defineProperty(v,"__esModule",{value:!0}),v.Terminal=void 0;const o=l(9042),r=l(3236),a=l(844),n=l(5741),s=l(8285),i=l(7975),d=l(7090),p=["cols","rows"];class m extends a.Disposable{constructor(f){super(),this._core=this.register(new r.Terminal(f)),this._addonManager=this.register(new n.AddonManager),this._publicOptions={...this._core.options};const g=b=>this._core.options[b],_=(b,y)=>{this._checkReadonlyOptions(b),this._core.options[b]=y};for(const b in this._core.options){const y={get:g.bind(this,b),set:_.bind(this,b)};Object.defineProperty(this._publicOptions,b,y)}}_checkReadonlyOptions(f){if(p.includes(f))throw new Error(`Option "${f}" 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 i.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new s.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const g in f)this._publicOptions[g]=f[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(f,g=!0){this._core.input(f,g)}resize(f,g){this._verifyIntegers(f,g),this._core.resize(f,g)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,g,_){this._verifyIntegers(f,g,_),this._core.select(f,g,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,g){this._verifyIntegers(f,g),this._core.selectLines(f,g)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,g){this._core.write(f,g)}writeln(f,g){this._core.write(f),this._core.write(`\r
|
|
@@ -6537,6 +6535,8 @@ Open Dashboard to configure it`)},O=function(){var W;const oe=(0,U.getContext)()
|
|
|
6537
6535
|
.w-full {
|
|
6538
6536
|
width: 100%;
|
|
6539
6537
|
}
|
|
6540
|
-
`},"./src/client/utils.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getContext=o,e.setContext=r,e.closeOutput=a,e.formatDate=n,e.formatDateWithTimeAgo=s;const l=t("./src/utils/messaging.ts"),h=t("./src/constants.ts");let v;function o(){if(!v)throw new Error("Renderer context not defined");return v}function r(i){v=i}function a({id:i,outputType:d}){const p=o();p.postMessage&&(0,l.postClientMessage)(p,h.ClientMessages.closeCellOutput,{id:i,outputType:d})}function n(i){return i.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function s(i){const p=new Date().getTime()-i.getTime(),m=Math.floor(p/1e3)*-1,c=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(m)<60?c.format(Math.round(m),"second"):Math.abs(m)<3600?c.format(Math.round(m/60),"minute"):Math.abs(m)<86400?c.format(Math.round(m/3600),"hour"):c.format(Math.round(m/86400),"day")}},"./src/constants.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RUNME_FRONTMATTER_PARSED=e.PLATFORM_USER_SIGNED_IN=e.GITHUB_USER_SIGNED_IN=e.SAVE_CELL_LOGIN_CONSENT_STORAGE_KEY=e.CELL_CREATION_DATE_STORAGE_KEY=e.EXECUTION_CELL_STORAGE_KEY=e.FOCUS_CELL_STORAGE_KEY=e.CATEGORY_SEPARATOR=e.WebViews=e.TELEMETRY_EVENTS=e.EXTENSION_NAME=e.SUPPORTED_FILE_EXTENSIONS=e.LANGUAGE_PREFIXES=e.NOTEBOOK_ENV_VAR_MODE=e.NOTEBOOK_AUTHOR_MODE_ON=e.NOTEBOOK_RUN_WITH_PROMPTS=e.NOTEBOOK_PREVIEW_OUTPUTS=e.NOTEBOOK_MODE=e.NOTEBOOK_OUTPUTS_MASKED=e.NOTEBOOK_LIFECYCLE_ID=e.NOTEBOOK_AUTOSAVE_ON=e.NOTEBOOK_HAS_CATEGORIES=e.NOTEBOOK_AVAILABLE_CATEGORIES=e.NotebookMode=e.AuthenticationProviders=e.RENDERERS=e.DEFAULT_PROMPT_ENV=e.SERVER_PORT=e.SERVER_ADDRESS=e.DEFAULT_LANGUAGEID=e.VSCODE_LANGUAGEID_MAP=e.LANGUAGES=e.LANGID_AND_EXTENSIONS=e.LANG_IDS_WITH_DESTINATION=e.ClientMessages=e.OutputType=void 0;var t;(function(n){n.vercel="stateful.runme/vercel-stdout",n.deno="stateful.runme/deno-stdout",n.outputItems="stateful.runme/output-items",n.annotations="stateful.runme/annotations",n.terminal="stateful.runme/terminal",n.error="stateful.runme/error",n.github="stateful.runme/github-stdout",n.stdout="application/vnd.code.notebook.stdout",n.gcp="stateful.runme/gcp",n.aws="stateful.runme/aws",n.daggerCall="stateful.runme/dagger",n.daggerShell="stateful.runme/dagger"})(t||(e.OutputType=t={}));var l;(function(n){n.infoMessage="common:infoMessage",n.errorMessage="common:errorMessage",n.closeCellOutput="common:closeCellOutput",n.displayPrompt="common:displayPrompt",n.onPrompt="common:onPrompt",n.setState="common:setState",n.getState="common:getState",n.onGetState="common:onGetState",n.onCategoryChange="common:onCategoryChange",n.platformApiRequest="common:platformApiRequest",n.platformApiResponse="common:platformApiResponse",n.optionsMessage="common:optionsMessage",n.optionsModal="common:optionsModal",n.openExternalLink="common:openExternalLink",n.onOptionsMessage="common:onOptionsMessage",n.copyTextToClipboard="common:copyTextToClipboard",n.onCopyTextToClipboard="common:onCopyTextToClipboard",n.onProgramClose="common:onProgramClose",n.denoUpdate="deno:deploymentUpdate",n.denoPromote="deno:promoteDeployment",n.vercelProd="vercel:promotePreview",n.mutateAnnotations="annotations:mutate",n.terminalStdout="terminal:stdout",n.terminalStderr="terminal:stderr",n.terminalStdin="terminal:stdin",n.terminalResize="terminal:resize",n.terminalFocus="terminal:focus",n.terminalOpen="terminal:open",n.openLink="terminal:openLink",n.activeThemeChanged="theme:changed",n.githubWorkflowDispatch="github:workflowDispatch",n.githubWorkflowDeploy="github:workflowDeploy",n.githubWorkflowStatusUpdate="github:workflowStatusUpdate",n.tangleEvent="tangle:event",n.gcpResourceStatusChanged="gcp:resourceStatusChanged",n.gcpClusterCheckStatus="gcp:clusterCheckStatus",n.gcpClusterDetails="gcp:clusterDetails",n.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",n.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",n.gcpVMInstanceAction="gcp:gceVMInstanceAction",n.awsEC2Instances="aws:ec2Instances",n.awsEC2InstanceAction="aws:ec2InstanceAction",n.awsEKSClusterAction="aws:eksClusterAction",n.onAuthorModeChange="common:onAuthorModeChange",n.gistCell="gist:cell",n.gcpCloudRunAction="gcp:cloudRunAction",n.gcpLoadServices="gcp:loadServices",n.gcpServicesLoaded="gcp:servicesLoaded",n.daggerSyncState="dagger:syncState",n.daggerCliAction="dagger:cliAction",n.featuresUpdateAction="features:updateAction",n.featuresRequest="features:request",n.featuresResponse="features:response"})(l||(e.ClientMessages=l={})),e.LANG_IDS_WITH_DESTINATION=[["Assembly","asm","sh"],["Batchfile","bat","sh"],["C","c",void 0],["C#","cs",void 0],["C++","cpp",void 0],["Cpp","cpp",void 0],["Clojure","clj",void 0],["CMake","cmake","sh"],["COBOL","cbl","null"],["CoffeeScript","coffee","html"],["CSS","css",void 0],["CSV","csv",void 0],["Dart","dart",void 0],["DM","dm",void 0],["Dockerfile","dockerfile","sh"],["Elixir","ex",void 0],["Erlang","erl",void 0],["Fortran","f90",void 0],["Go","go",void 0],["Groovy","groovy",void 0],["Haskell","hs",void 0],["HTML","html",void 0],["INI","ini",void 0],["Java","java",void 0],["JavaScript","js",void 0],["JSON","json",void 0],["JSONC","jsonc",void 0],["Julia","jl",void 0],["Kotlin","kt",void 0],["Lisp","lisp",void 0],["Lua","lua",void 0],["Log","log",void 0],["Makefile","makefile","sh"],["Markdown","md",void 0],["Matlab","matlab",void 0],["Objective-C","mm",void 0],["OCaml","ml",void 0],["Pascal","pas",void 0],["Perl","pm",void 0],["PHP","php",void 0],["PowerShell","ps1",void 0],["Prolog","prolog",void 0],["Python","py",void 0],["R","r",void 0],["Ruby","rb",void 0],["Rust","rs",void 0],["Scala","scala",void 0],["Shell","sh","sh"],["SQL","sql",void 0],["Swift","swift",void 0],["TeX","tex",void 0],["TOML","toml",void 0],["TypeScript","ts",void 0],["Verilog","v",void 0],["Visual Basic","vba",void 0],["XML","xml",void 0],["YAML","yaml",void 0]],e.LANGID_AND_EXTENSIONS=e.LANG_IDS_WITH_DESTINATION.reduce((n,[s,i])=>!s||!i?n:n.set(s.toLocaleLowerCase(),i),new Map),e.LANGUAGES=new Map(e.LANG_IDS_WITH_DESTINATION.map(([,n,s])=>[n,s])),e.VSCODE_LANGUAGEID_MAP={console:"sh",shell:"sh",shellscript:"sh",javascriptreact:"jsx",typescriptreact:"tsx"},e.DEFAULT_LANGUAGEID="shellscript",e.SERVER_ADDRESS="localhost",e.SERVER_PORT=7863,e.DEFAULT_PROMPT_ENV=!0;var h;(function(n){n.VercelOutput="vercel-output",n.DenoOutput="deno-output",n.ShellOutput="shell-output",n.ShellOutputItems="shell-output-items",n.EditAnnotations="edit-annotations",n.TerminalView="terminal-view",n.GitHubWorkflowViewer="github-workflow-viewer",n.GCPView="gcp-view",n.AWSView="aws-view",n.DaggerCli="dagger-cli"})(h||(e.RENDERERS=h={}));var v;(function(n){n.GitHub="github",n.Stateful="stateful"})(v||(e.AuthenticationProviders=v={}));var o;(function(n){n.Execution="execution",n.SessionOutputs="sessionOutputs"})(o||(e.NotebookMode=o={})),e.NOTEBOOK_AVAILABLE_CATEGORIES="notebookAvailableCategories",e.NOTEBOOK_HAS_CATEGORIES="notebookHasCategories",e.NOTEBOOK_AUTOSAVE_ON="notebookAutoSaveOn",e.NOTEBOOK_LIFECYCLE_ID="notebookLifecycleId",e.NOTEBOOK_OUTPUTS_MASKED="notebookOutputsMasked",e.NOTEBOOK_MODE="notebookMode",e.NOTEBOOK_PREVIEW_OUTPUTS="notebookPreviewRunmeOutputs",e.NOTEBOOK_RUN_WITH_PROMPTS="notebookRunWithPrompts",e.NOTEBOOK_AUTHOR_MODE_ON="notebookAuthorModeOn",e.NOTEBOOK_ENV_VAR_MODE="notebookEnvVarMode",e.LANGUAGE_PREFIXES={abap:"ABAP",asc:"Public Key",ash:"AGS Script",ampl:"AMPL",mod:"XML",g4:"ANTLR",apib:"API Blueprint",apl:"APL",dyalog:"APL",asp:"ASP",asax:"ASP",ascx:"ASP",ashx:"ASP",asmx:"ASP",aspx:"ASP",axd:"ASP",dats:"ATS",hats:"ATS",sats:"ATS",as:"ActionScript",adb:"Ada",ada:"Ada",ads:"Ada",agda:"Agda",als:"Alloy",apacheconf:"ApacheConf",vhost:"Nginx",cls:"Visual Basic",applescript:"AppleScript",scpt:"AppleScript",arc:"Arc",ino:"Arduino",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aj:"AspectJ",asm:"Assembly",a51:"Assembly",inc:"SourcePawn",nasm:"Assembly",aug:"Augeas",ahk:"AutoHotkey",ahkl:"AutoHotkey",au3:"AutoIt",awk:"Awk",auk:"Awk",gawk:"Awk",mawk:"Awk",nawk:"Awk",bat:"Batchfile",cmd:"Batchfile",befunge:"Befunge",bison:"Bison",bb:"BlitzBasic",decls:"BlitzBasic",bmx:"BlitzMax",bsv:"Bluespec",boo:"Boo",b:"Limbo",bf:"HyPhy",brs:"Brightscript",bro:"Bro",c:"C",cats:"C",h:"Objective-C",idc:"C",w:"C",cs:"Smalltalk",cake:"CoffeeScript",cshtml:"C#",csx:"C#",cpp:"C++","c++":"C++",cc:"C++",cp:"Component Pascal",cxx:"C++","h++":"C++",hh:"Hack",hpp:"C++",hxx:"C++",inl:"C++",ipp:"C++",tcc:"C++",tpp:"C++","c-objdump":"C-ObjDump",chs:"C2hs Haskell",clp:"CLIPS",cmake:"CMake","cmake.in":"CMake",cob:"COBOL",cbl:"COBOL",ccp:"COBOL",cobol:"COBOL",cpy:"COBOL",css:"CSS",csv:"CSV",capnp:"Cap'n Proto",mss:"CartoCSS",ceylon:"Ceylon",chpl:"Chapel",ch:"xBase",ck:"ChucK",cirru:"Cirru",clw:"Clarion",icl:"Clean",dcl:"Clean",click:"Click",clj:"Clojure",boot:"Clojure",cl2:"Clojure",cljc:"Clojure",cljs:"Clojure","cljs.hl":"Clojure",cljscm:"Clojure",cljx:"Clojure",hic:"Clojure",coffee:"CoffeeScript",_coffee:"CoffeeScript",cjsx:"CoffeeScript",cson:"CoffeeScript",iced:"CoffeeScript",cfm:"ColdFusion",cfml:"ColdFusion",cfc:"ColdFusion CFC",lisp:"NewLisp",asd:"Common Lisp",cl:"OpenCL",l:"PicoLisp",lsp:"NewLisp",ny:"Common Lisp",podsl:"Common Lisp",sexp:"Common Lisp",cps:"Component Pascal",coq:"Coq",v:"Verilog",cppobjdump:"Cpp-ObjDump","c++-objdump":"Cpp-ObjDump","c++objdump":"Cpp-ObjDump","cpp-objdump":"Cpp-ObjDump","cxx-objdump":"Cpp-ObjDump",creole:"Creole",cr:"Crystal",feature:"Cucumber",cu:"Cuda",cuh:"Cuda",cy:"Cycript",pyx:"Cython",pxd:"Cython",pxi:"Cython",d:"Makefile",di:"D","d-objdump":"D-ObjDump",com:"DIGITAL Command Language",dm:"DM",zone:"DNS Zone",arpa:"DNS Zone",darcspatch:"Darcs Patch",dpatch:"Darcs Patch",dart:"Dart",diff:"Diff",patch:"Diff",dockerfile:"Dockerfile",djs:"Dogescript",dylan:"Dylan",dyl:"Dylan",intr:"Dylan",lid:"Dylan",E:"E",ecl:"ECLiPSe",eclxml:"ECL",sch:"KiCad",brd:"KiCad",epj:"Ecere Projects",e:"Eiffel",ex:"Elixir",exs:"Elixir",elm:"Elm",el:"Emacs Lisp",emacs:"Emacs Lisp","emacs.desktop":"Emacs Lisp",em:"EmberScript",emberscript:"EmberScript",erl:"Erlang",es:"JavaScript",escript:"Erlang",hrl:"Erlang",xrl:"Erlang",yrl:"Erlang",fs:"GLSL",fsi:"F#",fsx:"F#",fx:"HLSL",flux:"FLUX",f90:"FORTRAN",f:"Forth",f03:"FORTRAN",f08:"FORTRAN",f77:"FORTRAN",f95:"FORTRAN",for:"Forth",fpp:"FORTRAN",factor:"Factor",fy:"Fancy",fancypack:"Fancy",fan:"Fantom","eam.fs":"Formatted",fth:"Forth","4th":"Forth",forth:"Forth",fr:"Text",frt:"Forth",ftl:"FreeMarker",g:"GAP",gco:"G-code",gcode:"G-code",gms:"GAMS",gap:"GAP",gd:"GDScript",gi:"GAP",tst:"Scilab",s:"GAS",ms:"MAXScript",glsl:"GLSL",fp:"GLSL",frag:"JavaScript",frg:"GLSL",fsh:"GLSL",fshader:"GLSL",geo:"GLSL",geom:"GLSL",glslv:"GLSL",gshader:"GLSL",shader:"GLSL",vert:"GLSL",vrx:"GLSL",vsh:"GLSL",vshader:"GLSL",gml:"XML",kid:"Genshi",ebuild:"Gentoo Ebuild",eclass:"Gentoo Eclass",po:"Gettext Catalog",pot:"Gettext Catalog",glf:"Glyph",gp:"Gnuplot",gnu:"Gnuplot",gnuplot:"Gnuplot",plot:"Gnuplot",plt:"Gnuplot",go:"Go",golo:"Golo",gs:"JavaScript",gst:"Gosu",gsx:"Gosu",vark:"Gosu",grace:"Grace",gradle:"Gradle",gf:"Grammatical Framework",graphql:"GraphQL",dot:"Graphviz (DOT)",gv:"Graphviz (DOT)",man:"Groff","1in":"Groff","1m":"Groff","1x":"Groff","3in":"Groff","3m":"Groff","3qt":"Groff","3x":"Groff",me:"Groff",n:"Nemerle",rno:"Groff",roff:"Groff",groovy:"Groovy",grt:"Groovy",gtpl:"Groovy",gvy:"Groovy",gsp:"Groovy Server Pages",hcl:"HCL",tf:"HCL",hlsl:"HLSL",fxh:"HLSL",hlsli:"HLSL",html:"HTML",htm:"HTML","html.hl":"HTML",st:"Smalltalk",xht:"HTML",xhtml:"HTML",mustache:"HTML+Django",jinja:"HTML+Django",eex:"HTML+EEX",erb:"HTML+ERB","erb.deface":"HTML+ERB",phtml:"HTML+PHP",http:"HTTP",php:"PHP",haml:"Haml","haml.deface":"Haml",handlebars:"Handlebars",hbs:"Handlebars",hb:"Harbour",hs:"Haskell",hsc:"Haskell",hx:"Haxe",hxsl:"Haxe",hy:"Hy",pro:"QMake",dlm:"IDL",ipf:"IGOR Pro",ini:"INI",cfg:"INI",prefs:"INI",properties:"INI",irclog:"IRC log",weechatlog:"IRC log",idr:"Idris",lidr:"Idris",ni:"Inform 7",i7x:"Inform 7",iss:"Inno Setup",io:"Io",ik:"Ioke",thy:"Isabelle",ijs:"J",flex:"JFlex",jflex:"JFlex",json:"JSON",geojson:"JSON",lock:"JSON",topojson:"JSON",json5:"JSON5",jsonld:"JSONLD",jq:"JSONiq",jsx:"JSX",jade:"Jade",j:"Objective-J",java:"Java",jsp:"Java Server Pages",js:"JavaScript",_js:"JavaScript",bones:"JavaScript",es6:"JavaScript",jake:"JavaScript",jsb:"JavaScript",jscad:"JavaScript",jsfl:"JavaScript",jsm:"JavaScript",jss:"JavaScript",njs:"JavaScript",pac:"JavaScript",sjs:"JavaScript",ssjs:"JavaScript","sublime-build":"JavaScript","sublime-commands":"JavaScript","sublime-completions":"JavaScript","sublime-keymap":"JavaScript","sublime-macro":"JavaScript","sublime-menu":"JavaScript","sublime-mousemap":"JavaScript","sublime-project":"JavaScript","sublime-settings":"JavaScript","sublime-theme":"JavaScript","sublime-workspace":"JavaScript",sublime_metrics:"JavaScript",sublime_session:"JavaScript",xsjs:"JavaScript",xsjslib:"JavaScript",jl:"Julia",ipynb:"Jupyter Notebook",krl:"KRL",kicad_pcb:"KiCad",kit:"Kit",kt:"Kotlin",ktm:"Kotlin",kts:"Kotlin",lfe:"LFE",ll:"LLVM",lol:"LOLCODE",lsl:"LSL",lslp:"LSL",lvproj:"LabVIEW",lasso:"Lasso",las:"Lasso",lasso8:"Lasso",lasso9:"Lasso",ldml:"Lasso",latte:"Latte",lean:"Lean",hlean:"Lean",less:"Less",lex:"Lex",ly:"LilyPond",ily:"LilyPond",m:"Objective-C",ld:"Linker Script",lds:"Linker Script",liquid:"Liquid",lagda:"Literate Agda",litcoffee:"Literate CoffeeScript",lhs:"Literate Haskell",ls:"LoomScript",_ls:"LiveScript",xm:"Logos",x:"Logos",xi:"Logos",lgt:"Logtalk",logtalk:"Logtalk",lookml:"LookML",lua:"Lua",fcgi:"Shell",nse:"Lua",pd_lua:"Lua",rbxs:"Lua",wlua:"Lua",mumps:"M",m4:"M4Sugar",mcr:"MAXScript",mtml:"MTML",muf:"MUF",mak:"Makefile",mk:"Makefile",mkfile:"Makefile",mako:"Mako",mao:"Mako",md:"Markdown",markdown:"Markdown",mkd:"Markdown",mkdn:"Markdown",mkdown:"Markdown",ron:"Markdown",mask:"Mask",mathematica:"Mathematica",cdf:"Mathematica",ma:"Mathematica",mt:"Mathematica",nb:"Text",nbp:"Mathematica",wl:"Mathematica",wlt:"Mathematica",matlab:"Matlab",maxpat:"Max",maxhelp:"Max",maxproj:"Max",mxt:"Max",pat:"Max",mediawiki:"MediaWiki",wiki:"MediaWiki",moo:"Moocode",metal:"Metal",minid:"MiniD",druby:"Mirah",duby:"Mirah",mir:"Mirah",mirah:"Mirah",mo:"Modelica",mms:"Module Management System",mmk:"Module Management System",monkey:"Monkey",moon:"MoonScript",myt:"Myghty",ncl:"Text",nl:"NewLisp",nsi:"NSIS",nsh:"NSIS",axs:"NetLinx",axi:"NetLinx","axs.erb":"NetLinx+ERB","axi.erb":"NetLinx+ERB",nlogo:"NetLogo",nginxconf:"Nginx",nim:"Nimrod",nimrod:"Nimrod",ninja:"Ninja",nit:"Nit",nix:"Nix",nu:"Nu",numpy:"NumPy",numpyw:"NumPy",numsc:"NumPy",ml:"OCaml",eliom:"OCaml",eliomi:"OCaml",ml4:"OCaml",mli:"OCaml",mll:"OCaml",mly:"OCaml",objdump:"ObjDump",mm:"XML",sj:"Objective-J",omgrofl:"Omgrofl",opa:"Opa",opal:"Opal",opencl:"OpenCL",p:"OpenEdge ABL",scad:"OpenSCAD",org:"Org",ox:"Ox",oxh:"Ox",oxo:"Ox",oxygene:"Oxygene",oz:"Oz",pwn:"PAWN",aw:"PHP",ctp:"PHP",php3:"PHP",php4:"PHP",php5:"PHP",phps:"PHP",phpt:"PHP",pls:"PLSQL",pck:"PLSQL",pkb:"PLSQL",pks:"PLSQL",plb:"PLSQL",plsql:"PLSQL",sql:"SQLPL",pov:"POV-Ray SDL",pan:"Pan",psc:"Papyrus",parrot:"Parrot",pasm:"Parrot Assembly",pir:"Parrot Internal Representation",pas:"Pascal",dfm:"Pascal",dpr:"Pascal",lpr:"Pascal",pp:"Puppet",pl:"Prolog",al:"Perl",cgi:"Shell",perl:"Perl",ph:"Perl",plx:"Perl",pm:"Perl6",pod:"Pod",psgi:"Perl",t:"Turing","6pl":"Perl6","6pm":"Perl6",nqp:"Perl6",p6:"Perl6",p6l:"Perl6",p6m:"Perl6",pl6:"Perl6",pm6:"Perl6",pkl:"Pickle",pig:"PigLatin",pike:"Pike",pmod:"Pike",pogo:"PogoScript",pony:"Pony",ps:"PostScript",eps:"PostScript",ps1:"PowerShell",psd1:"PowerShell",psm1:"PowerShell",pde:"Processing",prolog:"Prolog",yap:"Prolog",spin:"Propeller Spin",proto:"Protocol Buffer",pub:"Public Key",pd:"Pure Data",pb:"PureBasic",pbi:"PureBasic",purs:"PureScript",py:"Python",bzl:"Python",gyp:"Python",lmi:"Python",pyde:"Python",pyp:"Python",pyt:"Python",pyw:"Python",rpy:"Ren'Py",tac:"Python",wsgi:"Python",xpy:"Python",pytb:"Python traceback",qml:"QML",qbs:"QML",pri:"QMake",r:"Rebol",rd:"R",rsx:"R",raml:"RAML",rdoc:"RDoc",rbbas:"REALbasic",rbfrm:"REALbasic",rbmnu:"REALbasic",rbres:"REALbasic",rbtbar:"REALbasic",rbuistate:"REALbasic",rhtml:"RHTML",rmd:"RMarkdown",rkt:"Racket",rktd:"Racket",rktl:"Racket",scrbl:"Racket",rl:"Ragel in Ruby Host",raw:"Raw token data",reb:"Rebol",r2:"Rebol",r3:"Rebol",rebol:"Rebol",red:"Red",reds:"Red",cw:"Redcode",rs:"Rust",rsh:"RenderScript",robot:"RobotFramework",rg:"Rouge",rb:"Ruby",builder:"Ruby",gemspec:"Ruby",god:"Ruby",irbrc:"Ruby",jbuilder:"Ruby",mspec:"Ruby",pluginspec:"XML",podspec:"Ruby",rabl:"Ruby",rake:"Ruby",rbuild:"Ruby",rbw:"Ruby",rbx:"Ruby",ru:"Ruby",ruby:"Ruby",thor:"Ruby",watchr:"Ruby","rs.in":"Rust",sas:"SAS",scss:"SCSS",smt2:"SMT",smt:"SMT",sparql:"SPARQL",rq:"SPARQL",sqf:"SQF",hqf:"SQF",cql:"SQL",ddl:"SQL",prc:"SQL",tab:"SQL",udf:"SQL",viw:"SQL",db2:"SQLPL",ston:"STON",svg:"SVG",sage:"Sage",sagews:"Sage",sls:"Scheme",sass:"Sass",scala:"Scala",sbt:"Scala",sc:"SuperCollider",scaml:"Scaml",scm:"Scheme",sld:"Scheme",sps:"Scheme",ss:"Scheme",sci:"Scilab",sce:"Scilab",self:"Self",sh:"Shell",bash:"Shell",bats:"Shell",command:"Shell",ksh:"Shell","sh.in":"Shell",tmux:"Shell",tool:"Shell",zsh:"Shell","sh-session":"ShellSession",shen:"Shen",sl:"Slash",slim:"Slim",smali:"Smali",tpl:"Smarty",sp:"SourcePawn",sma:"SourcePawn",nut:"Squirrel",stan:"Stan",ML:"Standard ML",fun:"Standard ML",sig:"Standard ML",sml:"Standard ML",do:"Stata",ado:"Stata",doh:"Stata",ihlp:"Stata",mata:"Stata",matah:"Stata",sthlp:"Stata",styl:"Stylus",scd:"SuperCollider",swift:"Swift",sv:"SystemVerilog",svh:"SystemVerilog",vh:"SystemVerilog",toml:"TOML",txl:"TXL",tcl:"Tcl",adp:"Tcl",tm:"Tcl",tcsh:"Tcsh",csh:"Tcsh",tex:"TeX",aux:"TeX",bbx:"TeX",bib:"TeX",cbx:"TeX",dtx:"TeX",ins:"TeX",lbx:"TeX",ltx:"TeX",mkii:"TeX",mkiv:"TeX",mkvi:"TeX",sty:"TeX",toc:"TeX",tea:"Tea",txt:"Text",no:"Text",textile:"Textile",thrift:"Thrift",tu:"Turing",ttl:"Turtle",twig:"Twig",ts:"typescript",tsx:"typescriptreact",upc:"Unified Parallel C",anim:"Unity3D Asset",asset:"Unity3D Asset",mat:"Unity3D Asset",meta:"Unity3D Asset",prefab:"Unity3D Asset",unity:"Unity3D Asset",uno:"Uno",uc:"UnrealScript",ur:"UrWeb",urs:"UrWeb",vcl:"VCL",vhdl:"VHDL",vhd:"VHDL",vhf:"VHDL",vhi:"VHDL",vho:"VHDL",vhs:"VHDL",vht:"VHDL",vhw:"VHDL",vala:"Vala",vapi:"Vala",veo:"Verilog",vim:"VimL",vb:"Visual Basic",bas:"Visual Basic",frm:"Visual Basic",frx:"Visual Basic",vba:"Visual Basic",vbhtml:"Visual Basic",vbs:"Visual Basic",volt:"Volt",vue:"Vue",owl:"Web Ontology Language",webidl:"WebIDL",x10:"X10",xc:"XC",xml:"XML",ant:"XML",axml:"XML",ccxml:"XML",clixml:"XML",cproject:"XML",csl:"XML",csproj:"XML",ct:"XML",dita:"XML",ditamap:"XML",ditaval:"XML","dll.config":"XML",dotsettings:"XML",filters:"XML",fsproj:"XML",fxml:"XML",glade:"XML",grxml:"XML",iml:"XML",ivy:"XML",jelly:"XML",jsproj:"XML",kml:"XML",launch:"XML",mdpolicy:"XML",mxml:"XML",nproj:"XML",nuspec:"XML",odd:"XML",osm:"XML",plist:"XML",props:"XML",ps1xml:"XML",psc1:"XML",pt:"XML",rdf:"XML",rss:"XML",scxml:"XML",srdf:"XML",storyboard:"XML",stTheme:"XML","sublime-snippet":"XML",targets:"XML",tmCommand:"XML",tml:"XML",tmLanguage:"XML",tmPreferences:"XML",tmSnippet:"XML",tmTheme:"XML",ui:"XML",urdf:"XML",ux:"XML",vbproj:"XML",vcxproj:"XML",vssettings:"XML",vxml:"XML",wsdl:"XML",wsf:"XML",wxi:"XML",wxl:"XML",wxs:"XML",x3d:"XML",xacro:"XML",xaml:"XML",xib:"XML",xlf:"XML",xliff:"XML",xmi:"XML","xml.dist":"XML",xproj:"XML",xsd:"XML",xul:"XML",zcml:"XML","xsp-config":"XPages","xsp.metadata":"XPages",xpl:"XProc",xproc:"XProc",xquery:"XQuery",xq:"XQuery",xql:"XQuery",xqm:"XQuery",xqy:"XQuery",xs:"XS",xslt:"XSLT",xsl:"XSLT",xojo_code:"Xojo",xojo_menu:"Xojo",xojo_report:"Xojo",xojo_script:"Xojo",xojo_toolbar:"Xojo",xojo_window:"Xojo",xtend:"Xtend",yml:"YAML",reek:"YAML",rviz:"YAML","sublime-syntax":"YAML",syntax:"YAML",yaml:"YAML","yaml-tmlanguage":"YAML",yang:"YANG",y:"Yacc",yacc:"Yacc",yy:"Yacc",zep:"Zephir",zimpl:"Zimpl",zmpl:"Zimpl",zpl:"Zimpl",desktop:"desktop","desktop.in":"desktop",ec:"eC",eh:"eC",edn:"edn",fish:"fish",mu:"mupad",nc:"nesC",ooc:"ooc",rst:"reStructuredText",rest:"reStructuredText","rest.txt":"reStructuredText","rst.txt":"reStructuredText",wisp:"wisp",prg:"xBase",prw:"xBase"},e.SUPPORTED_FILE_EXTENSIONS=["sh","bash","ksh","zsh","fish","bat","cmd","pwsh",...Object.keys(e.LANGUAGE_PREFIXES)],e.EXTENSION_NAME="stateful.runme";var r;(function(n){n.RecommendExtension="runme.recommendExtension",n.NotebookGist="runme.notebookGist",n.CellGist="runme.cellGist",n.ShellWarning="extension.shellWarning",n.OpenWorkspace="cloud.OpenWorkspace"})(r||(e.TELEMETRY_EVENTS=r={}));var a;(function(n){n.RunmeCloud="runme.cloud",n.RunmeChat="runme.chat",n.RunmeSearch="runme.search",n.NotebookEnvStore="runme.notebook.envStore"})(a||(e.WebViews=a={})),e.CATEGORY_SEPARATOR=",",e.FOCUS_CELL_STORAGE_KEY="focusCell",e.EXECUTION_CELL_STORAGE_KEY="executionCell",e.CELL_CREATION_DATE_STORAGE_KEY="cellCreationDate",e.SAVE_CELL_LOGIN_CONSENT_STORAGE_KEY="loginConsent",e.GITHUB_USER_SIGNED_IN="userSignedIn",e.PLATFORM_USER_SIGNED_IN="platformUserSignedIn",e.RUNME_FRONTMATTER_PARSED="runme.dev/frontmatterParsed"},"./src/extension/grpc/runner/v1.ts":function(u,e,t){var l=this&&this.__createBinding||(Object.create?function(v,o,r,a){a===void 0&&(a=r);var n=Object.getOwnPropertyDescriptor(o,r);(!n||("get"in n?!o.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(v,a,n)}:function(v,o,r,a){a===void 0&&(a=r),v[a]=o[r]}),h=this&&this.__exportStar||function(v,o){for(var r in v)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&l(o,v,r)};Object.defineProperty(e,"__esModule",{value:!0}),h(t("./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/runme/runner/v1/runner_pb.js"),e)},"./src/extension/resolvers/awsResolver.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AWSResolver=e.AWSSupportedView=void 0;var t;(function(h){h.EC2Instances="ec2Instances",h.EC2InstanceDetails="ec2InstanceDetails",h.EKSClusters="eksClusters"})(t||(e.AWSSupportedView=t={}));class l{constructor(v){var r;this.cellText=v,this.supportedFeatures=new Map,this.supportedFeatures.set("/ec2/details",{view:t.EC2InstanceDetails,data:{urlRegex:/ec2\/home[?]?region=[^#]+#InstanceDetails:instanceId=([^\s&]+)/,region:"",instanceId:""}}),this.supportedFeatures.set("/ec2/home",{view:t.EC2Instances,data:{region:""}}),this.supportedFeatures.set("/eks/home",{view:t.EKSClusters,data:{region:""}});const o=this.cellText;if(o.includes("console.aws.amazon.com")){const a=new URL(o);let n=null;for(const[s,i]of this.supportedFeatures)if((r=i.data.urlRegex)!=null&&r.test(o)||s===a.pathname){n=i;break}if(n){if(n.data.urlRegex&&n.data){if(n.view===t.EC2InstanceDetails){const i=/instanceId=([^&]+)/.exec(a.toString());i&&(n.data.instanceId=i[0].split("=")[1]);const d=/region=([^&]+)/.exec(a.toString());d&&(n.data.region=d[1].split("#")[0])}const s=n.data.urlRegex.exec(a.pathname);if(s){const[,...i]=s;Object.keys(n.data).forEach((d,p)=>{n.data[d]=i[p]})}}if(n.view===t.EKSClusters){const s=/clusters\/([^&]+)/.exec(a.toString());if(s){const[,i]=s;n.data.cluster=i}}n.data.region=a.searchParams.get("region"),this.resolvedFeature={...n}}}}match(){return!!this.resolvedFeature}get(){return this.resolvedFeature}dispose(){this.supportedFeatures.clear()}}e.AWSResolver=l},"./src/extension/resolvers/gcpResolver.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPResolver=e.GCPSupportedView=void 0;var t;(function(h){h.CLUSTERS="clusters",h.CLUSTER="cluster",h.VM_INSTANCES="vm_instances",h.VM_INSTANCE="vm_instance",h.CLOUD_RUN_SERVICES="cloud_run_services",h.CLOUD_RUN_REVISIONS="cloud_run_revisions"})(t||(e.GCPSupportedView=t={}));class l{constructor(v){var r;this.cellText=v,this.supportedFeatures=new Map,this.supportedFeatures.set("/kubernetes/list/overview",{view:t.CLUSTERS,data:{project:""}}),this.supportedFeatures.set("/kubernetes/clusters/details",{view:t.CLUSTER,data:{location:"",cluster:"",urlRegex:/kubernetes\/clusters\/details\/([^/]+)\/([^/]+)\/details/,project:""}}),this.supportedFeatures.set("/compute/instances",{view:t.VM_INSTANCES,data:{urlRegex:/compute\/instances[?]project=.+/,project:""}}),this.supportedFeatures.set("/compute/instancesDetail",{view:t.VM_INSTANCE,data:{urlRegex:/compute\/instancesDetail\/zones\/([^/]+)\/instances\/([^/]+)(\?project=(.+))?/,location:"",instance:"",project:""}}),this.supportedFeatures.set("/run",{view:t.CLOUD_RUN_SERVICES,data:{urlRegex:/run[?]project=.+/,project:""}}),this.supportedFeatures.set("/revisions",{view:t.CLOUD_RUN_REVISIONS,data:{urlRegex:/^\/run\/detail\/([^/]+)\/([^/]+)\/revisions$/,region:"",service:""}});const o=this.cellText;if(o.startsWith("https://console.cloud.google.com")){const a=new URL(o);let n=null;for(const[s,i]of this.supportedFeatures)if((r=i.data.urlRegex)!=null&&r.test(a.pathname)||s===a.pathname){n=i;break}if(n){if(n.data.urlRegex&&n.data){const s=n.data.urlRegex.exec(a.pathname);if(s){const[,...i]=s;Object.keys(n.data).filter(d=>d!=="urlRegex").forEach((d,p)=>{n.data[d]=i[p]})}}n.data.project=a.searchParams.get("project"),this.resolvedFeature={...n}}}}match(){return!!this.resolvedFeature}get(){return this.resolvedFeature}dispose(){this.supportedFeatures.clear()}}e.GCPResolver=l},"./src/features.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES_CONTEXT_STATE_KEY=void 0;const l=t("./node_modules/rxjs/dist/cjs/index.js"),h=t("./node_modules/semver/index.js");e.FEATURES_CONTEXT_STATE_KEY="features";function v(_){var y;return((y=_==null?void 0:_.runme)==null?void 0:y.features)||{}}function o(_,b,y=new Map){const C=v(_),S=new l.BehaviorSubject({features:C,context:b});return p(S,b,y),S}function r(_,b){return b!==void 0?b===!0:_===!0}function a(_,b){return!_||_==="All"||b===_}function n(_,b){return!_||!b?!0:(0,h.satisfies)(b,_)}function s(_,b){return _?!!b:!0}function i(_,b){return _?b?_[b]===!0:!1:!0}function d(_,b,y,C=new Map){const{os:S,vsCodeVersion:E,runmeVersion:j,extensionVersion:O,githubAuthRequired:I,statefulAuthRequired:T,enabledForExtensions:x}=b.conditions;return!(!r(b.enabled,C.get(_))||!a(S,y==null?void 0:y.os)||!n(E,y==null?void 0:y.vsCodeVersion)||!n(j,y==null?void 0:y.runmeVersion)||!n(O,y==null?void 0:y.extensionVersion)||!s(I,y==null?void 0:y.githubAuth)||!s(T,y==null?void 0:y.statefulAuth)||!i(x,y==null?void 0:y.extensionId))}function p(_,b,y=new Map){const C=_.getValue(),S=Object.entries(C.features).reduce((E,[j,O])=>({...E,[j]:{...O,on:d(j,O,b,y)}}),{});return _.next({features:S,context:b}),_}function m(_,b,y,C){var j;if(!_)return;const S=_.getValue(),E={...S.context||{},[b]:y};E[b]!==((j=S==null?void 0:S.context)==null?void 0:j[b])&&p(_,E,C)}function c(_){return _?JSON.stringify(_.getValue()):""}function f(_){const{features:b,context:y}=JSON.parse(_),C=new l.BehaviorSubject({features:b,context:y});return C.next({features:b,context:C.getValue().context}),C}function g(_,b){if(!b)return!1;const y=b.getValue().features[_];return(y==null?void 0:y.on)??!1}e.default={loadState:o,updateState:p,updateContext:m,getSnapshot:c,loadSnapshot:f,isOn:g}},"./src/schema.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellAnnotationsSchema=e.SafeNotebookAnnotationsSchema=e.SafeCellAnnotationsSchema=e.AnnotationSchema=void 0;const l=t("./node_modules/zod/dist/cjs/index.js"),h=t("./src/extension/grpc/runner/v1.ts"),v=(a,n)=>a.trim().replaceAll(/[ ]{2,}/g,"").replaceAll(n,""),o=a=>l.z.preprocess(n=>(typeof n=="string"&&(n=v(n,",")),typeof n=="boolean"?n:typeof n=="string"&&n.toLowerCase()==="false"?!1:typeof n=="string"&&n.toLowerCase()==="true"?!0:a),l.z.boolean()),r=(a,n="expected a boolean value")=>l.z.preprocess(s=>s?(typeof s=="string"&&(s=v(s,",")),typeof s=="string"&&s.toLowerCase()==="false"?!1:typeof s=="string"&&s.toLowerCase()==="true"?!0:s):a,l.z.boolean({invalid_type_error:n}));e.AnnotationSchema={"runme.dev/id":l.z.string().optional(),"runme.dev/name":l.z.string().optional(),"runme.dev/nameGenerated":r(!0).optional(),"runme.dev/fenced":r(!0).optional(),id:l.z.string().optional(),background:r(!1),interactive:r(!0),closeTerminalOnSuccess:r(!0),openTerminalOnError:r(!0),promptEnv:l.z.preprocess(a=>{if(typeof a=="string"&&(a=v(a,",")),typeof a=="boolean"&&!a)return h.ResolveProgramRequest_Mode.SKIP_ALL;if(typeof a=="boolean"&&a)return h.ResolveProgramRequest_Mode.UNSPECIFIED;if(typeof a=="string"&&["false","no","never"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.SKIP_ALL;if(typeof a=="string"&&["true","yes","always"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.PROMPT_ALL;if(typeof a=="string"&&["","auto"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.UNSPECIFIED;if(typeof a=="string"&&a){const n=Number(a);if(Number.isFinite(n))return n}},l.z.nativeEnum(h.ResolveProgramRequest_Mode).default(h.ResolveProgramRequest_Mode.UNSPECIFIED)),excludeFromRunAll:r(!1),terminalRows:l.z.preprocess(a=>{if(typeof a=="string"&&a){const n=Number(a);if(Number.isFinite(n))return n}if(typeof a=="number"&&Number.isFinite(a))return a},l.z.number().int().positive().optional()),name:l.z.preprocess(a=>typeof a=="string"?v(a,","):a,l.z.string().default("")),mimeType:l.z.string().optional().refine(a=>{if(a){const[n,s,...i]=a.split("/");if(!n||!s||i.length)return!1}return!0},"mime type specification invalid format"),interpreter:l.z.string().optional().default(""),cwd:l.z.string().optional().default(""),category:l.z.string().default("")},e.SafeCellAnnotationsSchema=l.z.object({...e.AnnotationSchema,background:o(!1),interactive:o(!0),closeTerminalOnSuccess:o(!0),openTerminalOnError:o(!0)}),e.SafeNotebookAnnotationsSchema=l.z.object({id:l.z.string(),version:l.z.string()}),e.CellAnnotationsSchema=l.z.object({...e.AnnotationSchema})},"./src/types.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureName=e.ExtensionName=e.EnvVarMode=e.NotebookAutoSaveSetting=e.APIMethod=e.GCPCloudRunActionType=e.AWSActionType=e.InstanceStatusType=e.GceActionType=e.Serializer=void 0,t("./src/constants.ts");var l;(function(p){(function(m){m[m.UNSPECIFIED=0]="UNSPECIFIED",m[m.ALL=1]="ALL",m[m.DOCUMENT=2]="DOCUMENT",m[m.CELL=3]="CELL"})(p.LifecycleIdentity||(p.LifecycleIdentity={}))})(l||(e.Serializer=l={}));var h;(function(p){p.StopVMInstance="stopVmInstance",p.StartVMInstance="startVmInstance",p.SuspendVMInstance="suspendVmInstance",p.ConnectViaSSH="connectViaSsh"})(h||(e.GceActionType=h={}));var v;(function(p){p.Stopping="STOPPING",p.Suspending="SUSPENDING",p.Staging="STAGING",p.Repairing="REPAIRING",p.Provisioning="PROVISIONING",p.Suspended="SUSPENDED",p.Terminated="TERMINATED",p.Running="RUNNING"})(v||(e.InstanceStatusType=v={}));var o;(function(p){p.ConnectViaSSH="connectViaSsh",p.EC2InstanceDetails="aws:ec2InstanceDetails",p.EKSClusterDetails="aws:eksClusterDetails"})(o||(e.AWSActionType=o={}));var r;(function(p){p.DescribeYAML="describeYAML",p.DownloadYAML="downloadYAML",p.ViewRevisions="viewRevisions"})(r||(e.GCPCloudRunActionType=r={}));var a;(function(p){p.CreateCellExecution="createCellExecution",p.UpdateCellExecution="updateCellExecution",p.CreateEscalation="createEscalation",p.TrackRunmeEvent="trackRunmeEvent"})(a||(e.APIMethod=a={}));var n;(function(p){p.Yes="yes",p.No="no"})(n||(e.NotebookAutoSaveSetting=n={}));var s;(function(p){p.Docs="docs",p.Shell="shell"})(s||(e.EnvVarMode=s={}));var i;(function(p){p.StatefulRunme="stateful.runme",p.StatefulPlatform="stateful.platform"})(i||(e.ExtensionName=i={}));var d;(function(p){p.Gist="Gist",p.Share="Share",p.Escalate="Escalate",p.ForceLogin="ForceLogin",p.SignedIn="SignedIn",p.RequireStatefulAuth="RequireStatefulAuth",p.CopySelectionToClipboard="CopySelectionToClipboard",p.NewTreeProvider="NewTreeProvider",p.OpenTerminalOnStartup="OpenTerminalOnStartup",p.HostedPlayground="HostedPlayground",p.RecommendExtension="RecommendExtension",p.ReporterAPI="ReporterAPI",p.RemoteNotebooks="RemoteNotebooks",p.AIProgress="AIProgress"})(d||(e.FeatureName=d={}))},"./src/utils/ansi.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stripANSI=t;function t(l){return l.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}},"./src/utils/messaging.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.postClientMessage=t,e.onClientMessage=l;async function t(h,v,o){var a;const r={type:v,output:o};return await((a=h.postMessage)==null?void 0:a.call(h,r))}function l(h,v){var o;return((o=h.onDidReceiveMessage)==null?void 0:o.call(h,v))??{dispose:()=>{}}}}},ei={};function gt(u){var e=ei[u];if(e!==void 0)return e.exports;var t=ei[u]={exports:{}};return kd[u].call(t.exports,t,t.exports,gt),t.exports}gt.d=(u,e)=>{for(var t in e)gt.o(e,t)&&!gt.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:e[t]})};gt.o=(u,e)=>Object.prototype.hasOwnProperty.call(u,e);gt.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var Rs={};(()=>{var u=Rs;/*!*****************************!*\
|
|
6538
|
+
`},"./src/client/utils.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getContext=o,e.setContext=r,e.closeOutput=a,e.formatDate=n,e.formatDateWithTimeAgo=s;const l=t("./src/utils/messaging.ts"),h=t("./src/constants.ts");let v;function o(){if(!v)throw new Error("Renderer context not defined");return v}function r(i){v=i}function a({id:i,outputType:d}){const p=o();p.postMessage&&(0,l.postClientMessage)(p,h.ClientMessages.closeCellOutput,{id:i,outputType:d})}function n(i){return i.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function s(i){const p=new Date().getTime()-i.getTime(),m=Math.floor(p/1e3)*-1,c=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(m)<60?c.format(Math.round(m),"second"):Math.abs(m)<3600?c.format(Math.round(m/60),"minute"):Math.abs(m)<86400?c.format(Math.round(m/3600),"hour"):c.format(Math.round(m/86400),"day")}},"./src/constants.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RUNME_FRONTMATTER_PARSED=e.PLATFORM_USER_SIGNED_IN=e.GITHUB_USER_SIGNED_IN=e.SAVE_CELL_LOGIN_CONSENT_STORAGE_KEY=e.CELL_CREATION_DATE_STORAGE_KEY=e.EXECUTION_CELL_STORAGE_KEY=e.FOCUS_CELL_STORAGE_KEY=e.CATEGORY_SEPARATOR=e.WebViews=e.TELEMETRY_EVENTS=e.EXTENSION_NAME=e.SUPPORTED_FILE_EXTENSIONS=e.LANGUAGE_PREFIXES=e.NOTEBOOK_ENV_VAR_MODE=e.NOTEBOOK_AUTHOR_MODE_ON=e.NOTEBOOK_RUN_WITH_PROMPTS=e.NOTEBOOK_PREVIEW_OUTPUTS=e.NOTEBOOK_MODE=e.NOTEBOOK_OUTPUTS_MASKED=e.NOTEBOOK_LIFECYCLE_ID=e.NOTEBOOK_AUTOSAVE_ON=e.NOTEBOOK_HAS_CATEGORIES=e.NOTEBOOK_AVAILABLE_CATEGORIES=e.NotebookMode=e.AuthenticationProviders=e.RENDERERS=e.DEFAULT_PROMPT_ENV=e.SERVER_PORT=e.SERVER_ADDRESS=e.DEFAULT_LANGUAGEID=e.VSCODE_LANGUAGEID_MAP=e.LANGUAGES=e.LANGID_AND_EXTENSIONS=e.LANG_IDS_WITH_DESTINATION=e.ClientMessages=e.OutputType=void 0;var t;(function(n){n.vercel="stateful.runme/vercel-stdout",n.deno="stateful.runme/deno-stdout",n.outputItems="stateful.runme/output-items",n.annotations="stateful.runme/annotations",n.terminal="stateful.runme/terminal",n.error="stateful.runme/error",n.github="stateful.runme/github-stdout",n.stdout="application/vnd.code.notebook.stdout",n.gcp="stateful.runme/gcp",n.aws="stateful.runme/aws",n.daggerCall="stateful.runme/dagger",n.daggerShell="stateful.runme/dagger"})(t||(e.OutputType=t={}));var l;(function(n){n.infoMessage="common:infoMessage",n.errorMessage="common:errorMessage",n.closeCellOutput="common:closeCellOutput",n.displayPrompt="common:displayPrompt",n.onPrompt="common:onPrompt",n.setState="common:setState",n.getState="common:getState",n.onGetState="common:onGetState",n.onCategoryChange="common:onCategoryChange",n.platformApiRequest="common:platformApiRequest",n.platformApiResponse="common:platformApiResponse",n.optionsMessage="common:optionsMessage",n.optionsModal="common:optionsModal",n.openExternalLink="common:openExternalLink",n.onOptionsMessage="common:onOptionsMessage",n.copyTextToClipboard="common:copyTextToClipboard",n.onCopyTextToClipboard="common:onCopyTextToClipboard",n.onProgramClose="common:onProgramClose",n.denoUpdate="deno:deploymentUpdate",n.denoPromote="deno:promoteDeployment",n.vercelProd="vercel:promotePreview",n.mutateAnnotations="annotations:mutate",n.terminalStdout="terminal:stdout",n.terminalStderr="terminal:stderr",n.terminalStdin="terminal:stdin",n.terminalResize="terminal:resize",n.terminalFocus="terminal:focus",n.terminalOpen="terminal:open",n.openLink="terminal:openLink",n.activeThemeChanged="theme:changed",n.githubWorkflowDispatch="github:workflowDispatch",n.githubWorkflowDeploy="github:workflowDeploy",n.githubWorkflowStatusUpdate="github:workflowStatusUpdate",n.tangleEvent="tangle:event",n.gcpResourceStatusChanged="gcp:resourceStatusChanged",n.gcpClusterCheckStatus="gcp:clusterCheckStatus",n.gcpClusterDetails="gcp:clusterDetails",n.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",n.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",n.gcpVMInstanceAction="gcp:gceVMInstanceAction",n.awsEC2Instances="aws:ec2Instances",n.awsEC2InstanceAction="aws:ec2InstanceAction",n.awsEKSClusterAction="aws:eksClusterAction",n.onAuthorModeChange="common:onAuthorModeChange",n.gistCell="gist:cell",n.gcpCloudRunAction="gcp:cloudRunAction",n.gcpLoadServices="gcp:loadServices",n.gcpServicesLoaded="gcp:servicesLoaded",n.daggerSyncState="dagger:syncState",n.daggerCliAction="dagger:cliAction",n.featuresUpdateAction="features:updateAction",n.featuresRequest="features:request",n.featuresResponse="features:response"})(l||(e.ClientMessages=l={})),e.LANG_IDS_WITH_DESTINATION=[["Assembly","asm","sh"],["Batchfile","bat","sh"],["C","c",void 0],["C#","cs",void 0],["C++","cpp",void 0],["Cpp","cpp",void 0],["Clojure","clj",void 0],["CMake","cmake","sh"],["COBOL","cbl","null"],["CoffeeScript","coffee","html"],["CSS","css",void 0],["CSV","csv",void 0],["Dart","dart",void 0],["DM","dm",void 0],["Dockerfile","dockerfile","sh"],["Elixir","ex",void 0],["Erlang","erl",void 0],["Fortran","f90",void 0],["Go","go",void 0],["Groovy","groovy",void 0],["Haskell","hs",void 0],["HTML","html",void 0],["INI","ini",void 0],["Java","java",void 0],["JavaScript","js",void 0],["JSON","json",void 0],["JSONC","jsonc",void 0],["Julia","jl",void 0],["Kotlin","kt",void 0],["Lisp","lisp",void 0],["Lua","lua",void 0],["Log","log",void 0],["Makefile","makefile","sh"],["Markdown","md",void 0],["Matlab","matlab",void 0],["Objective-C","mm",void 0],["OCaml","ml",void 0],["Pascal","pas",void 0],["Perl","pm",void 0],["PHP","php",void 0],["PowerShell","ps1",void 0],["Prolog","prolog",void 0],["Python","py",void 0],["R","r",void 0],["Ruby","rb",void 0],["Rust","rs",void 0],["Scala","scala",void 0],["Shell","sh","sh"],["SQL","sql",void 0],["Swift","swift",void 0],["TeX","tex",void 0],["TOML","toml",void 0],["TypeScript","ts",void 0],["Verilog","v",void 0],["Visual Basic","vba",void 0],["XML","xml",void 0],["YAML","yaml",void 0]],e.LANGID_AND_EXTENSIONS=e.LANG_IDS_WITH_DESTINATION.reduce((n,[s,i])=>!s||!i?n:n.set(s.toLocaleLowerCase(),i),new Map),e.LANGUAGES=new Map(e.LANG_IDS_WITH_DESTINATION.map(([,n,s])=>[n,s])),e.VSCODE_LANGUAGEID_MAP={console:"sh",shell:"sh",shellscript:"sh",javascriptreact:"jsx",typescriptreact:"tsx"},e.DEFAULT_LANGUAGEID="shellscript",e.SERVER_ADDRESS="localhost",e.SERVER_PORT=7863,e.DEFAULT_PROMPT_ENV=!0;var h;(function(n){n.VercelOutput="vercel-output",n.DenoOutput="deno-output",n.ShellOutput="shell-output",n.ShellOutputItems="shell-output-items",n.EditAnnotations="edit-annotations",n.TerminalView="terminal-view",n.GitHubWorkflowViewer="github-workflow-viewer",n.GCPView="gcp-view",n.AWSView="aws-view",n.DaggerCli="dagger-cli"})(h||(e.RENDERERS=h={}));var v;(function(n){n.GitHub="github",n.Stateful="stateful"})(v||(e.AuthenticationProviders=v={}));var o;(function(n){n.Execution="execution",n.SessionOutputs="sessionOutputs"})(o||(e.NotebookMode=o={})),e.NOTEBOOK_AVAILABLE_CATEGORIES="notebookAvailableCategories",e.NOTEBOOK_HAS_CATEGORIES="notebookHasCategories",e.NOTEBOOK_AUTOSAVE_ON="notebookAutoSaveOn",e.NOTEBOOK_LIFECYCLE_ID="notebookLifecycleId",e.NOTEBOOK_OUTPUTS_MASKED="notebookOutputsMasked",e.NOTEBOOK_MODE="notebookMode",e.NOTEBOOK_PREVIEW_OUTPUTS="notebookPreviewRunmeOutputs",e.NOTEBOOK_RUN_WITH_PROMPTS="notebookRunWithPrompts",e.NOTEBOOK_AUTHOR_MODE_ON="notebookAuthorModeOn",e.NOTEBOOK_ENV_VAR_MODE="notebookEnvVarMode",e.LANGUAGE_PREFIXES={abap:"ABAP",asc:"Public Key",ash:"AGS Script",ampl:"AMPL",mod:"XML",g4:"ANTLR",apib:"API Blueprint",apl:"APL",dyalog:"APL",asp:"ASP",asax:"ASP",ascx:"ASP",ashx:"ASP",asmx:"ASP",aspx:"ASP",axd:"ASP",dats:"ATS",hats:"ATS",sats:"ATS",as:"ActionScript",adb:"Ada",ada:"Ada",ads:"Ada",agda:"Agda",als:"Alloy",apacheconf:"ApacheConf",vhost:"Nginx",cls:"Visual Basic",applescript:"AppleScript",scpt:"AppleScript",arc:"Arc",ino:"Arduino",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aj:"AspectJ",asm:"Assembly",a51:"Assembly",inc:"SourcePawn",nasm:"Assembly",aug:"Augeas",ahk:"AutoHotkey",ahkl:"AutoHotkey",au3:"AutoIt",awk:"Awk",auk:"Awk",gawk:"Awk",mawk:"Awk",nawk:"Awk",bat:"Batchfile",cmd:"Batchfile",befunge:"Befunge",bison:"Bison",bb:"BlitzBasic",decls:"BlitzBasic",bmx:"BlitzMax",bsv:"Bluespec",boo:"Boo",b:"Limbo",bf:"HyPhy",brs:"Brightscript",bro:"Bro",c:"C",cats:"C",h:"Objective-C",idc:"C",w:"C",cs:"Smalltalk",cake:"CoffeeScript",cshtml:"C#",csx:"C#",cpp:"C++","c++":"C++",cc:"C++",cp:"Component Pascal",cxx:"C++","h++":"C++",hh:"Hack",hpp:"C++",hxx:"C++",inl:"C++",ipp:"C++",tcc:"C++",tpp:"C++","c-objdump":"C-ObjDump",chs:"C2hs Haskell",clp:"CLIPS",cmake:"CMake","cmake.in":"CMake",cob:"COBOL",cbl:"COBOL",ccp:"COBOL",cobol:"COBOL",cpy:"COBOL",css:"CSS",csv:"CSV",capnp:"Cap'n Proto",mss:"CartoCSS",ceylon:"Ceylon",chpl:"Chapel",ch:"xBase",ck:"ChucK",cirru:"Cirru",clw:"Clarion",icl:"Clean",dcl:"Clean",click:"Click",clj:"Clojure",boot:"Clojure",cl2:"Clojure",cljc:"Clojure",cljs:"Clojure","cljs.hl":"Clojure",cljscm:"Clojure",cljx:"Clojure",hic:"Clojure",coffee:"CoffeeScript",_coffee:"CoffeeScript",cjsx:"CoffeeScript",cson:"CoffeeScript",iced:"CoffeeScript",cfm:"ColdFusion",cfml:"ColdFusion",cfc:"ColdFusion CFC",lisp:"NewLisp",asd:"Common Lisp",cl:"OpenCL",l:"PicoLisp",lsp:"NewLisp",ny:"Common Lisp",podsl:"Common Lisp",sexp:"Common Lisp",cps:"Component Pascal",coq:"Coq",v:"Verilog",cppobjdump:"Cpp-ObjDump","c++-objdump":"Cpp-ObjDump","c++objdump":"Cpp-ObjDump","cpp-objdump":"Cpp-ObjDump","cxx-objdump":"Cpp-ObjDump",creole:"Creole",cr:"Crystal",feature:"Cucumber",cu:"Cuda",cuh:"Cuda",cy:"Cycript",pyx:"Cython",pxd:"Cython",pxi:"Cython",d:"Makefile",di:"D","d-objdump":"D-ObjDump",com:"DIGITAL Command Language",dm:"DM",zone:"DNS Zone",arpa:"DNS Zone",darcspatch:"Darcs Patch",dpatch:"Darcs Patch",dart:"Dart",diff:"Diff",patch:"Diff",dockerfile:"Dockerfile",djs:"Dogescript",dylan:"Dylan",dyl:"Dylan",intr:"Dylan",lid:"Dylan",E:"E",ecl:"ECLiPSe",eclxml:"ECL",sch:"KiCad",brd:"KiCad",epj:"Ecere Projects",e:"Eiffel",ex:"Elixir",exs:"Elixir",elm:"Elm",el:"Emacs Lisp",emacs:"Emacs Lisp","emacs.desktop":"Emacs Lisp",em:"EmberScript",emberscript:"EmberScript",erl:"Erlang",es:"JavaScript",escript:"Erlang",hrl:"Erlang",xrl:"Erlang",yrl:"Erlang",fs:"GLSL",fsi:"F#",fsx:"F#",fx:"HLSL",flux:"FLUX",f90:"FORTRAN",f:"Forth",f03:"FORTRAN",f08:"FORTRAN",f77:"FORTRAN",f95:"FORTRAN",for:"Forth",fpp:"FORTRAN",factor:"Factor",fy:"Fancy",fancypack:"Fancy",fan:"Fantom","eam.fs":"Formatted",fth:"Forth","4th":"Forth",forth:"Forth",fr:"Text",frt:"Forth",ftl:"FreeMarker",g:"GAP",gco:"G-code",gcode:"G-code",gms:"GAMS",gap:"GAP",gd:"GDScript",gi:"GAP",tst:"Scilab",s:"GAS",ms:"MAXScript",glsl:"GLSL",fp:"GLSL",frag:"JavaScript",frg:"GLSL",fsh:"GLSL",fshader:"GLSL",geo:"GLSL",geom:"GLSL",glslv:"GLSL",gshader:"GLSL",shader:"GLSL",vert:"GLSL",vrx:"GLSL",vsh:"GLSL",vshader:"GLSL",gml:"XML",kid:"Genshi",ebuild:"Gentoo Ebuild",eclass:"Gentoo Eclass",po:"Gettext Catalog",pot:"Gettext Catalog",glf:"Glyph",gp:"Gnuplot",gnu:"Gnuplot",gnuplot:"Gnuplot",plot:"Gnuplot",plt:"Gnuplot",go:"Go",golo:"Golo",gs:"JavaScript",gst:"Gosu",gsx:"Gosu",vark:"Gosu",grace:"Grace",gradle:"Gradle",gf:"Grammatical Framework",graphql:"GraphQL",dot:"Graphviz (DOT)",gv:"Graphviz (DOT)",man:"Groff","1in":"Groff","1m":"Groff","1x":"Groff","3in":"Groff","3m":"Groff","3qt":"Groff","3x":"Groff",me:"Groff",n:"Nemerle",rno:"Groff",roff:"Groff",groovy:"Groovy",grt:"Groovy",gtpl:"Groovy",gvy:"Groovy",gsp:"Groovy Server Pages",hcl:"HCL",tf:"HCL",hlsl:"HLSL",fxh:"HLSL",hlsli:"HLSL",html:"HTML",htm:"HTML","html.hl":"HTML",st:"Smalltalk",xht:"HTML",xhtml:"HTML",mustache:"HTML+Django",jinja:"HTML+Django",eex:"HTML+EEX",erb:"HTML+ERB","erb.deface":"HTML+ERB",phtml:"HTML+PHP",http:"HTTP",php:"PHP",haml:"Haml","haml.deface":"Haml",handlebars:"Handlebars",hbs:"Handlebars",hb:"Harbour",hs:"Haskell",hsc:"Haskell",hx:"Haxe",hxsl:"Haxe",hy:"Hy",pro:"QMake",dlm:"IDL",ipf:"IGOR Pro",ini:"INI",cfg:"INI",prefs:"INI",properties:"INI",irclog:"IRC log",weechatlog:"IRC log",idr:"Idris",lidr:"Idris",ni:"Inform 7",i7x:"Inform 7",iss:"Inno Setup",io:"Io",ik:"Ioke",thy:"Isabelle",ijs:"J",flex:"JFlex",jflex:"JFlex",json:"JSON",geojson:"JSON",lock:"JSON",topojson:"JSON",json5:"JSON5",jsonld:"JSONLD",jq:"JSONiq",jsx:"JSX",jade:"Jade",j:"Objective-J",java:"Java",jsp:"Java Server Pages",js:"JavaScript",_js:"JavaScript",bones:"JavaScript",es6:"JavaScript",jake:"JavaScript",jsb:"JavaScript",jscad:"JavaScript",jsfl:"JavaScript",jsm:"JavaScript",jss:"JavaScript",njs:"JavaScript",pac:"JavaScript",sjs:"JavaScript",ssjs:"JavaScript","sublime-build":"JavaScript","sublime-commands":"JavaScript","sublime-completions":"JavaScript","sublime-keymap":"JavaScript","sublime-macro":"JavaScript","sublime-menu":"JavaScript","sublime-mousemap":"JavaScript","sublime-project":"JavaScript","sublime-settings":"JavaScript","sublime-theme":"JavaScript","sublime-workspace":"JavaScript",sublime_metrics:"JavaScript",sublime_session:"JavaScript",xsjs:"JavaScript",xsjslib:"JavaScript",jl:"Julia",ipynb:"Jupyter Notebook",krl:"KRL",kicad_pcb:"KiCad",kit:"Kit",kt:"Kotlin",ktm:"Kotlin",kts:"Kotlin",lfe:"LFE",ll:"LLVM",lol:"LOLCODE",lsl:"LSL",lslp:"LSL",lvproj:"LabVIEW",lasso:"Lasso",las:"Lasso",lasso8:"Lasso",lasso9:"Lasso",ldml:"Lasso",latte:"Latte",lean:"Lean",hlean:"Lean",less:"Less",lex:"Lex",ly:"LilyPond",ily:"LilyPond",m:"Objective-C",ld:"Linker Script",lds:"Linker Script",liquid:"Liquid",lagda:"Literate Agda",litcoffee:"Literate CoffeeScript",lhs:"Literate Haskell",ls:"LoomScript",_ls:"LiveScript",xm:"Logos",x:"Logos",xi:"Logos",lgt:"Logtalk",logtalk:"Logtalk",lookml:"LookML",lua:"Lua",fcgi:"Shell",nse:"Lua",pd_lua:"Lua",rbxs:"Lua",wlua:"Lua",mumps:"M",m4:"M4Sugar",mcr:"MAXScript",mtml:"MTML",muf:"MUF",mak:"Makefile",mk:"Makefile",mkfile:"Makefile",mako:"Mako",mao:"Mako",md:"Markdown",markdown:"Markdown",mkd:"Markdown",mkdn:"Markdown",mkdown:"Markdown",ron:"Markdown",mask:"Mask",mathematica:"Mathematica",cdf:"Mathematica",ma:"Mathematica",mt:"Mathematica",nb:"Text",nbp:"Mathematica",wl:"Mathematica",wlt:"Mathematica",matlab:"Matlab",maxpat:"Max",maxhelp:"Max",maxproj:"Max",mxt:"Max",pat:"Max",mediawiki:"MediaWiki",wiki:"MediaWiki",moo:"Moocode",metal:"Metal",minid:"MiniD",druby:"Mirah",duby:"Mirah",mir:"Mirah",mirah:"Mirah",mo:"Modelica",mms:"Module Management System",mmk:"Module Management System",monkey:"Monkey",moon:"MoonScript",myt:"Myghty",ncl:"Text",nl:"NewLisp",nsi:"NSIS",nsh:"NSIS",axs:"NetLinx",axi:"NetLinx","axs.erb":"NetLinx+ERB","axi.erb":"NetLinx+ERB",nlogo:"NetLogo",nginxconf:"Nginx",nim:"Nimrod",nimrod:"Nimrod",ninja:"Ninja",nit:"Nit",nix:"Nix",nu:"Nu",numpy:"NumPy",numpyw:"NumPy",numsc:"NumPy",ml:"OCaml",eliom:"OCaml",eliomi:"OCaml",ml4:"OCaml",mli:"OCaml",mll:"OCaml",mly:"OCaml",objdump:"ObjDump",mm:"XML",sj:"Objective-J",omgrofl:"Omgrofl",opa:"Opa",opal:"Opal",opencl:"OpenCL",p:"OpenEdge ABL",scad:"OpenSCAD",org:"Org",ox:"Ox",oxh:"Ox",oxo:"Ox",oxygene:"Oxygene",oz:"Oz",pwn:"PAWN",aw:"PHP",ctp:"PHP",php3:"PHP",php4:"PHP",php5:"PHP",phps:"PHP",phpt:"PHP",pls:"PLSQL",pck:"PLSQL",pkb:"PLSQL",pks:"PLSQL",plb:"PLSQL",plsql:"PLSQL",sql:"SQLPL",pov:"POV-Ray SDL",pan:"Pan",psc:"Papyrus",parrot:"Parrot",pasm:"Parrot Assembly",pir:"Parrot Internal Representation",pas:"Pascal",dfm:"Pascal",dpr:"Pascal",lpr:"Pascal",pp:"Puppet",pl:"Prolog",al:"Perl",cgi:"Shell",perl:"Perl",ph:"Perl",plx:"Perl",pm:"Perl6",pod:"Pod",psgi:"Perl",t:"Turing","6pl":"Perl6","6pm":"Perl6",nqp:"Perl6",p6:"Perl6",p6l:"Perl6",p6m:"Perl6",pl6:"Perl6",pm6:"Perl6",pkl:"Pickle",pig:"PigLatin",pike:"Pike",pmod:"Pike",pogo:"PogoScript",pony:"Pony",ps:"PostScript",eps:"PostScript",ps1:"PowerShell",psd1:"PowerShell",psm1:"PowerShell",pde:"Processing",prolog:"Prolog",yap:"Prolog",spin:"Propeller Spin",proto:"Protocol Buffer",pub:"Public Key",pd:"Pure Data",pb:"PureBasic",pbi:"PureBasic",purs:"PureScript",py:"Python",bzl:"Python",gyp:"Python",lmi:"Python",pyde:"Python",pyp:"Python",pyt:"Python",pyw:"Python",rpy:"Ren'Py",tac:"Python",wsgi:"Python",xpy:"Python",pytb:"Python traceback",qml:"QML",qbs:"QML",pri:"QMake",r:"Rebol",rd:"R",rsx:"R",raml:"RAML",rdoc:"RDoc",rbbas:"REALbasic",rbfrm:"REALbasic",rbmnu:"REALbasic",rbres:"REALbasic",rbtbar:"REALbasic",rbuistate:"REALbasic",rhtml:"RHTML",rmd:"RMarkdown",rkt:"Racket",rktd:"Racket",rktl:"Racket",scrbl:"Racket",rl:"Ragel in Ruby Host",raw:"Raw token data",reb:"Rebol",r2:"Rebol",r3:"Rebol",rebol:"Rebol",red:"Red",reds:"Red",cw:"Redcode",rs:"Rust",rsh:"RenderScript",robot:"RobotFramework",rg:"Rouge",rb:"Ruby",builder:"Ruby",gemspec:"Ruby",god:"Ruby",irbrc:"Ruby",jbuilder:"Ruby",mspec:"Ruby",pluginspec:"XML",podspec:"Ruby",rabl:"Ruby",rake:"Ruby",rbuild:"Ruby",rbw:"Ruby",rbx:"Ruby",ru:"Ruby",ruby:"Ruby",thor:"Ruby",watchr:"Ruby","rs.in":"Rust",sas:"SAS",scss:"SCSS",smt2:"SMT",smt:"SMT",sparql:"SPARQL",rq:"SPARQL",sqf:"SQF",hqf:"SQF",cql:"SQL",ddl:"SQL",prc:"SQL",tab:"SQL",udf:"SQL",viw:"SQL",db2:"SQLPL",ston:"STON",svg:"SVG",sage:"Sage",sagews:"Sage",sls:"Scheme",sass:"Sass",scala:"Scala",sbt:"Scala",sc:"SuperCollider",scaml:"Scaml",scm:"Scheme",sld:"Scheme",sps:"Scheme",ss:"Scheme",sci:"Scilab",sce:"Scilab",self:"Self",sh:"Shell",bash:"Shell",bats:"Shell",command:"Shell",ksh:"Shell","sh.in":"Shell",tmux:"Shell",tool:"Shell",zsh:"Shell","sh-session":"ShellSession",shen:"Shen",sl:"Slash",slim:"Slim",smali:"Smali",tpl:"Smarty",sp:"SourcePawn",sma:"SourcePawn",nut:"Squirrel",stan:"Stan",ML:"Standard ML",fun:"Standard ML",sig:"Standard ML",sml:"Standard ML",do:"Stata",ado:"Stata",doh:"Stata",ihlp:"Stata",mata:"Stata",matah:"Stata",sthlp:"Stata",styl:"Stylus",scd:"SuperCollider",swift:"Swift",sv:"SystemVerilog",svh:"SystemVerilog",vh:"SystemVerilog",toml:"TOML",txl:"TXL",tcl:"Tcl",adp:"Tcl",tm:"Tcl",tcsh:"Tcsh",csh:"Tcsh",tex:"TeX",aux:"TeX",bbx:"TeX",bib:"TeX",cbx:"TeX",dtx:"TeX",ins:"TeX",lbx:"TeX",ltx:"TeX",mkii:"TeX",mkiv:"TeX",mkvi:"TeX",sty:"TeX",toc:"TeX",tea:"Tea",txt:"Text",no:"Text",textile:"Textile",thrift:"Thrift",tu:"Turing",ttl:"Turtle",twig:"Twig",ts:"typescript",tsx:"typescriptreact",upc:"Unified Parallel C",anim:"Unity3D Asset",asset:"Unity3D Asset",mat:"Unity3D Asset",meta:"Unity3D Asset",prefab:"Unity3D Asset",unity:"Unity3D Asset",uno:"Uno",uc:"UnrealScript",ur:"UrWeb",urs:"UrWeb",vcl:"VCL",vhdl:"VHDL",vhd:"VHDL",vhf:"VHDL",vhi:"VHDL",vho:"VHDL",vhs:"VHDL",vht:"VHDL",vhw:"VHDL",vala:"Vala",vapi:"Vala",veo:"Verilog",vim:"VimL",vb:"Visual Basic",bas:"Visual Basic",frm:"Visual Basic",frx:"Visual Basic",vba:"Visual Basic",vbhtml:"Visual Basic",vbs:"Visual Basic",volt:"Volt",vue:"Vue",owl:"Web Ontology Language",webidl:"WebIDL",x10:"X10",xc:"XC",xml:"XML",ant:"XML",axml:"XML",ccxml:"XML",clixml:"XML",cproject:"XML",csl:"XML",csproj:"XML",ct:"XML",dita:"XML",ditamap:"XML",ditaval:"XML","dll.config":"XML",dotsettings:"XML",filters:"XML",fsproj:"XML",fxml:"XML",glade:"XML",grxml:"XML",iml:"XML",ivy:"XML",jelly:"XML",jsproj:"XML",kml:"XML",launch:"XML",mdpolicy:"XML",mxml:"XML",nproj:"XML",nuspec:"XML",odd:"XML",osm:"XML",plist:"XML",props:"XML",ps1xml:"XML",psc1:"XML",pt:"XML",rdf:"XML",rss:"XML",scxml:"XML",srdf:"XML",storyboard:"XML",stTheme:"XML","sublime-snippet":"XML",targets:"XML",tmCommand:"XML",tml:"XML",tmLanguage:"XML",tmPreferences:"XML",tmSnippet:"XML",tmTheme:"XML",ui:"XML",urdf:"XML",ux:"XML",vbproj:"XML",vcxproj:"XML",vssettings:"XML",vxml:"XML",wsdl:"XML",wsf:"XML",wxi:"XML",wxl:"XML",wxs:"XML",x3d:"XML",xacro:"XML",xaml:"XML",xib:"XML",xlf:"XML",xliff:"XML",xmi:"XML","xml.dist":"XML",xproj:"XML",xsd:"XML",xul:"XML",zcml:"XML","xsp-config":"XPages","xsp.metadata":"XPages",xpl:"XProc",xproc:"XProc",xquery:"XQuery",xq:"XQuery",xql:"XQuery",xqm:"XQuery",xqy:"XQuery",xs:"XS",xslt:"XSLT",xsl:"XSLT",xojo_code:"Xojo",xojo_menu:"Xojo",xojo_report:"Xojo",xojo_script:"Xojo",xojo_toolbar:"Xojo",xojo_window:"Xojo",xtend:"Xtend",yml:"YAML",reek:"YAML",rviz:"YAML","sublime-syntax":"YAML",syntax:"YAML",yaml:"YAML","yaml-tmlanguage":"YAML",yang:"YANG",y:"Yacc",yacc:"Yacc",yy:"Yacc",zep:"Zephir",zimpl:"Zimpl",zmpl:"Zimpl",zpl:"Zimpl",desktop:"desktop","desktop.in":"desktop",ec:"eC",eh:"eC",edn:"edn",fish:"fish",mu:"mupad",nc:"nesC",ooc:"ooc",rst:"reStructuredText",rest:"reStructuredText","rest.txt":"reStructuredText","rst.txt":"reStructuredText",wisp:"wisp",prg:"xBase",prw:"xBase"},e.SUPPORTED_FILE_EXTENSIONS=["sh","bash","ksh","zsh","fish","bat","cmd","pwsh",...Object.keys(e.LANGUAGE_PREFIXES)],e.EXTENSION_NAME="stateful.runme";var r;(function(n){n.RecommendExtension="runme.recommendExtension",n.NotebookGist="runme.notebookGist",n.CellGist="runme.cellGist",n.ShellWarning="extension.shellWarning",n.OpenWorkspace="cloud.OpenWorkspace"})(r||(e.TELEMETRY_EVENTS=r={}));var a;(function(n){n.RunmeCloud="runme.cloud",n.RunmeChat="runme.chat",n.RunmeSearch="runme.search",n.NotebookEnvStore="runme.notebook.envStore"})(a||(e.WebViews=a={})),e.CATEGORY_SEPARATOR=",",e.FOCUS_CELL_STORAGE_KEY="focusCell",e.EXECUTION_CELL_STORAGE_KEY="executionCell",e.CELL_CREATION_DATE_STORAGE_KEY="cellCreationDate",e.SAVE_CELL_LOGIN_CONSENT_STORAGE_KEY="loginConsent",e.GITHUB_USER_SIGNED_IN="userSignedIn",e.PLATFORM_USER_SIGNED_IN="platformUserSignedIn",e.RUNME_FRONTMATTER_PARSED="runme.dev/frontmatterParsed"},"./src/extension/grpc/runner/v1.ts":function(u,e,t){var l=this&&this.__createBinding||(Object.create?function(v,o,r,a){a===void 0&&(a=r);var n=Object.getOwnPropertyDescriptor(o,r);(!n||("get"in n?!o.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(v,a,n)}:function(v,o,r,a){a===void 0&&(a=r),v[a]=o[r]}),h=this&&this.__exportStar||function(v,o){for(var r in v)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&l(o,v,r)};Object.defineProperty(e,"__esModule",{value:!0}),h(t("./node_modules/@buf/stateful_runme.community_timostamm-protobuf-ts/runme/runner/v1/runner_pb.js"),e)},"./src/extension/resolvers/awsResolver.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AWSResolver=e.AWSSupportedView=void 0;var t;(function(h){h.EC2Instances="ec2Instances",h.EC2InstanceDetails="ec2InstanceDetails",h.EKSClusters="eksClusters"})(t||(e.AWSSupportedView=t={}));class l{constructor(v){var r;this.cellText=v,this.supportedFeatures=new Map,this.supportedFeatures.set("/ec2/details",{view:t.EC2InstanceDetails,data:{urlRegex:/ec2\/home[?]?region=[^#]+#InstanceDetails:instanceId=([^\s&]+)/,region:"",instanceId:""}}),this.supportedFeatures.set("/ec2/home",{view:t.EC2Instances,data:{region:""}}),this.supportedFeatures.set("/eks/home",{view:t.EKSClusters,data:{region:""}});const o=this.cellText;if(o.includes("console.aws.amazon.com")){const a=new URL(o);let n=null;for(const[s,i]of this.supportedFeatures)if((r=i.data.urlRegex)!=null&&r.test(o)||s===a.pathname){n=i;break}if(n){if(n.data.urlRegex&&n.data){if(n.view===t.EC2InstanceDetails){const i=/instanceId=([^&]+)/.exec(a.toString());i&&(n.data.instanceId=i[0].split("=")[1]);const d=/region=([^&]+)/.exec(a.toString());d&&(n.data.region=d[1].split("#")[0])}const s=n.data.urlRegex.exec(a.pathname);if(s){const[,...i]=s;Object.keys(n.data).forEach((d,p)=>{n.data[d]=i[p]})}}if(n.view===t.EKSClusters){const s=/clusters\/([^&]+)/.exec(a.toString());if(s){const[,i]=s;n.data.cluster=i}}n.data.region=a.searchParams.get("region"),this.resolvedFeature={...n}}}}match(){return!!this.resolvedFeature}get(){return this.resolvedFeature}dispose(){this.supportedFeatures.clear()}}e.AWSResolver=l},"./src/extension/resolvers/gcpResolver.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPResolver=e.GCPSupportedView=void 0;var t;(function(h){h.CLUSTERS="clusters",h.CLUSTER="cluster",h.VM_INSTANCES="vm_instances",h.VM_INSTANCE="vm_instance",h.CLOUD_RUN_SERVICES="cloud_run_services",h.CLOUD_RUN_REVISIONS="cloud_run_revisions"})(t||(e.GCPSupportedView=t={}));class l{constructor(v){var r;this.cellText=v,this.supportedFeatures=new Map,this.supportedFeatures.set("/kubernetes/list/overview",{view:t.CLUSTERS,data:{project:""}}),this.supportedFeatures.set("/kubernetes/clusters/details",{view:t.CLUSTER,data:{location:"",cluster:"",urlRegex:/kubernetes\/clusters\/details\/([^/]+)\/([^/]+)\/details/,project:""}}),this.supportedFeatures.set("/compute/instances",{view:t.VM_INSTANCES,data:{urlRegex:/compute\/instances[?]project=.+/,project:""}}),this.supportedFeatures.set("/compute/instancesDetail",{view:t.VM_INSTANCE,data:{urlRegex:/compute\/instancesDetail\/zones\/([^/]+)\/instances\/([^/]+)(\?project=(.+))?/,location:"",instance:"",project:""}}),this.supportedFeatures.set("/run",{view:t.CLOUD_RUN_SERVICES,data:{urlRegex:/run[?]project=.+/,project:""}}),this.supportedFeatures.set("/revisions",{view:t.CLOUD_RUN_REVISIONS,data:{urlRegex:/^\/run\/detail\/([^/]+)\/([^/]+)\/revisions$/,region:"",service:""}});const o=this.cellText;if(o.startsWith("https://console.cloud.google.com")){const a=new URL(o);let n=null;for(const[s,i]of this.supportedFeatures)if((r=i.data.urlRegex)!=null&&r.test(a.pathname)||s===a.pathname){n=i;break}if(n){if(n.data.urlRegex&&n.data){const s=n.data.urlRegex.exec(a.pathname);if(s){const[,...i]=s;Object.keys(n.data).filter(d=>d!=="urlRegex").forEach((d,p)=>{n.data[d]=i[p]})}}n.data.project=a.searchParams.get("project"),this.resolvedFeature={...n}}}}match(){return!!this.resolvedFeature}get(){return this.resolvedFeature}dispose(){this.supportedFeatures.clear()}}e.GCPResolver=l},"./src/features.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES_CONTEXT_STATE_KEY=void 0;const l=t("./node_modules/rxjs/dist/cjs/index.js"),h=t("./node_modules/semver/index.js");e.FEATURES_CONTEXT_STATE_KEY="features";function v(_){var y;return((y=_==null?void 0:_.runme)==null?void 0:y.features)||{}}function o(_,b,y=new Map){const C=v(_),S=new l.BehaviorSubject({features:C,context:b});return p(S,b,y),S}function r(_,b){return b!==void 0?b===!0:_===!0}function a(_,b){return!_||_==="All"||b===_}function n(_,b){return!_||!b?!0:(0,h.satisfies)(b,_)}function s(_,b){return _?!!b:!0}function i(_,b){return _?b?_[b]===!0:!1:!0}function d(_,b,y,C=new Map){const{os:S,vsCodeVersion:E,runmeVersion:j,extensionVersion:O,githubAuthRequired:I,statefulAuthRequired:T,enabledForExtensions:x}=b.conditions;return!(!r(b.enabled,C.get(_))||!a(S,y==null?void 0:y.os)||!n(E,y==null?void 0:y.vsCodeVersion)||!n(j,y==null?void 0:y.runmeVersion)||!n(O,y==null?void 0:y.extensionVersion)||!s(I,y==null?void 0:y.githubAuth)||!s(T,y==null?void 0:y.statefulAuth)||!i(x,y==null?void 0:y.extensionId))}function p(_,b,y=new Map){const C=_.getValue(),S=Object.entries(C.features).reduce((E,[j,O])=>({...E,[j]:{...O,on:d(j,O,b,y)}}),{});return _.next({features:S,context:b}),_}function m(_,b,y,C){var j;if(!_)return;const S=_.getValue(),E={...S.context||{},[b]:y};E[b]!==((j=S==null?void 0:S.context)==null?void 0:j[b])&&p(_,E,C)}function c(_){return _?JSON.stringify(_.getValue()):""}function f(_){const{features:b,context:y}=JSON.parse(_),C=new l.BehaviorSubject({features:b,context:y});return C.next({features:b,context:C.getValue().context}),C}function g(_,b){if(!b)return!1;const y=b.getValue().features[_];return(y==null?void 0:y.on)??!1}e.default={loadState:o,updateState:p,updateContext:m,getSnapshot:c,loadSnapshot:f,isOn:g}},"./src/schema.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellAnnotationsSchema=e.SafeNotebookAnnotationsSchema=e.SafeCellAnnotationsSchema=e.AnnotationSchema=void 0;const l=t("./node_modules/zod/dist/cjs/index.js"),h=t("./src/extension/grpc/runner/v1.ts"),v=(a,n)=>a.trim().replaceAll(/[ ]{2,}/g,"").replaceAll(n,""),o=a=>l.z.preprocess(n=>(typeof n=="string"&&(n=v(n,",")),typeof n=="boolean"?n:typeof n=="string"&&n.toLowerCase()==="false"?!1:typeof n=="string"&&n.toLowerCase()==="true"?!0:a),l.z.boolean()),r=(a,n="expected a boolean value")=>l.z.preprocess(s=>s?(typeof s=="string"&&(s=v(s,",")),typeof s=="string"&&s.toLowerCase()==="false"?!1:typeof s=="string"&&s.toLowerCase()==="true"?!0:s):a,l.z.boolean({invalid_type_error:n}));e.AnnotationSchema={"runme.dev/id":l.z.string().optional(),"runme.dev/name":l.z.string().optional(),"runme.dev/nameGenerated":r(!0).optional(),"runme.dev/fenced":r(!0).optional(),id:l.z.string().optional(),background:r(!1),interactive:r(!0),closeTerminalOnSuccess:r(!0),openTerminalOnError:r(!0),promptEnv:l.z.preprocess(a=>{if(typeof a=="string"&&(a=v(a,",")),typeof a=="boolean"&&!a)return h.ResolveProgramRequest_Mode.SKIP_ALL;if(typeof a=="boolean"&&a)return h.ResolveProgramRequest_Mode.UNSPECIFIED;if(typeof a=="string"&&["false","no","never"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.SKIP_ALL;if(typeof a=="string"&&["true","yes","always"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.PROMPT_ALL;if(typeof a=="string"&&["","auto"].includes(a.toLowerCase()))return h.ResolveProgramRequest_Mode.UNSPECIFIED;if(typeof a=="string"&&a){const n=Number(a);if(Number.isFinite(n))return n}},l.z.nativeEnum(h.ResolveProgramRequest_Mode).default(h.ResolveProgramRequest_Mode.UNSPECIFIED)),excludeFromRunAll:r(!1),terminalRows:l.z.preprocess(a=>{if(typeof a=="string"&&a){const n=Number(a);if(Number.isFinite(n))return n}if(typeof a=="number"&&Number.isFinite(a))return a},l.z.number().int().positive().optional()),name:l.z.preprocess(a=>typeof a=="string"?v(a,","):a,l.z.string().default("")),mimeType:l.z.string().optional().refine(a=>{if(a){const[n,s,...i]=a.split("/");if(!n||!s||i.length)return!1}return!0},"mime type specification invalid format"),interpreter:l.z.string().optional().default(""),cwd:l.z.string().optional().default(""),category:l.z.string().default("")},e.SafeCellAnnotationsSchema=l.z.object({...e.AnnotationSchema,background:o(!1),interactive:o(!0),closeTerminalOnSuccess:o(!0),openTerminalOnError:o(!0)}),e.SafeNotebookAnnotationsSchema=l.z.object({id:l.z.string(),version:l.z.string()}),e.CellAnnotationsSchema=l.z.object({...e.AnnotationSchema})},"./src/types.ts":(u,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureName=e.ExtensionName=e.EnvVarMode=e.NotebookAutoSaveSetting=e.APIMethod=e.GCPCloudRunActionType=e.AWSActionType=e.InstanceStatusType=e.GceActionType=e.Serializer=void 0,t("./src/constants.ts");var l;(function(p){(function(m){m[m.UNSPECIFIED=0]="UNSPECIFIED",m[m.ALL=1]="ALL",m[m.DOCUMENT=2]="DOCUMENT",m[m.CELL=3]="CELL"})(p.LifecycleIdentity||(p.LifecycleIdentity={}))})(l||(e.Serializer=l={}));var h;(function(p){p.StopVMInstance="stopVmInstance",p.StartVMInstance="startVmInstance",p.SuspendVMInstance="suspendVmInstance",p.ConnectViaSSH="connectViaSsh"})(h||(e.GceActionType=h={}));var v;(function(p){p.Stopping="STOPPING",p.Suspending="SUSPENDING",p.Staging="STAGING",p.Repairing="REPAIRING",p.Provisioning="PROVISIONING",p.Suspended="SUSPENDED",p.Terminated="TERMINATED",p.Running="RUNNING"})(v||(e.InstanceStatusType=v={}));var o;(function(p){p.ConnectViaSSH="connectViaSsh",p.EC2InstanceDetails="aws:ec2InstanceDetails",p.EKSClusterDetails="aws:eksClusterDetails"})(o||(e.AWSActionType=o={}));var r;(function(p){p.DescribeYAML="describeYAML",p.DownloadYAML="downloadYAML",p.ViewRevisions="viewRevisions"})(r||(e.GCPCloudRunActionType=r={}));var a;(function(p){p.CreateCellExecution="createCellExecution",p.UpdateCellExecution="updateCellExecution",p.CreateEscalation="createEscalation",p.TrackRunmeEvent="trackRunmeEvent"})(a||(e.APIMethod=a={}));var n;(function(p){p.Yes="yes",p.No="no"})(n||(e.NotebookAutoSaveSetting=n={}));var s;(function(p){p.Docs="docs",p.Shell="shell"})(s||(e.EnvVarMode=s={}));var i;(function(p){p.StatefulRunme="stateful.runme",p.StatefulPlatform="stateful.platform"})(i||(e.ExtensionName=i={}));var d;(function(p){p.Gist="Gist",p.Share="Share",p.Escalate="Escalate",p.ForceLogin="ForceLogin",p.SignedIn="SignedIn",p.RequireStatefulAuth="RequireStatefulAuth",p.CopySelectionToClipboard="CopySelectionToClipboard",p.NewTreeProvider="NewTreeProvider",p.OpenTerminalOnStartup="OpenTerminalOnStartup",p.HostedPlayground="HostedPlayground",p.RecommendExtension="RecommendExtension",p.ReporterAPI="ReporterAPI",p.RemoteNotebooks="RemoteNotebooks",p.AIProgress="AIProgress"})(d||(e.FeatureName=d={}))},"./src/utils/ansi.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stripANSI=t;function t(l){return l.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}},"./src/utils/messaging.ts":(u,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.postClientMessage=t,e.onClientMessage=l;async function t(h,v,o){var a;const r={type:v,output:o};return await((a=h.postMessage)==null?void 0:a.call(h,r))}function l(h,v){var o;return((o=h.onDidReceiveMessage)==null?void 0:o.call(h,v))??{dispose:()=>{}}}}},Vr={};function gt(u){var e=Vr[u];if(e!==void 0)return e.exports;var t=Vr[u]={exports:{}};return dc[u].call(t.exports,t,t.exports,gt),t.exports}gt.d=(u,e)=>{for(var t in e)gt.o(e,t)&&!gt.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:e[t]})};gt.o=(u,e)=>Object.prototype.hasOwnProperty.call(u,e);gt.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var Ps={};(()=>{var u=Ps;/*!*****************************!*\
|
|
6541
6539
|
!*** ./src/client/index.ts ***!
|
|
6542
|
-
\*****************************/Object.defineProperty(u,"__esModule",{value:!0}),u.ClientMessages=u.setContext=u.activate=void 0;const e=gt("./src/constants.ts");Object.defineProperty(u,"ClientMessages",{enumerable:!0,get:function(){return e.ClientMessages}});const t=gt("./src/client/utils.ts");Object.defineProperty(u,"setContext",{enumerable:!0,get:function(){return t.setContext}}),gt("./src/client/components/index.ts");const l=h=>((0,t.setContext)(h),{renderOutputItem(v,o){var n,s,i;const r=v.json();switch(r.type){case e.OutputType.vercel:if(r.output.error){a(r.output.error);break}const d=document.createElement(e.RENDERERS.VercelOutput);d.setAttribute("content",JSON.stringify(r.output)),o.appendChild(d);break;case e.OutputType.daggerCall:if(!((n=r.output)!=null&&n.cellId))return;const p=document.createElement(e.RENDERERS.DaggerCli);p.setAttribute("cellId",r.output.cellId);const m={...r.output,cli:{status:"active"}};p.setAttribute("state",JSON.stringify(m)),o.appendChild(p);break;case e.OutputType.deno:if((s=r.output)!=null&&s.error){a(r.output.error);break}const c=r.output||{},f=document.createElement(e.RENDERERS.DenoOutput);f.setAttribute("state",JSON.stringify(c)),o.appendChild(f);break;case e.OutputType.outputItems:const g=decodeURIComponent(escape(window.atob(r.output.content))),_=document.createElement(e.RENDERERS.ShellOutput);_.innerHTML=g,o.appendChild(_);const b=document.createElement(e.RENDERERS.ShellOutputItems);b.setAttribute("id",r.output.id),b.setAttribute("content",g),o.appendChild(b);break;case e.OutputType.annotations:const y=document.createElement(e.RENDERERS.EditAnnotations);y.setAttribute("annotations",JSON.stringify(r.output.annotations??[])),y.setAttribute("validationErrors",JSON.stringify(r.output.validationErrors??[])),y.setAttribute("settings",JSON.stringify(r.output.settings)),o.appendChild(y);break;case e.OutputType.terminal:const C=document.createElement(e.RENDERERS.TerminalView);C.setAttribute("id",r.output["runme.dev/id"]),C.setAttribute("fontFamily",r.output.fontFamily),typeof r.output.fontSize=="number"&&C.setAttribute("fontSize",r.output.fontSize.toString()),r.output.cursorStyle&&C.setAttribute("cursorStyle",r.output.cursorStyle),typeof r.output.cursorBlink=="boolean"&&C.setAttribute("cursorBlink",r.output.cursorBlink?"true":"false"),typeof r.output.cursorWidth=="number"&&C.setAttribute("cursorWidth",r.output.cursorWidth.toString()),typeof r.output.smoothScrollDuration=="number"&&C.setAttribute("smoothScrollDuration",r.output.smoothScrollDuration.toString()),typeof r.output.scrollback=="number"&&C.setAttribute("scrollback",r.output.scrollback.toString()),r.output.initialRows!==void 0&&C.setAttribute("initialRows",r.output.initialRows.toString()),r.output.content!==void 0&&C.setAttribute("initialContent",r.output.content),r.output.isAutoSaveEnabled&&C.setAttribute("isAutoSaveEnabled",r.output.isAutoSaveEnabled.toString()),r.output.isPlatformAuthEnabled&&C.setAttribute("isPlatformAuthEnabled",r.output.isPlatformAuthEnabled.toString()),r.output.isDaggerOutput&&C.setAttribute("isDaggerOutput",r.output.isDaggerOutput.toString()),o.appendChild(C);break;case e.OutputType.error:a(r.output);break;case e.OutputType.github:const S=document.createElement(e.RENDERERS.GitHubWorkflowViewer);(i=r.output)!=null&&i.content&&S.setAttribute("state",JSON.stringify(r.output)),o.appendChild(S);break;case e.OutputType.gcp:const E=document.createElement(e.RENDERERS.GCPView);r.output&&E.setAttribute("state",JSON.stringify(r.output)),o.appendChild(E);break;case e.OutputType.aws:const j=document.createElement(e.RENDERERS.AWSView);r.output&&j.setAttribute("state",JSON.stringify(r.output)),o.appendChild(j);break;default:o.innerHTML="No renderer found!"}function a(d){o.innerHTML=`⚠️ ${d}`}},disposeOutputItem(){}});u.activate=l})();const ys=Rs.ClientMessages;Rs.__esModule;Rs.activate;const Bd=Rs.setContext,Nd=5e3,$d=1e3,Bs=4e3,ti=1e3;var jo=(u=>(u.CONTINUOUS="CONTINUOUS",u.INITIAL="INITIAL",u))(jo||{});class wo{constructor({knownID:e,runID:t,sequence:l},{runnerEndpoint:h,authorization:v,autoReconnect:o}){Ue(this,"callback");Ue(this,"queue",new dt);Ue(this,"subscriptions",[]);Ue(this,"reconnect",new dt);Ue(this,"client",new Xe);Ue(this,"_latencies",new dt);Ue(this,"_latenciesConnectable",Yt(this._latencies.asObservable().pipe(md((e,t)=>{if(t.latency<0){const l=e.get(t.streamID);l&&e.set(t.streamID,{...l,readyState:t.readyState})}else e.set(t.streamID,t);return e},new Map))));Ue(this,"_errors",new dt);Ue(this,"_errorsConnectable",Yt(this._errors.asObservable()));Ue(this,"_stdout",new dt);Ue(this,"_stderr",new dt);Ue(this,"_exitCode",new dt);Ue(this,"_pid",new dt);Ue(this,"_mimeType",new dt);Ue(this,"_stdoutConnectable",Yt(this._stdout.asObservable()));Ue(this,"_stderrConnectable",Yt(this._stderr.asObservable()));Ue(this,"_exitCodeConnectable",Yt(this._exitCode.asObservable()));Ue(this,"_pidConnectable",Yt(this._pid.asObservable()));Ue(this,"_mimeTypeConnectable",Yt(this._mimeType.asObservable()));Ue(this,"knownID");Ue(this,"runID");Ue(this,"sequence");Ue(this,"runnerEndpoint");Ue(this,"authorization");Ue(this,"autoReconnect");this.knownID=e,this.runID=t,this.sequence=l,this.runnerEndpoint=h,this.authorization=v,this.autoReconnect=o,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(Jr(ti,tn,{leading:!0,trailing:!0}),Xr(r=>this.useSocketClient(r.streamID).pipe(Xr(a=>this.useHeartbeat(a,r))))).pipe(pd()),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 id($d).pipe(yt(()=>this.autoReconnect),gn(this.reconnect),yt(([,t])=>t.heartbeat==="CONTINUOUS"),gn(this.latencies),at(([,t])=>Array.from(t.values()).filter(l=>l.readyState===WebSocket.OPEN&&l.latency>=Bs)),yt(t=>t.length>0),Jr(ti)).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 e=this.client.pipe(yt(o=>(o==null?void 0:o.readyState)===WebSocket.OPEN),Zr(1)),t=this.queue.pipe(ud(()=>e),yt(o=>o.length>0),at(o=>o.sort((r,a)=>{const n=s=>{var i;return!!((i=s.payload.value)!=null&&i.config)};return n(a)?1:n(r)?-1:0}))),l=this.queue.pipe(vd(e));return od(t.pipe(Is(o=>o)),l).pipe(gn(this.client),ks(([,o])=>o.readyState===WebSocket.OPEN),at(([o,r])=>ni({req:o,authorization:this.authorization,socket:r,knownID:this.knownID,runID:this.runID}))).subscribe({error:o=>{this._errors.next(o)}})}useSocketClient(e){return new Xe(t=>{const l=new URL(this.runnerEndpoint);l.searchParams.set("id",e),l.searchParams.set("runID",this.runID);const h=new WebSocket(l.toString()),v=n=>{if(console.log(new Date,`WebSocket transport ${e} closed`,n),n.code===1005){t.complete();return}if(this.autoReconnect){this.connect();return}},o=n=>{console.log(new Date,`WebSocket transport ${e} error`,n),this.autoReconnect||t.error(n)},r=n=>{var p,m;if(typeof n.data!="string"){console.warn("Unexpected WebSocket message type:",typeof n.data);return}let s;try{s=si(n.data),console.log("Received WebsocketResponse:",s)}catch(c){console.error("Failed to parse WebsocketResponse:",c)}const i=s.status;if(i&&i.code!==Dd.OK){t.error(i);return}if(s.pong)return;const d=s.payload.value;if(d.stdoutData&&d.stdoutData.length>0&&((p=this.callback)==null||p.call(this,{type:ys.terminalStdout,output:{"runme.dev/id":this.knownID,data:d.stdoutData}}),this._stdout.next(d.stdoutData)),d.stderrData&&d.stderrData.length>0&&((m=this.callback)==null||m.call(this,{type:ys.terminalStderr,output:{"runme.dev/id":this.knownID,data:d.stderrData}}),this._stderr.next(d.stderrData)),d.exitCode!==void 0&&(this._exitCode.next(d.exitCode),t.complete()),d.pid!==void 0&&this._pid.next(d.pid),d.mimeType){const f=d.mimeType.split(";")[0];this._mimeType.next(f)}},a=()=>{console.log(new Date,`✅ Connected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),t.next(h)};return h.addEventListener("close",v),h.addEventListener("error",o),h.addEventListener("message",r),h.addEventListener("open",a),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),h.removeEventListener("close",v),h.removeEventListener("error",o),h.removeEventListener("message",r),h.removeEventListener("open",a),h.close()}})}setCallback(e){this.callback=e}sendExecuteRequest(e){this.queue.next(it(On,{payload:{value:e,case:"executeRequest"}}))}useHeartbeat(e,{streamID:t,heartbeat:l}){return new Xe(h=>{const v=wn(e,"message").pipe(ks(()=>e.readyState===WebSocket.OPEN),at(s=>si(s.data)),at(s=>s.pong),yt(s=>s!==void 0),at(s=>({receivedAt:BigInt(Date.now()),pong:s}))),a=(l==="INITIAL"?bs(0):bs(0,Nd)).pipe(ks(()=>e.readyState===WebSocket.OPEN),at(()=>{const s={timestamp:BigInt(Date.now())};return it(On,{ping:s})}),Yr(s=>{ni({req:s,authorization:this.authorization,socket:e})}),at(s=>s.ping)).pipe(yt(s=>(s==null?void 0:s.timestamp)!==void 0),Is(s=>cd(v.pipe(yt(i=>i.pong.timestamp===s.timestamp),Zr(1),at(i=>{const d=s.timestamp,p=i.receivedAt;return Number(p-d)})),bs(Bs).pipe(at(()=>{throw new Error(`Pong not received within ${Bs}ms for stream ${t}`)}))).pipe(bo(i=>(this._latencies.next({streamID:t,latency:Bs,readyState:e.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",i.message),Hc(null))))),fd(()=>{this._latencies.next({streamID:t,latency:-1,readyState:e.readyState,updatedAt:BigInt(Date.now())})}),Yr(s=>{s!==null&&this._latencies.next({streamID:t,latency:s,readyState:e.readyState,updatedAt:BigInt(Date.now())})})),n=[];return n.push(a.subscribe({error:s=>{console.error("Unexpected error sending heartbeat",s)}})),h.next(e),()=>{n.forEach(s=>s.unsubscribe())}})}connect(e="CONTINUOUS"){const t=Ud(),l=this.latencies.pipe(at(h=>{const v=h.get(t);return v===void 0?null:v}),ks(h=>(h==null?void 0:h.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:t,heartbeat:e}),l}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(e=>e.unsubscribe())}}function si(u){const e=JSON.parse(u);return Ql(Ld,e)}function ni({req:u,authorization:e,socket:t,knownID:l,runID:h}){l&&(u.knownId=l),h&&(u.runId=h);const{bearerToken:v}=e;v&&u&&(u.authorization=`Bearer ${v}`),t.send(JSON.stringify(Vl(On,u)))}function Ud(){return Ad().replace(/-/g,"")}function Fd(){return`run_${wd()}`}function Vd({blockID:u,runID:e,sequence:t,commands:l,runner:h,settings:v={},onStdout:o,onStderr:r,onExitCode:a,onPid:n,onMimeType:s}){var S;const{rows:i=20,className:d,fontSize:p=12,fontFamily:m="monospace",takeFocus:c=!0,scrollToFit:f=!0}=v,g=ft.useMemo(()=>{if(!(!u||!e||!h.endpoint))return console.log("Creating stream",u,e,h.endpoint),new wo({knownID:u,runID:e,sequence:t},{runnerEndpoint:h.endpoint,authorization:h.authorization,autoReconnect:h.reconnect})},[u,e,t,h]);ft.useEffect(()=>{const E=g==null?void 0:g.connect().subscribe(j=>console.log(`Heartbeat latency for streamID ${j==null?void 0:j.streamID} (${(j==null?void 0:j.readyState)===1?"open":"closed"}): ${j==null?void 0:j.latency}ms`));return()=>{E==null||E.unsubscribe(),g==null||g.close()}},[g]);let _=it(Br,{rows:34,cols:100,x:0,y:0});const b=ft.useMemo(()=>it(mn,{sessionStrategy:Ll.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:"sh",background:!1,fileExtension:"",env:[`RUNME_ID=${u}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],source:{case:"commands",value:{items:l}},interactive:!0,mode:jl.INLINE,runId:e,knownId:u},winsize:_}),[u,l,_]),y=ft.useMemo(()=>{var E;return{output:{"runme.dev/id":(E=b.config)==null?void 0:E.knownId,fontFamily:m||"monospace",fontSize:p||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:c,scrollToFit:f,smoothScrollDuration:0,scrollback:4e3,initialRows:i,content:"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[m,p,c,i,(S=b.config)==null?void 0:S.knownId,f]),C=new TextEncoder;return Bd({postMessage:E=>{if(E.type===ys.terminalOpen||E.type===ys.terminalResize){const j=Number(E.output.terminalDimensions.columns),O=Number(E.output.terminalDimensions.rows);if(Number.isFinite(j)&&Number.isFinite(O)){if(_.cols===j&&_.rows===O)return;_=it(Br,{cols:j,rows:O,x:0,y:0});const I=it(mn,{winsize:_});g==null||g.sendExecuteRequest(I)}}if(E.type===ys.terminalStdin){const j=C.encode(E.output.input),O=it(mn,{inputData:j});g==null||g.sendExecuteRequest(O)}},onDidReceiveMessage:E=>{g==null||g.setCallback(E)}}),ft.useEffect(()=>{const E=g==null?void 0:g.stdout.subscribe(j=>{o==null||o(j)});return()=>E==null?void 0:E.unsubscribe()},[g,o]),ft.useEffect(()=>{const E=g==null?void 0:g.stderr.subscribe(j=>{r==null||r(j)});return()=>E==null?void 0:E.unsubscribe()},[g,r]),ft.useEffect(()=>{const E=g==null?void 0:g.exitCode.subscribe(j=>{a==null||a(j),g==null||g.close()});return()=>E==null?void 0:E.unsubscribe()},[g,a]),ft.useEffect(()=>{const E=g==null?void 0:g.pid.subscribe(j=>{n==null||n(j)});return()=>E==null?void 0:E.unsubscribe()},[g,n]),ft.useEffect(()=>{const E=g==null?void 0:g.mimeType.subscribe(j=>{s==null||s(j)});return()=>E==null?void 0:E.unsubscribe()},[g,s]),ft.useEffect(()=>{!g||!b||(console.log("useEffect invoked - Commands changed:",JSON.stringify(b.config.source.value)),g==null||g.sendExecuteRequest(b))},[b,g]),oa.jsx("div",{className:d,ref:E=>{if(!E||E.hasChildNodes())return;const j=document.createElement("terminal-view");j.setAttribute("buttons","false"),j.setAttribute("id",y.output["runme.dev/id"]),j.setAttribute("fontFamily",y.output.fontFamily),typeof y.output.fontSize=="number"&&j.setAttribute("fontSize",y.output.fontSize.toString()),y.output.cursorStyle&&j.setAttribute("cursorStyle",y.output.cursorStyle),typeof y.output.cursorBlink=="boolean"&&j.setAttribute("cursorBlink",y.output.cursorBlink?"true":"false"),typeof y.output.cursorWidth=="number"&&j.setAttribute("cursorWidth",y.output.cursorWidth.toString()),typeof y.output.takeFocus=="boolean"&&j.setAttribute("takeFocus",y.output.takeFocus?"true":"false"),typeof y.output.smoothScrollDuration=="number"&&j.setAttribute("smoothScrollDuration",y.output.smoothScrollDuration.toString()),typeof y.output.scrollback=="number"&&j.setAttribute("scrollback",y.output.scrollback.toString()),y.output.initialRows!==void 0&&j.setAttribute("initialRows",y.output.initialRows.toString()),y.output.content!==void 0&&j.setAttribute("initialContent",y.output.content),y.output.isAutoSaveEnabled&&j.setAttribute("isAutoSaveEnabled",y.output.isAutoSaveEnabled.toString()),y.output.isPlatformAuthEnabled&&j.setAttribute("isPlatformAuthEnabled",y.output.isPlatformAuthEnabled.toString()),E.appendChild(j);const O=document.createElement("div");O.setAttribute("className","h-1"),E.appendChild(O),setTimeout(()=>{f&&!Wd(O)&&O.scrollIntoView({behavior:"smooth"})},0)}})}function Wd(u){const e=u.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}exports.Console=Vd;exports.Heartbeat=jo;exports.Streams=wo;exports.genRunID=Fd;
|
|
6540
|
+
\*****************************/Object.defineProperty(u,"__esModule",{value:!0}),u.ClientMessages=u.setContext=u.activate=void 0;const e=gt("./src/constants.ts");Object.defineProperty(u,"ClientMessages",{enumerable:!0,get:function(){return e.ClientMessages}});const t=gt("./src/client/utils.ts");Object.defineProperty(u,"setContext",{enumerable:!0,get:function(){return t.setContext}}),gt("./src/client/components/index.ts");const l=h=>((0,t.setContext)(h),{renderOutputItem(v,o){var n,s,i;const r=v.json();switch(r.type){case e.OutputType.vercel:if(r.output.error){a(r.output.error);break}const d=document.createElement(e.RENDERERS.VercelOutput);d.setAttribute("content",JSON.stringify(r.output)),o.appendChild(d);break;case e.OutputType.daggerCall:if(!((n=r.output)!=null&&n.cellId))return;const p=document.createElement(e.RENDERERS.DaggerCli);p.setAttribute("cellId",r.output.cellId);const m={...r.output,cli:{status:"active"}};p.setAttribute("state",JSON.stringify(m)),o.appendChild(p);break;case e.OutputType.deno:if((s=r.output)!=null&&s.error){a(r.output.error);break}const c=r.output||{},f=document.createElement(e.RENDERERS.DenoOutput);f.setAttribute("state",JSON.stringify(c)),o.appendChild(f);break;case e.OutputType.outputItems:const g=decodeURIComponent(escape(window.atob(r.output.content))),_=document.createElement(e.RENDERERS.ShellOutput);_.innerHTML=g,o.appendChild(_);const b=document.createElement(e.RENDERERS.ShellOutputItems);b.setAttribute("id",r.output.id),b.setAttribute("content",g),o.appendChild(b);break;case e.OutputType.annotations:const y=document.createElement(e.RENDERERS.EditAnnotations);y.setAttribute("annotations",JSON.stringify(r.output.annotations??[])),y.setAttribute("validationErrors",JSON.stringify(r.output.validationErrors??[])),y.setAttribute("settings",JSON.stringify(r.output.settings)),o.appendChild(y);break;case e.OutputType.terminal:const C=document.createElement(e.RENDERERS.TerminalView);C.setAttribute("id",r.output["runme.dev/id"]),C.setAttribute("fontFamily",r.output.fontFamily),typeof r.output.fontSize=="number"&&C.setAttribute("fontSize",r.output.fontSize.toString()),r.output.cursorStyle&&C.setAttribute("cursorStyle",r.output.cursorStyle),typeof r.output.cursorBlink=="boolean"&&C.setAttribute("cursorBlink",r.output.cursorBlink?"true":"false"),typeof r.output.cursorWidth=="number"&&C.setAttribute("cursorWidth",r.output.cursorWidth.toString()),typeof r.output.smoothScrollDuration=="number"&&C.setAttribute("smoothScrollDuration",r.output.smoothScrollDuration.toString()),typeof r.output.scrollback=="number"&&C.setAttribute("scrollback",r.output.scrollback.toString()),r.output.initialRows!==void 0&&C.setAttribute("initialRows",r.output.initialRows.toString()),r.output.content!==void 0&&C.setAttribute("initialContent",r.output.content),r.output.isAutoSaveEnabled&&C.setAttribute("isAutoSaveEnabled",r.output.isAutoSaveEnabled.toString()),r.output.isPlatformAuthEnabled&&C.setAttribute("isPlatformAuthEnabled",r.output.isPlatformAuthEnabled.toString()),r.output.isDaggerOutput&&C.setAttribute("isDaggerOutput",r.output.isDaggerOutput.toString()),o.appendChild(C);break;case e.OutputType.error:a(r.output);break;case e.OutputType.github:const S=document.createElement(e.RENDERERS.GitHubWorkflowViewer);(i=r.output)!=null&&i.content&&S.setAttribute("state",JSON.stringify(r.output)),o.appendChild(S);break;case e.OutputType.gcp:const E=document.createElement(e.RENDERERS.GCPView);r.output&&E.setAttribute("state",JSON.stringify(r.output)),o.appendChild(E);break;case e.OutputType.aws:const j=document.createElement(e.RENDERERS.AWSView);r.output&&j.setAttribute("state",JSON.stringify(r.output)),o.appendChild(j);break;default:o.innerHTML="No renderer found!"}function a(d){o.innerHTML=`⚠️ ${d}`}},disposeOutputItem(){}});u.activate=l})();const bs=Ps.ClientMessages;Ps.__esModule;Ps.activate;const uc=Ps.setContext,hc=St("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),fc=gl(hc,0),mc=Wn(fc),pc=St("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Qi=St("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[pc,Zs]),jn=zs(Qi,3),vc=zs(Qi,4);var wn=function(u,e){return wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,l){t.__proto__=l}||function(t,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(t[h]=l[h])},wn(u,e)};function jt(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");wn(u,e);function t(){this.constructor=u}u.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function gc(u,e,t,l){function h(v){return v instanceof t?v:new t(function(o){o(v)})}return new(t||(t=Promise))(function(v,o){function r(s){try{n(l.next(s))}catch(i){o(i)}}function a(s){try{n(l.throw(s))}catch(i){o(i)}}function n(s){s.done?v(s.value):h(s.value).then(r,a)}n((l=l.apply(u,e||[])).next())})}function qi(u,e){var t={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},l,h,v,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=r(0),o.throw=r(1),o.return=r(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function r(n){return function(s){return a([n,s])}}function a(n){if(l)throw new TypeError("Generator is already executing.");for(;o&&(o=0,n[0]&&(t=0)),t;)try{if(l=1,h&&(v=n[0]&2?h.return:n[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,n[1])).done)return v;switch(h=0,v&&(n=[n[0]&2,v.value]),n[0]){case 0:case 1:v=n;break;case 4:return t.label++,{value:n[1],done:!1};case 5:t.label++,h=n[1],n=[0];continue;case 7:n=t.ops.pop(),t.trys.pop();continue;default:if(v=t.trys,!(v=v.length>0&&v[v.length-1])&&(n[0]===6||n[0]===2)){t=0;continue}if(n[0]===3&&(!v||n[1]>v[0]&&n[1]<v[3])){t.label=n[1];break}if(n[0]===6&&t.label<v[1]){t.label=v[1],v=n;break}if(v&&t.label<v[2]){t.label=v[2],t.ops.push(n);break}v[2]&&t.ops.pop(),t.trys.pop();continue}n=e.call(u,t)}catch(s){n=[6,s],h=0}finally{l=v=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}function cs(u){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&u[e],l=0;if(t)return t.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&l>=u.length&&(u=void 0),{value:u&&u[l++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _t(u,e){var t=typeof Symbol=="function"&&u[Symbol.iterator];if(!t)return u;var l=t.call(u),h,v=[],o;try{for(;(e===void 0||e-- >0)&&!(h=l.next()).done;)v.push(h.value)}catch(r){o={error:r}}finally{try{h&&!h.done&&(t=l.return)&&t.call(l)}finally{if(o)throw o.error}}return v}function Et(u,e,t){if(t||arguments.length===2)for(var l=0,h=e.length,v;l<h;l++)(v||!(l in e))&&(v||(v=Array.prototype.slice.call(e,0,l)),v[l]=e[l]);return u.concat(v||Array.prototype.slice.call(e))}function is(u){return this instanceof is?(this.v=u,this):new is(u)}function _c(u,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=t.apply(u,e||[]),h,v=[];return h=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),r("next"),r("throw"),r("return",o),h[Symbol.asyncIterator]=function(){return this},h;function o(p){return function(m){return Promise.resolve(m).then(p,i)}}function r(p,m){l[p]&&(h[p]=function(c){return new Promise(function(f,g){v.push([p,c,f,g])>1||a(p,c)})},m&&(h[p]=m(h[p])))}function a(p,m){try{n(l[p](m))}catch(c){d(v[0][3],c)}}function n(p){p.value instanceof is?Promise.resolve(p.value.v).then(s,i):d(v[0][2],p)}function s(p){a("next",p)}function i(p){a("throw",p)}function d(p,m){p(m),v.shift(),v.length&&a(v[0][0],v[0][1])}}function bc(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=u[Symbol.asyncIterator],t;return e?e.call(u):(u=typeof cs=="function"?cs(u):u[Symbol.iterator](),t={},l("next"),l("throw"),l("return"),t[Symbol.asyncIterator]=function(){return this},t);function l(v){t[v]=u[v]&&function(o){return new Promise(function(r,a){o=u[v](o),h(r,a,o.done,o.value)})}}function h(v,o,r,a){Promise.resolve(a).then(function(n){v({value:n,done:r})},o)}}function Ne(u){return typeof u=="function"}function eo(u){var e=function(l){Error.call(l),l.stack=new Error().stack},t=u(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var pn=eo(function(u){return function(t){u(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
6541
|
+
`+t.map(function(l,h){return h+1+") "+l.toString()}).join(`
|
|
6542
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Hs(u,e){if(u){var t=u.indexOf(e);0<=t&&u.splice(t,1)}}var Rs=function(){function u(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return u.prototype.unsubscribe=function(){var e,t,l,h,v;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var r=cs(o),a=r.next();!a.done;a=r.next()){var n=a.value;n.remove(this)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}else o.remove(this);var s=this.initialTeardown;if(Ne(s))try{s()}catch(c){v=c instanceof pn?c.errors:[c]}var i=this._finalizers;if(i){this._finalizers=null;try{for(var d=cs(i),p=d.next();!p.done;p=d.next()){var m=p.value;try{Wr(m)}catch(c){v=v??[],c instanceof pn?v=Et(Et([],_t(v)),_t(c.errors)):v.push(c)}}}catch(c){l={error:c}}finally{try{p&&!p.done&&(h=d.return)&&h.call(d)}finally{if(l)throw l.error}}}if(v)throw new pn(v)}},u.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Wr(e);else{if(e instanceof u){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},u.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},u.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},u.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Hs(t,e)},u.prototype.remove=function(e){var t=this._finalizers;t&&Hs(t,e),e instanceof u&&e._removeParent(this)},u.EMPTY=function(){var e=new u;return e.closed=!0,e}(),u}(),to=Rs.EMPTY;function so(u){return u instanceof Rs||u&&"closed"in u&&Ne(u.remove)&&Ne(u.add)&&Ne(u.unsubscribe)}function Wr(u){Ne(u)?u():u.unsubscribe()}var yc={Promise:void 0},Cc={setTimeout:function(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];return setTimeout.apply(void 0,Et([u,e],_t(t)))},clearTimeout:function(u){return clearTimeout(u)},delegate:void 0};function no(u){Cc.setTimeout(function(){throw u})}function ws(){}function Us(u){u()}var Yn=function(u){jt(e,u);function e(t){var l=u.call(this)||this;return l.isStopped=!1,t?(l.destination=t,so(t)&&t.add(l)):l.destination=jc,l}return e.create=function(t,l,h){return new Os(t,l,h)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,u.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Rs),Ec=function(){function u(e){this.partialObserver=e}return u.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(l){Ls(l)}},u.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(l){Ls(l)}else Ls(e)},u.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Ls(t)}},u}(),Os=function(u){jt(e,u);function e(t,l,h){var v=u.call(this)||this,o;return Ne(t)||!t?o={next:t??void 0,error:l??void 0,complete:h??void 0}:o=t,v.destination=new Ec(o),v}return e}(Yn);function Ls(u){no(u)}function Sc(u){throw u}var jc={closed:!0,next:ws,error:Sc,complete:ws},Jn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function en(u){return u}function wc(u){return u.length===0?en:u.length===1?u[0]:function(t){return u.reduce(function(l,h){return h(l)},t)}}var Xe=function(){function u(e){e&&(this._subscribe=e)}return u.prototype.lift=function(e){var t=new u;return t.source=this,t.operator=e,t},u.prototype.subscribe=function(e,t,l){var h=this,v=Ic(e)?e:new Os(e,t,l);return Us(function(){var o=h,r=o.operator,a=o.source;v.add(r?r.call(v,a):a?h._subscribe(v):h._trySubscribe(v))}),v},u.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},u.prototype.forEach=function(e,t){var l=this;return t=Hr(t),new t(function(h,v){var o=new Os({next:function(r){try{e(r)}catch(a){v(a),o.unsubscribe()}},error:v,complete:h});l.subscribe(o)})},u.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},u.prototype[Jn]=function(){return this},u.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wc(e)(this)},u.prototype.toPromise=function(e){var t=this;return e=Hr(e),new e(function(l,h){var v;t.subscribe(function(o){return v=o},function(o){return h(o)},function(){return l(v)})})},u.create=function(e){return new u(e)},u}();function Hr(u){var e;return(e=u??yc.Promise)!==null&&e!==void 0?e:Promise}function Oc(u){return u&&Ne(u.next)&&Ne(u.error)&&Ne(u.complete)}function Ic(u){return u&&u instanceof Yn||Oc(u)&&so(u)}function Tc(u){return Ne(u==null?void 0:u.lift)}function st(u){return function(e){if(Tc(e))return e.lift(function(t){try{return u(t,this)}catch(l){this.error(l)}});throw new TypeError("Unable to lift unknown Observable type")}}function ze(u,e,t,l,h){return new xc(u,e,t,l,h)}var xc=function(u){jt(e,u);function e(t,l,h,v,o,r){var a=u.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=r,a._next=l?function(n){try{l(n)}catch(s){t.error(s)}}:u.prototype._next,a._error=v?function(n){try{v(n)}catch(s){t.error(s)}finally{this.unsubscribe()}}:u.prototype._error,a._complete=h?function(){try{h()}catch(n){t.error(n)}finally{this.unsubscribe()}}:u.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var l=this.closed;u.prototype.unsubscribe.call(this),!l&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(Yn),Ac=eo(function(u){return function(){u(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),dt=function(u){jt(e,u);function e(){var t=u.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var l=new Kr(this,this);return l.operator=t,l},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ac},e.prototype.next=function(t){var l=this;Us(function(){var h,v;if(l._throwIfClosed(),!l.isStopped){l.currentObservers||(l.currentObservers=Array.from(l.observers));try{for(var o=cs(l.currentObservers),r=o.next();!r.done;r=o.next()){var a=r.value;a.next(t)}}catch(n){h={error:n}}finally{try{r&&!r.done&&(v=o.return)&&v.call(o)}finally{if(h)throw h.error}}}})},e.prototype.error=function(t){var l=this;Us(function(){if(l._throwIfClosed(),!l.isStopped){l.hasError=l.isStopped=!0,l.thrownError=t;for(var h=l.observers;h.length;)h.shift().error(t)}})},e.prototype.complete=function(){var t=this;Us(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var l=t.observers;l.length;)l.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),u.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var l=this,h=this,v=h.hasError,o=h.isStopped,r=h.observers;return v||o?to:(this.currentObservers=null,r.push(t),new Rs(function(){l.currentObservers=null,Hs(r,t)}))},e.prototype._checkFinalizedStatuses=function(t){var l=this,h=l.hasError,v=l.thrownError,o=l.isStopped;h?t.error(v):o&&t.complete()},e.prototype.asObservable=function(){var t=new Xe;return t.source=this,t},e.create=function(t,l){return new Kr(t,l)},e}(Xe),Kr=function(u){jt(e,u);function e(t,l){var h=u.call(this)||this;return h.destination=t,h.source=l,h}return e.prototype.next=function(t){var l,h;(h=(l=this.destination)===null||l===void 0?void 0:l.next)===null||h===void 0||h.call(l,t)},e.prototype.error=function(t){var l,h;(h=(l=this.destination)===null||l===void 0?void 0:l.error)===null||h===void 0||h.call(l,t)},e.prototype.complete=function(){var t,l;(l=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||l===void 0||l.call(t)},e.prototype._subscribe=function(t){var l,h;return(h=(l=this.source)===null||l===void 0?void 0:l.subscribe(t))!==null&&h!==void 0?h:to},e}(dt),Pc={now:function(){return Date.now()}},Rc=function(u){jt(e,u);function e(t,l){return u.call(this)||this}return e.prototype.schedule=function(t,l){return this},e}(Rs),Gr={setInterval:function(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];return setInterval.apply(void 0,Et([u,e],_t(t)))},clearInterval:function(u){return clearInterval(u)},delegate:void 0},Dc=function(u){jt(e,u);function e(t,l){var h=u.call(this,t,l)||this;return h.scheduler=t,h.work=l,h.pending=!1,h}return e.prototype.schedule=function(t,l){var h;if(l===void 0&&(l=0),this.closed)return this;this.state=t;var v=this.id,o=this.scheduler;return v!=null&&(this.id=this.recycleAsyncId(o,v,l)),this.pending=!0,this.delay=l,this.id=(h=this.id)!==null&&h!==void 0?h:this.requestAsyncId(o,this.id,l),this},e.prototype.requestAsyncId=function(t,l,h){return h===void 0&&(h=0),Gr.setInterval(t.flush.bind(t,this),h)},e.prototype.recycleAsyncId=function(t,l,h){if(h===void 0&&(h=0),h!=null&&this.delay===h&&this.pending===!1)return l;l!=null&&Gr.clearInterval(l)},e.prototype.execute=function(t,l){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var h=this._execute(t,l);if(h)return h;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,l){var h=!1,v;try{this.work(t)}catch(o){h=!0,v=o||new Error("Scheduled action threw falsy error")}if(h)return this.unsubscribe(),v},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,l=t.id,h=t.scheduler,v=h.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Hs(v,this),l!=null&&(this.id=this.recycleAsyncId(h,l,null)),this.delay=null,u.prototype.unsubscribe.call(this)}},e}(Rc),zr=function(){function u(e,t){t===void 0&&(t=u.now),this.schedulerActionCtor=e,this.now=t}return u.prototype.schedule=function(e,t,l){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(l,t)},u.now=Pc.now,u}(),Mc=function(u){jt(e,u);function e(t,l){l===void 0&&(l=zr.now);var h=u.call(this,t,l)||this;return h.actions=[],h._active=!1,h}return e.prototype.flush=function(t){var l=this.actions;if(this._active){l.push(t);return}var h;this._active=!0;do if(h=t.execute(t.state,t.delay))break;while(t=l.shift());if(this._active=!1,h){for(;t=l.shift();)t.unsubscribe();throw h}},e}(zr),tn=new Mc(Dc),Lc=tn,ro=new Xe(function(u){return u.complete()});function io(u){return u&&Ne(u.schedule)}function Qn(u){return u[u.length-1]}function kc(u){return Ne(Qn(u))?u.pop():void 0}function oo(u){return io(Qn(u))?u.pop():void 0}function Bc(u,e){return typeof Qn(u)=="number"?u.pop():e}var qn=function(u){return u&&typeof u.length=="number"&&typeof u!="function"};function ao(u){return Ne(u==null?void 0:u.then)}function lo(u){return Ne(u[Jn])}function co(u){return Symbol.asyncIterator&&Ne(u==null?void 0:u[Symbol.asyncIterator])}function uo(u){return new TypeError("You provided "+(u!==null&&typeof u=="object"?"an invalid object":"'"+u+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Nc(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ho=Nc();function fo(u){return Ne(u==null?void 0:u[ho])}function mo(u){return _c(this,arguments,function(){var t,l,h,v;return qi(this,function(o){switch(o.label){case 0:t=u.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,is(t.read())];case 3:return l=o.sent(),h=l.value,v=l.done,v?[4,is(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,is(h)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function po(u){return Ne(u==null?void 0:u.getReader)}function qe(u){if(u instanceof Xe)return u;if(u!=null){if(lo(u))return $c(u);if(qn(u))return Uc(u);if(ao(u))return Fc(u);if(co(u))return vo(u);if(fo(u))return Vc(u);if(po(u))return Wc(u)}throw uo(u)}function $c(u){return new Xe(function(e){var t=u[Jn]();if(Ne(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Uc(u){return new Xe(function(e){for(var t=0;t<u.length&&!e.closed;t++)e.next(u[t]);e.complete()})}function Fc(u){return new Xe(function(e){u.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,no)})}function Vc(u){return new Xe(function(e){var t,l;try{for(var h=cs(u),v=h.next();!v.done;v=h.next()){var o=v.value;if(e.next(o),e.closed)return}}catch(r){t={error:r}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(t)throw t.error}}e.complete()})}function vo(u){return new Xe(function(e){Hc(u,e).catch(function(t){return e.error(t)})})}function Wc(u){return vo(mo(u))}function Hc(u,e){var t,l,h,v;return gc(this,void 0,void 0,function(){var o,r;return qi(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=bc(u),a.label=1;case 1:return[4,t.next()];case 2:if(l=a.sent(),!!l.done)return[3,4];if(o=l.value,e.next(o),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return r=a.sent(),h={error:r},[3,11];case 6:return a.trys.push([6,,9,10]),l&&!l.done&&(v=t.return)?[4,v.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(h)throw h.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function qt(u,e,t,l,h){l===void 0&&(l=0),h===void 0&&(h=!1);var v=e.schedule(function(){t(),h?u.add(this.schedule(null,l)):this.unsubscribe()},l);if(u.add(v),!h)return v}function go(u,e){return e===void 0&&(e=0),st(function(t,l){t.subscribe(ze(l,function(h){return qt(l,u,function(){return l.next(h)},e)},function(){return qt(l,u,function(){return l.complete()},e)},function(h){return qt(l,u,function(){return l.error(h)},e)}))})}function _o(u,e){return e===void 0&&(e=0),st(function(t,l){l.add(u.schedule(function(){return t.subscribe(l)},e))})}function Kc(u,e){return qe(u).pipe(_o(e),go(e))}function Gc(u,e){return qe(u).pipe(_o(e),go(e))}function zc(u,e){return new Xe(function(t){var l=0;return e.schedule(function(){l===u.length?t.complete():(t.next(u[l++]),t.closed||this.schedule())})})}function Zc(u,e){return new Xe(function(t){var l;return qt(t,e,function(){l=u[ho](),qt(t,e,function(){var h,v,o;try{h=l.next(),v=h.value,o=h.done}catch(r){t.error(r);return}o?t.complete():t.next(v)},0,!0)}),function(){return Ne(l==null?void 0:l.return)&&l.return()}})}function bo(u,e){if(!u)throw new Error("Iterable cannot be null");return new Xe(function(t){qt(t,e,function(){var l=u[Symbol.asyncIterator]();qt(t,e,function(){l.next().then(function(h){h.done?t.complete():t.next(h.value)})},0,!0)})})}function Xc(u,e){return bo(mo(u),e)}function Yc(u,e){if(u!=null){if(lo(u))return Kc(u,e);if(qn(u))return zc(u,e);if(ao(u))return Gc(u,e);if(co(u))return bo(u,e);if(fo(u))return Zc(u,e);if(po(u))return Xc(u,e)}throw uo(u)}function yo(u,e){return e?Yc(u,e):qe(u)}function Jc(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=oo(u);return yo(u,t)}function Qc(u){return u instanceof Date&&!isNaN(u)}function at(u,e){return st(function(t,l){var h=0;t.subscribe(ze(l,function(v){l.next(u.call(e,v,h++))}))})}var qc=Array.isArray;function ed(u,e){return qc(e)?u.apply(void 0,Et([],_t(e))):u(e)}function td(u){return at(function(e){return ed(u,e)})}function sd(u,e,t,l,h,v,o,r){var a=[],n=0,s=0,i=!1,d=function(){i&&!a.length&&!n&&e.complete()},p=function(c){return n<l?m(c):a.push(c)},m=function(c){n++;var f=!1;qe(t(c,s++)).subscribe(ze(e,function(g){e.next(g)},function(){f=!0},void 0,function(){if(f)try{n--;for(var g=function(){var _=a.shift();o||m(_)};a.length&&n<l;)g();d()}catch(_){e.error(_)}}))};return u.subscribe(ze(e,p,function(){i=!0,d()})),function(){}}function Is(u,e,t){return t===void 0&&(t=1/0),Ne(e)?Is(function(l,h){return at(function(v,o){return e(l,v,h,o)})(qe(u(l,h)))},t):(typeof e=="number"&&(t=e),st(function(l,h){return sd(l,h,u,t)}))}function nd(u){return u===void 0&&(u=1/0),Is(en,u)}function rd(u){return new Xe(function(e){qe(u()).subscribe(e)})}var id={connector:function(){return new dt},resetOnDisconnect:!0};function Yt(u,e){e===void 0&&(e=id);var t=null,l=e.connector,h=e.resetOnDisconnect,v=h===void 0?!0:h,o=l(),r=new Xe(function(a){return o.subscribe(a)});return r.connect=function(){return(!t||t.closed)&&(t=rd(function(){return u}).subscribe(o),v&&t.add(function(){return o=l()})),t},r}var od=["addListener","removeListener"],ad=["addEventListener","removeEventListener"],ld=["on","off"];function On(u,e,t,l){if(Ne(t)&&(l=t,t=void 0),l)return On(u,e,t).pipe(td(l));var h=_t(ud(u)?ad.map(function(r){return function(a){return u[r](e,a,t)}}):cd(u)?od.map(Zr(u,e)):dd(u)?ld.map(Zr(u,e)):[],2),v=h[0],o=h[1];if(!v&&qn(u))return Is(function(r){return On(r,e,t)})(qe(u));if(!v)throw new TypeError("Invalid event target");return new Xe(function(r){var a=function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return r.next(1<n.length?n:n[0])};return v(a),function(){return o(a)}})}function Zr(u,e){return function(t){return function(l){return u[t](e,l)}}}function cd(u){return Ne(u.addListener)&&Ne(u.removeListener)}function dd(u){return Ne(u.on)&&Ne(u.off)}function ud(u){return Ne(u.addEventListener)&&Ne(u.removeEventListener)}function ys(u,e,t){u===void 0&&(u=0),t===void 0&&(t=Lc);var l=-1;return e!=null&&(io(e)?t=e:l=e),new Xe(function(h){var v=Qc(u)?+u-t.now():u;v<0&&(v=0);var o=0;return t.schedule(function(){h.closed||(h.next(o++),0<=l?this.schedule(void 0,l):h.complete())},v)})}function hd(u,e){return e===void 0&&(e=tn),ys(u,u,e)}function fd(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=oo(u),l=Bc(u,1/0),h=u;return h.length?h.length===1?qe(h[0]):nd(l)(yo(h,t)):ro}var md=Array.isArray;function pd(u){return u.length===1&&md(u[0])?u[0]:u}function yt(u,e){return st(function(t,l){var h=0;t.subscribe(ze(l,function(v){return u.call(e,v,h++)&&l.next(v)}))})}function vd(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return u=pd(u),u.length===1?qe(u[0]):new Xe(gd(u))}function gd(u){return function(e){for(var t=[],l=function(v){t.push(qe(u[v]).subscribe(ze(e,function(o){if(t){for(var r=0;r<t.length;r++)r!==v&&t[r].unsubscribe();t=null}e.next(o)})))},h=0;t&&!e.closed&&h<u.length;h++)l(h)}}function _d(u){return st(function(e,t){var l=null,h=null,v=function(){h==null||h.unsubscribe();var o=l;l=[],o&&t.next(o),qe(u()).subscribe(h=ze(t,v,ws))};v(),e.subscribe(ze(t,function(o){return l==null?void 0:l.push(o)},function(){l&&t.next(l),t.complete()},void 0,function(){return l=h=null}))})}function Co(u){return st(function(e,t){var l=null,h=!1,v;l=e.subscribe(ze(t,void 0,void 0,function(o){v=qe(u(o,Co(u)(e))),l?(l.unsubscribe(),l=null,v.subscribe(t)):h=!0})),h&&(l.unsubscribe(),l=null,v.subscribe(t))})}function bd(u,e,t,l,h){return function(v,o){var r=t,a=e,n=0;v.subscribe(ze(o,function(s){var i=n++;a=r?u(a,s,i):(r=!0,s),o.next(a)},h))}}function Xr(u){return u<=0?function(){return ro}:st(function(e,t){var l=0;e.subscribe(ze(t,function(h){++l<=u&&(t.next(h),u<=l&&t.complete())}))})}function yd(u){return st(function(e,t){try{e.subscribe(t)}finally{t.add(u)}})}function Cd(u,e){return st(bd(u,e,arguments.length>=2,!0))}function Ed(u){u===void 0&&(u={});var e=u.connector,t=e===void 0?function(){return new dt}:e,l=u.resetOnError,h=l===void 0?!0:l,v=u.resetOnComplete,o=v===void 0?!0:v,r=u.resetOnRefCountZero,a=r===void 0?!0:r;return function(n){var s,i,d,p=0,m=!1,c=!1,f=function(){i==null||i.unsubscribe(),i=void 0},g=function(){f(),s=d=void 0,m=c=!1},_=function(){var b=s;g(),b==null||b.unsubscribe()};return st(function(b,y){p++,!c&&!m&&f();var C=d=d??t();y.add(function(){p--,p===0&&!c&&!m&&(i=vn(_,a))}),C.subscribe(y),!s&&p>0&&(s=new Os({next:function(S){return C.next(S)},error:function(S){c=!0,f(),i=vn(g,h,S),C.error(S)},complete:function(){m=!0,f(),i=vn(g,o),C.complete()}}),qe(b).subscribe(s))})(n)}}function vn(u,e){for(var t=[],l=2;l<arguments.length;l++)t[l-2]=arguments[l];if(e===!0){u();return}if(e!==!1){var h=new Os({next:function(){h.unsubscribe(),u()}});return qe(e.apply(void 0,Et([],_t(t)))).subscribe(h)}}function Sd(u){return st(function(e,t){var l=!1,h=ze(t,function(){h==null||h.unsubscribe(),l=!0},ws);qe(u).subscribe(h),e.subscribe(ze(t,function(v){return l&&t.next(v)}))})}function Yr(u,e){return st(function(t,l){var h=null,v=0,o=!1,r=function(){return o&&!h&&l.complete()};t.subscribe(ze(l,function(a){h==null||h.unsubscribe();var n=0,s=v++;qe(u(a,s)).subscribe(h=ze(l,function(i){return l.next(e?e(a,i,s,n++):i)},function(){h=null,r()}))},function(){o=!0,r()}))})}function ks(u,e){return e===void 0&&(e=!1),st(function(t,l){var h=0;t.subscribe(ze(l,function(v){var o=u(v,h++);(o||e)&&l.next(v),!o&&l.complete()}))})}function Jr(u,e,t){var l=Ne(u)||e||t?{next:u,error:e,complete:t}:u;return l?st(function(h,v){var o;(o=l.subscribe)===null||o===void 0||o.call(l);var r=!0;h.subscribe(ze(v,function(a){var n;(n=l.next)===null||n===void 0||n.call(l,a),v.next(a)},function(){var a;r=!1,(a=l.complete)===null||a===void 0||a.call(l),v.complete()},function(a){var n;r=!1,(n=l.error)===null||n===void 0||n.call(l,a),v.error(a)},function(){var a,n;r&&((a=l.unsubscribe)===null||a===void 0||a.call(l)),(n=l.finalize)===null||n===void 0||n.call(l)}))}):en}function jd(u,e){return st(function(t,l){var h=e??{},v=h.leading,o=v===void 0?!0:v,r=h.trailing,a=r===void 0?!1:r,n=!1,s=null,i=null,d=!1,p=function(){i==null||i.unsubscribe(),i=null,a&&(f(),d&&l.complete())},m=function(){i=null,d&&l.complete()},c=function(g){return i=qe(u(g)).subscribe(ze(l,p,m))},f=function(){if(n){n=!1;var g=s;s=null,l.next(g),!d&&c(g)}};t.subscribe(ze(l,function(g){n=!0,s=g,!(i&&!i.closed)&&(o?f():c(g))},function(){d=!0,!(a&&n&&i&&!i.closed)&&l.complete()}))})}function Qr(u,e,t){e===void 0&&(e=tn);var l=ys(u,e);return jd(function(){return l},t)}function gn(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];var t=kc(u);return st(function(l,h){for(var v=u.length,o=new Array(v),r=u.map(function(){return!1}),a=!1,n=function(i){qe(u[i]).subscribe(ze(h,function(d){o[i]=d,!a&&!r[i]&&(r[i]=!0,(a=r.every(en))&&(r=null))},ws))},s=0;s<v;s++)n(s);l.subscribe(ze(h,function(i){if(a){var d=Et([i],_t(o));h.next(t?t.apply(void 0,Et([],_t(d))):d)}}))})}const Eo="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ks=32,wd=16,So=10,qr=0xffffffffffff;var Qt;(function(u){u.Base32IncorrectEncoding="B32_ENC_INVALID",u.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",u.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",u.EncodeTimeNegative="ENC_TIME_NEG",u.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",u.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",u.PRNGDetectFailure="PRNG_DETECT",u.ULIDInvalid="ULID_INVALID",u.Unexpected="UNEXPECTED",u.UUIDInvalid="UUID_INVALID"})(Qt||(Qt={}));class gs extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function Od(u){const e=Math.floor(u()*Ks)%Ks;return Eo.charAt(e)}function Id(u){const e=Td(),t=e&&(e.crypto||e.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const l=new Uint8Array(1);return t.getRandomValues(l),l[0]/255};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/255;throw new gs(Qt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Td(){return Pd()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function xd(u,e){let t="";for(;u>0;u--)t=Od(e)+t;return t}function Ad(u,e=So){if(isNaN(u))throw new gs(Qt.EncodeTimeValueMalformed,`Time must be a number: ${u}`);if(u>qr)throw new gs(Qt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${qr}: ${u}`);if(u<0)throw new gs(Qt.EncodeTimeNegative,`Time must be positive: ${u}`);if(Number.isInteger(u)===!1)throw new gs(Qt.EncodeTimeValueMalformed,`Time must be an integer: ${u}`);let t,l="";for(let h=e;h>0;h--)t=u%Ks,l=Eo.charAt(t)+l,u=(u-t)/Ks;return l}function Pd(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Rd(u,e){const t=Id(),l=Date.now();return Ad(l,So)+xd(wd,t)}const tt=[];for(let u=0;u<256;++u)tt.push((u+256).toString(16).slice(1));function Dd(u,e=0){return(tt[u[e+0]]+tt[u[e+1]]+tt[u[e+2]]+tt[u[e+3]]+"-"+tt[u[e+4]]+tt[u[e+5]]+"-"+tt[u[e+6]]+tt[u[e+7]]+"-"+tt[u[e+8]]+tt[u[e+9]]+"-"+tt[u[e+10]]+tt[u[e+11]]+tt[u[e+12]]+tt[u[e+13]]+tt[u[e+14]]+tt[u[e+15]]).toLowerCase()}let _n;const Md=new Uint8Array(16);function Ld(){if(!_n){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");_n=crypto.getRandomValues.bind(crypto)}return _n(Md)}const kd=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ei={randomUUID:kd};function Bd(u,e,t){var h;if(ei.randomUUID&&!u)return ei.randomUUID();u=u||{};const l=u.random??((h=u.rng)==null?void 0:h.call(u))??Ld();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Dd(l)}const Nd=5e3,$d=1e3,Bs=4e3,ti=1e3;var jo=(u=>(u.CONTINUOUS="CONTINUOUS",u.INITIAL="INITIAL",u))(jo||{});class wo{constructor({knownID:e,runID:t,sequence:l},{runnerEndpoint:h,authorization:v,autoReconnect:o}){Ue(this,"callback");Ue(this,"queue",new dt);Ue(this,"subscriptions",[]);Ue(this,"reconnect",new dt);Ue(this,"client",new Xe);Ue(this,"_latencies",new dt);Ue(this,"_latenciesConnectable",Yt(this._latencies.asObservable().pipe(Cd((e,t)=>{if(t.latency<0){const l=e.get(t.streamID);l&&e.set(t.streamID,{...l,readyState:t.readyState})}else e.set(t.streamID,t);return e},new Map))));Ue(this,"_errors",new dt);Ue(this,"_errorsConnectable",Yt(this._errors.asObservable()));Ue(this,"_stdout",new dt);Ue(this,"_stderr",new dt);Ue(this,"_exitCode",new dt);Ue(this,"_pid",new dt);Ue(this,"_mimeType",new dt);Ue(this,"_stdoutConnectable",Yt(this._stdout.asObservable()));Ue(this,"_stderrConnectable",Yt(this._stderr.asObservable()));Ue(this,"_exitCodeConnectable",Yt(this._exitCode.asObservable()));Ue(this,"_pidConnectable",Yt(this._pid.asObservable()));Ue(this,"_mimeTypeConnectable",Yt(this._mimeType.asObservable()));Ue(this,"knownID");Ue(this,"runID");Ue(this,"sequence");Ue(this,"runnerEndpoint");Ue(this,"authorization");Ue(this,"autoReconnect");this.knownID=e,this.runID=t,this.sequence=l,this.runnerEndpoint=h,this.authorization=v,this.autoReconnect=o,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(Qr(ti,tn,{leading:!0,trailing:!0}),Yr(r=>this.useSocketClient(r.streamID).pipe(Yr(a=>this.useHeartbeat(a,r))))).pipe(Ed()),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 hd($d).pipe(yt(()=>this.autoReconnect),gn(this.reconnect),yt(([,t])=>t.heartbeat==="CONTINUOUS"),gn(this.latencies),at(([,t])=>Array.from(t.values()).filter(l=>l.readyState===WebSocket.OPEN&&l.latency>=Bs)),yt(t=>t.length>0),Qr(ti)).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 e=this.client.pipe(yt(o=>(o==null?void 0:o.readyState)===WebSocket.OPEN),Xr(1)),t=this.queue.pipe(_d(()=>e),yt(o=>o.length>0),at(o=>o.sort((r,a)=>{const n=s=>{var i;return!!((i=s.payload.value)!=null&&i.config)};return n(a)?1:n(r)?-1:0}))),l=this.queue.pipe(Sd(e));return fd(t.pipe(Is(o=>o)),l).pipe(gn(this.client),ks(([,o])=>o.readyState===WebSocket.OPEN),at(([o,r])=>ni({req:o,authorization:this.authorization,socket:r,knownID:this.knownID,runID:this.runID}))).subscribe({error:o=>{this._errors.next(o)}})}useSocketClient(e){return new Xe(t=>{const l=new URL(this.runnerEndpoint);l.searchParams.set("id",e),l.searchParams.set("runID",this.runID);const h=new WebSocket(l.toString()),v=n=>{if(console.log(new Date,`WebSocket transport ${e} closed`,n),n.code===1005){t.complete();return}if(this.autoReconnect){this.connect();return}},o=n=>{console.log(new Date,`WebSocket transport ${e} error`,n),this.autoReconnect||t.error(n)},r=n=>{var p,m;if(typeof n.data!="string"){console.warn("Unexpected WebSocket message type:",typeof n.data);return}let s;try{s=si(n.data),console.log("Received WebsocketResponse:",s)}catch(c){console.error("Failed to parse WebsocketResponse:",c)}const i=s.status;if(i&&i.code!==mc.OK){t.error(i);return}if(s.pong)return;const d=s.payload.value;if(d.stdoutData&&d.stdoutData.length>0&&((p=this.callback)==null||p.call(this,{type:bs.terminalStdout,output:{"runme.dev/id":this.knownID,data:d.stdoutData}}),this._stdout.next(d.stdoutData)),d.stderrData&&d.stderrData.length>0&&((m=this.callback)==null||m.call(this,{type:bs.terminalStderr,output:{"runme.dev/id":this.knownID,data:d.stderrData}}),this._stderr.next(d.stderrData)),d.exitCode!==void 0&&(this._exitCode.next(d.exitCode),t.complete()),d.pid!==void 0&&this._pid.next(d.pid),d.mimeType){const f=d.mimeType.split(";")[0];this._mimeType.next(f)}},a=()=>{console.log(new Date,`✅ Connected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),t.next(h)};return h.addEventListener("close",v),h.addEventListener("error",o),h.addEventListener("message",r),h.addEventListener("open",a),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for block ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),h.removeEventListener("close",v),h.removeEventListener("error",o),h.removeEventListener("message",r),h.removeEventListener("open",a),h.close()}})}setCallback(e){this.callback=e}sendExecuteRequest(e){this.queue.next(it(jn,{payload:{value:e,case:"executeRequest"}}))}useHeartbeat(e,{streamID:t,heartbeat:l}){return new Xe(h=>{const v=On(e,"message").pipe(ks(()=>e.readyState===WebSocket.OPEN),at(s=>si(s.data)),at(s=>s.pong),yt(s=>s!==void 0),at(s=>({receivedAt:BigInt(Date.now()),pong:s}))),a=(l==="INITIAL"?ys(0):ys(0,Nd)).pipe(ks(()=>e.readyState===WebSocket.OPEN),at(()=>{const s={timestamp:BigInt(Date.now())};return it(jn,{ping:s})}),Jr(s=>{ni({req:s,authorization:this.authorization,socket:e})}),at(s=>s.ping)).pipe(yt(s=>(s==null?void 0:s.timestamp)!==void 0),Is(s=>vd(v.pipe(yt(i=>i.pong.timestamp===s.timestamp),Xr(1),at(i=>{const d=s.timestamp,p=i.receivedAt;return Number(p-d)})),ys(Bs).pipe(at(()=>{throw new Error(`Pong not received within ${Bs}ms for stream ${t}`)}))).pipe(Co(i=>(this._latencies.next({streamID:t,latency:Bs,readyState:e.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",i.message),Jc(null))))),yd(()=>{this._latencies.next({streamID:t,latency:-1,readyState:e.readyState,updatedAt:BigInt(Date.now())})}),Jr(s=>{s!==null&&this._latencies.next({streamID:t,latency:s,readyState:e.readyState,updatedAt:BigInt(Date.now())})})),n=[];return n.push(a.subscribe({error:s=>{console.error("Unexpected error sending heartbeat",s)}})),h.next(e),()=>{n.forEach(s=>s.unsubscribe())}})}connect(e="CONTINUOUS"){const t=Ud(),l=this.latencies.pipe(at(h=>{const v=h.get(t);return v===void 0?null:v}),ks(h=>(h==null?void 0:h.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:t,heartbeat:e}),l}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(e=>e.unsubscribe())}}function si(u){const e=JSON.parse(u);return Ql(vc,e)}function ni({req:u,authorization:e,socket:t,knownID:l,runID:h}){l&&(u.knownId=l),h&&(u.runId=h);const{bearerToken:v}=e;v&&u&&(u.authorization=`Bearer ${v}`),t.send(JSON.stringify(Vl(jn,u)))}function Ud(){return Bd().replace(/-/g,"")}function Fd(){return`run_${Rd()}`}function Vd({blockID:u,runID:e,sequence:t,commands:l,runner:h,settings:v={},onStdout:o,onStderr:r,onExitCode:a,onPid:n,onMimeType:s}){var S;const{rows:i=20,className:d,fontSize:p=12,fontFamily:m="monospace",takeFocus:c=!0,scrollToFit:f=!0}=v,g=ft.useMemo(()=>{if(!(!u||!e||!h.endpoint))return console.log("Creating stream",u,e,h.endpoint),new wo({knownID:u,runID:e,sequence:t},{runnerEndpoint:h.endpoint,authorization:h.authorization,autoReconnect:h.reconnect})},[u,e,t,h]);ft.useEffect(()=>{const E=g==null?void 0:g.connect().subscribe(j=>console.log(`Heartbeat latency for streamID ${j==null?void 0:j.streamID} (${(j==null?void 0:j.readyState)===1?"open":"closed"}): ${j==null?void 0:j.latency}ms`));return()=>{E==null||E.unsubscribe(),g==null||g.close()}},[g]);let _=it(Br,{rows:34,cols:100,x:0,y:0});const b=ft.useMemo(()=>it(mn,{sessionStrategy:Ll.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:"sh",background:!1,fileExtension:"",env:[`RUNME_ID=${u}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],source:{case:"commands",value:{items:l}},interactive:!0,mode:jl.INLINE,runId:e,knownId:u},winsize:_}),[u,l,_]),y=ft.useMemo(()=>{var E;return{output:{"runme.dev/id":(E=b.config)==null?void 0:E.knownId,fontFamily:m||"monospace",fontSize:p||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:c,scrollToFit:f,smoothScrollDuration:0,scrollback:4e3,initialRows:i,content:"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[m,p,c,i,(S=b.config)==null?void 0:S.knownId,f]),C=new TextEncoder;return uc({postMessage:E=>{if(E.type===bs.terminalOpen||E.type===bs.terminalResize){const j=Number(E.output.terminalDimensions.columns),O=Number(E.output.terminalDimensions.rows);if(Number.isFinite(j)&&Number.isFinite(O)){if(_.cols===j&&_.rows===O)return;_=it(Br,{cols:j,rows:O,x:0,y:0});const I=it(mn,{winsize:_});g==null||g.sendExecuteRequest(I)}}if(E.type===bs.terminalStdin){const j=C.encode(E.output.input),O=it(mn,{inputData:j});g==null||g.sendExecuteRequest(O)}},onDidReceiveMessage:E=>{g==null||g.setCallback(E)}}),ft.useEffect(()=>{const E=g==null?void 0:g.stdout.subscribe(j=>{o==null||o(j)});return()=>E==null?void 0:E.unsubscribe()},[g,o]),ft.useEffect(()=>{const E=g==null?void 0:g.stderr.subscribe(j=>{r==null||r(j)});return()=>E==null?void 0:E.unsubscribe()},[g,r]),ft.useEffect(()=>{const E=g==null?void 0:g.exitCode.subscribe(j=>{a==null||a(j),g==null||g.close()});return()=>E==null?void 0:E.unsubscribe()},[g,a]),ft.useEffect(()=>{const E=g==null?void 0:g.pid.subscribe(j=>{n==null||n(j)});return()=>E==null?void 0:E.unsubscribe()},[g,n]),ft.useEffect(()=>{const E=g==null?void 0:g.mimeType.subscribe(j=>{s==null||s(j)});return()=>E==null?void 0:E.unsubscribe()},[g,s]),ft.useEffect(()=>{!g||!b||(console.log("useEffect invoked - Commands changed:",JSON.stringify(b.config.source.value)),g==null||g.sendExecuteRequest(b))},[b,g]),oa.jsx("div",{className:d,ref:E=>{if(!E||E.hasChildNodes())return;const j=document.createElement("terminal-view");j.setAttribute("buttons","false"),j.setAttribute("id",y.output["runme.dev/id"]),j.setAttribute("fontFamily",y.output.fontFamily),typeof y.output.fontSize=="number"&&j.setAttribute("fontSize",y.output.fontSize.toString()),y.output.cursorStyle&&j.setAttribute("cursorStyle",y.output.cursorStyle),typeof y.output.cursorBlink=="boolean"&&j.setAttribute("cursorBlink",y.output.cursorBlink?"true":"false"),typeof y.output.cursorWidth=="number"&&j.setAttribute("cursorWidth",y.output.cursorWidth.toString()),typeof y.output.takeFocus=="boolean"&&j.setAttribute("takeFocus",y.output.takeFocus?"true":"false"),typeof y.output.smoothScrollDuration=="number"&&j.setAttribute("smoothScrollDuration",y.output.smoothScrollDuration.toString()),typeof y.output.scrollback=="number"&&j.setAttribute("scrollback",y.output.scrollback.toString()),y.output.initialRows!==void 0&&j.setAttribute("initialRows",y.output.initialRows.toString()),y.output.content!==void 0&&j.setAttribute("initialContent",y.output.content),y.output.isAutoSaveEnabled&&j.setAttribute("isAutoSaveEnabled",y.output.isAutoSaveEnabled.toString()),y.output.isPlatformAuthEnabled&&j.setAttribute("isPlatformAuthEnabled",y.output.isPlatformAuthEnabled.toString()),E.appendChild(j);const O=document.createElement("div");O.setAttribute("className","h-1"),E.appendChild(O),setTimeout(()=>{f&&!Wd(O)&&O.scrollIntoView({behavior:"smooth"})},0)}})}function Wd(u){const e=u.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}exports.Console=Vd;exports.Heartbeat=jo;exports.Streams=wo;exports.genRunID=Fd;
|