@runmedev/react-components 3.16.2 → 3.16.3
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/App.d.ts +4 -5
- package/dist/App.d.ts.map +1 -1
- package/dist/app/index.css +1 -1
- package/dist/app/index.js +127 -127
- package/dist/components/Actions/Actions.d.ts +4 -1
- package/dist/components/Actions/Actions.d.ts.map +1 -1
- package/dist/components/Actions/Editor.d.ts +2 -1
- package/dist/components/Actions/Editor.d.ts.map +1 -1
- package/dist/components/Chat/Chat copy.d.ts +6 -0
- package/dist/components/Chat/Chat copy.d.ts.map +1 -0
- package/dist/components/Chat/Chat.d.ts +3 -0
- package/dist/components/Chat/Chat.d.ts.map +1 -1
- package/dist/components/Files/Viewer.d.ts +4 -1
- package/dist/components/Files/Viewer.d.ts.map +1 -1
- package/dist/components/Settings/Settings.d.ts.map +1 -1
- package/dist/components/TopNavigation.d.ts +3 -1
- package/dist/components/TopNavigation.d.ts.map +1 -1
- package/dist/contexts/CellContext.d.ts +8 -1
- package/dist/contexts/CellContext.d.ts.map +1 -1
- package/dist/contexts/OutputContext.d.ts.map +1 -1
- package/dist/contexts/SettingsContext.d.ts +4 -2
- package/dist/contexts/SettingsContext.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react-components.cjs +103 -103
- package/dist/react-components.css +1 -1
- package/dist/react-components.mjs +8892 -8531
- package/dist/runme/client.d.ts +1 -0
- package/dist/runme/client.d.ts.map +1 -1
- package/dist/simhash.d.ts +23 -0
- package/dist/simhash.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";var u0=Object.defineProperty;var d0=(e,t,r)=>t in e?u0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ui=(e,t,r)=>d0(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react/jsx-runtime"),ue=require("react"),Se=require("@radix-ui/themes"),h0=require("@monaco-editor/react"),f0=require("react-markdown"),jt=require("react-router-dom");require("react-dom");const p0=require("@radix-ui/react-icons");function g0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ze=g0(ue);function Ec(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}var ee;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(ee||(ee={}));function m0(){let e=0,t=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ua(e,t,r){for(let o=0;o<28;o=o+7){const u=e>>>o,s=!(!(u>>>7)&&t==0),a=(s?u|128:u)&255;if(r.push(a),!s)return}const n=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(r.push((i?n|128:n)&255),!!i){for(let o=3;o<31;o=o+7){const u=t>>>o,s=!!(u>>>7),a=(s?u|128:u)&255;if(r.push(a),!s)return}r.push(t>>>31&1)}}const Os=4294967296;function Cu(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let n=0,i=0;function o(u,s){const a=Number(e.slice(u,s));i*=r,n=n*r+a,n>=Os&&(i=i+(n/Os|0),n=n%Os)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?xf(n,i):Cc(n,i)}function v0(e,t){let r=Cc(e,t);const n=r.hi&2147483648;n&&(r=xf(r.lo,r.hi));const i=Af(r.lo,r.hi);return n?"-"+i:i}function Af(e,t){if({lo:e,hi:t}=b0(e,t),t<=2097151)return String(Os*t+e);const r=e&16777215,n=(e>>>24|t<<8)&16777215,i=t>>16&65535;let o=r+n*6777216+i*6710656,u=n+i*8147497,s=i*2;const a=1e7;return o>=a&&(u+=Math.floor(o/a),o%=a),u>=a&&(s+=Math.floor(u/a),u%=a),s.toString()+ku(u)+ku(o)}function b0(e,t){return{lo:e>>>0,hi:t>>>0}}function Cc(e,t){return{lo:e|0,hi:t|0}}function xf(e,t){return t=~t,e?e=~e+1:t+=1,Cc(e,t)}const ku=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Ua(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function _0(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const it=y0();function y0(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),i=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(u){const s=typeof u=="bigint"?u:BigInt(u);if(s>n||s<r)throw new Error(`invalid int64: ${u}`);return s},uParse(u){const s=typeof u=="bigint"?u:BigInt(u);if(s>o||s<i)throw new Error(`invalid uint64: ${u}`);return s},enc(u){return e.setBigInt64(0,this.parse(u),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(u){return e.setBigInt64(0,this.uParse(u),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(u,s){return e.setInt32(0,u,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(u,s){return e.setInt32(0,u,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),Iu(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),Au(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),Iu(r),Cu(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),Au(r),Cu(r)},dec(r,n){return v0(r,n)},uDec(r,n){return Af(r,n)}}}function Iu(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Au(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}function vn(e,t){switch(e){case ee.STRING:return"";case ee.BOOL:return!1;case ee.DOUBLE:case ee.FLOAT:return 0;case ee.INT64:case ee.UINT64:case ee.SFIXED64:case ee.FIXED64:case ee.SINT64:return t?"0":it.zero;case ee.BYTES:return new Uint8Array(0);default:return 0}}function S0(e,t){switch(e){case ee.BOOL:return t===!1;case ee.STRING:return t==="";case ee.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Rf=2,kr=Symbol.for("reflect unsafe local");function Nf(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(n=>n.localName===r)}function w0(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Rf)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!S0(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Ei(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Tf(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Bf(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function E0(e,t){const r=t.localName;if(t.oneof){const n=t.oneof.localName;e[n].case===r&&(e[n]={case:void 0})}else if(t.presence!=Rf)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=vn(t.scalar,t.longAsString);break}}function Wr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function kc(e,t){var r,n,i,o;if(Wr(e)&&kr in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const u=t,s=e.field();return u.listKind==s.listKind&&u.scalar===s.scalar&&((r=u.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=u.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function Ic(e,t){var r,n,i,o;if(Wr(e)&&kr in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const u=t,s=e.field();return u.mapKey===s.mapKey&&u.mapKind==s.mapKind&&u.scalar===s.scalar&&((r=u.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=u.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function ho(e,t){return Wr(e)&&kr in e&&"desc"in e&&Wr(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}function C0(e){return Lf(e.$typeName)}function Hi(e){const t=e.fields[0];return Lf(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function Lf(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const k0=999,I0=998,Ds=2;function Ge(e,t){if(Ec(t,e))return t;const r=T0(e);return t!==void 0&&A0(e,r,t),r}function A0(e,t,r){for(const n of e.members){let i=r[n.localName];if(i==null)continue;let o;if(n.kind=="oneof"){const u=Nf(r,n);if(!u)continue;o=u,i=Tf(r,u)}else o=n;switch(o.fieldKind){case"message":i=Ac(o,i);break;case"scalar":i=Of(o,i);break;case"list":i=R0(o,i);break;case"map":i=x0(o,i);break}Bf(t,o,i)}return t}function Of(e,t){return e.scalar==ee.BYTES?xc(t):t}function x0(e,t){if(Wr(t)){if(e.scalar==ee.BYTES)return xu(t,xc);if(e.mapKind=="message")return xu(t,r=>Ac(e,r))}return t}function R0(e,t){if(Array.isArray(t)){if(e.scalar==ee.BYTES)return t.map(xc);if(e.listKind=="message")return t.map(r=>Ac(e,r))}return t}function Ac(e,t){if(e.fieldKind=="message"&&!e.oneof&&Hi(e.message))return Of(e.message.fields[0],t);if(Wr(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!Ec(t,e.message))return Ge(e.message,t)}return t}function xc(e){return Array.isArray(e)?new Uint8Array(e):e}function xu(e,t){const r={};for(const n of Object.entries(e))r[n[0]]=t(n[1]);return r}const N0=Symbol(),Ru=new WeakMap;function T0(e){let t;if(B0(e)){const r=Ru.get(e);let n,i;if(r)({prototype:n,members:i}=r);else{n={},i=new Set;for(const o of e.members)o.kind!="oneof"&&(o.fieldKind!="scalar"&&o.fieldKind!="enum"||o.presence!=Ds&&(i.add(o),n[o.localName]=da(o)));Ru.set(e,{prototype:n,members:i})}t=Object.create(n),t.$typeName=e.typeName;for(const o of e.members)i.has(o)||o.kind=="field"&&(o.fieldKind=="message"||(o.fieldKind=="scalar"||o.fieldKind=="enum")&&o.presence!=Ds)||(t[o.localName]=da(o))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==Ds)&&(t[r.localName]=da(r))}return t}function B0(e){switch(e.file.edition){case k0:return!1;case I0:return!0;default:return e.fields.some(t=>t.presence!=Ds&&t.fieldKind!="message"&&!t.oneof)}}function da(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return N0;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?vn(e.scalar,e.longAsString):e.enum.values[0].number}const L0=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Mt extends Error{constructor(t,r,n="FieldValueInvalidError"){super(r),this.name=n,this.field=()=>t}}function O0(e){return e instanceof Error&&L0.includes(e.name)&&"field"in e&&typeof e.field=="function"}const ha=Symbol.for("@bufbuild/protobuf/text-encoding");function Rc(){if(globalThis[ha]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[ha]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[ha]}var dt;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(dt||(dt={}));const Df=34028234663852886e22,Ff=-34028234663852886e22,Vf=4294967295,Mf=2147483647,Uf=-2147483648;class Pf{constructor(t=Rc().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let r=new Uint8Array(t),n=0;for(let i=0;i<this.chunks.length;i++)r.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Nu(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return fa(t),Ua(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){D0(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){Nu(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){fa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return fa(t),t=(t<<1^t>>31)>>>0,Ua(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=it.enc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=it.uEnc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}int64(t){let r=it.enc(t);return ua(r.lo,r.hi,this.buf),this}sint64(t){const r=it.enc(t),n=r.hi>>31,i=r.lo<<1^n,o=(r.hi<<1|r.lo>>>31)^n;return ua(i,o,this.buf),this}uint64(t){const r=it.uEnc(t);return ua(r.lo,r.hi,this.buf),this}}class Nc{constructor(t,r=Rc().decodeUtf8){this.decodeUtf8=r,this.varint64=m0,this.uint32=_0,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case dt.Varint:for(;this.buf[this.pos++]&128;);break;case dt.Bit64:this.pos+=4;case dt.Bit32:this.pos+=4;break;case dt.LengthDelimited:let i=this.uint32();this.pos+=i;break;case dt.StartGroup:for(;;){const[o,u]=this.tag();if(u===dt.EndGroup){if(r!==void 0&&o!==r)throw new Error("invalid end group tag");break}this.skip(u,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return it.dec(...this.varint64())}uint64(){return it.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,it.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return it.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return it.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function fa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Mf||e<Uf)throw new Error("invalid int32: "+e)}function Nu(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Vf||e<0)throw new Error("invalid uint32: "+e)}function D0(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>Df||e<Ff))throw new Error("invalid float32: "+e)}function an(e,t){const r=e.fieldKind=="list"?kc(t,e):e.fieldKind=="map"?Ic(t,e):Tc(e,t);if(r===!0)return;let n;switch(e.fieldKind){case"list":n=`expected ${$f(e)}, got ${yt(t)}`;break;case"map":n=`expected ${Gf(e)}, got ${yt(t)}`;break;default:n=$s(e,t,r)}return new Mt(e,n)}function Tu(e,t,r){const n=Tc(e,r);if(n!==!0)return new Mt(e,`list item #${t+1}: ${$s(e,r,n)}`)}function F0(e,t,r){const n=Wf(t,e.mapKey);if(n!==!0)return new Mt(e,`invalid map key: ${$s({scalar:e.mapKey},t,n)}`);const i=Tc(e,r);if(i!==!0)return new Mt(e,`map entry ${yt(t)}: ${$s(e,r,i)}`)}function Tc(e,t){return e.scalar!==void 0?Wf(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):ho(t,e.message)}function Wf(e,t){switch(t){case ee.DOUBLE:return typeof e=="number";case ee.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>Df||e<Ff?`${e.toFixed()} out of range`:!0;case ee.INT32:case ee.SFIXED32:case ee.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Mf||e<Uf?`${e.toFixed()} out of range`:!0;case ee.FIXED32:case ee.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Vf||e<0?`${e.toFixed()} out of range`:!0;case ee.BOOL:return typeof e=="boolean";case ee.STRING:return typeof e!="string"?!1:Rc().checkUtf8(e)||"invalid UTF8";case ee.BYTES:return e instanceof Uint8Array;case ee.INT64:case ee.SFIXED64:case ee.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return it.parse(e),!0}catch{return`${e} out of range`}return!1;case ee.FIXED64:case ee.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return it.uParse(e),!0}catch{return`${e} out of range`}return!1}}function $s(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${yt(t)}`,e.scalar!==void 0?`expected ${V0(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${Hf(e.message)}`+r}function yt(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:kc(e)?$f(e.field()):Ic(e)?Gf(e.field()):ho(e)?Hf(e.desc):Ec(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Hf(e){return`ReflectMessage (${e.typeName})`}function $f(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${ee[e.scalar]})`}}function Gf(e){switch(e.mapKind){case"message":return`ReflectMap (${ee[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${ee[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${ee[e.mapKey]}, ${ee[e.scalar]})`}}function V0(e){switch(e){case ee.STRING:return"string";case ee.BOOL:return"boolean";case ee.INT64:case ee.SINT64:case ee.SFIXED64:return"bigint (int64)";case ee.UINT64:case ee.FIXED64:return"bigint (uint64)";case ee.BYTES:return"Uint8Array";case ee.DOUBLE:return"number (float64)";case ee.FLOAT:return"number (float32)";case ee.FIXED32:case ee.UINT32:return"number (uint32)";case ee.INT32:case ee.SFIXED32:case ee.SINT32:return"number (int32)"}}function Pt(e,t,r=!0){return new Zf(e,t,r)}class Zf{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,n)=>r.number-n.number)}constructor(t,r,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=t,this.message=this[kr]=r??Ge(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return di(this.message,t),Nf(this.message,t)}isSet(t){return di(this.message,t),w0(this.message,t)}clear(t){di(this.message,t),E0(this.message,t)}get(t){di(this.message,t);const r=Tf(this.message,t);switch(t.fieldKind){case"list":let n=this.lists.get(t);return(!n||n[kr]!==r)&&this.lists.set(t,n=new M0(t,r,this.check)),n;case"map":let i=this.maps.get(t);return(!i||i[kr]!==r)&&this.maps.set(t,i=new U0(t,r,this.check)),i;case"message":return Lc(t,r,this.check);case"scalar":return r===void 0?vn(t.scalar,!1):Oc(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(di(this.message,t),this.check){const i=an(t,r);if(i)throw i}let n;t.fieldKind=="message"?n=Bc(t,r):Ic(r)||kc(r)?n=r[kr]:n=Dc(t,r),Bf(this.message,t,n)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function di(e,t){if(t.parent.typeName!==e.$typeName)throw new Mt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class M0{field(){return this._field}get size(){return this._arr.length}constructor(t,r,n){this._field=t,this._arr=this[kr]=r,this.check=n}get(t){const r=this._arr[t];return r===void 0?void 0:pa(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Mt(this._field,`list item #${t+1}: out of range`);if(this.check){const n=Tu(this._field,t,r);if(n)throw n}this._arr[t]=Bu(this._field,r)}add(t){if(this.check){const r=Tu(this._field,this._arr.length,t);if(r)throw r}this._arr.push(Bu(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield pa(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,pa(this._field,this._arr[t],this.check)]}}class U0{constructor(t,r,n=!0){this.obj=this[kr]=r??{},this.check=n,this._field=t}field(){return this._field}set(t,r){if(this.check){const n=F0(this._field,t,r);if(n)throw n}return this.obj[Es(t)]=P0(this._field,r),this}delete(t){const r=Es(t),n=Object.prototype.hasOwnProperty.call(this.obj,r);return n&&delete this.obj[r],n}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[Es(t)];return r!==void 0&&(r=ga(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Es(t))}*keys(){for(const t of Object.keys(this.obj))yield Lu(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[Lu(t[0],this._field.mapKey),ga(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield ga(this._field,t,this.check)}forEach(t,r){for(const n of this.entries())t.call(r,n[1],n[0],this)}}function Bc(e,t){return ho(t)?C0(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?Kf(t.message):t.message:t}function Lc(e,t,r){return t!==void 0&&(Hi(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Oc(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Wr(t)&&(t=jf(t))),new Zf(e.message,t,r)}function Bu(e,t){return e.listKind=="message"?Bc(e,t):Dc(e,t)}function pa(e,t,r){return e.listKind=="message"?Lc(e,t,r):Oc(e,t)}function P0(e,t){return e.mapKind=="message"?Bc(e,t):Dc(e,t)}function ga(e,t,r){return e.mapKind=="message"?Lc(e,t,r):t}function Es(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function Lu(e,t){switch(t){case ee.STRING:return e;case ee.INT32:case ee.FIXED32:case ee.UINT32:case ee.SFIXED32:case ee.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case ee.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case ee.UINT64:case ee.FIXED64:try{return it.uParse(e)}catch{}break;default:try{return it.parse(e)}catch{}break}return e}function Oc(e,t){switch(e.scalar){case ee.INT64:case ee.SFIXED64:case ee.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=it.parse(t));break;case ee.FIXED64:case ee.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=it.uParse(t));break}return t}function Dc(e,t){switch(e.scalar){case ee.INT64:case ee.SFIXED64:case ee.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=it.parse(t));break;case ee.FIXED64:case ee.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=it.uParse(t));break}return t}function jf(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Wr(e))for(const[r,n]of Object.entries(e))t.fields[r]=Xf(n);return t}function Kf(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Yf(n);return t}function Yf(e){switch(e.kind.case){case"structValue":return Kf(e.kind.value);case"listValue":return e.kind.value.values.map(Yf);case"nullValue":case void 0:return null;default:return e.kind.value}}function Xf(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const n of e)r.values.push(Xf(n));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:jf(e)};break}return t}function W0(e,t){return Jf(Pt(e,t)).message}function Jf(e){const t=Pt(e.desc);for(const n of e.fields)if(e.isSet(n))switch(n.fieldKind){case"list":const i=t.get(n);for(const u of e.get(n))i.add(ma(n,u));break;case"map":const o=t.get(n);for(const u of e.get(n).entries())o.set(u[0],ma(n,u[1]));break;default:{t.set(n,ma(n,e.get(n)));break}}const r=e.getUnknown();return r&&r.length>0&&t.setUnknown([...r]),t}function ma(e,t){return e.message!==void 0&&ho(t)?Jf(t):e.scalar==ee.BYTES&&t instanceof Uint8Array?t.slice():t}function Fc(e){const t=$0();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let n=new Uint8Array(r),i=0,o=0,u,s=0;for(let a=0;a<e.length;a++){if(u=t[e.charCodeAt(a)],u===void 0)switch(e[a]){case"=":o=0;case`
|
|
2
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:s=u,o=1;break;case 1:n[i++]=s<<2|(u&48)>>4,s=u,o=2;break;case 2:n[i++]=(s&15)<<4|(u&60)>>2,s=u,o=3;break;case 3:n[i++]=(s&3)<<6|u,o=0;break}}if(o==1)throw Error("invalid base64 string");return n.subarray(0,i)}function H0(e,t="std"){const r=zf(t),n=t=="std";let i="",o=0,u,s=0;for(let a=0;a<e.length;a++)switch(u=e[a],o){case 0:i+=r[u>>2],s=(u&3)<<4,o=1;break;case 1:i+=r[s|u>>4],s=(u&15)<<2,o=2;break;case 2:i+=r[s|u>>6],i+=r[u&63],o=0;break}return o&&(i+=r[s],n&&(i+="=",o==1&&(i+="="))),i}let Cs,Ou,Nn;function zf(e){return Cs||(Cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ou=Cs.slice(0,-2).concat("-","_")),e=="url"?Ou:Cs}function $0(){if(!Nn){Nn=[];const e=zf("std");for(let t=0;t<e.length;t++)Nn[e[t].charCodeAt(0)]=t;Nn[45]=e.indexOf("+"),Nn[95]=e.indexOf("/")}return Nn}function Ci(e){let t=!1;const r=[];for(let n=0;n<e.length;n++){let i=e.charAt(n);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),r.push(i);break}}return r.join("")}const G0=new Set(["constructor","toString","toJSON","valueOf"]);function ki(e){return G0.has(e)?e+"$":e}function Vc(e){for(const t of e.field)Ei(t,"jsonName")||(t.jsonName=Ci(t.name));e.nestedType.forEach(Vc)}function Z0(e,t){const r=e.values.find(n=>n.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function j0(e,t){switch(e){case ee.STRING:return t;case ee.BYTES:{const r=K0(t);if(r===!1)throw new Error(`cannot parse ${ee[e]} default value: ${t}`);return r}case ee.INT64:case ee.SFIXED64:case ee.SINT64:return it.parse(t);case ee.UINT64:case ee.FIXED64:return it.uParse(t);case ee.DOUBLE:case ee.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case ee.BOOL:return t==="true";case ee.INT32:case ee.UINT32:case ee.SINT32:case ee.FIXED32:case ee.SFIXED32:return parseInt(t,10)}}function K0(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(n){if(this.tail.length>=n){const i=this.tail.substring(0,n);return this.tail=this.tail.substring(n),i}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,8);if(Number.isNaN(o))return!1;t.push(o);break}case"x":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;t.push(o);break}case"u":{const n=r.c,i=r.take(4);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;const u=new Uint8Array(4);new DataView(u.buffer).setInt32(0,o,!0),t.push(u[0],u[1],u[2],u[3]);break}case"U":{const n=r.c,i=r.take(8);if(i===!1)return!1;const o=it.uEnc(n+i),u=new Uint8Array(8),s=new DataView(u.buffer);s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),t.push(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*Pa(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Pa(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Pa(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function qf(...e){const t=Y0();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)Mu(r,t);return t}if("$typeName"in e[0]){let o=function(u){const s=[];for(const a of u.dependency){if(t.getFile(a)!=null||i.has(a))continue;const c=n(a);if(!c)throw new Error(`Unable to resolve ${a}, imported by ${u.name}`);"kind"in c?t.addFile(c,!1,!0):(i.add(c.name),s.push(c))}return s.concat(...s.map(o))};const r=e[0],n=e[1],i=new Set;for(const u of[r,...o(r)].reverse())Mu(u,t)}else for(const r of e)for(const n of r.files)t.addFile(n);return t}function Y0(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(n,i,o){if(r.set(n.proto.name,n),!i)for(const u of Pa(n))this.add(u);if(o)for(const u of n.dependencies)this.addFile(u,i,o)},add(n){if(n.kind=="extension"){let i=t.get(n.extendee.typeName);i||t.set(n.extendee.typeName,i=new Map),i.set(n.number,n)}e.set(n.typeName,n)},get(n){return e.get(n)},getFile(n){return r.get(n)},getMessage(n){const i=e.get(n);return(i==null?void 0:i.kind)=="message"?i:void 0},getEnum(n){const i=e.get(n);return(i==null?void 0:i.kind)=="enum"?i:void 0},getExtension(n){const i=e.get(n);return(i==null?void 0:i.kind)=="extension"?i:void 0},getExtensionFor(n,i){var o;return(o=t.get(n.typeName))===null||o===void 0?void 0:o.get(i)},getService(n){const i=e.get(n);return(i==null?void 0:i.kind)=="service"?i:void 0}}}const X0=998,J0=999,z0=9,Ii=10,_i=11,q0=12,Du=14,Mc=3,Q0=2,Fu=1,eb=0,va=1,Vu=2,tb=3,rb=1,nb=2,ib=1,Qf={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Mu(e,t){var r,n;const i={kind:"file",proto:e,deprecated:(n=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&n!==void 0?n:!1,edition:cb(e),name:e.name.replace(/\.proto$/,""),dependencies:lb(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},o=new Map,u={get(s){return o.get(s)},add(s){var a;sr(((a=s.proto.options)===null||a===void 0?void 0:a.mapEntry)===!0),o.set(s.typeName,s)}};for(const s of e.enumType)ep(s,i,void 0,t);for(const s of e.messageType)tp(s,i,void 0,t,u);for(const s of e.service)sb(s,i,t);Wa(i,t);for(const s of o.values())Ha(s,t,u);for(const s of i.messages)Ha(s,t,u),Wa(s,t);t.addFile(i,!0)}function Wa(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const n=$a(r,e,t);e.extensions.push(n),t.add(n)}break;case"message":for(const r of e.proto.extension){const n=$a(r,e,t);e.nestedExtensions.push(n),t.add(n)}for(const r of e.nestedMessages)Wa(r,t);break}}function Ha(e,t,r){const n=e.proto.oneofDecl.map(o=>ab(o,e)),i=new Set;for(const o of e.proto.field){const u=hb(o,n),s=$a(o,e,t,u,r);e.fields.push(s),e.field[s.localName]=s,u===void 0?e.members.push(s):(u.fields.push(s),i.has(u)||(i.add(u),e.members.push(u)))}for(const o of n.filter(u=>i.has(u)))e.oneofs.push(o);for(const o of e.nestedMessages)Ha(o,t,r)}function ep(e,t,r,n){var i,o,u,s,a;const c=ub(e.name,e.value),m={kind:"enum",proto:e,deprecated:(o=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,file:t,parent:r,open:!0,name:e.name,typeName:fo(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};m.open=mb(m),n.add(m);for(const f of e.value){const b=f.name;m.values.push(m.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(u=f.options)===null||u===void 0?void 0:u.deprecated)!==null&&s!==void 0?s:!1,parent:m,name:b,localName:ki(c==null?b:b.substring(c.length)),number:f.number,toString(){return`enum value ${m.typeName}.${b}`}})}((a=r==null?void 0:r.nestedEnums)!==null&&a!==void 0?a:t.enums).push(m)}function tp(e,t,r,n,i){var o,u,s,a;const c={kind:"message",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,file:t,parent:r,name:e.name,typeName:fo(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?i.add(c):(((a=r==null?void 0:r.nestedMessages)!==null&&a!==void 0?a:t.messages).push(c),n.add(c));for(const m of e.enumType)ep(m,t,c,n);for(const m of e.nestedType)tp(m,t,c,n,i)}function sb(e,t,r){var n,i;const o={kind:"service",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:fo(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),r.add(o);for(const u of e.method){const s=ob(u,o,r);o.methods.push(s),o.method[s.localName]=s}}function ob(e,t,r){var n,i,o,u;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const a=r.getMessage(wr(e.inputType)),c=r.getMessage(wr(e.outputType));sr(a,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),sr(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const m=e.name;return{kind:"rpc",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:m,localName:ki(m.length?ki(m[0].toLowerCase()+m.substring(1)):m),methodKind:s,input:a,output:c,idempotency:(u=(o=e.options)===null||o===void 0?void 0:o.idempotencyLevel)!==null&&u!==void 0?u:eb,toString(){return`rpc ${t.typeName}.${m}`}}}function ab(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:ki(Ci(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function $a(e,t,r,n,i){var o,u,s;const a=i===void 0,c={kind:"field",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:fb(e,n,a,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){const _=t.kind=="file"?t:t.file,k=t.kind=="file"?void 0:t,y=fo(e,k,_);c.kind="extension",c.file=_,c.parent=k,c.oneof=void 0,c.typeName=y,c.jsonName=`[${y}]`,c.toString=()=>`extension ${y}`;const d=r.getMessage(wr(e.extendee));sr(d,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=d}else{const _=t;sr(_.kind=="message"),c.parent=_,c.oneof=n,c.localName=n?Ci(e.name):ki(Ci(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const m=e.label,f=e.type,b=(s=e.options)===null||s===void 0?void 0:s.jstype;if(m===Mc){const _=f==_i?i==null?void 0:i.get(wr(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:k,value:y}=gb(_);return c.mapKey=k.scalar,c.mapKind=y.fieldKind,c.message=y.message,c.delimitedEncoding=!1,c.enum=y.enum,c.scalar=y.scalar,c}switch(c.fieldKind="list",f){case _i:case Ii:c.listKind="message",c.message=r.getMessage(wr(e.typeName)),sr(c.message),c.delimitedEncoding=Uu(e,t);break;case Du:c.listKind="enum",c.enum=r.getEnum(wr(e.typeName)),sr(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=b==Fu;break}return c.packed=pb(e,t),c}switch(f){case _i:case Ii:c.fieldKind="message",c.message=r.getMessage(wr(e.typeName)),sr(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=Uu(e,t),c.getDefaultValue=()=>{};break;case Du:{const _=r.getEnum(wr(e.typeName));sr(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(wr(e.typeName)),c.getDefaultValue=()=>Ei(e,"defaultValue")?Z0(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=b==Fu,c.getDefaultValue=()=>Ei(e,"defaultValue")?j0(f,e.defaultValue):void 0;break}}return c}function cb(e){switch(e.syntax){case"":case"proto2":return X0;case"proto3":return J0;case"editions":if(e.edition in Qf)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function lb(e,t){return e.dependency.map(r=>{const n=t.getFile(r);if(!n)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return n})}function ub(e,t){const r=db(e)+"_";for(const n of t){if(!n.name.toLowerCase().startsWith(r))return;const i=n.name.substring(r.length);if(i.length==0||/^\d/.test(i))return}return r}function db(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function fo(e,t,r){let n;return t?n=`${t.typeName}.${e.name}`:r.proto.package.length>0?n=`${r.proto.package}.${e.name}`:n=`${e.name}`,n}function wr(e){return e.startsWith(".")?e.substring(1):e}function hb(e,t){if(!Ei(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return sr(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function fb(e,t,r,n){if(e.label==Q0)return tb;if(e.label==Mc)return Vu;if(t||e.proto3Optional||r)return va;const i=Un("fieldPresence",{proto:e,parent:n});return i==Vu&&(e.type==_i||e.type==Ii)?va:i}function pb(e,t){if(e.label!=Mc)return!1;switch(e.type){case z0:case q0:case Ii:case _i:return!1}const r=e.options;return r&&Ei(r,"packed")?r.packed:rb==Un("repeatedFieldEncoding",{proto:e,parent:t})}function gb(e){const t=e.fields.find(n=>n.number===1),r=e.fields.find(n=>n.number===2);return sr(t&&t.fieldKind=="scalar"&&t.scalar!=ee.BYTES&&t.scalar!=ee.FLOAT&&t.scalar!=ee.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function mb(e){var t;return ib==Un("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function Uu(e,t){return e.type==Ii?!0:nb==Un("messageEncoding",{proto:e,parent:t})}function Un(e,t){var r,n;const i=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(i){const o=i[e];if(o!=0)return o}if("kind"in t){if(t.kind=="message")return Un(e,(n=t.parent)!==null&&n!==void 0?n:t.file);const o=Qf[t.edition];if(!o)throw new Error(`feature default for edition ${t.edition} not found`);return o[e]}return Un(e,t.parent)}function sr(e,t){if(!e)throw new Error(t)}function vb(e){const t=bb(e);return t.messageType.forEach(Vc),qf(t,()=>{}).getFile(t.name)}function bb(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(rp),enumType:e.enumType.map(np)}))}function rp(e){var t,r,n,i,o,u,s,a;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(_b))!==null&&r!==void 0?r:[],extension:[],nestedType:(i=(n=e.nestedType)===null||n===void 0?void 0:n.map(rp))!==null&&i!==void 0?i:[],enumType:(u=(o=e.enumType)===null||o===void 0?void 0:o.map(np))!==null&&u!==void 0?u:[],extensionRange:(a=(s=e.extensionRange)===null||s===void 0?void 0:s.map(m=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},m)))!==null&&a!==void 0?a:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function _b(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?yb(e.options):void 0}))}function yb(e){var t,r,n;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(n=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(o=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},o)))!==null&&n!==void 0?n:[],uninterpretedOption:[]}))}function np(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function Be(e,t,...r){return r.reduce((n,i)=>n.nestedMessages[i],e.messages[t])}function Xt(e,t,...r){if(r.length==0)return e.enums[t];const n=r.pop();return r.reduce((i,o)=>i.nestedMessages[o],e.messages[t]).nestedEnums[n]}function Jt(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const Sb=vb({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),wb=Be(Sb,1);var Pu;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(Pu||(Pu={}));var Wu;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Wu||(Wu={}));var Hu;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(Hu||(Hu={}));var $u;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})($u||($u={}));var Gu;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(Gu||(Gu={}));var Zu;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(Zu||(Zu={}));var ju;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(ju||(ju={}));var Ku;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(Ku||(Ku={}));var Yu;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(Yu||(Yu={}));var Xu;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(Xu||(Xu={}));var Ju;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Ju||(Ju={}));var zu;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(zu||(zu={}));var qu;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(qu||(qu={}));var Qu;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(Qu||(Qu={}));var ed;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(ed||(ed={}));var td;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(td||(td={}));var rd;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(rd||(rd={}));var nd;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(nd||(nd={}));var id;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(id||(id={}));var sd;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(sd||(sd={}));const od={readUnknownFields:!0};function Eb(e){return e?Object.assign(Object.assign({},od),e):od}function $i(e,t,r){const n=Pt(e,void 0,!1);return ip(n,new Nc(t),Eb(r),!1,t.byteLength),n.message}function ip(e,t,r,n,i){var o;const u=n?t.len:t.pos+i;let s,a;const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];for(;t.pos<u&&([s,a]=t.tag(),!(n&&a==dt.EndGroup));){const m=e.findNumber(s);if(!m){const f=t.skip(a,s);r.readUnknownFields&&c.push({no:s,wireType:a,data:f});continue}sp(e,t,m,a,r)}if(n&&(a!=dt.EndGroup||s!==i))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function sp(e,t,r,n,i){var o;switch(r.fieldKind){case"scalar":e.set(r,Pn(t,r.scalar));break;case"enum":const u=Pn(t,ee.INT32);if(r.enum.open)e.set(r,u);else if(r.enum.values.some(a=>a.number===u))e.set(r,u);else if(i.readUnknownFields){const a=[];Ua(u,a);const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];c.push({no:r.number,wireType:n,data:new Uint8Array(a)}),e.setUnknown(c)}break;case"message":e.set(r,Uc(t,i,r,e.get(r)));break;case"list":kb(t,n,e.get(r),i);break;case"map":Cb(t,e.get(r),i);break}}function Cb(e,t,r){const n=t.field();let i,o;const u=e.uint32(),s=e.pos+u;for(;e.pos<s;){const[a]=e.tag();switch(a){case 1:i=Pn(e,n.mapKey);break;case 2:switch(n.mapKind){case"scalar":o=Pn(e,n.scalar);break;case"enum":o=e.int32();break;case"message":o=Uc(e,r,n);break}break}}if(i===void 0&&(i=vn(n.mapKey,!1)),o===void 0)switch(n.mapKind){case"scalar":o=vn(n.scalar,!1);break;case"enum":o=n.enum.values[0].number;break;case"message":o=Pt(n.message,void 0,!1);break}t.set(i,o)}function kb(e,t,r,n){var i;const o=r.field();if(o.listKind==="message"){r.add(Uc(e,n,o));return}const u=(i=o.scalar)!==null&&i!==void 0?i:ee.INT32;if(!(t==dt.LengthDelimited&&u!=ee.STRING&&u!=ee.BYTES)){r.add(Pn(e,u));return}const a=e.uint32()+e.pos;for(;e.pos<a;)r.add(Pn(e,u))}function Uc(e,t,r,n){const i=r.delimitedEncoding,o=n??Pt(r.message,void 0,!1);return ip(o,e,t,i,i?r.number:e.uint32()),o}function Pn(e,t){switch(t){case ee.STRING:return e.string();case ee.BOOL:return e.bool();case ee.DOUBLE:return e.double();case ee.FLOAT:return e.float();case ee.INT32:return e.int32();case ee.INT64:return e.int64();case ee.UINT64:return e.uint64();case ee.FIXED64:return e.fixed64();case ee.BYTES:return e.bytes();case ee.FIXED32:return e.fixed32();case ee.SFIXED32:return e.sfixed32();case ee.SFIXED64:return e.sfixed64();case ee.SINT64:return e.sint64();case ee.UINT32:return e.uint32();case ee.SINT32:return e.sint32()}}function rr(e,t){var r;const n=$i(wb,Fc(e));return n.messageType.forEach(Vc),n.dependency=(r=t==null?void 0:t.map(o=>o.proto.name))!==null&&r!==void 0?r:[],qf(n,o=>t==null?void 0:t.find(u=>u.proto.name===o)).getFile(n.name)}const Ib=rr("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),op=rr("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Ab=Be(op,0),xb=3,ad={writeUnknownFields:!0};function Rb(e){return e?Object.assign(Object.assign({},ad),e):ad}function ap(e,t,r){return Gs(new Pf,Rb(r),Pt(e,t)).finish()}function Gs(e,t,r){var n;for(const i of r.sortedFields){if(!r.isSet(i)){if(i.presence==xb)throw new Error(`cannot encode ${i} to binary: required field not set`);continue}cp(e,t,r,i)}if(t.writeUnknownFields)for(const{no:i,wireType:o,data:u}of(n=r.getUnknown())!==null&&n!==void 0?n:[])e.tag(i,o).raw(u);return e}function cp(e,t,r,n){var i;switch(n.fieldKind){case"scalar":case"enum":Zs(e,r.desc.typeName,n.name,(i=n.scalar)!==null&&i!==void 0?i:ee.INT32,n.number,r.get(n));break;case"list":Nb(e,t,n,r.get(n));break;case"message":lp(e,t,n,r.get(n));break;case"map":for(const[o,u]of r.get(n))Tb(e,t,n,o,u);break}}function Zs(e,t,r,n,i,o){up(e.tag(i,Bb(n)),t,r,n,o)}function lp(e,t,r,n){r.delimitedEncoding?Gs(e.tag(r.number,dt.StartGroup),t,n).tag(r.number,dt.EndGroup):Gs(e.tag(r.number,dt.LengthDelimited).fork(),t,n).join()}function Nb(e,t,r,n){var i;if(r.listKind=="message"){for(const u of n)lp(e,t,r,u);return}const o=(i=r.scalar)!==null&&i!==void 0?i:ee.INT32;if(r.packed){if(!n.size)return;e.tag(r.number,dt.LengthDelimited).fork();for(const u of n)up(e,r.parent.typeName,r.name,o,u);e.join();return}for(const u of n)Zs(e,r.parent.typeName,r.name,o,r.number,u)}function Tb(e,t,r,n,i){var o;switch(e.tag(r.number,dt.LengthDelimited).fork(),Zs(e,r.parent.typeName,r.name,r.mapKey,1,n),r.mapKind){case"scalar":case"enum":Zs(e,r.parent.typeName,r.name,(o=r.scalar)!==null&&o!==void 0?o:ee.INT32,2,i);break;case"message":Gs(e.tag(2,dt.LengthDelimited).fork(),t,i).join();break}e.join()}function up(e,t,r,n,i){try{switch(n){case ee.STRING:e.string(i);break;case ee.BOOL:e.bool(i);break;case ee.DOUBLE:e.double(i);break;case ee.FLOAT:e.float(i);break;case ee.INT32:e.int32(i);break;case ee.INT64:e.int64(i);break;case ee.UINT64:e.uint64(i);break;case ee.FIXED64:e.fixed64(i);break;case ee.BYTES:e.bytes(i);break;case ee.FIXED32:e.fixed32(i);break;case ee.SFIXED32:e.sfixed32(i);break;case ee.SFIXED64:e.sfixed64(i);break;case ee.SINT64:e.sint64(i);break;case ee.UINT32:e.uint32(i);break;case ee.SINT32:e.sint32(i);break}}catch(o){throw o instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${o.message}`):o}}function Bb(e){switch(e){case ee.BYTES:case ee.STRING:return dt.LengthDelimited;case ee.DOUBLE:case ee.FIXED64:case ee.SFIXED64:return dt.Bit64;case ee.FIXED32:case ee.SFIXED32:case ee.FLOAT:return dt.Bit32;default:return dt.Varint}}function Lb(e,t,r){let n=!1;return r||(r=Ge(Ab),n=!0),r.value=ap(e,t),r.typeUrl=Fb(t.$typeName),n?r:void 0}function Ob(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,n=dp(e.typeUrl);return r===n}function Db(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(dp(e.typeUrl));if(!(!r||!Ob(e,r)))return $i(r,e.value)}function Fb(e){return`type.googleapis.com/${e}`}function dp(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const Pc=rr("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Vb=Be(Pc,0),hp=Be(Pc,1),Mb=Be(Pc,2);var Ga;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(Ga||(Ga={}));const fp=rr("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");function Ub(e,t){pp(t,e);const r=Wb(e.$unknown,t),[n,i,o]=po(t);for(const u of r)sp(n,new Nc(u.data),i,u.wireType,{readUnknownFields:!0});return o()}function Pb(e,t,r){var n;pp(t,e);const i=((n=e.$unknown)!==null&&n!==void 0?n:[]).filter(c=>c.no!==t.number),[o,u]=po(t,r),s=new Pf;cp(s,{writeUnknownFields:!0},o,u);const a=new Nc(s.finish());for(;a.pos<a.len;){const[c,m]=a.tag(),f=a.skip(m,c);i.push({no:c,wireType:m,data:f})}e.$unknown=i}function Wb(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function po(e,t){const r=e.typeName,n=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),i=Object.assign(Object.assign({},e.extendee),{fields:[n],members:[n],oneofs:[]}),o=Ge(i,t!==void 0?{[r]:t}:void 0);return[Pt(i,o),n,()=>{const u=o[r];if(u===void 0){const s=e.message;return Hi(s)?vn(s.fields[0].scalar,s.fields[0].longAsString):Ge(s)}return u}]}function pp(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const Hb=3,$b=2,cd={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Gb(e){return e?Object.assign(Object.assign({},cd),e):cd}function Zb(e,t,r){return Gi(Pt(e,t),Gb(r))}function jb(e,t,r){var n;const i=Zb(e,t,r);return JSON.stringify(i,null,(n=r==null?void 0:r.prettySpaces)!==null&&n!==void 0?n:0)}function Gi(e,t){var r;const n=Jb(e,t);if(n!==void 0)return n;const i={};for(const o of e.sortedFields){if(!e.isSet(o)){if(o.presence==Hb)throw new Error(`cannot encode ${o} to JSON: required field not set`);if(!t.alwaysEmitImplicit||o.presence!==$b)continue}const u=ld(o,e.get(o),t);u!==void 0&&(i[Xb(o,t)]=u)}if(t.registry){const o=new Set;for(const{no:u}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!o.has(u)){o.add(u);const s=t.registry.getExtensionFor(e.desc,u);if(!s)continue;const a=Ub(e.message,s),[c,m]=po(s,a),f=ld(m,c.get(m),t);f!==void 0&&(i[s.jsonName]=f)}}return i}function ld(e,t,r){switch(e.fieldKind){case"scalar":return go(e,t);case"message":return Gi(t,r);case"enum":return Wc(e.enum,t,r.enumAsInteger);case"list":return Yb(t,r);case"map":return Kb(t,r)}}function Kb(e,t){const r=e.field(),n={};switch(r.mapKind){case"scalar":for(const[i,o]of e)n[i]=go(r,o);break;case"message":for(const[i,o]of e)n[i]=Gi(o,t);break;case"enum":for(const[i,o]of e)n[i]=Wc(r.enum,o,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?n:void 0}function Yb(e,t){const r=e.field(),n=[];switch(r.listKind){case"scalar":for(const i of e)n.push(go(r,i));break;case"enum":for(const i of e)n.push(Wc(r.enum,i,t.enumAsInteger));break;case"message":for(const i of e)n.push(Gi(i,t));break}return t.alwaysEmitImplicit||n.length>0?n:void 0}function Wc(e,t,r){var n;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${yt(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const i=e.value[t];return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:t}function go(e,t){var r,n,i,o,u,s;switch(e.scalar){case ee.INT32:case ee.SFIXED32:case ee.SINT32:case ee.FIXED32:case ee.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=an(e,t))===null||r===void 0?void 0:r.message}`);return t;case ee.FLOAT:case ee.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(n=an(e,t))===null||n===void 0?void 0:n.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case ee.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(i=an(e,t))===null||i===void 0?void 0:i.message}`);return t;case ee.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(o=an(e,t))===null||o===void 0?void 0:o.message}`);return t;case ee.UINT64:case ee.FIXED64:case ee.INT64:case ee.SFIXED64:case ee.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(u=an(e,t))===null||u===void 0?void 0:u.message}`);return t.toString();case ee.BYTES:if(t instanceof Uint8Array)return H0(t);throw new Error(`cannot encode ${e} to JSON: ${(s=an(e,t))===null||s===void 0?void 0:s.message}`)}}function Xb(e,t){return t.useProtoFieldName?e.name:e.jsonName}function Jb(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return zb(e.message,t);case"google.protobuf.Timestamp":return e_(e.message);case"google.protobuf.Duration":return qb(e.message);case"google.protobuf.FieldMask":return Qb(e.message);case"google.protobuf.Struct":return gp(e.message);case"google.protobuf.Value":return Hc(e.message);case"google.protobuf.ListValue":return mp(e.message);default:if(Hi(e.desc)){const r=e.desc.fields[0];return go(r,e.get(r))}return}}function zb(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let n,i;if(r&&(n=Db(e,r),n&&(i=r.getMessage(n.$typeName))),!i||!n)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let o=Gi(Pt(i,n),t);return(i.typeName.startsWith("google.protobuf.")||o===null||Array.isArray(o)||typeof o!="object")&&(o={value:o}),o["@type"]=e.typeUrl,o}function qb(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function Qb(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Ci(t)}).join(",")}function gp(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Hc(n);return t}function Hc(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return gp(e.kind.value);case"listValue":return mp(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function mp(e){return e.values.map(Hc)}function e_(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const n=(e.nanos+1e9).toString().substring(1);n.substring(3)==="000000"?r="."+n.substring(0,3)+"Z":n.substring(6)==="000"?r="."+n.substring(0,6)+"Z":r="."+n+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const ud={ignoreUnknownFields:!1};function t_(e){return e?Object.assign(Object.assign({},ud),e):ud}function r_(e,t,r){return vp(e,l_(t,e.typeName),r)}function vp(e,t,r){const n=Pt(e);try{Wn(n,t,t_(r))}catch(i){throw O0(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return n.message}function Wn(e,t,r){var n;if(u_(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${yt(t)}`);const i=new Map,o=new Map;for(const u of e.desc.fields)o.set(u.name,u).set(u.jsonName,u);for(const[u,s]of Object.entries(t)){const a=o.get(u);if(a){if(a.oneof){if(s===null&&a.fieldKind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Mt(a.oneof,`oneof set multiple times by ${c.name} and ${a.name}`);i.set(a.oneof,a)}dd(e,a,s,r)}else{let c;if(u.startsWith("[")&&u.endsWith("]")&&(c=(n=r.registry)===null||n===void 0?void 0:n.getExtension(u.substring(1,u.length-1)))&&c.extendee.typeName===e.desc.typeName){const[m,f,b]=po(c);dd(m,f,s,r),Pb(e.message,c,b())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${u}" is unknown`)}}}function dd(e,t,r,n){switch(t.fieldKind){case"scalar":a_(e,t,r);break;case"enum":o_(e,t,r,n);break;case"message":s_(e,t,r,n);break;case"list":i_(e.get(t),r,n);break;case"map":n_(e.get(t),r,n);break}}function n_(e,t,r){if(t===null)return;const n=e.field();if(typeof t!="object"||Array.isArray(t))throw new Mt(n,"expected object, got "+yt(t));for(const[i,o]of Object.entries(t)){if(o===null)throw new Mt(n,"map value must not be null");let u;switch(n.mapKind){case"message":const a=Pt(n.message);Wn(a,o,r),u=a;break;case"enum":if(u=$c(n.enum,o,r.ignoreUnknownFields,!0),u===mo)return;break;case"scalar":u=bo(n,o,!0);break}const s=c_(n.mapKey,i);e.set(s,u)}}function i_(e,t,r){if(t===null)return;const n=e.field();if(!Array.isArray(t))throw new Mt(n,"expected Array, got "+yt(t));for(const i of t){if(i===null)throw new Mt(n,"list item must not be null");switch(n.listKind){case"message":const o=Pt(n.message);Wn(o,i,r),e.add(o);break;case"enum":const u=$c(n.enum,i,r.ignoreUnknownFields,!0);u!==mo&&e.add(u);break;case"scalar":e.add(bo(n,i,!0));break}}}function s_(e,t,r,n){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const i=e.isSet(t)?e.get(t):Pt(t.message);Wn(i,r,n),e.set(t,i)}function o_(e,t,r,n){const i=$c(t.enum,r,n.ignoreUnknownFields,!1);i===vo?e.clear(t):i!==mo&&e.set(t,i)}function a_(e,t,r){const n=bo(t,r,!1);n===vo?e.clear(t):e.set(t,n)}const mo=Symbol();function $c(e,t,r,n){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:n?e.values[0].number:vo;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=e.values.find(o=>o.name===t);if(i!==void 0)return i.number;if(r)return mo;break}throw new Error(`cannot decode ${e} from JSON: ${yt(t)}`)}const vo=Symbol();function bo(e,t,r){if(t===null)return r?vn(e.scalar,!1):vo;switch(e.scalar){case ee.DOUBLE:case ee.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Mt(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Mt(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const n=Number(t);if(!Number.isFinite(n))break;return n}break;case ee.INT32:case ee.FIXED32:case ee.SFIXED32:case ee.SINT32:case ee.UINT32:return bp(t);case ee.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return Fc(t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Mt(e,i)}}break}return t}function c_(e,t){switch(e){case ee.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case ee.INT32:case ee.FIXED32:case ee.UINT32:case ee.SFIXED32:case ee.SINT32:return bp(t);default:return t}}function bp(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function l_(e,t){try{return JSON.parse(e)}catch(r){const n=r instanceof Error?r.message:String(r);throw new Error(`cannot decode message ${t} from JSON: ${n}`,{cause:r})}}function u_(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return d_(e.message,t,r),!0;case"google.protobuf.Timestamp":return h_(e.message,t),!0;case"google.protobuf.Duration":return f_(e.message,t),!0;case"google.protobuf.FieldMask":return p_(e.message,t),!0;case"google.protobuf.Struct":return _p(e.message,t),!0;case"google.protobuf.Value":return Gc(e.message,t),!0;case"google.protobuf.ListValue":return yp(e.message,t),!0;default:if(Hi(e.desc)){const n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,bo(n,t,!0)),!0}return!1}}function d_(e,t,r){var n;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${yt(t)}`);if(Object.keys(t).length==0)return;const i=t["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const o=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!o.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const u=(n=r.registry)===null||n===void 0?void 0:n.getMessage(o);if(!u)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${i} is not in the type registry`);const s=Pt(u);if(o.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const a=t.value;Wn(s,a,r)}else{const a=Object.assign({},t);delete a["@type"],Wn(s,a,r)}Lb(s.desc,s.message,e)}function h_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${yt(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const n=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(n))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=it.parse(n/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function f_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${yt(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${yt(t)}`);const n=Number(r[1]);if(n>315576e6||n<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${yt(t)}`);if(e.seconds=it.parse(n),typeof r[2]!="string")return;const i=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(i),(n<0||Object.is(n,-0))&&(e.nanos=-e.nanos)}function p_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${yt(t)}`);if(t==="")return;function r(n){if(n.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const i=n.replace(/[A-Z]/g,o=>"_"+o.toLowerCase());return i[0]==="_"?i.substring(1):i}e.paths=t.split(",").map(r)}function _p(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${yt(t)}`);for(const[r,n]of Object.entries(t)){const i=Ge(hp);Gc(i,n),e.fields[r]=i}}function Gc(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:Ga.NULL_VALUE};else if(Array.isArray(t)){const r=Ge(Mb);yp(r,t),e.kind={case:"listValue",value:r}}else{const r=Ge(Vb);_p(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${yt(t)}`)}return e}function yp(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${yt(t)}`);for(const r of t){const n=Ge(hp);Gc(n,r),e.values.push(n)}}function Zc(e,t,...r){if(r.length>0)throw new Error;return e.services[t]}const g_=rr("Ch9ydW5tZS9wYXJzZXIvdjEvZG9jcmVzdWx0LnByb3RvEg9ydW5tZS5wYXJzZXIudjEiTAoJRG9jUmVzdWx0Eg8KB2ZpbGVfaWQYASABKAkSEQoJZmlsZV9uYW1lGAIgASgJEg0KBXNjb3JlGAMgASgBEgwKBGxpbmsYBCABKAlCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3BhcnNlci92MTtwYXJzZXJ2MWIGcHJvdG8z"),qe=rr("ChxydW5tZS9wYXJzZXIvdjEvcGFyc2VyLnByb3RvEg9ydW5tZS5wYXJzZXIudjEizwEKCE5vdGVib29rEiQKBWNlbGxzGAEgAygLMhUucnVubWUucGFyc2VyLnYxLkNlbGwSOQoIbWV0YWRhdGEYAiADKAsyJy5ydW5tZS5wYXJzZXIudjEuTm90ZWJvb2suTWV0YWRhdGFFbnRyeRIxCgtmcm9udG1hdHRlchgDIAEoCzIcLnJ1bm1lLnBhcnNlci52MS5Gcm9udG1hdHRlchovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEieAoWRXhlY3V0aW9uU3VtbWFyeVRpbWluZxIvCgpzdGFydF90aW1lGAEgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSLQoIZW5kX3RpbWUYAiABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZSI6Cg5DZWxsT3V0cHV0SXRlbRIMCgRkYXRhGAEgASgMEgwKBHR5cGUYAiABKAkSDAoEbWltZRgDIAEoCSJRChVQcm9jZXNzSW5mb0V4aXRSZWFzb24SDAoEdHlwZRgBIAEoCRIqCgRjb2RlGAIgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlIn4KFUNlbGxPdXRwdXRQcm9jZXNzSW5mbxI7CgtleGl0X3JlYXNvbhgBIAEoCzImLnJ1bm1lLnBhcnNlci52MS5Qcm9jZXNzSW5mb0V4aXRSZWFzb24SKAoDcGlkGAIgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUi6AEKCkNlbGxPdXRwdXQSLgoFaXRlbXMYASADKAsyHy5ydW5tZS5wYXJzZXIudjEuQ2VsbE91dHB1dEl0ZW0SOwoIbWV0YWRhdGEYAiADKAsyKS5ydW5tZS5wYXJzZXIudjEuQ2VsbE91dHB1dC5NZXRhZGF0YUVudHJ5EjwKDHByb2Nlc3NfaW5mbxgDIAEoCzImLnJ1bm1lLnBhcnNlci52MS5DZWxsT3V0cHV0UHJvY2Vzc0luZm8aLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrMBChRDZWxsRXhlY3V0aW9uU3VtbWFyeRI1Cg9leGVjdXRpb25fb3JkZXIYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSKwoHc3VjY2VzcxgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSNwoGdGltaW5nGAMgASgLMicucnVubWUucGFyc2VyLnYxLkV4ZWN1dGlvblN1bW1hcnlUaW1pbmciJwoJVGV4dFJhbmdlEg0KBXN0YXJ0GAEgASgNEgsKA2VuZBgCIAEoDSLWAwoEQ2VsbBInCgRraW5kGAEgASgOMhkucnVubWUucGFyc2VyLnYxLkNlbGxLaW5kEg0KBXZhbHVlGAIgASgJEhMKC2xhbmd1YWdlX2lkGAMgASgJEjUKCG1ldGFkYXRhGAQgAygLMiMucnVubWUucGFyc2VyLnYxLkNlbGwuTWV0YWRhdGFFbnRyeRIuCgp0ZXh0X3JhbmdlGAUgASgLMhoucnVubWUucGFyc2VyLnYxLlRleHRSYW5nZRIsCgdvdXRwdXRzGAYgAygLMhsucnVubWUucGFyc2VyLnYxLkNlbGxPdXRwdXQSQAoRZXhlY3V0aW9uX3N1bW1hcnkYByABKAsyJS5ydW5tZS5wYXJzZXIudjEuQ2VsbEV4ZWN1dGlvblN1bW1hcnkSDgoGcmVmX2lkGGQgASgJEicKBHJvbGUYZSABKA4yGS5ydW5tZS5wYXJzZXIudjEuQ2VsbFJvbGUSDwoHY2FsbF9pZBhmIAEoCRIvCgtkb2NfcmVzdWx0cxhnIAMoCzIaLnJ1bm1lLnBhcnNlci52MS5Eb2NSZXN1bHQaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIi0KFFJ1bm1lU2Vzc2lvbkRvY3VtZW50EhUKDXJlbGF0aXZlX3BhdGgYASABKAkiUwoMUnVubWVTZXNzaW9uEgoKAmlkGAEgASgJEjcKCGRvY3VtZW50GAIgASgLMiUucnVubWUucGFyc2VyLnYxLlJ1bm1lU2Vzc2lvbkRvY3VtZW50Il8KEEZyb250bWF0dGVyUnVubWUSCgoCaWQYASABKAkSDwoHdmVyc2lvbhgCIAEoCRIuCgdzZXNzaW9uGAMgASgLMh0ucnVubWUucGFyc2VyLnYxLlJ1bm1lU2Vzc2lvbiKnAQoLRnJvbnRtYXR0ZXISDQoFc2hlbGwYASABKAkSCwoDY3dkGAIgASgJEhQKDHNraXBfcHJvbXB0cxgDIAEoCBIwCgVydW5tZRgEIAEoCzIhLnJ1bm1lLnBhcnNlci52MS5Gcm9udG1hdHRlclJ1bm1lEhAKCGNhdGVnb3J5GAUgASgJEhUKDXRlcm1pbmFsX3Jvd3MYBiABKAkSCwoDdGFnGAcgASgJIk0KGURlc2VyaWFsaXplUmVxdWVzdE9wdGlvbnMSMAoIaWRlbnRpdHkYASABKA4yHi5ydW5tZS5wYXJzZXIudjEuUnVubWVJZGVudGl0eSJhChJEZXNlcmlhbGl6ZVJlcXVlc3QSDgoGc291cmNlGAEgASgMEjsKB29wdGlvbnMYAiABKAsyKi5ydW5tZS5wYXJzZXIudjEuRGVzZXJpYWxpemVSZXF1ZXN0T3B0aW9ucyJCChNEZXNlcmlhbGl6ZVJlc3BvbnNlEisKCG5vdGVib29rGAEgASgLMhkucnVubWUucGFyc2VyLnYxLk5vdGVib29rIkEKHVNlcmlhbGl6ZVJlcXVlc3RPdXRwdXRPcHRpb25zEg8KB2VuYWJsZWQYASABKAgSDwoHc3VtbWFyeRgCIAEoCCKKAQoXU2VyaWFsaXplUmVxdWVzdE9wdGlvbnMSPwoHb3V0cHV0cxgBIAEoCzIuLnJ1bm1lLnBhcnNlci52MS5TZXJpYWxpemVSZXF1ZXN0T3V0cHV0T3B0aW9ucxIuCgdzZXNzaW9uGAIgASgLMh0ucnVubWUucGFyc2VyLnYxLlJ1bm1lU2Vzc2lvbiJ6ChBTZXJpYWxpemVSZXF1ZXN0EisKCG5vdGVib29rGAEgASgLMhkucnVubWUucGFyc2VyLnYxLk5vdGVib29rEjkKB29wdGlvbnMYAiABKAsyKC5ydW5tZS5wYXJzZXIudjEuU2VyaWFsaXplUmVxdWVzdE9wdGlvbnMiIwoRU2VyaWFsaXplUmVzcG9uc2USDgoGcmVzdWx0GAEgASgMKmoKCENlbGxLaW5kEhkKFUNFTExfS0lORF9VTlNQRUNJRklFRBAAEhQKEENFTExfS0lORF9NQVJLVVAQARISCg5DRUxMX0tJTkRfQ09ERRACEhkKFUNFTExfS0lORF9ET0NfUkVTVUxUUxADKlIKCENlbGxSb2xlEhkKFUNFTExfUk9MRV9VTlNQRUNJRklFRBAAEhIKDkNFTExfUk9MRV9VU0VSEAESFwoTQ0VMTF9ST0xFX0FTU0lTVEFOVBACKn0KDVJ1bm1lSWRlbnRpdHkSHgoaUlVOTUVfSURFTlRJVFlfVU5TUEVDSUZJRUQQABIWChJSVU5NRV9JREVOVElUWV9BTEwQARIbChdSVU5NRV9JREVOVElUWV9ET0NVTUVOVBACEhcKE1JVTk1FX0lERU5USVRZX0NFTEwQAzLBAQoNUGFyc2VyU2VydmljZRJaCgtEZXNlcmlhbGl6ZRIjLnJ1bm1lLnBhcnNlci52MS5EZXNlcmlhbGl6ZVJlcXVlc3QaJC5ydW5tZS5wYXJzZXIudjEuRGVzZXJpYWxpemVSZXNwb25zZSIAElQKCVNlcmlhbGl6ZRIhLnJ1bm1lLnBhcnNlci52MS5TZXJpYWxpemVSZXF1ZXN0GiIucnVubWUucGFyc2VyLnYxLlNlcmlhbGl6ZVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3BhcnNlci92MTtwYXJzZXJ2MWIGcHJvdG8z",[fp,g_]),js=Be(qe,0),jc=Be(qe,1),Ai=Be(qe,2),Kc=Be(qe,3),Yc=Be(qe,4),_o=Be(qe,5),Xc=Be(qe,6),Sp=Be(qe,7),gn=Be(qe,8),wp=Be(qe,9),Jc=Be(qe,10),Ep=Be(qe,11),Cp=Be(qe,12),kp=Be(qe,13),Ip=Be(qe,14),Ap=Be(qe,15),zc=Be(qe,16),qc=Be(qe,17),Qc=Be(qe,18),xp=Be(qe,19),el=Xt(qe,0),Lt=Jt(el),tl=Xt(qe,1),Kt=Jt(tl),rl=Xt(qe,2),Rp=Jt(rl),nl=Zc(qe,0),m_=Object.freeze(Object.defineProperty({__proto__:null,CellExecutionSummarySchema:Xc,CellKind:Lt,CellKindSchema:el,CellOutputItemSchema:Ai,CellOutputProcessInfoSchema:Yc,CellOutputSchema:_o,CellRole:Kt,CellRoleSchema:tl,CellSchema:gn,DeserializeRequestOptionsSchema:kp,DeserializeRequestSchema:Ip,DeserializeResponseSchema:Ap,ExecutionSummaryTimingSchema:jc,FrontmatterRunmeSchema:Ep,FrontmatterSchema:Cp,NotebookSchema:js,ParserService:nl,ProcessInfoExitReasonSchema:Kc,RunmeIdentity:Rp,RunmeIdentitySchema:rl,RunmeSessionDocumentSchema:wp,RunmeSessionSchema:Jc,SerializeRequestOptionsSchema:qc,SerializeRequestOutputOptionsSchema:zc,SerializeRequestSchema:Qc,SerializeResponseSchema:xp,TextRangeSchema:Sp,file_runme_parser_v1_parser:qe},Symbol.toStringTag,{value:"Module"})),Np=rr("ChZhZ2VudC92MS9zZXJ2aWNlLnByb3RvEghhZ2VudC52MSJyCg9HZW5lcmF0ZVJlcXVlc3QSJAoFY2VsbHMYASADKAsyFS5ydW5tZS5wYXJzZXIudjEuQ2VsbBIcChRwcmV2aW91c19yZXNwb25zZV9pZBgCIAEoCRIbChNvcGVuYWlfYWNjZXNzX3Rva2VuGAMgASgJIk0KEEdlbmVyYXRlUmVzcG9uc2USJAoFY2VsbHMYASADKAsyFS5ydW5tZS5wYXJzZXIudjEuQ2VsbBITCgtyZXNwb25zZV9pZBgCIAEoCSI5CgpMb2dSZXF1ZXN0EisKCG5vdGVib29rGAEgASgLMhkucnVubWUucGFyc2VyLnYxLk5vdGVib29rIg0KC0xvZ1Jlc3BvbnNlMlgKD01lc3NhZ2VzU2VydmljZRJFCghHZW5lcmF0ZRIZLmFnZW50LnYxLkdlbmVyYXRlUmVxdWVzdBoaLmFnZW50LnYxLkdlbmVyYXRlUmVzcG9uc2UiADABMkIKCkxvZ1NlcnZpY2USNAoDTG9nEhQuYWdlbnQudjEuTG9nUmVxdWVzdBoVLmFnZW50LnYxLkxvZ1Jlc3BvbnNlIgBCQFo+Z2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL2FnZW50L3YxO2FnZW50djFiBnByb3RvMw",[qe]),v_=Be(Np,0),b_=Zc(Np,0),Et=[];for(let e=0;e<256;++e)Et.push((e+256).toString(16).slice(1));function __(e,t=0){return(Et[e[t+0]]+Et[e[t+1]]+Et[e[t+2]]+Et[e[t+3]]+"-"+Et[e[t+4]]+Et[e[t+5]]+"-"+Et[e[t+6]]+Et[e[t+7]]+"-"+Et[e[t+8]]+Et[e[t+9]]+"-"+Et[e[t+10]]+Et[e[t+11]]+Et[e[t+12]]+Et[e[t+13]]+Et[e[t+14]]+Et[e[t+15]]).toLowerCase()}let ba;const y_=new Uint8Array(16);function S_(){if(!ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ba=crypto.getRandomValues.bind(crypto)}return ba(y_)}const w_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),hd={randomUUID:w_};function fd(e,t,r){var i;if(hd.randomUUID&&!e)return hd.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??S_();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,__(n)}const E_=rr("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),We=rr("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[fp,E_]),Tp=Be(We,0),C_=Be(We,1),k_=Be(We,2),I_=Be(We,2,0),Bp=Xt(We,2,0,0),Lp=Jt(Bp),A_=Be(We,3),Op=Be(We,4),x_=Be(We,5),R_=Be(We,6),N_=Be(We,7),T_=Be(We,8),B_=Be(We,9),L_=Be(We,10),O_=Be(We,11),D_=Be(We,12),F_=Be(We,13),V_=Be(We,14),M_=Be(We,15),U_=Be(We,16),Dp=Xt(We,16,0),P_=Jt(Dp),Fp=Xt(We,16,1),W_=Jt(Fp),H_=Be(We,17),$_=Be(We,17,0),Vp=Xt(We,17,0),G_=Jt(Vp),Z_=Be(We,18),j_=Be(We,19),K_=Be(We,19,0),Y_=Be(We,19,1),Mp=Xt(We,19,0),X_=Jt(Mp),J_=Be(We,20),Up=Xt(We,0),z_=Jt(Up),Pp=Xt(We,1),q_=Jt(Pp),Wp=Xt(We,2),Q_=Jt(Wp),Hp=Xt(We,3),e1=Jt(Hp),$p=Zc(We,0),t1=Object.freeze(Object.defineProperty({__proto__:null,CreateSessionRequestSchema:k_,CreateSessionRequest_ConfigSchema:I_,CreateSessionRequest_Config_SessionEnvStoreSeeding:Lp,CreateSessionRequest_Config_SessionEnvStoreSeedingSchema:Bp,CreateSessionResponseSchema:A_,DeleteSessionRequestSchema:L_,DeleteSessionResponseSchema:O_,ExecuteRequestSchema:F_,ExecuteResponseSchema:V_,ExecuteStop:q_,ExecuteStopSchema:Pp,GetSessionRequestSchema:Op,GetSessionResponseSchema:x_,ListSessionsRequestSchema:R_,ListSessionsResponseSchema:N_,MonitorEnvStoreRequestSchema:Z_,MonitorEnvStoreResponseSchema:J_,MonitorEnvStoreResponseSnapshotSchema:j_,MonitorEnvStoreResponseSnapshot_ErrorSchema:Y_,MonitorEnvStoreResponseSnapshot_SnapshotEnvSchema:K_,MonitorEnvStoreResponseSnapshot_Status:X_,MonitorEnvStoreResponseSnapshot_StatusSchema:Mp,MonitorEnvStoreType:e1,MonitorEnvStoreTypeSchema:Hp,ProjectSchema:Tp,ResolveProgramCommandListSchema:M_,ResolveProgramRequestSchema:U_,ResolveProgramRequest_Mode:P_,ResolveProgramRequest_ModeSchema:Dp,ResolveProgramRequest_Retention:W_,ResolveProgramRequest_RetentionSchema:Fp,ResolveProgramResponseSchema:H_,ResolveProgramResponse_Status:G_,ResolveProgramResponse_StatusSchema:Vp,ResolveProgramResponse_VarResultSchema:$_,RunnerService:$p,SessionEnvStoreType:z_,SessionEnvStoreTypeSchema:Up,SessionSchema:C_,SessionStrategy:Q_,SessionStrategySchema:Wp,UpdateSessionRequestSchema:T_,UpdateSessionResponseSchema:B_,WinsizeSchema:D_,file_runme_runner_v2_runner:We},Symbol.toStringTag,{value:"Module"}));var Pe;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(Pe||(Pe={}));function pd(e){const t=Pe[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,r=>"_"+r.toLowerCase())}class Je extends Error{constructor(t,r=Pe.Unknown,n,i,o){super(r1(t,r)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=r,this.metadata=new Headers(n??{}),this.details=i??[],this.cause=o}static from(t,r=Pe.Unknown){return t instanceof Je?t:t instanceof Error?t.name=="AbortError"||t.name=="TimeoutError"?new Je(t.message,Pe.Canceled):new Je(t.message,r,void 0,void 0,t):new Je(String(t),r,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===Je.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){const r=t.kind==="message"?{getMessage:i=>i===t.typeName?t:void 0}:t,n=[];for(const i of this.details){if("desc"in i){r.getMessage(i.desc.typeName)&&n.push(Ge(i.desc,i.value));continue}const o=r.getMessage(i.type);if(o)try{n.push($i(o,i.value))}catch{}}return n}}function r1(e,t){return e.length?`[${pd(t)}] ${e}`:`[${pd(t)}]`}function n1(e,t,r){try{const n=Fc(e);return t?$i(t,n,r):n}catch(n){throw Je.from(n,Pe.DataLoss)}}function i1(e,t){const r={};for(const n of e.methods){const i=t(n);i!=null&&(r[n.localName]=i)}return r}const gd=1;function s1(e,t,r=!1){if(t>e){let n=`message size is larger than configured readMaxBytes ${e}`;throw r&&(n=`message size ${t} is larger than configured readMaxBytes ${e}`),new Je(n,Pe.ResourceExhausted)}}function o1(e){return new a1(e)}class a1{constructor(t){this.readMaxBytes=t,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((t,r)=>t+r.byteLength,0)}decode(t){this.buf.push(t);const r=[];for(;;){let n=this.pop();if(!n)break;r.push(n)}return r}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){const t=this.env;return this.env=void 0,t}}head(){if(!this.cons(this.header))return;const t=this.headerView.getUint8(0),r=this.headerView.getUint32(1);return s1(this.readMaxBytes,r,!0),{flags:t,data:new Uint8Array(r)}}cons(t){const r=t.byteLength;if(this.byteLength<r)return!1;let n=0;for(;n<r;){const i=this.buf.shift();i.byteLength>r-n?(t.set(i.subarray(0,r-n),n),this.buf.unshift(i.subarray(r-n)),n+=r-n):(t.set(i,n),n+=i.byteLength)}return!0}}function md(e){let t;const r=o1(4294967295);return new ReadableStream({start(){t=e.getReader()},async pull(n){let i=!1;for(;!i;){const o=await t.read();if(o.done)r.byteLength>0&&n.error(new Je("protocol error: incomplete envelope",Pe.InvalidArgument)),n.close();else for(const u of r.decode(o.value))n.enqueue(u),i=!0}}})}function vd(e,t){const r=new Uint8Array(t.length+5);r.set(t,5);const n=new DataView(r.buffer,r.byteOffset,r.byteLength);return n.setUint8(0,e),n.setUint32(1,t.length),r}var c1=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(u){return new Promise(function(s,a){u=e[o](u),i(s,a,u.done,u.value)})}}function i(o,u,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},u)}},xi=function(e){return this instanceof xi?(this.v=e,this):new xi(e)},l1=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof xi?Promise.resolve(_.value.v).then(m,f):b(o[0][2],_)}function m(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}},u1=function(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(u){return(r=!r)?{value:xi(e[i](u)),done:!1}:o?o(u):u}:o}};function d1(e){return l1(this,arguments,function*(){yield xi(yield*u1(c1(e)))})}var Gp=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(u){return new Promise(function(s,a){u=e[o](u),i(s,a,u.done,u.value)})}}function i(o,u,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},u)}},Hn=function(e){return this instanceof Hn?(this.v=e,this):new Hn(e)},h1=function(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(u){return(r=!r)?{value:Hn(e[i](u)),done:!1}:o?o(u):u}:o}},f1=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof Hn?Promise.resolve(_.value.v).then(m,f):b(o[0][2],_)}function m(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}};function Zp(e,t){return i1(e,r=>{switch(r.methodKind){case"unary":return p1(t,r);case"server_streaming":return g1(t,r);case"client_streaming":return m1(t,r);case"bidi_streaming":return v1(t,r);default:return null}})}function p1(e,t){return async(r,n)=>{var i,o;const u=await e.unary(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues);return(i=n==null?void 0:n.onHeader)===null||i===void 0||i.call(n,u.header),(o=n==null?void 0:n.onTrailer)===null||o===void 0||o.call(n,u.trailer),u.message}}function g1(e,t){return(r,n)=>jp(e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,d1([r]),n==null?void 0:n.contextValues),n)}function m1(e,t){return async(r,n)=>{var i,o,u,s,a,c;const m=await e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues);(a=n==null?void 0:n.onHeader)===null||a===void 0||a.call(n,m.header);let f,b=0;try{for(var _=!0,k=Gp(m.message),y;y=await k.next(),i=y.done,!i;_=!0)s=y.value,_=!1,f=s,b++}catch(d){o={error:d}}finally{try{!_&&!i&&(u=k.return)&&await u.call(k)}finally{if(o)throw o.error}}if(!f)throw new Je("protocol error: missing response message",Pe.Unimplemented);if(b>1)throw new Je("protocol error: received extra messages for client streaming method",Pe.Unimplemented);return(c=n==null?void 0:n.onTrailer)===null||c===void 0||c.call(n,m.trailer),f}}function v1(e,t){return(r,n)=>jp(e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues),n)}function jp(e,t){const r=(function(){return f1(this,arguments,function*(){var n,i;const o=yield Hn(e);(n=t==null?void 0:t.onHeader)===null||n===void 0||n.call(t,o.header),yield Hn(yield*h1(Gp(o.message))),(i=t==null?void 0:t.onTrailer)===null||i===void 0||i.call(t,o.trailer)})})()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>r.next()})}}function b1(...e){const t=new AbortController,r=e.filter(i=>i!==void 0).concat(t.signal);for(const i of r){if(i.aborted){n.apply(i);break}i.addEventListener("abort",n)}function n(){t.signal.aborted||t.abort(Kp(this));for(const i of r)i.removeEventListener("abort",n)}return t}function _1(e){const t=new AbortController,r=()=>{t.abort(new Je("the operation timed out",Pe.DeadlineExceeded))};let n;return e!==void 0&&(e<=0?r():n=setTimeout(r,e)),{signal:t.signal,cleanup:()=>clearTimeout(n)}}function Kp(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function bd(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}const _a=128;function _d(e){const t=new Headers,r=new TextDecoder().decode(e).split(`\r
|
|
3
|
-
`);for(const n of r){if(n==="")continue;const i=n.indexOf(":");if(i>0){const o=n.substring(0,i).trim(),u=n.substring(i+1).trim();t.append(o,u)}}return t}const y1="Content-Type",S1="Grpc-Timeout",$n="Grpc-Status",Yp="Grpc-Message",w1="Grpc-Status-Details-Bin",E1="User-Agent",yd="X-User-Agent",C1="X-Grpc-Web",k1="application/grpc-web+proto",I1="application/grpc-web+json",A1=rr("CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z",[op]),x1=Be(A1,0),R1="0";function Xp(e){var t;const r=e.get(w1);if(r!=null){const i=n1(r,x1);if(i.code==0)return;const o=new Je(i.message,i.code,e);return o.details=i.details.map(u=>({type:u.typeUrl.substring(u.typeUrl.lastIndexOf("/")+1),value:u.value})),o}const n=e.get($n);if(n!=null){if(n===R1)return;const i=parseInt(n,10);return i in Pe?new Je(decodeURIComponent((t=e.get(Yp))!==null&&t!==void 0?t:""),i,e):new Je(`invalid grpc-status: ${n}`,Pe.Internal,e)}}function Sd(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function Jp(e,t){return Ge(e,t)}function N1(e,t){function r(n){return n.done===!0?n:{done:n.done,value:Jp(e,n.value)}}return{[Symbol.asyncIterator](){const n=t[Symbol.asyncIterator](),i={next:()=>n.next().then(r)};return n.throw!==void 0&&(i.throw=o=>n.throw(o).then(r)),n.return!==void 0&&(i.return=o=>n.return(o).then(r)),i}}}function zp(e,t){if(!t)return e;for(const r of t.concat().reverse())e=r(e);return e}function T1(e){var t;const r=Object.assign({},e);return(t=r.ignoreUnknownFields)!==null&&t!==void 0||(r.ignoreUnknownFields=!0),r}function wd(e,t,r,n){const i=t?Ed(e.input,n):Cd(e.input,r);return{parse:(t?Ed(e.output,n):Cd(e.output,r)).parse,serialize:i.serialize}}function Ed(e,t){return{parse(r){try{return $i(e,r,t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Je(`parse binary: ${i}`,Pe.Internal)}},serialize(r){try{return ap(e,r,t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Je(`serialize binary: ${i}`,Pe.Internal)}}}}function Cd(e,t){var r,n;const i=(r=t==null?void 0:t.textEncoder)!==null&&r!==void 0?r:new TextEncoder,o=(n=t==null?void 0:t.textDecoder)!==null&&n!==void 0?n:new TextDecoder,u=T1(t);return{parse(s){try{const a=o.decode(s);return r_(e,a,u)}catch(a){throw Je.from(a,Pe.InvalidArgument)}},serialize(s){try{const a=jb(e,s,u);return i.encode(a)}catch(a){throw Je.from(a,Pe.Internal)}}}}function B1(e){const t=zp(e.next,e.interceptors),[r,n,i]=qp(e),o=Object.assign(Object.assign({},e.req),{message:Jp(e.req.method.input,e.req.message),signal:r});return t(o).then(u=>(i(),u),n)}function L1(e){const t=zp(e.next,e.interceptors),[r,n,i]=qp(e),o=Object.assign(Object.assign({},e.req),{message:N1(e.req.method.input,e.req.message),signal:r});let u=!1;return r.addEventListener("abort",function(){var s,a;const c=e.req.message[Symbol.asyncIterator]();u||(s=c.throw)===null||s===void 0||s.call(c,this.reason).catch(()=>{}),(a=c.return)===null||a===void 0||a.call(c).catch(()=>{})}),t(o).then(s=>Object.assign(Object.assign({},s),{message:{[Symbol.asyncIterator](){const a=s.message[Symbol.asyncIterator]();return{next(){return a.next().then(c=>(c.done==!0&&(u=!0,i()),c),n)}}}}}),n)}function qp(e){const{signal:t,cleanup:r}=_1(e.timeoutMs),n=b1(e.signal,t);return[n.signal,function(o){const u=Je.from(t.aborted?Kp(t):o);return n.abort(u),r(),Promise.reject(u)},function(){r(),n.abort()}]}function O1(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function kd(e,t){const r=Xp(e);if(r)throw t.forEach((n,i)=>{r.metadata.append(i,n)}),r;if(!t.has($n)&&!e.has($n))throw new Je("protocol error: missing status",Pe.Internal)}function Id(e,t,r,n){var i,o;const u=new Headers(r??{});u.set(y1,e?k1:I1),u.set(C1,"1");const s=(o=(i=u.get(E1))!==null&&i!==void 0?i:u.get(yd))!==null&&o!==void 0?o:"connect-es/2.1.0";return u.set(yd,s),t!==void 0&&u.set(S1,`${t}m`),u}function D1(e){switch(e){case 400:return Pe.Internal;case 401:return Pe.Unauthenticated;case 403:return Pe.PermissionDenied;case 404:return Pe.Unimplemented;case 429:return Pe.Unavailable;case 502:return Pe.Unavailable;case 503:return Pe.Unavailable;case 504:return Pe.Unavailable;default:return Pe.Unknown}}function Ad(e,t){var r;if(e>=200&&e<300)return{foundStatus:t.has($n),headerError:Xp(t)};throw new Je(decodeURIComponent((r=t.get(Yp))!==null&&r!==void 0?r:`HTTP ${e}`),D1(e),t)}var ln=function(e){return this instanceof ln?(this.v=e,this):new ln(e)},F1=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof ln?Promise.resolve(_.value.v).then(m,f):b(o[0][2],_)}function m(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}};const xd={redirect:"error"};function Qp(e){var t;O1();const r=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!0;return{async unary(n,i,o,u,s,a){const{serialize:c,parse:m}=wd(n,r,e.jsonOptions,e.binaryOptions);return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,await B1({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!1,service:n.parent,method:n,requestMethod:"POST",url:Sd(e.baseUrl,n),header:Id(r,o,u),contextValues:a??bd(),message:s},next:async f=>{var b;const k=await((b=e.fetch)!==null&&b!==void 0?b:globalThis.fetch)(f.url,Object.assign(Object.assign({},xd),{method:f.requestMethod,headers:f.header,signal:f.signal,body:vd(0,c(f.message))})),{headerError:y}=Ad(k.status,k.headers);if(!k.body)throw y!==void 0?y:"missing response body";const d=md(k.body).getReader();let p,h;for(;;){const g=await d.read();if(g.done)break;const{flags:S,data:I}=g.value;if((S&gd)===gd)throw new Je("protocol error: received unsupported compressed output",Pe.Internal);if(S===_a){if(p!==void 0)throw"extra trailer";p=_d(I);continue}if(h!==void 0)throw new Je("extra message",Pe.Unimplemented);h=m(I)}if(p===void 0)throw y!==void 0?y:new Je("missing trailer",k.headers.has($n)?Pe.Unimplemented:Pe.Unknown);if(kd(p,k.headers),h===void 0)throw new Je("missing message",p.has($n)?Pe.Unimplemented:Pe.Unknown);return{stream:!1,service:n.parent,method:n,header:k.headers,message:h,trailer:p}}})},async stream(n,i,o,u,s,a){const{serialize:c,parse:m}=wd(n,r,e.jsonOptions,e.binaryOptions);function f(_,k,y,d,p){return F1(this,arguments,function*(){const g=md(_).getReader();if(k){if(!(yield ln(g.read())).done)throw"extra data for trailers-only";return yield ln(void 0)}let S=!1;for(;;){const I=yield ln(g.read());if(I.done)break;const{flags:C,data:A}=I.value;if((C&_a)===_a){if(S)throw"extra trailer";S=!0;const E=_d(A);kd(E,d),E.forEach((N,F)=>y.set(F,N));continue}if(S)throw"extra message";yield yield ln(m(A))}if("throwIfAborted"in p&&p.throwIfAborted(),!S)throw"missing trailer"})}async function b(_){if(n.methodKind!="server_streaming")throw"The fetch API does not support streaming request bodies";const k=await _[Symbol.asyncIterator]().next();if(k.done==!0)throw"missing request message";return vd(0,c(k.value))}return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,L1({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!0,service:n.parent,method:n,requestMethod:"POST",url:Sd(e.baseUrl,n),header:Id(r,o,u),contextValues:a??bd(),message:s},next:async _=>{var k;const d=await((k=e.fetch)!==null&&k!==void 0?k:globalThis.fetch)(_.url,Object.assign(Object.assign({},xd),{method:_.requestMethod,headers:_.header,signal:_.signal,body:await b(_.message)})),{foundStatus:p,headerError:h}=Ad(d.status,d.headers);if(h!=null)throw h;if(!d.body)throw"missing response body";const g=new Headers;return Object.assign(Object.assign({},_),{header:d.headers,trailer:g,message:f(d.body,p,g,d.headers,_.signal)})}})}}}function Za(e,t,r=[]){const n=Qp({baseUrl:t,interceptors:r});return Zp(e,n)}var gr=(e=>(e.StatefulRunmeOutputItems="stateful.runme/output-items",e.StatefulRunmeTerminal="stateful.runme/terminal",e.VSCodeNotebookStdOut="application/vnd.code.notebook.stdout",e.VSCodeNotebookStdErr="application/vnd.code.notebook.stderr",e))(gr||{});const Ln="runme.dev/";var Ft=(e=>(e.ID="id",e.RunmeID=`${Ln}id`,e.Sequence=`${Ln}sequence`,e.LastRunID=`${Ln}lastRunID`,e.Pid=`${Ln}pid`,e.ExitCode=`${Ln}exitCode`,e))(Ft||{}),Ks=(e=>(e.PreviousResponseId=`${Ln}previousResponseId`,e))(Ks||{}),V1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs={exports:{}},M1=Fs.exports,Rd;function U1(){return Rd||(Rd=1,(function(e,t){(function(r,n){e.exports=n()})(M1,function(){var r=function(l,v){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var R in x)Object.prototype.hasOwnProperty.call(x,R)&&(w[R]=x[R])})(l,v)},n=function(){return(n=Object.assign||function(l){for(var v,w=1,x=arguments.length;w<x;w++)for(var R in v=arguments[w])Object.prototype.hasOwnProperty.call(v,R)&&(l[R]=v[R]);return l}).apply(this,arguments)};function i(l,v,w){for(var x,R=0,T=v.length;R<T;R++)!x&&R in v||((x=x||Array.prototype.slice.call(v,0,R))[R]=v[R]);return l.concat(x||Array.prototype.slice.call(v))}var o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:V1,u=Object.keys,s=Array.isArray;function a(l,v){return typeof v!="object"||u(v).forEach(function(w){l[w]=v[w]}),l}typeof Promise>"u"||o.Promise||(o.Promise=Promise);var c=Object.getPrototypeOf,m={}.hasOwnProperty;function f(l,v){return m.call(l,v)}function b(l,v){typeof v=="function"&&(v=v(c(l))),(typeof Reflect>"u"?u:Reflect.ownKeys)(v).forEach(function(w){k(l,w,v[w])})}var _=Object.defineProperty;function k(l,v,w,x){_(l,v,a(w&&f(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},x))}function y(l){return{from:function(v){return l.prototype=Object.create(v.prototype),k(l.prototype,"constructor",l),{extend:b.bind(null,l.prototype)}}}}var d=Object.getOwnPropertyDescriptor,p=[].slice;function h(l,v,w){return p.call(l,v,w)}function g(l,v){return v(l)}function S(l){if(!l)throw new Error("Assertion Failed")}function I(l){o.setImmediate?setImmediate(l):setTimeout(l,0)}function C(l,v){if(typeof v=="string"&&f(l,v))return l[v];if(!v)return l;if(typeof v!="string"){for(var w=[],x=0,R=v.length;x<R;++x){var T=C(l,v[x]);w.push(T)}return w}var D=v.indexOf(".");if(D!==-1){var M=l[v.substr(0,D)];return M==null?void 0:C(M,v.substr(D+1))}}function A(l,v,w){if(l&&v!==void 0&&!("isFrozen"in Object&&Object.isFrozen(l)))if(typeof v!="string"&&"length"in v){S(typeof w!="string"&&"length"in w);for(var x=0,R=v.length;x<R;++x)A(l,v[x],w[x])}else{var T,D,M=v.indexOf(".");M!==-1?(T=v.substr(0,M),(D=v.substr(M+1))===""?w===void 0?s(l)&&!isNaN(parseInt(T))?l.splice(T,1):delete l[T]:l[T]=w:A(M=!(M=l[T])||!f(l,T)?l[T]={}:M,D,w)):w===void 0?s(l)&&!isNaN(parseInt(v))?l.splice(v,1):delete l[v]:l[v]=w}}function E(l){var v,w={};for(v in l)f(l,v)&&(w[v]=l[v]);return w}var N=[].concat;function F(l){return N.apply([],l)}var Wt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(F([8,16,32,64].map(function(l){return["Int","Uint","Float"].map(function(v){return v+l+"Array"})}))).filter(function(l){return o[l]}),U=new Set(Wt.map(function(l){return o[l]})),P=null;function O(l){return P=new WeakMap,l=(function v(w){if(!w||typeof w!="object")return w;var x=P.get(w);if(x)return x;if(s(w)){x=[],P.set(w,x);for(var R=0,T=w.length;R<T;++R)x.push(v(w[R]))}else if(U.has(w.constructor))x=w;else{var D,M=c(w);for(D in x=M===Object.prototype?{}:Object.create(M),P.set(w,x),w)f(w,D)&&(x[D]=v(w[D]))}return x})(l),P=null,l}var te={}.toString;function le(l){return te.call(l).slice(8,-1)}var ge=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ke=typeof ge=="symbol"?function(l){var v;return l!=null&&(v=l[ge])&&v.apply(l)}:function(){return null};function ie(l,v){return v=l.indexOf(v),0<=v&&l.splice(v,1),0<=v}var B={};function V(l){var v,w,x,R;if(arguments.length===1){if(s(l))return l.slice();if(this===B&&typeof l=="string")return[l];if(R=ke(l)){for(w=[];!(x=R.next()).done;)w.push(x.value);return w}if(l==null)return[l];if(typeof(v=l.length)!="number")return[l];for(w=new Array(v);v--;)w[v]=l[v];return w}for(v=arguments.length,w=new Array(v);v--;)w[v]=arguments[v];return w}var W=typeof Symbol<"u"?function(l){return l[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Rt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],er=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Rt),Z={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function he(l,v){this.name=l,this.message=v}function me(l,v){return l+". Errors: "+Object.keys(v).map(function(w){return v[w].toString()}).filter(function(w,x,R){return R.indexOf(w)===x}).join(`
|
|
4
|
-
`)}function
|
|
5
|
-
`+T:""),this.inner=T||null):typeof R=="object"&&(this.message="".concat(R.name," ").concat(R.message),this.inner=R):(this.message=Z[v]||w,this.inner=null)}return y(x).from(L),l[v]=x,l},{});se.Syntax=SyntaxError,se.Type=TypeError,se.Range=RangeError;var ae=Rt.reduce(function(l,v){return l[v+"Error"]=se[v],l},{}),Ie=er.reduce(function(l,v){return["Syntax","Type","Range"].indexOf(v)===-1&&(l[v+"Error"]=se[v]),l},{});function fe(){}function Fe(l){return l}function tt(l,v){return l==null||l===Fe?v:function(w){return v(l(w))}}function Xe(l,v){return function(){l.apply(this,arguments),v.apply(this,arguments)}}function xt(l,v){return l===fe?v:function(){var w=l.apply(this,arguments);w!==void 0&&(arguments[0]=w);var x=this.onsuccess,R=this.onerror;this.onsuccess=null,this.onerror=null;var T=v.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?Xe(x,this.onsuccess):x),R&&(this.onerror=this.onerror?Xe(R,this.onerror):R),T!==void 0?T:w}}function Le(l,v){return l===fe?v:function(){l.apply(this,arguments);var w=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,v.apply(this,arguments),w&&(this.onsuccess=this.onsuccess?Xe(w,this.onsuccess):w),x&&(this.onerror=this.onerror?Xe(x,this.onerror):x)}}function Yr(l,v){return l===fe?v:function(w){var x=l.apply(this,arguments);a(w,x);var R=this.onsuccess,T=this.onerror;return this.onsuccess=null,this.onerror=null,w=v.apply(this,arguments),R&&(this.onsuccess=this.onsuccess?Xe(R,this.onsuccess):R),T&&(this.onerror=this.onerror?Xe(T,this.onerror):T),x===void 0?w===void 0?void 0:w:a(x,w)}}function Qn(l,v){return l===fe?v:function(){return v.apply(this,arguments)!==!1&&l.apply(this,arguments)}}function Xr(l,v){return l===fe?v:function(){var w=l.apply(this,arguments);if(w&&typeof w.then=="function"){for(var x=this,R=arguments.length,T=new Array(R);R--;)T[R]=arguments[R];return w.then(function(){return v.apply(x,T)})}return v.apply(this,arguments)}}Ie.ModifyError=be,Ie.DexieError=he,Ie.BulkError=Ee;var Vt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Jr(l){Vt=l}var mt={},Nr=100,Wt=typeof Promise>"u"?[]:(function(){var l=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[l,c(l),l];var v=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[v,c(v),l]})(),Rt=Wt[0],er=Wt[1],Wt=Wt[2],er=er&&er.then,ir=Rt&&Rt.constructor,qt=!!Wt,lr=function(l,v){ei.push([l,v]),ur&&(queueMicrotask(Pv),ur=!1)},Qt=!0,ur=!0,Ye=[],Sn=[],Bo=Fe,Tr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:fe,pgp:!1,env:{},finalize:fe},Re=Tr,ei=[],zr=0,Qi=[];function Ae(l){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var v=this._PSD=Re;if(typeof l!="function"){if(l!==mt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Oo(this,this._value))}this._state=null,this._value=null,++v.ref,(function w(x,R){try{R(function(T){if(x._state===null){if(T===x)throw new TypeError("A promise cannot be resolved with itself.");var D=x._lib&&wn();T&&typeof T.then=="function"?w(x,function(M,G){T instanceof Ae?T._then(M,G):T.then(M,G)}):(x._state=!0,x._value=T,jl(x)),D&&En()}},Oo.bind(null,x))}catch(T){Oo(x,T)}})(this,l)}var Lo={get:function(){var l=Re,v=ns;function w(x,R){var T=this,D=!l.global&&(l!==Re||v!==ns),M=D&&!Lr(),G=new Ae(function(j,z){Do(T,new Zl(Yl(x,l,D,M),Yl(R,l,D,M),j,z,l))});return this._consoleTask&&(G._consoleTask=this._consoleTask),G}return w.prototype=mt,w},set:function(l){k(this,"then",l&&l.prototype===mt?Lo:{get:function(){return l},set:Lo.set})}};function Zl(l,v,w,x,R){this.onFulfilled=typeof l=="function"?l:null,this.onRejected=typeof v=="function"?v:null,this.resolve=w,this.reject=x,this.psd=R}function Oo(l,v){var w,x;Sn.push(v),l._state===null&&(w=l._lib&&wn(),v=Bo(v),l._state=!1,l._value=v,x=l,Ye.some(function(R){return R._value===x._value})||Ye.push(x),jl(l),w&&En())}function jl(l){var v=l._listeners;l._listeners=[];for(var w=0,x=v.length;w<x;++w)Do(l,v[w]);var R=l._PSD;--R.ref||R.finalize(),zr===0&&(++zr,lr(function(){--zr==0&&Fo()},[]))}function Do(l,v){if(l._state!==null){var w=l._state?v.onFulfilled:v.onRejected;if(w===null)return(l._state?v.resolve:v.reject)(l._value);++v.psd.ref,++zr,lr(Uv,[w,l,v])}else l._listeners.push(v)}function Uv(l,v,w){try{var x,R=v._value;!v._state&&Sn.length&&(Sn=[]),x=Vt&&v._consoleTask?v._consoleTask.run(function(){return l(R)}):l(R),v._state||Sn.indexOf(R)!==-1||(function(T){for(var D=Ye.length;D;)if(Ye[--D]._value===T._value)return Ye.splice(D,1)})(v),w.resolve(x)}catch(T){w.reject(T)}finally{--zr==0&&Fo(),--w.psd.ref||w.psd.finalize()}}function Pv(){qr(Tr,function(){wn()&&En()})}function wn(){var l=Qt;return ur=Qt=!1,l}function En(){var l,v,w;do for(;0<ei.length;)for(l=ei,ei=[],w=l.length,v=0;v<w;++v){var x=l[v];x[0].apply(null,x[1])}while(0<ei.length);ur=Qt=!0}function Fo(){var l=Ye;Ye=[],l.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var v=Qi.slice(0),w=v.length;w;)v[--w]()}function es(l){return new Ae(mt,!1,l)}function rt(l,v){var w=Re;return function(){var x=wn(),R=Re;try{return Or(w,!0),l.apply(this,arguments)}catch(T){v&&v(T)}finally{Or(R,!1),x&&En()}}}b(Ae.prototype,{then:Lo,_then:function(l,v){Do(this,new Zl(null,null,l,v,Re))},catch:function(l){if(arguments.length===1)return this.then(null,l);var v=l,w=arguments[1];return typeof v=="function"?this.then(null,function(x){return(x instanceof v?w:es)(x)}):this.then(null,function(x){return(x&&x.name===v?w:es)(x)})},finally:function(l){return this.then(function(v){return Ae.resolve(l()).then(function(){return v})},function(v){return Ae.resolve(l()).then(function(){return es(v)})})},timeout:function(l,v){var w=this;return l<1/0?new Ae(function(x,R){var T=setTimeout(function(){return R(new se.Timeout(v))},l);w.then(x,R).finally(clearTimeout.bind(null,T))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&k(Ae.prototype,Symbol.toStringTag,"Dexie.Promise"),Tr.env=Kl(),b(Ae,{all:function(){var l=V.apply(null,arguments).map(is);return new Ae(function(v,w){l.length===0&&v([]);var x=l.length;l.forEach(function(R,T){return Ae.resolve(R).then(function(D){l[T]=D,--x||v(l)},w)})})},resolve:function(l){return l instanceof Ae?l:l&&typeof l.then=="function"?new Ae(function(v,w){l.then(v,w)}):new Ae(mt,!0,l)},reject:es,race:function(){var l=V.apply(null,arguments).map(is);return new Ae(function(v,w){l.map(function(x){return Ae.resolve(x).then(v,w)})})},PSD:{get:function(){return Re},set:function(l){return Re=l}},totalEchoes:{get:function(){return ns}},newPSD:Br,usePSD:qr,scheduler:{get:function(){return lr},set:function(l){lr=l}},rejectionMapper:{get:function(){return Bo},set:function(l){Bo=l}},follow:function(l,v){return new Ae(function(w,x){return Br(function(R,T){var D=Re;D.unhandleds=[],D.onunhandled=T,D.finalize=Xe(function(){var M,G=this;M=function(){G.unhandleds.length===0?R():T(G.unhandleds[0])},Qi.push(function j(){M(),Qi.splice(Qi.indexOf(j),1)}),++zr,lr(function(){--zr==0&&Fo()},[])},D.finalize),l()},v,w,x)})}}),ir&&(ir.allSettled&&k(Ae,"allSettled",function(){var l=V.apply(null,arguments).map(is);return new Ae(function(v){l.length===0&&v([]);var w=l.length,x=new Array(w);l.forEach(function(R,T){return Ae.resolve(R).then(function(D){return x[T]={status:"fulfilled",value:D}},function(D){return x[T]={status:"rejected",reason:D}}).then(function(){return--w||v(x)})})})}),ir.any&&typeof AggregateError<"u"&&k(Ae,"any",function(){var l=V.apply(null,arguments).map(is);return new Ae(function(v,w){l.length===0&&w(new AggregateError([]));var x=l.length,R=new Array(x);l.forEach(function(T,D){return Ae.resolve(T).then(function(M){return v(M)},function(M){R[D]=M,--x||w(new AggregateError(R))})})})}),ir.withResolvers&&(Ae.withResolvers=ir.withResolvers));var vt={awaits:0,echoes:0,id:0},Wv=0,ts=[],rs=0,ns=0,Hv=0;function Br(l,v,w,x){var R=Re,T=Object.create(R);return T.parent=R,T.ref=0,T.global=!1,T.id=++Hv,Tr.env,T.env=qt?{Promise:Ae,PromiseProp:{value:Ae,configurable:!0,writable:!0},all:Ae.all,race:Ae.race,allSettled:Ae.allSettled,any:Ae.any,resolve:Ae.resolve,reject:Ae.reject}:{},v&&a(T,v),++R.ref,T.finalize=function(){--this.parent.ref||this.parent.finalize()},x=qr(T,l,w,x),T.ref===0&&T.finalize(),x}function Cn(){return vt.id||(vt.id=++Wv),++vt.awaits,vt.echoes+=Nr,vt.id}function Lr(){return!!vt.awaits&&(--vt.awaits==0&&(vt.id=0),vt.echoes=vt.awaits*Nr,!0)}function is(l){return vt.echoes&&l&&l.constructor===ir?(Cn(),l.then(function(v){return Lr(),v},function(v){return Lr(),ct(v)})):l}function $v(){var l=ts[ts.length-1];ts.pop(),Or(l,!1)}function Or(l,v){var w,x=Re;(v?!vt.echoes||rs++&&l===Re:!rs||--rs&&l===Re)||queueMicrotask(v?(function(R){++ns,vt.echoes&&--vt.echoes!=0||(vt.echoes=vt.awaits=vt.id=0),ts.push(Re),Or(R,!0)}).bind(null,l):$v),l!==Re&&(Re=l,x===Tr&&(Tr.env=Kl()),qt&&(w=Tr.env.Promise,v=l.env,(x.global||l.global)&&(Object.defineProperty(o,"Promise",v.PromiseProp),w.all=v.all,w.race=v.race,w.resolve=v.resolve,w.reject=v.reject,v.allSettled&&(w.allSettled=v.allSettled),v.any&&(w.any=v.any))))}function Kl(){var l=o.Promise;return qt?{Promise:l,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:l.all,race:l.race,allSettled:l.allSettled,any:l.any,resolve:l.resolve,reject:l.reject}:{}}function qr(l,v,w,x,R){var T=Re;try{return Or(l,!0),v(w,x,R)}finally{Or(T,!1)}}function Yl(l,v,w,x){return typeof l!="function"?l:function(){var R=Re;w&&Cn(),Or(v,!0);try{return l.apply(this,arguments)}finally{Or(R,!1),x&&queueMicrotask(Lr)}}}function Vo(l){Promise===ir&&vt.echoes===0?rs===0?l():enqueueNativeMicroTask(l):setTimeout(l,0)}(""+er).indexOf("[native code]")===-1&&(Cn=Lr=fe);var ct=Ae.reject,Qr="",yr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Xl="String expected.",kn=[],ss="__dbnames",Mo="readonly",Uo="readwrite";function en(l,v){return l?v?function(){return l.apply(this,arguments)&&v.apply(this,arguments)}:l:v}var Jl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function os(l){return typeof l!="string"||/\./.test(l)?function(v){return v}:function(v){return v[l]===void 0&&l in v&&delete(v=O(v))[l],v}}function zl(){throw se.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function He(l,v){try{var w=ql(l),x=ql(v);if(w!==x)return w==="Array"?1:x==="Array"?-1:w==="binary"?1:x==="binary"?-1:w==="string"?1:x==="string"?-1:w==="Date"?1:x!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return v<l?1:l<v?-1:0;case"binary":return(function(R,T){for(var D=R.length,M=T.length,G=D<M?D:M,j=0;j<G;++j)if(R[j]!==T[j])return R[j]<T[j]?-1:1;return D===M?0:D<M?-1:1})(Ql(l),Ql(v));case"Array":return(function(R,T){for(var D=R.length,M=T.length,G=D<M?D:M,j=0;j<G;++j){var z=He(R[j],T[j]);if(z!==0)return z}return D===M?0:D<M?-1:1})(l,v)}}catch{}return NaN}function ql(l){var v=typeof l;return v!="object"?v:ArrayBuffer.isView(l)?"binary":(l=le(l),l==="ArrayBuffer"?"binary":l)}function Ql(l){return l instanceof Uint8Array?l:ArrayBuffer.isView(l)?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(l)}function as(l,v,w){var x=l.schema.yProps;return x?(v&&0<w.numFailures&&(v=v.filter(function(R,T){return!w.failures[T]})),Promise.all(x.map(function(R){return R=R.updatesTable,v?l.db.table(R).where("k").anyOf(v).delete():l.db.table(R).clear()})).then(function(){return w})):w}var ti=(eu.prototype.execute=function(l){var v=this["@@propmod"];if(v.add!==void 0){var w=v.add;if(s(w))return i(i([],s(l)?l:[],!0),w).sort();if(typeof w=="number")return(Number(l)||0)+w;if(typeof w=="bigint")try{return BigInt(l)+w}catch{return BigInt(0)+w}throw new TypeError("Invalid term ".concat(w))}if(v.remove!==void 0){var x=v.remove;if(s(x))return s(l)?l.filter(function(R){return!x.includes(R)}).sort():[];if(typeof x=="number")return Number(l)-x;if(typeof x=="bigint")try{return BigInt(l)-x}catch{return BigInt(0)-x}throw new TypeError("Invalid subtrahend ".concat(x))}return w=(w=v.replacePrefix)===null||w===void 0?void 0:w[0],w&&typeof l=="string"&&l.startsWith(w)?v.replacePrefix[1]+l.substring(w.length):l},eu);function eu(l){this["@@propmod"]=l}function tu(l,v){for(var w=u(v),x=w.length,R=!1,T=0;T<x;++T){var D=w[T],M=v[D],G=C(l,D);M instanceof ti?(A(l,D,M.execute(G)),R=!0):G!==M&&(A(l,D,M),R=!0)}return R}var ru=(Qe.prototype._trans=function(l,v,w){var x=this._tx||Re.trans,R=this.name,T=Vt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(l==="readonly"?"read":"write"," ").concat(this.name));function D(j,z,$){if(!$.schema[R])throw new se.NotFound("Table "+R+" not part of transaction");return v($.idbtrans,$)}var M=wn();try{var G=x&&x.db._novip===this.db._novip?x===Re.trans?x._promise(l,D,w):Br(function(){return x._promise(l,D,w)},{trans:x,transless:Re.transless||Re}):(function j(z,$,Q,K){if(z.idbdb&&(z._state.openComplete||Re.letThrough||z._vip)){var Y=z._createTransaction($,Q,z._dbSchema);try{Y.create(),z._state.PR1398_maxLoop=3}catch(X){return X.name===J.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return j(z,$,Q,K)})):ct(X)}return Y._promise($,function(X,q){return Br(function(){return Re.trans=Y,K(X,q,Y)})}).then(function(X){if($==="readwrite")try{Y.idbtrans.commit()}catch{}return $==="readonly"?X:Y._completion.then(function(){return X})})}if(z._state.openComplete)return ct(new se.DatabaseClosed(z._state.dbOpenError));if(!z._state.isBeingOpened){if(!z._state.autoOpen)return ct(new se.DatabaseClosed);z.open().catch(fe)}return z._state.dbReadyPromise.then(function(){return j(z,$,Q,K)})})(this.db,l,[this.name],D);return T&&(G._consoleTask=T,G=G.catch(function(j){return console.trace(j),ct(j)})),G}finally{M&&En()}},Qe.prototype.get=function(l,v){var w=this;return l&&l.constructor===Object?this.where(l).first(v):l==null?ct(new se.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return w.core.get({trans:x,key:l}).then(function(R){return w.hook.reading.fire(R)})}).then(v)},Qe.prototype.where=function(l){if(typeof l=="string")return new this.db.WhereClause(this,l);if(s(l))return new this.db.WhereClause(this,"[".concat(l.join("+"),"]"));var v=u(l);if(v.length===1)return this.where(v[0]).equals(l[v[0]]);var w=this.schema.indexes.concat(this.schema.primKey).filter(function(M){if(M.compound&&v.every(function(j){return 0<=M.keyPath.indexOf(j)})){for(var G=0;G<v.length;++G)if(v.indexOf(M.keyPath[G])===-1)return!1;return!0}return!1}).sort(function(M,G){return M.keyPath.length-G.keyPath.length})[0];if(w&&this.db._maxKey!==Qr){var T=w.keyPath.slice(0,v.length);return this.where(T).equals(T.map(function(G){return l[G]}))}!w&&Vt&&console.warn("The query ".concat(JSON.stringify(l)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(v.join("+"),"]"));var x=this.schema.idxByName;function R(M,G){return He(M,G)===0}var D=v.reduce(function($,G){var j=$[0],z=$[1],$=x[G],Q=l[G];return[j||$,j||!$?en(z,$&&$.multi?function(K){return K=C(K,G),s(K)&&K.some(function(Y){return R(Q,Y)})}:function(K){return R(Q,C(K,G))}):z]},[null,null]),T=D[0],D=D[1];return T?this.where(T.name).equals(l[T.keyPath]).filter(D):w?this.filter(D):this.where(v).equals("")},Qe.prototype.filter=function(l){return this.toCollection().and(l)},Qe.prototype.count=function(l){return this.toCollection().count(l)},Qe.prototype.offset=function(l){return this.toCollection().offset(l)},Qe.prototype.limit=function(l){return this.toCollection().limit(l)},Qe.prototype.each=function(l){return this.toCollection().each(l)},Qe.prototype.toArray=function(l){return this.toCollection().toArray(l)},Qe.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Qe.prototype.orderBy=function(l){return new this.db.Collection(new this.db.WhereClause(this,s(l)?"[".concat(l.join("+"),"]"):l))},Qe.prototype.reverse=function(){return this.toCollection().reverse()},Qe.prototype.mapToClass=function(l){var v,w=this.db,x=this.name;function R(){return v!==null&&v.apply(this,arguments)||this}(this.schema.mappedClass=l).prototype instanceof zl&&((function(G,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");function z(){this.constructor=G}r(G,j),G.prototype=j===null?Object.create(j):(z.prototype=j.prototype,new z)})(R,v=l),Object.defineProperty(R.prototype,"db",{get:function(){return w},enumerable:!1,configurable:!0}),R.prototype.table=function(){return x},l=R);for(var T=new Set,D=l.prototype;D;D=c(D))Object.getOwnPropertyNames(D).forEach(function(G){return T.add(G)});function M(G){if(!G)return G;var j,z=Object.create(l.prototype);for(j in G)if(!T.has(j))try{z[j]=G[j]}catch{}return z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=M,this.hook("reading",M),l},Qe.prototype.defineClass=function(){return this.mapToClass(function(l){a(this,l)})},Qe.prototype.add=function(l,v){var w=this,x=this.schema.primKey,R=x.auto,T=x.keyPath,D=l;return T&&R&&(D=os(T)(l)),this._trans("readwrite",function(M){return w.core.mutate({trans:M,type:"add",keys:v!=null?[v]:null,values:[D]})}).then(function(M){return M.numFailures?Ae.reject(M.failures[0]):M.lastResult}).then(function(M){if(T)try{A(l,T,M)}catch{}return M})},Qe.prototype.upsert=function(l,v){var w=this,x=this.schema.primKey.keyPath;return this._trans("readwrite",function(R){return w.core.get({trans:R,key:l}).then(function(T){var D=T??{};return tu(D,v),x&&A(D,x,l),w.core.mutate({trans:R,type:"put",values:[D],keys:[l],upsert:!0,updates:{keys:[l],changeSpecs:[v]}}).then(function(M){return M.numFailures?Ae.reject(M.failures[0]):!!T})})})},Qe.prototype.update=function(l,v){return typeof l!="object"||s(l)?this.where(":id").equals(l).modify(v):(l=C(l,this.schema.primKey.keyPath),l===void 0?ct(new se.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(l).modify(v))},Qe.prototype.put=function(l,v){var w=this,x=this.schema.primKey,R=x.auto,T=x.keyPath,D=l;return T&&R&&(D=os(T)(l)),this._trans("readwrite",function(M){return w.core.mutate({trans:M,type:"put",values:[D],keys:v!=null?[v]:null})}).then(function(M){return M.numFailures?Ae.reject(M.failures[0]):M.lastResult}).then(function(M){if(T)try{A(l,T,M)}catch{}return M})},Qe.prototype.delete=function(l){var v=this;return this._trans("readwrite",function(w){return v.core.mutate({trans:w,type:"delete",keys:[l]}).then(function(x){return as(v,[l],x)}).then(function(x){return x.numFailures?Ae.reject(x.failures[0]):void 0})})},Qe.prototype.clear=function(){var l=this;return this._trans("readwrite",function(v){return l.core.mutate({trans:v,type:"deleteRange",range:Jl}).then(function(w){return as(l,null,w)})}).then(function(v){return v.numFailures?Ae.reject(v.failures[0]):void 0})},Qe.prototype.bulkGet=function(l){var v=this;return this._trans("readonly",function(w){return v.core.getMany({keys:l,trans:w}).then(function(x){return x.map(function(R){return v.hook.reading.fire(R)})})})},Qe.prototype.bulkAdd=function(l,v,w){var x=this,R=Array.isArray(v)?v:void 0,T=(w=w||(R?void 0:v))?w.allKeys:void 0;return this._trans("readwrite",function(D){var j=x.schema.primKey,M=j.auto,j=j.keyPath;if(j&&R)throw new se.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(R&&R.length!==l.length)throw new se.InvalidArgument("Arguments objects and keys must have the same length");var G=l.length,j=j&&M?l.map(os(j)):l;return x.core.mutate({trans:D,type:"add",keys:R,values:j,wantResults:T}).then(function(Y){var $=Y.numFailures,Q=Y.results,K=Y.lastResult,Y=Y.failures;if($===0)return T?Q:K;throw new Ee("".concat(x.name,".bulkAdd(): ").concat($," of ").concat(G," operations failed"),Y)})})},Qe.prototype.bulkPut=function(l,v,w){var x=this,R=Array.isArray(v)?v:void 0,T=(w=w||(R?void 0:v))?w.allKeys:void 0;return this._trans("readwrite",function(D){var j=x.schema.primKey,M=j.auto,j=j.keyPath;if(j&&R)throw new se.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(R&&R.length!==l.length)throw new se.InvalidArgument("Arguments objects and keys must have the same length");var G=l.length,j=j&&M?l.map(os(j)):l;return x.core.mutate({trans:D,type:"put",keys:R,values:j,wantResults:T}).then(function(Y){var $=Y.numFailures,Q=Y.results,K=Y.lastResult,Y=Y.failures;if($===0)return T?Q:K;throw new Ee("".concat(x.name,".bulkPut(): ").concat($," of ").concat(G," operations failed"),Y)})})},Qe.prototype.bulkUpdate=function(l){var v=this,w=this.core,x=l.map(function(D){return D.key}),R=l.map(function(D){return D.changes}),T=[];return this._trans("readwrite",function(D){return w.getMany({trans:D,keys:x,cache:"clone"}).then(function(M){var G=[],j=[];l.forEach(function($,Q){var K=$.key,Y=$.changes,X=M[Q];if(X){for(var q=0,ne=Object.keys(Y);q<ne.length;q++){var oe=ne[q],ce=Y[oe];if(oe===v.schema.primKey.keyPath){if(He(ce,K)!==0)throw new se.Constraint("Cannot update primary key in bulkUpdate()")}else A(X,oe,ce)}T.push(Q),G.push(K),j.push(X)}});var z=G.length;return w.mutate({trans:D,type:"put",keys:G,values:j,updates:{keys:x,changeSpecs:R}}).then(function($){var Q=$.numFailures,K=$.failures;if(Q===0)return z;for(var Y=0,X=Object.keys(K);Y<X.length;Y++){var q,ne=X[Y],oe=T[Number(ne)];oe!=null&&(q=K[ne],delete K[ne],K[oe]=q)}throw new Ee("".concat(v.name,".bulkUpdate(): ").concat(Q," of ").concat(z," operations failed"),K)})})})},Qe.prototype.bulkDelete=function(l){var v=this,w=l.length;return this._trans("readwrite",function(x){return v.core.mutate({trans:x,type:"delete",keys:l}).then(function(R){return as(v,l,R)})}).then(function(D){var R=D.numFailures,T=D.lastResult,D=D.failures;if(R===0)return T;throw new Ee("".concat(v.name,".bulkDelete(): ").concat(R," of ").concat(w," operations failed"),D)})},Qe);function Qe(){}function ri(l){function v(D,M){if(M){for(var G=arguments.length,j=new Array(G-1);--G;)j[G-1]=arguments[G];return w[D].subscribe.apply(null,j),l}if(typeof D=="string")return w[D]}var w={};v.addEventType=T;for(var x=1,R=arguments.length;x<R;++x)T(arguments[x]);return v;function T(D,M,G){if(typeof D!="object"){var j;M=M||Qn;var z={subscribers:[],fire:G=G||fe,subscribe:function($){z.subscribers.indexOf($)===-1&&(z.subscribers.push($),z.fire=M(z.fire,$))},unsubscribe:function($){z.subscribers=z.subscribers.filter(function(Q){return Q!==$}),z.fire=z.subscribers.reduce(M,G)}};return w[D]=v[D]=z}u(j=D).forEach(function($){var Q=j[$];if(s(Q))T($,j[$][0],j[$][1]);else{if(Q!=="asap")throw new se.InvalidArgument("Invalid event config");var K=T($,Fe,function(){for(var Y=arguments.length,X=new Array(Y);Y--;)X[Y]=arguments[Y];K.subscribers.forEach(function(q){I(function(){q.apply(null,X)})})})}})}}function ni(l,v){return y(v).from({prototype:l}),v}function In(l,v){return!(l.filter||l.algorithm||l.or)&&(v?l.justLimit:!l.replayFilter)}function Po(l,v){l.filter=en(l.filter,v)}function Wo(l,v,w){var x=l.replayFilter;l.replayFilter=x?function(){return en(x(),v())}:v,l.justLimit=w&&!x}function cs(l,v){if(l.isPrimKey)return v.primaryKey;var w=v.getIndexByKeyPath(l.index);if(!w)throw new se.Schema("KeyPath "+l.index+" on object store "+v.name+" is not indexed");return w}function nu(l,v,w){var x=cs(l,v.schema);return v.openCursor({trans:w,values:!l.keysOnly,reverse:l.dir==="prev",unique:!!l.unique,query:{index:x,range:l.range}})}function ls(l,v,w,x){var R=l.replayFilter?en(l.filter,l.replayFilter()):l.filter;if(l.or){var T={},D=function(M,G,j){var z,$;R&&!R(G,j,function(Q){return G.stop(Q)},function(Q){return G.fail(Q)})||(($=""+(z=G.primaryKey))=="[object ArrayBuffer]"&&($=""+new Uint8Array(z)),f(T,$)||(T[$]=!0,v(M,G,j)))};return Promise.all([l.or._iterate(D,w),iu(nu(l,x,w),l.algorithm,D,!l.keysOnly&&l.valueMapper)])}return iu(nu(l,x,w),en(l.algorithm,R),v,!l.keysOnly&&l.valueMapper)}function iu(l,v,w,x){var R=rt(x?function(T,D,M){return w(x(T),D,M)}:w);return l.then(function(T){if(T)return T.start(function(){var D=function(){return T.continue()};v&&!v(T,function(M){return D=M},function(M){T.stop(M),D=fe},function(M){T.fail(M),D=fe})||R(T.value,T,function(M){return D=M}),D()})})}var Gv=(je.prototype._read=function(l,v){var w=this._ctx;return w.error?w.table._trans(null,ct.bind(null,w.error)):w.table._trans("readonly",l).then(v)},je.prototype._write=function(l){var v=this._ctx;return v.error?v.table._trans(null,ct.bind(null,v.error)):v.table._trans("readwrite",l,"locked")},je.prototype._addAlgorithm=function(l){var v=this._ctx;v.algorithm=en(v.algorithm,l)},je.prototype._iterate=function(l,v){return ls(this._ctx,l,v,this._ctx.table.core)},je.prototype.clone=function(l){var v=Object.create(this.constructor.prototype),w=Object.create(this._ctx);return l&&a(w,l),v._ctx=w,v},je.prototype.raw=function(){return this._ctx.valueMapper=null,this},je.prototype.each=function(l){var v=this._ctx;return this._read(function(w){return ls(v,l,w,v.table.core)})},je.prototype.count=function(l){var v=this;return this._read(function(w){var x=v._ctx,R=x.table.core;if(In(x,!0))return R.count({trans:w,query:{index:cs(x,R.schema),range:x.range}}).then(function(D){return Math.min(D,x.limit)});var T=0;return ls(x,function(){return++T,!1},w,R).then(function(){return T})}).then(l)},je.prototype.sortBy=function(l,v){var w=l.split(".").reverse(),x=w[0],R=w.length-1;function T(G,j){return j?T(G[w[j]],j-1):G[x]}var D=this._ctx.dir==="next"?1:-1;function M(G,j){return He(T(G,R),T(j,R))*D}return this.toArray(function(G){return G.sort(M)}).then(v)},je.prototype.toArray=function(l){var v=this;return this._read(function(w){var x=v._ctx;if(x.dir==="next"&&In(x,!0)&&0<x.limit){var R=x.valueMapper,T=cs(x,x.table.core.schema);return x.table.core.query({trans:w,limit:x.limit,values:!0,query:{index:T,range:x.range}}).then(function(M){return M=M.result,R?M.map(R):M})}var D=[];return ls(x,function(M){return D.push(M)},w,x.table.core).then(function(){return D})},l)},je.prototype.offset=function(l){var v=this._ctx;return l<=0||(v.offset+=l,In(v)?Wo(v,function(){var w=l;return function(x,R){return w===0||(w===1?--w:R(function(){x.advance(w),w=0}),!1)}}):Wo(v,function(){var w=l;return function(){return--w<0}})),this},je.prototype.limit=function(l){return this._ctx.limit=Math.min(this._ctx.limit,l),Wo(this._ctx,function(){var v=l;return function(w,x,R){return--v<=0&&x(R),0<=v}},!0),this},je.prototype.until=function(l,v){return Po(this._ctx,function(w,x,R){return!l(w.value)||(x(R),v)}),this},je.prototype.first=function(l){return this.limit(1).toArray(function(v){return v[0]}).then(l)},je.prototype.last=function(l){return this.reverse().first(l)},je.prototype.filter=function(l){var v;return Po(this._ctx,function(w){return l(w.value)}),(v=this._ctx).isMatch=en(v.isMatch,l),this},je.prototype.and=function(l){return this.filter(l)},je.prototype.or=function(l){return new this.db.WhereClause(this._ctx.table,l,this)},je.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},je.prototype.desc=function(){return this.reverse()},je.prototype.eachKey=function(l){var v=this._ctx;return v.keysOnly=!v.isMatch,this.each(function(w,x){l(x.key,x)})},je.prototype.eachUniqueKey=function(l){return this._ctx.unique="unique",this.eachKey(l)},je.prototype.eachPrimaryKey=function(l){var v=this._ctx;return v.keysOnly=!v.isMatch,this.each(function(w,x){l(x.primaryKey,x)})},je.prototype.keys=function(l){var v=this._ctx;v.keysOnly=!v.isMatch;var w=[];return this.each(function(x,R){w.push(R.key)}).then(function(){return w}).then(l)},je.prototype.primaryKeys=function(l){var v=this._ctx;if(v.dir==="next"&&In(v,!0)&&0<v.limit)return this._read(function(x){var R=cs(v,v.table.core.schema);return v.table.core.query({trans:x,values:!1,limit:v.limit,query:{index:R,range:v.range}})}).then(function(x){return x.result}).then(l);v.keysOnly=!v.isMatch;var w=[];return this.each(function(x,R){w.push(R.primaryKey)}).then(function(){return w}).then(l)},je.prototype.uniqueKeys=function(l){return this._ctx.unique="unique",this.keys(l)},je.prototype.firstKey=function(l){return this.limit(1).keys(function(v){return v[0]}).then(l)},je.prototype.lastKey=function(l){return this.reverse().firstKey(l)},je.prototype.distinct=function(){var l=this._ctx,l=l.index&&l.table.schema.idxByName[l.index];if(!l||!l.multi)return this;var v={};return Po(this._ctx,function(R){var x=R.primaryKey.toString(),R=f(v,x);return v[x]=!0,!R}),this},je.prototype.modify=function(l){var v=this,w=this._ctx;return this._write(function(x){var R=typeof l=="function"?l:function(X){return tu(X,l)},T=w.table.core,j=T.schema.primaryKey,D=j.outbound,M=j.extractKey,G=200,j=v.db._options.modifyChunkSize;j&&(G=typeof j=="object"?j[T.name]||j["*"]||200:j);function z(X,oe){var ne=oe.failures,oe=oe.numFailures;Q+=X-oe;for(var ce=0,de=u(ne);ce<de.length;ce++){var ve=de[ce];$.push(ne[ve])}}var $=[],Q=0,K=[],Y=l===su;return v.clone().primaryKeys().then(function(X){function q(oe){var ce=Math.min(G,X.length-oe),de=X.slice(oe,oe+ce);return(Y?Promise.resolve([]):T.getMany({trans:x,keys:de,cache:"immutable"})).then(function(ve){var we=[],pe=[],_e=D?[]:null,Ce=Y?de:[];if(!Y)for(var ye=0;ye<ce;++ye){var xe=ve[ye],De={value:O(xe),primKey:X[oe+ye]};R.call(De,De.value,De)!==!1&&(De.value==null?Ce.push(X[oe+ye]):D||He(M(xe),M(De.value))===0?(pe.push(De.value),D&&_e.push(X[oe+ye])):(Ce.push(X[oe+ye]),we.push(De.value)))}return Promise.resolve(0<we.length&&T.mutate({trans:x,type:"add",values:we}).then(function(Ve){for(var Ue in Ve.failures)Ce.splice(parseInt(Ue),1);z(we.length,Ve)})).then(function(){return(0<pe.length||ne&&typeof l=="object")&&T.mutate({trans:x,type:"put",keys:_e,values:pe,criteria:ne,changeSpec:typeof l!="function"&&l,isAdditionalChunk:0<oe}).then(function(Ve){return z(pe.length,Ve)})}).then(function(){return(0<Ce.length||ne&&Y)&&T.mutate({trans:x,type:"delete",keys:Ce,criteria:ne,isAdditionalChunk:0<oe}).then(function(Ve){return as(w.table,Ce,Ve)}).then(function(Ve){return z(Ce.length,Ve)})}).then(function(){return X.length>oe+ce&&q(oe+G)})})}var ne=In(w)&&w.limit===1/0&&(typeof l!="function"||Y)&&{index:w.index,range:w.range};return q(0).then(function(){if(0<$.length)throw new be("Error modifying one or more objects",$,Q,K);return X.length})})})},je.prototype.delete=function(){var l=this._ctx,v=l.range;return!In(l)||l.table.schema.yProps||!l.isPrimKey&&v.type!==3?this.modify(su):this._write(function(w){var x=l.table.core.schema.primaryKey,R=v;return l.table.core.count({trans:w,query:{index:x,range:R}}).then(function(T){return l.table.core.mutate({trans:w,type:"deleteRange",range:R}).then(function(G){var M=G.failures,G=G.numFailures;if(G)throw new be("Could not delete some values",Object.keys(M).map(function(j){return M[j]}),T-G);return T-G})})})},je);function je(){}var su=function(l,v){return v.value=null};function Zv(l,v){return l<v?-1:l===v?0:1}function jv(l,v){return v<l?-1:l===v?0:1}function Ht(l,v,w){return l=l instanceof au?new l.Collection(l):l,l._ctx.error=new(w||TypeError)(v),l}function An(l){return new l.Collection(l,function(){return ou("")}).limit(0)}function us(l,v,w,x){var R,T,D,M,G,j,z,$=w.length;if(!w.every(function(Y){return typeof Y=="string"}))return Ht(l,Xl);function Q(Y){R=Y==="next"?function(q){return q.toUpperCase()}:function(q){return q.toLowerCase()},T=Y==="next"?function(q){return q.toLowerCase()}:function(q){return q.toUpperCase()},D=Y==="next"?Zv:jv;var X=w.map(function(q){return{lower:T(q),upper:R(q)}}).sort(function(q,ne){return D(q.lower,ne.lower)});M=X.map(function(q){return q.upper}),G=X.map(function(q){return q.lower}),z=(j=Y)==="next"?"":x}Q("next"),l=new l.Collection(l,function(){return Dr(M[0],G[$-1]+x)}),l._ondirectionchange=function(Y){Q(Y)};var K=0;return l._addAlgorithm(function(Y,X,q){var ne=Y.key;if(typeof ne!="string")return!1;var oe=T(ne);if(v(oe,G,K))return!0;for(var ce=null,de=K;de<$;++de){var ve=(function(we,pe,_e,Ce,ye,xe){for(var De=Math.min(we.length,Ce.length),Ve=-1,Ue=0;Ue<De;++Ue){var $t=pe[Ue];if($t!==Ce[Ue])return ye(we[Ue],_e[Ue])<0?we.substr(0,Ue)+_e[Ue]+_e.substr(Ue+1):ye(we[Ue],Ce[Ue])<0?we.substr(0,Ue)+Ce[Ue]+_e.substr(Ue+1):0<=Ve?we.substr(0,Ve)+pe[Ve]+_e.substr(Ve+1):null;ye(we[Ue],$t)<0&&(Ve=Ue)}return De<Ce.length&&xe==="next"?we+_e.substr(we.length):De<we.length&&xe==="prev"?we.substr(0,_e.length):Ve<0?null:we.substr(0,Ve)+Ce[Ve]+_e.substr(Ve+1)})(ne,oe,M[de],G[de],D,j);ve===null&&ce===null?K=de+1:(ce===null||0<D(ce,ve))&&(ce=ve)}return X(ce!==null?function(){Y.continue(ce+z)}:q),!1}),l}function Dr(l,v,w,x){return{type:2,lower:l,upper:v,lowerOpen:w,upperOpen:x}}function ou(l){return{type:1,lower:l,upper:l}}var au=(Object.defineProperty(bt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),bt.prototype.between=function(l,v,w,x){w=w!==!1,x=x===!0;try{return 0<this._cmp(l,v)||this._cmp(l,v)===0&&(w||x)&&(!w||!x)?An(this):new this.Collection(this,function(){return Dr(l,v,!w,!x)})}catch{return Ht(this,yr)}},bt.prototype.equals=function(l){return l==null?Ht(this,yr):new this.Collection(this,function(){return ou(l)})},bt.prototype.above=function(l){return l==null?Ht(this,yr):new this.Collection(this,function(){return Dr(l,void 0,!0)})},bt.prototype.aboveOrEqual=function(l){return l==null?Ht(this,yr):new this.Collection(this,function(){return Dr(l,void 0,!1)})},bt.prototype.below=function(l){return l==null?Ht(this,yr):new this.Collection(this,function(){return Dr(void 0,l,!1,!0)})},bt.prototype.belowOrEqual=function(l){return l==null?Ht(this,yr):new this.Collection(this,function(){return Dr(void 0,l)})},bt.prototype.startsWith=function(l){return typeof l!="string"?Ht(this,Xl):this.between(l,l+Qr,!0,!0)},bt.prototype.startsWithIgnoreCase=function(l){return l===""?this.startsWith(l):us(this,function(v,w){return v.indexOf(w[0])===0},[l],Qr)},bt.prototype.equalsIgnoreCase=function(l){return us(this,function(v,w){return v===w[0]},[l],"")},bt.prototype.anyOfIgnoreCase=function(){var l=V.apply(B,arguments);return l.length===0?An(this):us(this,function(v,w){return w.indexOf(v)!==-1},l,"")},bt.prototype.startsWithAnyOfIgnoreCase=function(){var l=V.apply(B,arguments);return l.length===0?An(this):us(this,function(v,w){return w.some(function(x){return v.indexOf(x)===0})},l,Qr)},bt.prototype.anyOf=function(){var l=this,v=V.apply(B,arguments),w=this._cmp;try{v.sort(w)}catch{return Ht(this,yr)}if(v.length===0)return An(this);var x=new this.Collection(this,function(){return Dr(v[0],v[v.length-1])});x._ondirectionchange=function(T){w=T==="next"?l._ascending:l._descending,v.sort(w)};var R=0;return x._addAlgorithm(function(T,D,M){for(var G=T.key;0<w(G,v[R]);)if(++R===v.length)return D(M),!1;return w(G,v[R])===0||(D(function(){T.continue(v[R])}),!1)}),x},bt.prototype.notEqual=function(l){return this.inAnyRange([[-1/0,l],[l,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},bt.prototype.noneOf=function(){var l=V.apply(B,arguments);if(l.length===0)return new this.Collection(this);try{l.sort(this._ascending)}catch{return Ht(this,yr)}var v=l.reduce(function(w,x){return w?w.concat([[w[w.length-1][1],x]]):[[-1/0,x]]},null);return v.push([l[l.length-1],this.db._maxKey]),this.inAnyRange(v,{includeLowers:!1,includeUppers:!1})},bt.prototype.inAnyRange=function(ne,v){var w=this,x=this._cmp,R=this._ascending,T=this._descending,D=this._min,M=this._max;if(ne.length===0)return An(this);if(!ne.every(function(oe){return oe[0]!==void 0&&oe[1]!==void 0&&R(oe[0],oe[1])<=0}))return Ht(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",se.InvalidArgument);var G=!v||v.includeLowers!==!1,j=v&&v.includeUppers===!0,z,$=R;function Q(oe,ce){return $(oe[0],ce[0])}try{(z=ne.reduce(function(oe,ce){for(var de=0,ve=oe.length;de<ve;++de){var we=oe[de];if(x(ce[0],we[1])<0&&0<x(ce[1],we[0])){we[0]=D(we[0],ce[0]),we[1]=M(we[1],ce[1]);break}}return de===ve&&oe.push(ce),oe},[])).sort(Q)}catch{return Ht(this,yr)}var K=0,Y=j?function(oe){return 0<R(oe,z[K][1])}:function(oe){return 0<=R(oe,z[K][1])},X=G?function(oe){return 0<T(oe,z[K][0])}:function(oe){return 0<=T(oe,z[K][0])},q=Y,ne=new this.Collection(this,function(){return Dr(z[0][0],z[z.length-1][1],!G,!j)});return ne._ondirectionchange=function(oe){$=oe==="next"?(q=Y,R):(q=X,T),z.sort(Q)},ne._addAlgorithm(function(oe,ce,de){for(var ve,we=oe.key;q(we);)if(++K===z.length)return ce(de),!1;return!Y(ve=we)&&!X(ve)||(w._cmp(we,z[K][1])===0||w._cmp(we,z[K][0])===0||ce(function(){$===R?oe.continue(z[K][0]):oe.continue(z[K][1])}),!1)}),ne},bt.prototype.startsWithAnyOf=function(){var l=V.apply(B,arguments);return l.every(function(v){return typeof v=="string"})?l.length===0?An(this):this.inAnyRange(l.map(function(v){return[v,v+Qr]})):Ht(this,"startsWithAnyOf() only works with strings")},bt);function bt(){}function dr(l){return rt(function(v){return ii(v),l(v.target.error),!1})}function ii(l){l.stopPropagation&&l.stopPropagation(),l.preventDefault&&l.preventDefault()}var si="storagemutated",Ho="x-storagemutated-1",Fr=ri(null,si),Kv=(hr.prototype._lock=function(){return S(!Re.global),++this._reculock,this._reculock!==1||Re.global||(Re.lockOwnerFor=this),this},hr.prototype._unlock=function(){if(S(!Re.global),--this._reculock==0)for(Re.global||(Re.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var l=this._blockedFuncs.shift();try{qr(l[1],l[0])}catch{}}return this},hr.prototype._locked=function(){return this._reculock&&Re.lockOwnerFor!==this},hr.prototype.create=function(l){var v=this;if(!this.mode)return this;var w=this.db.idbdb,x=this.db._state.dbOpenError;if(S(!this.idbtrans),!l&&!w)switch(x&&x.name){case"DatabaseClosedError":throw new se.DatabaseClosed(x);case"MissingAPIError":throw new se.MissingAPI(x.message,x);default:throw new se.OpenFailed(x)}if(!this.active)throw new se.TransactionInactive;return S(this._completion._state===null),(l=this.idbtrans=l||(this.db.core||w).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=rt(function(R){ii(R),v._reject(l.error)}),l.onabort=rt(function(R){ii(R),v.active&&v._reject(new se.Abort(l.error)),v.active=!1,v.on("abort").fire(R)}),l.oncomplete=rt(function(){v.active=!1,v._resolve(),"mutatedParts"in l&&Fr.storagemutated.fire(l.mutatedParts)}),this},hr.prototype._promise=function(l,v,w){var x=this;if(l==="readwrite"&&this.mode!=="readwrite")return ct(new se.ReadOnly("Transaction is readonly"));if(!this.active)return ct(new se.TransactionInactive);if(this._locked())return new Ae(function(T,D){x._blockedFuncs.push([function(){x._promise(l,v,w).then(T,D)},Re])});if(w)return Br(function(){var T=new Ae(function(D,M){x._lock();var G=v(D,M,x);G&&G.then&&G.then(D,M)});return T.finally(function(){return x._unlock()}),T._lib=!0,T});var R=new Ae(function(T,D){var M=v(T,D,x);M&&M.then&&M.then(T,D)});return R._lib=!0,R},hr.prototype._root=function(){return this.parent?this.parent._root():this},hr.prototype.waitFor=function(l){var v,w=this._root(),x=Ae.resolve(l);w._waitingFor?w._waitingFor=w._waitingFor.then(function(){return x}):(w._waitingFor=x,w._waitingQueue=[],v=w.idbtrans.objectStore(w.storeNames[0]),(function T(){for(++w._spinCount;w._waitingQueue.length;)w._waitingQueue.shift()();w._waitingFor&&(v.get(-1/0).onsuccess=T)})());var R=w._waitingFor;return new Ae(function(T,D){x.then(function(M){return w._waitingQueue.push(rt(T.bind(null,M)))},function(M){return w._waitingQueue.push(rt(D.bind(null,M)))}).finally(function(){w._waitingFor===R&&(w._waitingFor=null)})})},hr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new se.Abort))},hr.prototype.table=function(l){var v=this._memoizedTables||(this._memoizedTables={});if(f(v,l))return v[l];var w=this.schema[l];if(!w)throw new se.NotFound("Table "+l+" not part of transaction");return w=new this.db.Table(l,w,this),w.core=this.db.core.table(l),v[l]=w},hr);function hr(){}function $o(l,v,w,x,R,T,D,M){return{name:l,keyPath:v,unique:w,multi:x,auto:R,compound:T,src:(w&&!D?"&":"")+(x?"*":"")+(R?"++":"")+cu(v),type:M}}function cu(l){return typeof l=="string"?l:l?"["+[].join.call(l,"+")+"]":""}function Go(l,v,w){return{name:l,primKey:v,indexes:w,mappedClass:null,idxByName:(x=function(R){return[R.name,R]},w.reduce(function(R,T,D){return D=x(T,D),D&&(R[D[0]]=D[1]),R},{}))};var x}var oi=function(l){try{return l.only([[]]),oi=function(){return[[]]},[[]]}catch{return oi=function(){return Qr},Qr}};function Zo(l){return l==null?function(){}:typeof l=="string"?(v=l).split(".").length===1?function(w){return w[v]}:function(w){return C(w,v)}:function(w){return C(w,l)};var v}function lu(l){return[].slice.call(l)}var Yv=0;function ai(l){return l==null?":id":typeof l=="string"?l:"[".concat(l.join("+"),"]")}function Xv(l,v,G){function x(q){if(q.type===3)return null;if(q.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var K=q.lower,Y=q.upper,X=q.lowerOpen,q=q.upperOpen;return K===void 0?Y===void 0?null:v.upperBound(Y,!!q):Y===void 0?v.lowerBound(K,!!X):v.bound(K,Y,!!X,!!q)}function R(Q){var K,Y=Q.name;return{name:Y,schema:Q,mutate:function(X){var q=X.trans,ne=X.type,oe=X.keys,ce=X.values,de=X.range;return new Promise(function(ve,we){ve=rt(ve);var pe=q.objectStore(Y),_e=pe.keyPath==null,Ce=ne==="put"||ne==="add";if(!Ce&&ne!=="delete"&&ne!=="deleteRange")throw new Error("Invalid operation type: "+ne);var ye,xe=(oe||ce||{length:1}).length;if(oe&&ce&&oe.length!==ce.length)throw new Error("Given keys array must have same length as given values array.");if(xe===0)return ve({numFailures:0,failures:{},results:[],lastResult:void 0});function De(Ot){++$t,ii(Ot)}var Ve=[],Ue=[],$t=0;if(ne==="deleteRange"){if(de.type===4)return ve({numFailures:$t,failures:Ue,results:[],lastResult:void 0});de.type===3?Ve.push(ye=pe.clear()):Ve.push(ye=pe.delete(x(de)))}else{var _e=Ce?_e?[ce,oe]:[ce,null]:[oe,null],Oe=_e[0],Tt=_e[1];if(Ce)for(var Bt=0;Bt<xe;++Bt)Ve.push(ye=Tt&&Tt[Bt]!==void 0?pe[ne](Oe[Bt],Tt[Bt]):pe[ne](Oe[Bt])),ye.onerror=De;else for(Bt=0;Bt<xe;++Bt)Ve.push(ye=pe[ne](Oe[Bt])),ye.onerror=De}function ws(Ot){Ot=Ot.target.result,Ve.forEach(function(nn,la){return nn.error!=null&&(Ue[la]=nn.error)}),ve({numFailures:$t,failures:Ue,results:ne==="delete"?oe:Ve.map(function(nn){return nn.result}),lastResult:Ot})}ye.onerror=function(Ot){De(Ot),ws(Ot)},ye.onsuccess=ws})},getMany:function(X){var q=X.trans,ne=X.keys;return new Promise(function(oe,ce){oe=rt(oe);for(var de,ve=q.objectStore(Y),we=ne.length,pe=new Array(we),_e=0,Ce=0,ye=function(Ve){Ve=Ve.target,pe[Ve._pos]=Ve.result,++Ce===_e&&oe(pe)},xe=dr(ce),De=0;De<we;++De)ne[De]!=null&&((de=ve.get(ne[De]))._pos=De,de.onsuccess=ye,de.onerror=xe,++_e);_e===0&&oe(pe)})},get:function(X){var q=X.trans,ne=X.key;return new Promise(function(oe,ce){oe=rt(oe);var de=q.objectStore(Y).get(ne);de.onsuccess=function(ve){return oe(ve.target.result)},de.onerror=dr(ce)})},query:(K=j,function(X){return new Promise(function(q,ne){q=rt(q);var oe,ce,de,_e=X.trans,ve=X.values,we=X.limit,ye=X.query,pe=we===1/0?void 0:we,Ce=ye.index,ye=ye.range,_e=_e.objectStore(Y),Ce=Ce.isPrimaryKey?_e:_e.index(Ce.name),ye=x(ye);if(we===0)return q({result:[]});K?((pe=ve?Ce.getAll(ye,pe):Ce.getAllKeys(ye,pe)).onsuccess=function(xe){return q({result:xe.target.result})},pe.onerror=dr(ne)):(oe=0,ce=!ve&&"openKeyCursor"in Ce?Ce.openKeyCursor(ye):Ce.openCursor(ye),de=[],ce.onsuccess=function(xe){var De=ce.result;return De?(de.push(ve?De.value:De.primaryKey),++oe===we?q({result:de}):void De.continue()):q({result:de})},ce.onerror=dr(ne))})}),openCursor:function(X){var q=X.trans,ne=X.values,oe=X.query,ce=X.reverse,de=X.unique;return new Promise(function(ve,we){ve=rt(ve);var Ce=oe.index,pe=oe.range,_e=q.objectStore(Y),_e=Ce.isPrimaryKey?_e:_e.index(Ce.name),Ce=ce?de?"prevunique":"prev":de?"nextunique":"next",ye=!ne&&"openKeyCursor"in _e?_e.openKeyCursor(x(pe),Ce):_e.openCursor(x(pe),Ce);ye.onerror=dr(we),ye.onsuccess=rt(function(xe){var De,Ve,Ue,$t,Oe=ye.result;Oe?(Oe.___id=++Yv,Oe.done=!1,De=Oe.continue.bind(Oe),Ve=(Ve=Oe.continuePrimaryKey)&&Ve.bind(Oe),Ue=Oe.advance.bind(Oe),$t=function(){throw new Error("Cursor not stopped")},Oe.trans=q,Oe.stop=Oe.continue=Oe.continuePrimaryKey=Oe.advance=function(){throw new Error("Cursor not started")},Oe.fail=rt(we),Oe.next=function(){var Tt=this,Bt=1;return this.start(function(){return Bt--?Tt.continue():Tt.stop()}).then(function(){return Tt})},Oe.start=function(Tt){function Bt(){if(ye.result)try{Tt()}catch(Ot){Oe.fail(Ot)}else Oe.done=!0,Oe.start=function(){throw new Error("Cursor behind last entry")},Oe.stop()}var ws=new Promise(function(Ot,nn){Ot=rt(Ot),ye.onerror=dr(nn),Oe.fail=nn,Oe.stop=function(la){Oe.stop=Oe.continue=Oe.continuePrimaryKey=Oe.advance=$t,Ot(la)}});return ye.onsuccess=rt(function(Ot){ye.onsuccess=Bt,Bt()}),Oe.continue=De,Oe.continuePrimaryKey=Ve,Oe.advance=Ue,Bt(),ws},ve(Oe)):ve(null)},we)})},count:function(X){var q=X.query,ne=X.trans,oe=q.index,ce=q.range;return new Promise(function(de,ve){var we=ne.objectStore(Y),pe=oe.isPrimaryKey?we:we.index(oe.name),we=x(ce),pe=we?pe.count(we):pe.count();pe.onsuccess=rt(function(_e){return de(_e.target.result)}),pe.onerror=dr(ve)})}}}var T,D,M,z=(D=G,M=lu((T=l).objectStoreNames),{schema:{name:T.name,tables:M.map(function(Q){return D.objectStore(Q)}).map(function(Q){var K=Q.keyPath,q=Q.autoIncrement,Y=s(K),X={},q={name:Q.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:K==null,compound:Y,keyPath:K,autoIncrement:q,unique:!0,extractKey:Zo(K)},indexes:lu(Q.indexNames).map(function(ne){return Q.index(ne)}).map(function(de){var oe=de.name,ce=de.unique,ve=de.multiEntry,de=de.keyPath,ve={name:oe,compound:s(de),keyPath:de,unique:ce,multiEntry:ve,extractKey:Zo(de)};return X[ai(de)]=ve}),getIndexByKeyPath:function(ne){return X[ai(ne)]}};return X[":id"]=q.primaryKey,K!=null&&(X[ai(K)]=q.primaryKey),q})},hasGetAll:0<M.length&&"getAll"in D.objectStore(M[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),G=z.schema,j=z.hasGetAll,z=G.tables.map(R),$={};return z.forEach(function(Q){return $[Q.name]=Q}),{stack:"dbcore",transaction:l.transaction.bind(l),table:function(Q){if(!$[Q])throw new Error("Table '".concat(Q,"' not found"));return $[Q]},MIN_KEY:-1/0,MAX_KEY:oi(v),schema:G}}function Jv(l,v,w,x){var R=w.IDBKeyRange;return w.indexedDB,{dbcore:(x=Xv(v,R,x),l.dbcore.reduce(function(T,D){return D=D.create,n(n({},T),D(T))},x))}}function ds(l,x){var w=x.db,x=Jv(l._middlewares,w,l._deps,x);l.core=x.dbcore,l.tables.forEach(function(R){var T=R.name;l.core.schema.tables.some(function(D){return D.name===T})&&(R.core=l.core.table(T),l[T]instanceof l.Table&&(l[T].core=R.core))})}function hs(l,v,w,x){w.forEach(function(R){var T=x[R];v.forEach(function(D){var M=(function G(j,z){return d(j,z)||(j=c(j))&&G(j,z)})(D,R);(!M||"value"in M&&M.value===void 0)&&(D===l.Transaction.prototype||D instanceof l.Transaction?k(D,R,{get:function(){return this.table(R)},set:function(G){_(this,R,{value:G,writable:!0,configurable:!0,enumerable:!0})}}):D[R]=new l.Table(R,T))})})}function jo(l,v){v.forEach(function(w){for(var x in w)w[x]instanceof l.Table&&delete w[x]})}function zv(l,v){return l._cfg.version-v._cfg.version}function qv(l,v,w,x){var R=l._dbSchema;w.objectStoreNames.contains("$meta")&&!R.$meta&&(R.$meta=Go("$meta",du("")[0],[]),l._storeNames.push("$meta"));var T=l._createTransaction("readwrite",l._storeNames,R);T.create(w),T._completion.catch(x);var D=T._reject.bind(T),M=Re.transless||Re;Br(function(){return Re.trans=T,Re.transless=M,v!==0?(ds(l,w),j=v,((G=T).storeNames.includes("$meta")?G.table("$meta").get("version").then(function(z){return z??j}):Ae.resolve(j)).then(function(z){return Q=z,K=T,Y=w,X=[],z=($=l)._versions,q=$._dbSchema=ps(0,$.idbdb,Y),(z=z.filter(function(ne){return ne._cfg.version>=Q})).length!==0?(z.forEach(function(ne){X.push(function(){var oe=q,ce=ne._cfg.dbschema;gs($,oe,Y),gs($,ce,Y),q=$._dbSchema=ce;var de=Ko(oe,ce);de.add.forEach(function(Ce){Yo(Y,Ce[0],Ce[1].primKey,Ce[1].indexes)}),de.change.forEach(function(Ce){if(Ce.recreate)throw new se.Upgrade("Not yet support for changing primary key");var ye=Y.objectStore(Ce.name);Ce.add.forEach(function(xe){return fs(ye,xe)}),Ce.change.forEach(function(xe){ye.deleteIndex(xe.name),fs(ye,xe)}),Ce.del.forEach(function(xe){return ye.deleteIndex(xe)})});var ve=ne._cfg.contentUpgrade;if(ve&&ne._cfg.version>Q){ds($,Y),K._memoizedTables={};var we=E(ce);de.del.forEach(function(Ce){we[Ce]=oe[Ce]}),jo($,[$.Transaction.prototype]),hs($,[$.Transaction.prototype],u(we),we),K.schema=we;var pe,_e=W(ve);return _e&&Cn(),de=Ae.follow(function(){var Ce;(pe=ve(K))&&_e&&(Ce=Lr.bind(null,null),pe.then(Ce,Ce))}),pe&&typeof pe.then=="function"?Ae.resolve(pe):de.then(function(){return pe})}}),X.push(function(oe){var ce,de,ve=ne._cfg.dbschema;ce=ve,de=oe,[].slice.call(de.db.objectStoreNames).forEach(function(we){return ce[we]==null&&de.db.deleteObjectStore(we)}),jo($,[$.Transaction.prototype]),hs($,[$.Transaction.prototype],$._storeNames,$._dbSchema),K.schema=$._dbSchema}),X.push(function(oe){$.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil($.idbdb.version/10)===ne._cfg.version?($.idbdb.deleteObjectStore("$meta"),delete $._dbSchema.$meta,$._storeNames=$._storeNames.filter(function(ce){return ce!=="$meta"})):oe.objectStore("$meta").put(ne._cfg.version,"version"))})}),(function ne(){return X.length?Ae.resolve(X.shift()(K.idbtrans)).then(ne):Ae.resolve()})().then(function(){uu(q,Y)})):Ae.resolve();var $,Q,K,Y,X,q}).catch(D)):(u(R).forEach(function(z){Yo(w,z,R[z].primKey,R[z].indexes)}),ds(l,w),void Ae.follow(function(){return l.on.populate.fire(T)}).catch(D));var G,j})}function Qv(l,v){uu(l._dbSchema,v),v.db.version%10!=0||v.objectStoreNames.contains("$meta")||v.db.createObjectStore("$meta").add(Math.ceil(v.db.version/10-1),"version");var w=ps(0,l.idbdb,v);gs(l,l._dbSchema,v);for(var x=0,R=Ko(w,l._dbSchema).change;x<R.length;x++){var T=(function(D){if(D.change.length||D.recreate)return console.warn("Unable to patch indexes of table ".concat(D.name," because it has changes on the type of index or primary key.")),{value:void 0};var M=v.objectStore(D.name);D.add.forEach(function(G){Vt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(D.name,".").concat(G.src)),fs(M,G)})})(R[x]);if(typeof T=="object")return T.value}}function Ko(l,v){var w,x={del:[],add:[],change:[]};for(w in l)v[w]||x.del.push(w);for(w in v){var R=l[w],T=v[w];if(R){var D={name:w,def:T,recreate:!1,del:[],add:[],change:[]};if(""+(R.primKey.keyPath||"")!=""+(T.primKey.keyPath||"")||R.primKey.auto!==T.primKey.auto)D.recreate=!0,x.change.push(D);else{var M=R.idxByName,G=T.idxByName,j=void 0;for(j in M)G[j]||D.del.push(j);for(j in G){var z=M[j],$=G[j];z?z.src!==$.src&&D.change.push($):D.add.push($)}(0<D.del.length||0<D.add.length||0<D.change.length)&&x.change.push(D)}}else x.add.push([w,T])}return x}function Yo(l,v,w,x){var R=l.db.createObjectStore(v,w.keyPath?{keyPath:w.keyPath,autoIncrement:w.auto}:{autoIncrement:w.auto});return x.forEach(function(T){return fs(R,T)}),R}function uu(l,v){u(l).forEach(function(w){v.db.objectStoreNames.contains(w)||(Vt&&console.debug("Dexie: Creating missing table",w),Yo(v,w,l[w].primKey,l[w].indexes))})}function fs(l,v){l.createIndex(v.name,v.keyPath,{unique:v.unique,multiEntry:v.multi})}function ps(l,v,w){var x={};return h(v.objectStoreNames,0).forEach(function(R){for(var T=w.objectStore(R),D=$o(cu(j=T.keyPath),j||"",!0,!1,!!T.autoIncrement,j&&typeof j!="string",!0),M=[],G=0;G<T.indexNames.length;++G){var z=T.index(T.indexNames[G]),j=z.keyPath,z=$o(z.name,j,!!z.unique,!!z.multiEntry,!1,j&&typeof j!="string",!1);M.push(z)}x[R]=Go(R,D,M)}),x}function gs(l,v,w){for(var x=w.db.objectStoreNames,R=0;R<x.length;++R){var T=x[R],D=w.objectStore(T);l._hasGetAll="getAll"in D;for(var M=0;M<D.indexNames.length;++M){var G=D.indexNames[M],j=D.index(G).keyPath,z=typeof j=="string"?j:"["+h(j).join("+")+"]";!v[T]||(j=v[T].idxByName[z])&&(j.name=G,delete v[T].idxByName[z],v[T].idxByName[G]=j)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(l._hasGetAll=!1)}function du(l){return l.split(",").map(function(v,w){var T=v.split(":"),x=(R=T[1])===null||R===void 0?void 0:R.trim(),R=(v=T[0].trim()).replace(/([&*]|\+\+)/g,""),T=/^\[/.test(R)?R.match(/^\[(.*)\]$/)[1].split("+"):R;return $o(R,T||null,/\&/.test(v),/\*/.test(v),/\+\+/.test(v),s(T),w===0,x)})}var e0=(xn.prototype._createTableSchema=Go,xn.prototype._parseIndexSyntax=du,xn.prototype._parseStoresSpec=function(l,v){var w=this;u(l).forEach(function(x){if(l[x]!==null){var R=w._parseIndexSyntax(l[x]),T=R.shift();if(!T)throw new se.Schema("Invalid schema for table "+x+": "+l[x]);if(T.unique=!0,T.multi)throw new se.Schema("Primary key cannot be multiEntry*");R.forEach(function(D){if(D.auto)throw new se.Schema("Only primary key can be marked as autoIncrement (++)");if(!D.keyPath)throw new se.Schema("Index must have a name and cannot be an empty string")}),R=w._createTableSchema(x,T,R),v[x]=R}})},xn.prototype.stores=function(w){var v=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,w):w;var w=v._versions,x={},R={};return w.forEach(function(T){a(x,T._cfg.storesSource),R=T._cfg.dbschema={},T._parseStoresSpec(x,R)}),v._dbSchema=R,jo(v,[v._allTables,v,v.Transaction.prototype]),hs(v,[v._allTables,v,v.Transaction.prototype,this._cfg.tables],u(R),R),v._storeNames=u(R),this},xn.prototype.upgrade=function(l){return this._cfg.contentUpgrade=Xr(this._cfg.contentUpgrade||fe,l),this},xn);function xn(){}function Xo(l,v){var w=l._dbNamesDB;return w||(w=l._dbNamesDB=new Sr(ss,{addons:[],indexedDB:l,IDBKeyRange:v})).version(1).stores({dbnames:"name"}),w.table("dbnames")}function Jo(l){return l&&typeof l.databases=="function"}function zo(l){return Br(function(){return Re.letThrough=!0,l()})}function qo(l){return!("from"in l)}var Nt=function(l,v){if(!this){var w=new Nt;return l&&"d"in l&&a(w,l),w}a(this,arguments.length?{d:1,from:l,to:1<arguments.length?v:l}:{d:0})};function ci(l,v,w){var x=He(v,w);if(!isNaN(x)){if(0<x)throw RangeError();if(qo(l))return a(l,{from:v,to:w,d:1});var R=l.l,x=l.r;if(He(w,l.from)<0)return R?ci(R,v,w):l.l={from:v,to:w,d:1,l:null,r:null},fu(l);if(0<He(v,l.to))return x?ci(x,v,w):l.r={from:v,to:w,d:1,l:null,r:null},fu(l);He(v,l.from)<0&&(l.from=v,l.l=null,l.d=x?x.d+1:1),0<He(w,l.to)&&(l.to=w,l.r=null,l.d=l.l?l.l.d+1:1),w=!l.r,R&&!l.l&&li(l,R),x&&w&&li(l,x)}}function li(l,v){qo(v)||(function w(x,G){var T=G.from,D=G.to,M=G.l,G=G.r;ci(x,T,D),M&&w(x,M),G&&w(x,G)})(l,v)}function hu(l,v){var w=ms(v),x=w.next();if(x.done)return!1;for(var R=x.value,T=ms(l),D=T.next(R.from),M=D.value;!x.done&&!D.done;){if(He(M.from,R.to)<=0&&0<=He(M.to,R.from))return!0;He(R.from,M.from)<0?R=(x=w.next(M.from)).value:M=(D=T.next(R.from)).value}return!1}function ms(l){var v=qo(l)?null:{s:0,n:l};return{next:function(w){for(var x=0<arguments.length;v;)switch(v.s){case 0:if(v.s=1,x)for(;v.n.l&&He(w,v.n.from)<0;)v={up:v,n:v.n.l,s:1};else for(;v.n.l;)v={up:v,n:v.n.l,s:1};case 1:if(v.s=2,!x||He(w,v.n.to)<=0)return{value:v.n,done:!1};case 2:if(v.n.r){v.s=3,v={up:v,n:v.n.r,s:0};continue}case 3:v=v.up}return{done:!0}}}}function fu(l){var v,w,x=(((v=l.r)===null||v===void 0?void 0:v.d)||0)-(((w=l.l)===null||w===void 0?void 0:w.d)||0),R=1<x?"r":x<-1?"l":"";R&&(v=R=="r"?"l":"r",w=n({},l),x=l[R],l.from=x.from,l.to=x.to,l[R]=x[R],w[R]=x[v],(l[v]=w).d=pu(w)),l.d=pu(l)}function pu(w){var v=w.r,w=w.l;return(v?w?Math.max(v.d,w.d):v.d:w?w.d:0)+1}function vs(l,v){return u(v).forEach(function(w){l[w]?li(l[w],v[w]):l[w]=(function x(R){var T,D,M={};for(T in R)f(R,T)&&(D=R[T],M[T]=!D||typeof D!="object"||U.has(D.constructor)?D:x(D));return M})(v[w])}),l}function Qo(l,v){return l.all||v.all||Object.keys(l).some(function(w){return v[w]&&hu(v[w],l[w])})}b(Nt.prototype,((er={add:function(l){return li(this,l),this},addKey:function(l){return ci(this,l,l),this},addKeys:function(l){var v=this;return l.forEach(function(w){return ci(v,w,w)}),this},hasKey:function(l){var v=ms(this).next(l).value;return v&&He(v.from,l)<=0&&0<=He(v.to,l)}})[ge]=function(){return ms(this)},er));var tn={},ea={},ta=!1;function bs(l){vs(ea,l),ta||(ta=!0,setTimeout(function(){ta=!1,ra(ea,!(ea={}))},0))}function ra(l,v){v===void 0&&(v=!1);var w=new Set;if(l.all)for(var x=0,R=Object.values(tn);x<R.length;x++)gu(D=R[x],l,w,v);else for(var T in l){var D,M=/^idb\:\/\/(.*)\/(.*)\//.exec(T);M&&(T=M[1],M=M[2],(D=tn["idb://".concat(T,"/").concat(M)])&&gu(D,l,w,v))}w.forEach(function(G){return G()})}function gu(l,v,w,x){for(var R=[],T=0,D=Object.entries(l.queries.query);T<D.length;T++){for(var M=D[T],G=M[0],j=[],z=0,$=M[1];z<$.length;z++){var Q=$[z];Qo(v,Q.obsSet)?Q.subscribers.forEach(function(q){return w.add(q)}):x&&j.push(Q)}x&&R.push([G,j])}if(x)for(var K=0,Y=R;K<Y.length;K++){var X=Y[K],G=X[0],j=X[1];l.queries.query[G]=j}}function t0(l){var v=l._state,w=l._deps.indexedDB;if(v.isBeingOpened||l.idbdb)return v.dbReadyPromise.then(function(){return v.dbOpenError?ct(v.dbOpenError):l});v.isBeingOpened=!0,v.dbOpenError=null,v.openComplete=!1;var x=v.openCanceller,R=Math.round(10*l.verno),T=!1;function D(){if(v.openCanceller!==x)throw new se.DatabaseClosed("db.open() was cancelled")}function M(){return new Ae(function(Q,K){if(D(),!w)throw new se.MissingAPI;var Y=l.name,X=v.autoSchema||!R?w.open(Y):w.open(Y,R);if(!X)throw new se.MissingAPI;X.onerror=dr(K),X.onblocked=rt(l._fireOnBlocked),X.onupgradeneeded=rt(function(q){var ne;z=X.transaction,v.autoSchema&&!l._options.allowEmptyDB?(X.onerror=ii,z.abort(),X.result.close(),(ne=w.deleteDatabase(Y)).onsuccess=ne.onerror=rt(function(){K(new se.NoSuchDatabase("Database ".concat(Y," doesnt exist")))})):(z.onerror=dr(K),q=q.oldVersion>Math.pow(2,62)?0:q.oldVersion,$=q<1,l.idbdb=X.result,T&&Qv(l,z),qv(l,q/10,z,K))},K),X.onsuccess=rt(function(){z=null;var q,ne,oe,ce,de,ve=l.idbdb=X.result,we=h(ve.objectStoreNames);if(0<we.length)try{var pe=ve.transaction((ce=we).length===1?ce[0]:ce,"readonly");if(v.autoSchema)ne=ve,oe=pe,(q=l).verno=ne.version/10,oe=q._dbSchema=ps(0,ne,oe),q._storeNames=h(ne.objectStoreNames,0),hs(q,[q._allTables],u(oe),oe);else if(gs(l,l._dbSchema,pe),((de=Ko(ps(0,(de=l).idbdb,pe),de._dbSchema)).add.length||de.change.some(function(_e){return _e.add.length||_e.change.length}))&&!T)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ve.close(),R=ve.version+1,T=!0,Q(M());ds(l,pe)}catch{}kn.push(l),ve.onversionchange=rt(function(_e){v.vcFired=!0,l.on("versionchange").fire(_e)}),ve.onclose=rt(function(){l.close({disableAutoOpen:!1})}),$&&(de=l._deps,pe=Y,ve=de.indexedDB,de=de.IDBKeyRange,Jo(ve)||pe===ss||Xo(ve,de).put({name:pe}).catch(fe)),Q()},K)}).catch(function(Q){switch(Q==null?void 0:Q.name){case"UnknownError":if(0<v.PR1398_maxLoop)return v.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),M();break;case"VersionError":if(0<R)return R=0,M()}return Ae.reject(Q)})}var G,j=v.dbReadyResolve,z=null,$=!1;return Ae.race([x,(typeof navigator>"u"?Ae.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Q){function K(){return indexedDB.databases().finally(Q)}G=setInterval(K,100),K()}).finally(function(){return clearInterval(G)}):Promise.resolve()).then(M)]).then(function(){return D(),v.onReadyBeingFired=[],Ae.resolve(zo(function(){return l.on.ready.fire(l.vip)})).then(function Q(){if(0<v.onReadyBeingFired.length){var K=v.onReadyBeingFired.reduce(Xr,fe);return v.onReadyBeingFired=[],Ae.resolve(zo(function(){return K(l.vip)})).then(Q)}})}).finally(function(){v.openCanceller===x&&(v.onReadyBeingFired=null,v.isBeingOpened=!1)}).catch(function(Q){v.dbOpenError=Q;try{z&&z.abort()}catch{}return x===v.openCanceller&&l._close(),ct(Q)}).finally(function(){v.openComplete=!0,j()}).then(function(){var Q;return $&&(Q={},l.tables.forEach(function(K){K.schema.indexes.forEach(function(Y){Y.name&&(Q["idb://".concat(l.name,"/").concat(K.name,"/").concat(Y.name)]=new Nt(-1/0,[[[]]]))}),Q["idb://".concat(l.name,"/").concat(K.name,"/")]=Q["idb://".concat(l.name,"/").concat(K.name,"/:dels")]=new Nt(-1/0,[[[]]])}),Fr(si).fire(Q),ra(Q,!0)),l})}function na(l){function v(T){return l.next(T)}var w=R(v),x=R(function(T){return l.throw(T)});function R(T){return function(G){var M=T(G),G=M.value;return M.done?G:G&&typeof G.then=="function"?G.then(w,x):s(G)?Promise.all(G).then(w,x):w(G)}}return R(v)()}function _s(l,v,w){for(var x=s(l)?l.slice():[l],R=0;R<w;++R)x.push(v);return x}var r0={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(l){return n(n({},l),{table:function(v){var w=l.table(v),x=w.schema,R={},T=[];function D($,Q,K){var Y=ai($),X=R[Y]=R[Y]||[],q=$==null?0:typeof $=="string"?1:$.length,ne=0<Q,ne=n(n({},K),{name:ne?"".concat(Y,"(virtual-from:").concat(K.name,")"):K.name,lowLevelIndex:K,isVirtual:ne,keyTail:Q,keyLength:q,extractKey:Zo($),unique:!ne&&K.unique});return X.push(ne),ne.isPrimaryKey||T.push(ne),1<q&&D(q===2?$[0]:$.slice(0,q-1),Q+1,K),X.sort(function(oe,ce){return oe.keyTail-ce.keyTail}),ne}v=D(x.primaryKey.keyPath,0,x.primaryKey),R[":id"]=[v];for(var M=0,G=x.indexes;M<G.length;M++){var j=G[M];D(j.keyPath,0,j)}function z($){var Q,K=$.query.index;return K.isVirtual?n(n({},$),{query:{index:K.lowLevelIndex,range:(Q=$.query.range,K=K.keyTail,{type:Q.type===1?2:Q.type,lower:_s(Q.lower,Q.lowerOpen?l.MAX_KEY:l.MIN_KEY,K),lowerOpen:!0,upper:_s(Q.upper,Q.upperOpen?l.MIN_KEY:l.MAX_KEY,K),upperOpen:!0})}}):$}return n(n({},w),{schema:n(n({},x),{primaryKey:v,indexes:T,getIndexByKeyPath:function($){return($=R[ai($)])&&$[0]}}),count:function($){return w.count(z($))},query:function($){return w.query(z($))},openCursor:function($){var Q=$.query.index,K=Q.keyTail,Y=Q.isVirtual,X=Q.keyLength;return Y?w.openCursor(z($)).then(function(ne){return ne&&q(ne)}):w.openCursor($);function q(ne){return Object.create(ne,{continue:{value:function(oe){oe!=null?ne.continue(_s(oe,$.reverse?l.MAX_KEY:l.MIN_KEY,K)):$.unique?ne.continue(ne.key.slice(0,X).concat($.reverse?l.MIN_KEY:l.MAX_KEY,K)):ne.continue()}},continuePrimaryKey:{value:function(oe,ce){ne.continuePrimaryKey(_s(oe,l.MAX_KEY,K),ce)}},primaryKey:{get:function(){return ne.primaryKey}},key:{get:function(){var oe=ne.key;return X===1?oe[0]:oe.slice(0,X)}},value:{get:function(){return ne.value}}})}}})}})}};function ia(l,v,w,x){return w=w||{},x=x||"",u(l).forEach(function(R){var T,D,M;f(v,R)?(T=l[R],D=v[R],typeof T=="object"&&typeof D=="object"&&T&&D?(M=le(T))!==le(D)?w[x+R]=v[R]:M==="Object"?ia(T,D,w,x+R+"."):T!==D&&(w[x+R]=v[R]):T!==D&&(w[x+R]=v[R])):w[x+R]=void 0}),u(v).forEach(function(R){f(l,R)||(w[x+R]=v[R])}),w}function sa(l,v){return v.type==="delete"?v.keys:v.keys||v.values.map(l.extractKey)}var n0={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(l){return n(n({},l),{table:function(v){var w=l.table(v),x=w.schema.primaryKey;return n(n({},w),{mutate:function(R){var T=Re.trans,D=T.table(v).hook,M=D.deleting,G=D.creating,j=D.updating;switch(R.type){case"add":if(G.fire===fe)break;return T._promise("readwrite",function(){return z(R)},!0);case"put":if(G.fire===fe&&j.fire===fe)break;return T._promise("readwrite",function(){return z(R)},!0);case"delete":if(M.fire===fe)break;return T._promise("readwrite",function(){return z(R)},!0);case"deleteRange":if(M.fire===fe)break;return T._promise("readwrite",function(){return(function $(Q,K,Y){return w.query({trans:Q,values:!1,query:{index:x,range:K},limit:Y}).then(function(X){var q=X.result;return z({type:"delete",keys:q,trans:Q}).then(function(ne){return 0<ne.numFailures?Promise.reject(ne.failures[0]):q.length<Y?{failures:[],numFailures:0,lastResult:void 0}:$(Q,n(n({},K),{lower:q[q.length-1],lowerOpen:!0}),Y)})})})(R.trans,R.range,1e4)},!0)}return w.mutate(R);function z($){var Q,K,Y,X=Re.trans,q=$.keys||sa(x,$);if(!q)throw new Error("Keys missing");return($=$.type==="add"||$.type==="put"?n(n({},$),{keys:q}):n({},$)).type!=="delete"&&($.values=i([],$.values)),$.keys&&($.keys=i([],$.keys)),Q=w,Y=q,((K=$).type==="add"?Promise.resolve([]):Q.getMany({trans:K.trans,keys:Y,cache:"immutable"})).then(function(ne){var oe=q.map(function(ce,de){var ve,we,pe,_e=ne[de],Ce={onerror:null,onsuccess:null};return $.type==="delete"?M.fire.call(Ce,ce,_e,X):$.type==="add"||_e===void 0?(ve=G.fire.call(Ce,ce,$.values[de],X),ce==null&&ve!=null&&($.keys[de]=ce=ve,x.outbound||A($.values[de],x.keyPath,ce))):(ve=ia(_e,$.values[de]),(we=j.fire.call(Ce,ve,ce,_e,X))&&(pe=$.values[de],Object.keys(we).forEach(function(ye){f(pe,ye)?pe[ye]=we[ye]:A(pe,ye,we[ye])}))),Ce});return w.mutate($).then(function(ce){for(var de=ce.failures,ve=ce.results,we=ce.numFailures,ce=ce.lastResult,pe=0;pe<q.length;++pe){var _e=(ve||q)[pe],Ce=oe[pe];_e==null?Ce.onerror&&Ce.onerror(de[pe]):Ce.onsuccess&&Ce.onsuccess($.type==="put"&&ne[pe]?$.values[pe]:_e)}return{failures:de,results:ve,numFailures:we,lastResult:ce}}).catch(function(ce){return oe.forEach(function(de){return de.onerror&&de.onerror(ce)}),Promise.reject(ce)})})}}})}})}};function mu(l,v,w){try{if(!v||v.keys.length<l.length)return null;for(var x=[],R=0,T=0;R<v.keys.length&&T<l.length;++R)He(v.keys[R],l[T])===0&&(x.push(w?O(v.values[R]):v.values[R]),++T);return x.length===l.length?x:null}catch{return null}}var i0={stack:"dbcore",level:-1,create:function(l){return{table:function(v){var w=l.table(v);return n(n({},w),{getMany:function(x){if(!x.cache)return w.getMany(x);var R=mu(x.keys,x.trans._cache,x.cache==="clone");return R?Ae.resolve(R):w.getMany(x).then(function(T){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?O(T):T},T})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),w.mutate(x)}})}}}};function vu(l,v){return l.trans.mode==="readonly"&&!!l.subscr&&!l.trans.explicit&&l.trans.db._options.cache!=="disabled"&&!v.schema.primaryKey.outbound}function bu(l,v){switch(l){case"query":return v.values&&!v.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var s0={stack:"dbcore",level:0,name:"Observability",create:function(l){var v=l.schema.name,w=new Nt(l.MIN_KEY,l.MAX_KEY);return n(n({},l),{transaction:function(x,R,T){if(Re.subscr&&R!=="readonly")throw new se.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Re.querier));return l.transaction(x,R,T)},table:function(x){var R=l.table(x),T=R.schema,D=T.primaryKey,$=T.indexes,M=D.extractKey,G=D.outbound,j=D.autoIncrement&&$.filter(function(K){return K.compound&&K.keyPath.includes(D.keyPath)}),z=n(n({},R),{mutate:function(K){function Y(ye){return ye="idb://".concat(v,"/").concat(x,"/").concat(ye),ce[ye]||(ce[ye]=new Nt)}var X,q,ne,oe=K.trans,ce=K.mutatedParts||(K.mutatedParts={}),de=Y(""),ve=Y(":dels"),we=K.type,Ce=K.type==="deleteRange"?[K.range]:K.type==="delete"?[K.keys]:K.values.length<50?[sa(D,K).filter(function(ye){return ye}),K.values]:[],pe=Ce[0],_e=Ce[1],Ce=K.trans._cache;return s(pe)?(de.addKeys(pe),(Ce=we==="delete"||pe.length===_e.length?mu(pe,Ce):null)||ve.addKeys(pe),(Ce||_e)&&(X=Y,q=Ce,ne=_e,T.indexes.forEach(function(ye){var xe=X(ye.name||"");function De(Ue){return Ue!=null?ye.extractKey(Ue):null}function Ve(Ue){return ye.multiEntry&&s(Ue)?Ue.forEach(function($t){return xe.addKey($t)}):xe.addKey(Ue)}(q||ne).forEach(function(Ue,Tt){var Oe=q&&De(q[Tt]),Tt=ne&&De(ne[Tt]);He(Oe,Tt)!==0&&(Oe!=null&&Ve(Oe),Tt!=null&&Ve(Tt))})}))):pe?(_e={from:(_e=pe.lower)!==null&&_e!==void 0?_e:l.MIN_KEY,to:(_e=pe.upper)!==null&&_e!==void 0?_e:l.MAX_KEY},ve.add(_e),de.add(_e)):(de.add(w),ve.add(w),T.indexes.forEach(function(ye){return Y(ye.name).add(w)})),R.mutate(K).then(function(ye){return!pe||K.type!=="add"&&K.type!=="put"||(de.addKeys(ye.results),j&&j.forEach(function(xe){for(var De=K.values.map(function(Oe){return xe.extractKey(Oe)}),Ve=xe.keyPath.findIndex(function(Oe){return Oe===D.keyPath}),Ue=0,$t=ye.results.length;Ue<$t;++Ue)De[Ue][Ve]=ye.results[Ue];Y(xe.name).addKeys(De)})),oe.mutatedParts=vs(oe.mutatedParts||{},ce),ye})}}),$=function(Y){var X=Y.query,Y=X.index,X=X.range;return[Y,new Nt((Y=X.lower)!==null&&Y!==void 0?Y:l.MIN_KEY,(X=X.upper)!==null&&X!==void 0?X:l.MAX_KEY)]},Q={get:function(K){return[D,new Nt(K.key)]},getMany:function(K){return[D,new Nt().addKeys(K.keys)]},count:$,query:$,openCursor:$};return u(Q).forEach(function(K){z[K]=function(Y){var X=Re.subscr,q=!!X,ne=vu(Re,R)&&bu(K,Y)?Y.obsSet={}:X;if(q){var oe=function(_e){return _e="idb://".concat(v,"/").concat(x,"/").concat(_e),ne[_e]||(ne[_e]=new Nt)},ce=oe(""),de=oe(":dels"),X=Q[K](Y),q=X[0],X=X[1];if((K==="query"&&q.isPrimaryKey&&!Y.values?de:oe(q.name||"")).add(X),!q.isPrimaryKey){if(K!=="count"){var ve=K==="query"&&G&&Y.values&&R.query(n(n({},Y),{values:!1}));return R[K].apply(this,arguments).then(function(_e){if(K==="query"){if(G&&Y.values)return ve.then(function(De){return De=De.result,ce.addKeys(De),_e});var Ce=Y.values?_e.result.map(M):_e.result;(Y.values?ce:de).addKeys(Ce)}else if(K==="openCursor"){var ye=_e,xe=Y.values;return ye&&Object.create(ye,{key:{get:function(){return de.addKey(ye.primaryKey),ye.key}},primaryKey:{get:function(){var De=ye.primaryKey;return de.addKey(De),De}},value:{get:function(){return xe&&ce.addKey(ye.primaryKey),ye.value}}})}return _e})}de.add(w)}}return R[K].apply(this,arguments)}}),z}})}};function _u(l,v,w){if(w.numFailures===0)return v;if(v.type==="deleteRange")return null;var x=v.keys?v.keys.length:"values"in v&&v.values?v.values.length:1;return w.numFailures===x?null:(v=n({},v),s(v.keys)&&(v.keys=v.keys.filter(function(R,T){return!(T in w.failures)})),"values"in v&&s(v.values)&&(v.values=v.values.filter(function(R,T){return!(T in w.failures)})),v)}function oa(l,v){return w=l,((x=v).lower===void 0||(x.lowerOpen?0<He(w,x.lower):0<=He(w,x.lower)))&&(l=l,(v=v).upper===void 0||(v.upperOpen?He(l,v.upper)<0:He(l,v.upper)<=0));var w,x}function yu(l,v,Q,x,R,T){if(!Q||Q.length===0)return l;var D=v.query.index,M=D.multiEntry,G=v.query.range,j=x.schema.primaryKey.extractKey,z=D.extractKey,$=(D.lowLevelIndex||D).extractKey,Q=Q.reduce(function(K,Y){var X=K,q=[];if(Y.type==="add"||Y.type==="put")for(var ne=new Nt,oe=Y.values.length-1;0<=oe;--oe){var ce,de=Y.values[oe],ve=j(de);ne.hasKey(ve)||(ce=z(de),(M&&s(ce)?ce.some(function(ye){return oa(ye,G)}):oa(ce,G))&&(ne.addKey(ve),q.push(de)))}switch(Y.type){case"add":var we=new Nt().addKeys(v.values?K.map(function(xe){return j(xe)}):K),X=K.concat(v.values?q.filter(function(xe){return xe=j(xe),!we.hasKey(xe)&&(we.addKey(xe),!0)}):q.map(function(xe){return j(xe)}).filter(function(xe){return!we.hasKey(xe)&&(we.addKey(xe),!0)}));break;case"put":var pe=new Nt().addKeys(Y.values.map(function(xe){return j(xe)}));X=K.filter(function(xe){return!pe.hasKey(v.values?j(xe):xe)}).concat(v.values?q:q.map(function(xe){return j(xe)}));break;case"delete":var _e=new Nt().addKeys(Y.keys);X=K.filter(function(xe){return!_e.hasKey(v.values?j(xe):xe)});break;case"deleteRange":var Ce=Y.range;X=K.filter(function(xe){return!oa(j(xe),Ce)})}return X},l);return Q===l?l:(Q.sort(function(K,Y){return He($(K),$(Y))||He(j(K),j(Y))}),v.limit&&v.limit<1/0&&(Q.length>v.limit?Q.length=v.limit:l.length===v.limit&&Q.length<v.limit&&(R.dirty=!0)),T?Object.freeze(Q):Q)}function Su(l,v){return He(l.lower,v.lower)===0&&He(l.upper,v.upper)===0&&!!l.lowerOpen==!!v.lowerOpen&&!!l.upperOpen==!!v.upperOpen}function o0(l,v){return(function(w,x,R,T){if(w===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=He(w,x))===0){if(R&&T)return 0;if(R)return 1;if(T)return-1}return x})(l.lower,v.lower,l.lowerOpen,v.lowerOpen)<=0&&0<=(function(w,x,R,T){if(w===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=He(w,x))===0){if(R&&T)return 0;if(R)return-1;if(T)return 1}return x})(l.upper,v.upper,l.upperOpen,v.upperOpen)}function a0(l,v,w,x){l.subscribers.add(w),x.addEventListener("abort",function(){var R,T;l.subscribers.delete(w),l.subscribers.size===0&&(R=l,T=v,setTimeout(function(){R.subscribers.size===0&&ie(T,R)},3e3))})}var c0={stack:"dbcore",level:0,name:"Cache",create:function(l){var v=l.schema.name;return n(n({},l),{transaction:function(w,x,R){var T,D,M=l.transaction(w,x,R);return x==="readwrite"&&(D=(T=new AbortController).signal,R=function(G){return function(){if(T.abort(),x==="readwrite"){for(var j=new Set,z=0,$=w;z<$.length;z++){var Q=$[z],K=tn["idb://".concat(v,"/").concat(Q)];if(K){var Y=l.table(Q),X=K.optimisticOps.filter(function(xe){return xe.trans===M});if(M._explicit&&G&&M.mutatedParts)for(var q=0,ne=Object.values(K.queries.query);q<ne.length;q++)for(var oe=0,ce=(we=ne[q]).slice();oe<ce.length;oe++)Qo((pe=ce[oe]).obsSet,M.mutatedParts)&&(ie(we,pe),pe.subscribers.forEach(function(xe){return j.add(xe)}));else if(0<X.length){K.optimisticOps=K.optimisticOps.filter(function(xe){return xe.trans!==M});for(var de=0,ve=Object.values(K.queries.query);de<ve.length;de++)for(var we,pe,_e,Ce=0,ye=(we=ve[de]).slice();Ce<ye.length;Ce++)(pe=ye[Ce]).res!=null&&M.mutatedParts&&(G&&!pe.dirty?(_e=Object.isFrozen(pe.res),_e=yu(pe.res,pe.req,X,Y,pe,_e),pe.dirty?(ie(we,pe),pe.subscribers.forEach(function(xe){return j.add(xe)})):_e!==pe.res&&(pe.res=_e,pe.promise=Ae.resolve({result:_e}))):(pe.dirty&&ie(we,pe),pe.subscribers.forEach(function(xe){return j.add(xe)})))}}}j.forEach(function(xe){return xe()})}}},M.addEventListener("abort",R(!1),{signal:D}),M.addEventListener("error",R(!1),{signal:D}),M.addEventListener("complete",R(!0),{signal:D})),M},table:function(w){var x=l.table(w),R=x.schema.primaryKey;return n(n({},x),{mutate:function(T){var D=Re.trans;if(R.outbound||D.db._options.cache==="disabled"||D.explicit||D.idbtrans.mode!=="readwrite")return x.mutate(T);var M=tn["idb://".concat(v,"/").concat(w)];return M?(D=x.mutate(T),T.type!=="add"&&T.type!=="put"||!(50<=T.values.length||sa(R,T).some(function(G){return G==null}))?(M.optimisticOps.push(T),T.mutatedParts&&bs(T.mutatedParts),D.then(function(G){0<G.numFailures&&(ie(M.optimisticOps,T),(G=_u(0,T,G))&&M.optimisticOps.push(G),T.mutatedParts&&bs(T.mutatedParts))}),D.catch(function(){ie(M.optimisticOps,T),T.mutatedParts&&bs(T.mutatedParts)})):D.then(function(G){var j=_u(0,n(n({},T),{values:T.values.map(function(z,$){var Q;return G.failures[$]?z:(z=(Q=R.keyPath)!==null&&Q!==void 0&&Q.includes(".")?O(z):n({},z),A(z,R.keyPath,G.results[$]),z)})}),G);M.optimisticOps.push(j),queueMicrotask(function(){return T.mutatedParts&&bs(T.mutatedParts)})}),D):x.mutate(T)},query:function(T){if(!vu(Re,x)||!bu("query",T))return x.query(T);var D=((j=Re.trans)===null||j===void 0?void 0:j.db._options.cache)==="immutable",$=Re,M=$.requery,G=$.signal,j=(function(Y,X,q,ne){var oe=tn["idb://".concat(Y,"/").concat(X)];if(!oe)return[];if(!(X=oe.queries[q]))return[null,!1,oe,null];var ce=X[(ne.query?ne.query.index.name:null)||""];if(!ce)return[null,!1,oe,null];switch(q){case"query":var de=ce.find(function(ve){return ve.req.limit===ne.limit&&ve.req.values===ne.values&&Su(ve.req.query.range,ne.query.range)});return de?[de,!0,oe,ce]:[ce.find(function(ve){return("limit"in ve.req?ve.req.limit:1/0)>=ne.limit&&(!ne.values||ve.req.values)&&o0(ve.req.query.range,ne.query.range)}),!1,oe,ce];case"count":return de=ce.find(function(ve){return Su(ve.req.query.range,ne.query.range)}),[de,!!de,oe,ce]}})(v,w,"query",T),z=j[0],$=j[1],Q=j[2],K=j[3];return z&&$?z.obsSet=T.obsSet:($=x.query(T).then(function(Y){var X=Y.result;if(z&&(z.res=X),D){for(var q=0,ne=X.length;q<ne;++q)Object.freeze(X[q]);Object.freeze(X)}else Y.result=O(X);return Y}).catch(function(Y){return K&&z&&ie(K,z),Promise.reject(Y)}),z={obsSet:T.obsSet,promise:$,subscribers:new Set,type:"query",req:T,dirty:!1},K?K.push(z):(K=[z],(Q=Q||(tn["idb://".concat(v,"/").concat(w)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[T.query.index.name||""]=K)),a0(z,K,M,G),z.promise.then(function(Y){return{result:yu(Y.result,T,Q==null?void 0:Q.optimisticOps,x,z,D)}})}})}})}};function ys(l,v){return new Proxy(l,{get:function(w,x,R){return x==="db"?v:Reflect.get(w,x,R)}})}var Sr=(lt.prototype.version=function(l){if(isNaN(l)||l<.1)throw new se.Type("Given version is not a positive number");if(l=Math.round(10*l)/10,this.idbdb||this._state.isBeingOpened)throw new se.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,l);var v=this._versions,w=v.filter(function(x){return x._cfg.version===l})[0];return w||(w=new this.Version(l),v.push(w),v.sort(zv),w.stores({}),this._state.autoSchema=!1,w)},lt.prototype._whenReady=function(l){var v=this;return this.idbdb&&(this._state.openComplete||Re.letThrough||this._vip)?l():new Ae(function(w,x){if(v._state.openComplete)return x(new se.DatabaseClosed(v._state.dbOpenError));if(!v._state.isBeingOpened){if(!v._state.autoOpen)return void x(new se.DatabaseClosed);v.open().catch(fe)}v._state.dbReadyPromise.then(w,x)}).then(l)},lt.prototype.use=function(l){var v=l.stack,w=l.create,x=l.level,R=l.name;return R&&this.unuse({stack:v,name:R}),l=this._middlewares[v]||(this._middlewares[v]=[]),l.push({stack:v,create:w,level:x??10,name:R}),l.sort(function(T,D){return T.level-D.level}),this},lt.prototype.unuse=function(l){var v=l.stack,w=l.name,x=l.create;return v&&this._middlewares[v]&&(this._middlewares[v]=this._middlewares[v].filter(function(R){return x?R.create!==x:!!w&&R.name!==w})),this},lt.prototype.open=function(){var l=this;return qr(Tr,function(){return t0(l)})},lt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var l=this._state,v=kn.indexOf(this);if(0<=v&&kn.splice(v,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}l.isBeingOpened||(l.dbReadyPromise=new Ae(function(w){l.dbReadyResolve=w}),l.openCanceller=new Ae(function(w,x){l.cancelOpen=x}))},lt.prototype.close=function(w){var v=(w===void 0?{disableAutoOpen:!0}:w).disableAutoOpen,w=this._state;v?(w.isBeingOpened&&w.cancelOpen(new se.DatabaseClosed),this._close(),w.autoOpen=!1,w.dbOpenError=new se.DatabaseClosed):(this._close(),w.autoOpen=this._options.autoOpen||w.isBeingOpened,w.openComplete=!1,w.dbOpenError=null)},lt.prototype.delete=function(l){var v=this;l===void 0&&(l={disableAutoOpen:!0});var w=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new Ae(function(R,T){function D(){v.close(l);var M=v._deps.indexedDB.deleteDatabase(v.name);M.onsuccess=rt(function(){var G,j,z;G=v._deps,j=v.name,z=G.indexedDB,G=G.IDBKeyRange,Jo(z)||j===ss||Xo(z,G).delete(j).catch(fe),R()}),M.onerror=dr(T),M.onblocked=v._fireOnBlocked}if(w)throw new se.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(D):D()})},lt.prototype.backendDB=function(){return this.idbdb},lt.prototype.isOpen=function(){return this.idbdb!==null},lt.prototype.hasBeenClosed=function(){var l=this._state.dbOpenError;return l&&l.name==="DatabaseClosed"},lt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},lt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(lt.prototype,"tables",{get:function(){var l=this;return u(this._allTables).map(function(v){return l._allTables[v]})},enumerable:!1,configurable:!0}),lt.prototype.transaction=function(){var l=(function(v,w,x){var R=arguments.length;if(R<2)throw new se.InvalidArgument("Too few arguments");for(var T=new Array(R-1);--R;)T[R-1]=arguments[R];return x=T.pop(),[v,F(T),x]}).apply(this,arguments);return this._transaction.apply(this,l)},lt.prototype._transaction=function(l,v,w){var x=this,R=Re.trans;R&&R.db===this&&l.indexOf("!")===-1||(R=null);var T,D,M=l.indexOf("?")!==-1;l=l.replace("!","").replace("?","");try{if(D=v.map(function(j){if(j=j instanceof x.Table?j.name:j,typeof j!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return j}),l=="r"||l===Mo)T=Mo;else{if(l!="rw"&&l!=Uo)throw new se.InvalidArgument("Invalid transaction mode: "+l);T=Uo}if(R){if(R.mode===Mo&&T===Uo){if(!M)throw new se.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");R=null}R&&D.forEach(function(j){if(R&&R.storeNames.indexOf(j)===-1){if(!M)throw new se.SubTransaction("Table "+j+" not included in parent transaction.");R=null}}),M&&R&&!R.active&&(R=null)}}catch(j){return R?R._promise(null,function(z,$){$(j)}):ct(j)}var G=(function j(z,$,Q,K,Y){return Ae.resolve().then(function(){var X=Re.transless||Re,q=z._createTransaction($,Q,z._dbSchema,K);if(q.explicit=!0,X={trans:q,transless:X},K)q.idbtrans=K.idbtrans;else try{q.create(),q.idbtrans._explicit=!0,z._state.PR1398_maxLoop=3}catch(ce){return ce.name===J.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return j(z,$,Q,null,Y)})):ct(ce)}var ne,oe=W(Y);return oe&&Cn(),X=Ae.follow(function(){var ce;(ne=Y.call(q,q))&&(oe?(ce=Lr.bind(null,null),ne.then(ce,ce)):typeof ne.next=="function"&&typeof ne.throw=="function"&&(ne=na(ne)))},X),(ne&&typeof ne.then=="function"?Ae.resolve(ne).then(function(ce){return q.active?ce:ct(new se.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):X.then(function(){return ne})).then(function(ce){return K&&q._resolve(),q._completion.then(function(){return ce})}).catch(function(ce){return q._reject(ce),ct(ce)})})}).bind(null,this,T,D,R,w);return R?R._promise(T,G,"lock"):Re.trans?qr(Re.transless,function(){return x._whenReady(G)}):this._whenReady(G)},lt.prototype.table=function(l){if(!f(this._allTables,l))throw new se.InvalidTable("Table ".concat(l," does not exist"));return this._allTables[l]},lt);function lt(l,v){var w=this;this._middlewares={},this.verno=0;var x=lt.dependencies;this._options=v=n({addons:lt.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},v),this._deps={indexedDB:v.indexedDB,IDBKeyRange:v.IDBKeyRange},x=v.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var R,T,D,M,G,j={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:fe,dbReadyPromise:null,cancelOpen:fe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:v.autoOpen};j.dbReadyPromise=new Ae(function($){j.dbReadyResolve=$}),j.openCanceller=new Ae(function($,Q){j.cancelOpen=Q}),this._state=j,this.name=l,this.on=ri(this,"populate","blocked","versionchange","close",{ready:[Xr,fe]}),this.once=function($,Q){var K=function(){for(var Y=[],X=0;X<arguments.length;X++)Y[X]=arguments[X];w.on($).unsubscribe(K),Q.apply(w,Y)};return w.on($,K)},this.on.ready.subscribe=g(this.on.ready.subscribe,function($){return function(Q,K){lt.vip(function(){var Y,X=w._state;X.openComplete?(X.dbOpenError||Ae.resolve().then(Q),K&&$(Q)):X.onReadyBeingFired?(X.onReadyBeingFired.push(Q),K&&$(Q)):($(Q),Y=w,K||$(function q(){Y.on.ready.unsubscribe(Q),Y.on.ready.unsubscribe(q)}))})}}),this.Collection=(R=this,ni(Gv.prototype,function(ne,q){this.db=R;var K=Jl,Y=null;if(q)try{K=q()}catch(oe){Y=oe}var X=ne._ctx,q=X.table,ne=q.hook.reading.fire;this._ctx={table:q,index:X.index,isPrimKey:!X.index||q.schema.primKey.keyPath&&X.index===q.schema.primKey.name,range:K,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Y,or:X.or,valueMapper:ne!==Fe?ne:null}})),this.Table=(T=this,ni(ru.prototype,function($,Q,K){this.db=T,this._tx=K,this.name=$,this.schema=Q,this.hook=T._allTables[$]?T._allTables[$].hook:ri(null,{creating:[xt,fe],reading:[tt,Fe],updating:[Yr,fe],deleting:[Le,fe]})})),this.Transaction=(D=this,ni(Kv.prototype,function($,Q,K,Y,X){var q=this;$!=="readonly"&&Q.forEach(function(ne){ne=(ne=K[ne])===null||ne===void 0?void 0:ne.yProps,ne&&(Q=Q.concat(ne.map(function(oe){return oe.updatesTable})))}),this.db=D,this.mode=$,this.storeNames=Q,this.schema=K,this.chromeTransactionDurability=Y,this.idbtrans=null,this.on=ri(this,"complete","error","abort"),this.parent=X||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ae(function(ne,oe){q._resolve=ne,q._reject=oe}),this._completion.then(function(){q.active=!1,q.on.complete.fire()},function(ne){var oe=q.active;return q.active=!1,q.on.error.fire(ne),q.parent?q.parent._reject(ne):oe&&q.idbtrans&&q.idbtrans.abort(),ct(ne)})})),this.Version=(M=this,ni(e0.prototype,function($){this.db=M,this._cfg={version:$,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(G=this,ni(au.prototype,function($,Q,K){if(this.db=G,this._ctx={table:$,index:Q===":id"?null:Q,or:K},this._cmp=this._ascending=He,this._descending=function(Y,X){return He(X,Y)},this._max=function(Y,X){return 0<He(Y,X)?Y:X},this._min=function(Y,X){return He(Y,X)<0?Y:X},this._IDBKeyRange=G._deps.IDBKeyRange,!this._IDBKeyRange)throw new se.MissingAPI})),this.on("versionchange",function($){0<$.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function($){!$.newVersion||$.newVersion<$.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat($.oldVersion/10))}),this._maxKey=oi(v.IDBKeyRange),this._createTransaction=function($,Q,K,Y){return new w.Transaction($,Q,K,w._options.chromeTransactionDurability,Y)},this._fireOnBlocked=function($){w.on("blocked").fire($),kn.filter(function(Q){return Q.name===w.name&&Q!==w&&!Q._state.vcFired}).map(function(Q){return Q.on("versionchange").fire($)})},this.use(i0),this.use(c0),this.use(s0),this.use(r0),this.use(n0);var z=new Proxy(this,{get:function($,Q,K){if(Q==="_vip")return!0;if(Q==="table")return function(X){return ys(w.table(X),z)};var Y=Reflect.get($,Q,K);return Y instanceof ru?ys(Y,z):Q==="tables"?Y.map(function(X){return ys(X,z)}):Q==="_createTransaction"?function(){return ys(Y.apply(this,arguments),z)}:Y}});this.vip=z,x.forEach(function($){return $(w)})}var Ss,er=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",l0=(aa.prototype.subscribe=function(l,v,w){return this._subscribe(l&&typeof l!="function"?l:{next:l,error:v,complete:w})},aa.prototype[er]=function(){return this},aa);function aa(l){this._subscribe=l}try{Ss={indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch{Ss={indexedDB:null,IDBKeyRange:null}}function wu(l){var v,w=!1,x=new l0(function(R){var T=W(l),D,M=!1,G={},j={},z={get closed(){return M},unsubscribe:function(){M||(M=!0,D&&D.abort(),$&&Fr.storagemutated.unsubscribe(K))}};R.start&&R.start(z);var $=!1,Q=function(){return Vo(Y)},K=function(X){vs(G,X),Qo(j,G)&&Q()},Y=function(){var X,q,ne;!M&&Ss.indexedDB&&(G={},X={},D&&D.abort(),D=new AbortController,ne=(function(oe){var ce=wn();try{T&&Cn();var de=Br(l,oe);return de=T?de.finally(Lr):de}finally{ce&&En()}})(q={subscr:X,signal:D.signal,requery:Q,querier:l,trans:null}),Promise.resolve(ne).then(function(oe){w=!0,v=oe,M||q.signal.aborted||(G={},(function(ce){for(var de in ce)if(f(ce,de))return;return 1})(j=X)||$||(Fr(si,K),$=!0),Vo(function(){return!M&&R.next&&R.next(oe)}))},function(oe){w=!1,["DatabaseClosedError","AbortError"].includes(oe==null?void 0:oe.name)||M||Vo(function(){M||R.error&&R.error(oe)})}))};return setTimeout(Q,0),z});return x.hasValue=function(){return w},x.getValue=function(){return v},x}var rn=Sr;function ca(l){var v=Vr;try{Vr=!0,Fr.storagemutated.fire(l),ra(l,!0)}finally{Vr=v}}b(rn,n(n({},Ie),{delete:function(l){return new rn(l,{addons:[]}).delete()},exists:function(l){return new rn(l,{addons:[]}).open().then(function(v){return v.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(l){try{return v=rn.dependencies,w=v.indexedDB,v=v.IDBKeyRange,(Jo(w)?Promise.resolve(w.databases()).then(function(x){return x.map(function(R){return R.name}).filter(function(R){return R!==ss})}):Xo(w,v).toCollection().primaryKeys()).then(l)}catch{return ct(new se.MissingAPI)}var v,w},defineClass:function(){return function(l){a(this,l)}},ignoreTransaction:function(l){return Re.trans?qr(Re.transless,l):l()},vip:zo,async:function(l){return function(){try{var v=na(l.apply(this,arguments));return v&&typeof v.then=="function"?v:Ae.resolve(v)}catch(w){return ct(w)}}},spawn:function(l,v,w){try{var x=na(l.apply(w,v||[]));return x&&typeof x.then=="function"?x:Ae.resolve(x)}catch(R){return ct(R)}},currentTransaction:{get:function(){return Re.trans||null}},waitFor:function(l,v){return v=Ae.resolve(typeof l=="function"?rn.ignoreTransaction(l):l).timeout(v||6e4),Re.trans?Re.trans.waitFor(v):v},Promise:Ae,debug:{get:function(){return Vt},set:function(l){Jr(l)}},derive:y,extend:a,props:b,override:g,Events:ri,on:Fr,liveQuery:wu,extendObservabilitySet:vs,getByKeyPath:C,setByKeyPath:A,delByKeyPath:function(l,v){typeof v=="string"?A(l,v,void 0):"length"in v&&[].map.call(v,function(w){A(l,w,void 0)})},shallowClone:E,deepClone:O,getObjectDiff:ia,cmp:He,asap:I,minKey:-1/0,addons:[],connections:kn,errnames:J,dependencies:Ss,cache:tn,semVer:"4.2.1",version:"4.2.1".split(".").map(function(l){return parseInt(l)}).reduce(function(l,v,w){return l+v/Math.pow(10,2*w)})})),rn.maxKey=oi(rn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Fr(si,function(l){Vr||(l=new CustomEvent(Ho,{detail:l}),Vr=!0,dispatchEvent(l),Vr=!1)}),addEventListener(Ho,function(l){l=l.detail,Vr||ca(l)}));var Rn,Vr=!1,Eu=function(){};return typeof BroadcastChannel<"u"&&((Eu=function(){(Rn=new BroadcastChannel(Ho)).onmessage=function(l){return l.data&&ca(l.data)}})(),typeof Rn.unref=="function"&&Rn.unref(),Fr(si,function(l){Vr||Rn.postMessage(l)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(l){if(!Sr.disableBfCache&&l.persisted){Vt&&console.debug("Dexie: handling persisted pagehide"),Rn!=null&&Rn.close();for(var v=0,w=kn;v<w.length;v++)w[v].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(l){!Sr.disableBfCache&&l.persisted&&(Vt&&console.debug("Dexie: handling persisted pageshow"),Eu(),ca({all:new Nt(-1/0,[[]])}))})),Ae.rejectionMapper=function(l,v){return!l||l instanceof he||l instanceof TypeError||l instanceof SyntaxError||!l.name||!ae[l.name]?l:(v=new ae[l.name](v||l.message,l),"stack"in l&&k(v,"stack",{get:function(){return this.inner.stack}}),v)},Jr(Vt),n(Sr,Object.freeze({__proto__:null,Dexie:Sr,liveQuery:wu,Entity:zl,cmp:He,PropModification:ti,replacePrefix:function(l,v){return new ti({replacePrefix:[l,v]})},add:function(l){return new ti({add:l})},remove:function(l){return new ti({remove:l})},default:Sr,RangeSet:Nt,mergeRanges:li,rangesOverlap:hu}),{default:Sr}),Sr})})(Fs)),Fs.exports}var P1=U1();const ja=eg(P1),Nd=Symbol.for("Dexie"),Ys=globalThis[Nd]||(globalThis[Nd]=ja);if(ja.semVer!==Ys.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ja.semVer} and ${Ys.semVer}`);const{liveQuery:LC,mergeRanges:OC,rangesOverlap:DC,RangeSet:FC,cmp:VC,Entity:MC,PropModification:UC,replacePrefix:PC,add:WC,remove:HC,DexieYProvider:$C}=Ys;var Ka=function(e,t){return Ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ka(e,t)};function Zr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ka(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Ya(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){u={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return o}function Js(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function mr(e){return typeof e=="function"}function tg(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var ya=tg(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
1
|
+
"use strict";var x0=Object.defineProperty;var R0=(e,t,r)=>t in e?x0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ui=(e,t,r)=>R0(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),ue=require("react"),we=require("@radix-ui/themes"),N0=require("@monaco-editor/react"),T0=require("react-markdown"),Vt=require("react-router-dom");require("react-dom");const B0=require("@radix-ui/react-icons");function L0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ge=L0(ue);function Ei(e){let t=!1;const r=[];for(let n=0;n<e.length;n++){let i=e.charAt(n);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),r.push(i);break}}return r.join("")}const O0=new Set(["constructor","toString","toJSON","valueOf"]);function Ci(e){return O0.has(e)?e+"$":e}function D0(){let e=0,t=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ua(e,t,r){for(let o=0;o<28;o=o+7){const l=e>>>o,s=!(!(l>>>7)&&t==0),a=(s?l|128:l)&255;if(r.push(a),!s)return}const n=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(r.push((i?n|128:n)&255),!!i){for(let o=3;o<31;o=o+7){const l=t>>>o,s=!!(l>>>7),a=(s?l|128:l)&255;if(r.push(a),!s)return}r.push(t>>>31&1)}}const Os=4294967296;function Nu(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let n=0,i=0;function o(l,s){const a=Number(e.slice(l,s));i*=r,n=n*r+a,n>=Os&&(i=i+(n/Os|0),n=n%Os)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?Df(n,i):Cc(n,i)}function F0(e,t){let r=Cc(e,t);const n=r.hi&2147483648;n&&(r=Df(r.lo,r.hi));const i=Of(r.lo,r.hi);return n?"-"+i:i}function Of(e,t){if({lo:e,hi:t}=V0(e,t),t<=2097151)return String(Os*t+e);const r=e&16777215,n=(e>>>24|t<<8)&16777215,i=t>>16&65535;let o=r+n*6777216+i*6710656,l=n+i*8147497,s=i*2;const a=1e7;return o>=a&&(l+=Math.floor(o/a),o%=a),l>=a&&(s+=Math.floor(l/a),l%=a),s.toString()+Tu(l)+Tu(o)}function V0(e,t){return{lo:e>>>0,hi:t>>>0}}function Cc(e,t){return{lo:e|0,hi:t|0}}function Df(e,t){return t=~t,e?e=~e+1:t+=1,Cc(e,t)}const Tu=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Ua(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function M0(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const st=U0();function U0(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),i=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){const s=typeof l=="bigint"?l:BigInt(l);if(s>n||s<r)throw new Error(`invalid int64: ${l}`);return s},uParse(l){const s=typeof l=="bigint"?l:BigInt(l);if(s>o||s<i)throw new Error(`invalid uint64: ${l}`);return s},enc(l){return e.setBigInt64(0,this.parse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(l){return e.setBigInt64(0,this.uParse(l),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(l,s){return e.setInt32(0,l,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(l,s){return e.setInt32(0,l,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),Bu(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),Lu(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),Bu(r),Nu(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),Lu(r),Nu(r)},dec(r,n){return F0(r,n)},uDec(r,n){return Of(r,n)}}}function Bu(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Lu(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var ee;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(ee||(ee={}));function mn(e,t){switch(e){case ee.STRING:return"";case ee.BOOL:return!1;case ee.DOUBLE:case ee.FLOAT:return 0;case ee.INT64:case ee.UINT64:case ee.SFIXED64:case ee.FIXED64:case ee.SINT64:return t?"0":st.zero;case ee.BYTES:return new Uint8Array(0);default:return 0}}function P0(e,t){switch(e){case ee.BOOL:return t===!1;case ee.STRING:return t==="";case ee.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Ff=2,kr=Symbol.for("reflect unsafe local");function Vf(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(n=>n.localName===r)}function W0(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Ff)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!P0(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function ki(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Mf(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Uf(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function $0(e,t){const r=t.localName;if(t.oneof){const n=t.oneof.localName;e[n].case===r&&(e[n]={case:void 0})}else if(t.presence!=Ff)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=mn(t.scalar,t.longAsString);break}}function kc(e){for(const t of e.field)ki(t,"jsonName")||(t.jsonName=Ei(t.name));e.nestedType.forEach(kc)}function H0(e,t){const r=e.values.find(n=>n.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function j0(e,t){switch(e){case ee.STRING:return t;case ee.BYTES:{const r=Z0(t);if(r===!1)throw new Error(`cannot parse ${ee[e]} default value: ${t}`);return r}case ee.INT64:case ee.SFIXED64:case ee.SINT64:return st.parse(t);case ee.UINT64:case ee.FIXED64:return st.uParse(t);case ee.DOUBLE:case ee.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case ee.BOOL:return t==="true";case ee.INT32:case ee.UINT32:case ee.SINT32:case ee.FIXED32:case ee.SFIXED32:return parseInt(t,10)}}function Z0(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(n){if(this.tail.length>=n){const i=this.tail.substring(0,n);return this.tail=this.tail.substring(n),i}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,8);if(Number.isNaN(o))return!1;t.push(o);break}case"x":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;t.push(o);break}case"u":{const n=r.c,i=r.take(4);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;const l=new Uint8Array(4);new DataView(l.buffer).setInt32(0,o,!0),t.push(l[0],l[1],l[2],l[3]);break}case"U":{const n=r.c,i=r.take(8);if(i===!1)return!1;const o=st.uEnc(n+i),l=new Uint8Array(8),s=new DataView(l.buffer);s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),t.push(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*Pa(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Pa(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Pa(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function Pf(...e){const t=G0();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)Vu(r,t);return t}if("$typeName"in e[0]){let o=function(l){const s=[];for(const a of l.dependency){if(t.getFile(a)!=null||i.has(a))continue;const c=n(a);if(!c)throw new Error(`Unable to resolve ${a}, imported by ${l.name}`);"kind"in c?t.addFile(c,!1,!0):(i.add(c.name),s.push(c))}return s.concat(...s.map(o))};const r=e[0],n=e[1],i=new Set;for(const l of[r,...o(r)].reverse())Vu(l,t)}else for(const r of e)for(const n of r.files)t.addFile(n);return t}function G0(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(n,i,o){if(r.set(n.proto.name,n),!i)for(const l of Pa(n))this.add(l);if(o)for(const l of n.dependencies)this.addFile(l,i,o)},add(n){if(n.kind=="extension"){let i=t.get(n.extendee.typeName);i||t.set(n.extendee.typeName,i=new Map),i.set(n.number,n)}e.set(n.typeName,n)},get(n){return e.get(n)},getFile(n){return r.get(n)},getMessage(n){const i=e.get(n);return(i==null?void 0:i.kind)=="message"?i:void 0},getEnum(n){const i=e.get(n);return(i==null?void 0:i.kind)=="enum"?i:void 0},getExtension(n){const i=e.get(n);return(i==null?void 0:i.kind)=="extension"?i:void 0},getExtensionFor(n,i){var o;return(o=t.get(n.typeName))===null||o===void 0?void 0:o.get(i)},getService(n){const i=e.get(n);return(i==null?void 0:i.kind)=="service"?i:void 0}}}const K0=998,Y0=999,X0=9,Ii=10,_i=11,J0=12,Ou=14,Ic=3,z0=2,Du=1,q0=0,da=1,Fu=2,Q0=3,eb=1,tb=2,rb=1,Wf={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Vu(e,t){var r,n;const i={kind:"file",proto:e,deprecated:(n=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&n!==void 0?n:!1,edition:ob(e),name:e.name.replace(/\.proto$/,""),dependencies:ab(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},o=new Map,l={get(s){return o.get(s)},add(s){var a;ar(((a=s.proto.options)===null||a===void 0?void 0:a.mapEntry)===!0),o.set(s.typeName,s)}};for(const s of e.enumType)$f(s,i,void 0,t);for(const s of e.messageType)Hf(s,i,void 0,t,l);for(const s of e.service)nb(s,i,t);Wa(i,t);for(const s of o.values())$a(s,t,l);for(const s of i.messages)$a(s,t,l),Wa(s,t);t.addFile(i,!0)}function Wa(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const n=Ha(r,e,t);e.extensions.push(n),t.add(n)}break;case"message":for(const r of e.proto.extension){const n=Ha(r,e,t);e.nestedExtensions.push(n),t.add(n)}for(const r of e.nestedMessages)Wa(r,t);break}}function $a(e,t,r){const n=e.proto.oneofDecl.map(o=>sb(o,e)),i=new Set;for(const o of e.proto.field){const l=ub(o,n),s=Ha(o,e,t,l,r);e.fields.push(s),e.field[s.localName]=s,l===void 0?e.members.push(s):(l.fields.push(s),i.has(l)||(i.add(l),e.members.push(l)))}for(const o of n.filter(l=>i.has(l)))e.oneofs.push(o);for(const o of e.nestedMessages)$a(o,t,r)}function $f(e,t,r,n){var i,o,l,s,a;const c=cb(e.name,e.value),g={kind:"enum",proto:e,deprecated:(o=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,file:t,parent:r,open:!0,name:e.name,typeName:fo(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};g.open=pb(g),n.add(g);for(const f of e.value){const b=f.name;g.values.push(g.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(l=f.options)===null||l===void 0?void 0:l.deprecated)!==null&&s!==void 0?s:!1,parent:g,name:b,localName:Ci(c==null?b:b.substring(c.length)),number:f.number,toString(){return`enum value ${g.typeName}.${b}`}})}((a=r==null?void 0:r.nestedEnums)!==null&&a!==void 0?a:t.enums).push(g)}function Hf(e,t,r,n,i){var o,l,s,a;const c={kind:"message",proto:e,deprecated:(l=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&l!==void 0?l:!1,file:t,parent:r,name:e.name,typeName:fo(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?i.add(c):(((a=r==null?void 0:r.nestedMessages)!==null&&a!==void 0?a:t.messages).push(c),n.add(c));for(const g of e.enumType)$f(g,t,c,n);for(const g of e.nestedType)Hf(g,t,c,n,i)}function nb(e,t,r){var n,i;const o={kind:"service",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:fo(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),r.add(o);for(const l of e.method){const s=ib(l,o,r);o.methods.push(s),o.method[s.localName]=s}}function ib(e,t,r){var n,i,o,l;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const a=r.getMessage(wr(e.inputType)),c=r.getMessage(wr(e.outputType));ar(a,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),ar(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:g,localName:Ci(g.length?Ci(g[0].toLowerCase()+g.substring(1)):g),methodKind:s,input:a,output:c,idempotency:(l=(o=e.options)===null||o===void 0?void 0:o.idempotencyLevel)!==null&&l!==void 0?l:q0,toString(){return`rpc ${t.typeName}.${g}`}}}function sb(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Ci(Ei(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function Ha(e,t,r,n,i){var o,l,s;const a=i===void 0,c={kind:"field",proto:e,deprecated:(l=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&l!==void 0?l:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:db(e,n,a,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){const _=t.kind=="file"?t:t.file,k=t.kind=="file"?void 0:t,y=fo(e,k,_);c.kind="extension",c.file=_,c.parent=k,c.oneof=void 0,c.typeName=y,c.jsonName=`[${y}]`,c.toString=()=>`extension ${y}`;const d=r.getMessage(wr(e.extendee));ar(d,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=d}else{const _=t;ar(_.kind=="message"),c.parent=_,c.oneof=n,c.localName=n?Ei(e.name):Ci(Ei(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const g=e.label,f=e.type,b=(s=e.options)===null||s===void 0?void 0:s.jstype;if(g===Ic){const _=f==_i?i==null?void 0:i.get(wr(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:k,value:y}=fb(_);return c.mapKey=k.scalar,c.mapKind=y.fieldKind,c.message=y.message,c.delimitedEncoding=!1,c.enum=y.enum,c.scalar=y.scalar,c}switch(c.fieldKind="list",f){case _i:case Ii:c.listKind="message",c.message=r.getMessage(wr(e.typeName)),ar(c.message),c.delimitedEncoding=Mu(e,t);break;case Ou:c.listKind="enum",c.enum=r.getEnum(wr(e.typeName)),ar(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=b==Du;break}return c.packed=hb(e,t),c}switch(f){case _i:case Ii:c.fieldKind="message",c.message=r.getMessage(wr(e.typeName)),ar(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=Mu(e,t),c.getDefaultValue=()=>{};break;case Ou:{const _=r.getEnum(wr(e.typeName));ar(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(wr(e.typeName)),c.getDefaultValue=()=>ki(e,"defaultValue")?H0(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=b==Du,c.getDefaultValue=()=>ki(e,"defaultValue")?j0(f,e.defaultValue):void 0;break}}return c}function ob(e){switch(e.syntax){case"":case"proto2":return K0;case"proto3":return Y0;case"editions":if(e.edition in Wf)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function ab(e,t){return e.dependency.map(r=>{const n=t.getFile(r);if(!n)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return n})}function cb(e,t){const r=lb(e)+"_";for(const n of t){if(!n.name.toLowerCase().startsWith(r))return;const i=n.name.substring(r.length);if(i.length==0||/^\d/.test(i))return}return r}function lb(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function fo(e,t,r){let n;return t?n=`${t.typeName}.${e.name}`:r.proto.package.length>0?n=`${r.proto.package}.${e.name}`:n=`${e.name}`,n}function wr(e){return e.startsWith(".")?e.substring(1):e}function ub(e,t){if(!ki(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return ar(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function db(e,t,r,n){if(e.label==z0)return Q0;if(e.label==Ic)return Fu;if(t||e.proto3Optional||r)return da;const i=Un("fieldPresence",{proto:e,parent:n});return i==Fu&&(e.type==_i||e.type==Ii)?da:i}function hb(e,t){if(e.label!=Ic)return!1;switch(e.type){case X0:case J0:case Ii:case _i:return!1}const r=e.options;return r&&ki(r,"packed")?r.packed:eb==Un("repeatedFieldEncoding",{proto:e,parent:t})}function fb(e){const t=e.fields.find(n=>n.number===1),r=e.fields.find(n=>n.number===2);return ar(t&&t.fieldKind=="scalar"&&t.scalar!=ee.BYTES&&t.scalar!=ee.FLOAT&&t.scalar!=ee.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function pb(e){var t;return rb==Un("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function Mu(e,t){return e.type==Ii?!0:tb==Un("messageEncoding",{proto:e,parent:t})}function Un(e,t){var r,n;const i=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(i){const o=i[e];if(o!=0)return o}if("kind"in t){if(t.kind=="message")return Un(e,(n=t.parent)!==null&&n!==void 0?n:t.file);const o=Wf[t.edition];if(!o)throw new Error(`feature default for edition ${t.edition} not found`);return o[e]}return Un(e,t.parent)}function ar(e,t){if(!e)throw new Error(t)}function gb(e){const t=mb(e);return t.messageType.forEach(kc),Pf(t,()=>{}).getFile(t.name)}function mb(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(jf),enumType:e.enumType.map(Zf)}))}function jf(e){var t,r,n,i,o,l,s,a;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(vb))!==null&&r!==void 0?r:[],extension:[],nestedType:(i=(n=e.nestedType)===null||n===void 0?void 0:n.map(jf))!==null&&i!==void 0?i:[],enumType:(l=(o=e.enumType)===null||o===void 0?void 0:o.map(Zf))!==null&&l!==void 0?l:[],extensionRange:(a=(s=e.extensionRange)===null||s===void 0?void 0:s.map(g=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},g)))!==null&&a!==void 0?a:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function vb(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?bb(e.options):void 0}))}function bb(e){var t,r,n;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(n=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(o=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},o)))!==null&&n!==void 0?n:[],uninterpretedOption:[]}))}function Zf(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function Ac(e){const t=yb();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let n=new Uint8Array(r),i=0,o=0,l,s=0;for(let a=0;a<e.length;a++){if(l=t[e.charCodeAt(a)],l===void 0)switch(e[a]){case"=":o=0;case`
|
|
2
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:s=l,o=1;break;case 1:n[i++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:n[i++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:n[i++]=(s&3)<<6|l,o=0;break}}if(o==1)throw Error("invalid base64 string");return n.subarray(0,i)}function _b(e,t="std"){const r=Gf(t),n=t=="std";let i="",o=0,l,s=0;for(let a=0;a<e.length;a++)switch(l=e[a],o){case 0:i+=r[l>>2],s=(l&3)<<4,o=1;break;case 1:i+=r[s|l>>4],s=(l&15)<<2,o=2;break;case 2:i+=r[s|l>>6],i+=r[l&63],o=0;break}return o&&(i+=r[s],n&&(i+="=",o==1&&(i+="="))),i}let Es,Uu,Nn;function Gf(e){return Es||(Es="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Uu=Es.slice(0,-2).concat("-","_")),e=="url"?Uu:Es}function yb(){if(!Nn){Nn=[];const e=Gf("std");for(let t=0;t<e.length;t++)Nn[e[t].charCodeAt(0)]=t;Nn[45]=e.indexOf("+"),Nn[95]=e.indexOf("/")}return Nn}function xc(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const Sb=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Ut extends Error{constructor(t,r,n="FieldValueInvalidError"){super(r),this.name=n,this.field=()=>t}}function wb(e){return e instanceof Error&&Sb.includes(e.name)&&"field"in e&&typeof e.field=="function"}function Wr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Rc(e,t){var r,n,i,o;if(Wr(e)&&kr in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const l=t,s=e.field();return l.listKind==s.listKind&&l.scalar===s.scalar&&((r=l.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=l.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function Nc(e,t){var r,n,i,o;if(Wr(e)&&kr in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const l=t,s=e.field();return l.mapKey===s.mapKey&&l.mapKind==s.mapKind&&l.scalar===s.scalar&&((r=l.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=l.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function po(e,t){return Wr(e)&&kr in e&&"desc"in e&&Wr(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const ha=Symbol.for("@bufbuild/protobuf/text-encoding");function Tc(){if(globalThis[ha]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[ha]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[ha]}var ht;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(ht||(ht={}));const Kf=34028234663852886e22,Yf=-34028234663852886e22,Xf=4294967295,Jf=2147483647,zf=-2147483648;class qf{constructor(t=Tc().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let r=new Uint8Array(t),n=0;for(let i=0;i<this.chunks.length;i++)r.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Pu(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return fa(t),Ua(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){Eb(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){Pu(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){fa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return fa(t),t=(t<<1^t>>31)>>>0,Ua(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=st.enc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=st.uEnc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}int64(t){let r=st.enc(t);return ua(r.lo,r.hi,this.buf),this}sint64(t){const r=st.enc(t),n=r.hi>>31,i=r.lo<<1^n,o=(r.hi<<1|r.lo>>>31)^n;return ua(i,o,this.buf),this}uint64(t){const r=st.uEnc(t);return ua(r.lo,r.hi,this.buf),this}}class Bc{constructor(t,r=Tc().decodeUtf8){this.decodeUtf8=r,this.varint64=D0,this.uint32=M0,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case ht.Varint:for(;this.buf[this.pos++]&128;);break;case ht.Bit64:this.pos+=4;case ht.Bit32:this.pos+=4;break;case ht.LengthDelimited:let i=this.uint32();this.pos+=i;break;case ht.StartGroup:for(;;){const[o,l]=this.tag();if(l===ht.EndGroup){if(r!==void 0&&o!==r)throw new Error("invalid end group tag");break}this.skip(l,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return st.dec(...this.varint64())}uint64(){return st.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,st.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return st.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return st.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function fa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Jf||e<zf)throw new Error("invalid int32: "+e)}function Pu(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Xf||e<0)throw new Error("invalid uint32: "+e)}function Eb(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>Kf||e<Yf))throw new Error("invalid float32: "+e)}function on(e,t){const r=e.fieldKind=="list"?Rc(t,e):e.fieldKind=="map"?Nc(t,e):Lc(e,t);if(r===!0)return;let n;switch(e.fieldKind){case"list":n=`expected ${tp(e)}, got ${St(t)}`;break;case"map":n=`expected ${rp(e)}, got ${St(t)}`;break;default:n=Hs(e,t,r)}return new Ut(e,n)}function Wu(e,t,r){const n=Lc(e,r);if(n!==!0)return new Ut(e,`list item #${t+1}: ${Hs(e,r,n)}`)}function Cb(e,t,r){const n=Qf(t,e.mapKey);if(n!==!0)return new Ut(e,`invalid map key: ${Hs({scalar:e.mapKey},t,n)}`);const i=Lc(e,r);if(i!==!0)return new Ut(e,`map entry ${St(t)}: ${Hs(e,r,i)}`)}function Lc(e,t){return e.scalar!==void 0?Qf(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):po(t,e.message)}function Qf(e,t){switch(t){case ee.DOUBLE:return typeof e=="number";case ee.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>Kf||e<Yf?`${e.toFixed()} out of range`:!0;case ee.INT32:case ee.SFIXED32:case ee.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Jf||e<zf?`${e.toFixed()} out of range`:!0;case ee.FIXED32:case ee.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Xf||e<0?`${e.toFixed()} out of range`:!0;case ee.BOOL:return typeof e=="boolean";case ee.STRING:return typeof e!="string"?!1:Tc().checkUtf8(e)||"invalid UTF8";case ee.BYTES:return e instanceof Uint8Array;case ee.INT64:case ee.SFIXED64:case ee.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return st.parse(e),!0}catch{return`${e} out of range`}return!1;case ee.FIXED64:case ee.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return st.uParse(e),!0}catch{return`${e} out of range`}return!1}}function Hs(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${St(t)}`,e.scalar!==void 0?`expected ${kb(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${ep(e.message)}`+r}function St(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:Rc(e)?tp(e.field()):Nc(e)?rp(e.field()):po(e)?ep(e.desc):xc(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function ep(e){return`ReflectMessage (${e.typeName})`}function tp(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${ee[e.scalar]})`}}function rp(e){switch(e.mapKind){case"message":return`ReflectMap (${ee[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${ee[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${ee[e.mapKey]}, ${ee[e.scalar]})`}}function kb(e){switch(e){case ee.STRING:return"string";case ee.BOOL:return"boolean";case ee.INT64:case ee.SINT64:case ee.SFIXED64:return"bigint (int64)";case ee.UINT64:case ee.FIXED64:return"bigint (uint64)";case ee.BYTES:return"Uint8Array";case ee.DOUBLE:return"number (float64)";case ee.FLOAT:return"number (float32)";case ee.FIXED32:case ee.UINT32:return"number (uint32)";case ee.INT32:case ee.SFIXED32:case ee.SINT32:return"number (int32)"}}function Ib(e){return np(e.$typeName)}function $i(e){const t=e.fields[0];return np(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function np(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const Ab=999,xb=998,Ds=2;function Ze(e,t){if(xc(t,e))return t;const r=Lb(e);return t!==void 0&&Rb(e,r,t),r}function Rb(e,t,r){for(const n of e.members){let i=r[n.localName];if(i==null)continue;let o;if(n.kind=="oneof"){const l=Vf(r,n);if(!l)continue;o=l,i=Mf(r,l)}else o=n;switch(o.fieldKind){case"message":i=Oc(o,i);break;case"scalar":i=ip(o,i);break;case"list":i=Tb(o,i);break;case"map":i=Nb(o,i);break}Uf(t,o,i)}return t}function ip(e,t){return e.scalar==ee.BYTES?Dc(t):t}function Nb(e,t){if(Wr(t)){if(e.scalar==ee.BYTES)return $u(t,Dc);if(e.mapKind=="message")return $u(t,r=>Oc(e,r))}return t}function Tb(e,t){if(Array.isArray(t)){if(e.scalar==ee.BYTES)return t.map(Dc);if(e.listKind=="message")return t.map(r=>Oc(e,r))}return t}function Oc(e,t){if(e.fieldKind=="message"&&!e.oneof&&$i(e.message))return ip(e.message.fields[0],t);if(Wr(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!xc(t,e.message))return Ze(e.message,t)}return t}function Dc(e){return Array.isArray(e)?new Uint8Array(e):e}function $u(e,t){const r={};for(const n of Object.entries(e))r[n[0]]=t(n[1]);return r}const Bb=Symbol(),Hu=new WeakMap;function Lb(e){let t;if(Ob(e)){const r=Hu.get(e);let n,i;if(r)({prototype:n,members:i}=r);else{n={},i=new Set;for(const o of e.members)o.kind!="oneof"&&(o.fieldKind!="scalar"&&o.fieldKind!="enum"||o.presence!=Ds&&(i.add(o),n[o.localName]=pa(o)));Hu.set(e,{prototype:n,members:i})}t=Object.create(n),t.$typeName=e.typeName;for(const o of e.members)i.has(o)||o.kind=="field"&&(o.fieldKind=="message"||(o.fieldKind=="scalar"||o.fieldKind=="enum")&&o.presence!=Ds)||(t[o.localName]=pa(o))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==Ds)&&(t[r.localName]=pa(r))}return t}function Ob(e){switch(e.file.edition){case Ab:return!1;case xb:return!0;default:return e.fields.some(t=>t.presence!=Ds&&t.fieldKind!="message"&&!t.oneof)}}function pa(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return Bb;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?mn(e.scalar,e.longAsString):e.enum.values[0].number}function Wt(e,t,r=!0){return new sp(e,t,r)}class sp{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,n)=>r.number-n.number)}constructor(t,r,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=t,this.message=this[kr]=r??Ze(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return di(this.message,t),Vf(this.message,t)}isSet(t){return di(this.message,t),W0(this.message,t)}clear(t){di(this.message,t),$0(this.message,t)}get(t){di(this.message,t);const r=Mf(this.message,t);switch(t.fieldKind){case"list":let n=this.lists.get(t);return(!n||n[kr]!==r)&&this.lists.set(t,n=new Db(t,r,this.check)),n;case"map":let i=this.maps.get(t);return(!i||i[kr]!==r)&&this.maps.set(t,i=new Fb(t,r,this.check)),i;case"message":return Vc(t,r,this.check);case"scalar":return r===void 0?mn(t.scalar,!1):Mc(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(di(this.message,t),this.check){const i=on(t,r);if(i)throw i}let n;t.fieldKind=="message"?n=Fc(t,r):Nc(r)||Rc(r)?n=r[kr]:n=Uc(t,r),Uf(this.message,t,n)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function di(e,t){if(t.parent.typeName!==e.$typeName)throw new Ut(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class Db{field(){return this._field}get size(){return this._arr.length}constructor(t,r,n){this._field=t,this._arr=this[kr]=r,this.check=n}get(t){const r=this._arr[t];return r===void 0?void 0:ga(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Ut(this._field,`list item #${t+1}: out of range`);if(this.check){const n=Wu(this._field,t,r);if(n)throw n}this._arr[t]=ju(this._field,r)}add(t){if(this.check){const r=Wu(this._field,this._arr.length,t);if(r)throw r}this._arr.push(ju(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield ga(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,ga(this._field,this._arr[t],this.check)]}}class Fb{constructor(t,r,n=!0){this.obj=this[kr]=r??{},this.check=n,this._field=t}field(){return this._field}set(t,r){if(this.check){const n=Cb(this._field,t,r);if(n)throw n}return this.obj[Cs(t)]=Vb(this._field,r),this}delete(t){const r=Cs(t),n=Object.prototype.hasOwnProperty.call(this.obj,r);return n&&delete this.obj[r],n}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[Cs(t)];return r!==void 0&&(r=ma(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Cs(t))}*keys(){for(const t of Object.keys(this.obj))yield Zu(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[Zu(t[0],this._field.mapKey),ma(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield ma(this._field,t,this.check)}forEach(t,r){for(const n of this.entries())t.call(r,n[1],n[0],this)}}function Fc(e,t){return po(t)?Ib(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?ap(t.message):t.message:t}function Vc(e,t,r){return t!==void 0&&($i(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Mc(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Wr(t)&&(t=op(t))),new sp(e.message,t,r)}function ju(e,t){return e.listKind=="message"?Fc(e,t):Uc(e,t)}function ga(e,t,r){return e.listKind=="message"?Vc(e,t,r):Mc(e,t)}function Vb(e,t){return e.mapKind=="message"?Fc(e,t):Uc(e,t)}function ma(e,t,r){return e.mapKind=="message"?Vc(e,t,r):t}function Cs(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function Zu(e,t){switch(t){case ee.STRING:return e;case ee.INT32:case ee.FIXED32:case ee.UINT32:case ee.SFIXED32:case ee.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case ee.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case ee.UINT64:case ee.FIXED64:try{return st.uParse(e)}catch{}break;default:try{return st.parse(e)}catch{}break}return e}function Mc(e,t){switch(e.scalar){case ee.INT64:case ee.SFIXED64:case ee.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=st.parse(t));break;case ee.FIXED64:case ee.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=st.uParse(t));break}return t}function Uc(e,t){switch(e.scalar){case ee.INT64:case ee.SFIXED64:case ee.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=st.parse(t));break;case ee.FIXED64:case ee.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=st.uParse(t));break}return t}function op(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Wr(e))for(const[r,n]of Object.entries(e))t.fields[r]=lp(n);return t}function ap(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=cp(n);return t}function cp(e){switch(e.kind.case){case"structValue":return ap(e.kind.value);case"listValue":return e.kind.value.values.map(cp);case"nullValue":case void 0:return null;default:return e.kind.value}}function lp(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const n of e)r.values.push(lp(n));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:op(e)};break}return t}const Mb=3,Gu={writeUnknownFields:!0};function Ub(e){return e?Object.assign(Object.assign({},Gu),e):Gu}function up(e,t,r){return js(new qf,Ub(r),Wt(e,t)).finish()}function js(e,t,r){var n;for(const i of r.sortedFields){if(!r.isSet(i)){if(i.presence==Mb)throw new Error(`cannot encode ${i} to binary: required field not set`);continue}dp(e,t,r,i)}if(t.writeUnknownFields)for(const{no:i,wireType:o,data:l}of(n=r.getUnknown())!==null&&n!==void 0?n:[])e.tag(i,o).raw(l);return e}function dp(e,t,r,n){var i;switch(n.fieldKind){case"scalar":case"enum":Zs(e,r.desc.typeName,n.name,(i=n.scalar)!==null&&i!==void 0?i:ee.INT32,n.number,r.get(n));break;case"list":Pb(e,t,n,r.get(n));break;case"message":hp(e,t,n,r.get(n));break;case"map":for(const[o,l]of r.get(n))Wb(e,t,n,o,l);break}}function Zs(e,t,r,n,i,o){fp(e.tag(i,$b(n)),t,r,n,o)}function hp(e,t,r,n){r.delimitedEncoding?js(e.tag(r.number,ht.StartGroup),t,n).tag(r.number,ht.EndGroup):js(e.tag(r.number,ht.LengthDelimited).fork(),t,n).join()}function Pb(e,t,r,n){var i;if(r.listKind=="message"){for(const l of n)hp(e,t,r,l);return}const o=(i=r.scalar)!==null&&i!==void 0?i:ee.INT32;if(r.packed){if(!n.size)return;e.tag(r.number,ht.LengthDelimited).fork();for(const l of n)fp(e,r.parent.typeName,r.name,o,l);e.join();return}for(const l of n)Zs(e,r.parent.typeName,r.name,o,r.number,l)}function Wb(e,t,r,n,i){var o;switch(e.tag(r.number,ht.LengthDelimited).fork(),Zs(e,r.parent.typeName,r.name,r.mapKey,1,n),r.mapKind){case"scalar":case"enum":Zs(e,r.parent.typeName,r.name,(o=r.scalar)!==null&&o!==void 0?o:ee.INT32,2,i);break;case"message":js(e.tag(2,ht.LengthDelimited).fork(),t,i).join();break}e.join()}function fp(e,t,r,n,i){try{switch(n){case ee.STRING:e.string(i);break;case ee.BOOL:e.bool(i);break;case ee.DOUBLE:e.double(i);break;case ee.FLOAT:e.float(i);break;case ee.INT32:e.int32(i);break;case ee.INT64:e.int64(i);break;case ee.UINT64:e.uint64(i);break;case ee.FIXED64:e.fixed64(i);break;case ee.BYTES:e.bytes(i);break;case ee.FIXED32:e.fixed32(i);break;case ee.SFIXED32:e.sfixed32(i);break;case ee.SFIXED64:e.sfixed64(i);break;case ee.SINT64:e.sint64(i);break;case ee.UINT32:e.uint32(i);break;case ee.SINT32:e.sint32(i);break}}catch(o){throw o instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${o.message}`):o}}function $b(e){switch(e){case ee.BYTES:case ee.STRING:return ht.LengthDelimited;case ee.DOUBLE:case ee.FIXED64:case ee.SFIXED64:return ht.Bit64;case ee.FIXED32:case ee.SFIXED32:case ee.FLOAT:return ht.Bit32;default:return ht.Varint}}function Hb(e,t){return pp(Wt(e,t)).message}function pp(e){const t=Wt(e.desc);for(const n of e.fields)if(e.isSet(n))switch(n.fieldKind){case"list":const i=t.get(n);for(const l of e.get(n))i.add(va(n,l));break;case"map":const o=t.get(n);for(const l of e.get(n).entries())o.set(l[0],va(n,l[1]));break;default:{t.set(n,va(n,e.get(n)));break}}const r=e.getUnknown();return r&&r.length>0&&t.setUnknown([...r]),t}function va(e,t){return e.message!==void 0&&po(t)?pp(t):e.scalar==ee.BYTES&&t instanceof Uint8Array?t.slice():t}function Be(e,t,...r){return r.reduce((n,i)=>n.nestedMessages[i],e.messages[t])}function Xt(e,t,...r){if(r.length==0)return e.enums[t];const n=r.pop();return r.reduce((i,o)=>i.nestedMessages[o],e.messages[t]).nestedEnums[n]}function Jt(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const jb=gb({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Zb=Be(jb,1);var Ku;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(Ku||(Ku={}));var Yu;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Yu||(Yu={}));var Xu;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(Xu||(Xu={}));var Ju;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(Ju||(Ju={}));var zu;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(zu||(zu={}));var qu;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(qu||(qu={}));var Qu;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Qu||(Qu={}));var ed;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(ed||(ed={}));var td;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(td||(td={}));var rd;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(rd||(rd={}));var nd;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(nd||(nd={}));var id;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(id||(id={}));var sd;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(sd||(sd={}));var od;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(od||(od={}));var ad;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(ad||(ad={}));var cd;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(cd||(cd={}));var ld;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(ld||(ld={}));var ud;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(ud||(ud={}));var dd;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(dd||(dd={}));var hd;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(hd||(hd={}));const fd={readUnknownFields:!0};function Gb(e){return e?Object.assign(Object.assign({},fd),e):fd}function Hi(e,t,r){const n=Wt(e,void 0,!1);return gp(n,new Bc(t),Gb(r),!1,t.byteLength),n.message}function gp(e,t,r,n,i){var o;const l=n?t.len:t.pos+i;let s,a;const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];for(;t.pos<l&&([s,a]=t.tag(),!(n&&a==ht.EndGroup));){const g=e.findNumber(s);if(!g){const f=t.skip(a,s);r.readUnknownFields&&c.push({no:s,wireType:a,data:f});continue}mp(e,t,g,a,r)}if(n&&(a!=ht.EndGroup||s!==i))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function mp(e,t,r,n,i){var o;switch(r.fieldKind){case"scalar":e.set(r,Pn(t,r.scalar));break;case"enum":const l=Pn(t,ee.INT32);if(r.enum.open)e.set(r,l);else if(r.enum.values.some(a=>a.number===l))e.set(r,l);else if(i.readUnknownFields){const a=[];Ua(l,a);const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];c.push({no:r.number,wireType:n,data:new Uint8Array(a)}),e.setUnknown(c)}break;case"message":e.set(r,Pc(t,i,r,e.get(r)));break;case"list":Yb(t,n,e.get(r),i);break;case"map":Kb(t,e.get(r),i);break}}function Kb(e,t,r){const n=t.field();let i,o;const l=e.uint32(),s=e.pos+l;for(;e.pos<s;){const[a]=e.tag();switch(a){case 1:i=Pn(e,n.mapKey);break;case 2:switch(n.mapKind){case"scalar":o=Pn(e,n.scalar);break;case"enum":o=e.int32();break;case"message":o=Pc(e,r,n);break}break}}if(i===void 0&&(i=mn(n.mapKey,!1)),o===void 0)switch(n.mapKind){case"scalar":o=mn(n.scalar,!1);break;case"enum":o=n.enum.values[0].number;break;case"message":o=Wt(n.message,void 0,!1);break}t.set(i,o)}function Yb(e,t,r,n){var i;const o=r.field();if(o.listKind==="message"){r.add(Pc(e,n,o));return}const l=(i=o.scalar)!==null&&i!==void 0?i:ee.INT32;if(!(t==ht.LengthDelimited&&l!=ee.STRING&&l!=ee.BYTES)){r.add(Pn(e,l));return}const a=e.uint32()+e.pos;for(;e.pos<a;)r.add(Pn(e,l))}function Pc(e,t,r,n){const i=r.delimitedEncoding,o=n??Wt(r.message,void 0,!1);return gp(o,e,t,i,i?r.number:e.uint32()),o}function Pn(e,t){switch(t){case ee.STRING:return e.string();case ee.BOOL:return e.bool();case ee.DOUBLE:return e.double();case ee.FLOAT:return e.float();case ee.INT32:return e.int32();case ee.INT64:return e.int64();case ee.UINT64:return e.uint64();case ee.FIXED64:return e.fixed64();case ee.BYTES:return e.bytes();case ee.FIXED32:return e.fixed32();case ee.SFIXED32:return e.sfixed32();case ee.SFIXED64:return e.sfixed64();case ee.SINT64:return e.sint64();case ee.UINT32:return e.uint32();case ee.SINT32:return e.sint32()}}function rr(e,t){var r;const n=Hi(Zb,Ac(e));return n.messageType.forEach(kc),n.dependency=(r=t==null?void 0:t.map(o=>o.proto.name))!==null&&r!==void 0?r:[],Pf(n,o=>t==null?void 0:t.find(l=>l.proto.name===o)).getFile(n.name)}function Wc(e,t,...r){if(r.length>0)throw new Error;return e.services[t]}const Xb=rr("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),vp=rr("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Jb=Be(vp,0);function zb(e,t,r){let n=!1;return r||(r=Ze(Jb),n=!0),r.value=up(e,t),r.typeUrl=e_(t.$typeName),n?r:void 0}function qb(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,n=bp(e.typeUrl);return r===n}function Qb(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(bp(e.typeUrl));if(!(!r||!qb(e,r)))return Hi(r,e.value)}function e_(e){return`type.googleapis.com/${e}`}function bp(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const $c=rr("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),t_=Be($c,0),_p=Be($c,1),r_=Be($c,2);var ja;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(ja||(ja={}));const yp=rr("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),n_=rr("Ch9ydW5tZS9wYXJzZXIvdjEvZG9jcmVzdWx0LnByb3RvEg9ydW5tZS5wYXJzZXIudjEiTAoJRG9jUmVzdWx0Eg8KB2ZpbGVfaWQYASABKAkSEQoJZmlsZV9uYW1lGAIgASgJEg0KBXNjb3JlGAMgASgBEgwKBGxpbmsYBCABKAlCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3BhcnNlci92MTtwYXJzZXJ2MWIGcHJvdG8z"),qe=rr("ChxydW5tZS9wYXJzZXIvdjEvcGFyc2VyLnByb3RvEg9ydW5tZS5wYXJzZXIudjEizwEKCE5vdGVib29rEiQKBWNlbGxzGAEgAygLMhUucnVubWUucGFyc2VyLnYxLkNlbGwSOQoIbWV0YWRhdGEYAiADKAsyJy5ydW5tZS5wYXJzZXIudjEuTm90ZWJvb2suTWV0YWRhdGFFbnRyeRIxCgtmcm9udG1hdHRlchgDIAEoCzIcLnJ1bm1lLnBhcnNlci52MS5Gcm9udG1hdHRlchovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEieAoWRXhlY3V0aW9uU3VtbWFyeVRpbWluZxIvCgpzdGFydF90aW1lGAEgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSLQoIZW5kX3RpbWUYAiABKAsyGy5nb29nbGUucHJvdG9idWYuSW50NjRWYWx1ZSI6Cg5DZWxsT3V0cHV0SXRlbRIMCgRkYXRhGAEgASgMEgwKBHR5cGUYAiABKAkSDAoEbWltZRgDIAEoCSJRChVQcm9jZXNzSW5mb0V4aXRSZWFzb24SDAoEdHlwZRgBIAEoCRIqCgRjb2RlGAIgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlIn4KFUNlbGxPdXRwdXRQcm9jZXNzSW5mbxI7CgtleGl0X3JlYXNvbhgBIAEoCzImLnJ1bm1lLnBhcnNlci52MS5Qcm9jZXNzSW5mb0V4aXRSZWFzb24SKAoDcGlkGAIgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUi6AEKCkNlbGxPdXRwdXQSLgoFaXRlbXMYASADKAsyHy5ydW5tZS5wYXJzZXIudjEuQ2VsbE91dHB1dEl0ZW0SOwoIbWV0YWRhdGEYAiADKAsyKS5ydW5tZS5wYXJzZXIudjEuQ2VsbE91dHB1dC5NZXRhZGF0YUVudHJ5EjwKDHByb2Nlc3NfaW5mbxgDIAEoCzImLnJ1bm1lLnBhcnNlci52MS5DZWxsT3V0cHV0UHJvY2Vzc0luZm8aLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrMBChRDZWxsRXhlY3V0aW9uU3VtbWFyeRI1Cg9leGVjdXRpb25fb3JkZXIYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSKwoHc3VjY2VzcxgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSNwoGdGltaW5nGAMgASgLMicucnVubWUucGFyc2VyLnYxLkV4ZWN1dGlvblN1bW1hcnlUaW1pbmciJwoJVGV4dFJhbmdlEg0KBXN0YXJ0GAEgASgNEgsKA2VuZBgCIAEoDSLWAwoEQ2VsbBInCgRraW5kGAEgASgOMhkucnVubWUucGFyc2VyLnYxLkNlbGxLaW5kEg0KBXZhbHVlGAIgASgJEhMKC2xhbmd1YWdlX2lkGAMgASgJEjUKCG1ldGFkYXRhGAQgAygLMiMucnVubWUucGFyc2VyLnYxLkNlbGwuTWV0YWRhdGFFbnRyeRIuCgp0ZXh0X3JhbmdlGAUgASgLMhoucnVubWUucGFyc2VyLnYxLlRleHRSYW5nZRIsCgdvdXRwdXRzGAYgAygLMhsucnVubWUucGFyc2VyLnYxLkNlbGxPdXRwdXQSQAoRZXhlY3V0aW9uX3N1bW1hcnkYByABKAsyJS5ydW5tZS5wYXJzZXIudjEuQ2VsbEV4ZWN1dGlvblN1bW1hcnkSDgoGcmVmX2lkGGQgASgJEicKBHJvbGUYZSABKA4yGS5ydW5tZS5wYXJzZXIudjEuQ2VsbFJvbGUSDwoHY2FsbF9pZBhmIAEoCRIvCgtkb2NfcmVzdWx0cxhnIAMoCzIaLnJ1bm1lLnBhcnNlci52MS5Eb2NSZXN1bHQaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIi0KFFJ1bm1lU2Vzc2lvbkRvY3VtZW50EhUKDXJlbGF0aXZlX3BhdGgYASABKAkiUwoMUnVubWVTZXNzaW9uEgoKAmlkGAEgASgJEjcKCGRvY3VtZW50GAIgASgLMiUucnVubWUucGFyc2VyLnYxLlJ1bm1lU2Vzc2lvbkRvY3VtZW50Il8KEEZyb250bWF0dGVyUnVubWUSCgoCaWQYASABKAkSDwoHdmVyc2lvbhgCIAEoCRIuCgdzZXNzaW9uGAMgASgLMh0ucnVubWUucGFyc2VyLnYxLlJ1bm1lU2Vzc2lvbiKnAQoLRnJvbnRtYXR0ZXISDQoFc2hlbGwYASABKAkSCwoDY3dkGAIgASgJEhQKDHNraXBfcHJvbXB0cxgDIAEoCBIwCgVydW5tZRgEIAEoCzIhLnJ1bm1lLnBhcnNlci52MS5Gcm9udG1hdHRlclJ1bm1lEhAKCGNhdGVnb3J5GAUgASgJEhUKDXRlcm1pbmFsX3Jvd3MYBiABKAkSCwoDdGFnGAcgASgJIk0KGURlc2VyaWFsaXplUmVxdWVzdE9wdGlvbnMSMAoIaWRlbnRpdHkYASABKA4yHi5ydW5tZS5wYXJzZXIudjEuUnVubWVJZGVudGl0eSJhChJEZXNlcmlhbGl6ZVJlcXVlc3QSDgoGc291cmNlGAEgASgMEjsKB29wdGlvbnMYAiABKAsyKi5ydW5tZS5wYXJzZXIudjEuRGVzZXJpYWxpemVSZXF1ZXN0T3B0aW9ucyJCChNEZXNlcmlhbGl6ZVJlc3BvbnNlEisKCG5vdGVib29rGAEgASgLMhkucnVubWUucGFyc2VyLnYxLk5vdGVib29rIlIKHVNlcmlhbGl6ZVJlcXVlc3RPdXRwdXRPcHRpb25zEg8KB2VuYWJsZWQYASABKAgSDwoHc3VtbWFyeRgCIAEoCBIPCgdwcm9maWxlGAMgASgJIooBChdTZXJpYWxpemVSZXF1ZXN0T3B0aW9ucxI/CgdvdXRwdXRzGAEgASgLMi4ucnVubWUucGFyc2VyLnYxLlNlcmlhbGl6ZVJlcXVlc3RPdXRwdXRPcHRpb25zEi4KB3Nlc3Npb24YAiABKAsyHS5ydW5tZS5wYXJzZXIudjEuUnVubWVTZXNzaW9uInoKEFNlcmlhbGl6ZVJlcXVlc3QSKwoIbm90ZWJvb2sYASABKAsyGS5ydW5tZS5wYXJzZXIudjEuTm90ZWJvb2sSOQoHb3B0aW9ucxgCIAEoCzIoLnJ1bm1lLnBhcnNlci52MS5TZXJpYWxpemVSZXF1ZXN0T3B0aW9ucyIjChFTZXJpYWxpemVSZXNwb25zZRIOCgZyZXN1bHQYASABKAwqfgoIQ2VsbEtpbmQSGQoVQ0VMTF9LSU5EX1VOU1BFQ0lGSUVEEAASFAoQQ0VMTF9LSU5EX01BUktVUBABEhIKDkNFTExfS0lORF9DT0RFEAISGQoVQ0VMTF9LSU5EX0RPQ19SRVNVTFRTEAMSEgoOQ0VMTF9LSU5EX1RPT0wQBCpSCghDZWxsUm9sZRIZChVDRUxMX1JPTEVfVU5TUEVDSUZJRUQQABISCg5DRUxMX1JPTEVfVVNFUhABEhcKE0NFTExfUk9MRV9BU1NJU1RBTlQQAip9Cg1SdW5tZUlkZW50aXR5Eh4KGlJVTk1FX0lERU5USVRZX1VOU1BFQ0lGSUVEEAASFgoSUlVOTUVfSURFTlRJVFlfQUxMEAESGwoXUlVOTUVfSURFTlRJVFlfRE9DVU1FTlQQAhIXChNSVU5NRV9JREVOVElUWV9DRUxMEAMywQEKDVBhcnNlclNlcnZpY2USWgoLRGVzZXJpYWxpemUSIy5ydW5tZS5wYXJzZXIudjEuRGVzZXJpYWxpemVSZXF1ZXN0GiQucnVubWUucGFyc2VyLnYxLkRlc2VyaWFsaXplUmVzcG9uc2UiABJUCglTZXJpYWxpemUSIS5ydW5tZS5wYXJzZXIudjEuU2VyaWFsaXplUmVxdWVzdBoiLnJ1bm1lLnBhcnNlci52MS5TZXJpYWxpemVSZXNwb25zZSIAQkhaRmdpdGh1Yi5jb20vcnVubWVkZXYvcnVubWUvdjMvYXBpL2dlbi9wcm90by9nby9ydW5tZS9wYXJzZXIvdjE7cGFyc2VydjFiBnByb3RvMw",[yp,n_]),Gs=Be(qe,0),Hc=Be(qe,1),Ai=Be(qe,2),jc=Be(qe,3),Zc=Be(qe,4),go=Be(qe,5),Gc=Be(qe,6),Sp=Be(qe,7),pn=Be(qe,8),wp=Be(qe,9),Kc=Be(qe,10),Ep=Be(qe,11),Cp=Be(qe,12),kp=Be(qe,13),Ip=Be(qe,14),Ap=Be(qe,15),Yc=Be(qe,16),Xc=Be(qe,17),Jc=Be(qe,18),xp=Be(qe,19),zc=Xt(qe,0),it=Jt(zc),qc=Xt(qe,1),Kt=Jt(qc),Qc=Xt(qe,2),Rp=Jt(Qc),el=Wc(qe,0),i_=Object.freeze(Object.defineProperty({__proto__:null,CellExecutionSummarySchema:Gc,CellKind:it,CellKindSchema:zc,CellOutputItemSchema:Ai,CellOutputProcessInfoSchema:Zc,CellOutputSchema:go,CellRole:Kt,CellRoleSchema:qc,CellSchema:pn,DeserializeRequestOptionsSchema:kp,DeserializeRequestSchema:Ip,DeserializeResponseSchema:Ap,ExecutionSummaryTimingSchema:Hc,FrontmatterRunmeSchema:Ep,FrontmatterSchema:Cp,NotebookSchema:Gs,ParserService:el,ProcessInfoExitReasonSchema:jc,RunmeIdentity:Rp,RunmeIdentitySchema:Qc,RunmeSessionDocumentSchema:wp,RunmeSessionSchema:Kc,SerializeRequestOptionsSchema:Xc,SerializeRequestOutputOptionsSchema:Yc,SerializeRequestSchema:Jc,SerializeResponseSchema:xp,TextRangeSchema:Sp,file_runme_parser_v1_parser:qe},Symbol.toStringTag,{value:"Module"})),Np=rr("ChZhZ2VudC92MS9zZXJ2aWNlLnByb3RvEghhZ2VudC52MSJyCg9HZW5lcmF0ZVJlcXVlc3QSJAoFY2VsbHMYASADKAsyFS5ydW5tZS5wYXJzZXIudjEuQ2VsbBIcChRwcmV2aW91c19yZXNwb25zZV9pZBgCIAEoCRIbChNvcGVuYWlfYWNjZXNzX3Rva2VuGAMgASgJIk0KEEdlbmVyYXRlUmVzcG9uc2USJAoFY2VsbHMYASADKAsyFS5ydW5tZS5wYXJzZXIudjEuQ2VsbBITCgtyZXNwb25zZV9pZBgCIAEoCSI5CgpMb2dSZXF1ZXN0EisKCG5vdGVib29rGAEgASgLMhkucnVubWUucGFyc2VyLnYxLk5vdGVib29rIg0KC0xvZ1Jlc3BvbnNlMlgKD01lc3NhZ2VzU2VydmljZRJFCghHZW5lcmF0ZRIZLmFnZW50LnYxLkdlbmVyYXRlUmVxdWVzdBoaLmFnZW50LnYxLkdlbmVyYXRlUmVzcG9uc2UiADABMkIKCkxvZ1NlcnZpY2USNAoDTG9nEhQuYWdlbnQudjEuTG9nUmVxdWVzdBoVLmFnZW50LnYxLkxvZ1Jlc3BvbnNlIgBCQFo+Z2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL2FnZW50L3YxO2FnZW50djFiBnByb3RvMw",[qe]),s_=Be(Np,0),o_=Wc(Np,0);function a_(e,t){Tp(t,e);const r=l_(e.$unknown,t),[n,i,o]=mo(t);for(const l of r)mp(n,new Bc(l.data),i,l.wireType,{readUnknownFields:!0});return o()}function c_(e,t,r){var n;Tp(t,e);const i=((n=e.$unknown)!==null&&n!==void 0?n:[]).filter(c=>c.no!==t.number),[o,l]=mo(t,r),s=new qf;dp(s,{writeUnknownFields:!0},o,l);const a=new Bc(s.finish());for(;a.pos<a.len;){const[c,g]=a.tag(),f=a.skip(g,c);i.push({no:c,wireType:g,data:f})}e.$unknown=i}function l_(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function mo(e,t){const r=e.typeName,n=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),i=Object.assign(Object.assign({},e.extendee),{fields:[n],members:[n],oneofs:[]}),o=Ze(i,t!==void 0?{[r]:t}:void 0);return[Wt(i,o),n,()=>{const l=o[r];if(l===void 0){const s=e.message;return $i(s)?mn(s.fields[0].scalar,s.fields[0].longAsString):Ze(s)}return l}]}function Tp(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const u_=3,d_=2,pd={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function h_(e){return e?Object.assign(Object.assign({},pd),e):pd}function f_(e,t,r){return ji(Wt(e,t),h_(r))}function p_(e,t,r){var n;const i=f_(e,t,r);return JSON.stringify(i,null,(n=r==null?void 0:r.prettySpaces)!==null&&n!==void 0?n:0)}function ji(e,t){var r;const n=b_(e,t);if(n!==void 0)return n;const i={};for(const o of e.sortedFields){if(!e.isSet(o)){if(o.presence==u_)throw new Error(`cannot encode ${o} to JSON: required field not set`);if(!t.alwaysEmitImplicit||o.presence!==d_)continue}const l=gd(o,e.get(o),t);l!==void 0&&(i[v_(o,t)]=l)}if(t.registry){const o=new Set;for(const{no:l}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!o.has(l)){o.add(l);const s=t.registry.getExtensionFor(e.desc,l);if(!s)continue;const a=a_(e.message,s),[c,g]=mo(s,a),f=gd(g,c.get(g),t);f!==void 0&&(i[s.jsonName]=f)}}return i}function gd(e,t,r){switch(e.fieldKind){case"scalar":return vo(e,t);case"message":return ji(t,r);case"enum":return tl(e.enum,t,r.enumAsInteger);case"list":return m_(t,r);case"map":return g_(t,r)}}function g_(e,t){const r=e.field(),n={};switch(r.mapKind){case"scalar":for(const[i,o]of e)n[i]=vo(r,o);break;case"message":for(const[i,o]of e)n[i]=ji(o,t);break;case"enum":for(const[i,o]of e)n[i]=tl(r.enum,o,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?n:void 0}function m_(e,t){const r=e.field(),n=[];switch(r.listKind){case"scalar":for(const i of e)n.push(vo(r,i));break;case"enum":for(const i of e)n.push(tl(r.enum,i,t.enumAsInteger));break;case"message":for(const i of e)n.push(ji(i,t));break}return t.alwaysEmitImplicit||n.length>0?n:void 0}function tl(e,t,r){var n;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${St(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const i=e.value[t];return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:t}function vo(e,t){var r,n,i,o,l,s;switch(e.scalar){case ee.INT32:case ee.SFIXED32:case ee.SINT32:case ee.FIXED32:case ee.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=on(e,t))===null||r===void 0?void 0:r.message}`);return t;case ee.FLOAT:case ee.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(n=on(e,t))===null||n===void 0?void 0:n.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case ee.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(i=on(e,t))===null||i===void 0?void 0:i.message}`);return t;case ee.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(o=on(e,t))===null||o===void 0?void 0:o.message}`);return t;case ee.UINT64:case ee.FIXED64:case ee.INT64:case ee.SFIXED64:case ee.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(l=on(e,t))===null||l===void 0?void 0:l.message}`);return t.toString();case ee.BYTES:if(t instanceof Uint8Array)return _b(t);throw new Error(`cannot encode ${e} to JSON: ${(s=on(e,t))===null||s===void 0?void 0:s.message}`)}}function v_(e,t){return t.useProtoFieldName?e.name:e.jsonName}function b_(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return __(e.message,t);case"google.protobuf.Timestamp":return w_(e.message);case"google.protobuf.Duration":return y_(e.message);case"google.protobuf.FieldMask":return S_(e.message);case"google.protobuf.Struct":return Bp(e.message);case"google.protobuf.Value":return rl(e.message);case"google.protobuf.ListValue":return Lp(e.message);default:if($i(e.desc)){const r=e.desc.fields[0];return vo(r,e.get(r))}return}}function __(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let n,i;if(r&&(n=Qb(e,r),n&&(i=r.getMessage(n.$typeName))),!i||!n)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let o=ji(Wt(i,n),t);return(i.typeName.startsWith("google.protobuf.")||o===null||Array.isArray(o)||typeof o!="object")&&(o={value:o}),o["@type"]=e.typeUrl,o}function y_(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function S_(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Ei(t)}).join(",")}function Bp(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=rl(n);return t}function rl(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return Bp(e.kind.value);case"listValue":return Lp(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function Lp(e){return e.values.map(rl)}function w_(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const n=(e.nanos+1e9).toString().substring(1);n.substring(3)==="000000"?r="."+n.substring(0,3)+"Z":n.substring(6)==="000"?r="."+n.substring(0,6)+"Z":r="."+n+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const md={ignoreUnknownFields:!1};function E_(e){return e?Object.assign(Object.assign({},md),e):md}function C_(e,t,r){return Op(e,T_(t,e.typeName),r)}function Op(e,t,r){const n=Wt(e);try{Wn(n,t,E_(r))}catch(i){throw wb(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return n.message}function Wn(e,t,r){var n;if(B_(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${St(t)}`);const i=new Map,o=new Map;for(const l of e.desc.fields)o.set(l.name,l).set(l.jsonName,l);for(const[l,s]of Object.entries(t)){const a=o.get(l);if(a){if(a.oneof){if(s===null&&a.fieldKind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Ut(a.oneof,`oneof set multiple times by ${c.name} and ${a.name}`);i.set(a.oneof,a)}vd(e,a,s,r)}else{let c;if(l.startsWith("[")&&l.endsWith("]")&&(c=(n=r.registry)===null||n===void 0?void 0:n.getExtension(l.substring(1,l.length-1)))&&c.extendee.typeName===e.desc.typeName){const[g,f,b]=mo(c);vd(g,f,s,r),c_(e.message,c,b())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${l}" is unknown`)}}}function vd(e,t,r,n){switch(t.fieldKind){case"scalar":R_(e,t,r);break;case"enum":x_(e,t,r,n);break;case"message":A_(e,t,r,n);break;case"list":I_(e.get(t),r,n);break;case"map":k_(e.get(t),r,n);break}}function k_(e,t,r){if(t===null)return;const n=e.field();if(typeof t!="object"||Array.isArray(t))throw new Ut(n,"expected object, got "+St(t));for(const[i,o]of Object.entries(t)){if(o===null)throw new Ut(n,"map value must not be null");let l;switch(n.mapKind){case"message":const a=Wt(n.message);Wn(a,o,r),l=a;break;case"enum":if(l=nl(n.enum,o,r.ignoreUnknownFields,!0),l===bo)return;break;case"scalar":l=yo(n,o,!0);break}const s=N_(n.mapKey,i);e.set(s,l)}}function I_(e,t,r){if(t===null)return;const n=e.field();if(!Array.isArray(t))throw new Ut(n,"expected Array, got "+St(t));for(const i of t){if(i===null)throw new Ut(n,"list item must not be null");switch(n.listKind){case"message":const o=Wt(n.message);Wn(o,i,r),e.add(o);break;case"enum":const l=nl(n.enum,i,r.ignoreUnknownFields,!0);l!==bo&&e.add(l);break;case"scalar":e.add(yo(n,i,!0));break}}}function A_(e,t,r,n){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const i=e.isSet(t)?e.get(t):Wt(t.message);Wn(i,r,n),e.set(t,i)}function x_(e,t,r,n){const i=nl(t.enum,r,n.ignoreUnknownFields,!1);i===_o?e.clear(t):i!==bo&&e.set(t,i)}function R_(e,t,r){const n=yo(t,r,!1);n===_o?e.clear(t):e.set(t,n)}const bo=Symbol();function nl(e,t,r,n){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:n?e.values[0].number:_o;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=e.values.find(o=>o.name===t);if(i!==void 0)return i.number;if(r)return bo;break}throw new Error(`cannot decode ${e} from JSON: ${St(t)}`)}const _o=Symbol();function yo(e,t,r){if(t===null)return r?mn(e.scalar,!1):_o;switch(e.scalar){case ee.DOUBLE:case ee.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Ut(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Ut(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const n=Number(t);if(!Number.isFinite(n))break;return n}break;case ee.INT32:case ee.FIXED32:case ee.SFIXED32:case ee.SINT32:case ee.UINT32:return Dp(t);case ee.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return Ac(t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Ut(e,i)}}break}return t}function N_(e,t){switch(e){case ee.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case ee.INT32:case ee.FIXED32:case ee.UINT32:case ee.SFIXED32:case ee.SINT32:return Dp(t);default:return t}}function Dp(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function T_(e,t){try{return JSON.parse(e)}catch(r){const n=r instanceof Error?r.message:String(r);throw new Error(`cannot decode message ${t} from JSON: ${n}`,{cause:r})}}function B_(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return L_(e.message,t,r),!0;case"google.protobuf.Timestamp":return O_(e.message,t),!0;case"google.protobuf.Duration":return D_(e.message,t),!0;case"google.protobuf.FieldMask":return F_(e.message,t),!0;case"google.protobuf.Struct":return Fp(e.message,t),!0;case"google.protobuf.Value":return il(e.message,t),!0;case"google.protobuf.ListValue":return Vp(e.message,t),!0;default:if($i(e.desc)){const n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,yo(n,t,!0)),!0}return!1}}function L_(e,t,r){var n;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${St(t)}`);if(Object.keys(t).length==0)return;const i=t["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const o=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!o.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const l=(n=r.registry)===null||n===void 0?void 0:n.getMessage(o);if(!l)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${i} is not in the type registry`);const s=Wt(l);if(o.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const a=t.value;Wn(s,a,r)}else{const a=Object.assign({},t);delete a["@type"],Wn(s,a,r)}zb(s.desc,s.message,e)}function O_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const n=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(n))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=st.parse(n/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function D_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const n=Number(r[1]);if(n>315576e6||n<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);if(e.seconds=st.parse(n),typeof r[2]!="string")return;const i=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(i),(n<0||Object.is(n,-0))&&(e.nanos=-e.nanos)}function F_(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);if(t==="")return;function r(n){if(n.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const i=n.replace(/[A-Z]/g,o=>"_"+o.toLowerCase());return i[0]==="_"?i.substring(1):i}e.paths=t.split(",").map(r)}function Fp(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`);for(const[r,n]of Object.entries(t)){const i=Ze(_p);il(i,n),e.fields[r]=i}}function il(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:ja.NULL_VALUE};else if(Array.isArray(t)){const r=Ze(r_);Vp(r,t),e.kind={case:"listValue",value:r}}else{const r=Ze(t_);Fp(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`)}return e}function Vp(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`);for(const r of t){const n=Ze(_p);il(n,r),e.values.push(n)}}const Ct=[];for(let e=0;e<256;++e)Ct.push((e+256).toString(16).slice(1));function V_(e,t=0){return(Ct[e[t+0]]+Ct[e[t+1]]+Ct[e[t+2]]+Ct[e[t+3]]+"-"+Ct[e[t+4]]+Ct[e[t+5]]+"-"+Ct[e[t+6]]+Ct[e[t+7]]+"-"+Ct[e[t+8]]+Ct[e[t+9]]+"-"+Ct[e[t+10]]+Ct[e[t+11]]+Ct[e[t+12]]+Ct[e[t+13]]+Ct[e[t+14]]+Ct[e[t+15]]).toLowerCase()}let ba;const M_=new Uint8Array(16);function U_(){if(!ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ba=crypto.getRandomValues.bind(crypto)}return ba(M_)}const P_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bd={randomUUID:P_};function _d(e,t,r){var i;if(bd.randomUUID&&!e)return bd.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??U_();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,V_(n)}const W_=rr("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),We=rr("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QihwIKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCRIxCgNwd2QYByABKAsyJC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlLlB3ZBooCgNQd2QSDwoHY3VycmVudBgBIAEoCRIQCghwcmV2aW91cxgCIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[yp,W_]),Mp=Be(We,0),$_=Be(We,1),H_=Be(We,2),j_=Be(We,2,0),Up=Xt(We,2,0,0),Pp=Jt(Up),Z_=Be(We,3),Wp=Be(We,4),G_=Be(We,5),K_=Be(We,6),Y_=Be(We,7),X_=Be(We,8),J_=Be(We,9),z_=Be(We,10),q_=Be(We,11),Q_=Be(We,12),e1=Be(We,13),t1=Be(We,14),r1=Be(We,14,0),n1=Be(We,15),i1=Be(We,16),$p=Xt(We,16,0),s1=Jt($p),Hp=Xt(We,16,1),o1=Jt(Hp),a1=Be(We,17),c1=Be(We,17,0),jp=Xt(We,17,0),l1=Jt(jp),u1=Be(We,18),d1=Be(We,19),h1=Be(We,19,0),f1=Be(We,19,1),Zp=Xt(We,19,0),p1=Jt(Zp),g1=Be(We,20),Gp=Xt(We,0),m1=Jt(Gp),Kp=Xt(We,1),v1=Jt(Kp),Yp=Xt(We,2),b1=Jt(Yp),Xp=Xt(We,3),_1=Jt(Xp),Jp=Wc(We,0),y1=Object.freeze(Object.defineProperty({__proto__:null,CreateSessionRequestSchema:H_,CreateSessionRequest_ConfigSchema:j_,CreateSessionRequest_Config_SessionEnvStoreSeeding:Pp,CreateSessionRequest_Config_SessionEnvStoreSeedingSchema:Up,CreateSessionResponseSchema:Z_,DeleteSessionRequestSchema:z_,DeleteSessionResponseSchema:q_,ExecuteRequestSchema:e1,ExecuteResponseSchema:t1,ExecuteResponse_PwdSchema:r1,ExecuteStop:v1,ExecuteStopSchema:Kp,GetSessionRequestSchema:Wp,GetSessionResponseSchema:G_,ListSessionsRequestSchema:K_,ListSessionsResponseSchema:Y_,MonitorEnvStoreRequestSchema:u1,MonitorEnvStoreResponseSchema:g1,MonitorEnvStoreResponseSnapshotSchema:d1,MonitorEnvStoreResponseSnapshot_ErrorSchema:f1,MonitorEnvStoreResponseSnapshot_SnapshotEnvSchema:h1,MonitorEnvStoreResponseSnapshot_Status:p1,MonitorEnvStoreResponseSnapshot_StatusSchema:Zp,MonitorEnvStoreType:_1,MonitorEnvStoreTypeSchema:Xp,ProjectSchema:Mp,ResolveProgramCommandListSchema:n1,ResolveProgramRequestSchema:i1,ResolveProgramRequest_Mode:s1,ResolveProgramRequest_ModeSchema:$p,ResolveProgramRequest_Retention:o1,ResolveProgramRequest_RetentionSchema:Hp,ResolveProgramResponseSchema:a1,ResolveProgramResponse_Status:l1,ResolveProgramResponse_StatusSchema:jp,ResolveProgramResponse_VarResultSchema:c1,RunnerService:Jp,SessionEnvStoreType:m1,SessionEnvStoreTypeSchema:Gp,SessionSchema:$_,SessionStrategy:b1,SessionStrategySchema:Yp,UpdateSessionRequestSchema:X_,UpdateSessionResponseSchema:J_,WinsizeSchema:Q_,file_runme_runner_v2_runner:We},Symbol.toStringTag,{value:"Module"}));var He;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(He||(He={}));function yd(e){const t=He[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,r=>"_"+r.toLowerCase())}class Je extends Error{constructor(t,r=He.Unknown,n,i,o){super(S1(t,r)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=r,this.metadata=new Headers(n??{}),this.details=i??[],this.cause=o}static from(t,r=He.Unknown){return t instanceof Je?t:t instanceof Error?t.name=="AbortError"||t.name=="TimeoutError"?new Je(t.message,He.Canceled):new Je(t.message,r,void 0,void 0,t):new Je(String(t),r,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===Je.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){const r=t.kind==="message"?{getMessage:i=>i===t.typeName?t:void 0}:t,n=[];for(const i of this.details){if("desc"in i){r.getMessage(i.desc.typeName)&&n.push(Ze(i.desc,i.value));continue}const o=r.getMessage(i.type);if(o)try{n.push(Hi(o,i.value))}catch{}}return n}}function S1(e,t){return e.length?`[${yd(t)}] ${e}`:`[${yd(t)}]`}function w1(e,t,r){try{const n=Ac(e);return t?Hi(t,n,r):n}catch(n){throw Je.from(n,He.DataLoss)}}function E1(e,t){const r={};for(const n of e.methods){const i=t(n);i!=null&&(r[n.localName]=i)}return r}const Sd=1;function C1(e,t,r=!1){if(t>e){let n=`message size is larger than configured readMaxBytes ${e}`;throw r&&(n=`message size ${t} is larger than configured readMaxBytes ${e}`),new Je(n,He.ResourceExhausted)}}function k1(e){return new I1(e)}class I1{constructor(t){this.readMaxBytes=t,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((t,r)=>t+r.byteLength,0)}decode(t){this.buf.push(t);const r=[];for(;;){let n=this.pop();if(!n)break;r.push(n)}return r}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){const t=this.env;return this.env=void 0,t}}head(){if(!this.cons(this.header))return;const t=this.headerView.getUint8(0),r=this.headerView.getUint32(1);return C1(this.readMaxBytes,r,!0),{flags:t,data:new Uint8Array(r)}}cons(t){const r=t.byteLength;if(this.byteLength<r)return!1;let n=0;for(;n<r;){const i=this.buf.shift();i.byteLength>r-n?(t.set(i.subarray(0,r-n),n),this.buf.unshift(i.subarray(r-n)),n+=r-n):(t.set(i,n),n+=i.byteLength)}return!0}}function wd(e){let t;const r=k1(4294967295);return new ReadableStream({start(){t=e.getReader()},async pull(n){let i=!1;for(;!i;){const o=await t.read();if(o.done)r.byteLength>0&&n.error(new Je("protocol error: incomplete envelope",He.InvalidArgument)),n.close();else for(const l of r.decode(o.value))n.enqueue(l),i=!0}}})}function Ed(e,t){const r=new Uint8Array(t.length+5);r.set(t,5);const n=new DataView(r.buffer,r.byteOffset,r.byteLength);return n.setUint8(0,e),n.setUint32(1,t.length),r}var A1=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(l){return new Promise(function(s,a){l=e[o](l),i(s,a,l.done,l.value)})}}function i(o,l,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},l)}},xi=function(e){return this instanceof xi?(this.v=e,this):new xi(e)},x1=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",l),i[Symbol.asyncIterator]=function(){return this},i;function l(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof xi?Promise.resolve(_.value.v).then(g,f):b(o[0][2],_)}function g(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}},R1=function(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(l){return(r=!r)?{value:xi(e[i](l)),done:!1}:o?o(l):l}:o}};function N1(e){return x1(this,arguments,function*(){yield xi(yield*R1(A1(e)))})}var zp=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(l){return new Promise(function(s,a){l=e[o](l),i(s,a,l.done,l.value)})}}function i(o,l,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},l)}},$n=function(e){return this instanceof $n?(this.v=e,this):new $n(e)},T1=function(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(l){return(r=!r)?{value:$n(e[i](l)),done:!1}:o?o(l):l}:o}},B1=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",l),i[Symbol.asyncIterator]=function(){return this},i;function l(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof $n?Promise.resolve(_.value.v).then(g,f):b(o[0][2],_)}function g(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}};function qp(e,t){return E1(e,r=>{switch(r.methodKind){case"unary":return L1(t,r);case"server_streaming":return O1(t,r);case"client_streaming":return D1(t,r);case"bidi_streaming":return F1(t,r);default:return null}})}function L1(e,t){return async(r,n)=>{var i,o;const l=await e.unary(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues);return(i=n==null?void 0:n.onHeader)===null||i===void 0||i.call(n,l.header),(o=n==null?void 0:n.onTrailer)===null||o===void 0||o.call(n,l.trailer),l.message}}function O1(e,t){return(r,n)=>Qp(e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,N1([r]),n==null?void 0:n.contextValues),n)}function D1(e,t){return async(r,n)=>{var i,o,l,s,a,c;const g=await e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues);(a=n==null?void 0:n.onHeader)===null||a===void 0||a.call(n,g.header);let f,b=0;try{for(var _=!0,k=zp(g.message),y;y=await k.next(),i=y.done,!i;_=!0)s=y.value,_=!1,f=s,b++}catch(d){o={error:d}}finally{try{!_&&!i&&(l=k.return)&&await l.call(k)}finally{if(o)throw o.error}}if(!f)throw new Je("protocol error: missing response message",He.Unimplemented);if(b>1)throw new Je("protocol error: received extra messages for client streaming method",He.Unimplemented);return(c=n==null?void 0:n.onTrailer)===null||c===void 0||c.call(n,g.trailer),f}}function F1(e,t){return(r,n)=>Qp(e.stream(t,n==null?void 0:n.signal,n==null?void 0:n.timeoutMs,n==null?void 0:n.headers,r,n==null?void 0:n.contextValues),n)}function Qp(e,t){const r=(function(){return B1(this,arguments,function*(){var n,i;const o=yield $n(e);(n=t==null?void 0:t.onHeader)===null||n===void 0||n.call(t,o.header),yield $n(yield*T1(zp(o.message))),(i=t==null?void 0:t.onTrailer)===null||i===void 0||i.call(t,o.trailer)})})()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>r.next()})}}function V1(...e){const t=new AbortController,r=e.filter(i=>i!==void 0).concat(t.signal);for(const i of r){if(i.aborted){n.apply(i);break}i.addEventListener("abort",n)}function n(){t.signal.aborted||t.abort(eg(this));for(const i of r)i.removeEventListener("abort",n)}return t}function M1(e){const t=new AbortController,r=()=>{t.abort(new Je("the operation timed out",He.DeadlineExceeded))};let n;return e!==void 0&&(e<=0?r():n=setTimeout(r,e)),{signal:t.signal,cleanup:()=>clearTimeout(n)}}function eg(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function Cd(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}const _a=128;function kd(e){const t=new Headers,r=new TextDecoder().decode(e).split(`\r
|
|
3
|
+
`);for(const n of r){if(n==="")continue;const i=n.indexOf(":");if(i>0){const o=n.substring(0,i).trim(),l=n.substring(i+1).trim();t.append(o,l)}}return t}const U1="Content-Type",P1="Grpc-Timeout",Hn="Grpc-Status",tg="Grpc-Message",W1="Grpc-Status-Details-Bin",$1="User-Agent",Id="X-User-Agent",H1="X-Grpc-Web",j1="application/grpc-web+proto",Z1="application/grpc-web+json",G1=rr("CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z",[vp]),K1=Be(G1,0),Y1="0";function rg(e){var t;const r=e.get(W1);if(r!=null){const i=w1(r,K1);if(i.code==0)return;const o=new Je(i.message,i.code,e);return o.details=i.details.map(l=>({type:l.typeUrl.substring(l.typeUrl.lastIndexOf("/")+1),value:l.value})),o}const n=e.get(Hn);if(n!=null){if(n===Y1)return;const i=parseInt(n,10);return i in He?new Je(decodeURIComponent((t=e.get(tg))!==null&&t!==void 0?t:""),i,e):new Je(`invalid grpc-status: ${n}`,He.Internal,e)}}function Ad(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function ng(e,t){return Ze(e,t)}function X1(e,t){function r(n){return n.done===!0?n:{done:n.done,value:ng(e,n.value)}}return{[Symbol.asyncIterator](){const n=t[Symbol.asyncIterator](),i={next:()=>n.next().then(r)};return n.throw!==void 0&&(i.throw=o=>n.throw(o).then(r)),n.return!==void 0&&(i.return=o=>n.return(o).then(r)),i}}}function ig(e,t){if(!t)return e;for(const r of t.concat().reverse())e=r(e);return e}function J1(e){var t;const r=Object.assign({},e);return(t=r.ignoreUnknownFields)!==null&&t!==void 0||(r.ignoreUnknownFields=!0),r}function xd(e,t,r,n){const i=t?Rd(e.input,n):Nd(e.input,r);return{parse:(t?Rd(e.output,n):Nd(e.output,r)).parse,serialize:i.serialize}}function Rd(e,t){return{parse(r){try{return Hi(e,r,t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Je(`parse binary: ${i}`,He.Internal)}},serialize(r){try{return up(e,r,t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Je(`serialize binary: ${i}`,He.Internal)}}}}function Nd(e,t){var r,n;const i=(r=t==null?void 0:t.textEncoder)!==null&&r!==void 0?r:new TextEncoder,o=(n=t==null?void 0:t.textDecoder)!==null&&n!==void 0?n:new TextDecoder,l=J1(t);return{parse(s){try{const a=o.decode(s);return C_(e,a,l)}catch(a){throw Je.from(a,He.InvalidArgument)}},serialize(s){try{const a=p_(e,s,l);return i.encode(a)}catch(a){throw Je.from(a,He.Internal)}}}}function z1(e){const t=ig(e.next,e.interceptors),[r,n,i]=sg(e),o=Object.assign(Object.assign({},e.req),{message:ng(e.req.method.input,e.req.message),signal:r});return t(o).then(l=>(i(),l),n)}function q1(e){const t=ig(e.next,e.interceptors),[r,n,i]=sg(e),o=Object.assign(Object.assign({},e.req),{message:X1(e.req.method.input,e.req.message),signal:r});let l=!1;return r.addEventListener("abort",function(){var s,a;const c=e.req.message[Symbol.asyncIterator]();l||(s=c.throw)===null||s===void 0||s.call(c,this.reason).catch(()=>{}),(a=c.return)===null||a===void 0||a.call(c).catch(()=>{})}),t(o).then(s=>Object.assign(Object.assign({},s),{message:{[Symbol.asyncIterator](){const a=s.message[Symbol.asyncIterator]();return{next(){return a.next().then(c=>(c.done==!0&&(l=!0,i()),c),n)}}}}}),n)}function sg(e){const{signal:t,cleanup:r}=M1(e.timeoutMs),n=V1(e.signal,t);return[n.signal,function(o){const l=Je.from(t.aborted?eg(t):o);return n.abort(l),r(),Promise.reject(l)},function(){r(),n.abort()}]}function Q1(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function Td(e,t){const r=rg(e);if(r)throw t.forEach((n,i)=>{r.metadata.append(i,n)}),r;if(!t.has(Hn)&&!e.has(Hn))throw new Je("protocol error: missing status",He.Internal)}function Bd(e,t,r,n){var i,o;const l=new Headers(r??{});l.set(U1,e?j1:Z1),l.set(H1,"1");const s=(o=(i=l.get($1))!==null&&i!==void 0?i:l.get(Id))!==null&&o!==void 0?o:"connect-es/2.1.0";return l.set(Id,s),t!==void 0&&l.set(P1,`${t}m`),l}function ey(e){switch(e){case 400:return He.Internal;case 401:return He.Unauthenticated;case 403:return He.PermissionDenied;case 404:return He.Unimplemented;case 429:return He.Unavailable;case 502:return He.Unavailable;case 503:return He.Unavailable;case 504:return He.Unavailable;default:return He.Unknown}}function Ld(e,t){var r;if(e>=200&&e<300)return{foundStatus:t.has(Hn),headerError:rg(t)};throw new Je(decodeURIComponent((r=t.get(tg))!==null&&r!==void 0?r:`HTTP ${e}`),ey(e),t)}var cn=function(e){return this instanceof cn?(this.v=e,this):new cn(e)},ty=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",l),i[Symbol.asyncIterator]=function(){return this},i;function l(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof cn?Promise.resolve(_.value.v).then(g,f):b(o[0][2],_)}function g(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}};const Od={redirect:"error"};function og(e){var t;Q1();const r=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!0;return{async unary(n,i,o,l,s,a){const{serialize:c,parse:g}=xd(n,r,e.jsonOptions,e.binaryOptions);return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,await z1({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!1,service:n.parent,method:n,requestMethod:"POST",url:Ad(e.baseUrl,n),header:Bd(r,o,l),contextValues:a??Cd(),message:s},next:async f=>{var b;const k=await((b=e.fetch)!==null&&b!==void 0?b:globalThis.fetch)(f.url,Object.assign(Object.assign({},Od),{method:f.requestMethod,headers:f.header,signal:f.signal,body:Ed(0,c(f.message))})),{headerError:y}=Ld(k.status,k.headers);if(!k.body)throw y!==void 0?y:"missing response body";const d=wd(k.body).getReader();let p,h;for(;;){const m=await d.read();if(m.done)break;const{flags:S,data:I}=m.value;if((S&Sd)===Sd)throw new Je("protocol error: received unsupported compressed output",He.Internal);if(S===_a){if(p!==void 0)throw"extra trailer";p=kd(I);continue}if(h!==void 0)throw new Je("extra message",He.Unimplemented);h=g(I)}if(p===void 0)throw y!==void 0?y:new Je("missing trailer",k.headers.has(Hn)?He.Unimplemented:He.Unknown);if(Td(p,k.headers),h===void 0)throw new Je("missing message",p.has(Hn)?He.Unimplemented:He.Unknown);return{stream:!1,service:n.parent,method:n,header:k.headers,message:h,trailer:p}}})},async stream(n,i,o,l,s,a){const{serialize:c,parse:g}=xd(n,r,e.jsonOptions,e.binaryOptions);function f(_,k,y,d,p){return ty(this,arguments,function*(){const m=wd(_).getReader();if(k){if(!(yield cn(m.read())).done)throw"extra data for trailers-only";return yield cn(void 0)}let S=!1;for(;;){const I=yield cn(m.read());if(I.done)break;const{flags:C,data:A}=I.value;if((C&_a)===_a){if(S)throw"extra trailer";S=!0;const E=kd(A);Td(E,d),E.forEach((N,O)=>y.set(O,N));continue}if(S)throw"extra message";yield yield cn(g(A))}if("throwIfAborted"in p&&p.throwIfAborted(),!S)throw"missing trailer"})}async function b(_){if(n.methodKind!="server_streaming")throw"The fetch API does not support streaming request bodies";const k=await _[Symbol.asyncIterator]().next();if(k.done==!0)throw"missing request message";return Ed(0,c(k.value))}return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,q1({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!0,service:n.parent,method:n,requestMethod:"POST",url:Ad(e.baseUrl,n),header:Bd(r,o,l),contextValues:a??Cd(),message:s},next:async _=>{var k;const d=await((k=e.fetch)!==null&&k!==void 0?k:globalThis.fetch)(_.url,Object.assign(Object.assign({},Od),{method:_.requestMethod,headers:_.header,signal:_.signal,body:await b(_.message)})),{foundStatus:p,headerError:h}=Ld(d.status,d.headers);if(h!=null)throw h;if(!d.body)throw"missing response body";const m=new Headers;return Object.assign(Object.assign({},_),{header:d.headers,trailer:m,message:f(d.body,p,m,d.headers,_.signal)})}})}}}function Za(e,t,r=[]){const n=og({baseUrl:t,interceptors:r});return qp(e,n)}var mr=(e=>(e.TextPlain="text/plain",e.StatefulRunmeOutputItems="stateful.runme/output-items",e.StatefulRunmeTerminal="stateful.runme/terminal",e.VSCodeNotebookStdOut="application/vnd.code.notebook.stdout",e.VSCodeNotebookStdErr="application/vnd.code.notebook.stderr",e))(mr||{});const Ln="runme.dev/";var Ft=(e=>(e.ID="id",e.RunmeID=`${Ln}id`,e.Sequence=`${Ln}sequence`,e.LastRunID=`${Ln}lastRunID`,e.Pid=`${Ln}pid`,e.ExitCode=`${Ln}exitCode`,e))(Ft||{}),Ks=(e=>(e.PreviousResponseId=`${Ln}previousResponseId`,e))(Ks||{}),ry=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ag(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs={exports:{}},ny=Fs.exports,Dd;function iy(){return Dd||(Dd=1,(function(e,t){(function(r,n){e.exports=n()})(ny,function(){var r=function(u,v){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var R in x)Object.prototype.hasOwnProperty.call(x,R)&&(w[R]=x[R])})(u,v)},n=function(){return(n=Object.assign||function(u){for(var v,w=1,x=arguments.length;w<x;w++)for(var R in v=arguments[w])Object.prototype.hasOwnProperty.call(v,R)&&(u[R]=v[R]);return u}).apply(this,arguments)};function i(u,v,w){for(var x,R=0,T=v.length;R<T;R++)!x&&R in v||((x=x||Array.prototype.slice.call(v,0,R))[R]=v[R]);return u.concat(x||Array.prototype.slice.call(v))}var o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:ry,l=Object.keys,s=Array.isArray;function a(u,v){return typeof v!="object"||l(v).forEach(function(w){u[w]=v[w]}),u}typeof Promise>"u"||o.Promise||(o.Promise=Promise);var c=Object.getPrototypeOf,g={}.hasOwnProperty;function f(u,v){return g.call(u,v)}function b(u,v){typeof v=="function"&&(v=v(c(u))),(typeof Reflect>"u"?l:Reflect.ownKeys)(v).forEach(function(w){k(u,w,v[w])})}var _=Object.defineProperty;function k(u,v,w,x){_(u,v,a(w&&f(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},x))}function y(u){return{from:function(v){return u.prototype=Object.create(v.prototype),k(u.prototype,"constructor",u),{extend:b.bind(null,u.prototype)}}}}var d=Object.getOwnPropertyDescriptor,p=[].slice;function h(u,v,w){return p.call(u,v,w)}function m(u,v){return v(u)}function S(u){if(!u)throw new Error("Assertion Failed")}function I(u){o.setImmediate?setImmediate(u):setTimeout(u,0)}function C(u,v){if(typeof v=="string"&&f(u,v))return u[v];if(!v)return u;if(typeof v!="string"){for(var w=[],x=0,R=v.length;x<R;++x){var T=C(u,v[x]);w.push(T)}return w}var V=v.indexOf(".");if(V!==-1){var W=u[v.substr(0,V)];return W==null?void 0:C(W,v.substr(V+1))}}function A(u,v,w){if(u&&v!==void 0&&!("isFrozen"in Object&&Object.isFrozen(u)))if(typeof v!="string"&&"length"in v){S(typeof w!="string"&&"length"in w);for(var x=0,R=v.length;x<R;++x)A(u,v[x],w[x])}else{var T,V,W=v.indexOf(".");W!==-1?(T=v.substr(0,W),(V=v.substr(W+1))===""?w===void 0?s(u)&&!isNaN(parseInt(T))?u.splice(T,1):delete u[T]:u[T]=w:A(W=!(W=u[T])||!f(u,T)?u[T]={}:W,V,w)):w===void 0?s(u)&&!isNaN(parseInt(v))?u.splice(v,1):delete u[v]:u[v]=w}}function E(u){var v,w={};for(v in u)f(u,v)&&(w[v]=u[v]);return w}var N=[].concat;function O(u){return N.apply([],u)}var $t="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(O([8,16,32,64].map(function(u){return["Int","Uint","Float"].map(function(v){return v+u+"Array"})}))).filter(function(u){return o[u]}),P=new Set($t.map(function(u){return o[u]})),$=null;function D(u){return $=new WeakMap,u=(function v(w){if(!w||typeof w!="object")return w;var x=$.get(w);if(x)return x;if(s(w)){x=[],$.set(w,x);for(var R=0,T=w.length;R<T;++R)x.push(v(w[R]))}else if(P.has(w.constructor))x=w;else{var V,W=c(w);for(V in x=W===Object.prototype?{}:Object.create(W),$.set(w,x),w)f(w,V)&&(x[V]=v(w[V]))}return x})(u),$=null,u}var re={}.toString;function le(u){return re.call(u).slice(8,-1)}var ge=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Ie=typeof ge=="symbol"?function(u){var v;return u!=null&&(v=u[ge])&&v.apply(u)}:function(){return null};function me(u,v){return v=u.indexOf(v),0<=v&&u.splice(v,1),0<=v}var B={};function U(u){var v,w,x,R;if(arguments.length===1){if(s(u))return u.slice();if(this===B&&typeof u=="string")return[u];if(R=Ie(u)){for(w=[];!(x=R.next()).done;)w.push(x.value);return w}if(u==null)return[u];if(typeof(v=u.length)!="number")return[u];for(w=new Array(v);v--;)w[v]=u[v];return w}for(v=arguments.length,w=new Array(v);v--;)w[v]=arguments[v];return w}var F=typeof Symbol<"u"?function(u){return u[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Nt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],er=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Nt),j={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function oe(u,v){this.name=u,this.message=v}function fe(u,v){return u+". Errors: "+Object.keys(v).map(function(w){return v[w].toString()}).filter(function(w,x,R){return R.indexOf(w)===x}).join(`
|
|
4
|
+
`)}function pe(u,v,w,x){this.failures=v,this.failedKeys=x,this.successCount=w,this.message=fe(u,v)}function _e(u,v){this.name="BulkError",this.failures=Object.keys(v).map(function(w){return v[w]}),this.failuresByPos=v,this.message=fe(u,this.failures)}y(oe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),y(pe).from(oe),y(_e).from(oe);var Y=er.reduce(function(u,v){return u[v]=v+"Error",u},{}),L=oe,ie=er.reduce(function(u,v){var w=v+"Error";function x(R,T){this.name=w,R?typeof R=="string"?(this.message="".concat(R).concat(T?`
|
|
5
|
+
`+T:""),this.inner=T||null):typeof R=="object"&&(this.message="".concat(R.name," ").concat(R.message),this.inner=R):(this.message=j[v]||w,this.inner=null)}return y(x).from(L),u[v]=x,u},{});ie.Syntax=SyntaxError,ie.Type=TypeError,ie.Range=RangeError;var ae=Nt.reduce(function(u,v){return u[v+"Error"]=ie[v],u},{}),ke=er.reduce(function(u,v){return["Syntax","Type","Range"].indexOf(v)===-1&&(u[v+"Error"]=ie[v]),u},{});function he(){}function Fe(u){return u}function tt(u,v){return u==null||u===Fe?v:function(w){return v(u(w))}}function Xe(u,v){return function(){u.apply(this,arguments),v.apply(this,arguments)}}function Rt(u,v){return u===he?v:function(){var w=u.apply(this,arguments);w!==void 0&&(arguments[0]=w);var x=this.onsuccess,R=this.onerror;this.onsuccess=null,this.onerror=null;var T=v.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?Xe(x,this.onsuccess):x),R&&(this.onerror=this.onerror?Xe(R,this.onerror):R),T!==void 0?T:w}}function Le(u,v){return u===he?v:function(){u.apply(this,arguments);var w=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,v.apply(this,arguments),w&&(this.onsuccess=this.onsuccess?Xe(w,this.onsuccess):w),x&&(this.onerror=this.onerror?Xe(x,this.onerror):x)}}function Kr(u,v){return u===he?v:function(w){var x=u.apply(this,arguments);a(w,x);var R=this.onsuccess,T=this.onerror;return this.onsuccess=null,this.onerror=null,w=v.apply(this,arguments),R&&(this.onsuccess=this.onsuccess?Xe(R,this.onsuccess):R),T&&(this.onerror=this.onerror?Xe(T,this.onerror):T),x===void 0?w===void 0?void 0:w:a(x,w)}}function Qn(u,v){return u===he?v:function(){return v.apply(this,arguments)!==!1&&u.apply(this,arguments)}}function Yr(u,v){return u===he?v:function(){var w=u.apply(this,arguments);if(w&&typeof w.then=="function"){for(var x=this,R=arguments.length,T=new Array(R);R--;)T[R]=arguments[R];return w.then(function(){return v.apply(x,T)})}return v.apply(this,arguments)}}ke.ModifyError=pe,ke.DexieError=oe,ke.BulkError=_e;var Mt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Xr(u){Mt=u}var vt={},Nr=100,$t=typeof Promise>"u"?[]:(function(){var u=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[u,c(u),u];var v=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[v,c(v),u]})(),Nt=$t[0],er=$t[1],$t=$t[2],er=er&&er.then,or=Nt&&Nt.constructor,qt=!!$t,ur=function(u,v){ei.push([u,v]),dr&&(queueMicrotask(i0),dr=!1)},Qt=!0,dr=!0,Ye=[],Sn=[],Bo=Fe,Tr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:he,pgp:!1,env:{},finalize:he},Re=Tr,ei=[],Jr=0,Qi=[];function Ae(u){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var v=this._PSD=Re;if(typeof u!="function"){if(u!==vt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Oo(this,this._value))}this._state=null,this._value=null,++v.ref,(function w(x,R){try{R(function(T){if(x._state===null){if(T===x)throw new TypeError("A promise cannot be resolved with itself.");var V=x._lib&&wn();T&&typeof T.then=="function"?w(x,function(W,Z){T instanceof Ae?T._then(W,Z):T.then(W,Z)}):(x._state=!0,x._value=T,ql(x)),V&&En()}},Oo.bind(null,x))}catch(T){Oo(x,T)}})(this,u)}var Lo={get:function(){var u=Re,v=ns;function w(x,R){var T=this,V=!u.global&&(u!==Re||v!==ns),W=V&&!Lr(),Z=new Ae(function(G,z){Do(T,new zl(eu(x,u,V,W),eu(R,u,V,W),G,z,u))});return this._consoleTask&&(Z._consoleTask=this._consoleTask),Z}return w.prototype=vt,w},set:function(u){k(this,"then",u&&u.prototype===vt?Lo:{get:function(){return u},set:Lo.set})}};function zl(u,v,w,x,R){this.onFulfilled=typeof u=="function"?u:null,this.onRejected=typeof v=="function"?v:null,this.resolve=w,this.reject=x,this.psd=R}function Oo(u,v){var w,x;Sn.push(v),u._state===null&&(w=u._lib&&wn(),v=Bo(v),u._state=!1,u._value=v,x=u,Ye.some(function(R){return R._value===x._value})||Ye.push(x),ql(u),w&&En())}function ql(u){var v=u._listeners;u._listeners=[];for(var w=0,x=v.length;w<x;++w)Do(u,v[w]);var R=u._PSD;--R.ref||R.finalize(),Jr===0&&(++Jr,ur(function(){--Jr==0&&Fo()},[]))}function Do(u,v){if(u._state!==null){var w=u._state?v.onFulfilled:v.onRejected;if(w===null)return(u._state?v.resolve:v.reject)(u._value);++v.psd.ref,++Jr,ur(n0,[w,u,v])}else u._listeners.push(v)}function n0(u,v,w){try{var x,R=v._value;!v._state&&Sn.length&&(Sn=[]),x=Mt&&v._consoleTask?v._consoleTask.run(function(){return u(R)}):u(R),v._state||Sn.indexOf(R)!==-1||(function(T){for(var V=Ye.length;V;)if(Ye[--V]._value===T._value)return Ye.splice(V,1)})(v),w.resolve(x)}catch(T){w.reject(T)}finally{--Jr==0&&Fo(),--w.psd.ref||w.psd.finalize()}}function i0(){zr(Tr,function(){wn()&&En()})}function wn(){var u=Qt;return dr=Qt=!1,u}function En(){var u,v,w;do for(;0<ei.length;)for(u=ei,ei=[],w=u.length,v=0;v<w;++v){var x=u[v];x[0].apply(null,x[1])}while(0<ei.length);dr=Qt=!0}function Fo(){var u=Ye;Ye=[],u.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var v=Qi.slice(0),w=v.length;w;)v[--w]()}function es(u){return new Ae(vt,!1,u)}function rt(u,v){var w=Re;return function(){var x=wn(),R=Re;try{return Or(w,!0),u.apply(this,arguments)}catch(T){v&&v(T)}finally{Or(R,!1),x&&En()}}}b(Ae.prototype,{then:Lo,_then:function(u,v){Do(this,new zl(null,null,u,v,Re))},catch:function(u){if(arguments.length===1)return this.then(null,u);var v=u,w=arguments[1];return typeof v=="function"?this.then(null,function(x){return(x instanceof v?w:es)(x)}):this.then(null,function(x){return(x&&x.name===v?w:es)(x)})},finally:function(u){return this.then(function(v){return Ae.resolve(u()).then(function(){return v})},function(v){return Ae.resolve(u()).then(function(){return es(v)})})},timeout:function(u,v){var w=this;return u<1/0?new Ae(function(x,R){var T=setTimeout(function(){return R(new ie.Timeout(v))},u);w.then(x,R).finally(clearTimeout.bind(null,T))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&k(Ae.prototype,Symbol.toStringTag,"Dexie.Promise"),Tr.env=Ql(),b(Ae,{all:function(){var u=U.apply(null,arguments).map(is);return new Ae(function(v,w){u.length===0&&v([]);var x=u.length;u.forEach(function(R,T){return Ae.resolve(R).then(function(V){u[T]=V,--x||v(u)},w)})})},resolve:function(u){return u instanceof Ae?u:u&&typeof u.then=="function"?new Ae(function(v,w){u.then(v,w)}):new Ae(vt,!0,u)},reject:es,race:function(){var u=U.apply(null,arguments).map(is);return new Ae(function(v,w){u.map(function(x){return Ae.resolve(x).then(v,w)})})},PSD:{get:function(){return Re},set:function(u){return Re=u}},totalEchoes:{get:function(){return ns}},newPSD:Br,usePSD:zr,scheduler:{get:function(){return ur},set:function(u){ur=u}},rejectionMapper:{get:function(){return Bo},set:function(u){Bo=u}},follow:function(u,v){return new Ae(function(w,x){return Br(function(R,T){var V=Re;V.unhandleds=[],V.onunhandled=T,V.finalize=Xe(function(){var W,Z=this;W=function(){Z.unhandleds.length===0?R():T(Z.unhandleds[0])},Qi.push(function G(){W(),Qi.splice(Qi.indexOf(G),1)}),++Jr,ur(function(){--Jr==0&&Fo()},[])},V.finalize),u()},v,w,x)})}}),or&&(or.allSettled&&k(Ae,"allSettled",function(){var u=U.apply(null,arguments).map(is);return new Ae(function(v){u.length===0&&v([]);var w=u.length,x=new Array(w);u.forEach(function(R,T){return Ae.resolve(R).then(function(V){return x[T]={status:"fulfilled",value:V}},function(V){return x[T]={status:"rejected",reason:V}}).then(function(){return--w||v(x)})})})}),or.any&&typeof AggregateError<"u"&&k(Ae,"any",function(){var u=U.apply(null,arguments).map(is);return new Ae(function(v,w){u.length===0&&w(new AggregateError([]));var x=u.length,R=new Array(x);u.forEach(function(T,V){return Ae.resolve(T).then(function(W){return v(W)},function(W){R[V]=W,--x||w(new AggregateError(R))})})})}),or.withResolvers&&(Ae.withResolvers=or.withResolvers));var bt={awaits:0,echoes:0,id:0},s0=0,ts=[],rs=0,ns=0,o0=0;function Br(u,v,w,x){var R=Re,T=Object.create(R);return T.parent=R,T.ref=0,T.global=!1,T.id=++o0,Tr.env,T.env=qt?{Promise:Ae,PromiseProp:{value:Ae,configurable:!0,writable:!0},all:Ae.all,race:Ae.race,allSettled:Ae.allSettled,any:Ae.any,resolve:Ae.resolve,reject:Ae.reject}:{},v&&a(T,v),++R.ref,T.finalize=function(){--this.parent.ref||this.parent.finalize()},x=zr(T,u,w,x),T.ref===0&&T.finalize(),x}function Cn(){return bt.id||(bt.id=++s0),++bt.awaits,bt.echoes+=Nr,bt.id}function Lr(){return!!bt.awaits&&(--bt.awaits==0&&(bt.id=0),bt.echoes=bt.awaits*Nr,!0)}function is(u){return bt.echoes&&u&&u.constructor===or?(Cn(),u.then(function(v){return Lr(),v},function(v){return Lr(),lt(v)})):u}function a0(){var u=ts[ts.length-1];ts.pop(),Or(u,!1)}function Or(u,v){var w,x=Re;(v?!bt.echoes||rs++&&u===Re:!rs||--rs&&u===Re)||queueMicrotask(v?(function(R){++ns,bt.echoes&&--bt.echoes!=0||(bt.echoes=bt.awaits=bt.id=0),ts.push(Re),Or(R,!0)}).bind(null,u):a0),u!==Re&&(Re=u,x===Tr&&(Tr.env=Ql()),qt&&(w=Tr.env.Promise,v=u.env,(x.global||u.global)&&(Object.defineProperty(o,"Promise",v.PromiseProp),w.all=v.all,w.race=v.race,w.resolve=v.resolve,w.reject=v.reject,v.allSettled&&(w.allSettled=v.allSettled),v.any&&(w.any=v.any))))}function Ql(){var u=o.Promise;return qt?{Promise:u,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:u.all,race:u.race,allSettled:u.allSettled,any:u.any,resolve:u.resolve,reject:u.reject}:{}}function zr(u,v,w,x,R){var T=Re;try{return Or(u,!0),v(w,x,R)}finally{Or(T,!1)}}function eu(u,v,w,x){return typeof u!="function"?u:function(){var R=Re;w&&Cn(),Or(v,!0);try{return u.apply(this,arguments)}finally{Or(R,!1),x&&queueMicrotask(Lr)}}}function Vo(u){Promise===or&&bt.echoes===0?rs===0?u():enqueueNativeMicroTask(u):setTimeout(u,0)}(""+er).indexOf("[native code]")===-1&&(Cn=Lr=he);var lt=Ae.reject,qr="",yr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",tu="String expected.",kn=[],ss="__dbnames",Mo="readonly",Uo="readwrite";function Qr(u,v){return u?v?function(){return u.apply(this,arguments)&&v.apply(this,arguments)}:u:v}var ru={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function os(u){return typeof u!="string"||/\./.test(u)?function(v){return v}:function(v){return v[u]===void 0&&u in v&&delete(v=D(v))[u],v}}function nu(){throw ie.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function je(u,v){try{var w=iu(u),x=iu(v);if(w!==x)return w==="Array"?1:x==="Array"?-1:w==="binary"?1:x==="binary"?-1:w==="string"?1:x==="string"?-1:w==="Date"?1:x!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return v<u?1:u<v?-1:0;case"binary":return(function(R,T){for(var V=R.length,W=T.length,Z=V<W?V:W,G=0;G<Z;++G)if(R[G]!==T[G])return R[G]<T[G]?-1:1;return V===W?0:V<W?-1:1})(su(u),su(v));case"Array":return(function(R,T){for(var V=R.length,W=T.length,Z=V<W?V:W,G=0;G<Z;++G){var z=je(R[G],T[G]);if(z!==0)return z}return V===W?0:V<W?-1:1})(u,v)}}catch{}return NaN}function iu(u){var v=typeof u;return v!="object"?v:ArrayBuffer.isView(u)?"binary":(u=le(u),u==="ArrayBuffer"?"binary":u)}function su(u){return u instanceof Uint8Array?u:ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):new Uint8Array(u)}function as(u,v,w){var x=u.schema.yProps;return x?(v&&0<w.numFailures&&(v=v.filter(function(R,T){return!w.failures[T]})),Promise.all(x.map(function(R){return R=R.updatesTable,v?u.db.table(R).where("k").anyOf(v).delete():u.db.table(R).clear()})).then(function(){return w})):w}var ti=(ou.prototype.execute=function(u){var v=this["@@propmod"];if(v.add!==void 0){var w=v.add;if(s(w))return i(i([],s(u)?u:[],!0),w).sort();if(typeof w=="number")return(Number(u)||0)+w;if(typeof w=="bigint")try{return BigInt(u)+w}catch{return BigInt(0)+w}throw new TypeError("Invalid term ".concat(w))}if(v.remove!==void 0){var x=v.remove;if(s(x))return s(u)?u.filter(function(R){return!x.includes(R)}).sort():[];if(typeof x=="number")return Number(u)-x;if(typeof x=="bigint")try{return BigInt(u)-x}catch{return BigInt(0)-x}throw new TypeError("Invalid subtrahend ".concat(x))}return w=(w=v.replacePrefix)===null||w===void 0?void 0:w[0],w&&typeof u=="string"&&u.startsWith(w)?v.replacePrefix[1]+u.substring(w.length):u},ou);function ou(u){this["@@propmod"]=u}function au(u,v){for(var w=l(v),x=w.length,R=!1,T=0;T<x;++T){var V=w[T],W=v[V],Z=C(u,V);W instanceof ti?(A(u,V,W.execute(Z)),R=!0):Z!==W&&(A(u,V,W),R=!0)}return R}var cu=(Qe.prototype._trans=function(u,v,w){var x=this._tx||Re.trans,R=this.name,T=Mt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(u==="readonly"?"read":"write"," ").concat(this.name));function V(G,z,H){if(!H.schema[R])throw new ie.NotFound("Table "+R+" not part of transaction");return v(H.idbtrans,H)}var W=wn();try{var Z=x&&x.db._novip===this.db._novip?x===Re.trans?x._promise(u,V,w):Br(function(){return x._promise(u,V,w)},{trans:x,transless:Re.transless||Re}):(function G(z,H,Q,K){if(z.idbdb&&(z._state.openComplete||Re.letThrough||z._vip)){var X=z._createTransaction(H,Q,z._dbSchema);try{X.create(),z._state.PR1398_maxLoop=3}catch(J){return J.name===Y.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return G(z,H,Q,K)})):lt(J)}return X._promise(H,function(J,q){return Br(function(){return Re.trans=X,K(J,q,X)})}).then(function(J){if(H==="readwrite")try{X.idbtrans.commit()}catch{}return H==="readonly"?J:X._completion.then(function(){return J})})}if(z._state.openComplete)return lt(new ie.DatabaseClosed(z._state.dbOpenError));if(!z._state.isBeingOpened){if(!z._state.autoOpen)return lt(new ie.DatabaseClosed);z.open().catch(he)}return z._state.dbReadyPromise.then(function(){return G(z,H,Q,K)})})(this.db,u,[this.name],V);return T&&(Z._consoleTask=T,Z=Z.catch(function(G){return console.trace(G),lt(G)})),Z}finally{W&&En()}},Qe.prototype.get=function(u,v){var w=this;return u&&u.constructor===Object?this.where(u).first(v):u==null?lt(new ie.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return w.core.get({trans:x,key:u}).then(function(R){return w.hook.reading.fire(R)})}).then(v)},Qe.prototype.where=function(u){if(typeof u=="string")return new this.db.WhereClause(this,u);if(s(u))return new this.db.WhereClause(this,"[".concat(u.join("+"),"]"));var v=l(u);if(v.length===1)return this.where(v[0]).equals(u[v[0]]);var w=this.schema.indexes.concat(this.schema.primKey).filter(function(W){if(W.compound&&v.every(function(G){return 0<=W.keyPath.indexOf(G)})){for(var Z=0;Z<v.length;++Z)if(v.indexOf(W.keyPath[Z])===-1)return!1;return!0}return!1}).sort(function(W,Z){return W.keyPath.length-Z.keyPath.length})[0];if(w&&this.db._maxKey!==qr){var T=w.keyPath.slice(0,v.length);return this.where(T).equals(T.map(function(Z){return u[Z]}))}!w&&Mt&&console.warn("The query ".concat(JSON.stringify(u)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(v.join("+"),"]"));var x=this.schema.idxByName;function R(W,Z){return je(W,Z)===0}var V=v.reduce(function(H,Z){var G=H[0],z=H[1],H=x[Z],Q=u[Z];return[G||H,G||!H?Qr(z,H&&H.multi?function(K){return K=C(K,Z),s(K)&&K.some(function(X){return R(Q,X)})}:function(K){return R(Q,C(K,Z))}):z]},[null,null]),T=V[0],V=V[1];return T?this.where(T.name).equals(u[T.keyPath]).filter(V):w?this.filter(V):this.where(v).equals("")},Qe.prototype.filter=function(u){return this.toCollection().and(u)},Qe.prototype.count=function(u){return this.toCollection().count(u)},Qe.prototype.offset=function(u){return this.toCollection().offset(u)},Qe.prototype.limit=function(u){return this.toCollection().limit(u)},Qe.prototype.each=function(u){return this.toCollection().each(u)},Qe.prototype.toArray=function(u){return this.toCollection().toArray(u)},Qe.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Qe.prototype.orderBy=function(u){return new this.db.Collection(new this.db.WhereClause(this,s(u)?"[".concat(u.join("+"),"]"):u))},Qe.prototype.reverse=function(){return this.toCollection().reverse()},Qe.prototype.mapToClass=function(u){var v,w=this.db,x=this.name;function R(){return v!==null&&v.apply(this,arguments)||this}(this.schema.mappedClass=u).prototype instanceof nu&&((function(Z,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function z(){this.constructor=Z}r(Z,G),Z.prototype=G===null?Object.create(G):(z.prototype=G.prototype,new z)})(R,v=u),Object.defineProperty(R.prototype,"db",{get:function(){return w},enumerable:!1,configurable:!0}),R.prototype.table=function(){return x},u=R);for(var T=new Set,V=u.prototype;V;V=c(V))Object.getOwnPropertyNames(V).forEach(function(Z){return T.add(Z)});function W(Z){if(!Z)return Z;var G,z=Object.create(u.prototype);for(G in Z)if(!T.has(G))try{z[G]=Z[G]}catch{}return z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=W,this.hook("reading",W),u},Qe.prototype.defineClass=function(){return this.mapToClass(function(u){a(this,u)})},Qe.prototype.add=function(u,v){var w=this,x=this.schema.primKey,R=x.auto,T=x.keyPath,V=u;return T&&R&&(V=os(T)(u)),this._trans("readwrite",function(W){return w.core.mutate({trans:W,type:"add",keys:v!=null?[v]:null,values:[V]})}).then(function(W){return W.numFailures?Ae.reject(W.failures[0]):W.lastResult}).then(function(W){if(T)try{A(u,T,W)}catch{}return W})},Qe.prototype.upsert=function(u,v){var w=this,x=this.schema.primKey.keyPath;return this._trans("readwrite",function(R){return w.core.get({trans:R,key:u}).then(function(T){var V=T??{};return au(V,v),x&&A(V,x,u),w.core.mutate({trans:R,type:"put",values:[V],keys:[u],upsert:!0,updates:{keys:[u],changeSpecs:[v]}}).then(function(W){return W.numFailures?Ae.reject(W.failures[0]):!!T})})})},Qe.prototype.update=function(u,v){return typeof u!="object"||s(u)?this.where(":id").equals(u).modify(v):(u=C(u,this.schema.primKey.keyPath),u===void 0?lt(new ie.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(u).modify(v))},Qe.prototype.put=function(u,v){var w=this,x=this.schema.primKey,R=x.auto,T=x.keyPath,V=u;return T&&R&&(V=os(T)(u)),this._trans("readwrite",function(W){return w.core.mutate({trans:W,type:"put",values:[V],keys:v!=null?[v]:null})}).then(function(W){return W.numFailures?Ae.reject(W.failures[0]):W.lastResult}).then(function(W){if(T)try{A(u,T,W)}catch{}return W})},Qe.prototype.delete=function(u){var v=this;return this._trans("readwrite",function(w){return v.core.mutate({trans:w,type:"delete",keys:[u]}).then(function(x){return as(v,[u],x)}).then(function(x){return x.numFailures?Ae.reject(x.failures[0]):void 0})})},Qe.prototype.clear=function(){var u=this;return this._trans("readwrite",function(v){return u.core.mutate({trans:v,type:"deleteRange",range:ru}).then(function(w){return as(u,null,w)})}).then(function(v){return v.numFailures?Ae.reject(v.failures[0]):void 0})},Qe.prototype.bulkGet=function(u){var v=this;return this._trans("readonly",function(w){return v.core.getMany({keys:u,trans:w}).then(function(x){return x.map(function(R){return v.hook.reading.fire(R)})})})},Qe.prototype.bulkAdd=function(u,v,w){var x=this,R=Array.isArray(v)?v:void 0,T=(w=w||(R?void 0:v))?w.allKeys:void 0;return this._trans("readwrite",function(V){var G=x.schema.primKey,W=G.auto,G=G.keyPath;if(G&&R)throw new ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(R&&R.length!==u.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");var Z=u.length,G=G&&W?u.map(os(G)):u;return x.core.mutate({trans:V,type:"add",keys:R,values:G,wantResults:T}).then(function(X){var H=X.numFailures,Q=X.results,K=X.lastResult,X=X.failures;if(H===0)return T?Q:K;throw new _e("".concat(x.name,".bulkAdd(): ").concat(H," of ").concat(Z," operations failed"),X)})})},Qe.prototype.bulkPut=function(u,v,w){var x=this,R=Array.isArray(v)?v:void 0,T=(w=w||(R?void 0:v))?w.allKeys:void 0;return this._trans("readwrite",function(V){var G=x.schema.primKey,W=G.auto,G=G.keyPath;if(G&&R)throw new ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(R&&R.length!==u.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");var Z=u.length,G=G&&W?u.map(os(G)):u;return x.core.mutate({trans:V,type:"put",keys:R,values:G,wantResults:T}).then(function(X){var H=X.numFailures,Q=X.results,K=X.lastResult,X=X.failures;if(H===0)return T?Q:K;throw new _e("".concat(x.name,".bulkPut(): ").concat(H," of ").concat(Z," operations failed"),X)})})},Qe.prototype.bulkUpdate=function(u){var v=this,w=this.core,x=u.map(function(V){return V.key}),R=u.map(function(V){return V.changes}),T=[];return this._trans("readwrite",function(V){return w.getMany({trans:V,keys:x,cache:"clone"}).then(function(W){var Z=[],G=[];u.forEach(function(H,Q){var K=H.key,X=H.changes,J=W[Q];if(J){for(var q=0,ne=Object.keys(X);q<ne.length;q++){var se=ne[q],ce=X[se];if(se===v.schema.primKey.keyPath){if(je(ce,K)!==0)throw new ie.Constraint("Cannot update primary key in bulkUpdate()")}else A(J,se,ce)}T.push(Q),Z.push(K),G.push(J)}});var z=Z.length;return w.mutate({trans:V,type:"put",keys:Z,values:G,updates:{keys:x,changeSpecs:R}}).then(function(H){var Q=H.numFailures,K=H.failures;if(Q===0)return z;for(var X=0,J=Object.keys(K);X<J.length;X++){var q,ne=J[X],se=T[Number(ne)];se!=null&&(q=K[ne],delete K[ne],K[se]=q)}throw new _e("".concat(v.name,".bulkUpdate(): ").concat(Q," of ").concat(z," operations failed"),K)})})})},Qe.prototype.bulkDelete=function(u){var v=this,w=u.length;return this._trans("readwrite",function(x){return v.core.mutate({trans:x,type:"delete",keys:u}).then(function(R){return as(v,u,R)})}).then(function(V){var R=V.numFailures,T=V.lastResult,V=V.failures;if(R===0)return T;throw new _e("".concat(v.name,".bulkDelete(): ").concat(R," of ").concat(w," operations failed"),V)})},Qe);function Qe(){}function ri(u){function v(V,W){if(W){for(var Z=arguments.length,G=new Array(Z-1);--Z;)G[Z-1]=arguments[Z];return w[V].subscribe.apply(null,G),u}if(typeof V=="string")return w[V]}var w={};v.addEventType=T;for(var x=1,R=arguments.length;x<R;++x)T(arguments[x]);return v;function T(V,W,Z){if(typeof V!="object"){var G;W=W||Qn;var z={subscribers:[],fire:Z=Z||he,subscribe:function(H){z.subscribers.indexOf(H)===-1&&(z.subscribers.push(H),z.fire=W(z.fire,H))},unsubscribe:function(H){z.subscribers=z.subscribers.filter(function(Q){return Q!==H}),z.fire=z.subscribers.reduce(W,Z)}};return w[V]=v[V]=z}l(G=V).forEach(function(H){var Q=G[H];if(s(Q))T(H,G[H][0],G[H][1]);else{if(Q!=="asap")throw new ie.InvalidArgument("Invalid event config");var K=T(H,Fe,function(){for(var X=arguments.length,J=new Array(X);X--;)J[X]=arguments[X];K.subscribers.forEach(function(q){I(function(){q.apply(null,J)})})})}})}}function ni(u,v){return y(v).from({prototype:u}),v}function In(u,v){return!(u.filter||u.algorithm||u.or)&&(v?u.justLimit:!u.replayFilter)}function Po(u,v){u.filter=Qr(u.filter,v)}function Wo(u,v,w){var x=u.replayFilter;u.replayFilter=x?function(){return Qr(x(),v())}:v,u.justLimit=w&&!x}function cs(u,v){if(u.isPrimKey)return v.primaryKey;var w=v.getIndexByKeyPath(u.index);if(!w)throw new ie.Schema("KeyPath "+u.index+" on object store "+v.name+" is not indexed");return w}function lu(u,v,w){var x=cs(u,v.schema);return v.openCursor({trans:w,values:!u.keysOnly,reverse:u.dir==="prev",unique:!!u.unique,query:{index:x,range:u.range}})}function ls(u,v,w,x){var R=u.replayFilter?Qr(u.filter,u.replayFilter()):u.filter;if(u.or){var T={},V=function(W,Z,G){var z,H;R&&!R(Z,G,function(Q){return Z.stop(Q)},function(Q){return Z.fail(Q)})||((H=""+(z=Z.primaryKey))=="[object ArrayBuffer]"&&(H=""+new Uint8Array(z)),f(T,H)||(T[H]=!0,v(W,Z,G)))};return Promise.all([u.or._iterate(V,w),uu(lu(u,x,w),u.algorithm,V,!u.keysOnly&&u.valueMapper)])}return uu(lu(u,x,w),Qr(u.algorithm,R),v,!u.keysOnly&&u.valueMapper)}function uu(u,v,w,x){var R=rt(x?function(T,V,W){return w(x(T),V,W)}:w);return u.then(function(T){if(T)return T.start(function(){var V=function(){return T.continue()};v&&!v(T,function(W){return V=W},function(W){T.stop(W),V=he},function(W){T.fail(W),V=he})||R(T.value,T,function(W){return V=W}),V()})})}var c0=(Ke.prototype._read=function(u,v){var w=this._ctx;return w.error?w.table._trans(null,lt.bind(null,w.error)):w.table._trans("readonly",u).then(v)},Ke.prototype._write=function(u){var v=this._ctx;return v.error?v.table._trans(null,lt.bind(null,v.error)):v.table._trans("readwrite",u,"locked")},Ke.prototype._addAlgorithm=function(u){var v=this._ctx;v.algorithm=Qr(v.algorithm,u)},Ke.prototype._iterate=function(u,v){return ls(this._ctx,u,v,this._ctx.table.core)},Ke.prototype.clone=function(u){var v=Object.create(this.constructor.prototype),w=Object.create(this._ctx);return u&&a(w,u),v._ctx=w,v},Ke.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ke.prototype.each=function(u){var v=this._ctx;return this._read(function(w){return ls(v,u,w,v.table.core)})},Ke.prototype.count=function(u){var v=this;return this._read(function(w){var x=v._ctx,R=x.table.core;if(In(x,!0))return R.count({trans:w,query:{index:cs(x,R.schema),range:x.range}}).then(function(V){return Math.min(V,x.limit)});var T=0;return ls(x,function(){return++T,!1},w,R).then(function(){return T})}).then(u)},Ke.prototype.sortBy=function(u,v){var w=u.split(".").reverse(),x=w[0],R=w.length-1;function T(Z,G){return G?T(Z[w[G]],G-1):Z[x]}var V=this._ctx.dir==="next"?1:-1;function W(Z,G){return je(T(Z,R),T(G,R))*V}return this.toArray(function(Z){return Z.sort(W)}).then(v)},Ke.prototype.toArray=function(u){var v=this;return this._read(function(w){var x=v._ctx;if(x.dir==="next"&&In(x,!0)&&0<x.limit){var R=x.valueMapper,T=cs(x,x.table.core.schema);return x.table.core.query({trans:w,limit:x.limit,values:!0,query:{index:T,range:x.range}}).then(function(W){return W=W.result,R?W.map(R):W})}var V=[];return ls(x,function(W){return V.push(W)},w,x.table.core).then(function(){return V})},u)},Ke.prototype.offset=function(u){var v=this._ctx;return u<=0||(v.offset+=u,In(v)?Wo(v,function(){var w=u;return function(x,R){return w===0||(w===1?--w:R(function(){x.advance(w),w=0}),!1)}}):Wo(v,function(){var w=u;return function(){return--w<0}})),this},Ke.prototype.limit=function(u){return this._ctx.limit=Math.min(this._ctx.limit,u),Wo(this._ctx,function(){var v=u;return function(w,x,R){return--v<=0&&x(R),0<=v}},!0),this},Ke.prototype.until=function(u,v){return Po(this._ctx,function(w,x,R){return!u(w.value)||(x(R),v)}),this},Ke.prototype.first=function(u){return this.limit(1).toArray(function(v){return v[0]}).then(u)},Ke.prototype.last=function(u){return this.reverse().first(u)},Ke.prototype.filter=function(u){var v;return Po(this._ctx,function(w){return u(w.value)}),(v=this._ctx).isMatch=Qr(v.isMatch,u),this},Ke.prototype.and=function(u){return this.filter(u)},Ke.prototype.or=function(u){return new this.db.WhereClause(this._ctx.table,u,this)},Ke.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ke.prototype.desc=function(){return this.reverse()},Ke.prototype.eachKey=function(u){var v=this._ctx;return v.keysOnly=!v.isMatch,this.each(function(w,x){u(x.key,x)})},Ke.prototype.eachUniqueKey=function(u){return this._ctx.unique="unique",this.eachKey(u)},Ke.prototype.eachPrimaryKey=function(u){var v=this._ctx;return v.keysOnly=!v.isMatch,this.each(function(w,x){u(x.primaryKey,x)})},Ke.prototype.keys=function(u){var v=this._ctx;v.keysOnly=!v.isMatch;var w=[];return this.each(function(x,R){w.push(R.key)}).then(function(){return w}).then(u)},Ke.prototype.primaryKeys=function(u){var v=this._ctx;if(v.dir==="next"&&In(v,!0)&&0<v.limit)return this._read(function(x){var R=cs(v,v.table.core.schema);return v.table.core.query({trans:x,values:!1,limit:v.limit,query:{index:R,range:v.range}})}).then(function(x){return x.result}).then(u);v.keysOnly=!v.isMatch;var w=[];return this.each(function(x,R){w.push(R.primaryKey)}).then(function(){return w}).then(u)},Ke.prototype.uniqueKeys=function(u){return this._ctx.unique="unique",this.keys(u)},Ke.prototype.firstKey=function(u){return this.limit(1).keys(function(v){return v[0]}).then(u)},Ke.prototype.lastKey=function(u){return this.reverse().firstKey(u)},Ke.prototype.distinct=function(){var u=this._ctx,u=u.index&&u.table.schema.idxByName[u.index];if(!u||!u.multi)return this;var v={};return Po(this._ctx,function(R){var x=R.primaryKey.toString(),R=f(v,x);return v[x]=!0,!R}),this},Ke.prototype.modify=function(u){var v=this,w=this._ctx;return this._write(function(x){var R=typeof u=="function"?u:function(J){return au(J,u)},T=w.table.core,G=T.schema.primaryKey,V=G.outbound,W=G.extractKey,Z=200,G=v.db._options.modifyChunkSize;G&&(Z=typeof G=="object"?G[T.name]||G["*"]||200:G);function z(J,se){var ne=se.failures,se=se.numFailures;Q+=J-se;for(var ce=0,de=l(ne);ce<de.length;ce++){var be=de[ce];H.push(ne[be])}}var H=[],Q=0,K=[],X=u===du;return v.clone().primaryKeys().then(function(J){function q(se){var ce=Math.min(Z,J.length-se),de=J.slice(se,se+ce);return(X?Promise.resolve([]):T.getMany({trans:x,keys:de,cache:"immutable"})).then(function(be){var Ee=[],ve=[],ye=V?[]:null,Ce=X?de:[];if(!X)for(var Se=0;Se<ce;++Se){var xe=be[Se],De={value:D(xe),primKey:J[se+Se]};R.call(De,De.value,De)!==!1&&(De.value==null?Ce.push(J[se+Se]):V||je(W(xe),W(De.value))===0?(ve.push(De.value),V&&ye.push(J[se+Se])):(Ce.push(J[se+Se]),Ee.push(De.value)))}return Promise.resolve(0<Ee.length&&T.mutate({trans:x,type:"add",values:Ee}).then(function(Ve){for(var Ue in Ve.failures)Ce.splice(parseInt(Ue),1);z(Ee.length,Ve)})).then(function(){return(0<ve.length||ne&&typeof u=="object")&&T.mutate({trans:x,type:"put",keys:ye,values:ve,criteria:ne,changeSpec:typeof u!="function"&&u,isAdditionalChunk:0<se}).then(function(Ve){return z(ve.length,Ve)})}).then(function(){return(0<Ce.length||ne&&X)&&T.mutate({trans:x,type:"delete",keys:Ce,criteria:ne,isAdditionalChunk:0<se}).then(function(Ve){return as(w.table,Ce,Ve)}).then(function(Ve){return z(Ce.length,Ve)})}).then(function(){return J.length>se+ce&&q(se+Z)})})}var ne=In(w)&&w.limit===1/0&&(typeof u!="function"||X)&&{index:w.index,range:w.range};return q(0).then(function(){if(0<H.length)throw new pe("Error modifying one or more objects",H,Q,K);return J.length})})})},Ke.prototype.delete=function(){var u=this._ctx,v=u.range;return!In(u)||u.table.schema.yProps||!u.isPrimKey&&v.type!==3?this.modify(du):this._write(function(w){var x=u.table.core.schema.primaryKey,R=v;return u.table.core.count({trans:w,query:{index:x,range:R}}).then(function(T){return u.table.core.mutate({trans:w,type:"deleteRange",range:R}).then(function(Z){var W=Z.failures,Z=Z.numFailures;if(Z)throw new pe("Could not delete some values",Object.keys(W).map(function(G){return W[G]}),T-Z);return T-Z})})})},Ke);function Ke(){}var du=function(u,v){return v.value=null};function l0(u,v){return u<v?-1:u===v?0:1}function u0(u,v){return v<u?-1:u===v?0:1}function Ht(u,v,w){return u=u instanceof fu?new u.Collection(u):u,u._ctx.error=new(w||TypeError)(v),u}function An(u){return new u.Collection(u,function(){return hu("")}).limit(0)}function us(u,v,w,x){var R,T,V,W,Z,G,z,H=w.length;if(!w.every(function(X){return typeof X=="string"}))return Ht(u,tu);function Q(X){R=X==="next"?function(q){return q.toUpperCase()}:function(q){return q.toLowerCase()},T=X==="next"?function(q){return q.toLowerCase()}:function(q){return q.toUpperCase()},V=X==="next"?l0:u0;var J=w.map(function(q){return{lower:T(q),upper:R(q)}}).sort(function(q,ne){return V(q.lower,ne.lower)});W=J.map(function(q){return q.upper}),Z=J.map(function(q){return q.lower}),z=(G=X)==="next"?"":x}Q("next"),u=new u.Collection(u,function(){return Dr(W[0],Z[H-1]+x)}),u._ondirectionchange=function(X){Q(X)};var K=0;return u._addAlgorithm(function(X,J,q){var ne=X.key;if(typeof ne!="string")return!1;var se=T(ne);if(v(se,Z,K))return!0;for(var ce=null,de=K;de<H;++de){var be=(function(Ee,ve,ye,Ce,Se,xe){for(var De=Math.min(Ee.length,Ce.length),Ve=-1,Ue=0;Ue<De;++Ue){var jt=ve[Ue];if(jt!==Ce[Ue])return Se(Ee[Ue],ye[Ue])<0?Ee.substr(0,Ue)+ye[Ue]+ye.substr(Ue+1):Se(Ee[Ue],Ce[Ue])<0?Ee.substr(0,Ue)+Ce[Ue]+ye.substr(Ue+1):0<=Ve?Ee.substr(0,Ve)+ve[Ve]+ye.substr(Ve+1):null;Se(Ee[Ue],jt)<0&&(Ve=Ue)}return De<Ce.length&&xe==="next"?Ee+ye.substr(Ee.length):De<Ee.length&&xe==="prev"?Ee.substr(0,ye.length):Ve<0?null:Ee.substr(0,Ve)+Ce[Ve]+ye.substr(Ve+1)})(ne,se,W[de],Z[de],V,G);be===null&&ce===null?K=de+1:(ce===null||0<V(ce,be))&&(ce=be)}return J(ce!==null?function(){X.continue(ce+z)}:q),!1}),u}function Dr(u,v,w,x){return{type:2,lower:u,upper:v,lowerOpen:w,upperOpen:x}}function hu(u){return{type:1,lower:u,upper:u}}var fu=(Object.defineProperty(_t.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),_t.prototype.between=function(u,v,w,x){w=w!==!1,x=x===!0;try{return 0<this._cmp(u,v)||this._cmp(u,v)===0&&(w||x)&&(!w||!x)?An(this):new this.Collection(this,function(){return Dr(u,v,!w,!x)})}catch{return Ht(this,yr)}},_t.prototype.equals=function(u){return u==null?Ht(this,yr):new this.Collection(this,function(){return hu(u)})},_t.prototype.above=function(u){return u==null?Ht(this,yr):new this.Collection(this,function(){return Dr(u,void 0,!0)})},_t.prototype.aboveOrEqual=function(u){return u==null?Ht(this,yr):new this.Collection(this,function(){return Dr(u,void 0,!1)})},_t.prototype.below=function(u){return u==null?Ht(this,yr):new this.Collection(this,function(){return Dr(void 0,u,!1,!0)})},_t.prototype.belowOrEqual=function(u){return u==null?Ht(this,yr):new this.Collection(this,function(){return Dr(void 0,u)})},_t.prototype.startsWith=function(u){return typeof u!="string"?Ht(this,tu):this.between(u,u+qr,!0,!0)},_t.prototype.startsWithIgnoreCase=function(u){return u===""?this.startsWith(u):us(this,function(v,w){return v.indexOf(w[0])===0},[u],qr)},_t.prototype.equalsIgnoreCase=function(u){return us(this,function(v,w){return v===w[0]},[u],"")},_t.prototype.anyOfIgnoreCase=function(){var u=U.apply(B,arguments);return u.length===0?An(this):us(this,function(v,w){return w.indexOf(v)!==-1},u,"")},_t.prototype.startsWithAnyOfIgnoreCase=function(){var u=U.apply(B,arguments);return u.length===0?An(this):us(this,function(v,w){return w.some(function(x){return v.indexOf(x)===0})},u,qr)},_t.prototype.anyOf=function(){var u=this,v=U.apply(B,arguments),w=this._cmp;try{v.sort(w)}catch{return Ht(this,yr)}if(v.length===0)return An(this);var x=new this.Collection(this,function(){return Dr(v[0],v[v.length-1])});x._ondirectionchange=function(T){w=T==="next"?u._ascending:u._descending,v.sort(w)};var R=0;return x._addAlgorithm(function(T,V,W){for(var Z=T.key;0<w(Z,v[R]);)if(++R===v.length)return V(W),!1;return w(Z,v[R])===0||(V(function(){T.continue(v[R])}),!1)}),x},_t.prototype.notEqual=function(u){return this.inAnyRange([[-1/0,u],[u,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},_t.prototype.noneOf=function(){var u=U.apply(B,arguments);if(u.length===0)return new this.Collection(this);try{u.sort(this._ascending)}catch{return Ht(this,yr)}var v=u.reduce(function(w,x){return w?w.concat([[w[w.length-1][1],x]]):[[-1/0,x]]},null);return v.push([u[u.length-1],this.db._maxKey]),this.inAnyRange(v,{includeLowers:!1,includeUppers:!1})},_t.prototype.inAnyRange=function(ne,v){var w=this,x=this._cmp,R=this._ascending,T=this._descending,V=this._min,W=this._max;if(ne.length===0)return An(this);if(!ne.every(function(se){return se[0]!==void 0&&se[1]!==void 0&&R(se[0],se[1])<=0}))return Ht(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ie.InvalidArgument);var Z=!v||v.includeLowers!==!1,G=v&&v.includeUppers===!0,z,H=R;function Q(se,ce){return H(se[0],ce[0])}try{(z=ne.reduce(function(se,ce){for(var de=0,be=se.length;de<be;++de){var Ee=se[de];if(x(ce[0],Ee[1])<0&&0<x(ce[1],Ee[0])){Ee[0]=V(Ee[0],ce[0]),Ee[1]=W(Ee[1],ce[1]);break}}return de===be&&se.push(ce),se},[])).sort(Q)}catch{return Ht(this,yr)}var K=0,X=G?function(se){return 0<R(se,z[K][1])}:function(se){return 0<=R(se,z[K][1])},J=Z?function(se){return 0<T(se,z[K][0])}:function(se){return 0<=T(se,z[K][0])},q=X,ne=new this.Collection(this,function(){return Dr(z[0][0],z[z.length-1][1],!Z,!G)});return ne._ondirectionchange=function(se){H=se==="next"?(q=X,R):(q=J,T),z.sort(Q)},ne._addAlgorithm(function(se,ce,de){for(var be,Ee=se.key;q(Ee);)if(++K===z.length)return ce(de),!1;return!X(be=Ee)&&!J(be)||(w._cmp(Ee,z[K][1])===0||w._cmp(Ee,z[K][0])===0||ce(function(){H===R?se.continue(z[K][0]):se.continue(z[K][1])}),!1)}),ne},_t.prototype.startsWithAnyOf=function(){var u=U.apply(B,arguments);return u.every(function(v){return typeof v=="string"})?u.length===0?An(this):this.inAnyRange(u.map(function(v){return[v,v+qr]})):Ht(this,"startsWithAnyOf() only works with strings")},_t);function _t(){}function hr(u){return rt(function(v){return ii(v),u(v.target.error),!1})}function ii(u){u.stopPropagation&&u.stopPropagation(),u.preventDefault&&u.preventDefault()}var si="storagemutated",$o="x-storagemutated-1",Fr=ri(null,si),d0=(fr.prototype._lock=function(){return S(!Re.global),++this._reculock,this._reculock!==1||Re.global||(Re.lockOwnerFor=this),this},fr.prototype._unlock=function(){if(S(!Re.global),--this._reculock==0)for(Re.global||(Re.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var u=this._blockedFuncs.shift();try{zr(u[1],u[0])}catch{}}return this},fr.prototype._locked=function(){return this._reculock&&Re.lockOwnerFor!==this},fr.prototype.create=function(u){var v=this;if(!this.mode)return this;var w=this.db.idbdb,x=this.db._state.dbOpenError;if(S(!this.idbtrans),!u&&!w)switch(x&&x.name){case"DatabaseClosedError":throw new ie.DatabaseClosed(x);case"MissingAPIError":throw new ie.MissingAPI(x.message,x);default:throw new ie.OpenFailed(x)}if(!this.active)throw new ie.TransactionInactive;return S(this._completion._state===null),(u=this.idbtrans=u||(this.db.core||w).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=rt(function(R){ii(R),v._reject(u.error)}),u.onabort=rt(function(R){ii(R),v.active&&v._reject(new ie.Abort(u.error)),v.active=!1,v.on("abort").fire(R)}),u.oncomplete=rt(function(){v.active=!1,v._resolve(),"mutatedParts"in u&&Fr.storagemutated.fire(u.mutatedParts)}),this},fr.prototype._promise=function(u,v,w){var x=this;if(u==="readwrite"&&this.mode!=="readwrite")return lt(new ie.ReadOnly("Transaction is readonly"));if(!this.active)return lt(new ie.TransactionInactive);if(this._locked())return new Ae(function(T,V){x._blockedFuncs.push([function(){x._promise(u,v,w).then(T,V)},Re])});if(w)return Br(function(){var T=new Ae(function(V,W){x._lock();var Z=v(V,W,x);Z&&Z.then&&Z.then(V,W)});return T.finally(function(){return x._unlock()}),T._lib=!0,T});var R=new Ae(function(T,V){var W=v(T,V,x);W&&W.then&&W.then(T,V)});return R._lib=!0,R},fr.prototype._root=function(){return this.parent?this.parent._root():this},fr.prototype.waitFor=function(u){var v,w=this._root(),x=Ae.resolve(u);w._waitingFor?w._waitingFor=w._waitingFor.then(function(){return x}):(w._waitingFor=x,w._waitingQueue=[],v=w.idbtrans.objectStore(w.storeNames[0]),(function T(){for(++w._spinCount;w._waitingQueue.length;)w._waitingQueue.shift()();w._waitingFor&&(v.get(-1/0).onsuccess=T)})());var R=w._waitingFor;return new Ae(function(T,V){x.then(function(W){return w._waitingQueue.push(rt(T.bind(null,W)))},function(W){return w._waitingQueue.push(rt(V.bind(null,W)))}).finally(function(){w._waitingFor===R&&(w._waitingFor=null)})})},fr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ie.Abort))},fr.prototype.table=function(u){var v=this._memoizedTables||(this._memoizedTables={});if(f(v,u))return v[u];var w=this.schema[u];if(!w)throw new ie.NotFound("Table "+u+" not part of transaction");return w=new this.db.Table(u,w,this),w.core=this.db.core.table(u),v[u]=w},fr);function fr(){}function Ho(u,v,w,x,R,T,V,W){return{name:u,keyPath:v,unique:w,multi:x,auto:R,compound:T,src:(w&&!V?"&":"")+(x?"*":"")+(R?"++":"")+pu(v),type:W}}function pu(u){return typeof u=="string"?u:u?"["+[].join.call(u,"+")+"]":""}function jo(u,v,w){return{name:u,primKey:v,indexes:w,mappedClass:null,idxByName:(x=function(R){return[R.name,R]},w.reduce(function(R,T,V){return V=x(T,V),V&&(R[V[0]]=V[1]),R},{}))};var x}var oi=function(u){try{return u.only([[]]),oi=function(){return[[]]},[[]]}catch{return oi=function(){return qr},qr}};function Zo(u){return u==null?function(){}:typeof u=="string"?(v=u).split(".").length===1?function(w){return w[v]}:function(w){return C(w,v)}:function(w){return C(w,u)};var v}function gu(u){return[].slice.call(u)}var h0=0;function ai(u){return u==null?":id":typeof u=="string"?u:"[".concat(u.join("+"),"]")}function f0(u,v,Z){function x(q){if(q.type===3)return null;if(q.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var K=q.lower,X=q.upper,J=q.lowerOpen,q=q.upperOpen;return K===void 0?X===void 0?null:v.upperBound(X,!!q):X===void 0?v.lowerBound(K,!!J):v.bound(K,X,!!J,!!q)}function R(Q){var K,X=Q.name;return{name:X,schema:Q,mutate:function(J){var q=J.trans,ne=J.type,se=J.keys,ce=J.values,de=J.range;return new Promise(function(be,Ee){be=rt(be);var ve=q.objectStore(X),ye=ve.keyPath==null,Ce=ne==="put"||ne==="add";if(!Ce&&ne!=="delete"&&ne!=="deleteRange")throw new Error("Invalid operation type: "+ne);var Se,xe=(se||ce||{length:1}).length;if(se&&ce&&se.length!==ce.length)throw new Error("Given keys array must have same length as given values array.");if(xe===0)return be({numFailures:0,failures:{},results:[],lastResult:void 0});function De(Ot){++jt,ii(Ot)}var Ve=[],Ue=[],jt=0;if(ne==="deleteRange"){if(de.type===4)return be({numFailures:jt,failures:Ue,results:[],lastResult:void 0});de.type===3?Ve.push(Se=ve.clear()):Ve.push(Se=ve.delete(x(de)))}else{var ye=Ce?ye?[ce,se]:[ce,null]:[se,null],Oe=ye[0],Bt=ye[1];if(Ce)for(var Lt=0;Lt<xe;++Lt)Ve.push(Se=Bt&&Bt[Lt]!==void 0?ve[ne](Oe[Lt],Bt[Lt]):ve[ne](Oe[Lt])),Se.onerror=De;else for(Lt=0;Lt<xe;++Lt)Ve.push(Se=ve[ne](Oe[Lt])),Se.onerror=De}function ws(Ot){Ot=Ot.target.result,Ve.forEach(function(rn,la){return rn.error!=null&&(Ue[la]=rn.error)}),be({numFailures:jt,failures:Ue,results:ne==="delete"?se:Ve.map(function(rn){return rn.result}),lastResult:Ot})}Se.onerror=function(Ot){De(Ot),ws(Ot)},Se.onsuccess=ws})},getMany:function(J){var q=J.trans,ne=J.keys;return new Promise(function(se,ce){se=rt(se);for(var de,be=q.objectStore(X),Ee=ne.length,ve=new Array(Ee),ye=0,Ce=0,Se=function(Ve){Ve=Ve.target,ve[Ve._pos]=Ve.result,++Ce===ye&&se(ve)},xe=hr(ce),De=0;De<Ee;++De)ne[De]!=null&&((de=be.get(ne[De]))._pos=De,de.onsuccess=Se,de.onerror=xe,++ye);ye===0&&se(ve)})},get:function(J){var q=J.trans,ne=J.key;return new Promise(function(se,ce){se=rt(se);var de=q.objectStore(X).get(ne);de.onsuccess=function(be){return se(be.target.result)},de.onerror=hr(ce)})},query:(K=G,function(J){return new Promise(function(q,ne){q=rt(q);var se,ce,de,ye=J.trans,be=J.values,Ee=J.limit,Se=J.query,ve=Ee===1/0?void 0:Ee,Ce=Se.index,Se=Se.range,ye=ye.objectStore(X),Ce=Ce.isPrimaryKey?ye:ye.index(Ce.name),Se=x(Se);if(Ee===0)return q({result:[]});K?((ve=be?Ce.getAll(Se,ve):Ce.getAllKeys(Se,ve)).onsuccess=function(xe){return q({result:xe.target.result})},ve.onerror=hr(ne)):(se=0,ce=!be&&"openKeyCursor"in Ce?Ce.openKeyCursor(Se):Ce.openCursor(Se),de=[],ce.onsuccess=function(xe){var De=ce.result;return De?(de.push(be?De.value:De.primaryKey),++se===Ee?q({result:de}):void De.continue()):q({result:de})},ce.onerror=hr(ne))})}),openCursor:function(J){var q=J.trans,ne=J.values,se=J.query,ce=J.reverse,de=J.unique;return new Promise(function(be,Ee){be=rt(be);var Ce=se.index,ve=se.range,ye=q.objectStore(X),ye=Ce.isPrimaryKey?ye:ye.index(Ce.name),Ce=ce?de?"prevunique":"prev":de?"nextunique":"next",Se=!ne&&"openKeyCursor"in ye?ye.openKeyCursor(x(ve),Ce):ye.openCursor(x(ve),Ce);Se.onerror=hr(Ee),Se.onsuccess=rt(function(xe){var De,Ve,Ue,jt,Oe=Se.result;Oe?(Oe.___id=++h0,Oe.done=!1,De=Oe.continue.bind(Oe),Ve=(Ve=Oe.continuePrimaryKey)&&Ve.bind(Oe),Ue=Oe.advance.bind(Oe),jt=function(){throw new Error("Cursor not stopped")},Oe.trans=q,Oe.stop=Oe.continue=Oe.continuePrimaryKey=Oe.advance=function(){throw new Error("Cursor not started")},Oe.fail=rt(Ee),Oe.next=function(){var Bt=this,Lt=1;return this.start(function(){return Lt--?Bt.continue():Bt.stop()}).then(function(){return Bt})},Oe.start=function(Bt){function Lt(){if(Se.result)try{Bt()}catch(Ot){Oe.fail(Ot)}else Oe.done=!0,Oe.start=function(){throw new Error("Cursor behind last entry")},Oe.stop()}var ws=new Promise(function(Ot,rn){Ot=rt(Ot),Se.onerror=hr(rn),Oe.fail=rn,Oe.stop=function(la){Oe.stop=Oe.continue=Oe.continuePrimaryKey=Oe.advance=jt,Ot(la)}});return Se.onsuccess=rt(function(Ot){Se.onsuccess=Lt,Lt()}),Oe.continue=De,Oe.continuePrimaryKey=Ve,Oe.advance=Ue,Lt(),ws},be(Oe)):be(null)},Ee)})},count:function(J){var q=J.query,ne=J.trans,se=q.index,ce=q.range;return new Promise(function(de,be){var Ee=ne.objectStore(X),ve=se.isPrimaryKey?Ee:Ee.index(se.name),Ee=x(ce),ve=Ee?ve.count(Ee):ve.count();ve.onsuccess=rt(function(ye){return de(ye.target.result)}),ve.onerror=hr(be)})}}}var T,V,W,z=(V=Z,W=gu((T=u).objectStoreNames),{schema:{name:T.name,tables:W.map(function(Q){return V.objectStore(Q)}).map(function(Q){var K=Q.keyPath,q=Q.autoIncrement,X=s(K),J={},q={name:Q.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:K==null,compound:X,keyPath:K,autoIncrement:q,unique:!0,extractKey:Zo(K)},indexes:gu(Q.indexNames).map(function(ne){return Q.index(ne)}).map(function(de){var se=de.name,ce=de.unique,be=de.multiEntry,de=de.keyPath,be={name:se,compound:s(de),keyPath:de,unique:ce,multiEntry:be,extractKey:Zo(de)};return J[ai(de)]=be}),getIndexByKeyPath:function(ne){return J[ai(ne)]}};return J[":id"]=q.primaryKey,K!=null&&(J[ai(K)]=q.primaryKey),q})},hasGetAll:0<W.length&&"getAll"in V.objectStore(W[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Z=z.schema,G=z.hasGetAll,z=Z.tables.map(R),H={};return z.forEach(function(Q){return H[Q.name]=Q}),{stack:"dbcore",transaction:u.transaction.bind(u),table:function(Q){if(!H[Q])throw new Error("Table '".concat(Q,"' not found"));return H[Q]},MIN_KEY:-1/0,MAX_KEY:oi(v),schema:Z}}function p0(u,v,w,x){var R=w.IDBKeyRange;return w.indexedDB,{dbcore:(x=f0(v,R,x),u.dbcore.reduce(function(T,V){return V=V.create,n(n({},T),V(T))},x))}}function ds(u,x){var w=x.db,x=p0(u._middlewares,w,u._deps,x);u.core=x.dbcore,u.tables.forEach(function(R){var T=R.name;u.core.schema.tables.some(function(V){return V.name===T})&&(R.core=u.core.table(T),u[T]instanceof u.Table&&(u[T].core=R.core))})}function hs(u,v,w,x){w.forEach(function(R){var T=x[R];v.forEach(function(V){var W=(function Z(G,z){return d(G,z)||(G=c(G))&&Z(G,z)})(V,R);(!W||"value"in W&&W.value===void 0)&&(V===u.Transaction.prototype||V instanceof u.Transaction?k(V,R,{get:function(){return this.table(R)},set:function(Z){_(this,R,{value:Z,writable:!0,configurable:!0,enumerable:!0})}}):V[R]=new u.Table(R,T))})})}function Go(u,v){v.forEach(function(w){for(var x in w)w[x]instanceof u.Table&&delete w[x]})}function g0(u,v){return u._cfg.version-v._cfg.version}function m0(u,v,w,x){var R=u._dbSchema;w.objectStoreNames.contains("$meta")&&!R.$meta&&(R.$meta=jo("$meta",vu("")[0],[]),u._storeNames.push("$meta"));var T=u._createTransaction("readwrite",u._storeNames,R);T.create(w),T._completion.catch(x);var V=T._reject.bind(T),W=Re.transless||Re;Br(function(){return Re.trans=T,Re.transless=W,v!==0?(ds(u,w),G=v,((Z=T).storeNames.includes("$meta")?Z.table("$meta").get("version").then(function(z){return z??G}):Ae.resolve(G)).then(function(z){return Q=z,K=T,X=w,J=[],z=(H=u)._versions,q=H._dbSchema=ps(0,H.idbdb,X),(z=z.filter(function(ne){return ne._cfg.version>=Q})).length!==0?(z.forEach(function(ne){J.push(function(){var se=q,ce=ne._cfg.dbschema;gs(H,se,X),gs(H,ce,X),q=H._dbSchema=ce;var de=Ko(se,ce);de.add.forEach(function(Ce){Yo(X,Ce[0],Ce[1].primKey,Ce[1].indexes)}),de.change.forEach(function(Ce){if(Ce.recreate)throw new ie.Upgrade("Not yet support for changing primary key");var Se=X.objectStore(Ce.name);Ce.add.forEach(function(xe){return fs(Se,xe)}),Ce.change.forEach(function(xe){Se.deleteIndex(xe.name),fs(Se,xe)}),Ce.del.forEach(function(xe){return Se.deleteIndex(xe)})});var be=ne._cfg.contentUpgrade;if(be&&ne._cfg.version>Q){ds(H,X),K._memoizedTables={};var Ee=E(ce);de.del.forEach(function(Ce){Ee[Ce]=se[Ce]}),Go(H,[H.Transaction.prototype]),hs(H,[H.Transaction.prototype],l(Ee),Ee),K.schema=Ee;var ve,ye=F(be);return ye&&Cn(),de=Ae.follow(function(){var Ce;(ve=be(K))&&ye&&(Ce=Lr.bind(null,null),ve.then(Ce,Ce))}),ve&&typeof ve.then=="function"?Ae.resolve(ve):de.then(function(){return ve})}}),J.push(function(se){var ce,de,be=ne._cfg.dbschema;ce=be,de=se,[].slice.call(de.db.objectStoreNames).forEach(function(Ee){return ce[Ee]==null&&de.db.deleteObjectStore(Ee)}),Go(H,[H.Transaction.prototype]),hs(H,[H.Transaction.prototype],H._storeNames,H._dbSchema),K.schema=H._dbSchema}),J.push(function(se){H.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(H.idbdb.version/10)===ne._cfg.version?(H.idbdb.deleteObjectStore("$meta"),delete H._dbSchema.$meta,H._storeNames=H._storeNames.filter(function(ce){return ce!=="$meta"})):se.objectStore("$meta").put(ne._cfg.version,"version"))})}),(function ne(){return J.length?Ae.resolve(J.shift()(K.idbtrans)).then(ne):Ae.resolve()})().then(function(){mu(q,X)})):Ae.resolve();var H,Q,K,X,J,q}).catch(V)):(l(R).forEach(function(z){Yo(w,z,R[z].primKey,R[z].indexes)}),ds(u,w),void Ae.follow(function(){return u.on.populate.fire(T)}).catch(V));var Z,G})}function v0(u,v){mu(u._dbSchema,v),v.db.version%10!=0||v.objectStoreNames.contains("$meta")||v.db.createObjectStore("$meta").add(Math.ceil(v.db.version/10-1),"version");var w=ps(0,u.idbdb,v);gs(u,u._dbSchema,v);for(var x=0,R=Ko(w,u._dbSchema).change;x<R.length;x++){var T=(function(V){if(V.change.length||V.recreate)return console.warn("Unable to patch indexes of table ".concat(V.name," because it has changes on the type of index or primary key.")),{value:void 0};var W=v.objectStore(V.name);V.add.forEach(function(Z){Mt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(V.name,".").concat(Z.src)),fs(W,Z)})})(R[x]);if(typeof T=="object")return T.value}}function Ko(u,v){var w,x={del:[],add:[],change:[]};for(w in u)v[w]||x.del.push(w);for(w in v){var R=u[w],T=v[w];if(R){var V={name:w,def:T,recreate:!1,del:[],add:[],change:[]};if(""+(R.primKey.keyPath||"")!=""+(T.primKey.keyPath||"")||R.primKey.auto!==T.primKey.auto)V.recreate=!0,x.change.push(V);else{var W=R.idxByName,Z=T.idxByName,G=void 0;for(G in W)Z[G]||V.del.push(G);for(G in Z){var z=W[G],H=Z[G];z?z.src!==H.src&&V.change.push(H):V.add.push(H)}(0<V.del.length||0<V.add.length||0<V.change.length)&&x.change.push(V)}}else x.add.push([w,T])}return x}function Yo(u,v,w,x){var R=u.db.createObjectStore(v,w.keyPath?{keyPath:w.keyPath,autoIncrement:w.auto}:{autoIncrement:w.auto});return x.forEach(function(T){return fs(R,T)}),R}function mu(u,v){l(u).forEach(function(w){v.db.objectStoreNames.contains(w)||(Mt&&console.debug("Dexie: Creating missing table",w),Yo(v,w,u[w].primKey,u[w].indexes))})}function fs(u,v){u.createIndex(v.name,v.keyPath,{unique:v.unique,multiEntry:v.multi})}function ps(u,v,w){var x={};return h(v.objectStoreNames,0).forEach(function(R){for(var T=w.objectStore(R),V=Ho(pu(G=T.keyPath),G||"",!0,!1,!!T.autoIncrement,G&&typeof G!="string",!0),W=[],Z=0;Z<T.indexNames.length;++Z){var z=T.index(T.indexNames[Z]),G=z.keyPath,z=Ho(z.name,G,!!z.unique,!!z.multiEntry,!1,G&&typeof G!="string",!1);W.push(z)}x[R]=jo(R,V,W)}),x}function gs(u,v,w){for(var x=w.db.objectStoreNames,R=0;R<x.length;++R){var T=x[R],V=w.objectStore(T);u._hasGetAll="getAll"in V;for(var W=0;W<V.indexNames.length;++W){var Z=V.indexNames[W],G=V.index(Z).keyPath,z=typeof G=="string"?G:"["+h(G).join("+")+"]";!v[T]||(G=v[T].idxByName[z])&&(G.name=Z,delete v[T].idxByName[z],v[T].idxByName[Z]=G)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(u._hasGetAll=!1)}function vu(u){return u.split(",").map(function(v,w){var T=v.split(":"),x=(R=T[1])===null||R===void 0?void 0:R.trim(),R=(v=T[0].trim()).replace(/([&*]|\+\+)/g,""),T=/^\[/.test(R)?R.match(/^\[(.*)\]$/)[1].split("+"):R;return Ho(R,T||null,/\&/.test(v),/\*/.test(v),/\+\+/.test(v),s(T),w===0,x)})}var b0=(xn.prototype._createTableSchema=jo,xn.prototype._parseIndexSyntax=vu,xn.prototype._parseStoresSpec=function(u,v){var w=this;l(u).forEach(function(x){if(u[x]!==null){var R=w._parseIndexSyntax(u[x]),T=R.shift();if(!T)throw new ie.Schema("Invalid schema for table "+x+": "+u[x]);if(T.unique=!0,T.multi)throw new ie.Schema("Primary key cannot be multiEntry*");R.forEach(function(V){if(V.auto)throw new ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!V.keyPath)throw new ie.Schema("Index must have a name and cannot be an empty string")}),R=w._createTableSchema(x,T,R),v[x]=R}})},xn.prototype.stores=function(w){var v=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,w):w;var w=v._versions,x={},R={};return w.forEach(function(T){a(x,T._cfg.storesSource),R=T._cfg.dbschema={},T._parseStoresSpec(x,R)}),v._dbSchema=R,Go(v,[v._allTables,v,v.Transaction.prototype]),hs(v,[v._allTables,v,v.Transaction.prototype,this._cfg.tables],l(R),R),v._storeNames=l(R),this},xn.prototype.upgrade=function(u){return this._cfg.contentUpgrade=Yr(this._cfg.contentUpgrade||he,u),this},xn);function xn(){}function Xo(u,v){var w=u._dbNamesDB;return w||(w=u._dbNamesDB=new Sr(ss,{addons:[],indexedDB:u,IDBKeyRange:v})).version(1).stores({dbnames:"name"}),w.table("dbnames")}function Jo(u){return u&&typeof u.databases=="function"}function zo(u){return Br(function(){return Re.letThrough=!0,u()})}function qo(u){return!("from"in u)}var Tt=function(u,v){if(!this){var w=new Tt;return u&&"d"in u&&a(w,u),w}a(this,arguments.length?{d:1,from:u,to:1<arguments.length?v:u}:{d:0})};function ci(u,v,w){var x=je(v,w);if(!isNaN(x)){if(0<x)throw RangeError();if(qo(u))return a(u,{from:v,to:w,d:1});var R=u.l,x=u.r;if(je(w,u.from)<0)return R?ci(R,v,w):u.l={from:v,to:w,d:1,l:null,r:null},_u(u);if(0<je(v,u.to))return x?ci(x,v,w):u.r={from:v,to:w,d:1,l:null,r:null},_u(u);je(v,u.from)<0&&(u.from=v,u.l=null,u.d=x?x.d+1:1),0<je(w,u.to)&&(u.to=w,u.r=null,u.d=u.l?u.l.d+1:1),w=!u.r,R&&!u.l&&li(u,R),x&&w&&li(u,x)}}function li(u,v){qo(v)||(function w(x,Z){var T=Z.from,V=Z.to,W=Z.l,Z=Z.r;ci(x,T,V),W&&w(x,W),Z&&w(x,Z)})(u,v)}function bu(u,v){var w=ms(v),x=w.next();if(x.done)return!1;for(var R=x.value,T=ms(u),V=T.next(R.from),W=V.value;!x.done&&!V.done;){if(je(W.from,R.to)<=0&&0<=je(W.to,R.from))return!0;je(R.from,W.from)<0?R=(x=w.next(W.from)).value:W=(V=T.next(R.from)).value}return!1}function ms(u){var v=qo(u)?null:{s:0,n:u};return{next:function(w){for(var x=0<arguments.length;v;)switch(v.s){case 0:if(v.s=1,x)for(;v.n.l&&je(w,v.n.from)<0;)v={up:v,n:v.n.l,s:1};else for(;v.n.l;)v={up:v,n:v.n.l,s:1};case 1:if(v.s=2,!x||je(w,v.n.to)<=0)return{value:v.n,done:!1};case 2:if(v.n.r){v.s=3,v={up:v,n:v.n.r,s:0};continue}case 3:v=v.up}return{done:!0}}}}function _u(u){var v,w,x=(((v=u.r)===null||v===void 0?void 0:v.d)||0)-(((w=u.l)===null||w===void 0?void 0:w.d)||0),R=1<x?"r":x<-1?"l":"";R&&(v=R=="r"?"l":"r",w=n({},u),x=u[R],u.from=x.from,u.to=x.to,u[R]=x[R],w[R]=x[v],(u[v]=w).d=yu(w)),u.d=yu(u)}function yu(w){var v=w.r,w=w.l;return(v?w?Math.max(v.d,w.d):v.d:w?w.d:0)+1}function vs(u,v){return l(v).forEach(function(w){u[w]?li(u[w],v[w]):u[w]=(function x(R){var T,V,W={};for(T in R)f(R,T)&&(V=R[T],W[T]=!V||typeof V!="object"||P.has(V.constructor)?V:x(V));return W})(v[w])}),u}function Qo(u,v){return u.all||v.all||Object.keys(u).some(function(w){return v[w]&&bu(v[w],u[w])})}b(Tt.prototype,((er={add:function(u){return li(this,u),this},addKey:function(u){return ci(this,u,u),this},addKeys:function(u){var v=this;return u.forEach(function(w){return ci(v,w,w)}),this},hasKey:function(u){var v=ms(this).next(u).value;return v&&je(v.from,u)<=0&&0<=je(v.to,u)}})[ge]=function(){return ms(this)},er));var en={},ea={},ta=!1;function bs(u){vs(ea,u),ta||(ta=!0,setTimeout(function(){ta=!1,ra(ea,!(ea={}))},0))}function ra(u,v){v===void 0&&(v=!1);var w=new Set;if(u.all)for(var x=0,R=Object.values(en);x<R.length;x++)Su(V=R[x],u,w,v);else for(var T in u){var V,W=/^idb\:\/\/(.*)\/(.*)\//.exec(T);W&&(T=W[1],W=W[2],(V=en["idb://".concat(T,"/").concat(W)])&&Su(V,u,w,v))}w.forEach(function(Z){return Z()})}function Su(u,v,w,x){for(var R=[],T=0,V=Object.entries(u.queries.query);T<V.length;T++){for(var W=V[T],Z=W[0],G=[],z=0,H=W[1];z<H.length;z++){var Q=H[z];Qo(v,Q.obsSet)?Q.subscribers.forEach(function(q){return w.add(q)}):x&&G.push(Q)}x&&R.push([Z,G])}if(x)for(var K=0,X=R;K<X.length;K++){var J=X[K],Z=J[0],G=J[1];u.queries.query[Z]=G}}function _0(u){var v=u._state,w=u._deps.indexedDB;if(v.isBeingOpened||u.idbdb)return v.dbReadyPromise.then(function(){return v.dbOpenError?lt(v.dbOpenError):u});v.isBeingOpened=!0,v.dbOpenError=null,v.openComplete=!1;var x=v.openCanceller,R=Math.round(10*u.verno),T=!1;function V(){if(v.openCanceller!==x)throw new ie.DatabaseClosed("db.open() was cancelled")}function W(){return new Ae(function(Q,K){if(V(),!w)throw new ie.MissingAPI;var X=u.name,J=v.autoSchema||!R?w.open(X):w.open(X,R);if(!J)throw new ie.MissingAPI;J.onerror=hr(K),J.onblocked=rt(u._fireOnBlocked),J.onupgradeneeded=rt(function(q){var ne;z=J.transaction,v.autoSchema&&!u._options.allowEmptyDB?(J.onerror=ii,z.abort(),J.result.close(),(ne=w.deleteDatabase(X)).onsuccess=ne.onerror=rt(function(){K(new ie.NoSuchDatabase("Database ".concat(X," doesnt exist")))})):(z.onerror=hr(K),q=q.oldVersion>Math.pow(2,62)?0:q.oldVersion,H=q<1,u.idbdb=J.result,T&&v0(u,z),m0(u,q/10,z,K))},K),J.onsuccess=rt(function(){z=null;var q,ne,se,ce,de,be=u.idbdb=J.result,Ee=h(be.objectStoreNames);if(0<Ee.length)try{var ve=be.transaction((ce=Ee).length===1?ce[0]:ce,"readonly");if(v.autoSchema)ne=be,se=ve,(q=u).verno=ne.version/10,se=q._dbSchema=ps(0,ne,se),q._storeNames=h(ne.objectStoreNames,0),hs(q,[q._allTables],l(se),se);else if(gs(u,u._dbSchema,ve),((de=Ko(ps(0,(de=u).idbdb,ve),de._dbSchema)).add.length||de.change.some(function(ye){return ye.add.length||ye.change.length}))&&!T)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),be.close(),R=be.version+1,T=!0,Q(W());ds(u,ve)}catch{}kn.push(u),be.onversionchange=rt(function(ye){v.vcFired=!0,u.on("versionchange").fire(ye)}),be.onclose=rt(function(){u.close({disableAutoOpen:!1})}),H&&(de=u._deps,ve=X,be=de.indexedDB,de=de.IDBKeyRange,Jo(be)||ve===ss||Xo(be,de).put({name:ve}).catch(he)),Q()},K)}).catch(function(Q){switch(Q==null?void 0:Q.name){case"UnknownError":if(0<v.PR1398_maxLoop)return v.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),W();break;case"VersionError":if(0<R)return R=0,W()}return Ae.reject(Q)})}var Z,G=v.dbReadyResolve,z=null,H=!1;return Ae.race([x,(typeof navigator>"u"?Ae.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Q){function K(){return indexedDB.databases().finally(Q)}Z=setInterval(K,100),K()}).finally(function(){return clearInterval(Z)}):Promise.resolve()).then(W)]).then(function(){return V(),v.onReadyBeingFired=[],Ae.resolve(zo(function(){return u.on.ready.fire(u.vip)})).then(function Q(){if(0<v.onReadyBeingFired.length){var K=v.onReadyBeingFired.reduce(Yr,he);return v.onReadyBeingFired=[],Ae.resolve(zo(function(){return K(u.vip)})).then(Q)}})}).finally(function(){v.openCanceller===x&&(v.onReadyBeingFired=null,v.isBeingOpened=!1)}).catch(function(Q){v.dbOpenError=Q;try{z&&z.abort()}catch{}return x===v.openCanceller&&u._close(),lt(Q)}).finally(function(){v.openComplete=!0,G()}).then(function(){var Q;return H&&(Q={},u.tables.forEach(function(K){K.schema.indexes.forEach(function(X){X.name&&(Q["idb://".concat(u.name,"/").concat(K.name,"/").concat(X.name)]=new Tt(-1/0,[[[]]]))}),Q["idb://".concat(u.name,"/").concat(K.name,"/")]=Q["idb://".concat(u.name,"/").concat(K.name,"/:dels")]=new Tt(-1/0,[[[]]])}),Fr(si).fire(Q),ra(Q,!0)),u})}function na(u){function v(T){return u.next(T)}var w=R(v),x=R(function(T){return u.throw(T)});function R(T){return function(Z){var W=T(Z),Z=W.value;return W.done?Z:Z&&typeof Z.then=="function"?Z.then(w,x):s(Z)?Promise.all(Z).then(w,x):w(Z)}}return R(v)()}function _s(u,v,w){for(var x=s(u)?u.slice():[u],R=0;R<w;++R)x.push(v);return x}var y0={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(u){return n(n({},u),{table:function(v){var w=u.table(v),x=w.schema,R={},T=[];function V(H,Q,K){var X=ai(H),J=R[X]=R[X]||[],q=H==null?0:typeof H=="string"?1:H.length,ne=0<Q,ne=n(n({},K),{name:ne?"".concat(X,"(virtual-from:").concat(K.name,")"):K.name,lowLevelIndex:K,isVirtual:ne,keyTail:Q,keyLength:q,extractKey:Zo(H),unique:!ne&&K.unique});return J.push(ne),ne.isPrimaryKey||T.push(ne),1<q&&V(q===2?H[0]:H.slice(0,q-1),Q+1,K),J.sort(function(se,ce){return se.keyTail-ce.keyTail}),ne}v=V(x.primaryKey.keyPath,0,x.primaryKey),R[":id"]=[v];for(var W=0,Z=x.indexes;W<Z.length;W++){var G=Z[W];V(G.keyPath,0,G)}function z(H){var Q,K=H.query.index;return K.isVirtual?n(n({},H),{query:{index:K.lowLevelIndex,range:(Q=H.query.range,K=K.keyTail,{type:Q.type===1?2:Q.type,lower:_s(Q.lower,Q.lowerOpen?u.MAX_KEY:u.MIN_KEY,K),lowerOpen:!0,upper:_s(Q.upper,Q.upperOpen?u.MIN_KEY:u.MAX_KEY,K),upperOpen:!0})}}):H}return n(n({},w),{schema:n(n({},x),{primaryKey:v,indexes:T,getIndexByKeyPath:function(H){return(H=R[ai(H)])&&H[0]}}),count:function(H){return w.count(z(H))},query:function(H){return w.query(z(H))},openCursor:function(H){var Q=H.query.index,K=Q.keyTail,X=Q.isVirtual,J=Q.keyLength;return X?w.openCursor(z(H)).then(function(ne){return ne&&q(ne)}):w.openCursor(H);function q(ne){return Object.create(ne,{continue:{value:function(se){se!=null?ne.continue(_s(se,H.reverse?u.MAX_KEY:u.MIN_KEY,K)):H.unique?ne.continue(ne.key.slice(0,J).concat(H.reverse?u.MIN_KEY:u.MAX_KEY,K)):ne.continue()}},continuePrimaryKey:{value:function(se,ce){ne.continuePrimaryKey(_s(se,u.MAX_KEY,K),ce)}},primaryKey:{get:function(){return ne.primaryKey}},key:{get:function(){var se=ne.key;return J===1?se[0]:se.slice(0,J)}},value:{get:function(){return ne.value}}})}}})}})}};function ia(u,v,w,x){return w=w||{},x=x||"",l(u).forEach(function(R){var T,V,W;f(v,R)?(T=u[R],V=v[R],typeof T=="object"&&typeof V=="object"&&T&&V?(W=le(T))!==le(V)?w[x+R]=v[R]:W==="Object"?ia(T,V,w,x+R+"."):T!==V&&(w[x+R]=v[R]):T!==V&&(w[x+R]=v[R])):w[x+R]=void 0}),l(v).forEach(function(R){f(u,R)||(w[x+R]=v[R])}),w}function sa(u,v){return v.type==="delete"?v.keys:v.keys||v.values.map(u.extractKey)}var S0={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(u){return n(n({},u),{table:function(v){var w=u.table(v),x=w.schema.primaryKey;return n(n({},w),{mutate:function(R){var T=Re.trans,V=T.table(v).hook,W=V.deleting,Z=V.creating,G=V.updating;switch(R.type){case"add":if(Z.fire===he)break;return T._promise("readwrite",function(){return z(R)},!0);case"put":if(Z.fire===he&&G.fire===he)break;return T._promise("readwrite",function(){return z(R)},!0);case"delete":if(W.fire===he)break;return T._promise("readwrite",function(){return z(R)},!0);case"deleteRange":if(W.fire===he)break;return T._promise("readwrite",function(){return(function H(Q,K,X){return w.query({trans:Q,values:!1,query:{index:x,range:K},limit:X}).then(function(J){var q=J.result;return z({type:"delete",keys:q,trans:Q}).then(function(ne){return 0<ne.numFailures?Promise.reject(ne.failures[0]):q.length<X?{failures:[],numFailures:0,lastResult:void 0}:H(Q,n(n({},K),{lower:q[q.length-1],lowerOpen:!0}),X)})})})(R.trans,R.range,1e4)},!0)}return w.mutate(R);function z(H){var Q,K,X,J=Re.trans,q=H.keys||sa(x,H);if(!q)throw new Error("Keys missing");return(H=H.type==="add"||H.type==="put"?n(n({},H),{keys:q}):n({},H)).type!=="delete"&&(H.values=i([],H.values)),H.keys&&(H.keys=i([],H.keys)),Q=w,X=q,((K=H).type==="add"?Promise.resolve([]):Q.getMany({trans:K.trans,keys:X,cache:"immutable"})).then(function(ne){var se=q.map(function(ce,de){var be,Ee,ve,ye=ne[de],Ce={onerror:null,onsuccess:null};return H.type==="delete"?W.fire.call(Ce,ce,ye,J):H.type==="add"||ye===void 0?(be=Z.fire.call(Ce,ce,H.values[de],J),ce==null&&be!=null&&(H.keys[de]=ce=be,x.outbound||A(H.values[de],x.keyPath,ce))):(be=ia(ye,H.values[de]),(Ee=G.fire.call(Ce,be,ce,ye,J))&&(ve=H.values[de],Object.keys(Ee).forEach(function(Se){f(ve,Se)?ve[Se]=Ee[Se]:A(ve,Se,Ee[Se])}))),Ce});return w.mutate(H).then(function(ce){for(var de=ce.failures,be=ce.results,Ee=ce.numFailures,ce=ce.lastResult,ve=0;ve<q.length;++ve){var ye=(be||q)[ve],Ce=se[ve];ye==null?Ce.onerror&&Ce.onerror(de[ve]):Ce.onsuccess&&Ce.onsuccess(H.type==="put"&&ne[ve]?H.values[ve]:ye)}return{failures:de,results:be,numFailures:Ee,lastResult:ce}}).catch(function(ce){return se.forEach(function(de){return de.onerror&&de.onerror(ce)}),Promise.reject(ce)})})}}})}})}};function wu(u,v,w){try{if(!v||v.keys.length<u.length)return null;for(var x=[],R=0,T=0;R<v.keys.length&&T<u.length;++R)je(v.keys[R],u[T])===0&&(x.push(w?D(v.values[R]):v.values[R]),++T);return x.length===u.length?x:null}catch{return null}}var w0={stack:"dbcore",level:-1,create:function(u){return{table:function(v){var w=u.table(v);return n(n({},w),{getMany:function(x){if(!x.cache)return w.getMany(x);var R=wu(x.keys,x.trans._cache,x.cache==="clone");return R?Ae.resolve(R):w.getMany(x).then(function(T){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?D(T):T},T})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),w.mutate(x)}})}}}};function Eu(u,v){return u.trans.mode==="readonly"&&!!u.subscr&&!u.trans.explicit&&u.trans.db._options.cache!=="disabled"&&!v.schema.primaryKey.outbound}function Cu(u,v){switch(u){case"query":return v.values&&!v.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var E0={stack:"dbcore",level:0,name:"Observability",create:function(u){var v=u.schema.name,w=new Tt(u.MIN_KEY,u.MAX_KEY);return n(n({},u),{transaction:function(x,R,T){if(Re.subscr&&R!=="readonly")throw new ie.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Re.querier));return u.transaction(x,R,T)},table:function(x){var R=u.table(x),T=R.schema,V=T.primaryKey,H=T.indexes,W=V.extractKey,Z=V.outbound,G=V.autoIncrement&&H.filter(function(K){return K.compound&&K.keyPath.includes(V.keyPath)}),z=n(n({},R),{mutate:function(K){function X(Se){return Se="idb://".concat(v,"/").concat(x,"/").concat(Se),ce[Se]||(ce[Se]=new Tt)}var J,q,ne,se=K.trans,ce=K.mutatedParts||(K.mutatedParts={}),de=X(""),be=X(":dels"),Ee=K.type,Ce=K.type==="deleteRange"?[K.range]:K.type==="delete"?[K.keys]:K.values.length<50?[sa(V,K).filter(function(Se){return Se}),K.values]:[],ve=Ce[0],ye=Ce[1],Ce=K.trans._cache;return s(ve)?(de.addKeys(ve),(Ce=Ee==="delete"||ve.length===ye.length?wu(ve,Ce):null)||be.addKeys(ve),(Ce||ye)&&(J=X,q=Ce,ne=ye,T.indexes.forEach(function(Se){var xe=J(Se.name||"");function De(Ue){return Ue!=null?Se.extractKey(Ue):null}function Ve(Ue){return Se.multiEntry&&s(Ue)?Ue.forEach(function(jt){return xe.addKey(jt)}):xe.addKey(Ue)}(q||ne).forEach(function(Ue,Bt){var Oe=q&&De(q[Bt]),Bt=ne&&De(ne[Bt]);je(Oe,Bt)!==0&&(Oe!=null&&Ve(Oe),Bt!=null&&Ve(Bt))})}))):ve?(ye={from:(ye=ve.lower)!==null&&ye!==void 0?ye:u.MIN_KEY,to:(ye=ve.upper)!==null&&ye!==void 0?ye:u.MAX_KEY},be.add(ye),de.add(ye)):(de.add(w),be.add(w),T.indexes.forEach(function(Se){return X(Se.name).add(w)})),R.mutate(K).then(function(Se){return!ve||K.type!=="add"&&K.type!=="put"||(de.addKeys(Se.results),G&&G.forEach(function(xe){for(var De=K.values.map(function(Oe){return xe.extractKey(Oe)}),Ve=xe.keyPath.findIndex(function(Oe){return Oe===V.keyPath}),Ue=0,jt=Se.results.length;Ue<jt;++Ue)De[Ue][Ve]=Se.results[Ue];X(xe.name).addKeys(De)})),se.mutatedParts=vs(se.mutatedParts||{},ce),Se})}}),H=function(X){var J=X.query,X=J.index,J=J.range;return[X,new Tt((X=J.lower)!==null&&X!==void 0?X:u.MIN_KEY,(J=J.upper)!==null&&J!==void 0?J:u.MAX_KEY)]},Q={get:function(K){return[V,new Tt(K.key)]},getMany:function(K){return[V,new Tt().addKeys(K.keys)]},count:H,query:H,openCursor:H};return l(Q).forEach(function(K){z[K]=function(X){var J=Re.subscr,q=!!J,ne=Eu(Re,R)&&Cu(K,X)?X.obsSet={}:J;if(q){var se=function(ye){return ye="idb://".concat(v,"/").concat(x,"/").concat(ye),ne[ye]||(ne[ye]=new Tt)},ce=se(""),de=se(":dels"),J=Q[K](X),q=J[0],J=J[1];if((K==="query"&&q.isPrimaryKey&&!X.values?de:se(q.name||"")).add(J),!q.isPrimaryKey){if(K!=="count"){var be=K==="query"&&Z&&X.values&&R.query(n(n({},X),{values:!1}));return R[K].apply(this,arguments).then(function(ye){if(K==="query"){if(Z&&X.values)return be.then(function(De){return De=De.result,ce.addKeys(De),ye});var Ce=X.values?ye.result.map(W):ye.result;(X.values?ce:de).addKeys(Ce)}else if(K==="openCursor"){var Se=ye,xe=X.values;return Se&&Object.create(Se,{key:{get:function(){return de.addKey(Se.primaryKey),Se.key}},primaryKey:{get:function(){var De=Se.primaryKey;return de.addKey(De),De}},value:{get:function(){return xe&&ce.addKey(Se.primaryKey),Se.value}}})}return ye})}de.add(w)}}return R[K].apply(this,arguments)}}),z}})}};function ku(u,v,w){if(w.numFailures===0)return v;if(v.type==="deleteRange")return null;var x=v.keys?v.keys.length:"values"in v&&v.values?v.values.length:1;return w.numFailures===x?null:(v=n({},v),s(v.keys)&&(v.keys=v.keys.filter(function(R,T){return!(T in w.failures)})),"values"in v&&s(v.values)&&(v.values=v.values.filter(function(R,T){return!(T in w.failures)})),v)}function oa(u,v){return w=u,((x=v).lower===void 0||(x.lowerOpen?0<je(w,x.lower):0<=je(w,x.lower)))&&(u=u,(v=v).upper===void 0||(v.upperOpen?je(u,v.upper)<0:je(u,v.upper)<=0));var w,x}function Iu(u,v,Q,x,R,T){if(!Q||Q.length===0)return u;var V=v.query.index,W=V.multiEntry,Z=v.query.range,G=x.schema.primaryKey.extractKey,z=V.extractKey,H=(V.lowLevelIndex||V).extractKey,Q=Q.reduce(function(K,X){var J=K,q=[];if(X.type==="add"||X.type==="put")for(var ne=new Tt,se=X.values.length-1;0<=se;--se){var ce,de=X.values[se],be=G(de);ne.hasKey(be)||(ce=z(de),(W&&s(ce)?ce.some(function(Se){return oa(Se,Z)}):oa(ce,Z))&&(ne.addKey(be),q.push(de)))}switch(X.type){case"add":var Ee=new Tt().addKeys(v.values?K.map(function(xe){return G(xe)}):K),J=K.concat(v.values?q.filter(function(xe){return xe=G(xe),!Ee.hasKey(xe)&&(Ee.addKey(xe),!0)}):q.map(function(xe){return G(xe)}).filter(function(xe){return!Ee.hasKey(xe)&&(Ee.addKey(xe),!0)}));break;case"put":var ve=new Tt().addKeys(X.values.map(function(xe){return G(xe)}));J=K.filter(function(xe){return!ve.hasKey(v.values?G(xe):xe)}).concat(v.values?q:q.map(function(xe){return G(xe)}));break;case"delete":var ye=new Tt().addKeys(X.keys);J=K.filter(function(xe){return!ye.hasKey(v.values?G(xe):xe)});break;case"deleteRange":var Ce=X.range;J=K.filter(function(xe){return!oa(G(xe),Ce)})}return J},u);return Q===u?u:(Q.sort(function(K,X){return je(H(K),H(X))||je(G(K),G(X))}),v.limit&&v.limit<1/0&&(Q.length>v.limit?Q.length=v.limit:u.length===v.limit&&Q.length<v.limit&&(R.dirty=!0)),T?Object.freeze(Q):Q)}function Au(u,v){return je(u.lower,v.lower)===0&&je(u.upper,v.upper)===0&&!!u.lowerOpen==!!v.lowerOpen&&!!u.upperOpen==!!v.upperOpen}function C0(u,v){return(function(w,x,R,T){if(w===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=je(w,x))===0){if(R&&T)return 0;if(R)return 1;if(T)return-1}return x})(u.lower,v.lower,u.lowerOpen,v.lowerOpen)<=0&&0<=(function(w,x,R,T){if(w===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=je(w,x))===0){if(R&&T)return 0;if(R)return-1;if(T)return 1}return x})(u.upper,v.upper,u.upperOpen,v.upperOpen)}function k0(u,v,w,x){u.subscribers.add(w),x.addEventListener("abort",function(){var R,T;u.subscribers.delete(w),u.subscribers.size===0&&(R=u,T=v,setTimeout(function(){R.subscribers.size===0&&me(T,R)},3e3))})}var I0={stack:"dbcore",level:0,name:"Cache",create:function(u){var v=u.schema.name;return n(n({},u),{transaction:function(w,x,R){var T,V,W=u.transaction(w,x,R);return x==="readwrite"&&(V=(T=new AbortController).signal,R=function(Z){return function(){if(T.abort(),x==="readwrite"){for(var G=new Set,z=0,H=w;z<H.length;z++){var Q=H[z],K=en["idb://".concat(v,"/").concat(Q)];if(K){var X=u.table(Q),J=K.optimisticOps.filter(function(xe){return xe.trans===W});if(W._explicit&&Z&&W.mutatedParts)for(var q=0,ne=Object.values(K.queries.query);q<ne.length;q++)for(var se=0,ce=(Ee=ne[q]).slice();se<ce.length;se++)Qo((ve=ce[se]).obsSet,W.mutatedParts)&&(me(Ee,ve),ve.subscribers.forEach(function(xe){return G.add(xe)}));else if(0<J.length){K.optimisticOps=K.optimisticOps.filter(function(xe){return xe.trans!==W});for(var de=0,be=Object.values(K.queries.query);de<be.length;de++)for(var Ee,ve,ye,Ce=0,Se=(Ee=be[de]).slice();Ce<Se.length;Ce++)(ve=Se[Ce]).res!=null&&W.mutatedParts&&(Z&&!ve.dirty?(ye=Object.isFrozen(ve.res),ye=Iu(ve.res,ve.req,J,X,ve,ye),ve.dirty?(me(Ee,ve),ve.subscribers.forEach(function(xe){return G.add(xe)})):ye!==ve.res&&(ve.res=ye,ve.promise=Ae.resolve({result:ye}))):(ve.dirty&&me(Ee,ve),ve.subscribers.forEach(function(xe){return G.add(xe)})))}}}G.forEach(function(xe){return xe()})}}},W.addEventListener("abort",R(!1),{signal:V}),W.addEventListener("error",R(!1),{signal:V}),W.addEventListener("complete",R(!0),{signal:V})),W},table:function(w){var x=u.table(w),R=x.schema.primaryKey;return n(n({},x),{mutate:function(T){var V=Re.trans;if(R.outbound||V.db._options.cache==="disabled"||V.explicit||V.idbtrans.mode!=="readwrite")return x.mutate(T);var W=en["idb://".concat(v,"/").concat(w)];return W?(V=x.mutate(T),T.type!=="add"&&T.type!=="put"||!(50<=T.values.length||sa(R,T).some(function(Z){return Z==null}))?(W.optimisticOps.push(T),T.mutatedParts&&bs(T.mutatedParts),V.then(function(Z){0<Z.numFailures&&(me(W.optimisticOps,T),(Z=ku(0,T,Z))&&W.optimisticOps.push(Z),T.mutatedParts&&bs(T.mutatedParts))}),V.catch(function(){me(W.optimisticOps,T),T.mutatedParts&&bs(T.mutatedParts)})):V.then(function(Z){var G=ku(0,n(n({},T),{values:T.values.map(function(z,H){var Q;return Z.failures[H]?z:(z=(Q=R.keyPath)!==null&&Q!==void 0&&Q.includes(".")?D(z):n({},z),A(z,R.keyPath,Z.results[H]),z)})}),Z);W.optimisticOps.push(G),queueMicrotask(function(){return T.mutatedParts&&bs(T.mutatedParts)})}),V):x.mutate(T)},query:function(T){if(!Eu(Re,x)||!Cu("query",T))return x.query(T);var V=((G=Re.trans)===null||G===void 0?void 0:G.db._options.cache)==="immutable",H=Re,W=H.requery,Z=H.signal,G=(function(X,J,q,ne){var se=en["idb://".concat(X,"/").concat(J)];if(!se)return[];if(!(J=se.queries[q]))return[null,!1,se,null];var ce=J[(ne.query?ne.query.index.name:null)||""];if(!ce)return[null,!1,se,null];switch(q){case"query":var de=ce.find(function(be){return be.req.limit===ne.limit&&be.req.values===ne.values&&Au(be.req.query.range,ne.query.range)});return de?[de,!0,se,ce]:[ce.find(function(be){return("limit"in be.req?be.req.limit:1/0)>=ne.limit&&(!ne.values||be.req.values)&&C0(be.req.query.range,ne.query.range)}),!1,se,ce];case"count":return de=ce.find(function(be){return Au(be.req.query.range,ne.query.range)}),[de,!!de,se,ce]}})(v,w,"query",T),z=G[0],H=G[1],Q=G[2],K=G[3];return z&&H?z.obsSet=T.obsSet:(H=x.query(T).then(function(X){var J=X.result;if(z&&(z.res=J),V){for(var q=0,ne=J.length;q<ne;++q)Object.freeze(J[q]);Object.freeze(J)}else X.result=D(J);return X}).catch(function(X){return K&&z&&me(K,z),Promise.reject(X)}),z={obsSet:T.obsSet,promise:H,subscribers:new Set,type:"query",req:T,dirty:!1},K?K.push(z):(K=[z],(Q=Q||(en["idb://".concat(v,"/").concat(w)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[T.query.index.name||""]=K)),k0(z,K,W,Z),z.promise.then(function(X){return{result:Iu(X.result,T,Q==null?void 0:Q.optimisticOps,x,z,V)}})}})}})}};function ys(u,v){return new Proxy(u,{get:function(w,x,R){return x==="db"?v:Reflect.get(w,x,R)}})}var Sr=(ut.prototype.version=function(u){if(isNaN(u)||u<.1)throw new ie.Type("Given version is not a positive number");if(u=Math.round(10*u)/10,this.idbdb||this._state.isBeingOpened)throw new ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,u);var v=this._versions,w=v.filter(function(x){return x._cfg.version===u})[0];return w||(w=new this.Version(u),v.push(w),v.sort(g0),w.stores({}),this._state.autoSchema=!1,w)},ut.prototype._whenReady=function(u){var v=this;return this.idbdb&&(this._state.openComplete||Re.letThrough||this._vip)?u():new Ae(function(w,x){if(v._state.openComplete)return x(new ie.DatabaseClosed(v._state.dbOpenError));if(!v._state.isBeingOpened){if(!v._state.autoOpen)return void x(new ie.DatabaseClosed);v.open().catch(he)}v._state.dbReadyPromise.then(w,x)}).then(u)},ut.prototype.use=function(u){var v=u.stack,w=u.create,x=u.level,R=u.name;return R&&this.unuse({stack:v,name:R}),u=this._middlewares[v]||(this._middlewares[v]=[]),u.push({stack:v,create:w,level:x??10,name:R}),u.sort(function(T,V){return T.level-V.level}),this},ut.prototype.unuse=function(u){var v=u.stack,w=u.name,x=u.create;return v&&this._middlewares[v]&&(this._middlewares[v]=this._middlewares[v].filter(function(R){return x?R.create!==x:!!w&&R.name!==w})),this},ut.prototype.open=function(){var u=this;return zr(Tr,function(){return _0(u)})},ut.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var u=this._state,v=kn.indexOf(this);if(0<=v&&kn.splice(v,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}u.isBeingOpened||(u.dbReadyPromise=new Ae(function(w){u.dbReadyResolve=w}),u.openCanceller=new Ae(function(w,x){u.cancelOpen=x}))},ut.prototype.close=function(w){var v=(w===void 0?{disableAutoOpen:!0}:w).disableAutoOpen,w=this._state;v?(w.isBeingOpened&&w.cancelOpen(new ie.DatabaseClosed),this._close(),w.autoOpen=!1,w.dbOpenError=new ie.DatabaseClosed):(this._close(),w.autoOpen=this._options.autoOpen||w.isBeingOpened,w.openComplete=!1,w.dbOpenError=null)},ut.prototype.delete=function(u){var v=this;u===void 0&&(u={disableAutoOpen:!0});var w=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new Ae(function(R,T){function V(){v.close(u);var W=v._deps.indexedDB.deleteDatabase(v.name);W.onsuccess=rt(function(){var Z,G,z;Z=v._deps,G=v.name,z=Z.indexedDB,Z=Z.IDBKeyRange,Jo(z)||G===ss||Xo(z,Z).delete(G).catch(he),R()}),W.onerror=hr(T),W.onblocked=v._fireOnBlocked}if(w)throw new ie.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(V):V()})},ut.prototype.backendDB=function(){return this.idbdb},ut.prototype.isOpen=function(){return this.idbdb!==null},ut.prototype.hasBeenClosed=function(){var u=this._state.dbOpenError;return u&&u.name==="DatabaseClosed"},ut.prototype.hasFailed=function(){return this._state.dbOpenError!==null},ut.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(ut.prototype,"tables",{get:function(){var u=this;return l(this._allTables).map(function(v){return u._allTables[v]})},enumerable:!1,configurable:!0}),ut.prototype.transaction=function(){var u=(function(v,w,x){var R=arguments.length;if(R<2)throw new ie.InvalidArgument("Too few arguments");for(var T=new Array(R-1);--R;)T[R-1]=arguments[R];return x=T.pop(),[v,O(T),x]}).apply(this,arguments);return this._transaction.apply(this,u)},ut.prototype._transaction=function(u,v,w){var x=this,R=Re.trans;R&&R.db===this&&u.indexOf("!")===-1||(R=null);var T,V,W=u.indexOf("?")!==-1;u=u.replace("!","").replace("?","");try{if(V=v.map(function(G){if(G=G instanceof x.Table?G.name:G,typeof G!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return G}),u=="r"||u===Mo)T=Mo;else{if(u!="rw"&&u!=Uo)throw new ie.InvalidArgument("Invalid transaction mode: "+u);T=Uo}if(R){if(R.mode===Mo&&T===Uo){if(!W)throw new ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");R=null}R&&V.forEach(function(G){if(R&&R.storeNames.indexOf(G)===-1){if(!W)throw new ie.SubTransaction("Table "+G+" not included in parent transaction.");R=null}}),W&&R&&!R.active&&(R=null)}}catch(G){return R?R._promise(null,function(z,H){H(G)}):lt(G)}var Z=(function G(z,H,Q,K,X){return Ae.resolve().then(function(){var J=Re.transless||Re,q=z._createTransaction(H,Q,z._dbSchema,K);if(q.explicit=!0,J={trans:q,transless:J},K)q.idbtrans=K.idbtrans;else try{q.create(),q.idbtrans._explicit=!0,z._state.PR1398_maxLoop=3}catch(ce){return ce.name===Y.InvalidState&&z.isOpen()&&0<--z._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),z.close({disableAutoOpen:!1}),z.open().then(function(){return G(z,H,Q,null,X)})):lt(ce)}var ne,se=F(X);return se&&Cn(),J=Ae.follow(function(){var ce;(ne=X.call(q,q))&&(se?(ce=Lr.bind(null,null),ne.then(ce,ce)):typeof ne.next=="function"&&typeof ne.throw=="function"&&(ne=na(ne)))},J),(ne&&typeof ne.then=="function"?Ae.resolve(ne).then(function(ce){return q.active?ce:lt(new ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):J.then(function(){return ne})).then(function(ce){return K&&q._resolve(),q._completion.then(function(){return ce})}).catch(function(ce){return q._reject(ce),lt(ce)})})}).bind(null,this,T,V,R,w);return R?R._promise(T,Z,"lock"):Re.trans?zr(Re.transless,function(){return x._whenReady(Z)}):this._whenReady(Z)},ut.prototype.table=function(u){if(!f(this._allTables,u))throw new ie.InvalidTable("Table ".concat(u," does not exist"));return this._allTables[u]},ut);function ut(u,v){var w=this;this._middlewares={},this.verno=0;var x=ut.dependencies;this._options=v=n({addons:ut.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},v),this._deps={indexedDB:v.indexedDB,IDBKeyRange:v.IDBKeyRange},x=v.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var R,T,V,W,Z,G={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:he,dbReadyPromise:null,cancelOpen:he,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:v.autoOpen};G.dbReadyPromise=new Ae(function(H){G.dbReadyResolve=H}),G.openCanceller=new Ae(function(H,Q){G.cancelOpen=Q}),this._state=G,this.name=u,this.on=ri(this,"populate","blocked","versionchange","close",{ready:[Yr,he]}),this.once=function(H,Q){var K=function(){for(var X=[],J=0;J<arguments.length;J++)X[J]=arguments[J];w.on(H).unsubscribe(K),Q.apply(w,X)};return w.on(H,K)},this.on.ready.subscribe=m(this.on.ready.subscribe,function(H){return function(Q,K){ut.vip(function(){var X,J=w._state;J.openComplete?(J.dbOpenError||Ae.resolve().then(Q),K&&H(Q)):J.onReadyBeingFired?(J.onReadyBeingFired.push(Q),K&&H(Q)):(H(Q),X=w,K||H(function q(){X.on.ready.unsubscribe(Q),X.on.ready.unsubscribe(q)}))})}}),this.Collection=(R=this,ni(c0.prototype,function(ne,q){this.db=R;var K=ru,X=null;if(q)try{K=q()}catch(se){X=se}var J=ne._ctx,q=J.table,ne=q.hook.reading.fire;this._ctx={table:q,index:J.index,isPrimKey:!J.index||q.schema.primKey.keyPath&&J.index===q.schema.primKey.name,range:K,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:X,or:J.or,valueMapper:ne!==Fe?ne:null}})),this.Table=(T=this,ni(cu.prototype,function(H,Q,K){this.db=T,this._tx=K,this.name=H,this.schema=Q,this.hook=T._allTables[H]?T._allTables[H].hook:ri(null,{creating:[Rt,he],reading:[tt,Fe],updating:[Kr,he],deleting:[Le,he]})})),this.Transaction=(V=this,ni(d0.prototype,function(H,Q,K,X,J){var q=this;H!=="readonly"&&Q.forEach(function(ne){ne=(ne=K[ne])===null||ne===void 0?void 0:ne.yProps,ne&&(Q=Q.concat(ne.map(function(se){return se.updatesTable})))}),this.db=V,this.mode=H,this.storeNames=Q,this.schema=K,this.chromeTransactionDurability=X,this.idbtrans=null,this.on=ri(this,"complete","error","abort"),this.parent=J||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ae(function(ne,se){q._resolve=ne,q._reject=se}),this._completion.then(function(){q.active=!1,q.on.complete.fire()},function(ne){var se=q.active;return q.active=!1,q.on.error.fire(ne),q.parent?q.parent._reject(ne):se&&q.idbtrans&&q.idbtrans.abort(),lt(ne)})})),this.Version=(W=this,ni(b0.prototype,function(H){this.db=W,this._cfg={version:H,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Z=this,ni(fu.prototype,function(H,Q,K){if(this.db=Z,this._ctx={table:H,index:Q===":id"?null:Q,or:K},this._cmp=this._ascending=je,this._descending=function(X,J){return je(J,X)},this._max=function(X,J){return 0<je(X,J)?X:J},this._min=function(X,J){return je(X,J)<0?X:J},this._IDBKeyRange=Z._deps.IDBKeyRange,!this._IDBKeyRange)throw new ie.MissingAPI})),this.on("versionchange",function(H){0<H.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function(H){!H.newVersion||H.newVersion<H.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat(H.oldVersion/10))}),this._maxKey=oi(v.IDBKeyRange),this._createTransaction=function(H,Q,K,X){return new w.Transaction(H,Q,K,w._options.chromeTransactionDurability,X)},this._fireOnBlocked=function(H){w.on("blocked").fire(H),kn.filter(function(Q){return Q.name===w.name&&Q!==w&&!Q._state.vcFired}).map(function(Q){return Q.on("versionchange").fire(H)})},this.use(w0),this.use(I0),this.use(E0),this.use(y0),this.use(S0);var z=new Proxy(this,{get:function(H,Q,K){if(Q==="_vip")return!0;if(Q==="table")return function(J){return ys(w.table(J),z)};var X=Reflect.get(H,Q,K);return X instanceof cu?ys(X,z):Q==="tables"?X.map(function(J){return ys(J,z)}):Q==="_createTransaction"?function(){return ys(X.apply(this,arguments),z)}:X}});this.vip=z,x.forEach(function(H){return H(w)})}var Ss,er=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",A0=(aa.prototype.subscribe=function(u,v,w){return this._subscribe(u&&typeof u!="function"?u:{next:u,error:v,complete:w})},aa.prototype[er]=function(){return this},aa);function aa(u){this._subscribe=u}try{Ss={indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch{Ss={indexedDB:null,IDBKeyRange:null}}function xu(u){var v,w=!1,x=new A0(function(R){var T=F(u),V,W=!1,Z={},G={},z={get closed(){return W},unsubscribe:function(){W||(W=!0,V&&V.abort(),H&&Fr.storagemutated.unsubscribe(K))}};R.start&&R.start(z);var H=!1,Q=function(){return Vo(X)},K=function(J){vs(Z,J),Qo(G,Z)&&Q()},X=function(){var J,q,ne;!W&&Ss.indexedDB&&(Z={},J={},V&&V.abort(),V=new AbortController,ne=(function(se){var ce=wn();try{T&&Cn();var de=Br(u,se);return de=T?de.finally(Lr):de}finally{ce&&En()}})(q={subscr:J,signal:V.signal,requery:Q,querier:u,trans:null}),Promise.resolve(ne).then(function(se){w=!0,v=se,W||q.signal.aborted||(Z={},(function(ce){for(var de in ce)if(f(ce,de))return;return 1})(G=J)||H||(Fr(si,K),H=!0),Vo(function(){return!W&&R.next&&R.next(se)}))},function(se){w=!1,["DatabaseClosedError","AbortError"].includes(se==null?void 0:se.name)||W||Vo(function(){W||R.error&&R.error(se)})}))};return setTimeout(Q,0),z});return x.hasValue=function(){return w},x.getValue=function(){return v},x}var tn=Sr;function ca(u){var v=Vr;try{Vr=!0,Fr.storagemutated.fire(u),ra(u,!0)}finally{Vr=v}}b(tn,n(n({},ke),{delete:function(u){return new tn(u,{addons:[]}).delete()},exists:function(u){return new tn(u,{addons:[]}).open().then(function(v){return v.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(u){try{return v=tn.dependencies,w=v.indexedDB,v=v.IDBKeyRange,(Jo(w)?Promise.resolve(w.databases()).then(function(x){return x.map(function(R){return R.name}).filter(function(R){return R!==ss})}):Xo(w,v).toCollection().primaryKeys()).then(u)}catch{return lt(new ie.MissingAPI)}var v,w},defineClass:function(){return function(u){a(this,u)}},ignoreTransaction:function(u){return Re.trans?zr(Re.transless,u):u()},vip:zo,async:function(u){return function(){try{var v=na(u.apply(this,arguments));return v&&typeof v.then=="function"?v:Ae.resolve(v)}catch(w){return lt(w)}}},spawn:function(u,v,w){try{var x=na(u.apply(w,v||[]));return x&&typeof x.then=="function"?x:Ae.resolve(x)}catch(R){return lt(R)}},currentTransaction:{get:function(){return Re.trans||null}},waitFor:function(u,v){return v=Ae.resolve(typeof u=="function"?tn.ignoreTransaction(u):u).timeout(v||6e4),Re.trans?Re.trans.waitFor(v):v},Promise:Ae,debug:{get:function(){return Mt},set:function(u){Xr(u)}},derive:y,extend:a,props:b,override:m,Events:ri,on:Fr,liveQuery:xu,extendObservabilitySet:vs,getByKeyPath:C,setByKeyPath:A,delByKeyPath:function(u,v){typeof v=="string"?A(u,v,void 0):"length"in v&&[].map.call(v,function(w){A(u,w,void 0)})},shallowClone:E,deepClone:D,getObjectDiff:ia,cmp:je,asap:I,minKey:-1/0,addons:[],connections:kn,errnames:Y,dependencies:Ss,cache:en,semVer:"4.2.1",version:"4.2.1".split(".").map(function(u){return parseInt(u)}).reduce(function(u,v,w){return u+v/Math.pow(10,2*w)})})),tn.maxKey=oi(tn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Fr(si,function(u){Vr||(u=new CustomEvent($o,{detail:u}),Vr=!0,dispatchEvent(u),Vr=!1)}),addEventListener($o,function(u){u=u.detail,Vr||ca(u)}));var Rn,Vr=!1,Ru=function(){};return typeof BroadcastChannel<"u"&&((Ru=function(){(Rn=new BroadcastChannel($o)).onmessage=function(u){return u.data&&ca(u.data)}})(),typeof Rn.unref=="function"&&Rn.unref(),Fr(si,function(u){Vr||Rn.postMessage(u)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(u){if(!Sr.disableBfCache&&u.persisted){Mt&&console.debug("Dexie: handling persisted pagehide"),Rn!=null&&Rn.close();for(var v=0,w=kn;v<w.length;v++)w[v].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(u){!Sr.disableBfCache&&u.persisted&&(Mt&&console.debug("Dexie: handling persisted pageshow"),Ru(),ca({all:new Tt(-1/0,[[]])}))})),Ae.rejectionMapper=function(u,v){return!u||u instanceof oe||u instanceof TypeError||u instanceof SyntaxError||!u.name||!ae[u.name]?u:(v=new ae[u.name](v||u.message,u),"stack"in u&&k(v,"stack",{get:function(){return this.inner.stack}}),v)},Xr(Mt),n(Sr,Object.freeze({__proto__:null,Dexie:Sr,liveQuery:xu,Entity:nu,cmp:je,PropModification:ti,replacePrefix:function(u,v){return new ti({replacePrefix:[u,v]})},add:function(u){return new ti({add:u})},remove:function(u){return new ti({remove:u})},default:Sr,RangeSet:Tt,mergeRanges:li,rangesOverlap:bu}),{default:Sr}),Sr})})(Fs)),Fs.exports}var sy=iy();const Ga=ag(sy),Fd=Symbol.for("Dexie"),Ys=globalThis[Fd]||(globalThis[Fd]=Ga);if(Ga.semVer!==Ys.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ga.semVer} and ${Ys.semVer}`);const{liveQuery:KC,mergeRanges:YC,rangesOverlap:XC,RangeSet:JC,cmp:zC,Entity:qC,PropModification:QC,replacePrefix:e5,add:t5,remove:r5,DexieYProvider:n5}=Ys;var Ka=function(e,t){return Ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ka(e,t)};function Zr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ka(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Ya(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],l;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){l={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return o}function Js(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function vr(e){return typeof e=="function"}function cg(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var ya=cg(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
6
6
|
`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
7
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function zs(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Zi=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var s=Ya(u),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else u.remove(this);var m=this.initialTeardown;if(mr(m))try{m()}catch(y){o=y instanceof ya?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var b=Ya(f),_=b.next();!_.done;_=b.next()){var k=_.value;try{Td(k)}catch(y){o=o??[],y instanceof ya?o=Js(Js([],Xs(o)),Xs(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new ya(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Td(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&zs(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&zs(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),rg=Zi.EMPTY;function ng(e){return e instanceof Zi||e&&"closed"in e&&mr(e.remove)&&mr(e.add)&&mr(e.unsubscribe)}function Td(e){mr(e)?e():e.unsubscribe()}var W1={Promise:void 0},H1={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Js([e,t],Xs(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function $1(e){H1.setTimeout(function(){throw e})}function Bd(){}function Vs(e){e()}var il=(function(e){Zr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,ng(r)&&r.add(n)):n.destination=j1,n}return t.create=function(r,n,i){return new Xa(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Zi),G1=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){ks(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){ks(n)}else ks(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ks(r)}},e})(),Xa=(function(e){Zr(t,e);function t(r,n,i){var o=e.call(this)||this,u;return mr(r)||!r?u={next:r??void 0,error:n??void 0,complete:i??void 0}:u=r,o.destination=new G1(u),o}return t})(il);function ks(e){$1(e)}function Z1(e){throw e}var j1={closed:!0,next:Bd,error:Z1,complete:Bd},K1=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Y1(e){return e}function X1(e){return e.length===0?Y1:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var Ld=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=z1(t)?t:new Xa(t,r,n);return Vs(function(){var u=i,s=u.operator,a=u.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Od(r),new r(function(i,o){var u=new Xa({next:function(s){try{t(s)}catch(a){o(a),u.unsubscribe()}},error:o,complete:i});n.subscribe(u)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[K1]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return X1(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Od(t),new t(function(n,i){var o;r.subscribe(function(u){return o=u},function(u){return i(u)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function Od(e){var t;return(t=e??W1.Promise)!==null&&t!==void 0?t:Promise}function J1(e){return e&&mr(e.next)&&mr(e.error)&&mr(e.complete)}function z1(e){return e&&e instanceof il||J1(e)&&ng(e)}function q1(e){return mr(e==null?void 0:e.lift)}function Q1(e){return function(t){if(q1(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ey(e,t,r,n,i){return new ty(e,t,r,n,i)}var ty=(function(e){Zr(t,e);function t(r,n,i,o,u,s){var a=e.call(this,r)||this;return a.onFinalize=u,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(m){r.error(m)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(il),ry=tg(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ig=(function(e){Zr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Dd(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new ry},t.prototype.next=function(r){var n=this;Vs(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var u=Ya(n.currentObservers),s=u.next();!s.done;s=u.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Vs(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Vs(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,u=i.isStopped,s=i.observers;return o||u?rg:(this.currentObservers=null,s.push(r),new Zi(function(){n.currentObservers=null,zs(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,u=n.isStopped;i?r.error(o):u&&r.complete()},t.prototype.asObservable=function(){var r=new Ld;return r.source=this,r},t.create=function(r,n){return new Dd(r,n)},t})(Ld),Dd=(function(e){Zr(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:rg},t})(ig),ny={now:function(){return Date.now()}},iy=(function(e){Zr(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Zi),Fd={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Js([e,t],Xs(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},sy=(function(e){Zr(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,u=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(u,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Fd.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Fd.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(u){i=!0,o=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,zs(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(iy),Vd=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=ny.now,e})(),oy=(function(e){Zr(t,e);function t(r,n){n===void 0&&(n=Vd.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(Vd),ay=new oy(sy);function cy(e,t){return t===void 0&&(t=ay),Q1(function(r,n){var i=null,o=null,u=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=u+e,m=t.now();if(m<c){i=this.schedule(void 0,c-m),n.add(i);return}s()}r.subscribe(ey(n,function(c){o=c,u=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}class ly extends Ys{constructor(r,n,i){super(r);ui(this,"sessions");ui(this,"principal");ui(this,"client");ui(this,"saveSubject",new ig);this.principal=n,this.client=i,this.version(1).stores({sessions:"id, principal, name, created, updated"}),this.saveSubject.pipe(cy(200)).subscribe(async({id:o,notebook:u})=>{if(!o){console.warn(new Date().toISOString(),"no id to save notebook");return}const s={id:o,principal:this.principal,name:sg(),created:Date.now(),updated:Date.now(),data:u};console.log(new Date().toISOString(),"saving Notebook",o,u),await this.sessions.put(s)})}async saveNotebook(r,n){this.saveSubject.next({id:r,notebook:n})}async loadSession(r){return this.sessions.get(r)}async loadSessions(r){return(await this.sessions.bulkGet(r)).filter(i=>!!i)}async listSessions(){return this.sessions.orderBy("updated").reverse().toArray()}query(){return this.sessions.where("principal").equals(this.principal)}async listActiveSessions(){const r=Date.now(),n=r-1440*60*1e3,i=await this.query().and(s=>s.updated>=n).and(s=>s.updated<=r).reverse().primaryKeys();let o=[];try{o=await Promise.all(i.map(s=>this.client.getSession(Ge(Op,{id:s})).catch(a=>{const c=Je.from(a);if(!(c.code===Pe.Unknown&&c.message.includes("session not found")))throw a})))}catch(s){return console.error("Error listing active sessions",s),[]}return o.map(s=>{var a;return(a=s==null?void 0:s.session)==null?void 0:a.id}).filter(s=>!!s)}async deleteSession(r){await this.sessions.delete(r)}async createSession(){var r;try{return(r=(await this.client.createSession({project:Ge(Tp,{root:".",envLoadOrder:[".env",".env.local",".env.development",".env.dev"]}),config:{envStoreSeeding:Lp.SYSTEM}})).session)==null?void 0:r.id}catch(n){throw console.error("Error creating session",n),n}}}function sg(){return new Date().toISOString()}var Ja=function(e,t){return Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ja(e,t)};function jr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ja(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function uy(e,t,r,n){function i(o){return o instanceof r?o:new r(function(u){u(o)})}return new(r||(r=Promise))(function(o,u){function s(m){try{c(n.next(m))}catch(f){u(f)}}function a(m){try{c(n.throw(m))}catch(f){u(f)}}function c(m){m.done?o(m.value):i(m.value).then(s,a)}c((n=n.apply(e,[])).next())})}function og(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(c){return function(m){return a([c,m])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(m){c=[6,m],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Gn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ar(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){u={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return o}function Hr(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Vn(e){return this instanceof Vn?(this.v=e,this):new Vn(e)}function dy(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof Vn?Promise.resolve(_.value.v).then(m,f):b(o[0][2],_)}function m(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}}function hy(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Gn=="function"?Gn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(u){return new Promise(function(s,a){u=e[o](u),i(s,a,u.done,u.value)})}}function i(o,u,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},u)}}/**
|
|
7
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function zs(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Zi=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var s=Ya(l),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else l.remove(this);var g=this.initialTeardown;if(vr(g))try{g()}catch(y){o=y instanceof ya?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var b=Ya(f),_=b.next();!_.done;_=b.next()){var k=_.value;try{Vd(k)}catch(y){o=o??[],y instanceof ya?o=Js(Js([],Xs(o)),Xs(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new ya(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Vd(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&zs(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&zs(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),lg=Zi.EMPTY;function ug(e){return e instanceof Zi||e&&"closed"in e&&vr(e.remove)&&vr(e.add)&&vr(e.unsubscribe)}function Vd(e){vr(e)?e():e.unsubscribe()}var oy={Promise:void 0},ay={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Js([e,t],Xs(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function cy(e){ay.setTimeout(function(){throw e})}function Md(){}function Vs(e){e()}var sl=(function(e){Zr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,ug(r)&&r.add(n)):n.destination=dy,n}return t.create=function(r,n,i){return new Xa(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Zi),ly=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){ks(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){ks(n)}else ks(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ks(r)}},e})(),Xa=(function(e){Zr(t,e);function t(r,n,i){var o=e.call(this)||this,l;return vr(r)||!r?l={next:r??void 0,error:n??void 0,complete:i??void 0}:l=r,o.destination=new ly(l),o}return t})(sl);function ks(e){cy(e)}function uy(e){throw e}var dy={closed:!0,next:Md,error:uy,complete:Md},hy=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function fy(e){return e}function py(e){return e.length===0?fy:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var Ud=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=my(t)?t:new Xa(t,r,n);return Vs(function(){var l=i,s=l.operator,a=l.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Pd(r),new r(function(i,o){var l=new Xa({next:function(s){try{t(s)}catch(a){o(a),l.unsubscribe()}},error:o,complete:i});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[hy]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return py(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Pd(t),new t(function(n,i){var o;r.subscribe(function(l){return o=l},function(l){return i(l)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function Pd(e){var t;return(t=e??oy.Promise)!==null&&t!==void 0?t:Promise}function gy(e){return e&&vr(e.next)&&vr(e.error)&&vr(e.complete)}function my(e){return e&&e instanceof sl||gy(e)&&ug(e)}function vy(e){return vr(e==null?void 0:e.lift)}function by(e){return function(t){if(vy(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function _y(e,t,r,n,i){return new yy(e,t,r,n,i)}var yy=(function(e){Zr(t,e);function t(r,n,i,o,l,s){var a=e.call(this,r)||this;return a.onFinalize=l,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(g){r.error(g)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(sl),Sy=cg(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),dg=(function(e){Zr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Wd(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Sy},t.prototype.next=function(r){var n=this;Vs(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Ya(n.currentObservers),s=l.next();!s.done;s=l.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Vs(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Vs(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,l=i.isStopped,s=i.observers;return o||l?lg:(this.currentObservers=null,s.push(r),new Zi(function(){n.currentObservers=null,zs(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,l=n.isStopped;i?r.error(o):l&&r.complete()},t.prototype.asObservable=function(){var r=new Ud;return r.source=this,r},t.create=function(r,n){return new Wd(r,n)},t})(Ud),Wd=(function(e){Zr(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:lg},t})(dg),wy={now:function(){return Date.now()}},Ey=(function(e){Zr(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Zi),$d={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Js([e,t],Xs(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Cy=(function(e){Zr(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,l=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(l,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),$d.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&$d.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(l){i=!0,o=l||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,zs(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Ey),Hd=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=wy.now,e})(),ky=(function(e){Zr(t,e);function t(r,n){n===void 0&&(n=Hd.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(Hd),Iy=new ky(Cy);function Ay(e,t){return t===void 0&&(t=Iy),by(function(r,n){var i=null,o=null,l=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=l+e,g=t.now();if(g<c){i=this.schedule(void 0,c-g),n.add(i);return}s()}r.subscribe(_y(n,function(c){o=c,l=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}class xy extends Ys{constructor(r,n,i){super(r);ui(this,"sessions");ui(this,"principal");ui(this,"client");ui(this,"saveSubject",new dg);this.principal=n,this.client=i,this.version(1).stores({sessions:"id, principal, name, created, updated"}),this.saveSubject.pipe(Ay(200)).subscribe(async({id:o,notebook:l})=>{if(!o){console.warn(new Date().toISOString(),"no id to save notebook");return}const s={id:o,principal:this.principal,name:ol(),created:Date.now(),updated:Date.now(),data:l};await this.sessions.put(s)})}async saveNotebook(r,n){this.saveSubject.next({id:r,notebook:n})}async loadSession(r){return this.sessions.get(r)}async loadSessions(r){return(await this.sessions.bulkGet(r)).filter(i=>!!i)}async listSessions(){return this.sessions.orderBy("updated").reverse().toArray()}query(){return this.sessions.where("principal").equals(this.principal)}async listActiveSessions(){const r=Date.now(),n=r-1440*60*1e3,i=await this.query().and(s=>s.updated>=n).and(s=>s.updated<=r).reverse().primaryKeys();let o=[];try{o=await Promise.all(i.map(s=>this.client.getSession(Ze(Wp,{id:s})).catch(a=>{const c=Je.from(a);if(!(c.code===He.Unknown&&c.message.includes("session not found")))throw a})))}catch(s){return console.error("Error listing active sessions",s),[]}return o.map(s=>{var a;return(a=s==null?void 0:s.session)==null?void 0:a.id}).filter(s=>!!s)}async deleteSession(r){await this.sessions.delete(r)}async createSession(){var r;try{return(r=(await this.client.createSession({project:Ze(Mp,{root:".",envLoadOrder:[".env",".env.local",".env.development",".env.dev"]}),config:{envStoreSeeding:Pp.SYSTEM}})).session)==null?void 0:r.id}catch(n){throw console.error("Error creating session",n),n}}}function ol(){return new Date().toISOString()}function jd(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return t}function Zd(e){if(!e||e.trim().length===0)return BigInt(0);const t=e.toLowerCase().split(/\s+/).filter(i=>i.length>0);if(t.length===0)return BigInt(0);const r=new Array(64).fill(0);for(const i of t){const o=jd(i),l=jd(i+"_seed2"),s=BigInt(o>>>0)|BigInt(l>>>0)<<BigInt(32);for(let a=0;a<64;a++)(s>>BigInt(a)&BigInt(1))===BigInt(1)?r[a]+=1:r[a]-=1}let n=BigInt(0);for(let i=0;i<64;i++)r[i]>0&&(n|=BigInt(1)<<BigInt(i));return n}function Ry(e,t){const r=e^t;let n=0,i=r;for(;i>0;)i&BigInt(1)&&n++,i=i>>BigInt(1);return n}function Ny(e,t,r){if(!e.value||!t.value)return!1;const n=Zd(e.value),i=Zd(t.value);return Ry(n,i)<=r}var Ja=function(e,t){return Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ja(e,t)};function Gr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ja(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Ty(e,t,r,n){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function s(g){try{c(n.next(g))}catch(f){l(f)}}function a(g){try{c(n.throw(g))}catch(f){l(f)}}function c(g){g.done?o(g.value):i(g.value).then(s,a)}c((n=n.apply(e,[])).next())})}function hg(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=s(0),l.throw=s(1),l.return=s(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(c){return function(g){return a([c,g])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(g){c=[6,g],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function jn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ar(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],l;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){l={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return o}function $r(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Vn(e){return this instanceof Vn?(this.v=e,this):new Vn(e)}function By(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",l),i[Symbol.asyncIterator]=function(){return this},i;function l(_){return function(k){return Promise.resolve(k).then(_,f)}}function s(_,k){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},k&&(i[_]=k(i[_])))}function a(_,k){try{c(n[_](k))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof Vn?Promise.resolve(_.value.v).then(g,f):b(o[0][2],_)}function g(_){a("next",_)}function f(_){a("throw",_)}function b(_,k){_(k),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Ly(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof jn=="function"?jn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(l){return new Promise(function(s,a){l=e[o](l),i(s,a,l.done,l.value)})}}function i(o,l,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},l)}}/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2019 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const Ms=globalThis,
|
|
11
|
+
*/const Ms=globalThis,al=Ms.ShadowRoot&&(Ms.ShadyCSS===void 0||Ms.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cl=Symbol(),Gd=new WeakMap;let fg=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==cl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(al&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Gd.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Gd.set(t,e))}return e}toString(){return this.cssText}};const pi=e=>new fg(typeof e=="string"?e:e+"",void 0,cl),lr=(e,...t)=>{const r=e.length===1?e[0]:t.reduce(((n,i,o)=>n+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1]),e[0]);return new fg(r,e,cl)},Oy=(e,t)=>{if(al)e.adoptedStyleSheets=t.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(const r of t){const n=document.createElement("style"),i=Ms.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}},Kd=al?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const n of t.cssRules)r+=n.cssText;return pi(r)})(e):e;/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2017 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const{is:
|
|
15
|
+
*/const{is:Dy,defineProperty:Fy,getOwnPropertyDescriptor:Vy,getOwnPropertyNames:My,getOwnPropertySymbols:Uy,getPrototypeOf:Py}=Object,Zn=globalThis,Yd=Zn.trustedTypes,Wy=Yd?Yd.emptyScript:"",Xd=Zn.reactiveElementPolyfillSupport,yi=(e,t)=>e,qs={toAttribute(e,t){switch(t){case Boolean:e=e?Wy:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},ll=(e,t)=>!Dy(e,t),Jd={attribute:!0,type:String,converter:qs,reflect:!1,useDefault:!1,hasChanged:ll};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Zn.litPropertyMetadata??(Zn.litPropertyMetadata=new WeakMap);let On=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Jd){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Fy(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=Vy(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:n,set(o){const l=n==null?void 0:n.call(this);i==null||i.call(this,o),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Jd}static _$Ei(){if(this.hasOwnProperty(yi("elementProperties")))return;const e=Py(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(yi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(yi("properties"))){const t=this.properties,r=[...My(t),...Uy(t)];for(const n of r)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const n of r)t.unshift(Kd(n))}else e!==void 0&&t.push(Kd(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Oy(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var r;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:qs).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r,n;const i=this.constructor,o=i._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const l=i.getPropertyOptions(o),s=typeof l.converter=="function"?{fromAttribute:l.converter}:((r=l.converter)==null?void 0:r.fromAttribute)!==void 0?l.converter:qs;this._$Em=o;const a=s.fromAttribute(t,l.type);this[o]=a??((n=this._$Ej)==null?void 0:n.get(o))??a,this._$Em=null}}requestUpdate(e,t,r){var n;if(e!==void 0){const i=this.constructor,o=this[e];if(r??(r=i.getPropertyOptions(e)),!((r.hasChanged??ll)(o,t)||r.useDefault&&r.reflect&&o===((n=this._$Ej)==null?void 0:n.get(e))&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:i},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[i,o]of n){const{wrapped:l}=o,s=this[i];l!==!0||this._$AL.has(i)||s===void 0||this.C(i,void 0,o,s)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach((n=>{var i;return(i=n.hostUpdate)==null?void 0:i.call(n)})),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};On.elementStyles=[],On.shadowRootOptions={mode:"open"},On[yi("elementProperties")]=new Map,On[yi("finalized")]=new Map,Xd==null||Xd({ReactiveElement:On}),(Zn.reactiveElementVersions??(Zn.reactiveElementVersions=[])).push("2.1.1");/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const Qs=globalThis,eo=Qs.trustedTypes
|
|
20
|
-
\f\r]`,hi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
21
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
19
|
+
*/const Qs=globalThis,eo=Qs.trustedTypes,zd=eo?eo.createPolicy("lit-html",{createHTML:e=>e}):void 0,pg="$lit$",Pr=`lit$${Math.random().toFixed(9).slice(2)}$`,gg="?"+Pr,$y=`<${gg}>`,vn=document,Ri=()=>vn.createComment(""),Ni=e=>e===null||typeof e!="object"&&typeof e!="function",ul=Array.isArray,Hy=e=>ul(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Sa=`[
|
|
20
|
+
\f\r]`,hi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qd=/-->/g,Qd=/>/g,nn=RegExp(`>|${Sa}(?:([^\\s"'>=/]+)(${Sa}*=${Sa}*(?:[^
|
|
21
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),eh=/'/g,th=/"/g,mg=/^(?:script|style|textarea|title)$/i,jy=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Ne=jy(1),Gn=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),rh=new WeakMap,ln=vn.createTreeWalker(vn,129);function vg(e,t){if(!ul(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return zd!==void 0?zd.createHTML(t):t}const Zy=(e,t)=>{const r=e.length-1,n=[];let i,o=t===2?"<svg>":t===3?"<math>":"",l=hi;for(let s=0;s<r;s++){const a=e[s];let c,g,f=-1,b=0;for(;b<a.length&&(l.lastIndex=b,g=l.exec(a),g!==null);)b=l.lastIndex,l===hi?g[1]==="!--"?l=qd:g[1]!==void 0?l=Qd:g[2]!==void 0?(mg.test(g[2])&&(i=RegExp("</"+g[2],"g")),l=nn):g[3]!==void 0&&(l=nn):l===nn?g[0]===">"?(l=i??hi,f=-1):g[1]===void 0?f=-2:(f=l.lastIndex-g[2].length,c=g[1],l=g[3]===void 0?nn:g[3]==='"'?th:eh):l===th||l===eh?l=nn:l===qd||l===Qd?l=hi:(l=nn,i=void 0);const _=l===nn&&e[s+1].startsWith("/>")?" ":"";o+=l===hi?a+$y:f>=0?(n.push(c),a.slice(0,f)+pg+a.slice(f)+Pr+_):a+Pr+(f===-2?s:_)}return[vg(e,o+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class Ti{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let o=0,l=0;const s=t.length-1,a=this.parts,[c,g]=Zy(t,r);if(this.el=Ti.createElement(c,n),ln.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=ln.nextNode())!==null&&a.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(const f of i.getAttributeNames())if(f.endsWith(pg)){const b=g[l++],_=i.getAttribute(f).split(Pr),k=/([.?@])?(.*)/.exec(b);a.push({type:1,index:o,name:k[2],strings:_,ctor:k[1]==="."?Ky:k[1]==="?"?Yy:k[1]==="@"?Xy:So}),i.removeAttribute(f)}else f.startsWith(Pr)&&(a.push({type:6,index:o}),i.removeAttribute(f));if(mg.test(i.tagName)){const f=i.textContent.split(Pr),b=f.length-1;if(b>0){i.textContent=eo?eo.emptyScript:"";for(let _=0;_<b;_++)i.append(f[_],Ri()),ln.nextNode(),a.push({type:2,index:++o});i.append(f[b],Ri())}}}else if(i.nodeType===8)if(i.data===gg)a.push({type:2,index:o});else{let f=-1;for(;(f=i.data.indexOf(Pr,f+1))!==-1;)a.push({type:7,index:o}),f+=Pr.length-1}o++}}static createElement(t,r){const n=vn.createElement("template");return n.innerHTML=t,n}}function Kn(e,t,r=e,n){var i,o;if(t===Gn)return t;let l=n!==void 0?(i=r._$Co)==null?void 0:i[n]:r._$Cl;const s=Ni(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==s&&((o=l==null?void 0:l._$AO)==null||o.call(l,!1),s===void 0?l=void 0:(l=new s(e),l._$AT(e,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=l:r._$Cl=l),l!==void 0&&(t=Kn(e,l._$AS(e,t.values),l,n)),t}class Gy{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:r},parts:n}=this._$AD,i=((t==null?void 0:t.creationScope)??vn).importNode(r,!0);ln.currentNode=i;let o=ln.nextNode(),l=0,s=0,a=n[0];for(;a!==void 0;){if(l===a.index){let c;a.type===2?c=new Gi(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Jy(o,this,t)),this._$AV.push(c),a=n[++s]}l!==(a==null?void 0:a.index)&&(o=ln.nextNode(),l++)}return ln.currentNode=vn,i}p(t){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}}class Gi{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,r,n,i){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=Kn(this,t,r),Ni(t)?t===ft||t==null||t===""?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==Gn&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Hy(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&Ni(this._$AH)?this._$AA.nextSibling.data=t:this.T(vn.createTextNode(t)),this._$AH=t}$(t){var r;const{values:n,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Ti.createElement(vg(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===o)this._$AH.p(n);else{const l=new Gy(o,this),s=l.u(this.options);l.p(n),this.T(s),this._$AH=l}}_$AC(t){let r=rh.get(t.strings);return r===void 0&&rh.set(t.strings,r=new Ti(t)),r}k(t){ul(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const o of t)i===r.length?r.push(n=new Gi(this.O(Ri()),this.O(Ri()),this,this.options)):n=r[i],n._$AI(o),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(t=this._$AA.nextSibling,r){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var r;this._$AM===void 0&&(this._$Cv=t,(r=this._$AP)==null||r.call(this,t))}}class So{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,i,o){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=r,this._$AM=i,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ft}_$AI(t,r=this,n,i){const o=this.strings;let l=!1;if(o===void 0)t=Kn(this,t,r,0),l=!Ni(t)||t!==this._$AH&&t!==Gn,l&&(this._$AH=t);else{const s=t;let a,c;for(t=o[0],a=0;a<o.length-1;a++)c=Kn(this,s[n+a],r,a),c===Gn&&(c=this._$AH[a]),l||(l=!Ni(c)||c!==this._$AH[a]),c===ft?t=ft:t!==ft&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}l&&!i&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ky extends So{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class Yy extends So{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class Xy extends So{constructor(t,r,n,i,o){super(t,r,n,i,o),this.type=5}_$AI(t,r=this){if((t=Kn(this,t,r,0)??ft)===Gn)return;const n=this._$AH,i=t===ft&&n!==ft||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==ft&&(n===ft||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,t):this._$AH.handleEvent(t)}}class Jy{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Kn(this,t)}}const nh=Qs.litHtmlPolyfillSupport;nh==null||nh(Ti,Gi),(Qs.litHtmlVersions??(Qs.litHtmlVersions=[])).push("3.3.1");const zy=(e,t,r)=>{const n=(r==null?void 0:r.renderBefore)??t;let i=n._$litPart$;if(i===void 0){const o=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new Gi(t.insertBefore(Ri(),o),o,void 0,r??{})}return i._$AI(e),i};/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const Bi=globalThis;class
|
|
25
|
+
*/const Bi=globalThis;class xt extends On{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const r=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=r.firstChild),r}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zy(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Gn}}var ih;xt._$litElement$=!0,xt.finalized=!0,(ih=Bi.litElementHydrateSupport)==null||ih.call(Bi,{LitElement:xt});const sh=Bi.litElementPolyfillSupport;sh==null||sh({LitElement:xt});(Bi.litElementVersions??(Bi.litElementVersions=[])).push("4.2.1");/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/const
|
|
33
|
+
*/const qy={attribute:!0,type:String,converter:qs,reflect:!1,hasChanged:ll},Qy=(e=qy,t,r)=>{const{kind:n,metadata:i}=r;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(r.name,e),n==="accessor"){const{name:l}=r;return{set(s){const a=t.get.call(this);t.set.call(this,s),this.requestUpdate(l,a,e)},init(s){return s!==void 0&&this.C(l,void 0,e,s),s}}}if(n==="setter"){const{name:l}=r;return function(s){const a=this[l];t.call(this,s),this.requestUpdate(l,a,e)}}throw Error("Unsupported decorator location: "+n)};function Te(e){return(t,r)=>typeof r=="object"?Qy(e,t,r):((n,i,o)=>{const l=i.hasOwnProperty(o);return i.constructor.createProperty(o,n),l?Object.getOwnPropertyDescriptor(i,o):void 0})(e,t,r)}/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/function
|
|
37
|
+
*/function e2(e){return Te({...e,state:!0,attribute:!1})}var t2=(e,t,r,n)=>{for(var i=t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=l(i)||i);return i};let za=class extends xt{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return Ne`
|
|
38
38
|
<div class="close-button tooltip">
|
|
39
39
|
<span class="tooltiptext">Close</span>
|
|
40
40
|
<vscode-button
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<span class="icon icon-close"></span>
|
|
47
47
|
</vscode-button>
|
|
48
48
|
</div>
|
|
49
|
-
`}};za.styles=
|
|
49
|
+
`}};za.styles=lr`
|
|
50
50
|
:host {
|
|
51
51
|
--button-icon-hover-background: var(--vscode-toolbar-hoverBackground);
|
|
52
52
|
--tooltip-background: #343434;
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
.tooltip:not(:hover) .tooltiptext {
|
|
120
120
|
transition-delay: 0s;
|
|
121
121
|
}
|
|
122
|
-
`;za=
|
|
122
|
+
`;za=t2([zt("close-cell-button")],za);const bg=Ne`
|
|
123
123
|
<svg
|
|
124
124
|
class="icon"
|
|
125
125
|
width="16"
|
|
@@ -139,11 +139,11 @@
|
|
|
139
139
|
d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z"
|
|
140
140
|
/>
|
|
141
141
|
</svg>
|
|
142
|
-
`;var
|
|
142
|
+
`;var r2=Object.defineProperty,n2=Object.getOwnPropertyDescriptor,_g=(e,t,r,n)=>{for(var i=n>1?void 0:n?n2(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&r2(t,r,i),i};let to=class extends xt{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return Ne`
|
|
143
143
|
<vscode-button appearance="secondary" @click=${this.onCopy}>
|
|
144
|
-
${
|
|
144
|
+
${bg} ${this.copyText}
|
|
145
145
|
</vscode-button>
|
|
146
|
-
`}};to.styles=
|
|
146
|
+
`}};to.styles=lr`
|
|
147
147
|
vscode-button {
|
|
148
148
|
color: var(--vscode-button-foreground);
|
|
149
149
|
background-color: var(--vscode-button-background);
|
|
@@ -160,25 +160,25 @@
|
|
|
160
160
|
margin: 0 5px 0 -5px;
|
|
161
161
|
padding: 0;
|
|
162
162
|
}
|
|
163
|
-
`;fg([Te({type:String})],to.prototype,"copyText",2);to=fg([zt("copy-button")],to);var qa={exports:{}},Vy=qa.exports,qd;function My(){return qd||(qd=1,(function(e,t){(function(r,n){e.exports=n()})(Vy,(()=>(()=>{var r={930:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(485);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,f,b){this._css.set(m,f,b)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,b){this._color.set(m,f,b)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},997:function(u,s,a){var c=this&&this.__decorate||function(A,E,N,F){var U,P=arguments.length,O=P<3?E:F===null?F=Object.getOwnPropertyDescriptor(E,N):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(A,E,N,F);else for(var te=A.length-1;te>=0;te--)(U=A[te])&&(O=(P<3?U(O):P>3?U(E,N,O):U(E,N))||O);return P>3&&O&&Object.defineProperty(E,N,O),O},m=this&&this.__param||function(A,E){return function(N,F){E(N,F,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=a(930),b=a(160),_=a(345),k=a(859),y=a(97),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),h=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let N=0;N<216;N++){const F=E[N/36%6|0],U=E[N/6%6|0],P=E[N%6];A.push({css:b.channels.toCss(F,U,P),rgba:b.channels.toRgba(F,U,P)})}for(let N=0;N<24;N++){const F=8+10*N;A.push({css:b.channels.toCss(F,F,F),rgba:b.channels.toRgba(F,F,F)})}return A})());let I=s.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:h,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(A={}){const E=this._colors;if(E.foreground=C(A.foreground,d),E.background=C(A.background,p),E.cursor=C(A.cursor,h),E.cursorAccent=C(A.cursorAccent,g),E.selectionBackgroundTransparent=C(A.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=C(A.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=A.selectionForeground?C(A.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=C(A.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=C(A.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=C(A.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=C(A.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=C(A.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=C(A.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=C(A.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=C(A.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=C(A.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=C(A.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=C(A.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=C(A.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=C(A.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=C(A.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=C(A.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=C(A.brightWhite,s.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const N=Math.min(E.ansi.length-16,A.extendedAnsi.length);for(let F=0;F<N;F++)E.ansi[F+16]=C(A.extendedAnsi[F],s.DEFAULT_ANSI_COLORS[F+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(A){A(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(A,E){if(A!==void 0)try{return b.css.toColor(A)}catch{}return E}s.ThemeService=I=c([m(0,y.IOptionsService)],I)},160:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,f=0;var b,_,k,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function h(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,I,C,A){return A!==void 0?`#${p(S)}${p(I)}${p(C)}${p(A)}`:`#${p(S)}${p(I)}${p(C)}`},g.toRgba=function(S,I,C,A=255){return(S<<24|I<<16|C<<8|A)>>>0},g.toColor=function(S,I,C,A){return{css:g.toCss(S,I,C,A),rgba:g.toRgba(S,I,C,A)}}})(b||(s.channels=b={})),(function(g){function S(I,C){return f=Math.round(255*C),[a,c,m]=d.toChannels(I.rgba),{css:b.toCss(a,c,m,f),rgba:b.toRgba(a,c,m,f)}}g.blend=function(I,C){if(f=(255&C.rgba)/255,f===1)return{css:C.css,rgba:C.rgba};const A=C.rgba>>24&255,E=C.rgba>>16&255,N=C.rgba>>8&255,F=I.rgba>>24&255,U=I.rgba>>16&255,P=I.rgba>>8&255;return a=F+Math.round((A-F)*f),c=U+Math.round((E-U)*f),m=P+Math.round((N-P)*f),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(I){return(255&I.rgba)==255},g.ensureContrastRatio=function(I,C,A){const E=d.ensureContrastRatio(I.rgba,C.rgba,A);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(I){const C=(255|I.rgba)>>>0;return[a,c,m]=d.toChannels(C),{css:b.toCss(a,c,m),rgba:C}},g.opacity=S,g.multiplyOpacity=function(I,C){return f=255&I.rgba,S(I,f*C/255)},g.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,I;try{const C=document.createElement("canvas");C.width=1,C.height=1;const A=C.getContext("2d",{willReadFrequently:!0});A&&(S=A,S.globalCompositeOperation="copy",I=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),m=parseInt(C.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),m=parseInt(C.slice(3,4).repeat(2),16),f=parseInt(C.slice(4,5).repeat(2),16),b.toColor(a,c,m,f);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 A=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(A)return a=parseInt(A[1]),c=parseInt(A[2]),m=parseInt(A[3]),f=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),b.toColor(a,c,m,f);if(!S||!I)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=I,S.fillStyle=C,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,f]=S.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,f),css:C}}})(k||(s.css=k={})),(function(g){function S(I,C,A){const E=I/255,N=C/255,F=A/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}g.relativeLuminance=function(I){return S(I>>16&255,I>>8&255,255&I)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(C,A,E){const N=C>>24&255,F=C>>16&255,U=C>>8&255;let P=A>>24&255,O=A>>16&255,te=A>>8&255,le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));for(;le<E&&(P>0||O>0||te>0);)P-=Math.max(0,Math.ceil(.1*P)),O-=Math.max(0,Math.ceil(.1*O)),te-=Math.max(0,Math.ceil(.1*te)),le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));return(P<<24|O<<16|te<<8|255)>>>0}function I(C,A,E){const N=C>>24&255,F=C>>16&255,U=C>>8&255;let P=A>>24&255,O=A>>16&255,te=A>>8&255,le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));for(;le<E&&(P<255||O<255||te<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),O=Math.min(255,O+Math.ceil(.1*(255-O))),te=Math.min(255,te+Math.ceil(.1*(255-te))),le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));return(P<<24|O<<16|te<<8|255)>>>0}g.blend=function(C,A){if(f=(255&A)/255,f===1)return A;const E=A>>24&255,N=A>>16&255,F=A>>8&255,U=C>>24&255,P=C>>16&255,O=C>>8&255;return a=U+Math.round((E-U)*f),c=P+Math.round((N-P)*f),m=O+Math.round((F-O)*f),b.toRgba(a,c,m)},g.ensureContrastRatio=function(C,A,E){const N=y.relativeLuminance(C>>8),F=y.relativeLuminance(A>>8);if(h(N,F)<E){if(F<N){const O=S(C,A,E),te=h(N,y.relativeLuminance(O>>8));if(te<E){const le=I(C,A,E);return te>h(N,y.relativeLuminance(le>>8))?O:le}return O}const U=I(C,A,E),P=h(N,y.relativeLuminance(U>>8));if(P<E){const O=S(C,A,E);return P>h(N,y.relativeLuminance(O>>8))?U:O}return U}},g.reduceLuminance=S,g.increaseLuminance=I,g.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=h},345:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let f=0;f<this._listeners.length;f++)m.push(this._listeners[f]);for(let f=0;f<m.length;f++)m[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},859:(u,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},485:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,f,b){this._data[m]||(this._data[m]={}),this._data[m][f]=b}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,f,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(f,b,_)}get(c,m,f,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(f,b)}clear(){this._data.clear()}}},726:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const f=function(b,_,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(f,b,k)};return f.toString=()=>m,s.serviceRegistry.set(m,f),f}},97:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(726);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(u){var s=n[u];if(s!==void 0)return s.exports;var a=n[u]={exports:{}};return r[u].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.HTMLSerializeHandler=u.SerializeAddon=void 0;const s=i(997);function a(y,d,p){return Math.max(d,Math.min(y,p))}class c{constructor(d){this._buffer=d}serialize(d,p){const h=this._buffer.getNullCell(),g=this._buffer.getNullCell();let S=h;const I=d.start.y,C=d.end.y,A=d.start.x,E=d.end.x;this._beforeSerialize(C-I,I,C);for(let N=I;N<=C;N++){const F=this._buffer.getLine(N);if(F){const U=N===d.start.y?A:0,P=N===d.end.y?E:F.length;for(let O=U;O<P;O++){const te=F.getCell(O,S===h?g:h);te?(this._nextCell(te,S,N,O),S=te):console.warn(`Can't get cell at row=${N}, col=${O}`)}}this._rowEnd(N,N===C)}return this._afterSerialize(),this._serializeString(p)}_nextCell(d,p,h,g){}_rowEnd(d,p){}_beforeSerialize(d,p,h){}_afterSerialize(){}_serializeString(d){return""}}function m(y,d){return y.getFgColorMode()===d.getFgColorMode()&&y.getFgColor()===d.getFgColor()}function f(y,d){return y.getBgColorMode()===d.getBgColorMode()&&y.getBgColor()===d.getBgColor()}function b(y,d){return y.isInverse()===d.isInverse()&&y.isBold()===d.isBold()&&y.isUnderline()===d.isUnderline()&&y.isOverline()===d.isOverline()&&y.isBlink()===d.isBlink()&&y.isInvisible()===d.isInvisible()&&y.isItalic()===d.isItalic()&&y.isDim()===d.isDim()&&y.isStrikethrough()===d.isStrikethrough()}class _ extends c{constructor(d,p){super(d),this._terminal=p,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(d,p,h){this._allRows=new Array(d),this._lastContentCursorRow=p,this._lastCursorRow=p,this._firstRow=p}_rowEnd(d,p){var h;this._nullCellCount>0&&!f(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let g="";if(!p){d-this._firstRow>=this._terminal.rows&&((h=this._buffer.getLine(this._cursorStyleRow))==null||h.getCell(this._cursorStyleCol,this._backgroundCell));const S=this._buffer.getLine(d),I=this._buffer.getLine(d+1);if(I.isWrapped){g="";const C=S.getCell(S.length-1,this._thisRowLastChar),A=S.getCell(S.length-2,this._thisRowLastSecondChar),E=I.getCell(0,this._nextRowFirstChar),N=E.getWidth()>1;let F=!1;(E.getChars()&&N?this._nullCellCount<=1:this._nullCellCount<=0)&&((C.getChars()||C.getWidth()===0)&&f(C,E)&&(F=!0),N&&(A.getChars()||A.getWidth()===0)&&f(C,E)&&f(A,E)&&(F=!0)),F||(g="-".repeat(this._nullCellCount+1),g+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(g+="\x1B[A",g+=`\x1B[${S.length-this._nullCellCount}C`,g+=`\x1B[${this._nullCellCount}X`,g+=`\x1B[${S.length-this._nullCellCount}D`,g+="\x1B[B"),this._lastContentCursorRow=d+1,this._lastContentCursorCol=0,this._lastCursorRow=d+1,this._lastCursorCol=0)}else g=`\r
|
|
164
|
-
`,this._lastCursorRow=d+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=g,this._currentRow="",this._nullCellCount=0}_diffStyle(d,p){const h=[],g=!m(d,p),S=!f(d,p),I=!b(d,p);if(g||S||I)if(d.isAttributeDefault())p.isAttributeDefault()||h.push(0);else{if(g){const C=d.getFgColor();d.isFgRGB()?h.push(38,2,C>>>16&255,C>>>8&255,255&C):d.isFgPalette()?C>=16?h.push(38,5,C):h.push(8&C?90+(7&C):30+(7&C)):h.push(39)}if(S){const C=d.getBgColor();d.isBgRGB()?h.push(48,2,C>>>16&255,C>>>8&255,255&C):d.isBgPalette()?C>=16?h.push(48,5,C):h.push(8&C?100+(7&C):40+(7&C)):h.push(49)}I&&(d.isInverse()!==p.isInverse()&&h.push(d.isInverse()?7:27),d.isBold()!==p.isBold()&&h.push(d.isBold()?1:22),d.isUnderline()!==p.isUnderline()&&h.push(d.isUnderline()?4:24),d.isOverline()!==p.isOverline()&&h.push(d.isOverline()?53:55),d.isBlink()!==p.isBlink()&&h.push(d.isBlink()?5:25),d.isInvisible()!==p.isInvisible()&&h.push(d.isInvisible()?8:28),d.isItalic()!==p.isItalic()&&h.push(d.isItalic()?3:23),d.isDim()!==p.isDim()&&h.push(d.isDim()?2:22),d.isStrikethrough()!==p.isStrikethrough()&&h.push(d.isStrikethrough()?9:29))}return h}_nextCell(d,p,h,g){if(d.getWidth()===0)return;const S=d.getChars()==="",I=this._diffStyle(d,this._cursorStyle);if(S?!f(this._cursorStyle,d):I.length>0){this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=h,this._lastContentCursorCol=this._lastCursorCol=g,this._currentRow+=`\x1B[${I.join(";")}m`;const C=this._buffer.getLine(h);C!==void 0&&(C.getCell(g,this._cursorStyle),this._cursorStyleRow=h,this._cursorStyleCol=g)}S?this._nullCellCount+=d.getWidth():(this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=d.getChars(),this._lastContentCursorRow=this._lastCursorRow=h,this._lastContentCursorCol=this._lastCursorCol=g+d.getWidth())}_serializeString(d){let p=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(p=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let h="";for(let C=0;C<p;C++)h+=this._allRows[C],C+1<p&&(h+=this._allRowSeparators[C]);if(!d){const C=this._buffer.baseY+this._buffer.cursorY,A=this._buffer.cursorX,E=N=>{N>0?h+=`\x1B[${N}C`:N<0&&(h+=`\x1B[${-N}D`)};(C!==this._lastCursorRow||A!==this._lastCursorCol)&&((g=C-this._lastCursorRow)>0?h+=`\x1B[${g}B`:g<0&&(h+=`\x1B[${-g}A`),E(A-this._lastCursorCol))}var g;const S=this._terminal._core._inputHandler._curAttrData,I=this._diffStyle(S,this._cursorStyle);return I.length>0&&(h+=`\x1B[${I.join(";")}m`),h}}u.SerializeAddon=class{activate(y){this._terminal=y}_serializeBufferByScrollback(y,d,p){const h=d.length,g=p===void 0?h:a(p+y.rows,0,h);return this._serializeBufferByRange(y,d,{start:h-g,end:h-1},!1)}_serializeBufferByRange(y,d,p,h){return new _(d,y).serialize({start:{x:0,y:typeof p.start=="number"?p.start:p.start.line},end:{x:y.cols,y:typeof p.end=="number"?p.end:p.end.line}},h)}_serializeBufferAsHTML(y,d){var p;const h=y.buffer.active,g=new k(h,y,d);if(!d.onlySelection){const I=h.length,C=d.scrollback,A=C===void 0?I:a(C+y.rows,0,I);return g.serialize({start:{x:0,y:I-A},end:{x:y.cols,y:I-1}})}const S=(p=this._terminal)==null?void 0:p.getSelectionPosition();return S!==void 0?g.serialize({start:{x:S.start.x,y:S.start.y},end:{x:S.end.x,y:S.end.y}}):""}_serializeModes(y){let d="";const p=y.modes;if(p.applicationCursorKeysMode&&(d+="\x1B[?1h"),p.applicationKeypadMode&&(d+="\x1B[?66h"),p.bracketedPasteMode&&(d+="\x1B[?2004h"),p.insertMode&&(d+="\x1B[4h"),p.originMode&&(d+="\x1B[?6h"),p.reverseWraparoundMode&&(d+="\x1B[?45h"),p.sendFocusMode&&(d+="\x1B[?1004h"),p.wraparoundMode===!1&&(d+="\x1B[?7l"),p.mouseTrackingMode!=="none")switch(p.mouseTrackingMode){case"x10":d+="\x1B[?9h";break;case"vt200":d+="\x1B[?1000h";break;case"drag":d+="\x1B[?1002h";break;case"any":d+="\x1B[?1003h"}return d}serialize(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let d=y!=null&&y.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,y.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,y==null?void 0:y.scrollback);return y!=null&&y.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(d+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),y!=null&&y.excludeModes||(d+=this._serializeModes(this._terminal)),d}serializeAsHTML(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,y||{})}dispose(){}};class k extends c{constructor(d,p,h){super(d),this._terminal=p,this._options=h,this._currentRow="",this._htmlContent="",p._core._themeService?this._ansiColors=p._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(d,p,h){return p>>=0,h=h??" ",d.length>p?d:((p-=d.length)>h.length&&(h+=h.repeat(p/h.length)),h.slice(0,p)+d)}_beforeSerialize(d,p,h){var g,S;this._htmlContent+="<html><body><!--StartFragment--><pre>";let I="#000000",C="#ffffff";this._options.includeGlobalBackground&&(I=((g=this._terminal.options.theme)==null?void 0:g.foreground)??"#ffffff",C=((S=this._terminal.options.theme)==null?void 0:S.background)??"#000000");const A=[];A.push("color: "+I+";"),A.push("background-color: "+C+";"),A.push("font-family: "+this._terminal.options.fontFamily+";"),A.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+A.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(d,p){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(d,p){const h=p?d.getFgColor():d.getBgColor();return(p?d.isFgRGB():d.isBgRGB())?"#"+[h>>16&255,h>>8&255,255&h].map((g=>this._padStart(g.toString(16),2,"0"))).join(""):(p?d.isFgPalette():d.isBgPalette())?this._ansiColors[h].css:void 0}_diffStyle(d,p){const h=[],g=!m(d,p),S=!f(d,p),I=!b(d,p);if(g||S||I){const C=this._getHexColor(d,!0);C&&h.push("color: "+C+";");const A=this._getHexColor(d,!1);return A&&h.push("background-color: "+A+";"),d.isInverse()&&h.push("color: #000000; background-color: #BFBFBF;"),d.isBold()&&h.push("font-weight: bold;"),d.isUnderline()&&d.isOverline()?h.push("text-decoration: overline underline;"):d.isUnderline()?h.push("text-decoration: underline;"):d.isOverline()&&h.push("text-decoration: overline;"),d.isBlink()&&h.push("text-decoration: blink;"),d.isInvisible()&&h.push("visibility: hidden;"),d.isItalic()&&h.push("font-style: italic;"),d.isDim()&&h.push("opacity: 0.5;"),d.isStrikethrough()&&h.push("text-decoration: line-through;"),h}}_nextCell(d,p,h,g){if(d.getWidth()===0)return;const S=d.getChars()==="",I=this._diffStyle(d,p);I&&(this._currentRow+=I.length===0?"</span><span>":"</span><span style='"+I.join(" ")+"'>"),this._currentRow+=S?" ":d.getChars()}_serializeString(){return this._htmlContent}}u.HTMLSerializeHandler=k})(),o})()))})(qa)),qa.exports}var Uy=My(),Qa={exports:{}},Py=Qa.exports,Qd;function Wy(){return Qd||(Qd=1,(function(e,t){(function(r,n){e.exports=n()})(Py,(()=>(()=>{var r={433:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=a(938),m=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],b=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let k;function y(d,p){let h,g=0,S=p.length-1;if(d<p[0][0]||d>p[S][1])return!1;for(;S>=g;)if(h=g+S>>1,d>p[h][1])g=h+1;else{if(!(d<p[h][0]))return!0;S=h-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!k){k=new Uint8Array(65536),k.fill(1),k[0]=0,k.fill(0,1,32),k.fill(0,127,160);for(let d=0;d<m.length;++d)k.fill(0,m[d][0],m[d][1]+1);for(let d=0;d<b.length;++d)k.fill(2,b[d][0],b[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?k[d]:y(d,f)?0:y(d,_)?2:1}charProperties(d,p){let h=this.wcwidth(d),g=h===0&&p!==0;if(g){const S=c.UnicodeService.extractWidth(p);S===0?g=!1:S>h&&(h=S)}return c.UnicodeService.createPropertyValue(0,h,g)}}},345:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let f=0;f<this._listeners.length;f++)m.push(this._listeners[f]);for(let f=0;f<m.length;f++)m[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},490:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(938),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(k,y){let d,p=0,h=y.length-1;if(k<y[0][0]||k>y[h][1])return!1;for(;h>=p;)if(d=p+h>>1,k>y[d][1])p=d+1;else{if(!(k<y[d][0]))return!0;h=d-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,k){let y=this.wcwidth(_),d=y===0&&k!==0;if(d){const p=c.UnicodeService.extractWidth(k);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},938:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(345),m=a(490);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,k,y=!1){return(16777215&_)<<3|(3&k)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let k=0,y=0;const d=_.length;for(let p=0;p<d;++p){let h=_.charCodeAt(p);if(55296<=h&&h<=56319){if(++p>=d)return k+this.wcwidth(h);const I=_.charCodeAt(p);56320<=I&&I<=57343?h=1024*(h-55296)+I-56320+65536:k+=this.wcwidth(I)}const g=this.charProperties(h,y);let S=f.extractWidth(g);f.extractShouldJoin(g)&&(S-=f.extractWidth(y)),k+=S,y=g}return k}charProperties(_,k){return this._activeProvider.charProperties(_,k)}}s.UnicodeService=f}},n={};function i(u){var s=n[u];if(s!==void 0)return s.exports;var a=n[u]={exports:{}};return r[u](a,a.exports,i),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.Unicode11Addon=void 0;const s=i(433);u.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),o})()))})(Qa)),Qa.exports}var Hy=Wy(),eh={exports:{}},th;function $y(){return th||(th=1,(function(e,t){(function(r,n){e.exports=n()})(self,(()=>(()=>{var r={6:(u,s)=>{function a(m){try{const f=new URL(m),b=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return m.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(m,f,b,_={}){this._terminal=m,this._regex=f,this._handler=b,this._options=_}provideLinks(m,f){const b=c.computeLink(m,this._regex,this._terminal,this._handler);f(this._addCallbacks(b))}_addCallbacks(m){return m.map((f=>(f.leave=this._options.leave,f.hover=(b,_)=>{if(this._options.hover){const{range:k}=f;this._options.hover(b,_,k)}},f)))}};class c{static computeLink(f,b,_,k){const y=new RegExp(b.source,(b.flags||"")+"g"),[d,p]=c._getWindowedLineStrings(f-1,_),h=d.join("");let g;const S=[];for(;g=y.exec(h);){const I=g[0];if(!a(I))continue;const[C,A]=c._mapStrIdx(_,p,0,g.index),[E,N]=c._mapStrIdx(_,C,A,I.length);if(C===-1||A===-1||E===-1||N===-1)continue;const F={start:{x:A+1,y:C+1},end:{x:N,y:E+1}};S.push({range:F,text:I,activate:k})}return S}static _getWindowedLineStrings(f,b){let _,k=f,y=f,d=0,p="";const h=[];if(_=b.buffer.active.getLine(f)){const g=_.translateToString(!0);if(_.isWrapped&&g[0]!==" "){for(d=0;(_=b.buffer.active.getLine(--k))&&d<2048&&(p=_.translateToString(!0),d+=p.length,h.push(p),_.isWrapped&&p.indexOf(" ")===-1););h.reverse()}for(h.push(g),d=0;(_=b.buffer.active.getLine(++y))&&_.isWrapped&&d<2048&&(p=_.translateToString(!0),d+=p.length,h.push(p),p.indexOf(" ")===-1););}return[h,k]}static _mapStrIdx(f,b,_,k){const y=f.buffer.active,d=y.getNullCell();let p=_;for(;k;){const h=y.getLine(b);if(!h)return[-1,-1];for(let g=p;g<h.length;++g){h.getCell(g,d);const S=d.getChars();if(d.getWidth()&&(k-=S.length||1,g===h.length-1&&S==="")){const I=y.getLine(b+1);I&&I.isWrapped&&(I.getCell(0,d),d.getWidth()===2&&(k+=1))}if(k<0)return[b,g]}b++,p=0}return[b,p]}}s.LinkComputer=c}},n={};function i(u){var s=n[u];if(s!==void 0)return s.exports;var a=n[u]={exports:{}};return r[u](a,a.exports,i),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const s=i(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(m,f){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(m=c,f={}){this._handler=m,this._options=f}activate(m){this._terminal=m;const f=this._options,b=f.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,b,this._handler,f))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),o})()))})(eh)),eh.exports}var Gy=$y(),rh={exports:{}},nh;function Zy(){return nh||(nh=1,(function(e,t){(function(r,n){e.exports=n()})(globalThis,(()=>(()=>{var r={4567:function(u,s,a){var c=this&&this.__decorate||function(h,g,S,I){var C,A=arguments.length,E=A<3?g:I===null?I=Object.getOwnPropertyDescriptor(g,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,g,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(g,S,E):C(g,S))||E);return A>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(h,g){return function(S,I){g(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const f=a(9042),b=a(9924),_=a(844),k=a(4725),y=a(2585),d=a(3656);let p=s.AccessibilityManager=class extends _.Disposable{constructor(h,g,S,I){super(),this._terminal=h,this._coreBrowserService=S,this._renderService=I,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((C=>this._handleResize(C.rows)))),this.register(this._terminal.onRender((C=>this._refreshRows(C.start,C.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((C=>this._handleChar(C)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
165
|
-
`)))),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,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let
|
|
166
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,g){this._liveRegionDebouncer.refresh(h,g,this._terminal.rows)}_renderRows(h,g){const S=this._terminal.buffer,I=S.lines.length.toString();for(let C=h;C<=g;C++){const A=S.lines.get(S.ydisp+C),E=[],N=(A==null?void 0:A.translateToString(!0,void 0,void 0,E))||"",F=(S.ydisp+C+1).toString(),U=this._rowElements[C];U&&(N.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=N,this._rowColumns.set(U,E)),U.setAttribute("aria-posinset",F),U.setAttribute("aria-setsize",I))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,g){const S=h.target,I=this._rowElements[g===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==I)return;let C,A;if(g===0?(C=S,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(C=this._rowElements.shift(),A=S,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),g===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(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){var h;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 S={node:g.anchorNode,offset:g.anchorOffset},I={node:g.focusNode,offset:g.focusOffset};if((S.node.compareDocumentPosition(I.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===I.node&&S.offset>I.offset)&&([S,I]=[I,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const C=this._rowElements.slice(-1)[0];if(I.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(I={node:C,offset:((h=C.textContent)==null?void 0:h.length)??0}),!this._rowContainer.contains(I.node))return;const A=({node:F,offset:U})=>{const P=F instanceof Text?F.parentNode:F;let O=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(O))return console.warn("row is invalid. Race condition?"),null;const te=this._rowColumns.get(P);if(!te)return console.warn("columns is null. Race condition?"),null;let le=U<te.length?te[U]:te.slice(-1)[0]+1;return le>=this._terminal.cols&&(++O,le=0),{row:O,column:le}},E=A(S),N=A(I);if(E&&N){if(E.row>N.row||E.row===N.row&&E.column>=N.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(N.row-E.row)*this._terminal.cols-E.column+N.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=p=c([m(1,y.IInstantiationService),m(2,k.ICoreBrowserService),m(3,k.IRenderService)],p)},3614:(u,s)=>{function a(b){return b.replace(/\r?\n/g,"\r")}function c(b,_){return _?"\x1B[200~"+b+"\x1B[201~":b}function m(b,_,k,y){b=c(b=a(b),k.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),_.value=""}function f(b,_,k){const y=k.getBoundingClientRect(),d=b.clientX-y.left-10,p=b.clientY-y.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${d}px`,_.style.top=`${p}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=c,s.copyHandler=function(b,_){b.clipboardData&&b.clipboardData.setData("text/plain",_.selectionText),b.preventDefault()},s.handlePasteEvent=function(b,_,k,y){b.stopPropagation(),b.clipboardData&&m(b.clipboardData.getData("text/plain"),_,k,y)},s.paste=m,s.moveTextAreaUnderMouseCursor=f,s.rightClickHandler=function(b,_,k,y,d){f(b,_,k),d&&y.rightClickSelect(b),_.value=y.selectionText,_.select()}},7239:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,f,b){this._css.set(m,f,b)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,b){this._color.set(m,f,b)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,c,m,f){a.addEventListener(c,m,f);let b=!1;return{dispose:()=>{b||(b=!0,a.removeEventListener(c,m,f))}}}},3551:function(u,s,a){var c=this&&this.__decorate||function(p,h,g,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,g,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,g,A):I(h,g))||A);return C>3&&A&&Object.defineProperty(h,g,A),A},m=this&&this.__param||function(p,h){return function(g,S){h(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const f=a(3656),b=a(8460),_=a(844),k=a(2585),y=a(4725);let d=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(p,h,g,S,I){super(),this._element=p,this._mouseService=h,this._renderService=g,this._bufferService=S,this._linkProviderService=I,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.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,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const h=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const g=p.composedPath();for(let S=0;S<g.length;S++){const I=g[S];if(I.classList.contains("xterm"))break;if(I.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,h){var g,S;this._activeProviderReplies&&h||((g=this._activeProviderReplies)==null||g.forEach((C=>{C==null||C.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let I=!1;for(const[C,A]of this._linkProviderService.linkProviders.entries())h?(S=this._activeProviderReplies)!=null&&S.get(C)&&(I=this._checkLinkProviderResult(C,p,I)):A.provideLinks(p.y,(E=>{var N,F;if(this._isMouseOut)return;const U=E==null?void 0:E.map((P=>({link:P})));(N=this._activeProviderReplies)==null||N.set(C,U),I=this._checkLinkProviderResult(C,p,I),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,h){const g=new Set;for(let S=0;S<h.size;S++){const I=h.get(S);if(I)for(let C=0;C<I.length;C++){const A=I[C],E=A.link.range.start.y<p?0:A.link.range.start.x,N=A.link.range.end.y>p?this._bufferService.cols:A.link.range.end.x;for(let F=E;F<=N;F++){if(g.has(F)){I.splice(C--,1);break}g.add(F)}}}}_checkLinkProviderResult(p,h,g){var S;if(!this._activeProviderReplies)return g;const I=this._activeProviderReplies.get(p);let C=!1;for(let A=0;A<p;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(C=!0);if(!C&&I){const A=I.find((E=>this._linkAtPosition(E.link,h)));A&&(g=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let A=0;A<this._activeProviderReplies.size;A++){const E=(S=this._activeProviderReplies.get(A))==null?void 0:S.find((N=>this._linkAtPosition(N.link,h)));if(E){g=!0,this._handleNewLink(E);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const h=this._positionFromMouseEvent(p,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,h){this._currentLink&&this._lastMouseEvent&&(!p||!h||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(p.link,h)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.pointerCursor},set:g=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.underline},set:g=>{var S,I,C;(S=this._currentLink)!=null&&S.state&&((C=(I=this._currentLink)==null?void 0:I.state)==null?void 0:C.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((g=>{if(!this._currentLink)return;const S=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,I=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=I&&(this._clearCurrentLink(S,I),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}}))))}_linkHover(p,h,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(g,h.text)}_fireUnderlineEvent(p,h){const g=p.range,S=this._bufferService.buffer.ydisp,I=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-S-1,g.end.x,g.end.y-S-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(I)}_linkLeave(p,h,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(g,h.text)}_linkAtPosition(p,h){const g=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,I=h.y*this._bufferService.cols+h.x;return g<=I&&I<=S}_positionFromMouseEvent(p,h,g){const S=g.getCoords(p,h,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,h,g,S,I){return{x1:p,y1:h,x2:g,y2:S,cols:this._bufferService.cols,fg:I}}};s.Linkifier=d=c([m(1,y.IMouseService),m(2,y.IRenderService),m(3,k.IBufferService),m(4,y.ILinkProviderService)],d)},9042:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,s,a){var c=this&&this.__decorate||function(y,d,p,h){var g,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(g=y[C])&&(I=(S<3?g(I):S>3?g(d,p,I):g(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},m=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const f=a(511),b=a(2585);let _=s.OscLinkProvider=class{constructor(y,d,p){this._bufferService=y,this._optionsService=d,this._oscLinkService=p}provideLinks(y,d){var p;const h=this._bufferService.buffer.lines.get(y-1);if(!h)return void d(void 0);const g=[],S=this._optionsService.rawOptions.linkHandler,I=new f.CellData,C=h.getTrimmedLength();let A=-1,E=-1,N=!1;for(let F=0;F<C;F++)if(E!==-1||h.hasContent(F)){if(h.loadCell(F,I),I.hasExtendedAttrs()&&I.extended.urlId){if(E===-1){E=F,A=I.extended.urlId;continue}N=I.extended.urlId!==A}else E!==-1&&(N=!0);if(N||E!==-1&&F===C-1){const U=(p=this._oscLinkService.getLinkData(A))==null?void 0:p.uri;if(U){const P={start:{x:E+1,y},end:{x:F+(N||F!==C-1?0:1),y}};let O=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const te=new URL(U);["http:","https:"].includes(te.protocol)||(O=!0)}catch{O=!0}O||g.push({text:U,range:P,activate:(te,le)=>S?S.activate(te,le,P):k(0,le),hover:(te,le)=>{var ge;return(ge=S==null?void 0:S.hover)==null?void 0:ge.call(S,te,le,P)},leave:(te,le)=>{var ge;return(ge=S==null?void 0:S.leave)==null?void 0:ge.call(S,te,le,P)}})}N=!1,I.hasExtendedAttrs()&&I.extended.urlId?(E=F,A=I.extended.urlId):(E=-1,A=-1)}}d(g)}};function k(y,d){if(confirm(`Do you want to navigate to ${d}?
|
|
163
|
+
`;_g([Te({type:String})],to.prototype,"copyText",2);to=_g([zt("copy-button")],to);var qa={exports:{}},i2=qa.exports,oh;function s2(){return oh||(oh=1,(function(e,t){(function(r,n){e.exports=n()})(i2,(()=>(()=>{var r={930:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(485);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(g,f,b){this._css.set(g,f,b)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,b){this._color.set(g,f,b)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},997:function(l,s,a){var c=this&&this.__decorate||function(A,E,N,O){var P,$=arguments.length,D=$<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,N):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(A,E,N,O);else for(var re=A.length-1;re>=0;re--)(P=A[re])&&(D=($<3?P(D):$>3?P(E,N,D):P(E,N))||D);return $>3&&D&&Object.defineProperty(E,N,D),D},g=this&&this.__param||function(A,E){return function(N,O){E(N,O,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=a(930),b=a(160),_=a(345),k=a(859),y=a(97),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),h=b.css.toColor("#ffffff"),m=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let N=0;N<216;N++){const O=E[N/36%6|0],P=E[N/6%6|0],$=E[N%6];A.push({css:b.channels.toCss(O,P,$),rgba:b.channels.toRgba(O,P,$)})}for(let N=0;N<24;N++){const O=8+10*N;A.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return A})());let I=s.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:h,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(A={}){const E=this._colors;if(E.foreground=C(A.foreground,d),E.background=C(A.background,p),E.cursor=C(A.cursor,h),E.cursorAccent=C(A.cursorAccent,m),E.selectionBackgroundTransparent=C(A.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=C(A.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=A.selectionForeground?C(A.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=C(A.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=C(A.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=C(A.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=C(A.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=C(A.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=C(A.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=C(A.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=C(A.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=C(A.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=C(A.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=C(A.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=C(A.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=C(A.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=C(A.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=C(A.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=C(A.brightWhite,s.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const N=Math.min(E.ansi.length-16,A.extendedAnsi.length);for(let O=0;O<N;O++)E.ansi[O+16]=C(A.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(A){A(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(A,E){if(A!==void 0)try{return b.css.toColor(A)}catch{}return E}s.ThemeService=I=c([g(0,y.IOptionsService)],I)},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,g=0,f=0;var b,_,k,y,d;function p(m){const S=m.toString(16);return S.length<2?"0"+S:S}function h(m,S){return m<S?(S+.05)/(m+.05):(m+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(m){m.toCss=function(S,I,C,A){return A!==void 0?`#${p(S)}${p(I)}${p(C)}${p(A)}`:`#${p(S)}${p(I)}${p(C)}`},m.toRgba=function(S,I,C,A=255){return(S<<24|I<<16|C<<8|A)>>>0},m.toColor=function(S,I,C,A){return{css:m.toCss(S,I,C,A),rgba:m.toRgba(S,I,C,A)}}})(b||(s.channels=b={})),(function(m){function S(I,C){return f=Math.round(255*C),[a,c,g]=d.toChannels(I.rgba),{css:b.toCss(a,c,g,f),rgba:b.toRgba(a,c,g,f)}}m.blend=function(I,C){if(f=(255&C.rgba)/255,f===1)return{css:C.css,rgba:C.rgba};const A=C.rgba>>24&255,E=C.rgba>>16&255,N=C.rgba>>8&255,O=I.rgba>>24&255,P=I.rgba>>16&255,$=I.rgba>>8&255;return a=O+Math.round((A-O)*f),c=P+Math.round((E-P)*f),g=$+Math.round((N-$)*f),{css:b.toCss(a,c,g),rgba:b.toRgba(a,c,g)}},m.isOpaque=function(I){return(255&I.rgba)==255},m.ensureContrastRatio=function(I,C,A){const E=d.ensureContrastRatio(I.rgba,C.rgba,A);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},m.opaque=function(I){const C=(255|I.rgba)>>>0;return[a,c,g]=d.toChannels(C),{css:b.toCss(a,c,g),rgba:C}},m.opacity=S,m.multiplyOpacity=function(I,C){return f=255&I.rgba,S(I,f*C/255)},m.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(_||(s.color=_={})),(function(m){let S,I;try{const C=document.createElement("canvas");C.width=1,C.height=1;const A=C.getContext("2d",{willReadFrequently:!0});A&&(S=A,S.globalCompositeOperation="copy",I=S.createLinearGradient(0,0,1,1))}catch{}m.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),b.toColor(a,c,g);case 5:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),f=parseInt(C.slice(4,5).repeat(2),16),b.toColor(a,c,g,f);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 A=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(A)return a=parseInt(A[1]),c=parseInt(A[2]),g=parseInt(A[3]),f=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),b.toColor(a,c,g,f);if(!S||!I)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=I,S.fillStyle=C,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,g,f]=S.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,g,f),css:C}}})(k||(s.css=k={})),(function(m){function S(I,C,A){const E=I/255,N=C/255,O=A/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}m.relativeLuminance=function(I){return S(I>>16&255,I>>8&255,255&I)},m.relativeLuminance2=S})(y||(s.rgb=y={})),(function(m){function S(C,A,E){const N=C>>24&255,O=C>>16&255,P=C>>8&255;let $=A>>24&255,D=A>>16&255,re=A>>8&255,le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));for(;le<E&&($>0||D>0||re>0);)$-=Math.max(0,Math.ceil(.1*$)),D-=Math.max(0,Math.ceil(.1*D)),re-=Math.max(0,Math.ceil(.1*re)),le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));return($<<24|D<<16|re<<8|255)>>>0}function I(C,A,E){const N=C>>24&255,O=C>>16&255,P=C>>8&255;let $=A>>24&255,D=A>>16&255,re=A>>8&255,le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));for(;le<E&&($<255||D<255||re<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),D=Math.min(255,D+Math.ceil(.1*(255-D))),re=Math.min(255,re+Math.ceil(.1*(255-re))),le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));return($<<24|D<<16|re<<8|255)>>>0}m.blend=function(C,A){if(f=(255&A)/255,f===1)return A;const E=A>>24&255,N=A>>16&255,O=A>>8&255,P=C>>24&255,$=C>>16&255,D=C>>8&255;return a=P+Math.round((E-P)*f),c=$+Math.round((N-$)*f),g=D+Math.round((O-D)*f),b.toRgba(a,c,g)},m.ensureContrastRatio=function(C,A,E){const N=y.relativeLuminance(C>>8),O=y.relativeLuminance(A>>8);if(h(N,O)<E){if(O<N){const D=S(C,A,E),re=h(N,y.relativeLuminance(D>>8));if(re<E){const le=I(C,A,E);return re>h(N,y.relativeLuminance(le>>8))?D:le}return D}const P=I(C,A,E),$=h(N,y.relativeLuminance(P>>8));if($<E){const D=S(C,A,E);return $>h(N,y.relativeLuminance(D>>8))?P:D}return P}},m.reduceLuminance=S,m.increaseLuminance=I,m.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=h},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((g=>c.fire(g)))},s.runAndSubscribe=function(a,c){return c(void 0),a((g=>c(g)))}},859:(l,s)=>{function a(c){for(const g of c)g.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const g=this._disposables.indexOf(c);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var g;this._isDisposed||c===this._value||((g=this._value)==null||g.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,f,b){this._data[g]||(this._data[g]={}),this._data[g][f]=b}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,g,f,b,_){this._data.get(c,g)||this._data.set(c,g,new a),this._data.get(c,g).set(f,b,_)}get(c,g,f,b){var _;return(_=this._data.get(c,g))==null?void 0:_.get(f,b)}clear(){this._data.clear()}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[c]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const f=function(b,_,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(f,b,k)};return f.toString=()=>g,s.serviceRegistry.set(g,f),f}},97:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(726);var g;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.HTMLSerializeHandler=l.SerializeAddon=void 0;const s=i(997);function a(y,d,p){return Math.max(d,Math.min(y,p))}class c{constructor(d){this._buffer=d}serialize(d,p){const h=this._buffer.getNullCell(),m=this._buffer.getNullCell();let S=h;const I=d.start.y,C=d.end.y,A=d.start.x,E=d.end.x;this._beforeSerialize(C-I,I,C);for(let N=I;N<=C;N++){const O=this._buffer.getLine(N);if(O){const P=N===d.start.y?A:0,$=N===d.end.y?E:O.length;for(let D=P;D<$;D++){const re=O.getCell(D,S===h?m:h);re?(this._nextCell(re,S,N,D),S=re):console.warn(`Can't get cell at row=${N}, col=${D}`)}}this._rowEnd(N,N===C)}return this._afterSerialize(),this._serializeString(p)}_nextCell(d,p,h,m){}_rowEnd(d,p){}_beforeSerialize(d,p,h){}_afterSerialize(){}_serializeString(d){return""}}function g(y,d){return y.getFgColorMode()===d.getFgColorMode()&&y.getFgColor()===d.getFgColor()}function f(y,d){return y.getBgColorMode()===d.getBgColorMode()&&y.getBgColor()===d.getBgColor()}function b(y,d){return y.isInverse()===d.isInverse()&&y.isBold()===d.isBold()&&y.isUnderline()===d.isUnderline()&&y.isOverline()===d.isOverline()&&y.isBlink()===d.isBlink()&&y.isInvisible()===d.isInvisible()&&y.isItalic()===d.isItalic()&&y.isDim()===d.isDim()&&y.isStrikethrough()===d.isStrikethrough()}class _ extends c{constructor(d,p){super(d),this._terminal=p,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(d,p,h){this._allRows=new Array(d),this._lastContentCursorRow=p,this._lastCursorRow=p,this._firstRow=p}_rowEnd(d,p){var h;this._nullCellCount>0&&!f(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let m="";if(!p){d-this._firstRow>=this._terminal.rows&&((h=this._buffer.getLine(this._cursorStyleRow))==null||h.getCell(this._cursorStyleCol,this._backgroundCell));const S=this._buffer.getLine(d),I=this._buffer.getLine(d+1);if(I.isWrapped){m="";const C=S.getCell(S.length-1,this._thisRowLastChar),A=S.getCell(S.length-2,this._thisRowLastSecondChar),E=I.getCell(0,this._nextRowFirstChar),N=E.getWidth()>1;let O=!1;(E.getChars()&&N?this._nullCellCount<=1:this._nullCellCount<=0)&&((C.getChars()||C.getWidth()===0)&&f(C,E)&&(O=!0),N&&(A.getChars()||A.getWidth()===0)&&f(C,E)&&f(A,E)&&(O=!0)),O||(m="-".repeat(this._nullCellCount+1),m+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(m+="\x1B[A",m+=`\x1B[${S.length-this._nullCellCount}C`,m+=`\x1B[${this._nullCellCount}X`,m+=`\x1B[${S.length-this._nullCellCount}D`,m+="\x1B[B"),this._lastContentCursorRow=d+1,this._lastContentCursorCol=0,this._lastCursorRow=d+1,this._lastCursorCol=0)}else m=`\r
|
|
164
|
+
`,this._lastCursorRow=d+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=m,this._currentRow="",this._nullCellCount=0}_diffStyle(d,p){const h=[],m=!g(d,p),S=!f(d,p),I=!b(d,p);if(m||S||I)if(d.isAttributeDefault())p.isAttributeDefault()||h.push(0);else{if(m){const C=d.getFgColor();d.isFgRGB()?h.push(38,2,C>>>16&255,C>>>8&255,255&C):d.isFgPalette()?C>=16?h.push(38,5,C):h.push(8&C?90+(7&C):30+(7&C)):h.push(39)}if(S){const C=d.getBgColor();d.isBgRGB()?h.push(48,2,C>>>16&255,C>>>8&255,255&C):d.isBgPalette()?C>=16?h.push(48,5,C):h.push(8&C?100+(7&C):40+(7&C)):h.push(49)}I&&(d.isInverse()!==p.isInverse()&&h.push(d.isInverse()?7:27),d.isBold()!==p.isBold()&&h.push(d.isBold()?1:22),d.isUnderline()!==p.isUnderline()&&h.push(d.isUnderline()?4:24),d.isOverline()!==p.isOverline()&&h.push(d.isOverline()?53:55),d.isBlink()!==p.isBlink()&&h.push(d.isBlink()?5:25),d.isInvisible()!==p.isInvisible()&&h.push(d.isInvisible()?8:28),d.isItalic()!==p.isItalic()&&h.push(d.isItalic()?3:23),d.isDim()!==p.isDim()&&h.push(d.isDim()?2:22),d.isStrikethrough()!==p.isStrikethrough()&&h.push(d.isStrikethrough()?9:29))}return h}_nextCell(d,p,h,m){if(d.getWidth()===0)return;const S=d.getChars()==="",I=this._diffStyle(d,this._cursorStyle);if(S?!f(this._cursorStyle,d):I.length>0){this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=h,this._lastContentCursorCol=this._lastCursorCol=m,this._currentRow+=`\x1B[${I.join(";")}m`;const C=this._buffer.getLine(h);C!==void 0&&(C.getCell(m,this._cursorStyle),this._cursorStyleRow=h,this._cursorStyleCol=m)}S?this._nullCellCount+=d.getWidth():(this._nullCellCount>0&&(f(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=d.getChars(),this._lastContentCursorRow=this._lastCursorRow=h,this._lastContentCursorCol=this._lastCursorCol=m+d.getWidth())}_serializeString(d){let p=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(p=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let h="";for(let C=0;C<p;C++)h+=this._allRows[C],C+1<p&&(h+=this._allRowSeparators[C]);if(!d){const C=this._buffer.baseY+this._buffer.cursorY,A=this._buffer.cursorX,E=N=>{N>0?h+=`\x1B[${N}C`:N<0&&(h+=`\x1B[${-N}D`)};(C!==this._lastCursorRow||A!==this._lastCursorCol)&&((m=C-this._lastCursorRow)>0?h+=`\x1B[${m}B`:m<0&&(h+=`\x1B[${-m}A`),E(A-this._lastCursorCol))}var m;const S=this._terminal._core._inputHandler._curAttrData,I=this._diffStyle(S,this._cursorStyle);return I.length>0&&(h+=`\x1B[${I.join(";")}m`),h}}l.SerializeAddon=class{activate(y){this._terminal=y}_serializeBufferByScrollback(y,d,p){const h=d.length,m=p===void 0?h:a(p+y.rows,0,h);return this._serializeBufferByRange(y,d,{start:h-m,end:h-1},!1)}_serializeBufferByRange(y,d,p,h){return new _(d,y).serialize({start:{x:0,y:typeof p.start=="number"?p.start:p.start.line},end:{x:y.cols,y:typeof p.end=="number"?p.end:p.end.line}},h)}_serializeBufferAsHTML(y,d){var p;const h=y.buffer.active,m=new k(h,y,d);if(!d.onlySelection){const I=h.length,C=d.scrollback,A=C===void 0?I:a(C+y.rows,0,I);return m.serialize({start:{x:0,y:I-A},end:{x:y.cols,y:I-1}})}const S=(p=this._terminal)==null?void 0:p.getSelectionPosition();return S!==void 0?m.serialize({start:{x:S.start.x,y:S.start.y},end:{x:S.end.x,y:S.end.y}}):""}_serializeModes(y){let d="";const p=y.modes;if(p.applicationCursorKeysMode&&(d+="\x1B[?1h"),p.applicationKeypadMode&&(d+="\x1B[?66h"),p.bracketedPasteMode&&(d+="\x1B[?2004h"),p.insertMode&&(d+="\x1B[4h"),p.originMode&&(d+="\x1B[?6h"),p.reverseWraparoundMode&&(d+="\x1B[?45h"),p.sendFocusMode&&(d+="\x1B[?1004h"),p.wraparoundMode===!1&&(d+="\x1B[?7l"),p.mouseTrackingMode!=="none")switch(p.mouseTrackingMode){case"x10":d+="\x1B[?9h";break;case"vt200":d+="\x1B[?1000h";break;case"drag":d+="\x1B[?1002h";break;case"any":d+="\x1B[?1003h"}return d}serialize(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let d=y!=null&&y.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,y.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,y==null?void 0:y.scrollback);return y!=null&&y.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(d+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),y!=null&&y.excludeModes||(d+=this._serializeModes(this._terminal)),d}serializeAsHTML(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,y||{})}dispose(){}};class k extends c{constructor(d,p,h){super(d),this._terminal=p,this._options=h,this._currentRow="",this._htmlContent="",p._core._themeService?this._ansiColors=p._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(d,p,h){return p>>=0,h=h??" ",d.length>p?d:((p-=d.length)>h.length&&(h+=h.repeat(p/h.length)),h.slice(0,p)+d)}_beforeSerialize(d,p,h){var m,S;this._htmlContent+="<html><body><!--StartFragment--><pre>";let I="#000000",C="#ffffff";this._options.includeGlobalBackground&&(I=((m=this._terminal.options.theme)==null?void 0:m.foreground)??"#ffffff",C=((S=this._terminal.options.theme)==null?void 0:S.background)??"#000000");const A=[];A.push("color: "+I+";"),A.push("background-color: "+C+";"),A.push("font-family: "+this._terminal.options.fontFamily+";"),A.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+A.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(d,p){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(d,p){const h=p?d.getFgColor():d.getBgColor();return(p?d.isFgRGB():d.isBgRGB())?"#"+[h>>16&255,h>>8&255,255&h].map((m=>this._padStart(m.toString(16),2,"0"))).join(""):(p?d.isFgPalette():d.isBgPalette())?this._ansiColors[h].css:void 0}_diffStyle(d,p){const h=[],m=!g(d,p),S=!f(d,p),I=!b(d,p);if(m||S||I){const C=this._getHexColor(d,!0);C&&h.push("color: "+C+";");const A=this._getHexColor(d,!1);return A&&h.push("background-color: "+A+";"),d.isInverse()&&h.push("color: #000000; background-color: #BFBFBF;"),d.isBold()&&h.push("font-weight: bold;"),d.isUnderline()&&d.isOverline()?h.push("text-decoration: overline underline;"):d.isUnderline()?h.push("text-decoration: underline;"):d.isOverline()&&h.push("text-decoration: overline;"),d.isBlink()&&h.push("text-decoration: blink;"),d.isInvisible()&&h.push("visibility: hidden;"),d.isItalic()&&h.push("font-style: italic;"),d.isDim()&&h.push("opacity: 0.5;"),d.isStrikethrough()&&h.push("text-decoration: line-through;"),h}}_nextCell(d,p,h,m){if(d.getWidth()===0)return;const S=d.getChars()==="",I=this._diffStyle(d,p);I&&(this._currentRow+=I.length===0?"</span><span>":"</span><span style='"+I.join(" ")+"'>"),this._currentRow+=S?" ":d.getChars()}_serializeString(){return this._htmlContent}}l.HTMLSerializeHandler=k})(),o})()))})(qa)),qa.exports}var o2=s2(),Qa={exports:{}},a2=Qa.exports,ah;function c2(){return ah||(ah=1,(function(e,t){(function(r,n){e.exports=n()})(a2,(()=>(()=>{var r={433:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=a(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],b=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let k;function y(d,p){let h,m=0,S=p.length-1;if(d<p[0][0]||d>p[S][1])return!1;for(;S>=m;)if(h=m+S>>1,d>p[h][1])m=h+1;else{if(!(d<p[h][0]))return!0;S=h-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!k){k=new Uint8Array(65536),k.fill(1),k[0]=0,k.fill(0,1,32),k.fill(0,127,160);for(let d=0;d<g.length;++d)k.fill(0,g[d][0],g[d][1]+1);for(let d=0;d<b.length;++d)k.fill(2,b[d][0],b[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?k[d]:y(d,f)?0:y(d,_)?2:1}charProperties(d,p){let h=this.wcwidth(d),m=h===0&&p!==0;if(m){const S=c.UnicodeService.extractWidth(p);S===0?m=!1:S>h&&(h=S)}return c.UnicodeService.createPropertyValue(0,h,m)}}},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((g=>c.fire(g)))},s.runAndSubscribe=function(a,c){return c(void 0),a((g=>c(g)))}},490:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(938),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<g.length;++_)b.fill(0,g[_][0],g[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(k,y){let d,p=0,h=y.length-1;if(k<y[0][0]||k>y[h][1])return!1;for(;h>=p;)if(d=p+h>>1,k>y[d][1])p=d+1;else{if(!(k<y[d][0]))return!0;h=d-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,k){let y=this.wcwidth(_),d=y===0&&k!==0;if(d){const p=c.UnicodeService.extractWidth(k);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},938:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(345),g=a(490);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,k,y=!1){return(16777215&_)<<3|(3&k)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new g.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let k=0,y=0;const d=_.length;for(let p=0;p<d;++p){let h=_.charCodeAt(p);if(55296<=h&&h<=56319){if(++p>=d)return k+this.wcwidth(h);const I=_.charCodeAt(p);56320<=I&&I<=57343?h=1024*(h-55296)+I-56320+65536:k+=this.wcwidth(I)}const m=this.charProperties(h,y);let S=f.extractWidth(m);f.extractShouldJoin(m)&&(S-=f.extractWidth(y)),k+=S,y=m}return k}charProperties(_,k){return this._activeProvider.charProperties(_,k)}}s.UnicodeService=f}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Unicode11Addon=void 0;const s=i(433);l.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),o})()))})(Qa)),Qa.exports}var l2=c2(),ch={exports:{}},lh;function u2(){return lh||(lh=1,(function(e,t){(function(r,n){e.exports=n()})(self,(()=>(()=>{var r={6:(l,s)=>{function a(g){try{const f=new URL(g),b=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return g.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(g,f,b,_={}){this._terminal=g,this._regex=f,this._handler=b,this._options=_}provideLinks(g,f){const b=c.computeLink(g,this._regex,this._terminal,this._handler);f(this._addCallbacks(b))}_addCallbacks(g){return g.map((f=>(f.leave=this._options.leave,f.hover=(b,_)=>{if(this._options.hover){const{range:k}=f;this._options.hover(b,_,k)}},f)))}};class c{static computeLink(f,b,_,k){const y=new RegExp(b.source,(b.flags||"")+"g"),[d,p]=c._getWindowedLineStrings(f-1,_),h=d.join("");let m;const S=[];for(;m=y.exec(h);){const I=m[0];if(!a(I))continue;const[C,A]=c._mapStrIdx(_,p,0,m.index),[E,N]=c._mapStrIdx(_,C,A,I.length);if(C===-1||A===-1||E===-1||N===-1)continue;const O={start:{x:A+1,y:C+1},end:{x:N,y:E+1}};S.push({range:O,text:I,activate:k})}return S}static _getWindowedLineStrings(f,b){let _,k=f,y=f,d=0,p="";const h=[];if(_=b.buffer.active.getLine(f)){const m=_.translateToString(!0);if(_.isWrapped&&m[0]!==" "){for(d=0;(_=b.buffer.active.getLine(--k))&&d<2048&&(p=_.translateToString(!0),d+=p.length,h.push(p),_.isWrapped&&p.indexOf(" ")===-1););h.reverse()}for(h.push(m),d=0;(_=b.buffer.active.getLine(++y))&&_.isWrapped&&d<2048&&(p=_.translateToString(!0),d+=p.length,h.push(p),p.indexOf(" ")===-1););}return[h,k]}static _mapStrIdx(f,b,_,k){const y=f.buffer.active,d=y.getNullCell();let p=_;for(;k;){const h=y.getLine(b);if(!h)return[-1,-1];for(let m=p;m<h.length;++m){h.getCell(m,d);const S=d.getChars();if(d.getWidth()&&(k-=S.length||1,m===h.length-1&&S==="")){const I=y.getLine(b+1);I&&I.isWrapped&&(I.getCell(0,d),d.getWidth()===2&&(k+=1))}if(k<0)return[b,m]}b++,p=0}return[b,p]}}s.LinkComputer=c}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const s=i(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(g,f){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(g=c,f={}){this._handler=g,this._options=f}activate(g){this._terminal=g;const f=this._options,b=f.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,b,this._handler,f))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),o})()))})(ch)),ch.exports}var d2=u2(),uh={exports:{}},dh;function h2(){return dh||(dh=1,(function(e,t){(function(r,n){e.exports=n()})(globalThis,(()=>(()=>{var r={4567:function(l,s,a){var c=this&&this.__decorate||function(h,m,S,I){var C,A=arguments.length,E=A<3?m:I===null?I=Object.getOwnPropertyDescriptor(m,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,m,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(m,S,E):C(m,S))||E);return A>3&&E&&Object.defineProperty(m,S,E),E},g=this&&this.__param||function(h,m){return function(S,I){m(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const f=a(9042),b=a(9924),_=a(844),k=a(4725),y=a(2585),d=a(3656);let p=s.AccessibilityManager=class extends _.Disposable{constructor(h,m,S,I){super(),this._terminal=h,this._coreBrowserService=S,this._renderService=I,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((C=>this._handleResize(C.rows)))),this.register(this._terminal.onRender((C=>this._refreshRows(C.start,C.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((C=>this._handleChar(C)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
165
|
+
`)))),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,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let m=0;m<h;m++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
|
|
166
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,m){this._liveRegionDebouncer.refresh(h,m,this._terminal.rows)}_renderRows(h,m){const S=this._terminal.buffer,I=S.lines.length.toString();for(let C=h;C<=m;C++){const A=S.lines.get(S.ydisp+C),E=[],N=(A==null?void 0:A.translateToString(!0,void 0,void 0,E))||"",O=(S.ydisp+C+1).toString(),P=this._rowElements[C];P&&(N.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=N,this._rowColumns.set(P,E)),P.setAttribute("aria-posinset",O),P.setAttribute("aria-setsize",I))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,m){const S=h.target,I=this._rowElements[m===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==I)return;let C,A;if(m===0?(C=S,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(C=this._rowElements.shift(),A=S,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),m===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(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){var h;if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:m.anchorNode,offset:m.anchorOffset},I={node:m.focusNode,offset:m.focusOffset};if((S.node.compareDocumentPosition(I.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===I.node&&S.offset>I.offset)&&([S,I]=[I,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const C=this._rowElements.slice(-1)[0];if(I.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(I={node:C,offset:((h=C.textContent)==null?void 0:h.length)??0}),!this._rowContainer.contains(I.node))return;const A=({node:O,offset:P})=>{const $=O instanceof Text?O.parentNode:O;let D=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const re=this._rowColumns.get($);if(!re)return console.warn("columns is null. Race condition?"),null;let le=P<re.length?re[P]:re.slice(-1)[0]+1;return le>=this._terminal.cols&&(++D,le=0),{row:D,column:le}},E=A(S),N=A(I);if(E&&N){if(E.row>N.row||E.row===N.row&&E.column>=N.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(N.row-E.row)*this._terminal.cols-E.column+N.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=p=c([g(1,y.IInstantiationService),g(2,k.ICoreBrowserService),g(3,k.IRenderService)],p)},3614:(l,s)=>{function a(b){return b.replace(/\r?\n/g,"\r")}function c(b,_){return _?"\x1B[200~"+b+"\x1B[201~":b}function g(b,_,k,y){b=c(b=a(b),k.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),_.value=""}function f(b,_,k){const y=k.getBoundingClientRect(),d=b.clientX-y.left-10,p=b.clientY-y.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${d}px`,_.style.top=`${p}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=c,s.copyHandler=function(b,_){b.clipboardData&&b.clipboardData.setData("text/plain",_.selectionText),b.preventDefault()},s.handlePasteEvent=function(b,_,k,y){b.stopPropagation(),b.clipboardData&&g(b.clipboardData.getData("text/plain"),_,k,y)},s.paste=g,s.moveTextAreaUnderMouseCursor=f,s.rightClickHandler=function(b,_,k,y,d){f(b,_,k),d&&y.rightClickSelect(b),_.value=y.selectionText,_.select()}},7239:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(g,f,b){this._css.set(g,f,b)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,b){this._color.set(g,f,b)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,c,g,f){a.addEventListener(c,g,f);let b=!1;return{dispose:()=>{b||(b=!0,a.removeEventListener(c,g,f))}}}},3551:function(l,s,a){var c=this&&this.__decorate||function(p,h,m,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,m,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,m,A):I(h,m))||A);return C>3&&A&&Object.defineProperty(h,m,A),A},g=this&&this.__param||function(p,h){return function(m,S){h(m,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const f=a(3656),b=a(8460),_=a(844),k=a(2585),y=a(4725);let d=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(p,h,m,S,I){super(),this._element=p,this._mouseService=h,this._renderService=m,this._bufferService=S,this._linkProviderService=I,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.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,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const h=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const m=p.composedPath();for(let S=0;S<m.length;S++){const I=m[S];if(I.classList.contains("xterm"))break;if(I.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,h){var m,S;this._activeProviderReplies&&h||((m=this._activeProviderReplies)==null||m.forEach((C=>{C==null||C.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let I=!1;for(const[C,A]of this._linkProviderService.linkProviders.entries())h?(S=this._activeProviderReplies)!=null&&S.get(C)&&(I=this._checkLinkProviderResult(C,p,I)):A.provideLinks(p.y,(E=>{var N,O;if(this._isMouseOut)return;const P=E==null?void 0:E.map(($=>({link:$})));(N=this._activeProviderReplies)==null||N.set(C,P),I=this._checkLinkProviderResult(C,p,I),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,h){const m=new Set;for(let S=0;S<h.size;S++){const I=h.get(S);if(I)for(let C=0;C<I.length;C++){const A=I[C],E=A.link.range.start.y<p?0:A.link.range.start.x,N=A.link.range.end.y>p?this._bufferService.cols:A.link.range.end.x;for(let O=E;O<=N;O++){if(m.has(O)){I.splice(C--,1);break}m.add(O)}}}}_checkLinkProviderResult(p,h,m){var S;if(!this._activeProviderReplies)return m;const I=this._activeProviderReplies.get(p);let C=!1;for(let A=0;A<p;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(C=!0);if(!C&&I){const A=I.find((E=>this._linkAtPosition(E.link,h)));A&&(m=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!m)for(let A=0;A<this._activeProviderReplies.size;A++){const E=(S=this._activeProviderReplies.get(A))==null?void 0:S.find((N=>this._linkAtPosition(N.link,h)));if(E){m=!0,this._handleNewLink(E);break}}return m}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const h=this._positionFromMouseEvent(p,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,h){this._currentLink&&this._lastMouseEvent&&(!p||!h||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(p.link,h)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var m,S;return(S=(m=this._currentLink)==null?void 0:m.state)==null?void 0:S.decorations.pointerCursor},set:m=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==m&&(this._currentLink.state.decorations.pointerCursor=m,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",m))}},underline:{get:()=>{var m,S;return(S=(m=this._currentLink)==null?void 0:m.state)==null?void 0:S.decorations.underline},set:m=>{var S,I,C;(S=this._currentLink)!=null&&S.state&&((C=(I=this._currentLink)==null?void 0:I.state)==null?void 0:C.decorations.underline)!==m&&(this._currentLink.state.decorations.underline=m,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,m))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((m=>{if(!this._currentLink)return;const S=m.start===0?0:m.start+1+this._bufferService.buffer.ydisp,I=this._bufferService.buffer.ydisp+1+m.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=I&&(this._clearCurrentLink(S,I),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}}))))}_linkHover(p,h,m){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(m,h.text)}_fireUnderlineEvent(p,h){const m=p.range,S=this._bufferService.buffer.ydisp,I=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-S-1,m.end.x,m.end.y-S-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(I)}_linkLeave(p,h,m){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(m,h.text)}_linkAtPosition(p,h){const m=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,I=h.y*this._bufferService.cols+h.x;return m<=I&&I<=S}_positionFromMouseEvent(p,h,m){const S=m.getCoords(p,h,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,h,m,S,I){return{x1:p,y1:h,x2:m,y2:S,cols:this._bufferService.cols,fg:I}}};s.Linkifier=d=c([g(1,y.IMouseService),g(2,y.IRenderService),g(3,k.IBufferService),g(4,y.ILinkProviderService)],d)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,h){var m,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(m=y[C])&&(I=(S<3?m(I):S>3?m(d,p,I):m(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},g=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const f=a(511),b=a(2585);let _=s.OscLinkProvider=class{constructor(y,d,p){this._bufferService=y,this._optionsService=d,this._oscLinkService=p}provideLinks(y,d){var p;const h=this._bufferService.buffer.lines.get(y-1);if(!h)return void d(void 0);const m=[],S=this._optionsService.rawOptions.linkHandler,I=new f.CellData,C=h.getTrimmedLength();let A=-1,E=-1,N=!1;for(let O=0;O<C;O++)if(E!==-1||h.hasContent(O)){if(h.loadCell(O,I),I.hasExtendedAttrs()&&I.extended.urlId){if(E===-1){E=O,A=I.extended.urlId;continue}N=I.extended.urlId!==A}else E!==-1&&(N=!0);if(N||E!==-1&&O===C-1){const P=(p=this._oscLinkService.getLinkData(A))==null?void 0:p.uri;if(P){const $={start:{x:E+1,y},end:{x:O+(N||O!==C-1?0:1),y}};let D=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const re=new URL(P);["http:","https:"].includes(re.protocol)||(D=!0)}catch{D=!0}D||m.push({text:P,range:$,activate:(re,le)=>S?S.activate(re,le,$):k(0,le),hover:(re,le)=>{var ge;return(ge=S==null?void 0:S.hover)==null?void 0:ge.call(S,re,le,$)},leave:(re,le)=>{var ge;return(ge=S==null?void 0:S.leave)==null?void 0:ge.call(S,re,le,$)}})}N=!1,I.hasExtendedAttrs()&&I.extended.urlId?(E=O,A=I.extended.urlId):(E=-1,A=-1)}}d(m)}};function k(y,d){if(confirm(`Do you want to navigate to ${d}?
|
|
167
167
|
|
|
168
|
-
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([m(0,b.IBufferService),m(1,b.IOptionsService),m(2,b.IOscLinkService)],_)},6193:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=a(3614),m=a(3656),f=a(3551),b=a(9042),_=a(3730),k=a(1680),y=a(3107),d=a(5744),p=a(2950),h=a(1296),g=a(428),S=a(4269),I=a(5114),C=a(8934),A=a(3230),E=a(9312),N=a(4725),F=a(6731),U=a(8055),P=a(8969),O=a(8460),te=a(844),le=a(6114),ge=a(8437),ke=a(2584),ie=a(7399),B=a(5941),V=a(9074),W=a(2585),Z=a(5435),he=a(4567),me=a(779);class be extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(J={}){super(J),this.browser=le,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new te.MutableDisposable),this._onCursorMove=this.register(new O.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new O.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new O.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new O.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new O.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new O.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new O.EventEmitter),this._onBlur=this.register(new O.EventEmitter),this._onA11yCharEmitter=this.register(new O.EventEmitter),this._onA11yTabEmitter=this.register(new O.EventEmitter),this._onWillOpen=this.register(new O.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(V.DecorationService),this._instantiationService.setService(W.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(me.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,se)=>this.refresh(L,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,O.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,O.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,O.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,te.toDisposable)((()=>{var L,se;this._customKeyEventHandler=void 0,(se=(L=this.element)==null?void 0:L.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const L of J){let se,ae="";switch(L.index){case 256:se="foreground",ae="10";break;case 257:se="background",ae="11";break;case 258:se="cursor",ae="12";break;default:se="ansi",ae="4;"+L.index}switch(L.type){case 0:const Ie=U.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${ke.C0.ESC}]${ae};${(0,B.toRgbString)(Ie)}${ke.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((fe=>fe.ansi[L.index]=U.channels.toColor(...L.color)));else{const fe=se;this._themeService.modifyColors((Fe=>Fe[fe]=U.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(he.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var J;return(J=this.textarea)==null?void 0:J.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const J=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(J);if(!L)return;const se=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,Ie=L.getWidth(se),fe=this._renderService.dimensions.css.cell.width*Ie,Fe=this.buffer.y*this._renderService.dimensions.css.cell.height,tt=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=tt+"px",this.textarea.style.top=Fe+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,c.copyHandler)(L,this._selectionService)})));const J=L=>(0,c.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,m.addDisposableDomListener)(this.element,"paste",J)),le.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),le.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,c.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){var L;if(!J)throw new Error("Terminal requires a parent element.");if(J.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((L=this.element)==null?void 0:L.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=J.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),J.appendChild(this.element);const se=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),se.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),se.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),le.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(I.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(F.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(A.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(se);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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(he.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,L=this.element;function se(fe){const Fe=J._mouseService.getMouseReportCoords(fe,J.screenElement);if(!Fe)return!1;let tt,Xe;switch(fe.overrideType||fe.type){case"mousemove":Xe=32,fe.buttons===void 0?(tt=3,fe.button!==void 0&&(tt=fe.button<3?fe.button:3)):tt=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Xe=0,tt=fe.button<3?fe.button:3;break;case"mousedown":Xe=1,tt=fe.button<3?fe.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(fe)===!1||J.viewport.getLinesScrolled(fe)===0)return!1;Xe=fe.deltaY<0?0:1,tt=4;break;default:return!1}return!(Xe===void 0||tt===void 0||tt>4)&&J.coreMouseService.triggerMouseEvent({col:Fe.col,row:Fe.row,x:Fe.x,y:Fe.y,button:tt,action:Xe,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ie={mouseup:fe=>(se(fe),fe.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(fe)),wheel:fe=>(se(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&se(fe)},mousemove:fe=>{fe.buttons||se(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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&fe?ae.mousemove||(L.addEventListener("mousemove",Ie.mousemove),ae.mousemove=Ie.mousemove):(L.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&fe?ae.wheel||(L.addEventListener("wheel",Ie.wheel,{passive:!1}),ae.wheel=Ie.wheel):(L.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&fe?ae.mouseup||(ae.mouseup=Ie.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&fe?ae.mousedrag||(ae.mousedrag=Ie.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return se(fe),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(fe)}))),this.register((0,m.addDisposableDomListener)(L,"wheel",(fe=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const Fe=this.viewport.getLinesScrolled(fe);if(Fe===0)return;const tt=ke.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Xe="";for(let xt=0;xt<Math.abs(Fe);xt++)Xe+=tt;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(J,L){var se;(se=this._renderService)==null||se.refreshRows(J,L)}updateCursorStyle(J){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(J)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(J,L,se=0){var ae;se===1?(super.scrollLines(J,L,se),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(J)}paste(J){(0,c.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,L,se){this._selectionService.setSelection(J,L,se)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var J;(J=this._selectionService)==null||J.clearSelection()}selectAll(){var J;(J=this._selectionService)==null||J.selectAll()}selectLines(J,L){var se;(se=this._selectionService)==null||se.selectLines(J,L)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!L&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,ie.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),se.type===3||se.type===2){const ae=this.rows-1;return this.scrollLines(se.type===2?-ae:ae),this.cancel(J,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(se.cancel&&this.cancel(J,!0),!se.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==ke.C0.ETX&&se.key!==ke.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,L){const se=J.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||J.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||J.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?se:se&&(!L.keyCode||L.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)L=J.charCode;else if(J.which===null||J.which===void 0)L=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;L=J.which}return!(!L||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=J.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(J),!0}return!1}resize(J,L){J!==this.cols||L!==this.rows?super.resize(J,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,L){var se,ae;(se=this._charSizeService)==null||se.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var J;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(ge.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(J=this.viewport)==null||J.reset(),this.refresh(0,this.rows-1)}}reset(){var J,L;this.options.rows=this.rows,this.options.cols=this.cols;const se=this._customKeyEventHandler;this._setup(),super.reset(),(J=this._selectionService)==null||J.reset(),this._decorationService.reset(),(L=this.viewport)==null||L.reset(),this._customKeyEventHandler=se,this.refresh(0,this.rows-1)}clearTextureAtlas(){var J;(J=this._renderService)==null||J.clearTextureAtlas()}_reportFocus(){var J;(J=this.element)!=null&&J.classList.contains("focus")?this.coreService.triggerDataEvent(ke.C0.ESC+"[I"):this.coreService.triggerDataEvent(ke.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case Z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[4;${se};${L}t`);break;case Z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),Ie=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[6;${Ie};${ae}t`)}}cancel(J,L){if(this.options.cancelEvents||L)return J.preventDefault(),J.stopPropagation(),!1}}s.Terminal=be},9924:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=f-this._lastRefreshMs,_=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(u,s,a){var c=this&&this.__decorate||function(p,h,g,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,g,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,g,A):I(h,g))||A);return C>3&&A&&Object.defineProperty(h,g,A),A},m=this&&this.__param||function(p,h){return function(g,S){h(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const f=a(3656),b=a(4725),_=a(8460),k=a(844),y=a(2585);let d=s.Viewport=class extends k.Disposable{constructor(p,h,g,S,I,C,A,E){super(),this._viewportElement=p,this._scrollArea=h,this._bufferService=g,this._optionsService=S,this._charSizeService=I,this._renderService=C,this._coreBrowserService=A,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,h){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&g<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const h=this._getPixelsScrolled(p);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(p,h){var g;let S,I="";const C=[],A=h??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let N=p;N<A;N++){const F=E.get(N);if(!F)continue;const U=(g=E.get(N+1))==null?void 0:g.isWrapped;if(I+=F.translateToString(!U),!U||N===E.length-1){const P=document.createElement("div");P.textContent=I,C.push(P),I.length>0&&(S=P),I=""}}return{bufferElements:C,cursorElement:S}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(p,h){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&h.altKey||g==="ctrl"&&h.ctrlKey||g==="shift"&&h.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const h=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}};s.Viewport=d=c([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,b.ICharSizeService),m(5,b.IRenderService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],d)},3107:function(u,s,a){var c=this&&this.__decorate||function(y,d,p,h){var g,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(g=y[C])&&(I=(S<3?g(I):S>3?g(d,p,I):g(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},m=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const f=a(4725),b=a(844),_=a(2585);let k=s.BufferDecorationRenderer=class extends b.Disposable{constructor(y,d,p,h,g){super(),this._screenElement=y,this._bufferService=d,this._coreBrowserService=p,this._decorationService=h,this._renderService=g,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((S=>this._removeDecoration(S)))),this.register((0,b.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 y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var d;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((d=y==null?void 0:y.options)==null?void 0:d.layer)==="top"),p.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=y.options.x??0;return h&&h>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(y,p),p}_refreshStyle(y){const d=y.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let p=this._decorationElements.get(y);p||(p=this._createElement(y),y.element=p,this._decorationElements.set(y,p),this._container.appendChild(p),y.onDispose((()=>{this._decorationElements.delete(y),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(p)}}_refreshXPosition(y,d=y.element){if(!d)return;const p=y.options.x??0;(y.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var d;(d=this._decorationElements.get(y))==null||d.remove(),this._decorationElements.delete(y),y.dispose()}};s.BufferDecorationRenderer=k=c([m(1,_.IBufferService),m(2,f.ICoreBrowserService),m(3,_.IDecorationService),m(4,f.IRenderService)],k)},5871:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,m){return c>=a.startBufferLine-this._linePadding[m||"full"]&&c<=a.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(u,s,a){var c=this&&this.__decorate||function(g,S,I,C){var A,E=arguments.length,N=E<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,I):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,S,I,C);else for(var F=g.length-1;F>=0;F--)(A=g[F])&&(N=(E<3?A(N):E>3?A(S,I,N):A(S,I))||N);return E>3&&N&&Object.defineProperty(S,I,N),N},m=this&&this.__param||function(g,S){return function(I,C){S(I,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const f=a(5871),b=a(4725),_=a(844),k=a(2585),y={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let h=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,S,I,C,A,E,N){var F;super(),this._viewportElement=g,this._screenElement=S,this._bufferService=I,this._decorationService=C,this._renderService=A,this._optionsService=E,this._coreBrowserService=N,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const g=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=g,d.center=S,d.right=g,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const S of g)S.position!=="full"&&this._renderColorZone(S);for(const S of g)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(p[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-y[g.position||"full"]/2),d[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[g.position||"full"]))}_queueRefresh(g,S){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=h=c([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,b.IRenderService),m(5,k.IOptionsService),m(6,b.ICoreBrowserService)],h)},2950:function(u,s,a){var c=this&&this.__decorate||function(y,d,p,h){var g,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(g=y[C])&&(I=(S<3?g(I):S>3?g(d,p,I):g(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},m=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const f=a(4725),b=a(2585),_=a(2584);let k=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,d,p,h,g,S){this._textarea=y,this._compositionView=d,this._bufferService=p,this._optionsService=h,this._coreService=g,this._renderService=S,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(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(y,"");this._dataAlreadySent=p,d.length>y.length?this._coreService.triggerDataEvent(p,!0):d.length<y.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):d.length===y.length&&d!==y&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=k=c([m(2,b.IBufferService),m(3,b.IOptionsService),m(4,b.ICoreService),m(5,f.IRenderService)],k)},9806:(u,s)=>{function a(c,m,f){const b=f.getBoundingClientRect(),_=c.getComputedStyle(f),k=parseInt(_.getPropertyValue("padding-left")),y=parseInt(_.getPropertyValue("padding-top"));return[m.clientX-b.left-k,m.clientY-b.top-y]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(c,m,f,b,_,k,y,d,p){if(!k)return;const h=a(c,m,f);return h?(h[0]=Math.ceil((h[0]+(p?y/2:0))/y),h[1]=Math.ceil(h[1]/d),h[0]=Math.min(Math.max(h[0],1),b+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),_),h):void 0}},9504:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=a(2584);function m(d,p,h,g){const S=d-f(d,h),I=p-f(p,h),C=Math.abs(S-I)-(function(A,E,N){let F=0;const U=A-f(A,N),P=E-f(E,N);for(let O=0;O<Math.abs(U-P);O++){const te=b(A,E)==="A"?-1:1,le=N.buffer.lines.get(U+te*O);le!=null&&le.isWrapped&&F++}return F})(d,p,h);return y(C,k(b(d,p),g))}function f(d,p){let h=0,g=p.buffer.lines.get(d),S=g==null?void 0:g.isWrapped;for(;S&&d>=0&&d<p.rows;)h++,g=p.buffer.lines.get(--d),S=g==null?void 0:g.isWrapped;return h}function b(d,p){return d>p?"A":"B"}function _(d,p,h,g,S,I){let C=d,A=p,E="";for(;C!==h||A!==g;)C+=S?1:-1,S&&C>I.cols-1?(E+=I.buffer.translateBufferLineToString(A,!1,d,C),C=0,d=0,A++):!S&&C<0&&(E+=I.buffer.translateBufferLineToString(A,!1,0,d+1),C=I.cols-1,d=C,A--);return E+I.buffer.translateBufferLineToString(A,!1,d,C)}function k(d,p){const h=p?"O":"[";return c.C0.ESC+h+d}function y(d,p){d=Math.floor(d);let h="";for(let g=0;g<d;g++)h+=p;return h}s.moveToCellSequence=function(d,p,h,g){const S=h.buffer.x,I=h.buffer.y;if(!h.buffer.hasScrollback)return(function(E,N,F,U,P,O){return m(N,U,P,O).length===0?"":y(_(E,N,E,N-f(N,P),!1,P).length,k("D",O))})(S,I,0,p,h,g)+m(I,p,h,g)+(function(E,N,F,U,P,O){let te;te=m(N,U,P,O).length>0?U-f(U,P):N;const le=U,ge=(function(ke,ie,B,V,W,Z){let he;return he=m(B,V,W,Z).length>0?V-f(V,W):ie,ke<B&&he<=V||ke>=B&&he<V?"C":"D"})(E,N,F,U,P,O);return y(_(E,te,F,le,ge==="C",P).length,k(ge,O))})(S,I,d,p,h,g);let C;if(I===p)return C=S>d?"D":"C",y(Math.abs(S-d),k(C,g));C=I>p?"D":"C";const A=Math.abs(I-p);return y((function(E,N){return N.cols-E})(I>p?d:S,h)+(A-1)*h.cols+1+((I>p?S:d)-1),k(C,g))}},1296:function(u,s,a){var c=this&&this.__decorate||function(O,te,le,ge){var ke,ie=arguments.length,B=ie<3?te:ge===null?ge=Object.getOwnPropertyDescriptor(te,le):ge;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(O,te,le,ge);else for(var V=O.length-1;V>=0;V--)(ke=O[V])&&(B=(ie<3?ke(B):ie>3?ke(te,le,B):ke(te,le))||B);return ie>3&&B&&Object.defineProperty(te,le,B),B},m=this&&this.__param||function(O,te){return function(le,ge){te(le,ge,O)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const f=a(3787),b=a(2550),_=a(2223),k=a(6171),y=a(6052),d=a(4725),p=a(8055),h=a(8460),g=a(844),S=a(2585),I="xterm-dom-renderer-owner-",C="xterm-rows",A="xterm-fg-",E="xterm-bg-",N="xterm-focus",F="xterm-selection";let U=1,P=s.DomRenderer=class extends g.Disposable{constructor(O,te,le,ge,ke,ie,B,V,W,Z,he,me,be){super(),this._terminal=O,this._document=te,this._element=le,this._screenElement=ge,this._viewportElement=ke,this._helperContainer=ie,this._linkifier2=B,this._charSizeService=W,this._optionsService=Z,this._bufferService=he,this._coreBrowserService=me,this._themeService=be,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.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(F),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Ee=>this._injectCss(Ee)))),this._injectCss(this._themeService.colors),this._rowFactory=V.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(I+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Ee=>this._handleLinkHover(Ee)))),this.register(this._linkifier2.onHideLinkUnderline((Ee=>this._handleLinkLeave(Ee)))),this.register((0,g.toDisposable)((()=>{this._element.classList.remove(I+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.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 O=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*O,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*O),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/O),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/O),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 le of this._rowElements)le.style.width=`${this.dimensions.css.canvas.width}px`,le.style.height=`${this.dimensions.css.cell.height}px`,le.style.lineHeight=`${this.dimensions.css.cell.height}px`,le.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const te=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=te,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(O){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let te=`${this._terminalSelector} .${C} { color: ${O.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;te+=`${this._terminalSelector} .${C} .xterm-dim { color: ${p.color.multiplyOpacity(O.foreground,.5).css};}`,te+=`${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 le=`blink_underline_${this._terminalClass}`,ge=`blink_bar_${this._terminalClass}`,ke=`blink_block_${this._terminalClass}`;te+=`@keyframes ${le} { 50% { border-bottom-style: hidden; }}`,te+=`@keyframes ${ge} { 50% { box-shadow: none; }}`,te+=`@keyframes ${ke} { 0% { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css}; } 50% { background-color: inherit; color: ${O.cursor.css}; }}`,te+=`${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${le} 1s step-end infinite;}${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ge} 1s step-end infinite;}${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ke} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${O.cursor.css} !important; color: ${O.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${O.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${O.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${O.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,te+=`${this._terminalSelector} .${F} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${F} div { position: absolute; background-color: ${O.selectionBackgroundOpaque.css};}${this._terminalSelector} .${F} div { position: absolute; background-color: ${O.selectionInactiveBackgroundOpaque.css};}`;for(const[ie,B]of O.ansi.entries())te+=`${this._terminalSelector} .${A}${ie} { color: ${B.css}; }${this._terminalSelector} .${A}${ie}.xterm-dim { color: ${p.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${E}${ie} { background-color: ${B.css}; }`;te+=`${this._terminalSelector} .${A}${_.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(O.background).css}; }${this._terminalSelector} .${A}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(O.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${O.foreground.css}; }`,this._themeStyleElement.textContent=te}_setDefaultSpacing(){const O=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${O}px`,this._rowFactory.defaultSpacing=O}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(O,te){for(let le=this._rowElements.length;le<=te;le++){const ge=this._document.createElement("div");this._rowContainer.appendChild(ge),this._rowElements.push(ge)}for(;this._rowElements.length>te;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(O,te){this._refreshRowElements(O,te),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(O,te,le){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(O,te,le),this.renderRows(0,this._bufferService.rows-1),!O||!te)return;this._selectionRenderModel.update(this._terminal,O,te,le);const ge=this._selectionRenderModel.viewportStartRow,ke=this._selectionRenderModel.viewportEndRow,ie=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(ie>=this._bufferService.rows||B<0)return;const V=this._document.createDocumentFragment();if(le){const W=O[0]>te[0];V.appendChild(this._createSelectionElement(ie,W?te[0]:O[0],W?O[0]:te[0],B-ie+1))}else{const W=ge===ie?O[0]:0,Z=ie===ke?te[0]:this._bufferService.cols;V.appendChild(this._createSelectionElement(ie,W,Z));const he=B-ie-1;if(V.appendChild(this._createSelectionElement(ie+1,0,this._bufferService.cols,he)),ie!==B){const me=ke===B?te[0]:this._bufferService.cols;V.appendChild(this._createSelectionElement(B,0,me))}}this._selectionContainer.appendChild(V)}_createSelectionElement(O,te,le,ge=1){const ke=this._document.createElement("div"),ie=te*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(le-te);return ie+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-ie),ke.style.height=ge*this.dimensions.css.cell.height+"px",ke.style.top=O*this.dimensions.css.cell.height+"px",ke.style.left=`${ie}px`,ke.style.width=`${B}px`,ke}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 O of this._rowElements)O.replaceChildren()}renderRows(O,te){const le=this._bufferService.buffer,ge=le.ybase+le.y,ke=Math.min(le.x,this._bufferService.cols-1),ie=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let W=O;W<=te;W++){const Z=W+le.ydisp,he=this._rowElements[W],me=le.lines.get(Z);if(!he||!me)break;he.replaceChildren(...this._rowFactory.createRow(me,Z,Z===ge,B,V,ke,ie,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${I}${this._terminalClass}`}_handleLinkHover(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!0)}_handleLinkLeave(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!1)}_setCellUnderline(O,te,le,ge,ke,ie){le<0&&(O=0),ge<0&&(te=0);const B=this._bufferService.rows-1;le=Math.max(Math.min(le,B),0),ge=Math.max(Math.min(ge,B),0),ke=Math.min(ke,this._bufferService.cols);const V=this._bufferService.buffer,W=V.ybase+V.y,Z=Math.min(V.x,ke-1),he=this._optionsService.rawOptions.cursorBlink,me=this._optionsService.rawOptions.cursorStyle,be=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ee=le;Ee<=ge;++Ee){const J=Ee+V.ydisp,L=this._rowElements[Ee],se=V.lines.get(J);if(!L||!se)break;L.replaceChildren(...this._rowFactory.createRow(se,J,J===W,me,be,Z,he,this.dimensions.css.cell.width,this._widthCache,ie?Ee===le?O:0:-1,ie?(Ee===ge?te:ke)-1:-1))}}};s.DomRenderer=P=c([m(7,S.IInstantiationService),m(8,d.ICharSizeService),m(9,S.IOptionsService),m(10,S.IBufferService),m(11,d.ICoreBrowserService),m(12,d.IThemeService)],P)},3787:function(u,s,a){var c=this&&this.__decorate||function(C,A,E,N){var F,U=arguments.length,P=U<3?A:N===null?N=Object.getOwnPropertyDescriptor(A,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(C,A,E,N);else for(var O=C.length-1;O>=0;O--)(F=C[O])&&(P=(U<3?F(P):U>3?F(A,E,P):F(A,E))||P);return U>3&&P&&Object.defineProperty(A,E,P),P},m=this&&this.__param||function(C,A){return function(E,N){A(E,N,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const f=a(2223),b=a(643),_=a(511),k=a(2585),y=a(8055),d=a(4725),p=a(4269),h=a(6171),g=a(3734);let S=s.DomRendererRowFactory=class{constructor(C,A,E,N,F,U,P){this._document=C,this._characterJoinerService=A,this._optionsService=E,this._coreBrowserService=N,this._coreService=F,this._decorationService=U,this._themeService=P,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,A,E){this._selectionStart=C,this._selectionEnd=A,this._columnSelectMode=E}createRow(C,A,E,N,F,U,P,O,te,le,ge){const ke=[],ie=this._characterJoinerService.getJoinedCharacters(A),B=this._themeService.colors;let V,W=C.getNoBgTrimmedLength();E&&W<U+1&&(W=U+1);let Z=0,he="",me=0,be=0,Ee=0,J=!1,L=0,se=!1,ae=0;const Ie=[],fe=le!==-1&&ge!==-1;for(let Fe=0;Fe<W;Fe++){C.loadCell(Fe,this._workCell);let tt=this._workCell.getWidth();if(tt===0)continue;let Xe=!1,xt=Fe,Le=this._workCell;if(ie.length>0&&Fe===ie[0][0]){Xe=!0;const Ye=ie.shift();Le=new p.JoinedCellData(this._workCell,C.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),xt=Ye[1]-1,tt=Le.getWidth()}const Yr=this._isCellInSelection(Fe,A),Qn=E&&Fe===U,Xr=fe&&Fe>=le&&Fe<=ge;let Vt=!1;this._decorationService.forEachDecorationAtCell(Fe,A,void 0,(Ye=>{Vt=!0}));let Jr=Le.getChars()||b.WHITESPACE_CELL_CHAR;if(Jr===" "&&(Le.isUnderline()||Le.isOverline())&&(Jr=" "),ae=tt*O-te.get(Jr,Le.isBold(),Le.isItalic()),V){if(Z&&(Yr&&se||!Yr&&!se&&Le.bg===me)&&(Yr&&se&&B.selectionForeground||Le.fg===be)&&Le.extended.ext===Ee&&Xr===J&&ae===L&&!Qn&&!Xe&&!Vt){Le.isInvisible()?he+=b.WHITESPACE_CELL_CHAR:he+=Jr,Z++;continue}Z&&(V.textContent=he),V=this._document.createElement("span"),Z=0,he=""}else V=this._document.createElement("span");if(me=Le.bg,be=Le.fg,Ee=Le.extended.ext,J=Xr,L=ae,se=Yr,Xe&&U>=Fe&&U<=xt&&(U=Fe),!this._coreService.isCursorHidden&&Qn&&this._coreService.isCursorInitialized){if(Ie.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&Ie.push("xterm-cursor-blink"),Ie.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(F)switch(F){case"outline":Ie.push("xterm-cursor-outline");break;case"block":Ie.push("xterm-cursor-block");break;case"bar":Ie.push("xterm-cursor-bar");break;case"underline":Ie.push("xterm-cursor-underline")}}if(Le.isBold()&&Ie.push("xterm-bold"),Le.isItalic()&&Ie.push("xterm-italic"),Le.isDim()&&Ie.push("xterm-dim"),he=Le.isInvisible()?b.WHITESPACE_CELL_CHAR:Le.getChars()||b.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(Ie.push(`xterm-underline-${Le.extended.underlineStyle}`),he===" "&&(he=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())V.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let Ye=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&Ye<8&&(Ye+=8),V.style.textDecorationColor=B.ansi[Ye].css}Le.isOverline()&&(Ie.push("xterm-overline"),he===" "&&(he=" ")),Le.isStrikethrough()&&Ie.push("xterm-strikethrough"),Xr&&(V.style.textDecoration="underline");let mt=Le.getFgColor(),Nr=Le.getFgColorMode(),Rt=Le.getBgColor(),Wt=Le.getBgColorMode();const ir=!!Le.isInverse();if(ir){const Ye=mt;mt=Rt,Rt=Ye;const Sn=Nr;Nr=Wt,Wt=Sn}let qt,lr,Qt,ur=!1;switch(this._decorationService.forEachDecorationAtCell(Fe,A,void 0,(Ye=>{Ye.options.layer!=="top"&&ur||(Ye.backgroundColorRGB&&(Wt=50331648,Rt=Ye.backgroundColorRGB.rgba>>8&16777215,qt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(Nr=50331648,mt=Ye.foregroundColorRGB.rgba>>8&16777215,lr=Ye.foregroundColorRGB),ur=Ye.options.layer==="top")})),!ur&&Yr&&(qt=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Rt=qt.rgba>>8&16777215,Wt=50331648,ur=!0,B.selectionForeground&&(Nr=50331648,mt=B.selectionForeground.rgba>>8&16777215,lr=B.selectionForeground)),ur&&Ie.push("xterm-decoration-top"),Wt){case 16777216:case 33554432:Qt=B.ansi[Rt],Ie.push(`xterm-bg-${Rt}`);break;case 50331648:Qt=y.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(V,`background-color:#${I((Rt>>>0).toString(16),"0",6)}`);break;default:ir?(Qt=B.foreground,Ie.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Qt=B.background}switch(qt||Le.isDim()&&(qt=y.color.multiplyOpacity(Qt,.5)),Nr){case 16777216:case 33554432:Le.isBold()&&mt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(mt+=8),this._applyMinimumContrast(V,Qt,B.ansi[mt],Le,qt,void 0)||Ie.push(`xterm-fg-${mt}`);break;case 50331648:const Ye=y.channels.toColor(mt>>16&255,mt>>8&255,255&mt);this._applyMinimumContrast(V,Qt,Ye,Le,qt,lr)||this._addStyle(V,`color:#${I(mt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(V,Qt,B.foreground,Le,qt,lr)||ir&&Ie.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Ie.length&&(V.className=Ie.join(" "),Ie.length=0),Qn||Xe||Vt?V.textContent=he:Z++,ae!==this.defaultSpacing&&(V.style.letterSpacing=`${ae}px`),ke.push(V),Fe=xt}return V&&Z&&(V.textContent=he),ke}_applyMinimumContrast(C,A,E,N,F,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const P=this._getContrastCache(N);let O;if(F||U||(O=P.getColor(A.rgba,E.rgba)),O===void 0){const te=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);O=y.color.ensureContrastRatio(F||A,U||E,te),P.setColor((F||A).rgba,(U||E).rgba,O??null)}return!!O&&(this._addStyle(C,`color:${O.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,A){C.setAttribute("style",`${C.getAttribute("style")||""}${A};`)}_isCellInSelection(C,A){const E=this._selectionStart,N=this._selectionEnd;return!(!E||!N)&&(this._columnSelectMode?E[0]<=N[0]?C>=E[0]&&A>=E[1]&&C<N[0]&&A<=N[1]:C<E[0]&&A>=E[1]&&C>=N[0]&&A<=N[1]:A>E[1]&&A<N[1]||E[1]===N[1]&&A===E[1]&&C>=E[0]&&C<N[0]||E[1]<N[1]&&A===N[1]&&C<N[0]||E[1]<N[1]&&A===E[1]&&C>=E[0])}};function I(C,A,E){for(;C.length<E;)C=A+C;return C}s.DomRendererRowFactory=S=c([m(1,d.ICharacterJoinerService),m(2,k.IOptionsService),m(3,d.ICoreBrowserService),m(4,k.ICoreService),m(5,k.IDecorationService),m(6,d.IThemeService)],S)},2550:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=a.createElement("span");m.classList.add("xterm-char-measure-element");const f=a.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const b=a.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const _=a.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[m,f,b,_],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(b),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,m,f){a===this._font&&c===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=a,this._fontSize=c,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(a,c,m){let f=0;if(!c&&!m&&a.length===1&&(f=a.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(a,0);return k>0&&(this._flat[f]=k),k}let b=a;c&&(b+="B"),m&&(b+="I");let _=this._holey.get(b);if(_===void 0){let k=0;c&&(k|=1),m&&(k|=2),_=this._measure(a,k),_>0&&this._holey.set(b,_)}return _}_measure(a,c){const m=this._measureElements[c];return m.textContent=a.repeat(32),m.offsetWidth/32}}},2223:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(u,s)=>{function a(m){return 57508<=m&&m<=57558}function c(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},s.isEmoji=c,s.allowRescaling=function(m,f,b,_){return f===1&&b>Math.ceil(1.5*_)&&m!==void 0&&m>255&&!c(m)&&!a(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},s.treatGlyphAsBackgroundColor=function(m){return a(m)||(function(f){return 9472<=f&&f<=9631})(m)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(m,f,b=0){return(m-(2*Math.round(f)-b))%(2*Math.round(f))}},6052:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,f,b,_=!1){if(this.selectionStart=f,this.selectionEnd=b,!f||!b||f[0]===b[0]&&f[1]===b[1])return void this.clear();const k=m.buffers.active.ydisp,y=f[1]-k,d=b[1]-k,p=Math.max(y,0),h=Math.min(d,m.rows-1);p>=m.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=y,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=h,this.startCol=f[0],this.endCol=b[0])}isCellSelected(m,f,b){return!!this.hasSelection&&(b-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&b>=this.viewportCappedStartRow&&f<this.endCol&&b<=this.viewportCappedEndRow:f<this.startCol&&b>=this.viewportCappedStartRow&&f>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},456:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,s,a){var c=this&&this.__decorate||function(h,g,S,I){var C,A=arguments.length,E=A<3?g:I===null?I=Object.getOwnPropertyDescriptor(g,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,g,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(g,S,E):C(g,S))||E);return A>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(h,g){return function(S,I){g(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const f=a(2585),b=a(8460),_=a(844);let k=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,g,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(h,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};s.CharSizeService=k=c([m(2,f.IOptionsService)],k);class y extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,S){g!==void 0&&g>0&&S!==void 0&&S>0&&(this._result.width=g,this._result.height=S)}}class d extends y{constructor(g,S,I){super(),this._document=g,this._parentElement=S,this._optionsService=I,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 p extends y{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(u,s,a){var c=this&&this.__decorate||function(p,h,g,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,g,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,g,A):I(h,g))||A);return C>3&&A&&Object.defineProperty(h,g,A),A},m=this&&this.__param||function(p,h){return function(g,S){h(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const f=a(3734),b=a(643),_=a(511),k=a(2585);class y extends f.AttributeData{constructor(h,g,S){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=g,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let d=s.CharacterJoinerService=class pg{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(h){const g={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(g),g.id}deregister(h){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===h)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(h);if(!g||g.length===0)return[];const S=[],I=g.translateToString(!0);let C=0,A=0,E=0,N=g.getFg(0),F=g.getBg(0);for(let U=0;U<g.getTrimmedLength();U++)if(g.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==F){if(U-C>1){const P=this._getJoinedRanges(I,E,A,g,C);for(let O=0;O<P.length;O++)S.push(P[O])}C=U,E=A,N=this._workCell.fg,F=this._workCell.bg}A+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const U=this._getJoinedRanges(I,E,A,g,C);for(let P=0;P<U.length;P++)S.push(U[P])}return S}_getJoinedRanges(h,g,S,I,C){const A=h.substring(g,S);let E=[];try{E=this._characterJoiners[0].handler(A)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const F=this._characterJoiners[N].handler(A);for(let U=0;U<F.length;U++)pg._mergeRanges(E,F[U])}catch(F){console.error(F)}return this._stringRangesToCellRanges(E,I,C),E}_stringRangesToCellRanges(h,g,S){let I=0,C=!1,A=0,E=h[I];if(E){for(let N=S;N<this._bufferService.cols;N++){const F=g.getWidth(N),U=g.getString(N).length||b.WHITESPACE_CELL_CHAR.length;if(F!==0){if(!C&&E[0]<=A&&(E[0]=N,C=!0),E[1]<=A){if(E[1]=N,E=h[++I],!E)break;E[0]<=A?(E[0]=N,C=!0):C=!1}A+=U}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(h,g){let S=!1;for(let I=0;I<h.length;I++){const C=h[I];if(S){if(g[1]<=C[0])return h[I-1][1]=g[1],h;if(g[1]<=C[1])return h[I-1][1]=Math.max(g[1],C[1]),h.splice(I,1),h;h.splice(I,1),I--}else{if(g[1]<=C[0])return h.splice(I,0,g),h;if(g[1]<=C[1])return C[0]=Math.min(g[0],C[0]),h;g[0]<C[1]&&(C[0]=Math.min(g[0],C[0]),S=!0)}}return S?h[h.length-1][1]=g[1]:h.push(g),h}};s.CharacterJoinerService=d=c([m(0,k.IBufferService)],d)},5114:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=a(844),m=a(8460),f=a(3656);class b extends c.Disposable{constructor(y,d,p){super(),this._textarea=y,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,m.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(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=b;class _ extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.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:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=a(844);class m extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const _=this.linkProviders.indexOf(b);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=m},8934:function(u,s,a){var c=this&&this.__decorate||function(k,y,d,p){var h,g=arguments.length,S=g<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(k,y,d,p);else for(var I=k.length-1;I>=0;I--)(h=k[I])&&(S=(g<3?h(S):g>3?h(y,d,S):h(y,d))||S);return g>3&&S&&Object.defineProperty(y,d,S),S},m=this&&this.__param||function(k,y){return function(d,p){y(d,p,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const f=a(4725),b=a(9806);let _=s.MouseService=class{constructor(k,y){this._renderService=k,this._charSizeService=y}getCoords(k,y,d,p,h){return(0,b.getCoords)(window,k,y,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(k,y){const d=(0,b.getCoordsRelativeToElement)(window,k,y);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};s.MouseService=_=c([m(0,f.IRenderService),m(1,f.ICharSizeService)],_)},3230:function(u,s,a){var c=this&&this.__decorate||function(h,g,S,I){var C,A=arguments.length,E=A<3?g:I===null?I=Object.getOwnPropertyDescriptor(g,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,g,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(g,S,E):C(g,S))||E);return A>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(h,g){return function(S,I){g(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const f=a(6193),b=a(4725),_=a(8460),k=a(844),y=a(7226),d=a(2585);let p=s.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,g,S,I,C,A,E,N){super(),this._rowCount=h,this._charSizeService=I,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((F,U)=>this._renderRows(F,U)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(A.onResize((()=>this._fullRefresh()))),this.register(A.buffers.onBufferActivate((()=>{var F;return(F=this._renderer.value)==null?void 0:F.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(C.onDecorationRegistered((()=>this._fullRefresh()))),this.register(C.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(A.cols,A.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(A.buffer.y,A.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,g),this.register(E.onWindowChange((F=>this._registerIntersectionObserver(F,g))))}_registerIntersectionObserver(h,g){if("IntersectionObserver"in h){const S=new h.IntersectionObserver((I=>this._handleIntersectionChange(I[I.length-1])),{threshold:0});S.observe(g),this._observerDisposable.value=(0,k.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,g,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,g,this._rowCount))}_renderRows(h,g){this._renderer.value&&(h=Math.min(h,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(h,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:h,end:g}),this._onRender.fire({start:h,end:g}),this._isNextRenderRedrawOnly=!0)}resize(h,g){this._rowCount=g,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((g=>this.refreshRows(g.start,g.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,g;this._renderer.value&&((g=(h=this._renderer.value).clearTextureAtlas)==null||g.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(h,g)})):this._renderer.value.handleResize(h,g),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,g,S){var I;this._selectionState.start=h,this._selectionState.end=g,this._selectionState.columnSelectMode=S,(I=this._renderer.value)==null||I.handleSelectionChanged(h,g,S)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};s.RenderService=p=c([m(2,d.IOptionsService),m(3,b.ICharSizeService),m(4,d.IDecorationService),m(5,d.IBufferService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],p)},9312:function(u,s,a){var c=this&&this.__decorate||function(E,N,F,U){var P,O=arguments.length,te=O<3?N:U===null?U=Object.getOwnPropertyDescriptor(N,F):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(E,N,F,U);else for(var le=E.length-1;le>=0;le--)(P=E[le])&&(te=(O<3?P(te):O>3?P(N,F,te):P(N,F))||te);return O>3&&te&&Object.defineProperty(N,F,te),te},m=this&&this.__param||function(E,N){return function(F,U){N(F,U,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const f=a(9806),b=a(9504),_=a(456),k=a(4725),y=a(8460),d=a(844),p=a(6114),h=a(4841),g=a(511),S=a(2585),I=" ",C=new RegExp(I,"g");let A=s.SelectionService=class extends d.Disposable{constructor(E,N,F,U,P,O,te,le,ge){super(),this._element=E,this._screenElement=N,this._linkifier=F,this._bufferService=U,this._coreService=P,this._mouseService=O,this._optionsService=te,this._renderService=le,this._coreBrowserService=ge,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ke=>this._handleMouseMove(ke),this._mouseUpListener=ke=>this._handleMouseUp(ke),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ke=>this._handleTrim(ke))),this.register(this._bufferService.buffers.onBufferActivate((ke=>this._handleBufferActivate(ke)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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,N=this._model.finalSelectionEnd;return!(!E||!N||E[0]===N[0]&&E[1]===N[1])}get selectionText(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!E||!N)return"";const F=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(E[0]===N[0])return"";const P=E[0]<N[0]?E[0]:N[0],O=E[0]<N[0]?N[0]:E[0];for(let te=E[1];te<=N[1];te++){const le=F.translateBufferLineToString(te,!0,P,O);U.push(le)}}else{const P=E[1]===N[1]?N[0]:void 0;U.push(F.translateBufferLineToString(E[1],!0,E[0],P));for(let O=E[1]+1;O<=N[1]-1;O++){const te=F.lines.get(O),le=F.translateBufferLineToString(O,!0);te!=null&&te.isWrapped?U[U.length-1]+=le:U.push(le)}if(E[1]!==N[1]){const O=F.lines.get(N[1]),te=F.translateBufferLineToString(N[1],!0,0,N[0]);O&&O.isWrapped?U[U.length-1]+=te:U.push(te)}}return U.map((P=>P.replace(C," "))).join(p.isWindows?`\r
|
|
168
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([g(0,b.IBufferService),g(1,b.IOptionsService),g(2,b.IOscLinkService)],_)},6193:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,g){this._rowCount=g,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=a(3614),g=a(3656),f=a(3551),b=a(9042),_=a(3730),k=a(1680),y=a(3107),d=a(5744),p=a(2950),h=a(1296),m=a(428),S=a(4269),I=a(5114),C=a(8934),A=a(3230),E=a(9312),N=a(4725),O=a(6731),P=a(8055),$=a(8969),D=a(8460),re=a(844),le=a(6114),ge=a(8437),Ie=a(2584),me=a(7399),B=a(5941),U=a(9074),F=a(2585),j=a(5435),oe=a(4567),fe=a(779);class pe extends $.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(Y={}){super(Y),this.browser=le,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new re.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(fe.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,ie)=>this.refresh(L,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,re.toDisposable)((()=>{var L,ie;this._customKeyEventHandler=void 0,(ie=(L=this.element)==null?void 0:L.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const L of Y){let ie,ae="";switch(L.index){case 256:ie="foreground",ae="10";break;case 257:ie="background",ae="11";break;case 258:ie="cursor",ae="12";break;default:ie="ansi",ae="4;"+L.index}switch(L.type){case 0:const ke=P.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${Ie.C0.ESC}]${ae};${(0,B.toRgbString)(ke)}${Ie.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((he=>he.ansi[L.index]=P.channels.toColor(...L.color)));else{const he=ie;this._themeService.modifyColors((Fe=>Fe[he]=P.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(oe.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ie.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ie.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 Y=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(Y);if(!L)return;const ie=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,ke=L.getWidth(ie),he=this._renderService.dimensions.css.cell.width*ke,Fe=this.buffer.y*this._renderService.dimensions.css.cell.height,tt=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=tt+"px",this.textarea.style.top=Fe+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,c.copyHandler)(L,this._selectionService)})));const Y=L=>(0,c.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,g.addDisposableDomListener)(this.element,"paste",Y)),le.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),le.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,c.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var L;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((L=this.element)==null?void 0:L.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.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"),Y.appendChild(this.element);const ie=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ie.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ie.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),le.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(I.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(A.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(ie);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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(oe.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,L=this.element;function ie(he){const Fe=Y._mouseService.getMouseReportCoords(he,Y.screenElement);if(!Fe)return!1;let tt,Xe;switch(he.overrideType||he.type){case"mousemove":Xe=32,he.buttons===void 0?(tt=3,he.button!==void 0&&(tt=he.button<3?he.button:3)):tt=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Xe=0,tt=he.button<3?he.button:3;break;case"mousedown":Xe=1,tt=he.button<3?he.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(he)===!1||Y.viewport.getLinesScrolled(he)===0)return!1;Xe=he.deltaY<0?0:1,tt=4;break;default:return!1}return!(Xe===void 0||tt===void 0||tt>4)&&Y.coreMouseService.triggerMouseEvent({col:Fe.col,row:Fe.row,x:Fe.x,y:Fe.y,button:tt,action:Xe,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ke={mouseup:he=>(ie(he),he.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(he)),wheel:he=>(ie(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ie(he)},mousemove:he=>{he.buttons||ie(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?ae.mousemove||(L.addEventListener("mousemove",ke.mousemove),ae.mousemove=ke.mousemove):(L.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&he?ae.wheel||(L.addEventListener("wheel",ke.wheel,{passive:!1}),ae.wheel=ke.wheel):(L.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&he?ae.mouseup||(ae.mouseup=ke.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&he?ae.mousedrag||(ae.mousedrag=ke.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(L,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ie(he),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(he)}))),this.register((0,g.addDisposableDomListener)(L,"wheel",(he=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const Fe=this.viewport.getLinesScrolled(he);if(Fe===0)return;const tt=Ie.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Xe="";for(let Rt=0;Rt<Math.abs(Fe);Rt++)Xe+=tt;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(L,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(L,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Y,L){var ie;(ie=this._renderService)==null||ie.refreshRows(Y,L)}updateCursorStyle(Y){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(Y)?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(Y,L,ie=0){var ae;ie===1?(super.scrollLines(Y,L,ie),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(Y)}paste(Y){(0,c.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,L,ie){this._selectionService.setSelection(Y,L,ie)}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 Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,L){var ie;(ie=this._selectionService)==null||ie.selectLines(Y,L)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!L&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,me.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),ie.type===3||ie.type===2){const ae=this.rows-1;return this.scrollLines(ie.type===2?-ae:ae),this.cancel(Y,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(ie.cancel&&this.cancel(Y,!0),!ie.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==Ie.C0.ETX&&ie.key!==Ie.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,L){const ie=Y.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||Y.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||Y.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?ie:ie&&(!L.keyCode||L.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)L=Y.charCode;else if(Y.which===null||Y.which===void 0)L=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;L=Y.which}return!(!L||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=Y.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(Y),!0}return!1}resize(Y,L){Y!==this.cols||L!==this.rows?super.resize(Y,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,L){var ie,ae;(ie=this._charSizeService)==null||ie.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var Y;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 L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(ge.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var Y,L;this.options.rows=this.rows,this.options.cols=this.cols;const ie=this._customKeyEventHandler;this._setup(),super.reset(),(Y=this._selectionService)==null||Y.reset(),this._decorationService.reset(),(L=this.viewport)==null||L.reset(),this._customKeyEventHandler=ie,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(Ie.C0.ESC+"[I"):this.coreService.triggerDataEvent(Ie.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Ie.C0.ESC}[4;${ie};${L}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),ke=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Ie.C0.ESC}[6;${ke};${ae}t`)}}cancel(Y,L){if(this.options.cancelEvents||L)return Y.preventDefault(),Y.stopPropagation(),!1}}s.Terminal=pe},9924:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,g){this._rowCount=g,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=f-this._lastRefreshMs,_=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(l,s,a){var c=this&&this.__decorate||function(p,h,m,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,m,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,m,A):I(h,m))||A);return C>3&&A&&Object.defineProperty(h,m,A),A},g=this&&this.__param||function(p,h){return function(m,S){h(m,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const f=a(3656),b=a(4725),_=a(8460),k=a(844),y=a(2585);let d=s.Viewport=class extends k.Disposable{constructor(p,h,m,S,I,C,A,E){super(),this._viewportElement=p,this._scrollArea=h,this._bufferService=m,this._optionsService=S,this._charSizeService=I,this._renderService=C,this._coreBrowserService=A,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,h){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&m<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const h=this._getPixelsScrolled(p);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(p,h){var m;let S,I="";const C=[],A=h??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let N=p;N<A;N++){const O=E.get(N);if(!O)continue;const P=(m=E.get(N+1))==null?void 0:m.isWrapped;if(I+=O.translateToString(!P),!P||N===E.length-1){const $=document.createElement("div");$.textContent=I,C.push($),I.length>0&&(S=$),I=""}}return{bufferElements:C,cursorElement:S}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(p,h){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&h.altKey||m==="ctrl"&&h.ctrlKey||m==="shift"&&h.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const h=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}};s.Viewport=d=c([g(2,y.IBufferService),g(3,y.IOptionsService),g(4,b.ICharSizeService),g(5,b.IRenderService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],d)},3107:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,h){var m,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(m=y[C])&&(I=(S<3?m(I):S>3?m(d,p,I):m(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},g=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const f=a(4725),b=a(844),_=a(2585);let k=s.BufferDecorationRenderer=class extends b.Disposable{constructor(y,d,p,h,m){super(),this._screenElement=y,this._bufferService=d,this._coreBrowserService=p,this._decorationService=h,this._renderService=m,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((S=>this._removeDecoration(S)))),this.register((0,b.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 y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var d;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((d=y==null?void 0:y.options)==null?void 0:d.layer)==="top"),p.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=y.options.x??0;return h&&h>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(y,p),p}_refreshStyle(y){const d=y.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let p=this._decorationElements.get(y);p||(p=this._createElement(y),y.element=p,this._decorationElements.set(y,p),this._container.appendChild(p),y.onDispose((()=>{this._decorationElements.delete(y),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(p)}}_refreshXPosition(y,d=y.element){if(!d)return;const p=y.options.x??0;(y.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var d;(d=this._decorationElements.get(y))==null||d.remove(),this._decorationElements.delete(y),y.dispose()}};s.BufferDecorationRenderer=k=c([g(1,_.IBufferService),g(2,f.ICoreBrowserService),g(3,_.IDecorationService),g(4,f.IRenderService)],k)},5871:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,g){return c>=a.startBufferLine-this._linePadding[g||"full"]&&c<=a.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(l,s,a){var c=this&&this.__decorate||function(m,S,I,C){var A,E=arguments.length,N=E<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,I):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(m,S,I,C);else for(var O=m.length-1;O>=0;O--)(A=m[O])&&(N=(E<3?A(N):E>3?A(S,I,N):A(S,I))||N);return E>3&&N&&Object.defineProperty(S,I,N),N},g=this&&this.__param||function(m,S){return function(I,C){S(I,C,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const f=a(5871),b=a(4725),_=a(844),k=a(2585),y={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let h=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,S,I,C,A,E,N){var O;super(),this._viewportElement=m,this._screenElement=S,this._bufferService=I,this._decorationService=C,this._renderService=A,this._optionsService=E,this._coreBrowserService=N,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var $;($=this._canvas)==null||$.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 m=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=m,d.center=S,d.right=m,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const S of m)S.position!=="full"&&this._renderColorZone(S);for(const S of m)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(p[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-y[m.position||"full"]/2),d[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[m.position||"full"]))}_queueRefresh(m,S){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=h=c([g(2,k.IBufferService),g(3,k.IDecorationService),g(4,b.IRenderService),g(5,k.IOptionsService),g(6,b.ICoreBrowserService)],h)},2950:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,h){var m,S=arguments.length,I=S<3?d:h===null?h=Object.getOwnPropertyDescriptor(d,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(y,d,p,h);else for(var C=y.length-1;C>=0;C--)(m=y[C])&&(I=(S<3?m(I):S>3?m(d,p,I):m(d,p))||I);return S>3&&I&&Object.defineProperty(d,p,I),I},g=this&&this.__param||function(y,d){return function(p,h){d(p,h,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const f=a(4725),b=a(2585),_=a(2584);let k=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,d,p,h,m,S){this._textarea=y,this._compositionView=d,this._bufferService=p,this._optionsService=h,this._coreService=m,this._renderService=S,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(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(y,"");this._dataAlreadySent=p,d.length>y.length?this._coreService.triggerDataEvent(p,!0):d.length<y.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):d.length===y.length&&d!==y&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=k=c([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,b.ICoreService),g(5,f.IRenderService)],k)},9806:(l,s)=>{function a(c,g,f){const b=f.getBoundingClientRect(),_=c.getComputedStyle(f),k=parseInt(_.getPropertyValue("padding-left")),y=parseInt(_.getPropertyValue("padding-top"));return[g.clientX-b.left-k,g.clientY-b.top-y]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(c,g,f,b,_,k,y,d,p){if(!k)return;const h=a(c,g,f);return h?(h[0]=Math.ceil((h[0]+(p?y/2:0))/y),h[1]=Math.ceil(h[1]/d),h[0]=Math.min(Math.max(h[0],1),b+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),_),h):void 0}},9504:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=a(2584);function g(d,p,h,m){const S=d-f(d,h),I=p-f(p,h),C=Math.abs(S-I)-(function(A,E,N){let O=0;const P=A-f(A,N),$=E-f(E,N);for(let D=0;D<Math.abs(P-$);D++){const re=b(A,E)==="A"?-1:1,le=N.buffer.lines.get(P+re*D);le!=null&&le.isWrapped&&O++}return O})(d,p,h);return y(C,k(b(d,p),m))}function f(d,p){let h=0,m=p.buffer.lines.get(d),S=m==null?void 0:m.isWrapped;for(;S&&d>=0&&d<p.rows;)h++,m=p.buffer.lines.get(--d),S=m==null?void 0:m.isWrapped;return h}function b(d,p){return d>p?"A":"B"}function _(d,p,h,m,S,I){let C=d,A=p,E="";for(;C!==h||A!==m;)C+=S?1:-1,S&&C>I.cols-1?(E+=I.buffer.translateBufferLineToString(A,!1,d,C),C=0,d=0,A++):!S&&C<0&&(E+=I.buffer.translateBufferLineToString(A,!1,0,d+1),C=I.cols-1,d=C,A--);return E+I.buffer.translateBufferLineToString(A,!1,d,C)}function k(d,p){const h=p?"O":"[";return c.C0.ESC+h+d}function y(d,p){d=Math.floor(d);let h="";for(let m=0;m<d;m++)h+=p;return h}s.moveToCellSequence=function(d,p,h,m){const S=h.buffer.x,I=h.buffer.y;if(!h.buffer.hasScrollback)return(function(E,N,O,P,$,D){return g(N,P,$,D).length===0?"":y(_(E,N,E,N-f(N,$),!1,$).length,k("D",D))})(S,I,0,p,h,m)+g(I,p,h,m)+(function(E,N,O,P,$,D){let re;re=g(N,P,$,D).length>0?P-f(P,$):N;const le=P,ge=(function(Ie,me,B,U,F,j){let oe;return oe=g(B,U,F,j).length>0?U-f(U,F):me,Ie<B&&oe<=U||Ie>=B&&oe<U?"C":"D"})(E,N,O,P,$,D);return y(_(E,re,O,le,ge==="C",$).length,k(ge,D))})(S,I,d,p,h,m);let C;if(I===p)return C=S>d?"D":"C",y(Math.abs(S-d),k(C,m));C=I>p?"D":"C";const A=Math.abs(I-p);return y((function(E,N){return N.cols-E})(I>p?d:S,h)+(A-1)*h.cols+1+((I>p?S:d)-1),k(C,m))}},1296:function(l,s,a){var c=this&&this.__decorate||function(D,re,le,ge){var Ie,me=arguments.length,B=me<3?re:ge===null?ge=Object.getOwnPropertyDescriptor(re,le):ge;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(D,re,le,ge);else for(var U=D.length-1;U>=0;U--)(Ie=D[U])&&(B=(me<3?Ie(B):me>3?Ie(re,le,B):Ie(re,le))||B);return me>3&&B&&Object.defineProperty(re,le,B),B},g=this&&this.__param||function(D,re){return function(le,ge){re(le,ge,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const f=a(3787),b=a(2550),_=a(2223),k=a(6171),y=a(6052),d=a(4725),p=a(8055),h=a(8460),m=a(844),S=a(2585),I="xterm-dom-renderer-owner-",C="xterm-rows",A="xterm-fg-",E="xterm-bg-",N="xterm-focus",O="xterm-selection";let P=1,$=s.DomRenderer=class extends m.Disposable{constructor(D,re,le,ge,Ie,me,B,U,F,j,oe,fe,pe){super(),this._terminal=D,this._document=re,this._element=le,this._screenElement=ge,this._viewportElement=Ie,this._helperContainer=me,this._linkifier2=B,this._charSizeService=F,this._optionsService=j,this._bufferService=oe,this._coreBrowserService=fe,this._themeService=pe,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.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,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(I+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,m.toDisposable)((()=>{this._element.classList.remove(I+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 le of this._rowElements)le.style.width=`${this.dimensions.css.canvas.width}px`,le.style.height=`${this.dimensions.css.cell.height}px`,le.style.lineHeight=`${this.dimensions.css.cell.height}px`,le.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const re=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=re,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let re=`${this._terminalSelector} .${C} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;re+=`${this._terminalSelector} .${C} .xterm-dim { color: ${p.color.multiplyOpacity(D.foreground,.5).css};}`,re+=`${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 le=`blink_underline_${this._terminalClass}`,ge=`blink_bar_${this._terminalClass}`,Ie=`blink_block_${this._terminalClass}`;re+=`@keyframes ${le} { 50% { border-bottom-style: hidden; }}`,re+=`@keyframes ${ge} { 50% { box-shadow: none; }}`,re+=`@keyframes ${Ie} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,re+=`${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${le} 1s step-end infinite;}${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ge} 1s step-end infinite;}${this._terminalSelector} .${C}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Ie} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,re+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[me,B]of D.ansi.entries())re+=`${this._terminalSelector} .${A}${me} { color: ${B.css}; }${this._terminalSelector} .${A}${me}.xterm-dim { color: ${p.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${E}${me} { background-color: ${B.css}; }`;re+=`${this._terminalSelector} .${A}${_.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(D.background).css}; }${this._terminalSelector} .${A}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=re}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,re){for(let le=this._rowElements.length;le<=re;le++){const ge=this._document.createElement("div");this._rowContainer.appendChild(ge),this._rowElements.push(ge)}for(;this._rowElements.length>re;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,re){this._refreshRowElements(D,re),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,re,le){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,re,le),this.renderRows(0,this._bufferService.rows-1),!D||!re)return;this._selectionRenderModel.update(this._terminal,D,re,le);const ge=this._selectionRenderModel.viewportStartRow,Ie=this._selectionRenderModel.viewportEndRow,me=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(me>=this._bufferService.rows||B<0)return;const U=this._document.createDocumentFragment();if(le){const F=D[0]>re[0];U.appendChild(this._createSelectionElement(me,F?re[0]:D[0],F?D[0]:re[0],B-me+1))}else{const F=ge===me?D[0]:0,j=me===Ie?re[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(me,F,j));const oe=B-me-1;if(U.appendChild(this._createSelectionElement(me+1,0,this._bufferService.cols,oe)),me!==B){const fe=Ie===B?re[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(B,0,fe))}}this._selectionContainer.appendChild(U)}_createSelectionElement(D,re,le,ge=1){const Ie=this._document.createElement("div"),me=re*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(le-re);return me+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-me),Ie.style.height=ge*this.dimensions.css.cell.height+"px",Ie.style.top=D*this.dimensions.css.cell.height+"px",Ie.style.left=`${me}px`,Ie.style.width=`${B}px`,Ie}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 D of this._rowElements)D.replaceChildren()}renderRows(D,re){const le=this._bufferService.buffer,ge=le.ybase+le.y,Ie=Math.min(le.x,this._bufferService.cols-1),me=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=D;F<=re;F++){const j=F+le.ydisp,oe=this._rowElements[F],fe=le.lines.get(j);if(!oe||!fe)break;oe.replaceChildren(...this._rowFactory.createRow(fe,j,j===ge,B,U,Ie,me,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${I}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,re,le,ge,Ie,me){le<0&&(D=0),ge<0&&(re=0);const B=this._bufferService.rows-1;le=Math.max(Math.min(le,B),0),ge=Math.max(Math.min(ge,B),0),Ie=Math.min(Ie,this._bufferService.cols);const U=this._bufferService.buffer,F=U.ybase+U.y,j=Math.min(U.x,Ie-1),oe=this._optionsService.rawOptions.cursorBlink,fe=this._optionsService.rawOptions.cursorStyle,pe=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=le;_e<=ge;++_e){const Y=_e+U.ydisp,L=this._rowElements[_e],ie=U.lines.get(Y);if(!L||!ie)break;L.replaceChildren(...this._rowFactory.createRow(ie,Y,Y===F,fe,pe,j,oe,this.dimensions.css.cell.width,this._widthCache,me?_e===le?D:0:-1,me?(_e===ge?re:Ie)-1:-1))}}};s.DomRenderer=$=c([g(7,S.IInstantiationService),g(8,d.ICharSizeService),g(9,S.IOptionsService),g(10,S.IBufferService),g(11,d.ICoreBrowserService),g(12,d.IThemeService)],$)},3787:function(l,s,a){var c=this&&this.__decorate||function(C,A,E,N){var O,P=arguments.length,$=P<3?A:N===null?N=Object.getOwnPropertyDescriptor(A,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(C,A,E,N);else for(var D=C.length-1;D>=0;D--)(O=C[D])&&($=(P<3?O($):P>3?O(A,E,$):O(A,E))||$);return P>3&&$&&Object.defineProperty(A,E,$),$},g=this&&this.__param||function(C,A){return function(E,N){A(E,N,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const f=a(2223),b=a(643),_=a(511),k=a(2585),y=a(8055),d=a(4725),p=a(4269),h=a(6171),m=a(3734);let S=s.DomRendererRowFactory=class{constructor(C,A,E,N,O,P,$){this._document=C,this._characterJoinerService=A,this._optionsService=E,this._coreBrowserService=N,this._coreService=O,this._decorationService=P,this._themeService=$,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,A,E){this._selectionStart=C,this._selectionEnd=A,this._columnSelectMode=E}createRow(C,A,E,N,O,P,$,D,re,le,ge){const Ie=[],me=this._characterJoinerService.getJoinedCharacters(A),B=this._themeService.colors;let U,F=C.getNoBgTrimmedLength();E&&F<P+1&&(F=P+1);let j=0,oe="",fe=0,pe=0,_e=0,Y=!1,L=0,ie=!1,ae=0;const ke=[],he=le!==-1&&ge!==-1;for(let Fe=0;Fe<F;Fe++){C.loadCell(Fe,this._workCell);let tt=this._workCell.getWidth();if(tt===0)continue;let Xe=!1,Rt=Fe,Le=this._workCell;if(me.length>0&&Fe===me[0][0]){Xe=!0;const Ye=me.shift();Le=new p.JoinedCellData(this._workCell,C.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),Rt=Ye[1]-1,tt=Le.getWidth()}const Kr=this._isCellInSelection(Fe,A),Qn=E&&Fe===P,Yr=he&&Fe>=le&&Fe<=ge;let Mt=!1;this._decorationService.forEachDecorationAtCell(Fe,A,void 0,(Ye=>{Mt=!0}));let Xr=Le.getChars()||b.WHITESPACE_CELL_CHAR;if(Xr===" "&&(Le.isUnderline()||Le.isOverline())&&(Xr=" "),ae=tt*D-re.get(Xr,Le.isBold(),Le.isItalic()),U){if(j&&(Kr&&ie||!Kr&&!ie&&Le.bg===fe)&&(Kr&&ie&&B.selectionForeground||Le.fg===pe)&&Le.extended.ext===_e&&Yr===Y&&ae===L&&!Qn&&!Xe&&!Mt){Le.isInvisible()?oe+=b.WHITESPACE_CELL_CHAR:oe+=Xr,j++;continue}j&&(U.textContent=oe),U=this._document.createElement("span"),j=0,oe=""}else U=this._document.createElement("span");if(fe=Le.bg,pe=Le.fg,_e=Le.extended.ext,Y=Yr,L=ae,ie=Kr,Xe&&P>=Fe&&P<=Rt&&(P=Fe),!this._coreService.isCursorHidden&&Qn&&this._coreService.isCursorInitialized){if(ke.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ke.push("xterm-cursor-blink"),ke.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ke.push("xterm-cursor-outline");break;case"block":ke.push("xterm-cursor-block");break;case"bar":ke.push("xterm-cursor-bar");break;case"underline":ke.push("xterm-cursor-underline")}}if(Le.isBold()&&ke.push("xterm-bold"),Le.isItalic()&&ke.push("xterm-italic"),Le.isDim()&&ke.push("xterm-dim"),oe=Le.isInvisible()?b.WHITESPACE_CELL_CHAR:Le.getChars()||b.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(ke.push(`xterm-underline-${Le.extended.underlineStyle}`),oe===" "&&(oe=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let Ye=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=B.ansi[Ye].css}Le.isOverline()&&(ke.push("xterm-overline"),oe===" "&&(oe=" ")),Le.isStrikethrough()&&ke.push("xterm-strikethrough"),Yr&&(U.style.textDecoration="underline");let vt=Le.getFgColor(),Nr=Le.getFgColorMode(),Nt=Le.getBgColor(),$t=Le.getBgColorMode();const or=!!Le.isInverse();if(or){const Ye=vt;vt=Nt,Nt=Ye;const Sn=Nr;Nr=$t,$t=Sn}let qt,ur,Qt,dr=!1;switch(this._decorationService.forEachDecorationAtCell(Fe,A,void 0,(Ye=>{Ye.options.layer!=="top"&&dr||(Ye.backgroundColorRGB&&($t=50331648,Nt=Ye.backgroundColorRGB.rgba>>8&16777215,qt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(Nr=50331648,vt=Ye.foregroundColorRGB.rgba>>8&16777215,ur=Ye.foregroundColorRGB),dr=Ye.options.layer==="top")})),!dr&&Kr&&(qt=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Nt=qt.rgba>>8&16777215,$t=50331648,dr=!0,B.selectionForeground&&(Nr=50331648,vt=B.selectionForeground.rgba>>8&16777215,ur=B.selectionForeground)),dr&&ke.push("xterm-decoration-top"),$t){case 16777216:case 33554432:Qt=B.ansi[Nt],ke.push(`xterm-bg-${Nt}`);break;case 50331648:Qt=y.channels.toColor(Nt>>16,Nt>>8&255,255&Nt),this._addStyle(U,`background-color:#${I((Nt>>>0).toString(16),"0",6)}`);break;default:or?(Qt=B.foreground,ke.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Qt=B.background}switch(qt||Le.isDim()&&(qt=y.color.multiplyOpacity(Qt,.5)),Nr){case 16777216:case 33554432:Le.isBold()&&vt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(vt+=8),this._applyMinimumContrast(U,Qt,B.ansi[vt],Le,qt,void 0)||ke.push(`xterm-fg-${vt}`);break;case 50331648:const Ye=y.channels.toColor(vt>>16&255,vt>>8&255,255&vt);this._applyMinimumContrast(U,Qt,Ye,Le,qt,ur)||this._addStyle(U,`color:#${I(vt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Qt,B.foreground,Le,qt,ur)||or&&ke.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ke.length&&(U.className=ke.join(" "),ke.length=0),Qn||Xe||Mt?U.textContent=oe:j++,ae!==this.defaultSpacing&&(U.style.letterSpacing=`${ae}px`),Ie.push(U),Fe=Rt}return U&&j&&(U.textContent=oe),Ie}_applyMinimumContrast(C,A,E,N,O,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const $=this._getContrastCache(N);let D;if(O||P||(D=$.getColor(A.rgba,E.rgba)),D===void 0){const re=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);D=y.color.ensureContrastRatio(O||A,P||E,re),$.setColor((O||A).rgba,(P||E).rgba,D??null)}return!!D&&(this._addStyle(C,`color:${D.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,A){C.setAttribute("style",`${C.getAttribute("style")||""}${A};`)}_isCellInSelection(C,A){const E=this._selectionStart,N=this._selectionEnd;return!(!E||!N)&&(this._columnSelectMode?E[0]<=N[0]?C>=E[0]&&A>=E[1]&&C<N[0]&&A<=N[1]:C<E[0]&&A>=E[1]&&C>=N[0]&&A<=N[1]:A>E[1]&&A<N[1]||E[1]===N[1]&&A===E[1]&&C>=E[0]&&C<N[0]||E[1]<N[1]&&A===N[1]&&C<N[0]||E[1]<N[1]&&A===E[1]&&C>=E[0])}};function I(C,A,E){for(;C.length<E;)C=A+C;return C}s.DomRendererRowFactory=S=c([g(1,d.ICharacterJoinerService),g(2,k.IOptionsService),g(3,d.ICoreBrowserService),g(4,k.ICoreService),g(5,k.IDecorationService),g(6,d.IThemeService)],S)},2550:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=a.createElement("span");g.classList.add("xterm-char-measure-element");const f=a.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const b=a.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const _=a.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[g,f,b,_],this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(b),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,g,f){a===this._font&&c===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=a,this._fontSize=c,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(a,c,g){let f=0;if(!c&&!g&&a.length===1&&(f=a.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(a,0);return k>0&&(this._flat[f]=k),k}let b=a;c&&(b+="B"),g&&(b+="I");let _=this._holey.get(b);if(_===void 0){let k=0;c&&(k|=1),g&&(k|=2),_=this._measure(a,k),_>0&&this._holey.set(b,_)}return _}_measure(a,c){const g=this._measureElements[c];return g.textContent=a.repeat(32),g.offsetWidth/32}}},2223:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,s)=>{function a(g){return 57508<=g&&g<=57558}function c(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=c,s.allowRescaling=function(g,f,b,_){return f===1&&b>Math.ceil(1.5*_)&&g!==void 0&&g>255&&!c(g)&&!a(g)&&!(function(k){return 57344<=k&&k<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return a(g)||(function(f){return 9472<=f&&f<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,f,b=0){return(g-(2*Math.round(f)-b))%(2*Math.round(f))}},6052:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,f,b,_=!1){if(this.selectionStart=f,this.selectionEnd=b,!f||!b||f[0]===b[0]&&f[1]===b[1])return void this.clear();const k=g.buffers.active.ydisp,y=f[1]-k,d=b[1]-k,p=Math.max(y,0),h=Math.min(d,g.rows-1);p>=g.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=y,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=h,this.startCol=f[0],this.endCol=b[0])}isCellSelected(g,f,b){return!!this.hasSelection&&(b-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&b>=this.viewportCappedStartRow&&f<this.endCol&&b<=this.viewportCappedEndRow:f<this.startCol&&b>=this.viewportCappedStartRow&&f>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},456:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,s,a){var c=this&&this.__decorate||function(h,m,S,I){var C,A=arguments.length,E=A<3?m:I===null?I=Object.getOwnPropertyDescriptor(m,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,m,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(m,S,E):C(m,S))||E);return A>3&&E&&Object.defineProperty(m,S,E),E},g=this&&this.__param||function(h,m){return function(S,I){m(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const f=a(2585),b=a(8460),_=a(844);let k=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,m,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(h,m,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};s.CharSizeService=k=c([g(2,f.IOptionsService)],k);class y extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(m,S){m!==void 0&&m>0&&S!==void 0&&S>0&&(this._result.width=m,this._result.height=S)}}class d extends y{constructor(m,S,I){super(),this._document=m,this._parentElement=S,this._optionsService=I,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 p extends y{constructor(m){super(),this._optionsService=m,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const m=this._ctx.measureText("W");return this._validateAndSet(m.width,m.fontBoundingBoxAscent+m.fontBoundingBoxDescent),this._result}}},4269:function(l,s,a){var c=this&&this.__decorate||function(p,h,m,S){var I,C=arguments.length,A=C<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(p,h,m,S);else for(var E=p.length-1;E>=0;E--)(I=p[E])&&(A=(C<3?I(A):C>3?I(h,m,A):I(h,m))||A);return C>3&&A&&Object.defineProperty(h,m,A),A},g=this&&this.__param||function(p,h){return function(m,S){h(m,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const f=a(3734),b=a(643),_=a(511),k=a(2585);class y extends f.AttributeData{constructor(h,m,S){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=m,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let d=s.CharacterJoinerService=class yg{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(h){const m={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(m),m.id}deregister(h){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===h)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(h);if(!m||m.length===0)return[];const S=[],I=m.translateToString(!0);let C=0,A=0,E=0,N=m.getFg(0),O=m.getBg(0);for(let P=0;P<m.getTrimmedLength();P++)if(m.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==O){if(P-C>1){const $=this._getJoinedRanges(I,E,A,m,C);for(let D=0;D<$.length;D++)S.push($[D])}C=P,E=A,N=this._workCell.fg,O=this._workCell.bg}A+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const P=this._getJoinedRanges(I,E,A,m,C);for(let $=0;$<P.length;$++)S.push(P[$])}return S}_getJoinedRanges(h,m,S,I,C){const A=h.substring(m,S);let E=[];try{E=this._characterJoiners[0].handler(A)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const O=this._characterJoiners[N].handler(A);for(let P=0;P<O.length;P++)yg._mergeRanges(E,O[P])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,I,C),E}_stringRangesToCellRanges(h,m,S){let I=0,C=!1,A=0,E=h[I];if(E){for(let N=S;N<this._bufferService.cols;N++){const O=m.getWidth(N),P=m.getString(N).length||b.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!C&&E[0]<=A&&(E[0]=N,C=!0),E[1]<=A){if(E[1]=N,E=h[++I],!E)break;E[0]<=A?(E[0]=N,C=!0):C=!1}A+=P}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(h,m){let S=!1;for(let I=0;I<h.length;I++){const C=h[I];if(S){if(m[1]<=C[0])return h[I-1][1]=m[1],h;if(m[1]<=C[1])return h[I-1][1]=Math.max(m[1],C[1]),h.splice(I,1),h;h.splice(I,1),I--}else{if(m[1]<=C[0])return h.splice(I,0,m),h;if(m[1]<=C[1])return C[0]=Math.min(m[0],C[0]),h;m[0]<C[1]&&(C[0]=Math.min(m[0],C[0]),S=!0)}}return S?h[h.length-1][1]=m[1]:h.push(m),h}};s.CharacterJoinerService=d=c([g(0,k.IBufferService)],d)},5114:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=a(844),g=a(8460),f=a(3656);class b extends c.Disposable{constructor(y,d,p){super(),this._textarea=y,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=b;class _ extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.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:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=a(844);class g extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const _=this.linkProviders.indexOf(b);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=g},8934:function(l,s,a){var c=this&&this.__decorate||function(k,y,d,p){var h,m=arguments.length,S=m<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(k,y,d,p);else for(var I=k.length-1;I>=0;I--)(h=k[I])&&(S=(m<3?h(S):m>3?h(y,d,S):h(y,d))||S);return m>3&&S&&Object.defineProperty(y,d,S),S},g=this&&this.__param||function(k,y){return function(d,p){y(d,p,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const f=a(4725),b=a(9806);let _=s.MouseService=class{constructor(k,y){this._renderService=k,this._charSizeService=y}getCoords(k,y,d,p,h){return(0,b.getCoords)(window,k,y,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(k,y){const d=(0,b.getCoordsRelativeToElement)(window,k,y);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};s.MouseService=_=c([g(0,f.IRenderService),g(1,f.ICharSizeService)],_)},3230:function(l,s,a){var c=this&&this.__decorate||function(h,m,S,I){var C,A=arguments.length,E=A<3?m:I===null?I=Object.getOwnPropertyDescriptor(m,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,m,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(m,S,E):C(m,S))||E);return A>3&&E&&Object.defineProperty(m,S,E),E},g=this&&this.__param||function(h,m){return function(S,I){m(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const f=a(6193),b=a(4725),_=a(8460),k=a(844),y=a(7226),d=a(2585);let p=s.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,m,S,I,C,A,E,N){super(),this._rowCount=h,this._charSizeService=I,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((O,P)=>this._renderRows(O,P)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(A.onResize((()=>this._fullRefresh()))),this.register(A.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(C.onDecorationRegistered((()=>this._fullRefresh()))),this.register(C.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(A.cols,A.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(A.buffer.y,A.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,m),this.register(E.onWindowChange((O=>this._registerIntersectionObserver(O,m))))}_registerIntersectionObserver(h,m){if("IntersectionObserver"in h){const S=new h.IntersectionObserver((I=>this._handleIntersectionChange(I[I.length-1])),{threshold:0});S.observe(m),this._observerDisposable.value=(0,k.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,m,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,m,this._rowCount))}_renderRows(h,m){this._renderer.value&&(h=Math.min(h,this._rowCount-1),m=Math.min(m,this._rowCount-1),this._renderer.value.renderRows(h,m),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:m}),this._onRender.fire({start:h,end:m}),this._isNextRenderRedrawOnly=!0)}resize(h,m){this._rowCount=m,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((m=>this.refreshRows(m.start,m.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,m;this._renderer.value&&((m=(h=this._renderer.value).clearTextureAtlas)==null||m.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,m){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(h,m)})):this._renderer.value.handleResize(h,m),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,m,S){var I;this._selectionState.start=h,this._selectionState.end=m,this._selectionState.columnSelectMode=S,(I=this._renderer.value)==null||I.handleSelectionChanged(h,m,S)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};s.RenderService=p=c([g(2,d.IOptionsService),g(3,b.ICharSizeService),g(4,d.IDecorationService),g(5,d.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],p)},9312:function(l,s,a){var c=this&&this.__decorate||function(E,N,O,P){var $,D=arguments.length,re=D<3?N:P===null?P=Object.getOwnPropertyDescriptor(N,O):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(E,N,O,P);else for(var le=E.length-1;le>=0;le--)($=E[le])&&(re=(D<3?$(re):D>3?$(N,O,re):$(N,O))||re);return D>3&&re&&Object.defineProperty(N,O,re),re},g=this&&this.__param||function(E,N){return function(O,P){N(O,P,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const f=a(9806),b=a(9504),_=a(456),k=a(4725),y=a(8460),d=a(844),p=a(6114),h=a(4841),m=a(511),S=a(2585),I=" ",C=new RegExp(I,"g");let A=s.SelectionService=class extends d.Disposable{constructor(E,N,O,P,$,D,re,le,ge){super(),this._element=E,this._screenElement=N,this._linkifier=O,this._bufferService=P,this._coreService=$,this._mouseService=D,this._optionsService=re,this._renderService=le,this._coreBrowserService=ge,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new m.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Ie=>this._handleMouseMove(Ie),this._mouseUpListener=Ie=>this._handleMouseUp(Ie),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Ie=>this._handleTrim(Ie))),this.register(this._bufferService.buffers.onBufferActivate((Ie=>this._handleBufferActivate(Ie)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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,N=this._model.finalSelectionEnd;return!(!E||!N||E[0]===N[0]&&E[1]===N[1])}get selectionText(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!E||!N)return"";const O=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(E[0]===N[0])return"";const $=E[0]<N[0]?E[0]:N[0],D=E[0]<N[0]?N[0]:E[0];for(let re=E[1];re<=N[1];re++){const le=O.translateBufferLineToString(re,!0,$,D);P.push(le)}}else{const $=E[1]===N[1]?N[0]:void 0;P.push(O.translateBufferLineToString(E[1],!0,E[0],$));for(let D=E[1]+1;D<=N[1]-1;D++){const re=O.lines.get(D),le=O.translateBufferLineToString(D,!0);re!=null&&re.isWrapped?P[P.length-1]+=le:P.push(le)}if(E[1]!==N[1]){const D=O.lines.get(N[1]),re=O.translateBufferLineToString(N[1],!0,0,N[0]);D&&D.isWrapped?P[P.length-1]+=re:P.push(re)}}return P.map(($=>$.replace(C," "))).join(p.isWindows?`\r
|
|
169
169
|
`:`
|
|
170
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.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 N=this._getMouseBufferCoords(E),F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(F&&U&&N)&&this._areCoordsInSelection(N,F,U)}isCellInSelection(E,N){const F=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!F||!U)&&this._areCoordsInSelection([E,N],F,U)}_areCoordsInSelection(E,N,F){return E[1]>N[1]&&E[1]<F[1]||N[1]===F[1]&&E[1]===N[1]&&E[0]>=N[0]&&E[0]<F[0]||N[1]<F[1]&&E[1]===F[1]&&E[0]<F[0]||N[1]<F[1]&&E[1]===N[1]&&E[0]>=N[0]}_selectWordAtCursor(E,N){var F,U;const P=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(E);return!!O&&(this._selectWordAt(O,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,N){this._model.clearSelection(),E=Math.max(E,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const N=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(E){let N=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const F=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=F?0:(N>F&&(N-=F),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(E){return p.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 N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const N=this._getMouseBufferCoords(E);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(E){return E.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const N=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 F=this._bufferService.buffer;if(this._model.selectionEnd[1]<F.lines.length){const U=F.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 N=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const F=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(F&&F[0]!==void 0&&F[1]!==void 0){const U=(0,b.moveToCellSequence)(F[0]-1,F[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,F=!(!E||!N||E[0]===N[0]&&E[1]===N[1]);F?E&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,N,F)):this._oldHasSelection&&this._fireOnSelectionChange(E,N,F)}_fireOnSelectionChange(E,N,F){this._oldSelectionStart=E,this._oldSelectionEnd=N,this._oldHasSelection=F,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(E,N){let F=N;for(let U=0;N>=U;U++){const P=E.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?F--:P>1&&N!==U&&(F+=P-1)}return F}setSelection(E,N,F){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,N],this._model.selectionStartLength=F,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,N,F=!0,U=!0){if(E[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,O=P.lines.get(E[1]);if(!O)return;const te=P.translateBufferLineToString(E[1],!1);let le=this._convertViewportColToCharacterIndex(O,E[0]),ge=le;const ke=E[0]-le;let ie=0,B=0,V=0,W=0;if(te.charAt(le)===" "){for(;le>0&&te.charAt(le-1)===" ";)le--;for(;ge<te.length&&te.charAt(ge+1)===" ";)ge++}else{let me=E[0],be=E[0];O.getWidth(me)===0&&(ie++,me--),O.getWidth(be)===2&&(B++,be++);const Ee=O.getString(be).length;for(Ee>1&&(W+=Ee-1,ge+=Ee-1);me>0&&le>0&&!this._isCharWordSeparator(O.loadCell(me-1,this._workCell));){O.loadCell(me-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(ie++,me--):J>1&&(V+=J-1,le-=J-1),le--,me--}for(;be<O.length&&ge+1<te.length&&!this._isCharWordSeparator(O.loadCell(be+1,this._workCell));){O.loadCell(be+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,be++):J>1&&(W+=J-1,ge+=J-1),ge++,be++}}ge++;let Z=le+ke-ie+V,he=Math.min(this._bufferService.cols,ge-le+ie+B-V-W);if(N||te.slice(le,ge).trim()!==""){if(F&&Z===0&&O.getCodePoint(0)!==32){const me=P.lines.get(E[1]-1);if(me&&O.isWrapped&&me.getCodePoint(this._bufferService.cols-1)!==32){const be=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(be){const Ee=this._bufferService.cols-be.start;Z-=Ee,he+=Ee}}}if(U&&Z+he===this._bufferService.cols&&O.getCodePoint(this._bufferService.cols-1)!==32){const me=P.lines.get(E[1]+1);if(me!=null&&me.isWrapped&&me.getCodePoint(0)!==32){const be=this._getWordAt([0,E[1]+1],!1,!1,!0);be&&(he+=be.length)}}return{start:Z,length:he}}}_selectWordAt(E,N){const F=this._getWordAt(E,N);if(F){for(;F.start<0;)F.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[F.start,E[1]],this._model.selectionStartLength=F.length}}_selectToWordAt(E){const N=this._getWordAt(E,!0);if(N){let F=E[1];for(;N.start<0;)N.start+=this._bufferService.cols,F--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,F++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,F]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const N=this._bufferService.buffer.getWrappedRangeForLine(E),F={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(F,this._bufferService.cols)}};s.SelectionService=A=c([m(3,S.IBufferService),m(4,S.ICoreService),m(5,k.IMouseService),m(6,S.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],A)},4725:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=a(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(u,s,a){var c=this&&this.__decorate||function(A,E,N,F){var U,P=arguments.length,O=P<3?E:F===null?F=Object.getOwnPropertyDescriptor(E,N):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(A,E,N,F);else for(var te=A.length-1;te>=0;te--)(U=A[te])&&(O=(P<3?U(O):P>3?U(E,N,O):U(E,N))||O);return P>3&&O&&Object.defineProperty(E,N,O),O},m=this&&this.__param||function(A,E){return function(N,F){E(N,F,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=a(7239),b=a(8055),_=a(8460),k=a(844),y=a(2585),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),h=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let N=0;N<216;N++){const F=E[N/36%6|0],U=E[N/6%6|0],P=E[N%6];A.push({css:b.channels.toCss(F,U,P),rgba:b.channels.toRgba(F,U,P)})}for(let N=0;N<24;N++){const F=8+10*N;A.push({css:b.channels.toCss(F,F,F),rgba:b.channels.toRgba(F,F,F)})}return A})());let I=s.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:h,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(A={}){const E=this._colors;if(E.foreground=C(A.foreground,d),E.background=C(A.background,p),E.cursor=C(A.cursor,h),E.cursorAccent=C(A.cursorAccent,g),E.selectionBackgroundTransparent=C(A.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=C(A.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=A.selectionForeground?C(A.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=C(A.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=C(A.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=C(A.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=C(A.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=C(A.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=C(A.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=C(A.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=C(A.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=C(A.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=C(A.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=C(A.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=C(A.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=C(A.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=C(A.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=C(A.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=C(A.brightWhite,s.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const N=Math.min(E.ansi.length-16,A.extendedAnsi.length);for(let F=0;F<N;F++)E.ansi[F+16]=C(A.extendedAnsi[F],s.DEFAULT_ANSI_COLORS[F+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(A){A(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(A,E){if(A!==void 0)try{return b.css.toColor(A)}catch{}return E}s.ThemeService=I=c([m(0,y.IOptionsService)],I)},6349:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=a(8460),m=a(844);class f extends m.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const k=new Array(_);for(let y=0;y<Math.min(_,this.length);y++)k[y]=this._array[this._getCyclicIndex(y)];this._array=k,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let k=this._length;k<_;k++)this._array[k]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,k){this._array[this._getCyclicIndex(_)]=k}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,k,...y){if(k){for(let d=_;d<this._length-k;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+k)];this._length-=k,this.onDeleteEmitter.fire({index:_,amount:k})}for(let d=this._length-1;d>=_;d--)this._array[this._getCyclicIndex(d+y.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<y.length;d++)this._array[this._getCyclicIndex(_+d)]=y[d];if(y.length&&this.onInsertEmitter.fire({index:_,amount:y.length}),this._length+y.length>this._maxLength){const d=this._length+y.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=y.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,k,y){if(!(k<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=k-1;p>=0;p--)this.set(_+p+y,this.get(_+p));const d=_+k+y-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<k;d++)this.set(_+d+y,this.get(_+d))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=f},1439:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(c,m=5){if(typeof c!="object")return c;const f=Array.isArray(c)?[]:{};for(const b in c)f[b]=m<=1?c[b]:c[b]&&a(c[b],m-1);return f}},8055:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,f=0;var b,_,k,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function h(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,I,C,A){return A!==void 0?`#${p(S)}${p(I)}${p(C)}${p(A)}`:`#${p(S)}${p(I)}${p(C)}`},g.toRgba=function(S,I,C,A=255){return(S<<24|I<<16|C<<8|A)>>>0},g.toColor=function(S,I,C,A){return{css:g.toCss(S,I,C,A),rgba:g.toRgba(S,I,C,A)}}})(b||(s.channels=b={})),(function(g){function S(I,C){return f=Math.round(255*C),[a,c,m]=d.toChannels(I.rgba),{css:b.toCss(a,c,m,f),rgba:b.toRgba(a,c,m,f)}}g.blend=function(I,C){if(f=(255&C.rgba)/255,f===1)return{css:C.css,rgba:C.rgba};const A=C.rgba>>24&255,E=C.rgba>>16&255,N=C.rgba>>8&255,F=I.rgba>>24&255,U=I.rgba>>16&255,P=I.rgba>>8&255;return a=F+Math.round((A-F)*f),c=U+Math.round((E-U)*f),m=P+Math.round((N-P)*f),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(I){return(255&I.rgba)==255},g.ensureContrastRatio=function(I,C,A){const E=d.ensureContrastRatio(I.rgba,C.rgba,A);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(I){const C=(255|I.rgba)>>>0;return[a,c,m]=d.toChannels(C),{css:b.toCss(a,c,m),rgba:C}},g.opacity=S,g.multiplyOpacity=function(I,C){return f=255&I.rgba,S(I,f*C/255)},g.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,I;try{const C=document.createElement("canvas");C.width=1,C.height=1;const A=C.getContext("2d",{willReadFrequently:!0});A&&(S=A,S.globalCompositeOperation="copy",I=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),m=parseInt(C.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),m=parseInt(C.slice(3,4).repeat(2),16),f=parseInt(C.slice(4,5).repeat(2),16),b.toColor(a,c,m,f);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 A=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(A)return a=parseInt(A[1]),c=parseInt(A[2]),m=parseInt(A[3]),f=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),b.toColor(a,c,m,f);if(!S||!I)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=I,S.fillStyle=C,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,f]=S.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,f),css:C}}})(k||(s.css=k={})),(function(g){function S(I,C,A){const E=I/255,N=C/255,F=A/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}g.relativeLuminance=function(I){return S(I>>16&255,I>>8&255,255&I)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(C,A,E){const N=C>>24&255,F=C>>16&255,U=C>>8&255;let P=A>>24&255,O=A>>16&255,te=A>>8&255,le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));for(;le<E&&(P>0||O>0||te>0);)P-=Math.max(0,Math.ceil(.1*P)),O-=Math.max(0,Math.ceil(.1*O)),te-=Math.max(0,Math.ceil(.1*te)),le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));return(P<<24|O<<16|te<<8|255)>>>0}function I(C,A,E){const N=C>>24&255,F=C>>16&255,U=C>>8&255;let P=A>>24&255,O=A>>16&255,te=A>>8&255,le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));for(;le<E&&(P<255||O<255||te<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),O=Math.min(255,O+Math.ceil(.1*(255-O))),te=Math.min(255,te+Math.ceil(.1*(255-te))),le=h(y.relativeLuminance2(P,O,te),y.relativeLuminance2(N,F,U));return(P<<24|O<<16|te<<8|255)>>>0}g.blend=function(C,A){if(f=(255&A)/255,f===1)return A;const E=A>>24&255,N=A>>16&255,F=A>>8&255,U=C>>24&255,P=C>>16&255,O=C>>8&255;return a=U+Math.round((E-U)*f),c=P+Math.round((N-P)*f),m=O+Math.round((F-O)*f),b.toRgba(a,c,m)},g.ensureContrastRatio=function(C,A,E){const N=y.relativeLuminance(C>>8),F=y.relativeLuminance(A>>8);if(h(N,F)<E){if(F<N){const O=S(C,A,E),te=h(N,y.relativeLuminance(O>>8));if(te<E){const le=I(C,A,E);return te>h(N,y.relativeLuminance(le>>8))?O:le}return O}const U=I(C,A,E),P=h(N,y.relativeLuminance(U>>8));if(P<E){const O=S(C,A,E);return P>h(N,y.relativeLuminance(O>>8))?U:O}return U}},g.reduceLuminance=S,g.increaseLuminance=I,g.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=h},8969:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=a(844),m=a(2585),f=a(4348),b=a(7866),_=a(744),k=a(7302),y=a(6975),d=a(8460),p=a(1753),h=a(1480),g=a(7994),S=a(9282),I=a(5435),C=a(5981),A=a(2660);let E=!1;class N extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((U=>{var P;(P=this._onScrollApi)==null||P.fire(U.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(U){for(const P in U)this.optionsService.options[P]=U[P]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(U)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(A.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new I.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new C.WriteBuffer(((P,O)=>this._inputHandler.parse(P,O)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,P){this._writeBuffer.write(U,P)}writeSync(U,P){this._logService.logLevel<=m.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(U,P)}input(U,P=!0){this.coreService.triggerDataEvent(U,P)}resize(U,P){isNaN(U)||isNaN(P)||(U=Math.max(U,_.MINIMUM_COLS),P=Math.max(P,_.MINIMUM_ROWS),this._bufferService.resize(U,P))}scroll(U,P=!1){this._bufferService.scroll(U,P)}scrollLines(U,P,O){this._bufferService.scrollLines(U,P,O)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const P=U-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(U,P){return this._inputHandler.registerEscHandler(U,P)}registerDcsHandler(U,P){return this._inputHandler.registerDcsHandler(U,P)}registerCsiHandler(U,P){return this._inputHandler.registerCsiHandler(U,P)}registerOscHandler(U,P){return this._inputHandler.registerOscHandler(U,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?U=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const P of U)P.dispose()}))}}}s.CoreTerminal=N},8460:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let f=0;f<this._listeners.length;f++)m.push(this._listeners[f]);for(let f=0;f<m.length;f++)m[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},5435:function(u,s,a){var c=this&&this.__decorate||function(ie,B,V,W){var Z,he=arguments.length,me=he<3?B:W===null?W=Object.getOwnPropertyDescriptor(B,V):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")me=Reflect.decorate(ie,B,V,W);else for(var be=ie.length-1;be>=0;be--)(Z=ie[be])&&(me=(he<3?Z(me):he>3?Z(B,V,me):Z(B,V))||me);return he>3&&me&&Object.defineProperty(B,V,me),me},m=this&&this.__param||function(ie,B){return function(V,W){B(V,W,ie)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const f=a(2584),b=a(7116),_=a(2015),k=a(844),y=a(482),d=a(8437),p=a(8460),h=a(643),g=a(511),S=a(3734),I=a(2585),C=a(1480),A=a(6242),E=a(6351),N=a(5941),F={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function P(ie,B){if(ie>24)return B.setWinLines||!1;switch(ie){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var O;(function(ie){ie[ie.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ie[ie.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(O||(s.WindowsOptionsReportType=O={}));let te=0;class le extends k.Disposable{getAttrData(){return this._curAttrData}constructor(B,V,W,Z,he,me,be,Ee,J=new _.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=V,this._coreService=W,this._logService=Z,this._optionsService=he,this._oscLinkService=me,this._coreMouseService=be,this._unicodeService=Ee,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 ge(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:se.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,se,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:se,data:ae})})),this._parser.setDcsHandlerFallback(((L,se,ae)=>{se==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:se,payload:ae})})),this._parser.setPrintHandler(((L,se,ae)=>this.print(L,se,ae))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new A.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new A.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new A.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new A.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new A.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new A.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new A.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new A.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new A.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new A.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new A.OscHandler((L=>this.restoreCursorColor(L)))),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 L in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((L,se)=>this.requestStatusString(L,se))))}_preserveStack(B,V,W,Z){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=V,this._parseStack.decodedLength=W,this._parseStack.position=Z}_logSlowResolvingAsync(B){this._logService.logLevel<=I.LogLevelEnum.WARN&&Promise.race([B,new Promise(((V,W)=>setTimeout((()=>W("#SLOW_TIMEOUT")),5e3)))]).catch((V=>{if(V!=="#SLOW_TIMEOUT")throw V;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,V){let W,Z=this._activeBuffer.x,he=this._activeBuffer.y,me=0;const be=this._parseStack.paused;if(be){if(W=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,V))return this._logSlowResolvingAsync(W),W;Z=this._parseStack.cursorStartX,he=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>U&&(me=this._parseStack.position+U)}if(this._logService.logLevel<=I.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(L=>String.fromCharCode(L))).join("")}"`),typeof B=="string"?B.split("").map((L=>L.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(B.length,U))),be||this._dirtyRowTracker.clearRange(),B.length>U)for(let L=me;L<B.length;L+=U){const se=L+U<B.length?L+U:B.length,ae=typeof B=="string"?this._stringDecoder.decode(B.substring(L,se),this._parseBuffer):this._utf8Decoder.decode(B.subarray(L,se),this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(Z,he,ae,L),this._logSlowResolvingAsync(W),W}else if(!be){const L=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,L))return this._preserveStack(Z,he,L,0),this._logSlowResolvingAsync(W),W}this._activeBuffer.x===Z&&this._activeBuffer.y===he||this._onCursorMove.fire();const Ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(Ee,this._bufferService.rows-1))}print(B,V,W){let Z,he;const me=this._charsetService.charset,be=this._optionsService.rawOptions.screenReaderMode,Ee=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,se=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&W-V>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let Ie=this._parser.precedingJoinState;for(let fe=V;fe<W;++fe){if(Z=B[fe],Z<127&&me){const xt=me[String.fromCharCode(Z)];xt&&(Z=xt.charCodeAt(0))}const Fe=this._unicodeService.charProperties(Z,Ie);he=C.UnicodeService.extractWidth(Fe);const tt=C.UnicodeService.extractShouldJoin(Fe),Xe=tt?C.UnicodeService.extractWidth(Ie):0;if(Ie=Fe,be&&this._onA11yChar.fire((0,y.stringFromCodePoint)(Z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+he-Xe>Ee){if(J){const xt=ae;let Le=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Xe>0&&ae instanceof d.BufferLine&&ae.copyCellsFrom(xt,Le,0,Xe,!1);Le<Ee;)xt.setCellFromCodepoint(Le++,0,1,se)}else if(this._activeBuffer.x=Ee-1,he===2)continue}if(tt&&this._activeBuffer.x){const xt=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-xt,Z,he);for(let Le=he-Xe;--Le>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(L&&(ae.insertCells(this._activeBuffer.x,he-Xe,this._activeBuffer.getNullCell(se)),ae.getWidth(Ee-1)===2&&ae.setCellFromCodepoint(Ee-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,se)),ae.setCellFromCodepoint(this._activeBuffer.x++,Z,he,se),he>0)for(;--he;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=Ie,this._activeBuffer.x<Ee&&W-V>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,V){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,V):this._parser.registerCsiHandler(B,(W=>!P(W.params[0],this._optionsService.rawOptions.windowOptions)||V(W)))}registerDcsHandler(B,V){return this._parser.registerDcsHandler(B,new E.DcsHandler(V))}registerEscHandler(B,V){return this._parser.registerEscHandler(B,V)}registerOscHandler(B,V){return this._parser.registerOscHandler(B,new A.OscHandler(V))}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 B;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&&(B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);V.hasWidth(this._activeBuffer.x)&&!V.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,V){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+V):(this._activeBuffer.x=B,this._activeBuffer.y=V),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,V){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+V)}cursorUp(B){const V=this._activeBuffer.y-this._activeBuffer.scrollTop;return V>=0?this._moveCursor(0,-Math.min(V,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const V=this._activeBuffer.scrollBottom-this._activeBuffer.y;return V>=0?this._moveCursor(0,Math.min(V,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const V=B.params[0];return V===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:V===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let V=B.params[0]||1;for(;V--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let V=B.params[0]||1;for(;V--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const V=B.params[0];return V===1&&(this._curAttrData.bg|=536870912),V!==2&&V!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,V,W,Z=!1,he=!1){const me=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);me.replaceCells(V,W,this._activeBuffer.getNullCell(this._eraseAttrData()),he),Z&&(me.isWrapped=!1)}_resetBufferLine(B,V=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W&&(W.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),V),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),W.isWrapped=!1)}eraseInDisplay(B,V=!1){let W;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,V);W<this._bufferService.rows;W++)this._resetBufferLine(W,V);this._dirtyRowTracker.markDirty(W);break;case 1:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W,0,this._activeBuffer.x+1,!0,V),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(W+1).isWrapped=!1);W--;)this._resetBufferLine(W,V);this._dirtyRowTracker.markDirty(0);break;case 2:for(W=this._bufferService.rows,this._dirtyRowTracker.markDirty(W-1);W--;)this._resetBufferLine(W,V);this._dirtyRowTracker.markDirty(0);break;case 3:const Z=this._activeBuffer.lines.length-this._bufferService.rows;Z>0&&(this._activeBuffer.lines.trimStart(Z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Z,0),this._onScroll.fire(0))}return!0}eraseInLine(B,V=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,V);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,V);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,V)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let V=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y,Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,he=this._bufferService.rows-1+this._activeBuffer.ybase-Z+1;for(;V--;)this._activeBuffer.lines.splice(he-1,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let V=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y;let Z;for(Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-Z;V--;)this._activeBuffer.lines.splice(W,1),this._activeBuffer.lines.splice(Z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return V&&(V.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return V&&(V.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let V=B.params[0]||1;for(;V--;)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(B){let V=B.params[0]||1;for(;V--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const V=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);Z.deleteCells(0,V,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const V=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);Z.insertCells(0,V,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const V=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);Z.insertCells(this._activeBuffer.x,V,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const V=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);Z.deleteCells(this._activeBuffer.x,V,this._activeBuffer.getNullCell(this._eraseAttrData())),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return V&&(V.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const V=this._parser.precedingJoinState;if(!V)return!0;const W=B.params[0]||1,Z=C.UnicodeService.extractWidth(V),he=this._activeBuffer.x-Z,me=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(he),be=new Uint32Array(me.length*W);let Ee=0;for(let L=0;L<me.length;){const se=me.codePointAt(L)||0;be[Ee++]=se,L+=se>65535?2:1}let J=Ee;for(let L=1;L<W;++L)be.copyWithin(J,0,Ee),J+=Ee;return this.print(be,0,J),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let V=0;V<B.length;V++)switch(B.params[V]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let V=0;V<B.length;V++)switch(B.params[V]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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(B){for(let V=0;V<B.length;V++)switch(B.params[V]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let V=0;V<B.length;V++)switch(B.params[V]){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(),B.params[V]===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(B,V){const W=this._coreService.decPrivateModes,{activeProtocol:Z,activeEncoding:he}=this._coreMouseService,me=this._coreService,{buffers:be,cols:Ee}=this._bufferService,{active:J,alt:L}=be,se=this._optionsService.rawOptions,ae=tt=>tt?1:2,Ie=B.params[0];return fe=Ie,Fe=V?Ie===2?4:Ie===4?ae(me.modes.insertMode):Ie===12?3:Ie===20?ae(se.convertEol):0:Ie===1?ae(W.applicationCursorKeys):Ie===3?se.windowOptions.setWinLines?Ee===80?2:Ee===132?1:0:0:Ie===6?ae(W.origin):Ie===7?ae(W.wraparound):Ie===8?3:Ie===9?ae(Z==="X10"):Ie===12?ae(se.cursorBlink):Ie===25?ae(!me.isCursorHidden):Ie===45?ae(W.reverseWraparound):Ie===66?ae(W.applicationKeypad):Ie===67?4:Ie===1e3?ae(Z==="VT200"):Ie===1002?ae(Z==="DRAG"):Ie===1003?ae(Z==="ANY"):Ie===1004?ae(W.sendFocus):Ie===1005?4:Ie===1006?ae(he==="SGR"):Ie===1015?4:Ie===1016?ae(he==="SGR_PIXELS"):Ie===1048?1:Ie===47||Ie===1047||Ie===1049?ae(J===L):Ie===2004?ae(W.bracketedPasteMode):0,me.triggerDataEvent(`${f.C0.ESC}[${V?"":"?"}${fe};${Fe}$y`),!0;var fe,Fe}_updateAttrColor(B,V,W,Z,he){return V===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([W,Z,he])):V===5&&(B&=-50331904,B|=33554432|255&W),B}_extractColor(B,V,W){const Z=[0,0,-1,0,0,0];let he=0,me=0;do{if(Z[me+he]=B.params[V+me],B.hasSubParams(V+me)){const be=B.getSubParams(V+me);let Ee=0;do Z[1]===5&&(he=1),Z[me+Ee+1+he]=be[Ee];while(++Ee<be.length&&Ee+me+1+he<Z.length);break}if(Z[1]===5&&me+he>=2||Z[1]===2&&me+he>=5)break;Z[1]&&(he=1)}while(++me+V<B.length&&me+he<Z.length);for(let be=2;be<Z.length;++be)Z[be]===-1&&(Z[be]=0);switch(Z[0]){case 38:W.fg=this._updateAttrColor(W.fg,Z[1],Z[3],Z[4],Z[5]);break;case 48:W.bg=this._updateAttrColor(W.bg,Z[1],Z[3],Z[4],Z[5]);break;case 58:W.extended=W.extended.clone(),W.extended.underlineColor=this._updateAttrColor(W.extended.underlineColor,Z[1],Z[3],Z[4],Z[5])}return me}_processUnderline(B,V){V.extended=V.extended.clone(),(!~B||B>5)&&(B=1),V.extended.underlineStyle=B,V.fg|=268435456,B===0&&(V.fg&=-268435457),V.updateExtended()}_processSGR0(B){B.fg=d.DEFAULT_ATTR_DATA.fg,B.bg=d.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const V=B.length;let W;const Z=this._curAttrData;for(let he=0;he<V;he++)W=B.params[he],W>=30&&W<=37?(Z.fg&=-50331904,Z.fg|=16777216|W-30):W>=40&&W<=47?(Z.bg&=-50331904,Z.bg|=16777216|W-40):W>=90&&W<=97?(Z.fg&=-50331904,Z.fg|=16777224|W-90):W>=100&&W<=107?(Z.bg&=-50331904,Z.bg|=16777224|W-100):W===0?this._processSGR0(Z):W===1?Z.fg|=134217728:W===3?Z.bg|=67108864:W===4?(Z.fg|=268435456,this._processUnderline(B.hasSubParams(he)?B.getSubParams(he)[0]:1,Z)):W===5?Z.fg|=536870912:W===7?Z.fg|=67108864:W===8?Z.fg|=1073741824:W===9?Z.fg|=2147483648:W===2?Z.bg|=134217728:W===21?this._processUnderline(2,Z):W===22?(Z.fg&=-134217729,Z.bg&=-134217729):W===23?Z.bg&=-67108865:W===24?(Z.fg&=-268435457,this._processUnderline(0,Z)):W===25?Z.fg&=-536870913:W===27?Z.fg&=-67108865:W===28?Z.fg&=-1073741825:W===29?Z.fg&=2147483647:W===39?(Z.fg&=-67108864,Z.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):W===49?(Z.bg&=-67108864,Z.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):W===38||W===48||W===58?he+=this._extractColor(B,he,Z):W===53?Z.bg|=1073741824:W===55?Z.bg&=-1073741825:W===59?(Z.extended=Z.extended.clone(),Z.extended.underlineColor=-1,Z.updateExtended()):W===100?(Z.fg&=-67108864,Z.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,Z.bg&=-67108864,Z.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",W);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const V=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${V};${W}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const V=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${V};${W}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(B){const V=B.params[0]||1;switch(V){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 W=V%2==1;return this._optionsService.options.cursorBlink=W,!0}setScrollRegion(B){const V=B.params[0]||1;let W;return(B.length<2||(W=B.params[1])>this._bufferService.rows||W===0)&&(W=this._bufferService.rows),W>V&&(this._activeBuffer.scrollTop=V-1,this._activeBuffer.scrollBottom=W-1,this._setCursor(0,0)),!0}windowOptions(B){if(!P(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const V=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:V!==2&&this._onRequestWindowsOptionsReport.fire(O.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(O.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:V!==0&&V!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),V!==0&&V!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:V!==0&&V!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),V!==0&&V!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const V=[],W=B.split(";");for(;W.length>1;){const Z=W.shift(),he=W.shift();if(/^\d+$/.exec(Z)){const me=parseInt(Z);if(ke(me))if(he==="?")V.push({type:0,index:me});else{const be=(0,N.parseColor)(he);be&&V.push({type:1,index:me,color:be})}}}return V.length&&this._onColor.fire(V),!0}setHyperlink(B){const V=B.split(";");return!(V.length<2)&&(V[1]?this._createHyperlink(V[0],V[1]):!V[0]&&this._finishHyperlink())}_createHyperlink(B,V){this._getCurrentLinkId()&&this._finishHyperlink();const W=B.split(":");let Z;const he=W.findIndex((me=>me.startsWith("id=")));return he!==-1&&(Z=W[he].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Z,uri:V}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,V){const W=B.split(";");for(let Z=0;Z<W.length&&!(V>=this._specialColors.length);++Z,++V)if(W[Z]==="?")this._onColor.fire([{type:0,index:this._specialColors[V]}]);else{const he=(0,N.parseColor)(W[Z]);he&&this._onColor.fire([{type:1,index:this._specialColors[V],color:he}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const V=[],W=B.split(";");for(let Z=0;Z<W.length;++Z)if(/^\d+$/.exec(W[Z])){const he=parseInt(W[Z]);ke(he)&&V.push({type:2,index:he})}return V.length&&this._onColor.fire(V),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,b.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(F[B[0]],b.CHARSETS[B[1]]||b.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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new g.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let V=0;V<this._bufferService.rows;++V){const W=this._activeBuffer.ybase+this._activeBuffer.y+V,Z=this._activeBuffer.lines.get(W);Z&&(Z.fill(B),Z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,V){const W=this._bufferService.buffer,Z=this._optionsService.rawOptions;return(he=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${he}${f.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${W.scrollTop+1};${W.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[Z.cursorStyle]-(Z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,V){this._dirtyRowTracker.markRangeDirty(B,V)}}s.InputHandler=le;let ge=class{constructor(ie){this._bufferService=ie,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ie){ie<this.start?this.start=ie:ie>this.end&&(this.end=ie)}markRangeDirty(ie,B){ie>B&&(te=ie,ie=B,B=te),ie<this.start&&(this.start=ie),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ke(ie){return 0<=ie&&ie<256}ge=c([m(0,I.IBufferService)],ge)},844:(u,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,f,b){this._data[m]||(this._data[m]={}),this._data[m][f]=b}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,f,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(f,b,_)}get(c,m,f,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(f,b)}clear(){this._data.clear()}}},6114:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const m=a.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const m=this._getKey(c);if(m===void 0||(a=this._search(m),a===-1)||this._getKey(this._array[a])!==m)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===m);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,m){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do m(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let m=0,f=this._array.length-1;for(;f>=m;){let b=m+f>>1;const _=this._getKey(this._array[b]);if(_>c)f=b-1;else{if(!(_<c)){for(;b>0&&this._getKey(this._array[b-1])===c;)b--;return b}m=b+1}}return m}}},7226:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let k=0,y=0,d=_.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),y=Math.max(k,y),p=_.timeRemaining(),1.5*y>p)return d-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-k))}ms`),void this._start();d=p}this.clear()}}class f extends m{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const k=Date.now()+_;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}s.PriorityTaskQueue=f,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:f,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=a(643);s.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),b=f==null?void 0:f.get(m.cols-1),_=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);_&&b&&(_.isWrapped=b[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&b[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new a;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,b=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=b}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=a(6349),m=a(7226),f=a(3734),b=a(8437),_=a(4634),k=a(511),y=a(643),d=a(4863),p=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(h,g,S){this._hasScrollback=h,this._optionsService=g,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,g){return new b.BufferLine(this._bufferService.cols,this.getNullCell(h),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const g=h+this._optionsService.rawOptions.scrollback;return g>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:g}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=b.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let I=0;const C=this._getCorrectBufferLength(g);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<h)for(let E=0;E<this.lines.length;E++)I+=+this.lines.get(E).resize(h,S);let A=0;if(this._rows<g)for(let E=this._rows;E<g;E++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(h,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+A+1?(this.ybase--,A++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(h,S)));else for(let E=this._rows;E>g;E--)this.lines.length>g+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,h-1),this.y=Math.min(this.y,g-1),A&&(this.y+=A),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(h,g),this._cols>h))for(let A=0;A<this.lines.length;A++)I+=+this.lines.get(A).resize(h,S);this._cols=h,this._rows=g,this._memoryCleanupQueue.clear(),I>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,g){this._cols!==h&&(h>this._cols?this._reflowLarger(h,g):this._reflowSmaller(h,g))}_reflowLarger(h,g){const S=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const I=(0,_.reflowLargerCreateNewLayout)(this.lines,S);(0,_.reflowLargerApplyNewLayout)(this.lines,I.layout),this._reflowLargerAdjustViewport(h,g,I.countRemoved)}}_reflowLargerAdjustViewport(h,g,S){const I=this.getNullCell(b.DEFAULT_ATTR_DATA);let C=S;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new b.BufferLine(h,I))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(h,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),I=[];let C=0;for(let A=this.lines.length-1;A>=0;A--){let E=this.lines.get(A);if(!E||!E.isWrapped&&E.getTrimmedLength()<=h)continue;const N=[E];for(;E.isWrapped&&A>0;)E=this.lines.get(--A),N.unshift(E);const F=this.ybase+this.y;if(F>=A&&F<A+N.length)continue;const U=N[N.length-1].getTrimmedLength(),P=(0,_.reflowSmallerGetNewLineLengths)(N,this._cols,h),O=P.length-N.length;let te;te=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+O):Math.max(0,this.lines.length-this.lines.maxLength+O);const le=[];for(let W=0;W<O;W++){const Z=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);le.push(Z)}le.length>0&&(I.push({start:A+N.length+C,newLines:le}),C+=le.length),N.push(...le);let ge=P.length-1,ke=P[ge];ke===0&&(ge--,ke=P[ge]);let ie=N.length-O-1,B=U;for(;ie>=0;){const W=Math.min(B,ke);if(N[ge]===void 0)break;if(N[ge].copyCellsFrom(N[ie],B-W,ke-W,W,!0),ke-=W,ke===0&&(ge--,ke=P[ge]),B-=W,B===0){ie--;const Z=Math.max(ie,0);B=(0,_.getWrappedLineTrimmedLength)(N,Z,this._cols)}}for(let W=0;W<N.length;W++)P[W]<h&&N[W].setCell(P[W],S);let V=O-te;for(;V-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+O,this.ybase+g-1)}if(I.length>0){const A=[],E=[];for(let ge=0;ge<this.lines.length;ge++)E.push(this.lines.get(ge));const N=this.lines.length;let F=N-1,U=0,P=I[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let O=0;for(let ge=Math.min(this.lines.maxLength-1,N+C-1);ge>=0;ge--)if(P&&P.start>F+O){for(let ke=P.newLines.length-1;ke>=0;ke--)this.lines.set(ge--,P.newLines[ke]);ge++,A.push({index:F+1,amount:P.newLines.length}),O+=P.newLines.length,P=I[++U]}else this.lines.set(ge,E[F--]);let te=0;for(let ge=A.length-1;ge>=0;ge--)A[ge].index+=te,this.lines.onInsertEmitter.fire(A[ge]),te+=A[ge].amount;const le=Math.max(0,N+C-this.lines.maxLength);le>0&&this.lines.onTrimEmitter.fire(le)}}translateBufferLineToString(h,g,S=0,I){const C=this.lines.get(h);return C?C.translateToString(g,S,I):""}getWrappedRangeForLine(h){let g=h,S=h;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:g,last:S}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===h&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const g=new d.Marker(h);return this.markers.push(g),g.register(this.lines.onTrim((S=>{g.line-=S,g.line<0&&g.dispose()}))),g.register(this.lines.onInsert((S=>{g.line>=S.index&&(g.line+=S.amount)}))),g.register(this.lines.onDelete((S=>{g.line>=S.index&&g.line<S.index+S.amount&&g.dispose(),g.line>S.index&&(g.line-=S.amount)}))),g.register(g.onDispose((()=>this._removeMarker(g)))),g}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=a(3734),m=a(511),f=a(643),b=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class k{constructor(d,p,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const g=p||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,g);this.length=d}get(d){const p=this._data[3*d+0],h=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:h?(0,b.stringFromCodePoint)(h):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):h]}set(d,p){this._data[3*d+1]=p[f.CHAR_DATA_ATTR_INDEX],p[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,b.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return _=3*d,p.content=this._data[_+0],p.fg=this._data[_+1],p.bg=this._data[_+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,h,g){268435456&g.bg&&(this._extendedAttrs[d]=g.extended),this._data[3*d+0]=p|h<<22,this._data[3*d+1]=g.fg,this._data[3*d+2]=g.bg}addCodepointToCell(d,p,h){let g=this._data[3*d+0];2097152&g?this._combined[d]+=(0,b.stringFromCodePoint)(p):2097151&g?(this._combined[d]=(0,b.stringFromCodePoint)(2097151&g)+(0,b.stringFromCodePoint)(p),g&=-2097152,g|=2097152):g=p|4194304,h&&(g&=-12582913,g|=h<<22),this._data[3*d+0]=g}insertCells(d,p,h){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length-d){const g=new m.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,g));for(let S=0;S<p;++S)this.setCell(d+S,h)}else for(let g=d;g<this.length;++g)this.setCell(g,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(d,p,h){if(d%=this.length,p<this.length-d){const g=new m.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,g));for(let S=this.length-p;S<this.length;++S)this.setCell(S,h)}else for(let g=d;g<this.length;++g)this.setCell(g,h);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,h)}replaceCells(d,p,h,g=!1){if(g)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,h);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,h),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,h);d<p&&d<this.length;)this.setCell(d++,h)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const g=new Uint32Array(h);g.set(this._data),this._data=g}for(let g=this.length;g<d;++g)this.setCell(g,p)}else{this._data=this._data.subarray(0,h);const g=Object.keys(this._combined);for(let I=0;I<g.length;I++){const C=parseInt(g[I],10);C>=d&&delete this._combined[C]}const S=Object.keys(this._extendedAttrs);for(let I=0;I<S.length;I++){const C=parseInt(S[I],10);C>=d&&delete this._extendedAttrs[C]}}return this.length=d,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,d);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new k(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,h,g,S){const I=d._data;if(S)for(let A=g-1;A>=0;A--){for(let E=0;E<3;E++)this._data[3*(h+A)+E]=I[3*(p+A)+E];268435456&I[3*(p+A)+2]&&(this._extendedAttrs[h+A]=d._extendedAttrs[p+A])}else for(let A=0;A<g;A++){for(let E=0;E<3;E++)this._data[3*(h+A)+E]=I[3*(p+A)+E];268435456&I[3*(p+A)+2]&&(this._extendedAttrs[h+A]=d._extendedAttrs[p+A])}const C=Object.keys(d._combined);for(let A=0;A<C.length;A++){const E=parseInt(C[A],10);E>=p&&(this._combined[E-p+h]=d._combined[E])}}translateToString(d,p,h,g){p=p??0,h=h??this.length,d&&(h=Math.min(h,this.getTrimmedLength())),g&&(g.length=0);let S="";for(;p<h;){const I=this._data[3*p+0],C=2097151&I,A=2097152&I?this._combined[p]:C?(0,b.stringFromCodePoint)(C):f.WHITESPACE_CELL_CHAR;if(S+=A,g)for(let E=0;E<A.length;++E)g.push(p);p+=I>>22||1}return g&&g.push(p),S}}s.BufferLine=k},4841:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(u,s)=>{function a(c,m,f){if(m===c.length-1)return c[m].getTrimmedLength();const b=!c[m].hasContent(f-1)&&c[m].getWidth(f-1)===1,_=c[m+1].getWidth(0)===2;return b&&_?f-1:f}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,m,f,b,_){const k=[];for(let y=0;y<c.length-1;y++){let d=y,p=c.get(++d);if(!p.isWrapped)continue;const h=[c.get(y)];for(;d<c.length&&p.isWrapped;)h.push(p),p=c.get(++d);if(b>=y&&b<d){y+=h.length-1;continue}let g=0,S=a(h,g,m),I=1,C=0;for(;I<h.length;){const E=a(h,I,m),N=E-C,F=f-S,U=Math.min(N,F);h[g].copyCellsFrom(h[I],C,S,U,!1),S+=U,S===f&&(g++,S=0),C+=U,C===E&&(I++,C=0),S===0&&g!==0&&h[g-1].getWidth(f-1)===2&&(h[g].copyCellsFrom(h[g-1],f-1,S++,1,!1),h[g-1].setCell(f-1,_))}h[g].replaceCells(S,f,_);let A=0;for(let E=h.length-1;E>0&&(E>g||h[E].getTrimmedLength()===0);E--)A++;A>0&&(k.push(y+h.length-A),k.push(A)),y+=h.length-1}return k},s.reflowLargerCreateNewLayout=function(c,m){const f=[];let b=0,_=m[b],k=0;for(let y=0;y<c.length;y++)if(_===y){const d=m[++b];c.onDeleteEmitter.fire({index:y-k,amount:d}),y+=d-1,k+=d,_=m[++b]}else f.push(y);return{layout:f,countRemoved:k}},s.reflowLargerApplyNewLayout=function(c,m){const f=[];for(let b=0;b<m.length;b++)f.push(c.get(m[b]));for(let b=0;b<f.length;b++)c.set(b,f[b]);c.length=m.length},s.reflowSmallerGetNewLineLengths=function(c,m,f){const b=[],_=c.map(((p,h)=>a(c,h,m))).reduce(((p,h)=>p+h));let k=0,y=0,d=0;for(;d<_;){if(_-d<f){b.push(_-d);break}k+=f;const p=a(c,y,m);k>p&&(k-=p,y++);const h=c[y].getWidth(k-1)===2;h&&k--;const g=h?f-1:f;b.push(g),d+=g}return b},s.getWrappedLineTrimmedLength=a},5295:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=a(8460),m=a(844),f=a(9092);class b extends m.Disposable{constructor(k,y){super(),this._optionsService=k,this._bufferService=y,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,y){this._normal.resize(k,y),this._alt.resize(k,y),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}s.BufferSet=b},511:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(482),m=a(643),f=a(3734);class b extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const y=new b;return y.setFromCharData(k),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const d=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=b},643:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=a(8460),m=a(844);class f{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=f,f._nextId=1},7116:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,s)=>{var a,c,m;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
171
|
-
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(a||(s.C0=a={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(c||(s.C1=c={})),(function(f){f.ST=`${a.ESC}\\`})(m||(s.C1_ESCAPED=m={}))},7399:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=a(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(f,b,_,k){const y={type:0,cancel:!1,key:void 0},d=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=f.ctrlKey?"\b":c.C0.DEL,f.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(f.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=f.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,f.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(_?"b":"[1;5D"))):y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(_?"f":"[1;5C"))):y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"A",_||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"B",_||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=d?c.C0.ESC+"[3;"+(d+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=d?c.C0.ESC+"[1;"+(d+1)+"H":b?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=d?c.C0.ESC+"[1;"+(d+1)+"F":b?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:f.shiftKey?y.type=2:f.ctrlKey?y.key=c.C0.ESC+"[5;"+(d+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:f.shiftKey?y.type=3:f.ctrlKey?y.key=c.C0.ESC+"[6;"+(d+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=d?c.C0.ESC+"[1;"+(d+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=d?c.C0.ESC+"[1;"+(d+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=d?c.C0.ESC+"[1;"+(d+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=d?c.C0.ESC+"[1;"+(d+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=d?c.C0.ESC+"[15;"+(d+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=d?c.C0.ESC+"[17;"+(d+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=d?c.C0.ESC+"[18;"+(d+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=d?c.C0.ESC+"[19;"+(d+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=d?c.C0.ESC+"[20;"+(d+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=d?c.C0.ESC+"[21;"+(d+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=d?c.C0.ESC+"[23;"+(d+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=d?c.C0.ESC+"[24;"+(d+1)+"~":c.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(_&&!k||!f.altKey||f.metaKey)!_||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?y.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(y.key=c.C0.US),f.key==="@"&&(y.key=c.C0.NUL)):f.keyCode===65&&(y.type=1);else{const p=m[f.keyCode],h=p==null?void 0:p[f.shiftKey?1:0];if(h)y.key=c.C0.ESC+h;else if(f.keyCode>=65&&f.keyCode<=90){const g=f.ctrlKey?f.keyCode-64:f.keyCode+32;let S=String.fromCharCode(g);f.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(f.keyCode===32)y.key=c.C0.ESC+(f.ctrlKey?c.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let g=f.code.slice(3,4);f.shiftKey||(g=g.toLowerCase()),y.key=c.C0.ESC+g,y.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?y.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?y.key=c.C0.NUL:f.keyCode>=51&&f.keyCode<=55?y.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?y.key=c.C0.DEL:f.keyCode===219?y.key=c.C0.ESC:f.keyCode===220?y.key=c.C0.FS:f.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,m=a.length){let f="";for(let b=c;b<m;++b){let _=a[b];_>65535?(_-=65536,f+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):f+=String.fromCharCode(_)}return f},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const m=a.length;if(!m)return 0;let f=0,b=0;if(this._interim){const _=a.charCodeAt(b++);56320<=_&&_<=57343?c[f++]=1024*(this._interim-55296)+_-56320+65536:(c[f++]=this._interim,c[f++]=_),this._interim=0}for(let _=b;_<m;++_){const k=a.charCodeAt(_);if(55296<=k&&k<=56319){if(++_>=m)return this._interim=k,f;const y=a.charCodeAt(_);56320<=y&&y<=57343?c[f++]=1024*(k-55296)+y-56320+65536:(c[f++]=k,c[f++]=y)}else k!==65279&&(c[f++]=k)}return f}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const m=a.length;if(!m)return 0;let f,b,_,k,y=0,d=0,p=0;if(this.interim[0]){let S=!1,I=this.interim[0];I&=(224&I)==192?31:(240&I)==224?15:7;let C,A=0;for(;(C=63&this.interim[++A])&&A<4;)I<<=6,I|=C;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=E-A;for(;p<N;){if(p>=m)return 0;if(C=a[p++],(192&C)!=128){p--,S=!0;break}this.interim[A++]=C,I<<=6,I|=63&C}S||(E===2?I<128?p--:c[y++]=I:E===3?I<2048||I>=55296&&I<=57343||I===65279||(c[y++]=I):I<65536||I>1114111||(c[y++]=I)),this.interim.fill(0)}const h=m-4;let g=p;for(;g<m;){for(;!(!(g<h)||128&(f=a[g])||128&(b=a[g+1])||128&(_=a[g+2])||128&(k=a[g+3]));)c[y++]=f,c[y++]=b,c[y++]=_,c[y++]=k,g+=4;if(f=a[g++],f<128)c[y++]=f;else if((224&f)==192){if(g>=m)return this.interim[0]=f,y;if(b=a[g++],(192&b)!=128){g--;continue}if(d=(31&f)<<6|63&b,d<128){g--;continue}c[y++]=d}else if((240&f)==224){if(g>=m)return this.interim[0]=f,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=f,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(d=(15&f)<<12|(63&b)<<6|63&_,d<2048||d>=55296&&d<=57343||d===65279)continue;c[y++]=d}else if((248&f)==240){if(g>=m)return this.interim[0]=f,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=f,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(g>=m)return this.interim[0]=f,this.interim[1]=b,this.interim[2]=_,y;if(k=a[g++],(192&k)!=128){g--;continue}if(d=(7&f)<<18|(63&b)<<12|(63&_)<<6|63&k,d<65536||d>1114111)continue;c[y++]=d}}return y}}},225:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(k,y){let d,p=0,h=y.length-1;if(k<y[0][0]||k>y[h][1])return!1;for(;h>=p;)if(d=p+h>>1,k>y[d][1])p=d+1;else{if(!(k<y[d][0]))return!0;h=d-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,k){let y=this.wcwidth(_),d=y===0&&k!==0;if(d){const p=c.UnicodeService.extractWidth(k);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},5981:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=a(8460),m=a(844);class f extends m.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(k)}_innerWrite(_=0,k=!0){const y=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,k);if(p){const g=S=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(y,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(g)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=f},5941:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function m(f,b){const _=f.toString(16),k=_.length<2?"0"+_:_;switch(b){case 4:return _[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}s.parseColor=function(f){if(!f)return;let b=f.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const _=a.exec(b);if(_){const k=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/k*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/k*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/k*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),c.exec(b)&&[3,6,9,12].includes(b.length))){const _=b.length/3,k=[0,0,0];for(let y=0;y<3;++y){const d=parseInt(b.slice(_*y,_*y+_),16);k[y]=_===1?d<<4:_===2?d:_===3?d>>4:d>>8}return k}},s.toRgbString=function(f,b=16){const[_,k,y]=f;return`rgb:${m(_,b)}/${m(k,b)}/${m(y,b)}`}},5770:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=a(482),m=a(8742),f=a(5770),b=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,y){this._handlers[k]===void 0&&(this._handlers[k]=[]);const d=this._handlers[k];return d.push(y),{dispose:()=>{const p=d.indexOf(y);p!==-1&&d.splice(p,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(k,y){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(k,y,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(k,y,d);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(k,y,d))}unhook(k,y=!0){if(this._active.length){let d=!1,p=this._active.length-1,h=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=y,h=this._stack.fallThrough,this._stack.paused=!1),!h&&d===!1){for(;p>=0&&(d=this._active[p].unhook(k),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const _=new m.Params;_.addParam(0),s.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=_,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():_,this._data="",this._hitLimit=!1}put(k,y,d){this._hitLimit||(this._data+=(0,c.utf32ToString)(k,y,d),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let y=!1;if(this._hitLimit)y=!1;else if(k&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((d=>(this._params=_,this._data="",this._hitLimit=!1,d)));return this._params=_,this._data="",this._hitLimit=!1,y}}},2015:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=a(844),m=a(8742),f=a(6242),b=a(6351);class _{constructor(p){this.table=new Uint8Array(p)}setDefault(p,h){this.table.fill(p<<4|h)}add(p,h,g,S){this.table[h<<8|p]=g<<4|S}addMany(p,h,g,S){for(let I=0;I<p.length;I++)this.table[h<<8|p[I]]=g<<4|S}}s.TransitionTable=_;const k=160;s.VT500_TRANSITION_TABLE=(function(){const d=new _(4095),p=Array.apply(null,Array(256)).map(((A,E)=>E)),h=(A,E)=>p.slice(A,E),g=h(32,127),S=h(0,24);S.push(25),S.push.apply(S,h(28,32));const I=h(0,14);let C;for(C in d.setDefault(1,0),d.addMany(g,0,2,0),I)d.addMany([24,26,153,154],C,3,0),d.addMany(h(128,144),C,3,0),d.addMany(h(144,152),C,3,0),d.add(156,C,0,0),d.add(27,C,11,1),d.add(157,C,4,8),d.addMany([152,158,159],C,0,7),d.add(155,C,11,3),d.add(144,C,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(g,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(h(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(g,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(h(64,127),3,7,0),d.addMany(h(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(h(48,60),4,8,4),d.addMany(h(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(h(32,64),6,0,6),d.add(127,6,0,6),d.addMany(h(64,127),6,0,0),d.addMany(h(32,48),3,9,5),d.addMany(h(32,48),5,9,5),d.addMany(h(48,64),5,0,6),d.addMany(h(64,127),5,7,0),d.addMany(h(32,48),4,9,5),d.addMany(h(32,48),1,9,2),d.addMany(h(32,48),2,9,2),d.addMany(h(48,127),2,10,0),d.addMany(h(48,80),1,10,0),d.addMany(h(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(h(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(h(28,32),9,0,9),d.addMany(h(32,48),9,9,12),d.addMany(h(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(h(32,128),11,0,11),d.addMany(h(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(h(28,32),10,0,10),d.addMany(h(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(h(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(h(28,32),12,0,12),d.addMany(h(32,48),12,9,12),d.addMany(h(48,64),12,0,11),d.addMany(h(64,127),12,12,13),d.addMany(h(64,127),10,12,13),d.addMany(h(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(g,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(k,0,2,0),d.add(k,8,5,8),d.add(k,6,0,6),d.add(k,11,0,11),d.add(k,13,13,13),d})();class y extends c.Disposable{constructor(p=s.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,g,S)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,g)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,h=[64,126]){let g=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=p.prefix.charCodeAt(0),g&&60>g||g>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let I=0;I<p.intermediates.length;++I){const C=p.intermediates.charCodeAt(I);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=C}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(h[0]>S||S>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return g<<=8,g|=S,g}identToString(p){const h=[];for(;p;)h.push(String.fromCharCode(255&p)),p>>=8;return h.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,h){const g=this._identifier(p,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const S=this._escHandlers[g];return S.push(h),{dispose:()=>{const I=S.indexOf(h);I!==-1&&S.splice(I,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,h){this._executeHandlers[p.charCodeAt(0)]=h}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,h){const g=this._identifier(p);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const S=this._csiHandlers[g];return S.push(h),{dispose:()=>{const I=S.indexOf(h);I!==-1&&S.splice(I,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,h){return this._dcsParser.registerHandler(this._identifier(p),h)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,h){return this._oscParser.registerHandler(p,h)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,h,g,S,I){this._parseStack.state=p,this._parseStack.handlers=h,this._parseStack.handlerPos=g,this._parseStack.transition=S,this._parseStack.chunkPos=I}parse(p,h,g){let S,I=0,C=0,A=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,A=this._parseStack.chunkPos+1;else{if(g===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 N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&N>-1){for(;N>=0&&(S=E[N](this._params),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 4:if(g===!1&&N>-1){for(;N>=0&&(S=E[N](),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 6:if(I=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(I!==24&&I!==26,g),S)return S;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(I=p[this._parseStack.chunkPos],S=this._oscParser.end(I!==24&&I!==26,g),S)return S;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,A=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=A;E<h;++E){switch(I=p[E],C=this._transitions.table[this.currentState<<8|(I<160?I:k)],C>>4){case 2:for(let O=E+1;;++O){if(O>=h||(I=p[O])<32||I>126&&I<k){this._printHandler(p,E,O),E=O-1;break}if(++O>=h||(I=p[O])<32||I>126&&I<k){this._printHandler(p,E,O),E=O-1;break}if(++O>=h||(I=p[O])<32||I>126&&I<k){this._printHandler(p,E,O),E=O-1;break}if(++O>=h||(I=p[O])<32||I>126&&I<k){this._printHandler(p,E,O),E=O-1;break}}break;case 3:this._executeHandlers[I]?this._executeHandlers[I]():this._executeHandlerFb(I),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:I,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|I];let F=N?N.length-1:-1;for(;F>=0&&(S=N[F](this._params),S!==!0);F--)if(S instanceof Promise)return this._preserveStack(3,N,F,C,E),S;F<0&&this._csiHandlerFb(this._collect<<8|I,this._params),this.precedingJoinState=0;break;case 8:do switch(I){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(I-48)}while(++E<h&&(I=p[E])>47&&I<60);E--;break;case 9:this._collect<<=8,this._collect|=I;break;case 10:const U=this._escHandlers[this._collect<<8|I];let P=U?U.length-1:-1;for(;P>=0&&(S=U[P](),S!==!0);P--)if(S instanceof Promise)return this._preserveStack(4,U,P,C,E),S;P<0&&this._escHandlerFb(this._collect<<8|I),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|I,this._params);break;case 13:for(let O=E+1;;++O)if(O>=h||(I=p[O])===24||I===26||I===27||I>127&&I<k){this._dcsParser.put(p,E,O),E=O-1;break}break;case 14:if(S=this._dcsParser.unhook(I!==24&&I!==26),S)return this._preserveStack(6,[],0,C,E),S;I===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 O=E+1;;O++)if(O>=h||(I=p[O])<32||I>127&&I<k){this._oscParser.put(p,E,O),E=O-1;break}break;case 6:if(S=this._oscParser.end(I!==24&&I!==26),S)return this._preserveStack(5,[],0,C,E),S;I===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}s.EscapeSequenceParser=y},6242:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=a(5770),m=a(482),f=[];s.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,_){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(_),{dispose:()=>{const y=k.indexOf(_);y!==-1&&k.splice(y,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,_,k){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(b,_,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(b,_,k))}start(){this.reset(),this._state=1}put(b,_,k){if(this._state!==3){if(this._state===1)for(;_<k;){const y=b[_++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&k-_>0&&this._put(b,_,k)}}end(b,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,k=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&k===!1){for(;y>=0&&(k=this._active[y].end(b),k!==!0);y--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,k;y--}for(;y>=0;y--)if(k=this._active[y].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",b);this._active=f,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,_,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(b,_,k),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let _=!1;if(this._hitLimit)_=!1;else if(b&&(_=this._handler(this._data),_ instanceof Promise))return _.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,_}}},8742:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class c{static fromArray(f){const b=new c;if(!f.length)return b;for(let _=Array.isArray(f[0])?1:0;_<f.length;++_){const k=f[_];if(Array.isArray(k))for(let y=0;y<k.length;++y)b.addSubParam(k[y]);else b.addParam(k)}return b}constructor(f=32,b=32){if(this.maxLength=f,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new c(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let b=0;b<this.length;++b){f.push(this.params[b]);const _=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-_>0&&f.push(Array.prototype.slice.call(this._subParams,_,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>a?a:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>a?a:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const b=this._subParamsIdx[f]>>8,_=255&this._subParamsIdx[f];return _-b>0?this._subParams.subarray(b,_):null}getSubParamsAll(){const f={};for(let b=0;b<this.length;++b){const _=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-_>0&&(f[b]=this._subParams.slice(_,k))}return f}addDigit(f){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,k=_[b-1];_[b-1]=~k?Math.min(10*k+f,a):f}}s.Params=c},5741:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const m={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(m),c.dispose=()=>this._wrappedAddonDispose(m),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===a){c=m;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=a(3785),m=a(511);s.BufferApiView=class{constructor(f,b){this._buffer=f,this.type=b}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const b=this._buffer.lines.get(f);if(b)return new c.BufferLineApiView(b)}getNullCell(){return new m.CellData}}},3785:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=a(511);s.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new c.CellData)}translateToString(m,f,b){return this._line.translateToString(m,f,b)}}},8285:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=a(8771),m=a(8460),f=a(844);class b extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=b},7975:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(m=>c(m.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((m,f)=>c(m,f.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(u,s,a){var c=this&&this.__decorate||function(d,p,h,g){var S,I=arguments.length,C=I<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,p,h,g);else for(var A=d.length-1;A>=0;A--)(S=d[A])&&(C=(I<3?S(C):I>3?S(p,h,C):S(p,h))||C);return I>3&&C&&Object.defineProperty(p,h,C),C},m=this&&this.__param||function(d,p){return function(h,g){p(h,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const f=a(8460),b=a(844),_=a(5295),k=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let y=s.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const h=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===d.fg&&g.getBg(0)===d.bg||(g=h.getBlankLine(d,p),this._cachedBlankLine=g),g.isWrapped=p;const S=h.ybase+h.scrollTop,I=h.ybase+h.scrollBottom;if(h.scrollTop===0){const C=h.lines.isFull;I===h.lines.length-1?C?h.lines.recycle().copyFrom(g):h.lines.push(g.clone()):h.lines.splice(I+1,0,g.clone()),C?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const C=I-S+1;h.lines.shiftElements(S+1,C-1,-1),h.lines.set(I,g.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(d,p,h){const g=this.buffer;if(d<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else d+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const S=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+d,g.ybase),0),S!==g.ydisp&&(p||this._onScroll.fire(g.ydisp))}};s.BufferService=y=c([m(0,k.IOptionsService)],y)},7994:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(u,s,a){var c=this&&this.__decorate||function(g,S,I,C){var A,E=arguments.length,N=E<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,I):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,S,I,C);else for(var F=g.length-1;F>=0;F--)(A=g[F])&&(N=(E<3?A(N):E>3?A(S,I,N):A(S,I))||N);return E>3&&N&&Object.defineProperty(S,I,N),N},m=this&&this.__param||function(g,S){return function(I,C){S(I,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const f=a(2585),b=a(8460),_=a(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function y(g,S){let I=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(I|=64,I|=g.action):(I|=3&g.button,4&g.button&&(I|=64),8&g.button&&(I|=128),g.action===32?I|=32:g.action!==0||S||(I|=3)),I}const d=String.fromCharCode,p={DEFAULT:g=>{const S=[y(g,!1)+32,g.col+32,g.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.col};${g.row}${S}`},SGR_PIXELS:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.x};${g.y}${S}`}};let h=s.CoreMouseService=class extends _.Disposable{constructor(g,S){super(),this._bufferService=g,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const I of Object.keys(k))this.addProtocol(I,k[I]);for(const I of Object.keys(p))this.addEncoding(I,p[I]);this.reset()}addProtocol(g,S){this._protocols[g]=S}addEncoding(g,S){this._encodings[g]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const S=this._encodings[this._activeEncoding](g);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,S,I){if(I){if(g.x!==S.x||g.y!==S.y)return!1}else if(g.col!==S.col||g.row!==S.row)return!1;return g.button===S.button&&g.action===S.action&&g.ctrl===S.ctrl&&g.alt===S.alt&&g.shift===S.shift}};s.CoreMouseService=h=c([m(0,f.IBufferService),m(1,f.ICoreService)],h)},6975:function(u,s,a){var c=this&&this.__decorate||function(h,g,S,I){var C,A=arguments.length,E=A<3?g:I===null?I=Object.getOwnPropertyDescriptor(g,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,g,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(g,S,E):C(g,S))||E);return A>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(h,g){return function(S,I){g(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const f=a(1439),b=a(8460),_=a(844),k=a(2585),y=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=s.CoreService=class extends _.Disposable{constructor(h,g,S){super(),this._bufferService=h,this._logService=g,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(y),this.decPrivateModes=(0,f.clone)(d)}reset(){this.modes=(0,f.clone)(y),this.decPrivateModes=(0,f.clone)(d)}triggerDataEvent(h,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((I=>I.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((g=>g.charCodeAt(0))))),this._onBinary.fire(h))}};s.CoreService=p=c([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],p)},9074:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=a(8055),m=a(8460),f=a(844),b=a(6106);let _=0,k=0;class y extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((h=>h==null?void 0:h.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const g=new d(h);if(g){const S=g.marker.onDispose((()=>g.dispose()));g.onDispose((()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),S.dispose())})),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,g,S){let I=0,C=0;for(const A of this._decorations.getKeyIterator(g))I=A.options.x??0,C=I+(A.options.width??1),h>=I&&h<C&&(!S||(A.options.layer??"bottom")===S)&&(yield A)}forEachDecorationAtCell(h,g,S,I){this._decorations.forEachByKey(g,(C=>{_=C.options.x??0,k=_+(C.options.width??1),h>=_&&h<k&&(!S||(C.options.layer??"bottom")===S)&&I(C)}))}}s.DecorationService=y;class d extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=a(2585),m=a(8343);class f{constructor(..._){this._entries=new Map;for(const[k,y]of _)this.set(k,y)}set(_,k){const y=this._entries.get(_);return this._entries.set(_,k),y}forEach(_){for(const[k,y]of this._entries.entries())_(k,y)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=f,s.InstantiationService=class{constructor(){this._services=new f,this._services.set(c.IInstantiationService,this)}setService(b,_){this._services.set(b,_)}getService(b){return this._services.get(b)}createInstance(b,..._){const k=(0,m.getServiceDependencies)(b).sort(((p,h)=>p.index-h.index)),y=[];for(const p of k){const h=this._services.get(p.id);if(!h)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${p.id}.`);y.push(h)}const d=k.length>0?k[0].index:_.length;if(_.length!==d)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${d+1} conflicts with ${_.length} static arguments`);return new b(..._,...y)}}},7866:function(u,s,a){var c=this&&this.__decorate||function(d,p,h,g){var S,I=arguments.length,C=I<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,p,h,g);else for(var A=d.length-1;A>=0;A--)(S=d[A])&&(C=(I<3?S(C):I>3?S(p,h,C):S(p,h))||C);return I>3&&C&&Object.defineProperty(p,h,C),C},m=this&&this.__param||function(d,p){return function(h,g){p(h,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const f=a(844),b=a(2585),_={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,y=s.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,h){this._evalLazyOptionalParams(h),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...h)}trace(d,...p){var h;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var h;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var h;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var h;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var h;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,d,p)}};s.LogService=y=c([m(0,b.IOptionsService)],y),s.setTraceLogger=function(d){k=d},s.traceCall=function(d,p,h){if(typeof h.value!="function")throw new Error("not supported");const g=h.value;h.value=function(...S){if(k.logLevel!==b.LogLevelEnum.TRACE)return g.apply(this,S);k.trace(`GlyphRenderer#${g.name}(${S.map((C=>JSON.stringify(C))).join(", ")})`);const I=g.apply(this,S);return k.trace(`GlyphRenderer#${g.name} return`,I),I}}},7302:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=a(8460),m=a(844),f=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends m.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...s.DEFAULT_OPTIONS};for(const p in y)if(p in d)try{const h=y[p];d[p]=this._sanitizeAndValidateOption(p,h)}catch(h){console.error(h)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,d){return this.onOptionChange((p=>{p===y&&d(this.rawOptions[y])}))}onMultipleOptionChange(y,d){return this.onOptionChange((p=>{y.indexOf(p)!==-1&&d()}))}_setupOptions(){const y=p=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,h)=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);h=this._sanitizeAndValidateOption(p,h),this.rawOptions[p]!==h&&(this.rawOptions[p]=h,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const h={get:y.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,h)}}_sanitizeAndValidateOption(y,d){switch(y){case"cursorStyle":if(d||(d=s.DEFAULT_OPTIONS[y]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${y}`);break;case"wordSeparator":d||(d=s.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=b.includes(d)?d:s.DEFAULT_OPTIONS[y];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${y} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${y} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}s.OptionsService=_},2660:function(u,s,a){var c=this&&this.__decorate||function(_,k,y,d){var p,h=arguments.length,g=h<3?k:d===null?d=Object.getOwnPropertyDescriptor(k,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(_,k,y,d);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(g=(h<3?p(g):h>3?p(k,y,g):p(k,y))||g);return h>3&&g&&Object.defineProperty(k,y,g),g},m=this&&this.__param||function(_,k){return function(y,d){k(y,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const f=a(2585);let b=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const k=this._bufferService.buffer;if(_.id===void 0){const S=k.addMarker(k.ybase+k.y),I={data:_,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(I,S))),this._dataByLinkId.set(I.id,I),I.id}const y=_,d=this._getEntryIdKey(y),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,k.ybase+k.y),p.id;const h=k.addMarker(k.ybase+k.y),g={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(g,h))),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(_,k){const y=this._dataByLinkId.get(_);if(y&&y.lines.every((d=>d.line!==k))){const d=this._bufferService.buffer.addMarker(k);y.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(y,d)))}}getLinkData(_){var k;return(k=this._dataByLinkId.get(_))==null?void 0:k.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,k){const y=_.lines.indexOf(k);y!==-1&&(_.lines.splice(y,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=b=c([m(0,f.IBufferService)],b)},8343:(u,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const f=function(b,_,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(f,b,k)};return f.toString=()=>m,s.serviceRegistry.set(m,f),f}},2585:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(8343);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(u,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(8460),m=a(225);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,k,y=!1){return(16777215&_)<<3|(3&k)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let k=0,y=0;const d=_.length;for(let p=0;p<d;++p){let h=_.charCodeAt(p);if(55296<=h&&h<=56319){if(++p>=d)return k+this.wcwidth(h);const I=_.charCodeAt(p);56320<=I&&I<=57343?h=1024*(h-55296)+I-56320+65536:k+=this.wcwidth(I)}const g=this.charProperties(h,y);let S=f.extractWidth(g);f.extractShouldJoin(g)&&(S-=f.extractWidth(y)),k+=S,y=g}return k}charProperties(_,k){return this._activeProvider.charProperties(_,k)}}s.UnicodeService=f}},n={};function i(u){var s=n[u];if(s!==void 0)return s.exports;var a=n[u]={exports:{}};return r[u].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const s=i(9042),a=i(3236),c=i(844),m=i(5741),f=i(8285),b=i(7975),_=i(7090),k=["cols","rows"];class y extends c.Disposable{constructor(p){super(),this._core=this.register(new a.Terminal(p)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const h=S=>this._core.options[S],g=(S,I)=>{this._checkReadonlyOptions(S),this._core.options[S]=I};for(const S in this._core.options){const I={get:h.bind(this,S),set:g.bind(this,S)};Object.defineProperty(this._publicOptions,S,I)}}_checkReadonlyOptions(p){if(k.includes(p))throw new Error(`Option "${p}" 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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const h in p)this._publicOptions[h]=p[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,h=!0){this._core.input(p,h)}resize(p,h){this._verifyIntegers(p,h),this._core.resize(p,h)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,h,g){this._verifyIntegers(p,h,g),this._core.select(p,h,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,h){this._verifyIntegers(p,h),this._core.selectLines(p,h)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,h){this._core.write(p,h)}writeln(p,h){this._core.write(p),this._core.write(`\r
|
|
172
|
-
`,h)}paste(p){this._core.paste(p)}refresh(p,h){this._verifyIntegers(p,h),this._core.refresh(p,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return s}_verifyIntegers(...p){for(const h of p)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const h of p)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}
|
|
170
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.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 N=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(O&&P&&N)&&this._areCoordsInSelection(N,O,P)}isCellInSelection(E,N){const O=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!O||!P)&&this._areCoordsInSelection([E,N],O,P)}_areCoordsInSelection(E,N,O){return E[1]>N[1]&&E[1]<O[1]||N[1]===O[1]&&E[1]===N[1]&&E[0]>=N[0]&&E[0]<O[0]||N[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||N[1]<O[1]&&E[1]===N[1]&&E[0]>=N[0]}_selectWordAtCursor(E,N){var O,P;const $=(P=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:P.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(E);return!!D&&(this._selectWordAt(D,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,N){this._model.clearSelection(),E=Math.max(E,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const N=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(E){let N=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=O?0:(N>O&&(N-=O),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(E){return p.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 N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const N=this._getMouseBufferCoords(E);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(E){return E.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const N=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 P=O.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 N=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<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 P=(0,b.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,O=!(!E||!N||E[0]===N[0]&&E[1]===N[1]);O?E&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,N,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,N,O)}_fireOnSelectionChange(E,N,O){this._oldSelectionStart=E,this._oldSelectionEnd=N,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(E,N){let O=N;for(let P=0;N>=P;P++){const $=E.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&N!==P&&(O+=$-1)}return O}setSelection(E,N,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,N],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,N,O=!0,P=!0){if(E[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,D=$.lines.get(E[1]);if(!D)return;const re=$.translateBufferLineToString(E[1],!1);let le=this._convertViewportColToCharacterIndex(D,E[0]),ge=le;const Ie=E[0]-le;let me=0,B=0,U=0,F=0;if(re.charAt(le)===" "){for(;le>0&&re.charAt(le-1)===" ";)le--;for(;ge<re.length&&re.charAt(ge+1)===" ";)ge++}else{let fe=E[0],pe=E[0];D.getWidth(fe)===0&&(me++,fe--),D.getWidth(pe)===2&&(B++,pe++);const _e=D.getString(pe).length;for(_e>1&&(F+=_e-1,ge+=_e-1);fe>0&&le>0&&!this._isCharWordSeparator(D.loadCell(fe-1,this._workCell));){D.loadCell(fe-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(me++,fe--):Y>1&&(U+=Y-1,le-=Y-1),le--,fe--}for(;pe<D.length&&ge+1<re.length&&!this._isCharWordSeparator(D.loadCell(pe+1,this._workCell));){D.loadCell(pe+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,pe++):Y>1&&(F+=Y-1,ge+=Y-1),ge++,pe++}}ge++;let j=le+Ie-me+U,oe=Math.min(this._bufferService.cols,ge-le+me+B-U-F);if(N||re.slice(le,ge).trim()!==""){if(O&&j===0&&D.getCodePoint(0)!==32){const fe=$.lines.get(E[1]-1);if(fe&&D.isWrapped&&fe.getCodePoint(this._bufferService.cols-1)!==32){const pe=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(pe){const _e=this._bufferService.cols-pe.start;j-=_e,oe+=_e}}}if(P&&j+oe===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const fe=$.lines.get(E[1]+1);if(fe!=null&&fe.isWrapped&&fe.getCodePoint(0)!==32){const pe=this._getWordAt([0,E[1]+1],!1,!1,!0);pe&&(oe+=pe.length)}}return{start:j,length:oe}}}_selectWordAt(E,N){const O=this._getWordAt(E,N);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 N=this._getWordAt(E,!0);if(N){let O=E[1];for(;N.start<0;)N.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const N=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(O,this._bufferService.cols)}};s.SelectionService=A=c([g(3,S.IBufferService),g(4,S.ICoreService),g(5,k.IMouseService),g(6,S.IOptionsService),g(7,k.IRenderService),g(8,k.ICoreBrowserService)],A)},4725:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=a(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,s,a){var c=this&&this.__decorate||function(A,E,N,O){var P,$=arguments.length,D=$<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,N):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(A,E,N,O);else for(var re=A.length-1;re>=0;re--)(P=A[re])&&(D=($<3?P(D):$>3?P(E,N,D):P(E,N))||D);return $>3&&D&&Object.defineProperty(E,N,D),D},g=this&&this.__param||function(A,E){return function(N,O){E(N,O,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const f=a(7239),b=a(8055),_=a(8460),k=a(844),y=a(2585),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),h=b.css.toColor("#ffffff"),m=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let N=0;N<216;N++){const O=E[N/36%6|0],P=E[N/6%6|0],$=E[N%6];A.push({css:b.channels.toCss(O,P,$),rgba:b.channels.toRgba(O,P,$)})}for(let N=0;N<24;N++){const O=8+10*N;A.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return A})());let I=s.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:h,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(A={}){const E=this._colors;if(E.foreground=C(A.foreground,d),E.background=C(A.background,p),E.cursor=C(A.cursor,h),E.cursorAccent=C(A.cursorAccent,m),E.selectionBackgroundTransparent=C(A.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=C(A.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=A.selectionForeground?C(A.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=C(A.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=C(A.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=C(A.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=C(A.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=C(A.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=C(A.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=C(A.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=C(A.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=C(A.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=C(A.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=C(A.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=C(A.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=C(A.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=C(A.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=C(A.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=C(A.brightWhite,s.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const N=Math.min(E.ansi.length-16,A.extendedAnsi.length);for(let O=0;O<N;O++)E.ansi[O+16]=C(A.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(A){A(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(A,E){if(A!==void 0)try{return b.css.toColor(A)}catch{}return E}s.ThemeService=I=c([g(0,y.IOptionsService)],I)},6349:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=a(8460),g=a(844);class f extends g.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const k=new Array(_);for(let y=0;y<Math.min(_,this.length);y++)k[y]=this._array[this._getCyclicIndex(y)];this._array=k,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let k=this._length;k<_;k++)this._array[k]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,k){this._array[this._getCyclicIndex(_)]=k}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,k,...y){if(k){for(let d=_;d<this._length-k;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+k)];this._length-=k,this.onDeleteEmitter.fire({index:_,amount:k})}for(let d=this._length-1;d>=_;d--)this._array[this._getCyclicIndex(d+y.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<y.length;d++)this._array[this._getCyclicIndex(_+d)]=y[d];if(y.length&&this.onInsertEmitter.fire({index:_,amount:y.length}),this._length+y.length>this._maxLength){const d=this._length+y.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=y.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,k,y){if(!(k<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=k-1;p>=0;p--)this.set(_+p+y,this.get(_+p));const d=_+k+y-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<k;d++)this.set(_+d+y,this.get(_+d))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=f},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(c,g=5){if(typeof c!="object")return c;const f=Array.isArray(c)?[]:{};for(const b in c)f[b]=g<=1?c[b]:c[b]&&a(c[b],g-1);return f}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,g=0,f=0;var b,_,k,y,d;function p(m){const S=m.toString(16);return S.length<2?"0"+S:S}function h(m,S){return m<S?(S+.05)/(m+.05):(m+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(m){m.toCss=function(S,I,C,A){return A!==void 0?`#${p(S)}${p(I)}${p(C)}${p(A)}`:`#${p(S)}${p(I)}${p(C)}`},m.toRgba=function(S,I,C,A=255){return(S<<24|I<<16|C<<8|A)>>>0},m.toColor=function(S,I,C,A){return{css:m.toCss(S,I,C,A),rgba:m.toRgba(S,I,C,A)}}})(b||(s.channels=b={})),(function(m){function S(I,C){return f=Math.round(255*C),[a,c,g]=d.toChannels(I.rgba),{css:b.toCss(a,c,g,f),rgba:b.toRgba(a,c,g,f)}}m.blend=function(I,C){if(f=(255&C.rgba)/255,f===1)return{css:C.css,rgba:C.rgba};const A=C.rgba>>24&255,E=C.rgba>>16&255,N=C.rgba>>8&255,O=I.rgba>>24&255,P=I.rgba>>16&255,$=I.rgba>>8&255;return a=O+Math.round((A-O)*f),c=P+Math.round((E-P)*f),g=$+Math.round((N-$)*f),{css:b.toCss(a,c,g),rgba:b.toRgba(a,c,g)}},m.isOpaque=function(I){return(255&I.rgba)==255},m.ensureContrastRatio=function(I,C,A){const E=d.ensureContrastRatio(I.rgba,C.rgba,A);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},m.opaque=function(I){const C=(255|I.rgba)>>>0;return[a,c,g]=d.toChannels(C),{css:b.toCss(a,c,g),rgba:C}},m.opacity=S,m.multiplyOpacity=function(I,C){return f=255&I.rgba,S(I,f*C/255)},m.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(_||(s.color=_={})),(function(m){let S,I;try{const C=document.createElement("canvas");C.width=1,C.height=1;const A=C.getContext("2d",{willReadFrequently:!0});A&&(S=A,S.globalCompositeOperation="copy",I=S.createLinearGradient(0,0,1,1))}catch{}m.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),b.toColor(a,c,g);case 5:return a=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),f=parseInt(C.slice(4,5).repeat(2),16),b.toColor(a,c,g,f);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 A=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(A)return a=parseInt(A[1]),c=parseInt(A[2]),g=parseInt(A[3]),f=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),b.toColor(a,c,g,f);if(!S||!I)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=I,S.fillStyle=C,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,g,f]=S.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,g,f),css:C}}})(k||(s.css=k={})),(function(m){function S(I,C,A){const E=I/255,N=C/255,O=A/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}m.relativeLuminance=function(I){return S(I>>16&255,I>>8&255,255&I)},m.relativeLuminance2=S})(y||(s.rgb=y={})),(function(m){function S(C,A,E){const N=C>>24&255,O=C>>16&255,P=C>>8&255;let $=A>>24&255,D=A>>16&255,re=A>>8&255,le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));for(;le<E&&($>0||D>0||re>0);)$-=Math.max(0,Math.ceil(.1*$)),D-=Math.max(0,Math.ceil(.1*D)),re-=Math.max(0,Math.ceil(.1*re)),le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));return($<<24|D<<16|re<<8|255)>>>0}function I(C,A,E){const N=C>>24&255,O=C>>16&255,P=C>>8&255;let $=A>>24&255,D=A>>16&255,re=A>>8&255,le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));for(;le<E&&($<255||D<255||re<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),D=Math.min(255,D+Math.ceil(.1*(255-D))),re=Math.min(255,re+Math.ceil(.1*(255-re))),le=h(y.relativeLuminance2($,D,re),y.relativeLuminance2(N,O,P));return($<<24|D<<16|re<<8|255)>>>0}m.blend=function(C,A){if(f=(255&A)/255,f===1)return A;const E=A>>24&255,N=A>>16&255,O=A>>8&255,P=C>>24&255,$=C>>16&255,D=C>>8&255;return a=P+Math.round((E-P)*f),c=$+Math.round((N-$)*f),g=D+Math.round((O-D)*f),b.toRgba(a,c,g)},m.ensureContrastRatio=function(C,A,E){const N=y.relativeLuminance(C>>8),O=y.relativeLuminance(A>>8);if(h(N,O)<E){if(O<N){const D=S(C,A,E),re=h(N,y.relativeLuminance(D>>8));if(re<E){const le=I(C,A,E);return re>h(N,y.relativeLuminance(le>>8))?D:le}return D}const P=I(C,A,E),$=h(N,y.relativeLuminance(P>>8));if($<E){const D=S(C,A,E);return $>h(N,y.relativeLuminance(D>>8))?P:D}return P}},m.reduceLuminance=S,m.increaseLuminance=I,m.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=h},8969:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=a(844),g=a(2585),f=a(4348),b=a(7866),_=a(744),k=a(7302),y=a(6975),d=a(8460),p=a(1753),h=a(1480),m=a(7994),S=a(9282),I=a(5435),C=a(5981),A=a(2660);let E=!1;class N extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((P=>{var $;($=this._onScrollApi)==null||$.fire(P.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(P){for(const $ in P)this.optionsService.options[$]=P[$]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(P)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(A.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new I.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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(($=>{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(($=>{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((($,D)=>this._inputHandler.parse($,D)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,$){this._writeBuffer.write(P,$)}writeSync(P,$){this._logService.logLevel<=g.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(P,$)}input(P,$=!0){this.coreService.triggerDataEvent(P,$)}resize(P,$){isNaN(P)||isNaN($)||(P=Math.max(P,_.MINIMUM_COLS),$=Math.max($,_.MINIMUM_ROWS),this._bufferService.resize(P,$))}scroll(P,$=!1){this._bufferService.scroll(P,$)}scrollLines(P,$,D){this._bufferService.scrollLines(P,$,D)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const $=P-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(P,$){return this._inputHandler.registerEscHandler(P,$)}registerDcsHandler(P,$){return this._inputHandler.registerDcsHandler(P,$)}registerCsiHandler(P,$){return this._inputHandler.registerCsiHandler(P,$)}registerOscHandler(P,$){return this._inputHandler.registerOscHandler(P,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?P=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const $ of P)$.dispose()}))}}}s.CoreTerminal=N},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((g=>c.fire(g)))},s.runAndSubscribe=function(a,c){return c(void 0),a((g=>c(g)))}},5435:function(l,s,a){var c=this&&this.__decorate||function(me,B,U,F){var j,oe=arguments.length,fe=oe<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,U):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")fe=Reflect.decorate(me,B,U,F);else for(var pe=me.length-1;pe>=0;pe--)(j=me[pe])&&(fe=(oe<3?j(fe):oe>3?j(B,U,fe):j(B,U))||fe);return oe>3&&fe&&Object.defineProperty(B,U,fe),fe},g=this&&this.__param||function(me,B){return function(U,F){B(U,F,me)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const f=a(2584),b=a(7116),_=a(2015),k=a(844),y=a(482),d=a(8437),p=a(8460),h=a(643),m=a(511),S=a(3734),I=a(2585),C=a(1480),A=a(6242),E=a(6351),N=a(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function $(me,B){if(me>24)return B.setWinLines||!1;switch(me){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var D;(function(me){me[me.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",me[me.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let re=0;class le extends k.Disposable{getAttrData(){return this._curAttrData}constructor(B,U,F,j,oe,fe,pe,_e,Y=new _.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=U,this._coreService=F,this._logService=j,this._optionsService=oe,this._oscLinkService=fe,this._coreMouseService=pe,this._unicodeService=_e,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new m.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 ge(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:ie.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,ie,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:ie,data:ae})})),this._parser.setDcsHandlerFallback(((L,ie,ae)=>{ie==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:ie,payload:ae})})),this._parser.setPrintHandler(((L,ie,ae)=>this.print(L,ie,ae))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new A.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new A.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new A.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new A.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new A.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new A.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new A.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new A.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new A.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new A.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new A.OscHandler((L=>this.restoreCursorColor(L)))),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 L in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((L,ie)=>this.requestStatusString(L,ie))))}_preserveStack(B,U,F,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=F,this._parseStack.position=j}_logSlowResolvingAsync(B){this._logService.logLevel<=I.LogLevelEnum.WARN&&Promise.race([B,new Promise(((U,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,U){let F,j=this._activeBuffer.x,oe=this._activeBuffer.y,fe=0;const pe=this._parseStack.paused;if(pe){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(F),F;j=this._parseStack.cursorStartX,oe=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>P&&(fe=this._parseStack.position+P)}if(this._logService.logLevel<=I.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(L=>String.fromCharCode(L))).join("")}"`),typeof B=="string"?B.split("").map((L=>L.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(B.length,P))),pe||this._dirtyRowTracker.clearRange(),B.length>P)for(let L=fe;L<B.length;L+=P){const ie=L+P<B.length?L+P:B.length,ae=typeof B=="string"?this._stringDecoder.decode(B.substring(L,ie),this._parseBuffer):this._utf8Decoder.decode(B.subarray(L,ie),this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(j,oe,ae,L),this._logSlowResolvingAsync(F),F}else if(!pe){const L=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,L))return this._preserveStack(j,oe,L,0),this._logSlowResolvingAsync(F),F}this._activeBuffer.x===j&&this._activeBuffer.y===oe||this._onCursorMove.fire();const _e=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(_e,this._bufferService.rows-1))}print(B,U,F){let j,oe;const fe=this._charsetService.charset,pe=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,ie=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&F-U>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let ke=this._parser.precedingJoinState;for(let he=U;he<F;++he){if(j=B[he],j<127&&fe){const Rt=fe[String.fromCharCode(j)];Rt&&(j=Rt.charCodeAt(0))}const Fe=this._unicodeService.charProperties(j,ke);oe=C.UnicodeService.extractWidth(Fe);const tt=C.UnicodeService.extractShouldJoin(Fe),Xe=tt?C.UnicodeService.extractWidth(ke):0;if(ke=Fe,pe&&this._onA11yChar.fire((0,y.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+oe-Xe>_e){if(Y){const Rt=ae;let Le=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Xe>0&&ae instanceof d.BufferLine&&ae.copyCellsFrom(Rt,Le,0,Xe,!1);Le<_e;)Rt.setCellFromCodepoint(Le++,0,1,ie)}else if(this._activeBuffer.x=_e-1,oe===2)continue}if(tt&&this._activeBuffer.x){const Rt=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-Rt,j,oe);for(let Le=oe-Xe;--Le>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(L&&(ae.insertCells(this._activeBuffer.x,oe-Xe,this._activeBuffer.getNullCell(ie)),ae.getWidth(_e-1)===2&&ae.setCellFromCodepoint(_e-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,ie)),ae.setCellFromCodepoint(this._activeBuffer.x++,j,oe,ie),oe>0)for(;--oe;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=ke,this._activeBuffer.x<_e&&F-U>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,U){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,U):this._parser.registerCsiHandler(B,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||U(F)))}registerDcsHandler(B,U){return this._parser.registerDcsHandler(B,new E.DcsHandler(U))}registerEscHandler(B,U){return this._parser.registerEscHandler(B,U)}registerOscHandler(B,U){return this._parser.registerOscHandler(B,new A.OscHandler(U))}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 B;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&&(B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=B,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+U)}cursorUp(B){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const U=B.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const U=B.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,U,F,j=!1,oe=!1){const fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);fe.replaceCells(U,F,this._activeBuffer.getNullCell(this._eraseAttrData()),oe),j&&(fe.isWrapped=!1)}_resetBufferLine(B,U=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),F.isWrapped=!1)}eraseInDisplay(B,U=!1){let F;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);F<this._bufferService.rows;F++)this._resetBufferLine(F,U);this._dirtyRowTracker.markDirty(F);break;case 1:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,U);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(B,U=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,oe=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;U--;)this._activeBuffer.lines.splice(oe-1,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y;let j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;U--;)this._activeBuffer.lines.splice(F,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let U=B.params[0]||1;for(;U--;)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(B){let U=B.params[0]||1;for(;U--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);j.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);j.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);j.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);j.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const U=this._parser.precedingJoinState;if(!U)return!0;const F=B.params[0]||1,j=C.UnicodeService.extractWidth(U),oe=this._activeBuffer.x-j,fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(oe),pe=new Uint32Array(fe.length*F);let _e=0;for(let L=0;L<fe.length;){const ie=fe.codePointAt(L)||0;pe[_e++]=ie,L+=ie>65535?2:1}let Y=_e;for(let L=1;L<F;++L)pe.copyWithin(Y,0,_e),Y+=_e;return this.print(pe,0,Y),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){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(),B.params[U]===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(B,U){const F=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:oe}=this._coreMouseService,fe=this._coreService,{buffers:pe,cols:_e}=this._bufferService,{active:Y,alt:L}=pe,ie=this._optionsService.rawOptions,ae=tt=>tt?1:2,ke=B.params[0];return he=ke,Fe=U?ke===2?4:ke===4?ae(fe.modes.insertMode):ke===12?3:ke===20?ae(ie.convertEol):0:ke===1?ae(F.applicationCursorKeys):ke===3?ie.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:ke===6?ae(F.origin):ke===7?ae(F.wraparound):ke===8?3:ke===9?ae(j==="X10"):ke===12?ae(ie.cursorBlink):ke===25?ae(!fe.isCursorHidden):ke===45?ae(F.reverseWraparound):ke===66?ae(F.applicationKeypad):ke===67?4:ke===1e3?ae(j==="VT200"):ke===1002?ae(j==="DRAG"):ke===1003?ae(j==="ANY"):ke===1004?ae(F.sendFocus):ke===1005?4:ke===1006?ae(oe==="SGR"):ke===1015?4:ke===1016?ae(oe==="SGR_PIXELS"):ke===1048?1:ke===47||ke===1047||ke===1049?ae(Y===L):ke===2004?ae(F.bracketedPasteMode):0,fe.triggerDataEvent(`${f.C0.ESC}[${U?"":"?"}${he};${Fe}$y`),!0;var he,Fe}_updateAttrColor(B,U,F,j,oe){return U===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([F,j,oe])):U===5&&(B&=-50331904,B|=33554432|255&F),B}_extractColor(B,U,F){const j=[0,0,-1,0,0,0];let oe=0,fe=0;do{if(j[fe+oe]=B.params[U+fe],B.hasSubParams(U+fe)){const pe=B.getSubParams(U+fe);let _e=0;do j[1]===5&&(oe=1),j[fe+_e+1+oe]=pe[_e];while(++_e<pe.length&&_e+fe+1+oe<j.length);break}if(j[1]===5&&fe+oe>=2||j[1]===2&&fe+oe>=5)break;j[1]&&(oe=1)}while(++fe+U<B.length&&fe+oe<j.length);for(let pe=2;pe<j.length;++pe)j[pe]===-1&&(j[pe]=0);switch(j[0]){case 38:F.fg=this._updateAttrColor(F.fg,j[1],j[3],j[4],j[5]);break;case 48:F.bg=this._updateAttrColor(F.bg,j[1],j[3],j[4],j[5]);break;case 58:F.extended=F.extended.clone(),F.extended.underlineColor=this._updateAttrColor(F.extended.underlineColor,j[1],j[3],j[4],j[5])}return fe}_processUnderline(B,U){U.extended=U.extended.clone(),(!~B||B>5)&&(B=1),U.extended.underlineStyle=B,U.fg|=268435456,B===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(B){B.fg=d.DEFAULT_ATTR_DATA.fg,B.bg=d.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=B.length;let F;const j=this._curAttrData;for(let oe=0;oe<U;oe++)F=B.params[oe],F>=30&&F<=37?(j.fg&=-50331904,j.fg|=16777216|F-30):F>=40&&F<=47?(j.bg&=-50331904,j.bg|=16777216|F-40):F>=90&&F<=97?(j.fg&=-50331904,j.fg|=16777224|F-90):F>=100&&F<=107?(j.bg&=-50331904,j.bg|=16777224|F-100):F===0?this._processSGR0(j):F===1?j.fg|=134217728:F===3?j.bg|=67108864:F===4?(j.fg|=268435456,this._processUnderline(B.hasSubParams(oe)?B.getSubParams(oe)[0]:1,j)):F===5?j.fg|=536870912:F===7?j.fg|=67108864:F===8?j.fg|=1073741824:F===9?j.fg|=2147483648:F===2?j.bg|=134217728:F===21?this._processUnderline(2,j):F===22?(j.fg&=-134217729,j.bg&=-134217729):F===23?j.bg&=-67108865:F===24?(j.fg&=-268435457,this._processUnderline(0,j)):F===25?j.fg&=-536870913:F===27?j.fg&=-67108865:F===28?j.fg&=-1073741825:F===29?j.fg&=2147483647:F===39?(j.fg&=-67108864,j.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):F===49?(j.bg&=-67108864,j.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?oe+=this._extractColor(B,oe,j):F===53?j.bg|=1073741824:F===55?j.bg&=-1073741825:F===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):F===100?(j.fg&=-67108864,j.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${U};${F}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const U=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${U};${F}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(B){const U=B.params[0]||1;switch(U){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 F=U%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(B){const U=B.params[0]||1;let F;return(B.length<2||(F=B.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(B){if(!$(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const U=[],F=B.split(";");for(;F.length>1;){const j=F.shift(),oe=F.shift();if(/^\d+$/.exec(j)){const fe=parseInt(j);if(Ie(fe))if(oe==="?")U.push({type:0,index:fe});else{const pe=(0,N.parseColor)(oe);pe&&U.push({type:1,index:fe,color:pe})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(B){const U=B.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(B,U){this._getCurrentLinkId()&&this._finishHyperlink();const F=B.split(":");let j;const oe=F.findIndex((fe=>fe.startsWith("id=")));return oe!==-1&&(j=F[oe].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,U){const F=B.split(";");for(let j=0;j<F.length&&!(U>=this._specialColors.length);++j,++U)if(F[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const oe=(0,N.parseColor)(F[j]);oe&&this._onColor.fire([{type:1,index:this._specialColors[U],color:oe}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const U=[],F=B.split(";");for(let j=0;j<F.length;++j)if(/^\d+$/.exec(F[j])){const oe=parseInt(F[j]);Ie(oe)&&U.push({type:2,index:oe})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,b.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(O[B[0]],b.CHARSETS[B[1]]||b.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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new m.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const F=this._activeBuffer.ybase+this._activeBuffer.y+U,j=this._activeBuffer.lines.get(F);j&&(j.fill(B),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,U){const F=this._bufferService.buffer,j=this._optionsService.rawOptions;return(oe=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${oe}${f.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,U){this._dirtyRowTracker.markRangeDirty(B,U)}}s.InputHandler=le;let ge=class{constructor(me){this._bufferService=me,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(me){me<this.start?this.start=me:me>this.end&&(this.end=me)}markRangeDirty(me,B){me>B&&(re=me,me=B,B=re),me<this.start&&(this.start=me),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Ie(me){return 0<=me&&me<256}ge=c([g(0,I.IBufferService)],ge)},844:(l,s)=>{function a(c){for(const g of c)g.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const g=this._disposables.indexOf(c);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var g;this._isDisposed||c===this._value||((g=this._value)==null||g.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,f,b){this._data[g]||(this._data[g]={}),this._data[g][f]=b}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,g,f,b,_){this._data.get(c,g)||this._data.set(c,g,new a),this._data.get(c,g).set(f,b,_)}get(c,g,f,b){var _;return(_=this._data.get(c,g))==null?void 0:_.get(f,b)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const g=this._getKey(c);if(g===void 0||(a=this._search(g),a===-1)||this._getKey(this._array[a])!==g)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===g);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,g){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do g(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let g=0,f=this._array.length-1;for(;f>=g;){let b=g+f>>1;const _=this._getKey(this._array[b]);if(_>c)f=b-1;else{if(!(_<c)){for(;b>0&&this._getKey(this._array[b-1])===c;)b--;return b}g=b+1}}return g}}},7226:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let k=0,y=0,d=_.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),y=Math.max(k,y),p=_.timeRemaining(),1.5*y>p)return d-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-k))}ms`),void this._start();d=p}this.clear()}}class f extends g{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const k=Date.now()+_;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}s.PriorityTaskQueue=f,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:f,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=a(643);s.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),b=f==null?void 0:f.get(g.cols-1),_=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);_&&b&&(_.isWrapped=b[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&b[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new a;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,b=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=b}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=a(6349),g=a(7226),f=a(3734),b=a(8437),_=a(4634),k=a(511),y=a(643),d=a(4863),p=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(h,m,S){this._hasScrollback=h,this._optionsService=m,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,m){return new b.BufferLine(this._bufferService.cols,this.getNullCell(h),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const m=h+this._optionsService.rawOptions.scrollback;return m>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:m}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=b.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,m){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let I=0;const C=this._getCorrectBufferLength(m);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<h)for(let E=0;E<this.lines.length;E++)I+=+this.lines.get(E).resize(h,S);let A=0;if(this._rows<m)for(let E=this._rows;E<m;E++)this.lines.length<m+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(h,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+A+1?(this.ybase--,A++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(h,S)));else for(let E=this._rows;E>m;E--)this.lines.length>m+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,h-1),this.y=Math.min(this.y,m-1),A&&(this.y+=A),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(h,m),this._cols>h))for(let A=0;A<this.lines.length;A++)I+=+this.lines.get(A).resize(h,S);this._cols=h,this._rows=m,this._memoryCleanupQueue.clear(),I>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,m){this._cols!==h&&(h>this._cols?this._reflowLarger(h,m):this._reflowSmaller(h,m))}_reflowLarger(h,m){const S=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const I=(0,_.reflowLargerCreateNewLayout)(this.lines,S);(0,_.reflowLargerApplyNewLayout)(this.lines,I.layout),this._reflowLargerAdjustViewport(h,m,I.countRemoved)}}_reflowLargerAdjustViewport(h,m,S){const I=this.getNullCell(b.DEFAULT_ATTR_DATA);let C=S;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new b.BufferLine(h,I))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(h,m){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),I=[];let C=0;for(let A=this.lines.length-1;A>=0;A--){let E=this.lines.get(A);if(!E||!E.isWrapped&&E.getTrimmedLength()<=h)continue;const N=[E];for(;E.isWrapped&&A>0;)E=this.lines.get(--A),N.unshift(E);const O=this.ybase+this.y;if(O>=A&&O<A+N.length)continue;const P=N[N.length-1].getTrimmedLength(),$=(0,_.reflowSmallerGetNewLineLengths)(N,this._cols,h),D=$.length-N.length;let re;re=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const le=[];for(let F=0;F<D;F++){const j=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);le.push(j)}le.length>0&&(I.push({start:A+N.length+C,newLines:le}),C+=le.length),N.push(...le);let ge=$.length-1,Ie=$[ge];Ie===0&&(ge--,Ie=$[ge]);let me=N.length-D-1,B=P;for(;me>=0;){const F=Math.min(B,Ie);if(N[ge]===void 0)break;if(N[ge].copyCellsFrom(N[me],B-F,Ie-F,F,!0),Ie-=F,Ie===0&&(ge--,Ie=$[ge]),B-=F,B===0){me--;const j=Math.max(me,0);B=(0,_.getWrappedLineTrimmedLength)(N,j,this._cols)}}for(let F=0;F<N.length;F++)$[F]<h&&N[F].setCell($[F],S);let U=D-re;for(;U-- >0;)this.ybase===0?this.y<m-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+m-1)}if(I.length>0){const A=[],E=[];for(let ge=0;ge<this.lines.length;ge++)E.push(this.lines.get(ge));const N=this.lines.length;let O=N-1,P=0,$=I[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let D=0;for(let ge=Math.min(this.lines.maxLength-1,N+C-1);ge>=0;ge--)if($&&$.start>O+D){for(let Ie=$.newLines.length-1;Ie>=0;Ie--)this.lines.set(ge--,$.newLines[Ie]);ge++,A.push({index:O+1,amount:$.newLines.length}),D+=$.newLines.length,$=I[++P]}else this.lines.set(ge,E[O--]);let re=0;for(let ge=A.length-1;ge>=0;ge--)A[ge].index+=re,this.lines.onInsertEmitter.fire(A[ge]),re+=A[ge].amount;const le=Math.max(0,N+C-this.lines.maxLength);le>0&&this.lines.onTrimEmitter.fire(le)}}translateBufferLineToString(h,m,S=0,I){const C=this.lines.get(h);return C?C.translateToString(m,S,I):""}getWrappedRangeForLine(h){let m=h,S=h;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:m,last:S}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===h&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const m=new d.Marker(h);return this.markers.push(m),m.register(this.lines.onTrim((S=>{m.line-=S,m.line<0&&m.dispose()}))),m.register(this.lines.onInsert((S=>{m.line>=S.index&&(m.line+=S.amount)}))),m.register(this.lines.onDelete((S=>{m.line>=S.index&&m.line<S.index+S.amount&&m.dispose(),m.line>S.index&&(m.line-=S.amount)}))),m.register(m.onDispose((()=>this._removeMarker(m)))),m}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=a(3734),g=a(511),f=a(643),b=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class k{constructor(d,p,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const m=p||g.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,m);this.length=d}get(d){const p=this._data[3*d+0],h=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:h?(0,b.stringFromCodePoint)(h):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):h]}set(d,p){this._data[3*d+1]=p[f.CHAR_DATA_ATTR_INDEX],p[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,b.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return _=3*d,p.content=this._data[_+0],p.fg=this._data[_+1],p.bg=this._data[_+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,h,m){268435456&m.bg&&(this._extendedAttrs[d]=m.extended),this._data[3*d+0]=p|h<<22,this._data[3*d+1]=m.fg,this._data[3*d+2]=m.bg}addCodepointToCell(d,p,h){let m=this._data[3*d+0];2097152&m?this._combined[d]+=(0,b.stringFromCodePoint)(p):2097151&m?(this._combined[d]=(0,b.stringFromCodePoint)(2097151&m)+(0,b.stringFromCodePoint)(p),m&=-2097152,m|=2097152):m=p|4194304,h&&(m&=-12582913,m|=h<<22),this._data[3*d+0]=m}insertCells(d,p,h){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length-d){const m=new g.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,m));for(let S=0;S<p;++S)this.setCell(d+S,h)}else for(let m=d;m<this.length;++m)this.setCell(m,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(d,p,h){if(d%=this.length,p<this.length-d){const m=new g.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,m));for(let S=this.length-p;S<this.length;++S)this.setCell(S,h)}else for(let m=d;m<this.length;++m)this.setCell(m,h);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,h)}replaceCells(d,p,h,m=!1){if(m)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,h);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,h),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,h),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,h);d<p&&d<this.length;)this.setCell(d++,h)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const m=new Uint32Array(h);m.set(this._data),this._data=m}for(let m=this.length;m<d;++m)this.setCell(m,p)}else{this._data=this._data.subarray(0,h);const m=Object.keys(this._combined);for(let I=0;I<m.length;I++){const C=parseInt(m[I],10);C>=d&&delete this._combined[C]}const S=Object.keys(this._extendedAttrs);for(let I=0;I<S.length;I++){const C=parseInt(S[I],10);C>=d&&delete this._extendedAttrs[C]}}return this.length=d,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,d);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new k(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,h,m,S){const I=d._data;if(S)for(let A=m-1;A>=0;A--){for(let E=0;E<3;E++)this._data[3*(h+A)+E]=I[3*(p+A)+E];268435456&I[3*(p+A)+2]&&(this._extendedAttrs[h+A]=d._extendedAttrs[p+A])}else for(let A=0;A<m;A++){for(let E=0;E<3;E++)this._data[3*(h+A)+E]=I[3*(p+A)+E];268435456&I[3*(p+A)+2]&&(this._extendedAttrs[h+A]=d._extendedAttrs[p+A])}const C=Object.keys(d._combined);for(let A=0;A<C.length;A++){const E=parseInt(C[A],10);E>=p&&(this._combined[E-p+h]=d._combined[E])}}translateToString(d,p,h,m){p=p??0,h=h??this.length,d&&(h=Math.min(h,this.getTrimmedLength())),m&&(m.length=0);let S="";for(;p<h;){const I=this._data[3*p+0],C=2097151&I,A=2097152&I?this._combined[p]:C?(0,b.stringFromCodePoint)(C):f.WHITESPACE_CELL_CHAR;if(S+=A,m)for(let E=0;E<A.length;++E)m.push(p);p+=I>>22||1}return m&&m.push(p),S}}s.BufferLine=k},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(l,s)=>{function a(c,g,f){if(g===c.length-1)return c[g].getTrimmedLength();const b=!c[g].hasContent(f-1)&&c[g].getWidth(f-1)===1,_=c[g+1].getWidth(0)===2;return b&&_?f-1:f}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,g,f,b,_){const k=[];for(let y=0;y<c.length-1;y++){let d=y,p=c.get(++d);if(!p.isWrapped)continue;const h=[c.get(y)];for(;d<c.length&&p.isWrapped;)h.push(p),p=c.get(++d);if(b>=y&&b<d){y+=h.length-1;continue}let m=0,S=a(h,m,g),I=1,C=0;for(;I<h.length;){const E=a(h,I,g),N=E-C,O=f-S,P=Math.min(N,O);h[m].copyCellsFrom(h[I],C,S,P,!1),S+=P,S===f&&(m++,S=0),C+=P,C===E&&(I++,C=0),S===0&&m!==0&&h[m-1].getWidth(f-1)===2&&(h[m].copyCellsFrom(h[m-1],f-1,S++,1,!1),h[m-1].setCell(f-1,_))}h[m].replaceCells(S,f,_);let A=0;for(let E=h.length-1;E>0&&(E>m||h[E].getTrimmedLength()===0);E--)A++;A>0&&(k.push(y+h.length-A),k.push(A)),y+=h.length-1}return k},s.reflowLargerCreateNewLayout=function(c,g){const f=[];let b=0,_=g[b],k=0;for(let y=0;y<c.length;y++)if(_===y){const d=g[++b];c.onDeleteEmitter.fire({index:y-k,amount:d}),y+=d-1,k+=d,_=g[++b]}else f.push(y);return{layout:f,countRemoved:k}},s.reflowLargerApplyNewLayout=function(c,g){const f=[];for(let b=0;b<g.length;b++)f.push(c.get(g[b]));for(let b=0;b<f.length;b++)c.set(b,f[b]);c.length=g.length},s.reflowSmallerGetNewLineLengths=function(c,g,f){const b=[],_=c.map(((p,h)=>a(c,h,g))).reduce(((p,h)=>p+h));let k=0,y=0,d=0;for(;d<_;){if(_-d<f){b.push(_-d);break}k+=f;const p=a(c,y,g);k>p&&(k-=p,y++);const h=c[y].getWidth(k-1)===2;h&&k--;const m=h?f-1:f;b.push(m),d+=m}return b},s.getWrappedLineTrimmedLength=a},5295:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=a(8460),g=a(844),f=a(9092);class b extends g.Disposable{constructor(k,y){super(),this._optionsService=k,this._bufferService=y,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,y){this._normal.resize(k,y),this._alt.resize(k,y),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}s.BufferSet=b},511:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(482),g=a(643),f=a(3734);class b extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const y=new b;return y.setFromCharData(k),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(k[g.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(k[g.CHAR_DATA_CHAR_INDEX].length===2){const d=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|k[g.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[g.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=k[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=b},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=a(8460),g=a(844);class f{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=f,f._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var a,c,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
171
|
+
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(a||(s.C0=a={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(c||(s.C1=c={})),(function(f){f.ST=`${a.ESC}\\`})(g||(s.C1_ESCAPED=g={}))},7399:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=a(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(f,b,_,k){const y={type:0,cancel:!1,key:void 0},d=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=f.ctrlKey?"\b":c.C0.DEL,f.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(f.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=f.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,f.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(_?"b":"[1;5D"))):y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(_?"f":"[1;5C"))):y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"A",_||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(f.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"B",_||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=d?c.C0.ESC+"[3;"+(d+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=d?c.C0.ESC+"[1;"+(d+1)+"H":b?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=d?c.C0.ESC+"[1;"+(d+1)+"F":b?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:f.shiftKey?y.type=2:f.ctrlKey?y.key=c.C0.ESC+"[5;"+(d+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:f.shiftKey?y.type=3:f.ctrlKey?y.key=c.C0.ESC+"[6;"+(d+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=d?c.C0.ESC+"[1;"+(d+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=d?c.C0.ESC+"[1;"+(d+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=d?c.C0.ESC+"[1;"+(d+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=d?c.C0.ESC+"[1;"+(d+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=d?c.C0.ESC+"[15;"+(d+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=d?c.C0.ESC+"[17;"+(d+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=d?c.C0.ESC+"[18;"+(d+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=d?c.C0.ESC+"[19;"+(d+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=d?c.C0.ESC+"[20;"+(d+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=d?c.C0.ESC+"[21;"+(d+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=d?c.C0.ESC+"[23;"+(d+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=d?c.C0.ESC+"[24;"+(d+1)+"~":c.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(_&&!k||!f.altKey||f.metaKey)!_||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?y.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(y.key=c.C0.US),f.key==="@"&&(y.key=c.C0.NUL)):f.keyCode===65&&(y.type=1);else{const p=g[f.keyCode],h=p==null?void 0:p[f.shiftKey?1:0];if(h)y.key=c.C0.ESC+h;else if(f.keyCode>=65&&f.keyCode<=90){const m=f.ctrlKey?f.keyCode-64:f.keyCode+32;let S=String.fromCharCode(m);f.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(f.keyCode===32)y.key=c.C0.ESC+(f.ctrlKey?c.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let m=f.code.slice(3,4);f.shiftKey||(m=m.toLowerCase()),y.key=c.C0.ESC+m,y.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?y.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?y.key=c.C0.NUL:f.keyCode>=51&&f.keyCode<=55?y.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?y.key=c.C0.DEL:f.keyCode===219?y.key=c.C0.ESC:f.keyCode===220?y.key=c.C0.FS:f.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,g=a.length){let f="";for(let b=c;b<g;++b){let _=a[b];_>65535?(_-=65536,f+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):f+=String.fromCharCode(_)}return f},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const g=a.length;if(!g)return 0;let f=0,b=0;if(this._interim){const _=a.charCodeAt(b++);56320<=_&&_<=57343?c[f++]=1024*(this._interim-55296)+_-56320+65536:(c[f++]=this._interim,c[f++]=_),this._interim=0}for(let _=b;_<g;++_){const k=a.charCodeAt(_);if(55296<=k&&k<=56319){if(++_>=g)return this._interim=k,f;const y=a.charCodeAt(_);56320<=y&&y<=57343?c[f++]=1024*(k-55296)+y-56320+65536:(c[f++]=k,c[f++]=y)}else k!==65279&&(c[f++]=k)}return f}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const g=a.length;if(!g)return 0;let f,b,_,k,y=0,d=0,p=0;if(this.interim[0]){let S=!1,I=this.interim[0];I&=(224&I)==192?31:(240&I)==224?15:7;let C,A=0;for(;(C=63&this.interim[++A])&&A<4;)I<<=6,I|=C;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=E-A;for(;p<N;){if(p>=g)return 0;if(C=a[p++],(192&C)!=128){p--,S=!0;break}this.interim[A++]=C,I<<=6,I|=63&C}S||(E===2?I<128?p--:c[y++]=I:E===3?I<2048||I>=55296&&I<=57343||I===65279||(c[y++]=I):I<65536||I>1114111||(c[y++]=I)),this.interim.fill(0)}const h=g-4;let m=p;for(;m<g;){for(;!(!(m<h)||128&(f=a[m])||128&(b=a[m+1])||128&(_=a[m+2])||128&(k=a[m+3]));)c[y++]=f,c[y++]=b,c[y++]=_,c[y++]=k,m+=4;if(f=a[m++],f<128)c[y++]=f;else if((224&f)==192){if(m>=g)return this.interim[0]=f,y;if(b=a[m++],(192&b)!=128){m--;continue}if(d=(31&f)<<6|63&b,d<128){m--;continue}c[y++]=d}else if((240&f)==224){if(m>=g)return this.interim[0]=f,y;if(b=a[m++],(192&b)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=b,y;if(_=a[m++],(192&_)!=128){m--;continue}if(d=(15&f)<<12|(63&b)<<6|63&_,d<2048||d>=55296&&d<=57343||d===65279)continue;c[y++]=d}else if((248&f)==240){if(m>=g)return this.interim[0]=f,y;if(b=a[m++],(192&b)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=b,y;if(_=a[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=f,this.interim[1]=b,this.interim[2]=_,y;if(k=a[m++],(192&k)!=128){m--;continue}if(d=(7&f)<<18|(63&b)<<12|(63&_)<<6|63&k,d<65536||d>1114111)continue;c[y++]=d}}return y}}},225:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<g.length;++_)b.fill(0,g[_][0],g[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(k,y){let d,p=0,h=y.length-1;if(k<y[0][0]||k>y[h][1])return!1;for(;h>=p;)if(d=p+h>>1,k>y[d][1])p=d+1;else{if(!(k<y[d][0]))return!0;h=d-1}return!1})(_,f)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,k){let y=this.wcwidth(_),d=y===0&&k!==0;if(d){const p=c.UnicodeService.extractWidth(k);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},5981:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=a(8460),g=a(844);class f extends g.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(k)}_innerWrite(_=0,k=!0){const y=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,k);if(p){const m=S=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(y,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(m)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=f},5941:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function g(f,b){const _=f.toString(16),k=_.length<2?"0"+_:_;switch(b){case 4:return _[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}s.parseColor=function(f){if(!f)return;let b=f.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const _=a.exec(b);if(_){const k=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/k*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/k*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/k*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),c.exec(b)&&[3,6,9,12].includes(b.length))){const _=b.length/3,k=[0,0,0];for(let y=0;y<3;++y){const d=parseInt(b.slice(_*y,_*y+_),16);k[y]=_===1?d<<4:_===2?d:_===3?d>>4:d>>8}return k}},s.toRgbString=function(f,b=16){const[_,k,y]=f;return`rgb:${g(_,b)}/${g(k,b)}/${g(y,b)}`}},5770:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=a(482),g=a(8742),f=a(5770),b=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,y){this._handlers[k]===void 0&&(this._handlers[k]=[]);const d=this._handlers[k];return d.push(y),{dispose:()=>{const p=d.indexOf(y);p!==-1&&d.splice(p,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(k,y){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(k,y,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(k,y,d);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(k,y,d))}unhook(k,y=!0){if(this._active.length){let d=!1,p=this._active.length-1,h=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=y,h=this._stack.fallThrough,this._stack.paused=!1),!h&&d===!1){for(;p>=0&&(d=this._active[p].unhook(k),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const _=new g.Params;_.addParam(0),s.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=_,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():_,this._data="",this._hitLimit=!1}put(k,y,d){this._hitLimit||(this._data+=(0,c.utf32ToString)(k,y,d),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let y=!1;if(this._hitLimit)y=!1;else if(k&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((d=>(this._params=_,this._data="",this._hitLimit=!1,d)));return this._params=_,this._data="",this._hitLimit=!1,y}}},2015:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=a(844),g=a(8742),f=a(6242),b=a(6351);class _{constructor(p){this.table=new Uint8Array(p)}setDefault(p,h){this.table.fill(p<<4|h)}add(p,h,m,S){this.table[h<<8|p]=m<<4|S}addMany(p,h,m,S){for(let I=0;I<p.length;I++)this.table[h<<8|p[I]]=m<<4|S}}s.TransitionTable=_;const k=160;s.VT500_TRANSITION_TABLE=(function(){const d=new _(4095),p=Array.apply(null,Array(256)).map(((A,E)=>E)),h=(A,E)=>p.slice(A,E),m=h(32,127),S=h(0,24);S.push(25),S.push.apply(S,h(28,32));const I=h(0,14);let C;for(C in d.setDefault(1,0),d.addMany(m,0,2,0),I)d.addMany([24,26,153,154],C,3,0),d.addMany(h(128,144),C,3,0),d.addMany(h(144,152),C,3,0),d.add(156,C,0,0),d.add(27,C,11,1),d.add(157,C,4,8),d.addMany([152,158,159],C,0,7),d.add(155,C,11,3),d.add(144,C,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(m,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(h(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(m,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(h(64,127),3,7,0),d.addMany(h(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(h(48,60),4,8,4),d.addMany(h(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(h(32,64),6,0,6),d.add(127,6,0,6),d.addMany(h(64,127),6,0,0),d.addMany(h(32,48),3,9,5),d.addMany(h(32,48),5,9,5),d.addMany(h(48,64),5,0,6),d.addMany(h(64,127),5,7,0),d.addMany(h(32,48),4,9,5),d.addMany(h(32,48),1,9,2),d.addMany(h(32,48),2,9,2),d.addMany(h(48,127),2,10,0),d.addMany(h(48,80),1,10,0),d.addMany(h(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(h(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(h(28,32),9,0,9),d.addMany(h(32,48),9,9,12),d.addMany(h(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(h(32,128),11,0,11),d.addMany(h(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(h(28,32),10,0,10),d.addMany(h(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(h(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(h(28,32),12,0,12),d.addMany(h(32,48),12,9,12),d.addMany(h(48,64),12,0,11),d.addMany(h(64,127),12,12,13),d.addMany(h(64,127),10,12,13),d.addMany(h(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(m,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(k,0,2,0),d.add(k,8,5,8),d.add(k,6,0,6),d.add(k,11,0,11),d.add(k,13,13,13),d})();class y extends c.Disposable{constructor(p=s.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,m,S)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,m)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,h=[64,126]){let m=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=p.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let I=0;I<p.intermediates.length;++I){const C=p.intermediates.charCodeAt(I);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=C}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(h[0]>S||S>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return m<<=8,m|=S,m}identToString(p){const h=[];for(;p;)h.push(String.fromCharCode(255&p)),p>>=8;return h.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,h){const m=this._identifier(p,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const S=this._escHandlers[m];return S.push(h),{dispose:()=>{const I=S.indexOf(h);I!==-1&&S.splice(I,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,h){this._executeHandlers[p.charCodeAt(0)]=h}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,h){const m=this._identifier(p);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const S=this._csiHandlers[m];return S.push(h),{dispose:()=>{const I=S.indexOf(h);I!==-1&&S.splice(I,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,h){return this._dcsParser.registerHandler(this._identifier(p),h)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,h){return this._oscParser.registerHandler(p,h)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,h,m,S,I){this._parseStack.state=p,this._parseStack.handlers=h,this._parseStack.handlerPos=m,this._parseStack.transition=S,this._parseStack.chunkPos=I}parse(p,h,m){let S,I=0,C=0,A=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,A=this._parseStack.chunkPos+1;else{if(m===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 N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&N>-1){for(;N>=0&&(S=E[N](this._params),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 4:if(m===!1&&N>-1){for(;N>=0&&(S=E[N](),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 6:if(I=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(I!==24&&I!==26,m),S)return S;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(I=p[this._parseStack.chunkPos],S=this._oscParser.end(I!==24&&I!==26,m),S)return S;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,A=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=A;E<h;++E){switch(I=p[E],C=this._transitions.table[this.currentState<<8|(I<160?I:k)],C>>4){case 2:for(let D=E+1;;++D){if(D>=h||(I=p[D])<32||I>126&&I<k){this._printHandler(p,E,D),E=D-1;break}if(++D>=h||(I=p[D])<32||I>126&&I<k){this._printHandler(p,E,D),E=D-1;break}if(++D>=h||(I=p[D])<32||I>126&&I<k){this._printHandler(p,E,D),E=D-1;break}if(++D>=h||(I=p[D])<32||I>126&&I<k){this._printHandler(p,E,D),E=D-1;break}}break;case 3:this._executeHandlers[I]?this._executeHandlers[I]():this._executeHandlerFb(I),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:I,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|I];let O=N?N.length-1:-1;for(;O>=0&&(S=N[O](this._params),S!==!0);O--)if(S instanceof Promise)return this._preserveStack(3,N,O,C,E),S;O<0&&this._csiHandlerFb(this._collect<<8|I,this._params),this.precedingJoinState=0;break;case 8:do switch(I){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(I-48)}while(++E<h&&(I=p[E])>47&&I<60);E--;break;case 9:this._collect<<=8,this._collect|=I;break;case 10:const P=this._escHandlers[this._collect<<8|I];let $=P?P.length-1:-1;for(;$>=0&&(S=P[$](),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(4,P,$,C,E),S;$<0&&this._escHandlerFb(this._collect<<8|I),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|I,this._params);break;case 13:for(let D=E+1;;++D)if(D>=h||(I=p[D])===24||I===26||I===27||I>127&&I<k){this._dcsParser.put(p,E,D),E=D-1;break}break;case 14:if(S=this._dcsParser.unhook(I!==24&&I!==26),S)return this._preserveStack(6,[],0,C,E),S;I===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 D=E+1;;D++)if(D>=h||(I=p[D])<32||I>127&&I<k){this._oscParser.put(p,E,D),E=D-1;break}break;case 6:if(S=this._oscParser.end(I!==24&&I!==26),S)return this._preserveStack(5,[],0,C,E),S;I===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}s.EscapeSequenceParser=y},6242:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=a(5770),g=a(482),f=[];s.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,_){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(_),{dispose:()=>{const y=k.indexOf(_);y!==-1&&k.splice(y,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,_,k){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(b,_,k);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(b,_,k))}start(){this.reset(),this._state=1}put(b,_,k){if(this._state!==3){if(this._state===1)for(;_<k;){const y=b[_++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&k-_>0&&this._put(b,_,k)}}end(b,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,k=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&k===!1){for(;y>=0&&(k=this._active[y].end(b),k!==!0);y--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,k;y--}for(;y>=0;y--)if(k=this._active[y].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",b);this._active=f,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,_,k){this._hitLimit||(this._data+=(0,g.utf32ToString)(b,_,k),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let _=!1;if(this._hitLimit)_=!1;else if(b&&(_=this._handler(this._data),_ instanceof Promise))return _.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,_}}},8742:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class c{static fromArray(f){const b=new c;if(!f.length)return b;for(let _=Array.isArray(f[0])?1:0;_<f.length;++_){const k=f[_];if(Array.isArray(k))for(let y=0;y<k.length;++y)b.addSubParam(k[y]);else b.addParam(k)}return b}constructor(f=32,b=32){if(this.maxLength=f,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new c(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let b=0;b<this.length;++b){f.push(this.params[b]);const _=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-_>0&&f.push(Array.prototype.slice.call(this._subParams,_,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>a?a:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>a?a:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const b=this._subParamsIdx[f]>>8,_=255&this._subParamsIdx[f];return _-b>0?this._subParams.subarray(b,_):null}getSubParamsAll(){const f={};for(let b=0;b<this.length;++b){const _=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-_>0&&(f[b]=this._subParams.slice(_,k))}return f}addDigit(f){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,k=_[b-1];_[b-1]=~k?Math.min(10*k+f,a):f}}s.Params=c},5741:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const g={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(g),c.dispose=()=>this._wrappedAddonDispose(g),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===a){c=g;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=a(3785),g=a(511);s.BufferApiView=class{constructor(f,b){this._buffer=f,this.type=b}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const b=this._buffer.lines.get(f);if(b)return new c.BufferLineApiView(b)}getNullCell(){return new g.CellData}}},3785:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=a(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new c.CellData)}translateToString(g,f,b){return this._line.translateToString(g,f,b)}}},8285:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=a(8771),g=a(8460),f=a(844);class b extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=b},7975:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(g=>c(g.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((g,f)=>c(g,f.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(l,s,a){var c=this&&this.__decorate||function(d,p,h,m){var S,I=arguments.length,C=I<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,p,h,m);else for(var A=d.length-1;A>=0;A--)(S=d[A])&&(C=(I<3?S(C):I>3?S(p,h,C):S(p,h))||C);return I>3&&C&&Object.defineProperty(p,h,C),C},g=this&&this.__param||function(d,p){return function(h,m){p(h,m,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const f=a(8460),b=a(844),_=a(5295),k=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let y=s.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const h=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===d.fg&&m.getBg(0)===d.bg||(m=h.getBlankLine(d,p),this._cachedBlankLine=m),m.isWrapped=p;const S=h.ybase+h.scrollTop,I=h.ybase+h.scrollBottom;if(h.scrollTop===0){const C=h.lines.isFull;I===h.lines.length-1?C?h.lines.recycle().copyFrom(m):h.lines.push(m.clone()):h.lines.splice(I+1,0,m.clone()),C?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const C=I-S+1;h.lines.shiftElements(S+1,C-1,-1),h.lines.set(I,m.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(d,p,h){const m=this.buffer;if(d<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else d+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const S=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+d,m.ybase),0),S!==m.ydisp&&(p||this._onScroll.fire(m.ydisp))}};s.BufferService=y=c([g(0,k.IOptionsService)],y)},7994:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(l,s,a){var c=this&&this.__decorate||function(m,S,I,C){var A,E=arguments.length,N=E<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,I):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(m,S,I,C);else for(var O=m.length-1;O>=0;O--)(A=m[O])&&(N=(E<3?A(N):E>3?A(S,I,N):A(S,I))||N);return E>3&&N&&Object.defineProperty(S,I,N),N},g=this&&this.__param||function(m,S){return function(I,C){S(I,C,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const f=a(2585),b=a(8460),_=a(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:m=>m.button!==4&&m.action===1&&(m.ctrl=!1,m.alt=!1,m.shift=!1,!0)},VT200:{events:19,restrict:m=>m.action!==32},DRAG:{events:23,restrict:m=>m.action!==32||m.button!==3},ANY:{events:31,restrict:m=>!0}};function y(m,S){let I=(m.ctrl?16:0)|(m.shift?4:0)|(m.alt?8:0);return m.button===4?(I|=64,I|=m.action):(I|=3&m.button,4&m.button&&(I|=64),8&m.button&&(I|=128),m.action===32?I|=32:m.action!==0||S||(I|=3)),I}const d=String.fromCharCode,p={DEFAULT:m=>{const S=[y(m,!1)+32,m.col+32,m.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:m=>{const S=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.col};${m.row}${S}`},SGR_PIXELS:m=>{const S=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${y(m,!0)};${m.x};${m.y}${S}`}};let h=s.CoreMouseService=class extends _.Disposable{constructor(m,S){super(),this._bufferService=m,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const I of Object.keys(k))this.addProtocol(I,k[I]);for(const I of Object.keys(p))this.addEncoding(I,p[I]);this.reset()}addProtocol(m,S){this._protocols[m]=S}addEncoding(m,S){this._encodings[m]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(m){if(!this._protocols[m])throw new Error(`unknown protocol "${m}"`);this._activeProtocol=m,this._onProtocolChange.fire(this._protocols[m].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(m){if(!this._encodings[m])throw new Error(`unknown encoding "${m}"`);this._activeEncoding=m}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(m){if(m.col<0||m.col>=this._bufferService.cols||m.row<0||m.row>=this._bufferService.rows||m.button===4&&m.action===32||m.button===3&&m.action!==32||m.button!==4&&(m.action===2||m.action===3)||(m.col++,m.row++,m.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,m,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(m))return!1;const S=this._encodings[this._activeEncoding](m);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=m,!0}explainEvents(m){return{down:!!(1&m),up:!!(2&m),drag:!!(4&m),move:!!(8&m),wheel:!!(16&m)}}_equalEvents(m,S,I){if(I){if(m.x!==S.x||m.y!==S.y)return!1}else if(m.col!==S.col||m.row!==S.row)return!1;return m.button===S.button&&m.action===S.action&&m.ctrl===S.ctrl&&m.alt===S.alt&&m.shift===S.shift}};s.CoreMouseService=h=c([g(0,f.IBufferService),g(1,f.ICoreService)],h)},6975:function(l,s,a){var c=this&&this.__decorate||function(h,m,S,I){var C,A=arguments.length,E=A<3?m:I===null?I=Object.getOwnPropertyDescriptor(m,S):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,m,S,I);else for(var N=h.length-1;N>=0;N--)(C=h[N])&&(E=(A<3?C(E):A>3?C(m,S,E):C(m,S))||E);return A>3&&E&&Object.defineProperty(m,S,E),E},g=this&&this.__param||function(h,m){return function(S,I){m(S,I,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const f=a(1439),b=a(8460),_=a(844),k=a(2585),y=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=s.CoreService=class extends _.Disposable{constructor(h,m,S){super(),this._bufferService=h,this._logService=m,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(y),this.decPrivateModes=(0,f.clone)(d)}reset(){this.modes=(0,f.clone)(y),this.decPrivateModes=(0,f.clone)(d)}triggerDataEvent(h,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((I=>I.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((m=>m.charCodeAt(0))))),this._onBinary.fire(h))}};s.CoreService=p=c([g(0,k.IBufferService),g(1,k.ILogService),g(2,k.IOptionsService)],p)},9074:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=a(8055),g=a(8460),f=a(844),b=a(6106);let _=0,k=0;class y extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((h=>h==null?void 0:h.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const m=new d(h);if(m){const S=m.marker.onDispose((()=>m.dispose()));m.onDispose((()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),S.dispose())})),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,m,S){let I=0,C=0;for(const A of this._decorations.getKeyIterator(m))I=A.options.x??0,C=I+(A.options.width??1),h>=I&&h<C&&(!S||(A.options.layer??"bottom")===S)&&(yield A)}forEachDecorationAtCell(h,m,S,I){this._decorations.forEachByKey(m,(C=>{_=C.options.x??0,k=_+(C.options.width??1),h>=_&&h<k&&(!S||(C.options.layer??"bottom")===S)&&I(C)}))}}s.DecorationService=y;class d extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=a(2585),g=a(8343);class f{constructor(..._){this._entries=new Map;for(const[k,y]of _)this.set(k,y)}set(_,k){const y=this._entries.get(_);return this._entries.set(_,k),y}forEach(_){for(const[k,y]of this._entries.entries())_(k,y)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=f,s.InstantiationService=class{constructor(){this._services=new f,this._services.set(c.IInstantiationService,this)}setService(b,_){this._services.set(b,_)}getService(b){return this._services.get(b)}createInstance(b,..._){const k=(0,g.getServiceDependencies)(b).sort(((p,h)=>p.index-h.index)),y=[];for(const p of k){const h=this._services.get(p.id);if(!h)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${p.id}.`);y.push(h)}const d=k.length>0?k[0].index:_.length;if(_.length!==d)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${d+1} conflicts with ${_.length} static arguments`);return new b(..._,...y)}}},7866:function(l,s,a){var c=this&&this.__decorate||function(d,p,h,m){var S,I=arguments.length,C=I<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,p,h,m);else for(var A=d.length-1;A>=0;A--)(S=d[A])&&(C=(I<3?S(C):I>3?S(p,h,C):S(p,h))||C);return I>3&&C&&Object.defineProperty(p,h,C),C},g=this&&this.__param||function(d,p){return function(h,m){p(h,m,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const f=a(844),b=a(2585),_={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,y=s.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,h){this._evalLazyOptionalParams(h),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...h)}trace(d,...p){var h;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var h;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var h;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var h;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var h;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,d,p)}};s.LogService=y=c([g(0,b.IOptionsService)],y),s.setTraceLogger=function(d){k=d},s.traceCall=function(d,p,h){if(typeof h.value!="function")throw new Error("not supported");const m=h.value;h.value=function(...S){if(k.logLevel!==b.LogLevelEnum.TRACE)return m.apply(this,S);k.trace(`GlyphRenderer#${m.name}(${S.map((C=>JSON.stringify(C))).join(", ")})`);const I=m.apply(this,S);return k.trace(`GlyphRenderer#${m.name} return`,I),I}}},7302:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=a(8460),g=a(844),f=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends g.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...s.DEFAULT_OPTIONS};for(const p in y)if(p in d)try{const h=y[p];d[p]=this._sanitizeAndValidateOption(p,h)}catch(h){console.error(h)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,d){return this.onOptionChange((p=>{p===y&&d(this.rawOptions[y])}))}onMultipleOptionChange(y,d){return this.onOptionChange((p=>{y.indexOf(p)!==-1&&d()}))}_setupOptions(){const y=p=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,h)=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);h=this._sanitizeAndValidateOption(p,h),this.rawOptions[p]!==h&&(this.rawOptions[p]=h,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const h={get:y.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,h)}}_sanitizeAndValidateOption(y,d){switch(y){case"cursorStyle":if(d||(d=s.DEFAULT_OPTIONS[y]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${y}`);break;case"wordSeparator":d||(d=s.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=b.includes(d)?d:s.DEFAULT_OPTIONS[y];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${y} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${y} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}s.OptionsService=_},2660:function(l,s,a){var c=this&&this.__decorate||function(_,k,y,d){var p,h=arguments.length,m=h<3?k:d===null?d=Object.getOwnPropertyDescriptor(k,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(_,k,y,d);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(m=(h<3?p(m):h>3?p(k,y,m):p(k,y))||m);return h>3&&m&&Object.defineProperty(k,y,m),m},g=this&&this.__param||function(_,k){return function(y,d){k(y,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const f=a(2585);let b=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const k=this._bufferService.buffer;if(_.id===void 0){const S=k.addMarker(k.ybase+k.y),I={data:_,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(I,S))),this._dataByLinkId.set(I.id,I),I.id}const y=_,d=this._getEntryIdKey(y),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,k.ybase+k.y),p.id;const h=k.addMarker(k.ybase+k.y),m={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(m,h))),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(_,k){const y=this._dataByLinkId.get(_);if(y&&y.lines.every((d=>d.line!==k))){const d=this._bufferService.buffer.addMarker(k);y.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(y,d)))}}getLinkData(_){var k;return(k=this._dataByLinkId.get(_))==null?void 0:k.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,k){const y=_.lines.indexOf(k);y!==-1&&(_.lines.splice(y,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=b=c([g(0,f.IBufferService)],b)},8343:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[c]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const f=function(b,_,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(f,b,k)};return f.toString=()=>g,s.serviceRegistry.set(g,f),f}},2585:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(8343);var g;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(8460),g=a(225);class f{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,k,y=!1){return(16777215&_)<<3|(3&k)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new g.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let k=0,y=0;const d=_.length;for(let p=0;p<d;++p){let h=_.charCodeAt(p);if(55296<=h&&h<=56319){if(++p>=d)return k+this.wcwidth(h);const I=_.charCodeAt(p);56320<=I&&I<=57343?h=1024*(h-55296)+I-56320+65536:k+=this.wcwidth(I)}const m=this.charProperties(h,y);let S=f.extractWidth(m);f.extractShouldJoin(m)&&(S-=f.extractWidth(y)),k+=S,y=m}return k}charProperties(_,k){return this._activeProvider.charProperties(_,k)}}s.UnicodeService=f}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const s=i(9042),a=i(3236),c=i(844),g=i(5741),f=i(8285),b=i(7975),_=i(7090),k=["cols","rows"];class y extends c.Disposable{constructor(p){super(),this._core=this.register(new a.Terminal(p)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const h=S=>this._core.options[S],m=(S,I)=>{this._checkReadonlyOptions(S),this._core.options[S]=I};for(const S in this._core.options){const I={get:h.bind(this,S),set:m.bind(this,S)};Object.defineProperty(this._publicOptions,S,I)}}_checkReadonlyOptions(p){if(k.includes(p))throw new Error(`Option "${p}" 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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const h in p)this._publicOptions[h]=p[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,h=!0){this._core.input(p,h)}resize(p,h){this._verifyIntegers(p,h),this._core.resize(p,h)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,h,m){this._verifyIntegers(p,h,m),this._core.select(p,h,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,h){this._verifyIntegers(p,h),this._core.selectLines(p,h)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,h){this._core.write(p,h)}writeln(p,h){this._core.write(p),this._core.write(`\r
|
|
172
|
+
`,h)}paste(p){this._core.paste(p)}refresh(p,h){this._verifyIntegers(p,h),this._core.refresh(p,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return s}_verifyIntegers(...p){for(const h of p)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const h of p)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),o})()))})(uh)),uh.exports}var f2=h2();/**
|
|
173
173
|
* @license
|
|
174
174
|
* Copyright 2021 Google LLC
|
|
175
175
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
176
|
-
*/function
|
|
176
|
+
*/function dt(e,t,r){return e?t(e):r==null?void 0:r(e)}function ze(e){return typeof e=="function"}function Sg(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var wa=Sg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
177
177
|
`+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
|
|
178
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function ro(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ki=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var s=Gn(u),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else u.remove(this);var m=this.initialTeardown;if(ze(m))try{m()}catch(y){o=y instanceof wa?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var b=Gn(f),_=b.next();!_.done;_=b.next()){var k=_.value;try{ih(k)}catch(y){o=o??[],y instanceof wa?o=Hr(Hr([],Ar(o)),Ar(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new wa(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ih(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&ro(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ro(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),mg=Ki.EMPTY;function vg(e){return e instanceof Ki||e&&"closed"in e&&ze(e.remove)&&ze(e.add)&&ze(e.unsubscribe)}function ih(e){ze(e)?e():e.unsubscribe()}var Ky={Promise:void 0},Yy={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Hr([e,t],Ar(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function bg(e){Yy.setTimeout(function(){throw e})}function Li(){}function Us(e){e()}var ll=(function(e){jr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,vg(r)&&r.add(n)):n.destination=zy,n}return t.create=function(r,n,i){return new Oi(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Ki),Xy=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Is(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Is(n)}else Is(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Is(r)}},e})(),Oi=(function(e){jr(t,e);function t(r,n,i){var o=e.call(this)||this,u;return ze(r)||!r?u={next:r??void 0,error:n??void 0,complete:i??void 0}:u=r,o.destination=new Xy(u),o}return t})(ll);function Is(e){bg(e)}function Jy(e){throw e}var zy={closed:!0,next:Li,error:Jy,complete:Li},ul=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Yi(e){return e}function qy(e){return e.length===0?Yi:e.length===1?e[0]:function(t){return e.reduce(function(r,n){return n(r)},t)}}var pt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=e2(t)?t:new Oi(t,r,n);return Us(function(){var u=i,s=u.operator,a=u.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=sh(r),new r(function(i,o){var u=new Oi({next:function(s){try{t(s)}catch(a){o(a),u.unsubscribe()}},error:o,complete:i});n.subscribe(u)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[ul]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return qy(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=sh(t),new t(function(n,i){var o;r.subscribe(function(u){return o=u},function(u){return i(u)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function sh(e){var t;return(t=e??Ky.Promise)!==null&&t!==void 0?t:Promise}function Qy(e){return e&&ze(e.next)&&ze(e.error)&&ze(e.complete)}function e2(e){return e&&e instanceof ll||Qy(e)&&vg(e)}function t2(e){return ze(e==null?void 0:e.lift)}function gt(e){return function(t){if(t2(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ot(e,t,r,n,i){return new r2(e,t,r,n,i)}var r2=(function(e){jr(t,e);function t(r,n,i,o,u,s){var a=e.call(this,r)||this;return a.onFinalize=u,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(m){r.error(m)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(ll),n2=gg(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tr=(function(e){jr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new oh(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new n2},t.prototype.next=function(r){var n=this;Us(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var u=Gn(n.currentObservers),s=u.next();!s.done;s=u.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Us(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Us(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,u=i.isStopped,s=i.observers;return o||u?mg:(this.currentObservers=null,s.push(r),new Ki(function(){n.currentObservers=null,ro(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,u=n.isStopped;i?r.error(o):u&&r.complete()},t.prototype.asObservable=function(){var r=new pt;return r.source=this,r},t.create=function(r,n){return new oh(r,n)},t})(pt),oh=(function(e){jr(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:mg},t})(tr),i2={now:function(){return Date.now()}},s2=(function(e){jr(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Ki),ah={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Hr([e,t],Ar(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},o2=(function(e){jr(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,u=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(u,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),ah.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ah.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(u){i=!0,o=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ro(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(s2),ch=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=i2.now,e})(),a2=(function(e){jr(t,e);function t(r,n){n===void 0&&(n=ch.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(ch),Xi=new a2(o2),c2=Xi,_g=new pt(function(e){return e.complete()});function yg(e){return e&&ze(e.schedule)}function dl(e){return e[e.length-1]}function l2(e){return ze(dl(e))?e.pop():void 0}function Sg(e){return yg(dl(e))?e.pop():void 0}function u2(e,t){return typeof dl(e)=="number"?e.pop():t}var hl=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function wg(e){return ze(e==null?void 0:e.then)}function Eg(e){return ze(e[ul])}function Cg(e){return Symbol.asyncIterator&&ze(e==null?void 0:e[Symbol.asyncIterator])}function kg(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function d2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ig=d2();function Ag(e){return ze(e==null?void 0:e[Ig])}function xg(e){return dy(this,arguments,function(){var t,r,n,i;return og(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Vn(t.read())];case 3:return r=o.sent(),n=r.value,i=r.done,i?[4,Vn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Vn(n)];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 Rg(e){return ze(e==null?void 0:e.getReader)}function wt(e){if(e instanceof pt)return e;if(e!=null){if(Eg(e))return h2(e);if(hl(e))return f2(e);if(wg(e))return p2(e);if(Cg(e))return Ng(e);if(Ag(e))return g2(e);if(Rg(e))return m2(e)}throw kg(e)}function h2(e){return new pt(function(t){var r=e[ul]();if(ze(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function f2(e){return new pt(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function p2(e){return new pt(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,bg)})}function g2(e){return new pt(function(t){var r,n;try{for(var i=Gn(e),o=i.next();!o.done;o=i.next()){var u=o.value;if(t.next(u),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function Ng(e){return new pt(function(t){v2(e,t).catch(function(r){return t.error(r)})})}function m2(e){return Ng(xg(e))}function v2(e,t){var r,n,i,o;return uy(this,void 0,void 0,function(){var u,s;return og(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=hy(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(u=n.value,t.next(u),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function mn(e,t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}function Tg(e,t){return t===void 0&&(t=0),gt(function(r,n){r.subscribe(ot(n,function(i){return mn(n,e,function(){return n.next(i)},t)},function(){return mn(n,e,function(){return n.complete()},t)},function(i){return mn(n,e,function(){return n.error(i)},t)}))})}function Bg(e,t){return t===void 0&&(t=0),gt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function b2(e,t){return wt(e).pipe(Bg(t),Tg(t))}function _2(e,t){return wt(e).pipe(Bg(t),Tg(t))}function y2(e,t){return new pt(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function S2(e,t){return new pt(function(r){var n;return mn(r,t,function(){n=e[Ig](),mn(r,t,function(){var i,o,u;try{i=n.next(),o=i.value,u=i.done}catch(s){r.error(s);return}u?r.complete():r.next(o)},0,!0)}),function(){return ze(n==null?void 0:n.return)&&n.return()}})}function Lg(e,t){if(!e)throw new Error("Iterable cannot be null");return new pt(function(r){mn(r,t,function(){var n=e[Symbol.asyncIterator]();mn(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function w2(e,t){return Lg(xg(e),t)}function E2(e,t){if(e!=null){if(Eg(e))return b2(e,t);if(hl(e))return y2(e,t);if(wg(e))return _2(e,t);if(Cg(e))return Lg(e,t);if(Ag(e))return S2(e,t);if(Rg(e))return w2(e,t)}throw kg(e)}function Og(e,t){return t?E2(e,t):wt(e)}function C2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Sg(e);return Og(e,r)}function k2(e){return e instanceof Date&&!isNaN(e)}function Gt(e,t){return gt(function(r,n){var i=0;r.subscribe(ot(n,function(o){n.next(e.call(t,o,i++))}))})}var I2=Array.isArray;function A2(e,t){return I2(t)?e.apply(void 0,Hr([],Ar(t))):e(t)}function x2(e){return Gt(function(t){return A2(e,t)})}function R2(e,t,r,n,i,o,u,s){var a=[],c=0,m=0,f=!1,b=function(){f&&!a.length&&!c&&t.complete()},_=function(y){return c<n?k(y):a.push(y)},k=function(y){c++;var d=!1;wt(r(y,m++)).subscribe(ot(t,function(p){t.next(p)},function(){d=!0},void 0,function(){if(d)try{c--;for(var p=function(){var h=a.shift();u||k(h)};a.length&&c<n;)p();b()}catch(h){t.error(h)}}))};return e.subscribe(ot(t,_,function(){f=!0,b()})),function(){}}function dn(e,t,r){return r===void 0&&(r=1/0),ze(t)?dn(function(n,i){return Gt(function(o,u){return t(n,o,i,u)})(wt(e(n,i)))},r):(typeof t=="number"&&(r=t),gt(function(n,i){return R2(n,i,e,r)}))}function N2(e){return e===void 0&&(e=1/0),dn(Yi,e)}function T2(e){return new pt(function(t){wt(e()).subscribe(t)})}var B2={connector:function(){return new tr},resetOnDisconnect:!0};function on(e,t){t===void 0&&(t=B2);var r=null,n=t.connector,i=t.resetOnDisconnect,o=i===void 0?!0:i,u=n(),s=new pt(function(a){return u.subscribe(a)});return s.connect=function(){return(!r||r.closed)&&(r=T2(function(){return e}).subscribe(u),o&&r.add(function(){return u=n()})),r},s}var L2=["addListener","removeListener"],O2=["addEventListener","removeEventListener"],D2=["on","off"];function ec(e,t,r,n){if(ze(r)&&(n=r,r=void 0),n)return ec(e,t,r).pipe(x2(n));var i=Ar(M2(e)?O2.map(function(s){return function(a){return e[s](t,a,r)}}):F2(e)?L2.map(lh(e,t)):V2(e)?D2.map(lh(e,t)):[],2),o=i[0],u=i[1];if(!o&&hl(e))return dn(function(s){return ec(s,t,r)})(wt(e));if(!o)throw new TypeError("Invalid event target");return new pt(function(s){var a=function(){for(var c=[],m=0;m<arguments.length;m++)c[m]=arguments[m];return s.next(1<c.length?c:c[0])};return o(a),function(){return u(a)}})}function lh(e,t){return function(r){return function(n){return e[r](t,n)}}}function F2(e){return ze(e.addListener)&&ze(e.removeListener)}function V2(e){return ze(e.on)&&ze(e.off)}function M2(e){return ze(e.addEventListener)&&ze(e.removeEventListener)}function Si(e,t,r){e===void 0&&(e=0),r===void 0&&(r=c2);var n=-1;return t!=null&&(yg(t)?r=t:n=t),new pt(function(i){var o=k2(e)?+e-r.now():e;o<0&&(o=0);var u=0;return r.schedule(function(){i.closed||(i.next(u++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function U2(e,t){return t===void 0&&(t=Xi),Si(e,e,t)}function P2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Sg(e),n=u2(e,1/0),i=e;return i.length?i.length===1?wt(i[0]):N2(n)(Og(i,r)):_g}var W2=Array.isArray;function H2(e){return e.length===1&&W2(e[0])?e[0]:e}function fr(e,t){return gt(function(r,n){var i=0;r.subscribe(ot(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function $2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=H2(e),e.length===1?wt(e[0]):new pt(G2(e))}function G2(e){return function(t){for(var r=[],n=function(o){r.push(wt(e[o]).subscribe(ot(t,function(u){if(r){for(var s=0;s<r.length;s++)s!==o&&r[s].unsubscribe();r=null}t.next(u)})))},i=0;r&&!t.closed&&i<e.length;i++)n(i)}}function Z2(e){return gt(function(t,r){var n=null,i=null,o=function(){i==null||i.unsubscribe();var u=n;n=[],u&&r.next(u),wt(e()).subscribe(i=ot(r,o,Li))};o(),t.subscribe(ot(r,function(u){return n==null?void 0:n.push(u)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}function Dg(e){return gt(function(t,r){var n=null,i=!1,o;n=t.subscribe(ot(r,void 0,void 0,function(u){o=wt(e(u,Dg(e)(t))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}function j2(e,t,r,n,i){return function(o,u){var s=r,a=t,c=0;o.subscribe(ot(u,function(m){var f=c++;a=s?e(a,m,f):(s=!0,m),u.next(a)},i))}}function Fg(e,t){return t===void 0&&(t=Xi),gt(function(r,n){var i=null,o=null,u=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=u+e,m=t.now();if(m<c){i=this.schedule(void 0,c-m),n.add(i);return}s()}r.subscribe(ot(n,function(c){o=c,u=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}function uh(e){return e<=0?function(){return _g}:gt(function(t,r){var n=0;t.subscribe(ot(r,function(i){++n<=e&&(r.next(i),e<=n&&r.complete())}))})}function Vg(e,t){return t===void 0&&(t=Yi),e=e??K2,gt(function(r,n){var i,o=!0;r.subscribe(ot(n,function(u){var s=t(u);(o||!e(i,s))&&(o=!1,i=s,n.next(u))}))})}function K2(e,t){return e===t}function Y2(e){return gt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function X2(e,t){return gt(j2(e,t,arguments.length>=2,!0))}function Mg(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new tr}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,u=o===void 0?!0:o,s=e.resetOnRefCountZero,a=s===void 0?!0:s;return function(c){var m,f,b,_=0,k=!1,y=!1,d=function(){f==null||f.unsubscribe(),f=void 0},p=function(){d(),m=b=void 0,k=y=!1},h=function(){var g=m;p(),g==null||g.unsubscribe()};return gt(function(g,S){_++,!y&&!k&&d();var I=b=b??r();S.add(function(){_--,_===0&&!y&&!k&&(f=Ea(h,a))}),I.subscribe(S),!m&&_>0&&(m=new Oi({next:function(C){return I.next(C)},error:function(C){y=!0,d(),f=Ea(p,i,C),I.error(C)},complete:function(){k=!0,d(),f=Ea(p,u),I.complete()}}),wt(g).subscribe(m))})(c)}}function Ea(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Oi({next:function(){i.unsubscribe(),e()}});return wt(t.apply(void 0,Hr([],Ar(r)))).subscribe(i)}}function J2(e){return gt(function(t,r){var n=!1,i=ot(r,function(){i==null||i.unsubscribe(),n=!0},Li);wt(e).subscribe(i),t.subscribe(ot(r,function(o){return n&&r.next(o)}))})}function dh(e,t){return gt(function(r,n){var i=null,o=0,u=!1,s=function(){return u&&!i&&n.complete()};r.subscribe(ot(n,function(a){i==null||i.unsubscribe();var c=0,m=o++;wt(e(a,m)).subscribe(i=ot(n,function(f){return n.next(t?t(a,f,m,c++):f)},function(){i=null,s()}))},function(){u=!0,s()}))})}function As(e,t){return t===void 0&&(t=!1),gt(function(r,n){var i=0;r.subscribe(ot(n,function(o){var u=e(o,i++);(u||t)&&n.next(o),!u&&n.complete()}))})}function z2(e,t,r){var n=ze(e)||t||r?{next:e,error:t,complete:r}:e;return n?gt(function(i,o){var u;(u=n.subscribe)===null||u===void 0||u.call(n);var s=!0;i.subscribe(ot(o,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),o.next(a)},function(){var a;s=!1,(a=n.complete)===null||a===void 0||a.call(n),o.complete()},function(a){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,a),o.error(a)},function(){var a,c;s&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Yi}function q2(e,t){return gt(function(r,n){var i=t??{},o=i.leading,u=o===void 0?!0:o,s=i.trailing,a=s===void 0?!1:s,c=!1,m=null,f=null,b=!1,_=function(){f==null||f.unsubscribe(),f=null,a&&(d(),b&&n.complete())},k=function(){f=null,b&&n.complete()},y=function(p){return f=wt(e(p)).subscribe(ot(n,_,k))},d=function(){if(c){c=!1;var p=m;m=null,n.next(p),!b&&y(p)}};r.subscribe(ot(n,function(p){c=!0,m=p,!(f&&!f.closed)&&(u?d():y(p))},function(){b=!0,!(a&&c&&f&&!f.closed)&&n.complete()}))})}function hh(e,t,r){t===void 0&&(t=Xi);var n=Si(e,t);return q2(function(){return n},r)}function Ca(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l2(e);return gt(function(n,i){for(var o=e.length,u=new Array(o),s=e.map(function(){return!1}),a=!1,c=function(f){wt(e[f]).subscribe(ot(i,function(b){u[f]=b,!a&&!s[f]&&(s[f]=!0,(a=s.every(Yi))&&(s=null))},Li))},m=0;m<o;m++)c(m);n.subscribe(ot(i,function(f){if(a){var b=Hr([f],Ar(u));i.next(r?r.apply(void 0,Hr([],Ar(b))):b)}}))})}/**
|
|
178
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function ro(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ki=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var s=jn(l),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else l.remove(this);var g=this.initialTeardown;if(ze(g))try{g()}catch(y){o=y instanceof wa?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var b=jn(f),_=b.next();!_.done;_=b.next()){var k=_.value;try{hh(k)}catch(y){o=o??[],y instanceof wa?o=$r($r([],Ar(o)),Ar(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new wa(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)hh(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&ro(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ro(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),wg=Ki.EMPTY;function Eg(e){return e instanceof Ki||e&&"closed"in e&&ze(e.remove)&&ze(e.add)&&ze(e.unsubscribe)}function hh(e){ze(e)?e():e.unsubscribe()}var p2={Promise:void 0},g2={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,$r([e,t],Ar(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Cg(e){g2.setTimeout(function(){throw e})}function Li(){}function Us(e){e()}var dl=(function(e){Gr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Eg(r)&&r.add(n)):n.destination=b2,n}return t.create=function(r,n,i){return new Oi(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Ki),m2=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Is(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Is(n)}else Is(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Is(r)}},e})(),Oi=(function(e){Gr(t,e);function t(r,n,i){var o=e.call(this)||this,l;return ze(r)||!r?l={next:r??void 0,error:n??void 0,complete:i??void 0}:l=r,o.destination=new m2(l),o}return t})(dl);function Is(e){Cg(e)}function v2(e){throw e}var b2={closed:!0,next:Li,error:v2,complete:Li},hl=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Yi(e){return e}function _2(e){return e.length===0?Yi:e.length===1?e[0]:function(t){return e.reduce(function(r,n){return n(r)},t)}}var gt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=S2(t)?t:new Oi(t,r,n);return Us(function(){var l=i,s=l.operator,a=l.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=fh(r),new r(function(i,o){var l=new Oi({next:function(s){try{t(s)}catch(a){o(a),l.unsubscribe()}},error:o,complete:i});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[hl]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _2(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=fh(t),new t(function(n,i){var o;r.subscribe(function(l){return o=l},function(l){return i(l)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function fh(e){var t;return(t=e??p2.Promise)!==null&&t!==void 0?t:Promise}function y2(e){return e&&ze(e.next)&&ze(e.error)&&ze(e.complete)}function S2(e){return e&&e instanceof dl||y2(e)&&Eg(e)}function w2(e){return ze(e==null?void 0:e.lift)}function mt(e){return function(t){if(w2(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function at(e,t,r,n,i){return new E2(e,t,r,n,i)}var E2=(function(e){Gr(t,e);function t(r,n,i,o,l,s){var a=e.call(this,r)||this;return a.onFinalize=l,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(g){r.error(g)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(dl),C2=Sg(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tr=(function(e){Gr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new ph(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new C2},t.prototype.next=function(r){var n=this;Us(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=jn(n.currentObservers),s=l.next();!s.done;s=l.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Us(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Us(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,l=i.isStopped,s=i.observers;return o||l?wg:(this.currentObservers=null,s.push(r),new Ki(function(){n.currentObservers=null,ro(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,l=n.isStopped;i?r.error(o):l&&r.complete()},t.prototype.asObservable=function(){var r=new gt;return r.source=this,r},t.create=function(r,n){return new ph(r,n)},t})(gt),ph=(function(e){Gr(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:wg},t})(tr),k2={now:function(){return Date.now()}},I2=(function(e){Gr(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Ki),gh={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,$r([e,t],Ar(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},A2=(function(e){Gr(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,l=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(l,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),gh.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&gh.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(l){i=!0,o=l||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ro(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(I2),mh=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=k2.now,e})(),x2=(function(e){Gr(t,e);function t(r,n){n===void 0&&(n=mh.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(mh),Xi=new x2(A2),R2=Xi,kg=new gt(function(e){return e.complete()});function Ig(e){return e&&ze(e.schedule)}function fl(e){return e[e.length-1]}function N2(e){return ze(fl(e))?e.pop():void 0}function Ag(e){return Ig(fl(e))?e.pop():void 0}function T2(e,t){return typeof fl(e)=="number"?e.pop():t}var pl=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function xg(e){return ze(e==null?void 0:e.then)}function Rg(e){return ze(e[hl])}function Ng(e){return Symbol.asyncIterator&&ze(e==null?void 0:e[Symbol.asyncIterator])}function Tg(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function B2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Bg=B2();function Lg(e){return ze(e==null?void 0:e[Bg])}function Og(e){return By(this,arguments,function(){var t,r,n,i;return hg(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Vn(t.read())];case 3:return r=o.sent(),n=r.value,i=r.done,i?[4,Vn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Vn(n)];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 Dg(e){return ze(e==null?void 0:e.getReader)}function Et(e){if(e instanceof gt)return e;if(e!=null){if(Rg(e))return L2(e);if(pl(e))return O2(e);if(xg(e))return D2(e);if(Ng(e))return Fg(e);if(Lg(e))return F2(e);if(Dg(e))return V2(e)}throw Tg(e)}function L2(e){return new gt(function(t){var r=e[hl]();if(ze(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function O2(e){return new gt(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function D2(e){return new gt(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Cg)})}function F2(e){return new gt(function(t){var r,n;try{for(var i=jn(e),o=i.next();!o.done;o=i.next()){var l=o.value;if(t.next(l),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function Fg(e){return new gt(function(t){M2(e,t).catch(function(r){return t.error(r)})})}function V2(e){return Fg(Og(e))}function M2(e,t){var r,n,i,o;return Ty(this,void 0,void 0,function(){var l,s;return hg(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=Ly(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function gn(e,t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}function Vg(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(at(n,function(i){return gn(n,e,function(){return n.next(i)},t)},function(){return gn(n,e,function(){return n.complete()},t)},function(i){return gn(n,e,function(){return n.error(i)},t)}))})}function Mg(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function U2(e,t){return Et(e).pipe(Mg(t),Vg(t))}function P2(e,t){return Et(e).pipe(Mg(t),Vg(t))}function W2(e,t){return new gt(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function $2(e,t){return new gt(function(r){var n;return gn(r,t,function(){n=e[Bg](),gn(r,t,function(){var i,o,l;try{i=n.next(),o=i.value,l=i.done}catch(s){r.error(s);return}l?r.complete():r.next(o)},0,!0)}),function(){return ze(n==null?void 0:n.return)&&n.return()}})}function Ug(e,t){if(!e)throw new Error("Iterable cannot be null");return new gt(function(r){gn(r,t,function(){var n=e[Symbol.asyncIterator]();gn(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function H2(e,t){return Ug(Og(e),t)}function j2(e,t){if(e!=null){if(Rg(e))return U2(e,t);if(pl(e))return W2(e,t);if(xg(e))return P2(e,t);if(Ng(e))return Ug(e,t);if(Lg(e))return $2(e,t);if(Dg(e))return H2(e,t)}throw Tg(e)}function Pg(e,t){return t?j2(e,t):Et(e)}function Z2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ag(e);return Pg(e,r)}function G2(e){return e instanceof Date&&!isNaN(e)}function Zt(e,t){return mt(function(r,n){var i=0;r.subscribe(at(n,function(o){n.next(e.call(t,o,i++))}))})}var K2=Array.isArray;function Y2(e,t){return K2(t)?e.apply(void 0,$r([],Ar(t))):e(t)}function X2(e){return Zt(function(t){return Y2(e,t)})}function J2(e,t,r,n,i,o,l,s){var a=[],c=0,g=0,f=!1,b=function(){f&&!a.length&&!c&&t.complete()},_=function(y){return c<n?k(y):a.push(y)},k=function(y){c++;var d=!1;Et(r(y,g++)).subscribe(at(t,function(p){t.next(p)},function(){d=!0},void 0,function(){if(d)try{c--;for(var p=function(){var h=a.shift();l||k(h)};a.length&&c<n;)p();b()}catch(h){t.error(h)}}))};return e.subscribe(at(t,_,function(){f=!0,b()})),function(){}}function un(e,t,r){return r===void 0&&(r=1/0),ze(t)?un(function(n,i){return Zt(function(o,l){return t(n,o,i,l)})(Et(e(n,i)))},r):(typeof t=="number"&&(r=t),mt(function(n,i){return J2(n,i,e,r)}))}function z2(e){return e===void 0&&(e=1/0),un(Yi,e)}function q2(e){return new gt(function(t){Et(e()).subscribe(t)})}var Q2={connector:function(){return new tr},resetOnDisconnect:!0};function sn(e,t){t===void 0&&(t=Q2);var r=null,n=t.connector,i=t.resetOnDisconnect,o=i===void 0?!0:i,l=n(),s=new gt(function(a){return l.subscribe(a)});return s.connect=function(){return(!r||r.closed)&&(r=q2(function(){return e}).subscribe(l),o&&r.add(function(){return l=n()})),r},s}var eS=["addListener","removeListener"],tS=["addEventListener","removeEventListener"],rS=["on","off"];function ec(e,t,r,n){if(ze(r)&&(n=r,r=void 0),n)return ec(e,t,r).pipe(X2(n));var i=Ar(sS(e)?tS.map(function(s){return function(a){return e[s](t,a,r)}}):nS(e)?eS.map(vh(e,t)):iS(e)?rS.map(vh(e,t)):[],2),o=i[0],l=i[1];if(!o&&pl(e))return un(function(s){return ec(s,t,r)})(Et(e));if(!o)throw new TypeError("Invalid event target");return new gt(function(s){var a=function(){for(var c=[],g=0;g<arguments.length;g++)c[g]=arguments[g];return s.next(1<c.length?c:c[0])};return o(a),function(){return l(a)}})}function vh(e,t){return function(r){return function(n){return e[r](t,n)}}}function nS(e){return ze(e.addListener)&&ze(e.removeListener)}function iS(e){return ze(e.on)&&ze(e.off)}function sS(e){return ze(e.addEventListener)&&ze(e.removeEventListener)}function Si(e,t,r){e===void 0&&(e=0),r===void 0&&(r=R2);var n=-1;return t!=null&&(Ig(t)?r=t:n=t),new gt(function(i){var o=G2(e)?+e-r.now():e;o<0&&(o=0);var l=0;return r.schedule(function(){i.closed||(i.next(l++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function oS(e,t){return t===void 0&&(t=Xi),Si(e,e,t)}function aS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ag(e),n=T2(e,1/0),i=e;return i.length?i.length===1?Et(i[0]):z2(n)(Pg(i,r)):kg}var cS=Array.isArray;function lS(e){return e.length===1&&cS(e[0])?e[0]:e}function pr(e,t){return mt(function(r,n){var i=0;r.subscribe(at(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function uS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=lS(e),e.length===1?Et(e[0]):new gt(dS(e))}function dS(e){return function(t){for(var r=[],n=function(o){r.push(Et(e[o]).subscribe(at(t,function(l){if(r){for(var s=0;s<r.length;s++)s!==o&&r[s].unsubscribe();r=null}t.next(l)})))},i=0;r&&!t.closed&&i<e.length;i++)n(i)}}function hS(e){return mt(function(t,r){var n=null,i=null,o=function(){i==null||i.unsubscribe();var l=n;n=[],l&&r.next(l),Et(e()).subscribe(i=at(r,o,Li))};o(),t.subscribe(at(r,function(l){return n==null?void 0:n.push(l)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}function Wg(e){return mt(function(t,r){var n=null,i=!1,o;n=t.subscribe(at(r,void 0,void 0,function(l){o=Et(e(l,Wg(e)(t))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}function fS(e,t,r,n,i){return function(o,l){var s=r,a=t,c=0;o.subscribe(at(l,function(g){var f=c++;a=s?e(a,g,f):(s=!0,g),l.next(a)},i))}}function $g(e,t){return t===void 0&&(t=Xi),mt(function(r,n){var i=null,o=null,l=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=l+e,g=t.now();if(g<c){i=this.schedule(void 0,c-g),n.add(i);return}s()}r.subscribe(at(n,function(c){o=c,l=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}function bh(e){return e<=0?function(){return kg}:mt(function(t,r){var n=0;t.subscribe(at(r,function(i){++n<=e&&(r.next(i),e<=n&&r.complete())}))})}function Hg(e,t){return t===void 0&&(t=Yi),e=e??pS,mt(function(r,n){var i,o=!0;r.subscribe(at(n,function(l){var s=t(l);(o||!e(i,s))&&(o=!1,i=s,n.next(l))}))})}function pS(e,t){return e===t}function gS(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function mS(e,t){return mt(fS(e,t,arguments.length>=2,!0))}function jg(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new tr}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,l=o===void 0?!0:o,s=e.resetOnRefCountZero,a=s===void 0?!0:s;return function(c){var g,f,b,_=0,k=!1,y=!1,d=function(){f==null||f.unsubscribe(),f=void 0},p=function(){d(),g=b=void 0,k=y=!1},h=function(){var m=g;p(),m==null||m.unsubscribe()};return mt(function(m,S){_++,!y&&!k&&d();var I=b=b??r();S.add(function(){_--,_===0&&!y&&!k&&(f=Ea(h,a))}),I.subscribe(S),!g&&_>0&&(g=new Oi({next:function(C){return I.next(C)},error:function(C){y=!0,d(),f=Ea(p,i,C),I.error(C)},complete:function(){k=!0,d(),f=Ea(p,l),I.complete()}}),Et(m).subscribe(g))})(c)}}function Ea(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Oi({next:function(){i.unsubscribe(),e()}});return Et(t.apply(void 0,$r([],Ar(r)))).subscribe(i)}}function vS(e){return mt(function(t,r){var n=!1,i=at(r,function(){i==null||i.unsubscribe(),n=!0},Li);Et(e).subscribe(i),t.subscribe(at(r,function(o){return n&&r.next(o)}))})}function _h(e,t){return mt(function(r,n){var i=null,o=0,l=!1,s=function(){return l&&!i&&n.complete()};r.subscribe(at(n,function(a){i==null||i.unsubscribe();var c=0,g=o++;Et(e(a,g)).subscribe(i=at(n,function(f){return n.next(t?t(a,f,g,c++):f)},function(){i=null,s()}))},function(){l=!0,s()}))})}function As(e,t){return t===void 0&&(t=!1),mt(function(r,n){var i=0;r.subscribe(at(n,function(o){var l=e(o,i++);(l||t)&&n.next(o),!l&&n.complete()}))})}function bS(e,t,r){var n=ze(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(i,o){var l;(l=n.subscribe)===null||l===void 0||l.call(n);var s=!0;i.subscribe(at(o,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),o.next(a)},function(){var a;s=!1,(a=n.complete)===null||a===void 0||a.call(n),o.complete()},function(a){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,a),o.error(a)},function(){var a,c;s&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Yi}function _S(e,t){return mt(function(r,n){var i=t??{},o=i.leading,l=o===void 0?!0:o,s=i.trailing,a=s===void 0?!1:s,c=!1,g=null,f=null,b=!1,_=function(){f==null||f.unsubscribe(),f=null,a&&(d(),b&&n.complete())},k=function(){f=null,b&&n.complete()},y=function(p){return f=Et(e(p)).subscribe(at(n,_,k))},d=function(){if(c){c=!1;var p=g;g=null,n.next(p),!b&&y(p)}};r.subscribe(at(n,function(p){c=!0,g=p,!(f&&!f.closed)&&(l?d():y(p))},function(){b=!0,!(a&&c&&f&&!f.closed)&&n.complete()}))})}function yh(e,t,r){t===void 0&&(t=Xi);var n=Si(e,t);return _S(function(){return n},r)}function Ca(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=N2(e);return mt(function(n,i){for(var o=e.length,l=new Array(o),s=e.map(function(){return!1}),a=!1,c=function(f){Et(e[f]).subscribe(at(i,function(b){l[f]=b,!a&&!s[f]&&(s[f]=!0,(a=s.every(Yi))&&(s=null))},Li))},g=0;g<o;g++)c(g);n.subscribe(at(i,function(f){if(a){var b=$r([f],Ar(l));i.next(r?r.apply(void 0,$r([],Ar(b))):b)}}))})}/**
|
|
179
179
|
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
|
|
180
180
|
* @license MIT
|
|
181
|
-
*/const
|
|
181
|
+
*/const yS=2,SS=1;class wS{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const n=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(n._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const n=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),l=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),a={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},c=a.top+a.bottom,g=a.right+a.left,f=o-c,b=l-g-n,{width:_,height:k}=this.getCellSize();return{cols:Math.max(yS,Math.floor(b/_)),rows:Math.max(SS,Math.floor(f/k))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}let tc;async function It(e,t,r){var n;const i={type:t,output:r};return await((n=e.postMessage)==null?void 0:n.call(e,i))}function ES(e,t){var r;return((r=e.onDidReceiveMessage)==null?void 0:r.call(e,t))??{dispose:()=>{}}}function Yt(){if(!tc)throw new Error("Renderer context not defined");return tc}function CS(e){tc=e}var Me=(e=>(e.infoMessage="common:infoMessage",e.errorMessage="common:errorMessage",e.closeCellOutput="common:closeCellOutput",e.displayPrompt="common:displayPrompt",e.onPrompt="common:onPrompt",e.setState="common:setState",e.getState="common:getState",e.onGetState="common:onGetState",e.onCategoryChange="common:onCategoryChange",e.platformApiRequest="common:platformApiRequest",e.platformApiResponse="common:platformApiResponse",e.optionsMessage="common:optionsMessage",e.optionsModal="common:optionsModal",e.openExternalLink="common:openExternalLink",e.onOptionsMessage="common:onOptionsMessage",e.copyTextToClipboard="common:copyTextToClipboard",e.onCopyTextToClipboard="common:onCopyTextToClipboard",e.onProgramClose="common:onProgramClose",e.denoUpdate="deno:deploymentUpdate",e.denoPromote="deno:promoteDeployment",e.vercelProd="vercel:promotePreview",e.mutateAnnotations="annotations:mutate",e.terminalStdout="terminal:stdout",e.terminalStderr="terminal:stderr",e.terminalStdin="terminal:stdin",e.terminalResize="terminal:resize",e.terminalFocus="terminal:focus",e.terminalOpen="terminal:open",e.openLink="terminal:openLink",e.activeThemeChanged="theme:changed",e.githubWorkflowDispatch="github:workflowDispatch",e.githubWorkflowDeploy="github:workflowDeploy",e.githubWorkflowStatusUpdate="github:workflowStatusUpdate",e.tangleEvent="tangle:event",e.gcpResourceStatusChanged="gcp:resourceStatusChanged",e.gcpClusterCheckStatus="gcp:clusterCheckStatus",e.gcpClusterDetails="gcp:clusterDetails",e.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",e.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",e.gcpVMInstanceAction="gcp:gceVMInstanceAction",e.awsEC2Instances="aws:ec2Instances",e.awsEC2InstanceAction="aws:ec2InstanceAction",e.awsEKSClusterAction="aws:eksClusterAction",e.onAuthorModeChange="common:onAuthorModeChange",e.gistCell="gist:cell",e.gcpCloudRunAction="gcp:cloudRunAction",e.gcpLoadServices="gcp:loadServices",e.gcpServicesLoaded="gcp:servicesLoaded",e.daggerSyncState="dagger:syncState",e.daggerCliAction="dagger:cliAction",e.featuresUpdateAction="features:updateAction",e.featuresRequest="features:request",e.featuresResponse="features:response",e))(Me||{}),Zg=(e=>(e.vercel="stateful.runme/vercel-stdout",e.deno="stateful.runme/deno-stdout",e.outputItems="stateful.runme/output-items",e.annotations="stateful.runme/annotations",e.terminal="stateful.runme/terminal",e.error="stateful.runme/error",e.github="stateful.runme/github-stdout",e.stdout="application/vnd.code.notebook.stdout",e.gcp="stateful.runme/gcp",e.aws="stateful.runme/aws",e.daggerCall="stateful.runme/dagger",e.daggerShell="stateful.runme/dagger",e))(Zg||{}),Gg=(e=>(e.RunmeCloud="runme.cloud",e.RunmeChat="runme.chat",e.RunmeSearch="runme.search",e.NotebookEnvStore="runme.notebook.envStore",e))(Gg||{});function kS({}){}function IS(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function AS(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,n=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?n.format(Math.round(r),"second"):Math.abs(r)<3600?n.format(Math.round(r/60),"minute"):Math.abs(r)<86400?n.format(Math.round(r/3600),"hour"):n.format(Math.round(r/86400),"day")}const xS=Ne`
|
|
182
182
|
<svg
|
|
183
183
|
class="icon"
|
|
184
184
|
width="16"
|
|
@@ -193,7 +193,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
193
193
|
d="M13.353 1.146L14.853 2.646L15 3V14.5L14.5 15H1.5L1 14.5V1.5L1.5 1H13L13.353 1.146ZM2 2V14H14V3.208L12.793 2H11V6H4V2H2ZM8 2V5H10V2H8Z"
|
|
194
194
|
/>
|
|
195
195
|
</svg>
|
|
196
|
-
`,
|
|
196
|
+
`,RS=Ne`<svg
|
|
197
197
|
class="icon"
|
|
198
198
|
width="16"
|
|
199
199
|
height="16"
|
|
@@ -206,18 +206,18 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
206
206
|
clip-rule="evenodd"
|
|
207
207
|
d="M11.9564 6H12.0063C12.8003 6 13.5617 6.31607 14.1231 6.87868C14.6845 7.44129 14.9999 8.20435 14.9999 9C14.9999 9.79565 14.6845 10.5587 14.1231 11.1213C13.5617 11.6839 12.8003 12 12.0063 12H10.0106V11H12.0063C12.5356 11 13.0432 10.7893 13.4175 10.4142C13.7918 10.0391 14.002 9.53044 14.002 9C14.002 8.46957 13.7918 7.96086 13.4175 7.58579C13.0432 7.21072 12.5356 7 12.0063 7H11.0923L10.9686 6.143C10.8937 5.60541 10.6455 5.10711 10.2617 4.72407C9.87792 4.34103 9.37968 4.09427 8.84295 4.02143C8.30621 3.94859 7.76044 4.05365 7.28883 4.3206C6.81723 4.58754 6.44567 5.00173 6.23082 5.5L5.89754 6.262L5.08929 6.073C4.90378 6.02699 4.71361 6.0025 4.52251 6C3.8609 6 3.22639 6.2634 2.75856 6.73224C2.29073 7.20108 2.02791 7.83696 2.02791 8.5C2.02791 9.16304 2.29073 9.79893 2.75856 10.2678C3.22639 10.7366 3.8609 11 4.52251 11H7.01712V12H4.52251C4.02742 12.0043 3.53708 11.903 3.08401 11.7029C2.63095 11.5028 2.22551 11.2084 1.8946 10.8394C1.56369 10.4703 1.31487 10.0349 1.16465 9.56211C1.01442 9.08932 0.966218 8.58992 1.02324 8.09704C1.08026 7.60416 1.24121 7.12906 1.49539 6.70326C1.74958 6.27745 2.0912 5.91068 2.4976 5.62727C2.904 5.34385 3.36588 5.15027 3.85261 5.05937C4.33935 4.96847 4.8398 4.98232 5.32079 5.1C5.62405 4.40501 6.14506 3.82799 6.8049 3.45635C7.46474 3.08472 8.22745 2.9387 8.97752 3.04044C9.72759 3.14217 10.4241 3.4861 10.9617 4.02014C11.4992 4.55418 11.8484 5.24923 11.9564 6ZM10.2928 9.85348L8.97879 8.53944L8.97879 13.9749H7.98492L7.98493 8.57568L6.7071 9.85347L5.99999 9.14636L8.14643 6.99998H8.85354L10.9999 9.14637L10.2928 9.85348Z"
|
|
208
208
|
/>
|
|
209
|
-
</svg>`;var
|
|
209
|
+
</svg>`;var NS=Object.defineProperty,TS=Object.getOwnPropertyDescriptor,_n=(e,t,r,n)=>{for(var i=n>1?void 0:n?TS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&NS(t,r,i),i};let xr=class extends xt{constructor(){super(...arguments),this.text="Copy",this.loadingText="Saving...",this.loading=!1,this.disabled=!1}onClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent(this.disabled?"onClickDisabled":"onClick");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return Ne`
|
|
210
210
|
<vscode-button
|
|
211
211
|
?disabled=${this.loading}
|
|
212
212
|
class=${e}
|
|
213
213
|
appearance="secondary"
|
|
214
214
|
@click=${this.onClick}
|
|
215
215
|
>
|
|
216
|
-
${
|
|
217
|
-
${
|
|
218
|
-
${
|
|
216
|
+
${dt(this.shareIcon,()=>RS)}
|
|
217
|
+
${dt(this.saveIcon,()=>xS)}
|
|
218
|
+
${dt(this.loading,()=>Ne`${this.loadingText}`,()=>Ne`${this.text}`)}
|
|
219
219
|
</vscode-button>
|
|
220
|
-
`}};xr.styles=
|
|
220
|
+
`}};xr.styles=lr`
|
|
221
221
|
vscode-button {
|
|
222
222
|
color: var(--vscode-button-foreground);
|
|
223
223
|
background-color: var(--vscode-button-background);
|
|
@@ -237,7 +237,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
237
237
|
margin: 0 5px 0 -5px;
|
|
238
238
|
padding: 0;
|
|
239
239
|
}
|
|
240
|
-
`;
|
|
240
|
+
`;_n([Te({type:String})],xr.prototype,"text",2);_n([Te({type:String})],xr.prototype,"loadingText",2);_n([Te({type:Boolean,reflect:!0})],xr.prototype,"loading",2);_n([Te({type:Boolean,reflect:!0})],xr.prototype,"disabled",2);_n([Te({type:Boolean,reflect:!0})],xr.prototype,"shareIcon",2);_n([Te({type:Boolean,reflect:!0})],xr.prototype,"saveIcon",2);xr=_n([zt("action-button")],xr);const Sh=Ne`
|
|
241
241
|
<svg
|
|
242
242
|
height="16"
|
|
243
243
|
aria-hidden="true"
|
|
@@ -252,9 +252,9 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
252
252
|
d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
|
|
253
253
|
></path>
|
|
254
254
|
</svg>
|
|
255
|
-
`;var
|
|
255
|
+
`;var BS=Object.defineProperty,LS=Object.getOwnPropertyDescriptor,gl=(e,t,r,n)=>{for(var i=n>1?void 0:n?LS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&BS(t,r,i),i};let Di=class extends xt{constructor(){super(...arguments),this.text="Preview & Gist",this.disabled=!1}onGistClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onGist");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return dt(this.disabled,()=>Ne`
|
|
256
256
|
<vscode-button class=${e} disabled appearance="secondary">
|
|
257
|
-
${
|
|
257
|
+
${Sh} ${this.text}
|
|
258
258
|
</vscode-button>
|
|
259
259
|
`,()=>Ne`
|
|
260
260
|
<vscode-button
|
|
@@ -262,9 +262,9 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
262
262
|
appearance="secondary"
|
|
263
263
|
@click=${this.onGistClick}
|
|
264
264
|
>
|
|
265
|
-
${
|
|
265
|
+
${Sh} ${this.text}
|
|
266
266
|
</vscode-button>
|
|
267
|
-
`)}};Di.styles=
|
|
267
|
+
`)}};Di.styles=lr`
|
|
268
268
|
vscode-button {
|
|
269
269
|
color: var(--vscode-button-foreground);
|
|
270
270
|
background-color: var(--vscode-button-background);
|
|
@@ -284,7 +284,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
284
284
|
margin: 0 5px 0 -5px;
|
|
285
285
|
padding: 0;
|
|
286
286
|
}
|
|
287
|
-
`;
|
|
287
|
+
`;gl([Te({type:String})],Di.prototype,"text",2);gl([Te({type:Boolean,reflect:!0})],Di.prototype,"disabled",2);Di=gl([zt("gist-cell")],Di);const Kg=Ne`
|
|
288
288
|
<svg
|
|
289
289
|
width="16"
|
|
290
290
|
height="16"
|
|
@@ -300,15 +300,15 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
300
300
|
fill="currentColor"
|
|
301
301
|
/>
|
|
302
302
|
</svg>
|
|
303
|
-
`;var
|
|
303
|
+
`;var OS=Object.defineProperty,DS=Object.getOwnPropertyDescriptor,ml=(e,t,r,n)=>{for(var i=n>1?void 0:n?DS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&OS(t,r,i),i};let Fi=class extends xt{constructor(){super(...arguments),this.openText="Open",this.disabled=!1}onOpenClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onOpen");this.dispatchEvent(t)}render(){const e=this.openText.toLocaleLowerCase();return dt(this.disabled,()=>{},()=>Ne`
|
|
304
304
|
<vscode-button
|
|
305
305
|
class=${e}
|
|
306
306
|
appearance="secondary"
|
|
307
307
|
@click=${this.onOpenClick}
|
|
308
308
|
>
|
|
309
|
-
${
|
|
309
|
+
${Kg} ${this.openText}
|
|
310
310
|
</vscode-button>
|
|
311
|
-
`)}};Fi.styles=
|
|
311
|
+
`)}};Fi.styles=lr`
|
|
312
312
|
vscode-button {
|
|
313
313
|
color: var(--vscode-button-foreground);
|
|
314
314
|
background-color: var(--vscode-button-background);
|
|
@@ -325,7 +325,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
325
325
|
margin: 0 5px 0 -5px;
|
|
326
326
|
padding: 0;
|
|
327
327
|
}
|
|
328
|
-
`;
|
|
328
|
+
`;ml([Te({type:String})],Fi.prototype,"openText",2);ml([Te({type:Boolean,reflect:!0})],Fi.prototype,"disabled",2);Fi=ml([zt("open-cell")],Fi);var FS=Object.defineProperty,VS=Object.getOwnPropertyDescriptor,vl=(e,t,r,n)=>{for(var i=n>1?void 0:n?VS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&FS(t,r,i),i};let no=class extends xt{constructor(){super(...arguments),this.loading=!1,this.signedIn=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){let e=this.signedIn?"Save":"Save to Cloud";return Ne`
|
|
329
329
|
<action-button
|
|
330
330
|
?loading=${this.loading}
|
|
331
331
|
text="${e}"
|
|
@@ -333,7 +333,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
333
333
|
@onClick="${this.handleClick}"
|
|
334
334
|
>
|
|
335
335
|
</action-button>
|
|
336
|
-
`}};
|
|
336
|
+
`}};vl([Te({type:Boolean,reflect:!0})],no.prototype,"loading",2);vl([Te({type:Boolean,reflect:!0})],no.prototype,"signedIn",2);no=vl([zt("save-button")],no);var MS=Object.defineProperty,US=Object.getOwnPropertyDescriptor,Yg=(e,t,r,n)=>{for(var i=n>1?void 0:n?US(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&MS(t,r,i),i};let rc=class extends xt{constructor(){super(...arguments),this.loading=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){return Ne`
|
|
337
337
|
<action-button
|
|
338
338
|
?loading=${this.loading}
|
|
339
339
|
text="Share"
|
|
@@ -341,7 +341,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
341
341
|
@onClick="${this.handleClick}"
|
|
342
342
|
>
|
|
343
343
|
</action-button>
|
|
344
|
-
`}};
|
|
344
|
+
`}};Yg([Te({type:Boolean,reflect:!0})],rc.prototype,"loading",2);rc=Yg([zt("share-button")],rc);const PS=lr`
|
|
345
345
|
:host {
|
|
346
346
|
--vscode-font-weight: normal;
|
|
347
347
|
--vscode-font-size: 13px;
|
|
@@ -949,7 +949,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
949
949
|
--vscode-widget-border: #303031;
|
|
950
950
|
--vscode-activityBarBadge-background: #007acc;
|
|
951
951
|
}
|
|
952
|
-
`,
|
|
952
|
+
`,WS=lr`
|
|
953
953
|
:host {
|
|
954
954
|
--vscode-font-weight: normal;
|
|
955
955
|
--vscode-font-size: 13px;
|
|
@@ -1492,53 +1492,53 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
1492
1492
|
--vscode-widget-border: #e5e5e5;
|
|
1493
1493
|
--vscode-activityBarBadge-background: #005fb8;
|
|
1494
1494
|
}
|
|
1495
|
-
`;var
|
|
1495
|
+
`;var $S=Object.defineProperty,HS=Object.getOwnPropertyDescriptor,Xg=e=>{throw TypeError(e)},ct=(e,t,r,n)=>{for(var i=n>1?void 0:n?HS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&$S(t,r,i),i},jS=(e,t,r)=>t.has(e)||Xg("Cannot "+r),ZS=(e,t,r)=>t.has(e)?Xg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),$e=(e,t,r)=>(jS(e,t,"access private method"),r),Pe,wo,Jg,bl,_l,zg,Ps,Mr,nc,qg,Qg,ic,em,sc,tm,rm,nm,im,sm,om,am,cm,lm=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(lm||{});const Mn=(...e)=>`--vscode-${e.join("-")}`,Dn=e=>Mn("terminal",e),GS=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,KS=["terminal:","theme:",Me.platformApiRequest,Me.platformApiResponse,Me.onOptionsMessage,Me.optionsMessage,Me.onCopyTextToClipboard,Me.onProgramClose,Me.featuresResponse,Me.featuresUpdateAction],YS=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],XS="console-view";let et=class extends xt{constructor(){super(...arguments),ZS(this,Pe),this.copyText="Copy",this.disposables=[],this.containerSize={height:0,width:0},this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(PS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(WS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:n,cursorStyle:i,cursorWidth:o,fontFamily:l,smoothScrollDuration:s,scrollback:a}=this;this.terminal=new f2.Terminal({rows:t,fontSize:n,fontFamily:l,scrollback:a,cursorWidth:o,cursorBlink:r,cursorStyle:i,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new wS,this.fitAddon.activate(this.terminal),this.serializer=new o2.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new l2.Unicode11Addon),this.terminal.loadAddon(new d2.WebLinksAddon($e(this,Pe,sm).bind(this))),this.terminal.attachCustomKeyEventHandler(g=>{var f;if(g.shiftKey&&g.ctrlKey&&g.code==="KeyC"){const b=(f=this==null?void 0:this.terminal)==null?void 0:f.getSelection();if(b)return navigator.clipboard.writeText(b),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const c=Yt();this.disposables.push(ES(c,async g=>{var f;if(KS.some(b=>g.type.startsWith(b)))switch(g.type){case Me.activeThemeChanged:$e(this,Pe,Ps).call(this);break;case Me.terminalStdout:case Me.terminalStderr:{const{"runme.dev/id":b,data:_}=g.output;if(b!==this.id)return;this.isShareReady=!1,this.terminal.write(_),this.requestUpdate()}break;case Me.platformApiResponse:{if(g.output.id!==this.id)return;if(this.isLoading=!1,g.output.hasErrors)return It(c,Me.errorMessage,g.output.data);if(g.output.data.hasOwnProperty("displayShare")&&g.output.data.displayShare===!1)return;const b=((f=g.output.data)==null?void 0:f.data)||{};if(b.createExtensionCellOutput||b.createCellExecution){const _=b.createCellExecution||b.createExtensionCellOutput||{},{exitCode:k,id:y,htmlUrl:d,isSlackReady:p}=_;return this.platformId=y,this.shareUrl=d||"",this.exitCode=k,this.isSlackReady=!!p,this.isShareReady=!0,It(c,Me.tangleEvent,{webviewId:Gg.RunmeCloud,data:{cellId:y}})}if(b.updateCellOutput){const{updateCellOutput:{exitCode:_,isSlackReady:k}}=b;this.isUpdatedReady=!0,this.exitCode=_,this.isSlackReady=!!k,$e(this,Pe,em).call(this)}b.createEscalation&&(this.escalationUrl=b.createEscalation.escalationUrl)}break;case Me.onOptionsMessage:{if(g.output.id!==this.id)return;const b=g.output.option;switch(this.isLoading=!1,b){case"Open":return It(c,Me.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return It(c,Me.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case Me.onCopyTextToClipboard:return g.output.id!==this.id?void 0:It(c,Me.infoMessage,"Link copied!");case Me.onProgramClose:{const{"runme.dev/id":b,code:_}=g.output;if(b!==this.id)return;this.exitCode=_;return}}}),this.terminal.onData(g=>It(c,Me.terminalStdin,{"runme.dev/id":this.id,input:g}))),It(c,Me.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),$e(this,Pe,Ps).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=$e(this,Pe,bl).call(this);this.takeFocus&&window.addEventListener("focus",()=>{$e(this,Pe,ic).call(this)}),window.addEventListener("click",()=>{$e(this,Pe,ic).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),$e(this,Pe,wo).call(this),$e(this,Pe,zg).call(this),$e(this,Pe,Ps).call(this);const n=$e(this,Pe,Jg).call(this),i=new gt(l=>{window.addEventListener("resize",()=>l.next($e(this,Pe,nc).call(this,!0))),r.addEventListener("mouseup",()=>l.next($e(this,Pe,nc).call(this,!1)))}).pipe(jg());$e(this,Pe,qg).call(this,i),$e(this,Pe,Qg).call(this,i),r.appendChild(n);const o=Yt();o.postMessage&&It(o,Me.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:um((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=Ne`
|
|
1496
1496
|
<close-cell-button
|
|
1497
|
-
@closed="${()=>
|
|
1497
|
+
@closed="${()=>kS({id:this.id,outputType:Zg.terminal})}"
|
|
1498
1498
|
></close-cell-button>
|
|
1499
1499
|
<div class="button-group">
|
|
1500
1500
|
<copy-button
|
|
1501
1501
|
copyText="${this.copyText}"
|
|
1502
|
-
@onCopy="${async()
|
|
1502
|
+
@onCopy="${async()=>$e(this,Pe,cm).call(this)}"
|
|
1503
1503
|
></copy-button>
|
|
1504
|
-
${
|
|
1505
|
-
@onGist="${
|
|
1504
|
+
${dt(!0,()=>Ne`<gist-cell
|
|
1505
|
+
@onGist="${$e(this,Pe,nm)}"
|
|
1506
1506
|
></gist-cell>`,()=>{})}
|
|
1507
|
-
${
|
|
1507
|
+
${dt(this.shouldRenderSaveButton(),()=>Ne`<save-button
|
|
1508
1508
|
?loading=${this.isLoading}
|
|
1509
1509
|
?signedIn=${!1}
|
|
1510
|
-
@onClick="${
|
|
1510
|
+
@onClick="${$e(this,Pe,sc)}"
|
|
1511
1511
|
>
|
|
1512
1512
|
</save-button>`,()=>{})}
|
|
1513
|
-
${
|
|
1513
|
+
${dt(this.shouldRenderShareButton(),()=>Ne`<share-button
|
|
1514
1514
|
?loading=${this.isLoading}
|
|
1515
|
-
@onClick="${
|
|
1515
|
+
@onClick="${$e(this,Pe,sc)}"
|
|
1516
1516
|
>
|
|
1517
1517
|
</share-button>`,()=>{})}
|
|
1518
|
-
${
|
|
1518
|
+
${dt(!1,()=>Ne`<action-button
|
|
1519
1519
|
?loading=${this.isCreatingEscalation}
|
|
1520
1520
|
?saveIcon="${!0}"
|
|
1521
1521
|
text="Escalate"
|
|
1522
|
-
@onClick="${
|
|
1523
|
-
@onClickDisabled=${
|
|
1522
|
+
@onClick="${$e(this,Pe,tm)}"
|
|
1523
|
+
@onClickDisabled=${$e(this,Pe,am)}
|
|
1524
1524
|
>
|
|
1525
1525
|
</action-button>`,()=>{})}
|
|
1526
|
-
${
|
|
1526
|
+
${dt(!1,()=>Ne`<action-button
|
|
1527
1527
|
?saveIcon="${!0}"
|
|
1528
1528
|
text="Open Escalation"
|
|
1529
|
-
@onClick="${
|
|
1529
|
+
@onClick="${$e(this,Pe,rm)}"
|
|
1530
1530
|
>
|
|
1531
1531
|
</action-button>`,()=>{})}
|
|
1532
|
-
${
|
|
1532
|
+
${dt(this.platformId&&!this.isLoading,()=>Ne`<open-cell
|
|
1533
1533
|
?disabled=${!this.isPlatformAuthEnabled}
|
|
1534
|
-
@onOpen="${
|
|
1534
|
+
@onOpen="${$e(this,Pe,om)}"
|
|
1535
1535
|
></open-cell>`,()=>{})}
|
|
1536
1536
|
</div>
|
|
1537
1537
|
`;return Ne`<section>
|
|
1538
1538
|
<div id="terminal"></div>
|
|
1539
|
-
${
|
|
1540
|
-
</section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}}
|
|
1541
|
-
Open Dashboard to configure it`)};
|
|
1539
|
+
${dt(this.buttons,()=>e)}
|
|
1540
|
+
</section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};Pe=new WeakSet;wo=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};Jg=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=o=>{var l;t={initialClientY:o.clientY,initialRows:this.rows},o.preventDefault(),(l=this.terminal)==null||l.focus()},n=()=>{t!==void 0&&(t=void 0)},i=o=>{var l;if(t===void 0||!this.fitAddon)return;const s=(o.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,a=Math.round(t.initialRows+s);a!==this.rows&&($e(this,Pe,wo).call(this,a),(l=this.terminal)==null||l.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",n),window.addEventListener("mousemove",i),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",n),window.removeEventListener("mousemove",i)}}),e};bl=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};_l=function(){const e=$e(this,Pe,bl).call(this);if(!e)return;const{width:t,height:r}=e.getBoundingClientRect();return{width:t,height:r}};zg=function(){const e=$e(this,Pe,_l).call(this);e&&(this.containerSize=e)};Ps=function(){const e=$e(this,Pe,Mr).call(this,Dn("foreground")),t={foreground:e,cursor:$e(this,Pe,Mr).call(this,Mn("terminalCursor","foreground"))||e,cursorAccent:$e(this,Pe,Mr).call(this,Mn("terminalCursor","background")),selectionForeground:$e(this,Pe,Mr).call(this,Dn("selectionForeground")),selectionBackground:$e(this,Pe,Mr).call(this,Dn("selectionBackground")),selectionInactiveBackground:$e(this,Pe,Mr).call(this,Dn("inactiveSelectionBackground")),...Object.fromEntries(YS.map(r=>[r,$e(this,Pe,Mr).call(this,Dn(GS(r)))]))};this.terminal.options.theme=t};Mr=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};nc=function(e){if(!this.fitAddon)return;const t=$e(this,Pe,_l).call(this);if(!t||e&&Math.abs(this.containerSize.width-t.width)<=Number.EPSILON&&Math.abs(this.containerSize.height-t.height)<=Number.EPSILON)return;this.containerSize=t;const r=$e(this,Pe,wo).call(this);if(r)return um(r)};qg=async function(e){const t=e.pipe(pr(r=>!!r),Hg(),$g(100)).subscribe(async r=>{const n=Yt();n.postMessage&&await It(n,Me.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};Qg=async function(e){const t=e.pipe(Zt(r=>r==null?void 0:r.rows),pr(r=>!!r),Hg(),$g(100)).subscribe(async r=>{const n=Yt();n.postMessage&&n.postMessage({type:Me.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};ic=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=Yt();r.postMessage&&await It(r,Me.terminalFocus,{"runme.dev/id":this.id})};em=async function(){const e=Yt();if(!(!e.postMessage||!this.shareUrl))return It(e,Me.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(lm),id:this.id,telemetryEvent:"app.share"})};sc=async function(){return $e(this,Pe,im).call(this,!0)};tm=async function(){this.isCreatingEscalation=!0};rm=async function(){const e=Yt();if(this.escalationUrl)return It(e,Me.openLink,this.escalationUrl)};nm=function(){const e=Yt();if(e.postMessage)return It(e,Me.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};im=async function(e){Yt().postMessage};sm=function(e,t){It(Yt(),Me.openLink,t)};om=function(){It(Yt(),Me.openLink,this.shareUrl)};am=function(){It(Yt(),Me.errorMessage,`There is no Slack integration configured yet.
|
|
1541
|
+
Open Dashboard to configure it`)};cm=function(){var e;const t=Yt();if(!t.postMessage)return;const r=JS(((e=this.serializer)==null?void 0:e.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(r).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(n=>It(t,Me.infoMessage,`Failed to copy to clipboard: ${n.message}!`))};et.styles=lr`
|
|
1542
1542
|
.xterm {
|
|
1543
1543
|
cursor: text;
|
|
1544
1544
|
position: relative;
|
|
@@ -1778,24 +1778,24 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
1778
1778
|
.xterm-bg-7 {
|
|
1779
1779
|
background-color: var(--vscode-editor-selectionBackground) !important;
|
|
1780
1780
|
}
|
|
1781
|
-
`;at([Te({type:String})],et.prototype,"id",2);at([Te({type:Boolean,converter:e=>e!=="false"})],et.prototype,"buttons",2);at([Te({type:Boolean,converter:e=>e!=="false"})],et.prototype,"takeFocus",2);at([Te({type:String})],et.prototype,"theme",2);at([Te({type:String})],et.prototype,"fontFamily",2);at([Te({type:Number})],et.prototype,"fontSize",2);at([Te({type:String})],et.prototype,"cursorStyle",2);at([Te({type:Boolean})],et.prototype,"cursorBlink",2);at([Te({type:Number})],et.prototype,"cursorWidth",2);at([Te({type:Number})],et.prototype,"smoothScrollDuration",2);at([Te({type:Number})],et.prototype,"scrollback",2);at([Te({type:String})],et.prototype,"initialContent",2);at([Te({type:Number})],et.prototype,"initialRows",2);at([Te({type:Number})],et.prototype,"lastLine",2);at([Te({type:Boolean})],et.prototype,"isLoading",2);at([Te({type:Boolean})],et.prototype,"isCreatingEscalation",2);at([Te()],et.prototype,"shareUrl",2);at([Te()],et.prototype,"escalationUrl",2);at([Te({type:Boolean})],et.prototype,"isUpdatedReady",2);at([Te({type:Boolean})],et.prototype,"isAutoSaveEnabled",2);at([Te({type:Boolean})],et.prototype,"isPlatformAuthEnabled",2);at([Te({type:Boolean})],et.prototype,"isDaggerOutput",2);et=at([zt(xS)],et);function im(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function RS(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function Vi(e){let t=!1;const r=[];for(let n=0;n<e.length;n++){let i=e.charAt(n);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),r.push(i);break}}return r.join("")}const NS=new Set(["constructor","toString","toJSON","valueOf"]);function Mi(e){return NS.has(e)?e+"$":e}function TS(){let e=0,t=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ka(e,t,r){for(let o=0;o<28;o=o+7){const u=e>>>o,s=!(!(u>>>7)&&t==0),a=(s?u|128:u)&255;if(r.push(a),!s)return}const n=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(r.push((i?n|128:n)&255),!!i){for(let o=3;o<31;o=o+7){const u=t>>>o,s=!!(u>>>7),a=(s?u|128:u)&255;if(r.push(a),!s)return}r.push(t>>>31&1)}}const Ws=4294967296;function ph(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let n=0,i=0;function o(u,s){const a=Number(e.slice(u,s));i*=r,n=n*r+a,n>=Ws&&(i=i+(n/Ws|0),n=n%Ws)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?om(n,i):ml(n,i)}function BS(e,t){let r=ml(e,t);const n=r.hi&2147483648;n&&(r=om(r.lo,r.hi));const i=sm(r.lo,r.hi);return n?"-"+i:i}function sm(e,t){if({lo:e,hi:t}=LS(e,t),t<=2097151)return String(Ws*t+e);const r=e&16777215,n=(e>>>24|t<<8)&16777215,i=t>>16&65535;let o=r+n*6777216+i*6710656,u=n+i*8147497,s=i*2;const a=1e7;return o>=a&&(u+=Math.floor(o/a),o%=a),u>=a&&(s+=Math.floor(u/a),u%=a),s.toString()+gh(u)+gh(o)}function LS(e,t){return{lo:e>>>0,hi:t>>>0}}function ml(e,t){return{lo:e|0,hi:t|0}}function om(e,t){return t=~t,e?e=~e+1:t+=1,ml(e,t)}const gh=e=>{const t=String(e);return"0000000".slice(t.length)+t};function oc(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function OS(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const st=DS();function DS(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const u=typeof o=="bigint"?o:BigInt(o);if(u>r||u<t)throw new Error(`invalid int64: ${o}`);return u},uParse(o){const u=typeof o=="bigint"?o:BigInt(o);if(u>i||u<n)throw new Error(`invalid uint64: ${o}`);return u},enc(o){return e.setBigInt64(0,this.parse(o),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(o){return e.setBigInt64(0,this.uParse(o),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(o,u){return e.setInt32(0,o,!0),e.setInt32(4,u,!0),e.getBigInt64(0,!0)},uDec(o,u){return e.setInt32(0,o,!0),e.setInt32(4,u,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(t){return typeof t!="string"&&(t=t.toString()),mh(t),t},uParse(t){return typeof t!="string"&&(t=t.toString()),vh(t),t},enc(t){return typeof t!="string"&&(t=t.toString()),mh(t),ph(t)},uEnc(t){return typeof t!="string"&&(t=t.toString()),vh(t),ph(t)},dec(t,r){return BS(t,r)},uDec(t,r){return sm(t,r)}}}function mh(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function vh(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var re;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(re||(re={}));function _n(e,t){switch(e){case re.STRING:return"";case re.BOOL:return!1;case re.DOUBLE:case re.FLOAT:return 0;case re.INT64:case re.UINT64:case re.SFIXED64:case re.FIXED64:case re.SINT64:return t?"0":st.zero;case re.BYTES:return new Uint8Array(0);default:return 0}}function FS(e,t){switch(e){case re.BOOL:return t===!1;case re.STRING:return t==="";case re.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const am=2,Ir=Symbol.for("reflect unsafe local");function cm(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(n=>n.localName===r)}function VS(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=am)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!FS(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Ui(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function lm(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function um(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function MS(e,t){const r=t.localName;if(t.oneof){const n=t.oneof.localName;e[n].case===r&&(e[n]={case:void 0})}else if(t.presence!=am)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=_n(t.scalar,t.longAsString);break}}function vl(e){for(const t of e.field)Ui(t,"jsonName")||(t.jsonName=Vi(t.name));e.nestedType.forEach(vl)}function US(e,t){const r=e.values.find(n=>n.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function PS(e,t){switch(e){case re.STRING:return t;case re.BYTES:{const r=WS(t);if(r===!1)throw new Error(`cannot parse ${re[e]} default value: ${t}`);return r}case re.INT64:case re.SFIXED64:case re.SINT64:return st.parse(t);case re.UINT64:case re.FIXED64:return st.uParse(t);case re.DOUBLE:case re.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case re.BOOL:return t==="true";case re.INT32:case re.UINT32:case re.SINT32:case re.FIXED32:case re.SFIXED32:return parseInt(t,10)}}function WS(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(n){if(this.tail.length>=n){const i=this.tail.substring(0,n);return this.tail=this.tail.substring(n),i}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,8);if(Number.isNaN(o))return!1;t.push(o);break}case"x":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;t.push(o);break}case"u":{const n=r.c,i=r.take(4);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;const u=new Uint8Array(4);new DataView(u.buffer).setInt32(0,o,!0),t.push(u[0],u[1],u[2],u[3]);break}case"U":{const n=r.c,i=r.take(8);if(i===!1)return!1;const o=st.uEnc(n+i),u=new Uint8Array(8),s=new DataView(u.buffer);s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),t.push(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*ac(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*ac(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*ac(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function dm(...e){const t=HS();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)wh(r,t);return t}if("$typeName"in e[0]){let r=function(u){const s=[];for(const a of u.dependency){if(t.getFile(a)!=null||o.has(a))continue;const c=i(a);if(!c)throw new Error(`Unable to resolve ${a}, imported by ${u.name}`);"kind"in c?t.addFile(c,!1,!0):(o.add(c.name),s.push(c))}return s.concat(...s.map(r))};const n=e[0],i=e[1],o=new Set;for(const u of[n,...r(n)].reverse())wh(u,t)}else for(const r of e)for(const n of r.files)t.addFile(n);return t}function HS(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(n,i,o){if(r.set(n.proto.name,n),!i)for(const u of ac(n))this.add(u);if(o)for(const u of n.dependencies)this.addFile(u,i,o)},add(n){if(n.kind=="extension"){let i=t.get(n.extendee.typeName);i||t.set(n.extendee.typeName,i=new Map),i.set(n.number,n)}e.set(n.typeName,n)},get(n){return e.get(n)},getFile(n){return r.get(n)},getMessage(n){const i=e.get(n);return(i==null?void 0:i.kind)=="message"?i:void 0},getEnum(n){const i=e.get(n);return(i==null?void 0:i.kind)=="enum"?i:void 0},getExtension(n){const i=e.get(n);return(i==null?void 0:i.kind)=="extension"?i:void 0},getExtensionFor(n,i){var o;return(o=t.get(n.typeName))===null||o===void 0?void 0:o.get(i)},getService(n){const i=e.get(n);return(i==null?void 0:i.kind)=="service"?i:void 0}}}const $S=998,GS=999,ZS=9,Pi=10,wi=11,jS=12,bh=14,bl=3,KS=2,_h=1,YS=0,yh=1,Sh=2,XS=3,JS=1,zS=2,qS=1,hm={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function wh(e,t){var r,n;const i={kind:"file",proto:e,deprecated:(n=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&n!==void 0?n:!1,edition:rw(e),name:e.name.replace(/\.proto$/,""),dependencies:nw(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},o=new Map,u={get(s){return o.get(s)},add(s){var a;or(((a=s.proto.options)===null||a===void 0?void 0:a.mapEntry)===!0),o.set(s.typeName,s)}};for(const s of e.enumType)fm(s,i,void 0,t);for(const s of e.messageType)pm(s,i,void 0,t,u);for(const s of e.service)QS(s,i,t);cc(i,t);for(const s of o.values())lc(s,t,u);for(const s of i.messages)lc(s,t,u),cc(s,t);t.addFile(i,!0)}function cc(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const n=uc(r,e,t);e.extensions.push(n),t.add(n)}break;case"message":for(const r of e.proto.extension){const n=uc(r,e,t);e.nestedExtensions.push(n),t.add(n)}for(const r of e.nestedMessages)cc(r,t);break}}function lc(e,t,r){const n=e.proto.oneofDecl.map(o=>tw(o,e)),i=new Set;for(const o of e.proto.field){const u=ow(o,n),s=uc(o,e,t,u,r);e.fields.push(s),e.field[s.localName]=s,u===void 0?e.members.push(s):(u.fields.push(s),i.has(u)||(i.add(u),e.members.push(u)))}for(const o of n.filter(u=>i.has(u)))e.oneofs.push(o);for(const o of e.nestedMessages)lc(o,t,r)}function fm(e,t,r,n){var i,o,u,s,a;const c=iw(e.name,e.value),m={kind:"enum",proto:e,deprecated:(o=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,file:t,parent:r,open:!0,name:e.name,typeName:wo(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};m.open=uw(m),n.add(m);for(const f of e.value){const b=f.name;m.values.push(m.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(u=f.options)===null||u===void 0?void 0:u.deprecated)!==null&&s!==void 0?s:!1,parent:m,name:b,localName:Mi(c==null?b:b.substring(c.length)),number:f.number,toString(){return`enum value ${m.typeName}.${b}`}})}((a=r==null?void 0:r.nestedEnums)!==null&&a!==void 0?a:t.enums).push(m)}function pm(e,t,r,n,i){var o,u,s,a;const c={kind:"message",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,file:t,parent:r,name:e.name,typeName:wo(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?i.add(c):(((a=r==null?void 0:r.nestedMessages)!==null&&a!==void 0?a:t.messages).push(c),n.add(c));for(const m of e.enumType)fm(m,t,c,n);for(const m of e.nestedType)pm(m,t,c,n,i)}function QS(e,t,r){var n,i;const o={kind:"service",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:wo(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),r.add(o);for(const u of e.method){const s=ew(u,o,r);o.methods.push(s),o.method[s.localName]=s}}function ew(e,t,r){var n,i,o,u;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const a=r.getMessage(Er(e.inputType)),c=r.getMessage(Er(e.outputType));or(a,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),or(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const m=e.name;return{kind:"rpc",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:m,localName:Mi(m.length?Mi(m[0].toLowerCase()+m.substring(1)):m),methodKind:s,input:a,output:c,idempotency:(u=(o=e.options)===null||o===void 0?void 0:o.idempotencyLevel)!==null&&u!==void 0?u:YS,toString(){return`rpc ${t.typeName}.${m}`}}}function tw(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Mi(Vi(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function uc(e,t,r,n,i){var o,u,s;const a=i===void 0,c={kind:"field",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:aw(e,n,a,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){const _=t.kind=="file"?t:t.file,k=t.kind=="file"?void 0:t,y=wo(e,k,_);c.kind="extension",c.file=_,c.parent=k,c.oneof=void 0,c.typeName=y,c.jsonName=`[${y}]`,c.toString=()=>`extension ${y}`;const d=r.getMessage(Er(e.extendee));or(d,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=d}else{const _=t;or(_.kind=="message"),c.parent=_,c.oneof=n,c.localName=n?Vi(e.name):Mi(Vi(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const m=e.label,f=e.type,b=(s=e.options)===null||s===void 0?void 0:s.jstype;if(m===bl){const _=f==wi?i==null?void 0:i.get(Er(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:k,value:y}=lw(_);return c.mapKey=k.scalar,c.mapKind=y.fieldKind,c.message=y.message,c.delimitedEncoding=!1,c.enum=y.enum,c.scalar=y.scalar,c}switch(c.fieldKind="list",f){case wi:case Pi:c.listKind="message",c.message=r.getMessage(Er(e.typeName)),or(c.message),c.delimitedEncoding=Eh(e,t);break;case bh:c.listKind="enum",c.enum=r.getEnum(Er(e.typeName)),or(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=b==_h;break}return c.packed=cw(e,t),c}switch(f){case wi:case Pi:c.fieldKind="message",c.message=r.getMessage(Er(e.typeName)),or(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=Eh(e,t),c.getDefaultValue=()=>{};break;case bh:{const _=r.getEnum(Er(e.typeName));or(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(Er(e.typeName)),c.getDefaultValue=()=>Ui(e,"defaultValue")?US(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=b==_h,c.getDefaultValue=()=>Ui(e,"defaultValue")?PS(f,e.defaultValue):void 0;break}}return c}function rw(e){switch(e.syntax){case"":case"proto2":return $S;case"proto3":return GS;case"editions":if(e.edition in hm)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function nw(e,t){return e.dependency.map(r=>{const n=t.getFile(r);if(!n)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return n})}function iw(e,t){const r=sw(e)+"_";for(const n of t){if(!n.name.toLowerCase().startsWith(r))return;const i=n.name.substring(r.length);if(i.length==0||/^\d/.test(i))return}return r}function sw(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function wo(e,t,r){let n;return t?n=`${t.typeName}.${e.name}`:r.proto.package.length>0?n=`${r.proto.package}.${e.name}`:n=`${e.name}`,n}function Er(e){return e.startsWith(".")?e.substring(1):e}function ow(e,t){if(!Ui(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return or(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function aw(e,t,r,n){if(e.label==KS)return XS;if(e.label==bl)return Sh;if(t||e.proto3Optional||r)return yh;const i=Yn("fieldPresence",{proto:e,parent:n});return i==Sh&&(e.type==wi||e.type==Pi)?yh:i}function cw(e,t){if(e.label!=bl)return!1;switch(e.type){case ZS:case jS:case Pi:case wi:return!1}const r=e.options;return r&&Ui(r,"packed")?r.packed:JS==Yn("repeatedFieldEncoding",{proto:e,parent:t})}function lw(e){const t=e.fields.find(n=>n.number===1),r=e.fields.find(n=>n.number===2);return or(t&&t.fieldKind=="scalar"&&t.scalar!=re.BYTES&&t.scalar!=re.FLOAT&&t.scalar!=re.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function uw(e){var t;return qS==Yn("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function Eh(e,t){return e.type==Pi?!0:zS==Yn("messageEncoding",{proto:e,parent:t})}function Yn(e,t){var r,n;const i=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(i){const o=i[e];if(o!=0)return o}if("kind"in t){if(t.kind=="message")return Yn(e,(n=t.parent)!==null&&n!==void 0?n:t.file);const o=hm[t.edition];if(!o)throw new Error(`feature default for edition ${t.edition} not found`);return o[e]}return Yn(e,t.parent)}function or(e,t){if(!e)throw new Error(t)}function dw(e){const t=hw(e);return t.messageType.forEach(vl),dm(t,()=>{}).getFile(t.name)}function hw(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(gm),enumType:e.enumType.map(mm)}))}function gm(e){var t,r,n,i,o,u,s,a;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(fw))!==null&&r!==void 0?r:[],extension:[],nestedType:(i=(n=e.nestedType)===null||n===void 0?void 0:n.map(gm))!==null&&i!==void 0?i:[],enumType:(u=(o=e.enumType)===null||o===void 0?void 0:o.map(mm))!==null&&u!==void 0?u:[],extensionRange:(a=(s=e.extensionRange)===null||s===void 0?void 0:s.map(c=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},c)))!==null&&a!==void 0?a:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function fw(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?pw(e.options):void 0}))}function pw(e){var t,r,n;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(n=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(i=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},i)))!==null&&n!==void 0?n:[],uninterpretedOption:[]}))}function mm(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(t=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},t))})}function vm(e){const t=mw();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let n=new Uint8Array(r),i=0,o=0,u,s=0;for(let a=0;a<e.length;a++){if(u=t[e.charCodeAt(a)],u===void 0)switch(e[a]){case"=":o=0;case`
|
|
1782
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:s=u,o=1;break;case 1:n[i++]=s<<2|(u&48)>>4,s=u,o=2;break;case 2:n[i++]=(s&15)<<4|(u&60)>>2,s=u,o=3;break;case 3:n[i++]=(s&3)<<6|u,o=0;break}}if(o==1)throw Error("invalid base64 string");return n.subarray(0,i)}function gw(e,t="std"){const r=bm(t),n=t=="std";let i="",o=0,u,s=0;for(let a=0;a<e.length;a++)switch(u=e[a],o){case 0:i+=r[u>>2],s=(u&3)<<4,o=1;break;case 1:i+=r[s|u>>4],s=(u&15)<<2,o=2;break;case 2:i+=r[s|u>>6],i+=r[u&63],o=0;break}return o&&(i+=r[s],n&&(i+="=",o==1&&(i+="="))),i}let xs,Ch,Tn;function bm(e){return xs||(xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ch=xs.slice(0,-2).concat("-","_")),e=="url"?Ch:xs}function mw(){if(!Tn){Tn=[];const e=bm("std");for(let t=0;t<e.length;t++)Tn[e[t].charCodeAt(0)]=t;Tn[45]=e.indexOf("+"),Tn[95]=e.indexOf("/")}return Tn}function _l(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const vw=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Ut extends Error{constructor(t,r,n="FieldValueInvalidError"){super(r),this.name=n,this.field=()=>t}}function bw(e){return e instanceof Error&&vw.includes(e.name)&&"field"in e&&typeof e.field=="function"}function $r(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yl(e,t){var r,n,i,o;if($r(e)&&Ir in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const u=t,s=e.field();return u.listKind==s.listKind&&u.scalar===s.scalar&&((r=u.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=u.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function Sl(e,t){var r,n,i,o;if($r(e)&&Ir in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const u=t,s=e.field();return u.mapKey===s.mapKey&&u.mapKind==s.mapKind&&u.scalar===s.scalar&&((r=u.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=u.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function wl(e,t){return $r(e)&&Ir in e&&"desc"in e&&$r(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Ia=Symbol.for("@bufbuild/protobuf/text-encoding");function El(){if(globalThis[Ia]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ia]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Ia]}var ft;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(ft||(ft={}));const _m=34028234663852886e22,ym=-34028234663852886e22,Sm=4294967295,wm=2147483647,Em=-2147483648;class Cm{constructor(t=El().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let r=new Uint8Array(t),n=0;for(let i=0;i<this.chunks.length;i++)r.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(kh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Aa(t),oc(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){_w(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){kh(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Aa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Aa(t),t=(t<<1^t>>31)>>>0,oc(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=st.enc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=st.uEnc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}int64(t){let r=st.enc(t);return ka(r.lo,r.hi,this.buf),this}sint64(t){const r=st.enc(t),n=r.hi>>31,i=r.lo<<1^n,o=(r.hi<<1|r.lo>>>31)^n;return ka(i,o,this.buf),this}uint64(t){const r=st.uEnc(t);return ka(r.lo,r.hi,this.buf),this}}class Cl{constructor(t,r=El().decodeUtf8){this.decodeUtf8=r,this.varint64=TS,this.uint32=OS,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case ft.Varint:for(;this.buf[this.pos++]&128;);break;case ft.Bit64:this.pos+=4;case ft.Bit32:this.pos+=4;break;case ft.LengthDelimited:let i=this.uint32();this.pos+=i;break;case ft.StartGroup:for(;;){const[o,u]=this.tag();if(u===ft.EndGroup){if(r!==void 0&&o!==r)throw new Error("invalid end group tag");break}this.skip(u,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return st.dec(...this.varint64())}uint64(){return st.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,st.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return st.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return st.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function Aa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>wm||e<Em)throw new Error("invalid int32: "+e)}function kh(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Sm||e<0)throw new Error("invalid uint32: "+e)}function _w(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>_m||e<ym))throw new Error("invalid float32: "+e)}function cn(e,t){const r=e.fieldKind=="list"?yl(t,e):e.fieldKind=="map"?Sl(t,e):kl(e,t);if(r===!0)return;let n;switch(e.fieldKind){case"list":n=`expected ${Am(e)}, got ${St(t)}`;break;case"map":n=`expected ${xm(e)}, got ${St(t)}`;break;default:n=io(e,t,r)}return new Ut(e,n)}function Ih(e,t,r){const n=kl(e,r);if(n!==!0)return new Ut(e,`list item #${t+1}: ${io(e,r,n)}`)}function yw(e,t,r){const n=km(t,e.mapKey);if(n!==!0)return new Ut(e,`invalid map key: ${io({scalar:e.mapKey},t,n)}`);const i=kl(e,r);if(i!==!0)return new Ut(e,`map entry ${St(t)}: ${io(e,r,i)}`)}function kl(e,t){return e.scalar!==void 0?km(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):wl(t,e.message)}function km(e,t){switch(t){case re.DOUBLE:return typeof e=="number";case re.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>_m||e<ym?`${e.toFixed()} out of range`:!0;case re.INT32:case re.SFIXED32:case re.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>wm||e<Em?`${e.toFixed()} out of range`:!0;case re.FIXED32:case re.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Sm||e<0?`${e.toFixed()} out of range`:!0;case re.BOOL:return typeof e=="boolean";case re.STRING:return typeof e!="string"?!1:El().checkUtf8(e)||"invalid UTF8";case re.BYTES:return e instanceof Uint8Array;case re.INT64:case re.SFIXED64:case re.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return st.parse(e),!0}catch{return`${e} out of range`}return!1;case re.FIXED64:case re.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return st.uParse(e),!0}catch{return`${e} out of range`}return!1}}function io(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${St(t)}`,e.scalar!==void 0?`expected ${Sw(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${Im(e.message)}`+r}function St(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:yl(e)?Am(e.field()):Sl(e)?xm(e.field()):wl(e)?Im(e.desc):_l(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Im(e){return`ReflectMessage (${e.typeName})`}function Am(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${re[e.scalar]})`}}function xm(e){switch(e.mapKind){case"message":return`ReflectMap (${re[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${re[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${re[e.mapKey]}, ${re[e.scalar]})`}}function Sw(e){switch(e){case re.STRING:return"string";case re.BOOL:return"boolean";case re.INT64:case re.SINT64:case re.SFIXED64:return"bigint (int64)";case re.UINT64:case re.FIXED64:return"bigint (uint64)";case re.BYTES:return"Uint8Array";case re.DOUBLE:return"number (float64)";case re.FLOAT:return"number (float32)";case re.FIXED32:case re.UINT32:return"number (uint32)";case re.INT32:case re.SFIXED32:case re.SINT32:return"number (int32)"}}function ww(e){return Rm(e.$typeName)}function Ji(e){const t=e.fields[0];return Rm(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function Rm(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const Ew=999,Cw=998,Hs=2;function _t(e,t){if(_l(t,e))return t;const r=Rw(e);return t!==void 0&&kw(e,r,t),r}function kw(e,t,r){for(const n of e.members){let i=r[n.localName];if(i==null)continue;let o;if(n.kind=="oneof"){const u=cm(r,n);if(!u)continue;o=u,i=lm(r,u)}else o=n;switch(o.fieldKind){case"message":i=Il(o,i);break;case"scalar":i=Nm(o,i);break;case"list":i=Aw(o,i);break;case"map":i=Iw(o,i);break}um(t,o,i)}return t}function Nm(e,t){return e.scalar==re.BYTES?Al(t):t}function Iw(e,t){if($r(t)){if(e.scalar==re.BYTES)return Ah(t,Al);if(e.mapKind=="message")return Ah(t,r=>Il(e,r))}return t}function Aw(e,t){if(Array.isArray(t)){if(e.scalar==re.BYTES)return t.map(Al);if(e.listKind=="message")return t.map(r=>Il(e,r))}return t}function Il(e,t){if(e.fieldKind=="message"&&!e.oneof&&Ji(e.message))return Nm(e.message.fields[0],t);if($r(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!_l(t,e.message))return _t(e.message,t)}return t}function Al(e){return Array.isArray(e)?new Uint8Array(e):e}function Ah(e,t){const r={};for(const n of Object.entries(e))r[n[0]]=t(n[1]);return r}const xw=Symbol(),xh=new WeakMap;function Rw(e){let t;if(Nw(e)){const r=xh.get(e);let n,i;if(r)({prototype:n,members:i}=r);else{n={},i=new Set;for(const o of e.members)o.kind!="oneof"&&(o.fieldKind!="scalar"&&o.fieldKind!="enum"||o.presence!=Hs&&(i.add(o),n[o.localName]=xa(o)));xh.set(e,{prototype:n,members:i})}t=Object.create(n),t.$typeName=e.typeName;for(const o of e.members)i.has(o)||o.kind=="field"&&(o.fieldKind=="message"||(o.fieldKind=="scalar"||o.fieldKind=="enum")&&o.presence!=Hs)||(t[o.localName]=xa(o))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==Hs)&&(t[r.localName]=xa(r))}return t}function Nw(e){switch(e.file.edition){case Ew:return!1;case Cw:return!0;default:return e.fields.some(t=>t.presence!=Hs&&t.fieldKind!="message"&&!t.oneof)}}function xa(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return xw;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?_n(e.scalar,e.longAsString):e.enum.values[0].number}function nr(e,t,r=!0){return new Tm(e,t,r)}class Tm{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,n)=>r.number-n.number)}constructor(t,r,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=t,this.message=this[Ir]=r??_t(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return fi(this.message,t),cm(this.message,t)}isSet(t){return fi(this.message,t),VS(this.message,t)}clear(t){fi(this.message,t),MS(this.message,t)}get(t){fi(this.message,t);const r=lm(this.message,t);switch(t.fieldKind){case"list":let n=this.lists.get(t);return(!n||n[Ir]!==r)&&this.lists.set(t,n=new Tw(t,r,this.check)),n;case"map":let i=this.maps.get(t);return(!i||i[Ir]!==r)&&this.maps.set(t,i=new Bw(t,r,this.check)),i;case"message":return Rl(t,r,this.check);case"scalar":return r===void 0?_n(t.scalar,!1):Nl(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(fi(this.message,t),this.check){const i=cn(t,r);if(i)throw i}let n;t.fieldKind=="message"?n=xl(t,r):Sl(r)||yl(r)?n=r[Ir]:n=Tl(t,r),um(this.message,t,n)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function fi(e,t){if(t.parent.typeName!==e.$typeName)throw new Ut(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class Tw{field(){return this._field}get size(){return this._arr.length}constructor(t,r,n){this._field=t,this._arr=this[Ir]=r,this.check=n}get(t){const r=this._arr[t];return r===void 0?void 0:Ra(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Ut(this._field,`list item #${t+1}: out of range`);if(this.check){const n=Ih(this._field,t,r);if(n)throw n}this._arr[t]=Rh(this._field,r)}add(t){if(this.check){const r=Ih(this._field,this._arr.length,t);if(r)throw r}this._arr.push(Rh(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield Ra(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,Ra(this._field,this._arr[t],this.check)]}}class Bw{constructor(t,r,n=!0){this.obj=this[Ir]=r??{},this.check=n,this._field=t}field(){return this._field}set(t,r){if(this.check){const n=yw(this._field,t,r);if(n)throw n}return this.obj[Rs(t)]=Lw(this._field,r),this}delete(t){const r=Rs(t),n=Object.prototype.hasOwnProperty.call(this.obj,r);return n&&delete this.obj[r],n}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[Rs(t)];return r!==void 0&&(r=Na(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Rs(t))}*keys(){for(const t of Object.keys(this.obj))yield Nh(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[Nh(t[0],this._field.mapKey),Na(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Na(this._field,t,this.check)}forEach(t,r){for(const n of this.entries())t.call(r,n[1],n[0],this)}}function xl(e,t){return wl(t)?ww(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?Lm(t.message):t.message:t}function Rl(e,t,r){return t!==void 0&&(Ji(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Nl(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&$r(t)&&(t=Bm(t))),new Tm(e.message,t,r)}function Rh(e,t){return e.listKind=="message"?xl(e,t):Tl(e,t)}function Ra(e,t,r){return e.listKind=="message"?Rl(e,t,r):Nl(e,t)}function Lw(e,t){return e.mapKind=="message"?xl(e,t):Tl(e,t)}function Na(e,t,r){return e.mapKind=="message"?Rl(e,t,r):t}function Rs(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function Nh(e,t){switch(t){case re.STRING:return e;case re.INT32:case re.FIXED32:case re.UINT32:case re.SFIXED32:case re.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case re.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case re.UINT64:case re.FIXED64:try{return st.uParse(e)}catch{}break;default:try{return st.parse(e)}catch{}break}return e}function Nl(e,t){switch(e.scalar){case re.INT64:case re.SFIXED64:case re.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=st.parse(t));break;case re.FIXED64:case re.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=st.uParse(t));break}return t}function Tl(e,t){switch(e.scalar){case re.INT64:case re.SFIXED64:case re.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=st.parse(t));break;case re.FIXED64:case re.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=st.uParse(t));break}return t}function Bm(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if($r(e))for(const[r,n]of Object.entries(e))t.fields[r]=Dm(n);return t}function Lm(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Om(n);return t}function Om(e){switch(e.kind.case){case"structValue":return Lm(e.kind.value);case"listValue":return e.kind.value.values.map(Om);case"nullValue":case void 0:return null;default:return e.kind.value}}function Dm(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const n of e)r.values.push(Dm(n));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:Bm(e)};break}return t}const Ow=3,Th={writeUnknownFields:!0};function Dw(e){return e?Object.assign(Object.assign({},Th),e):Th}function Fw(e,t,r){return so(new Cm,Dw(r),nr(e,t)).finish()}function so(e,t,r){var n;for(const i of r.sortedFields){if(!r.isSet(i)){if(i.presence==Ow)throw new Error(`cannot encode ${i} to binary: required field not set`);continue}Fm(e,t,r,i)}if(t.writeUnknownFields)for(const{no:i,wireType:o,data:u}of(n=r.getUnknown())!==null&&n!==void 0?n:[])e.tag(i,o).raw(u);return e}function Fm(e,t,r,n){var i;switch(n.fieldKind){case"scalar":case"enum":oo(e,r.desc.typeName,n.name,(i=n.scalar)!==null&&i!==void 0?i:re.INT32,n.number,r.get(n));break;case"list":Vw(e,t,n,r.get(n));break;case"message":Vm(e,t,n,r.get(n));break;case"map":for(const[o,u]of r.get(n))Mw(e,t,n,o,u);break}}function oo(e,t,r,n,i,o){Mm(e.tag(i,Uw(n)),t,r,n,o)}function Vm(e,t,r,n){r.delimitedEncoding?so(e.tag(r.number,ft.StartGroup),t,n).tag(r.number,ft.EndGroup):so(e.tag(r.number,ft.LengthDelimited).fork(),t,n).join()}function Vw(e,t,r,n){var i;if(r.listKind=="message"){for(const u of n)Vm(e,t,r,u);return}const o=(i=r.scalar)!==null&&i!==void 0?i:re.INT32;if(r.packed){if(!n.size)return;e.tag(r.number,ft.LengthDelimited).fork();for(const u of n)Mm(e,r.parent.typeName,r.name,o,u);e.join();return}for(const u of n)oo(e,r.parent.typeName,r.name,o,r.number,u)}function Mw(e,t,r,n,i){var o;switch(e.tag(r.number,ft.LengthDelimited).fork(),oo(e,r.parent.typeName,r.name,r.mapKey,1,n),r.mapKind){case"scalar":case"enum":oo(e,r.parent.typeName,r.name,(o=r.scalar)!==null&&o!==void 0?o:re.INT32,2,i);break;case"message":so(e.tag(2,ft.LengthDelimited).fork(),t,i).join();break}e.join()}function Mm(e,t,r,n,i){try{switch(n){case re.STRING:e.string(i);break;case re.BOOL:e.bool(i);break;case re.DOUBLE:e.double(i);break;case re.FLOAT:e.float(i);break;case re.INT32:e.int32(i);break;case re.INT64:e.int64(i);break;case re.UINT64:e.uint64(i);break;case re.FIXED64:e.fixed64(i);break;case re.BYTES:e.bytes(i);break;case re.FIXED32:e.fixed32(i);break;case re.SFIXED32:e.sfixed32(i);break;case re.SFIXED64:e.sfixed64(i);break;case re.SINT64:e.sint64(i);break;case re.UINT32:e.uint32(i);break;case re.SINT32:e.sint32(i);break}}catch(o){throw o instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${o.message}`):o}}function Uw(e){switch(e){case re.BYTES:case re.STRING:return ft.LengthDelimited;case re.DOUBLE:case re.FIXED64:case re.SFIXED64:return ft.Bit64;case re.FIXED32:case re.SFIXED32:case re.FLOAT:return ft.Bit32;default:return ft.Varint}}function br(e,t,...r){return r.reduce((n,i)=>n.nestedMessages[i],e.messages[t])}function Eo(e,t,...r){if(r.length==0)return e.enums[t];const n=r.pop();return r.reduce((i,o)=>i.nestedMessages[o],e.messages[t]).nestedEnums[n]}function Co(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const Pw=dw({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Ww=br(Pw,1);var Bh;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(Bh||(Bh={}));var Lh;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Lh||(Lh={}));var Oh;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(Oh||(Oh={}));var Dh;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(Dh||(Dh={}));var Fh;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(Fh||(Fh={}));var Vh;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(Vh||(Vh={}));var Mh;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Mh||(Mh={}));var Uh;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(Uh||(Uh={}));var Ph;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(Ph||(Ph={}));var Wh;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(Wh||(Wh={}));var Hh;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Hh||(Hh={}));var $h;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})($h||($h={}));var Gh;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(Gh||(Gh={}));var Zh;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(Zh||(Zh={}));var jh;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(jh||(jh={}));var Kh;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Kh||(Kh={}));var Yh;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(Yh||(Yh={}));var Xh;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Xh||(Xh={}));var Jh;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(Jh||(Jh={}));var zh;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(zh||(zh={}));const Hw={readUnknownFields:!0};function $w(e){return Hw}function Um(e,t,r){const n=nr(e,void 0,!1);return Pm(n,new Cl(t),$w(),!1,t.byteLength),n.message}function Pm(e,t,r,n,i){var o;const u=n?t.len:t.pos+i;let s,a;const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];for(;t.pos<u&&([s,a]=t.tag(),!(n&&a==ft.EndGroup));){const m=e.findNumber(s);if(!m){const f=t.skip(a,s);r.readUnknownFields&&c.push({no:s,wireType:a,data:f});continue}Wm(e,t,m,a,r)}if(n&&(a!=ft.EndGroup||s!==i))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function Wm(e,t,r,n,i){var o;switch(r.fieldKind){case"scalar":e.set(r,Xn(t,r.scalar));break;case"enum":const u=Xn(t,re.INT32);if(r.enum.open)e.set(r,u);else if(r.enum.values.some(s=>s.number===u))e.set(r,u);else if(i.readUnknownFields){const s=[];oc(u,s);const a=(o=e.getUnknown())!==null&&o!==void 0?o:[];a.push({no:r.number,wireType:n,data:new Uint8Array(s)}),e.setUnknown(a)}break;case"message":e.set(r,Bl(t,i,r,e.get(r)));break;case"list":Zw(t,n,e.get(r),i);break;case"map":Gw(t,e.get(r),i);break}}function Gw(e,t,r){const n=t.field();let i,o;const u=e.uint32(),s=e.pos+u;for(;e.pos<s;){const[a]=e.tag();switch(a){case 1:i=Xn(e,n.mapKey);break;case 2:switch(n.mapKind){case"scalar":o=Xn(e,n.scalar);break;case"enum":o=e.int32();break;case"message":o=Bl(e,r,n);break}break}}if(i===void 0&&(i=_n(n.mapKey,!1)),o===void 0)switch(n.mapKind){case"scalar":o=_n(n.scalar,!1);break;case"enum":o=n.enum.values[0].number;break;case"message":o=nr(n.message,void 0,!1);break}t.set(i,o)}function Zw(e,t,r,n){var i;const o=r.field();if(o.listKind==="message"){r.add(Bl(e,n,o));return}const u=(i=o.scalar)!==null&&i!==void 0?i:re.INT32;if(!(t==ft.LengthDelimited&&u!=re.STRING&&u!=re.BYTES)){r.add(Xn(e,u));return}const s=e.uint32()+e.pos;for(;e.pos<s;)r.add(Xn(e,u))}function Bl(e,t,r,n){const i=r.delimitedEncoding,o=n??nr(r.message,void 0,!1);return Pm(o,e,t,i,i?r.number:e.uint32()),o}function Xn(e,t){switch(t){case re.STRING:return e.string();case re.BOOL:return e.bool();case re.DOUBLE:return e.double();case re.FLOAT:return e.float();case re.INT32:return e.int32();case re.INT64:return e.int64();case re.UINT64:return e.uint64();case re.FIXED64:return e.fixed64();case re.BYTES:return e.bytes();case re.FIXED32:return e.fixed32();case re.SFIXED32:return e.sfixed32();case re.SFIXED64:return e.sfixed64();case re.SINT64:return e.sint64();case re.UINT32:return e.uint32();case re.SINT32:return e.sint32()}}function Kr(e,t){var r;const n=Um(Ww,vm(e));return n.messageType.forEach(vl),n.dependency=(r=t==null?void 0:t.map(i=>i.proto.name))!==null&&r!==void 0?r:[],dm(n,i=>t==null?void 0:t.find(o=>o.proto.name===i)).getFile(n.name)}const Ll=Kr("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),qh=br(Ll,0,0),jw=Eo(Ll,0),Ta=Co(jw),Kw=Kr("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Yw=br(Kw,0);function Xw(e,t,r){let n=!1;return r||(r=_t(Yw),n=!0),r.value=Fw(e,t),r.typeUrl=qw(t.$typeName),n?r:void 0}function Jw(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,n=Hm(e.typeUrl);return r===n}function zw(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(Hm(e.typeUrl));if(!(!r||!Jw(e,r)))return Um(r,e.value)}function qw(e){return`type.googleapis.com/${e}`}function Hm(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const Ol=Kr("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Qw=br(Ol,0),$m=br(Ol,1),eE=br(Ol,2);var dc;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(dc||(dc={}));const tE=Kr("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),zi=Kr("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[tE,Ll]),Gm=br(zi,12),hc=br(zi,13),rE=Eo(zi,19,0),Cr=Co(rE),nE=Eo(zi,2),iE=Co(nE);function sE(e,t){Zm(t,e);const r=aE(e.$unknown,t),[n,i,o]=ko(t);for(const u of r)Wm(n,new Cl(u.data),i,u.wireType,{readUnknownFields:!0});return o()}function oE(e,t,r){var n;Zm(t,e);const i=((n=e.$unknown)!==null&&n!==void 0?n:[]).filter(c=>c.no!==t.number),[o,u]=ko(t,r),s=new Cm;Fm(s,{writeUnknownFields:!0},o,u);const a=new Cl(s.finish());for(;a.pos<a.len;){const[c,m]=a.tag(),f=a.skip(m,c);i.push({no:c,wireType:m,data:f})}e.$unknown=i}function aE(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function ko(e,t){const r=e.typeName,n=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),i=Object.assign(Object.assign({},e.extendee),{fields:[n],members:[n],oneofs:[]}),o=_t(i,t!==void 0?{[r]:t}:void 0);return[nr(i,o),n,()=>{const u=o[r];if(u===void 0){const s=e.message;return Ji(s)?_n(s.fields[0].scalar,s.fields[0].longAsString):_t(s)}return u}]}function Zm(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const cE=3,lE=2,Qh={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function uE(e){return e?Object.assign(Object.assign({},Qh),e):Qh}function dE(e,t,r){return qi(nr(e,t),uE(r))}function qi(e,t){var r;const n=gE(e,t);if(n!==void 0)return n;const i={};for(const o of e.sortedFields){if(!e.isSet(o)){if(o.presence==cE)throw new Error(`cannot encode ${o} to JSON: required field not set`);if(!t.alwaysEmitImplicit||o.presence!==lE)continue}const u=ef(o,e.get(o),t);u!==void 0&&(i[pE(o,t)]=u)}if(t.registry){const o=new Set;for(const{no:u}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!o.has(u)){o.add(u);const s=t.registry.getExtensionFor(e.desc,u);if(!s)continue;const a=sE(e.message,s),[c,m]=ko(s,a),f=ef(m,c.get(m),t);f!==void 0&&(i[s.jsonName]=f)}}return i}function ef(e,t,r){switch(e.fieldKind){case"scalar":return Io(e,t);case"message":return qi(t,r);case"enum":return Dl(e.enum,t,r.enumAsInteger);case"list":return fE(t,r);case"map":return hE(t,r)}}function hE(e,t){const r=e.field(),n={};switch(r.mapKind){case"scalar":for(const[i,o]of e)n[i]=Io(r,o);break;case"message":for(const[i,o]of e)n[i]=qi(o,t);break;case"enum":for(const[i,o]of e)n[i]=Dl(r.enum,o,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?n:void 0}function fE(e,t){const r=e.field(),n=[];switch(r.listKind){case"scalar":for(const i of e)n.push(Io(r,i));break;case"enum":for(const i of e)n.push(Dl(r.enum,i,t.enumAsInteger));break;case"message":for(const i of e)n.push(qi(i,t));break}return t.alwaysEmitImplicit||n.length>0?n:void 0}function Dl(e,t,r){var n;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${St(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const i=e.value[t];return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:t}function Io(e,t){var r,n,i,o,u,s;switch(e.scalar){case re.INT32:case re.SFIXED32:case re.SINT32:case re.FIXED32:case re.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=cn(e,t))===null||r===void 0?void 0:r.message}`);return t;case re.FLOAT:case re.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(n=cn(e,t))===null||n===void 0?void 0:n.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case re.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(i=cn(e,t))===null||i===void 0?void 0:i.message}`);return t;case re.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(o=cn(e,t))===null||o===void 0?void 0:o.message}`);return t;case re.UINT64:case re.FIXED64:case re.INT64:case re.SFIXED64:case re.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(u=cn(e,t))===null||u===void 0?void 0:u.message}`);return t.toString();case re.BYTES:if(t instanceof Uint8Array)return gw(t);throw new Error(`cannot encode ${e} to JSON: ${(s=cn(e,t))===null||s===void 0?void 0:s.message}`)}}function pE(e,t){return t.useProtoFieldName?e.name:e.jsonName}function gE(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return mE(e.message,t);case"google.protobuf.Timestamp":return _E(e.message);case"google.protobuf.Duration":return vE(e.message);case"google.protobuf.FieldMask":return bE(e.message);case"google.protobuf.Struct":return jm(e.message);case"google.protobuf.Value":return Fl(e.message);case"google.protobuf.ListValue":return Km(e.message);default:if(Ji(e.desc)){const r=e.desc.fields[0];return Io(r,e.get(r))}return}}function mE(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let n,i;if(r&&(n=zw(e,r),n&&(i=r.getMessage(n.$typeName))),!i||!n)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let o=qi(nr(i,n),t);return(i.typeName.startsWith("google.protobuf.")||o===null||Array.isArray(o)||typeof o!="object")&&(o={value:o}),o["@type"]=e.typeUrl,o}function vE(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function bE(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Vi(t)}).join(",")}function jm(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Fl(n);return t}function Fl(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return jm(e.kind.value);case"listValue":return Km(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function Km(e){return e.values.map(Fl)}function _E(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const n=(e.nanos+1e9).toString().substring(1);n.substring(3)==="000000"?r="."+n.substring(0,3)+"Z":n.substring(6)==="000"?r="."+n.substring(0,6)+"Z":r="."+n+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const tf={ignoreUnknownFields:!1};function yE(e){return e?Object.assign(Object.assign({},tf),e):tf}function SE(e,t,r){const n=nr(e);try{Jn(n,t,yE(r))}catch(i){throw bw(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return n.message}function Jn(e,t,r){var n;if(xE(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${St(t)}`);const i=new Map,o=new Map;for(const u of e.desc.fields)o.set(u.name,u).set(u.jsonName,u);for(const[u,s]of Object.entries(t)){const a=o.get(u);if(a){if(a.oneof){if(s===null&&a.fieldKind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Ut(a.oneof,`oneof set multiple times by ${c.name} and ${a.name}`);i.set(a.oneof,a)}rf(e,a,s,r)}else{let c;if(u.startsWith("[")&&u.endsWith("]")&&(c=(n=r.registry)===null||n===void 0?void 0:n.getExtension(u.substring(1,u.length-1)))&&c.extendee.typeName===e.desc.typeName){const[m,f,b]=ko(c);rf(m,f,s,r),oE(e.message,c,b())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${u}" is unknown`)}}}function rf(e,t,r,n){switch(t.fieldKind){case"scalar":IE(e,t,r);break;case"enum":kE(e,t,r,n);break;case"message":CE(e,t,r,n);break;case"list":EE(e.get(t),r,n);break;case"map":wE(e.get(t),r,n);break}}function wE(e,t,r){if(t===null)return;const n=e.field();if(typeof t!="object"||Array.isArray(t))throw new Ut(n,"expected object, got "+St(t));for(const[i,o]of Object.entries(t)){if(o===null)throw new Ut(n,"map value must not be null");let u;switch(n.mapKind){case"message":const a=nr(n.message);Jn(a,o,r),u=a;break;case"enum":if(u=Vl(n.enum,o,r.ignoreUnknownFields,!0),u===Ao)return;break;case"scalar":u=Ro(n,o,!0);break}const s=AE(n.mapKey,i);e.set(s,u)}}function EE(e,t,r){if(t===null)return;const n=e.field();if(!Array.isArray(t))throw new Ut(n,"expected Array, got "+St(t));for(const i of t){if(i===null)throw new Ut(n,"list item must not be null");switch(n.listKind){case"message":const o=nr(n.message);Jn(o,i,r),e.add(o);break;case"enum":const u=Vl(n.enum,i,r.ignoreUnknownFields,!0);u!==Ao&&e.add(u);break;case"scalar":e.add(Ro(n,i,!0));break}}}function CE(e,t,r,n){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const i=e.isSet(t)?e.get(t):nr(t.message);Jn(i,r,n),e.set(t,i)}function kE(e,t,r,n){const i=Vl(t.enum,r,n.ignoreUnknownFields,!1);i===xo?e.clear(t):i!==Ao&&e.set(t,i)}function IE(e,t,r){const n=Ro(t,r,!1);n===xo?e.clear(t):e.set(t,n)}const Ao=Symbol();function Vl(e,t,r,n){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:n?e.values[0].number:xo;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=e.values.find(o=>o.name===t);if(i!==void 0)return i.number;if(r)return Ao;break}throw new Error(`cannot decode ${e} from JSON: ${St(t)}`)}const xo=Symbol();function Ro(e,t,r){if(t===null)return r?_n(e.scalar,!1):xo;switch(e.scalar){case re.DOUBLE:case re.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Ut(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Ut(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const n=Number(t);if(!Number.isFinite(n))break;return n}break;case re.INT32:case re.FIXED32:case re.SFIXED32:case re.SINT32:case re.UINT32:return Ym(t);case re.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return vm(t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Ut(e,i)}}break}return t}function AE(e,t){switch(e){case re.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case re.INT32:case re.FIXED32:case re.UINT32:case re.SFIXED32:case re.SINT32:return Ym(t);default:return t}}function Ym(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function xE(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return RE(e.message,t,r),!0;case"google.protobuf.Timestamp":return NE(e.message,t),!0;case"google.protobuf.Duration":return TE(e.message,t),!0;case"google.protobuf.FieldMask":return BE(e.message,t),!0;case"google.protobuf.Struct":return Xm(e.message,t),!0;case"google.protobuf.Value":return Ml(e.message,t),!0;case"google.protobuf.ListValue":return Jm(e.message,t),!0;default:if(Ji(e.desc)){const n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,Ro(n,t,!0)),!0}return!1}}function RE(e,t,r){var n;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${St(t)}`);if(Object.keys(t).length==0)return;const i=t["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const o=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!o.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const u=(n=r.registry)===null||n===void 0?void 0:n.getMessage(o);if(!u)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${i} is not in the type registry`);const s=nr(u);if(o.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const a=t.value;Jn(s,a,r)}else{const a=Object.assign({},t);delete a["@type"],Jn(s,a,r)}Xw(s.desc,s.message,e)}function NE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const n=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(n))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=st.parse(n/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function TE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);const n=Number(r[1]);if(n>315576e6||n<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);if(e.seconds=st.parse(n),typeof r[2]!="string")return;const i=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(i),(n<0||Object.is(n,-0))&&(e.nanos=-e.nanos)}function BE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${St(t)}`);if(t==="")return;function r(n){if(n.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const i=n.replace(/[A-Z]/g,o=>"_"+o.toLowerCase());return i[0]==="_"?i.substring(1):i}e.paths=t.split(",").map(r)}function Xm(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`);for(const[r,n]of Object.entries(t)){const i=_t($m);Ml(i,n),e.fields[r]=i}}function Ml(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:dc.NULL_VALUE};else if(Array.isArray(t)){const r=_t(eE);Jm(r,t),e.kind={case:"listValue",value:r}}else{const r=_t(Qw);Xm(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`)}return e}function Jm(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${St(t)}`);for(const r of t){const n=_t($m);Ml(n,r),e.values.push(n)}}const LE=Kr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),OE=Eo(LE,0),DE=Co(OE),FE=Kr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),zm=Kr("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[FE,zi]),fc=br(zm,3),VE=br(zm,4),qm="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ao=32,ME=16,Qm=10,nf=0xffffffffffff;var hn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(hn||(hn={}));class gi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function UE(e){const t=Math.floor(e()*ao)%ao;return qm.charAt(t)}function PE(e){const t=WE(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new gi(hn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function WE(){return GE()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function HE(e,t){let r="";for(;e>0;e--)r=UE(t)+r;return r}function $E(e,t=Qm){if(isNaN(e))throw new gi(hn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>nf)throw new gi(hn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${nf}: ${e}`);if(e<0)throw new gi(hn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new gi(hn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%ao,n=qm.charAt(r)+n,e=(e-r)/ao;return n}function GE(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ZE(e,t){const r=PE(),n=Date.now();return $E(n,Qm)+HE(ME,r)}const Ct=[];for(let e=0;e<256;++e)Ct.push((e+256).toString(16).slice(1));function jE(e,t=0){return(Ct[e[t+0]]+Ct[e[t+1]]+Ct[e[t+2]]+Ct[e[t+3]]+"-"+Ct[e[t+4]]+Ct[e[t+5]]+"-"+Ct[e[t+6]]+Ct[e[t+7]]+"-"+Ct[e[t+8]]+Ct[e[t+9]]+"-"+Ct[e[t+10]]+Ct[e[t+11]]+Ct[e[t+12]]+Ct[e[t+13]]+Ct[e[t+14]]+Ct[e[t+15]]).toLowerCase()}let Ba;const KE=new Uint8Array(16);function YE(){if(!Ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ba=crypto.getRandomValues.bind(crypto)}return Ba(KE)}const XE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sf={randomUUID:XE};function JE(e,t,r){var n;if(sf.randomUUID&&!e)return sf.randomUUID();e=e||{};const i=e.random??((n=e.rng)==null?void 0:n.call(e))??YE();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,jE(i)}const zE=5e3,qE=1e3,Ns=4e3,of=1e3;var ev=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(ev||{});class tv{constructor({knownID:t,runID:r,sequence:n,options:i}){this.queue=new tr,this.subscriptions=[],this.reconnect=new tr,this.client=new pt,this._latencies=new tr,this._latenciesConnectable=on(this._latencies.asObservable().pipe(X2((o,u)=>{if(u.latency<0){const s=o.get(u.streamID);s&&o.set(u.streamID,{...s,readyState:u.readyState})}else o.set(u.streamID,u);return o},new Map))),this._errors=new tr,this._errorsConnectable=on(this._errors.asObservable()),this._stdout=new tr,this._stderr=new tr,this._exitCode=new tr,this._pid=new tr,this._mimeType=new tr,this._stdoutConnectable=on(this._stdout.asObservable()),this._stderrConnectable=on(this._stderr.asObservable()),this._exitCodeConnectable=on(this._exitCode.asObservable()),this._pidConnectable=on(this._pid.asObservable()),this._mimeTypeConnectable=on(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=n,this.runnerEndpoint=i.runnerEndpoint,this.interceptors=i.interceptors,this.autoReconnect=i.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(hh(of,Xi,{leading:!0,trailing:!0}),dh(o=>this.useSocketClient(o.streamID).pipe(dh(u=>this.useHeartbeat(u,o))))).pipe(Mg()),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 U2(qE).pipe(fr(()=>this.autoReconnect),Ca(this.reconnect),fr(([,t])=>t.heartbeat==="CONTINUOUS"),Ca(this.latencies),Gt(([,t])=>Array.from(t.values()).filter(r=>r.readyState===WebSocket.OPEN&&r.latency>=Ns)),fr(t=>t.length>0),hh(of)).subscribe({next:t=>{console.log(new Date,"Triggering reconnect",t),this.connect()},complete:()=>{console.log("Monitor complete")},error:t=>{console.error("Error in monitor",t)}})}process(){const t=this.client.pipe(fr(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN),uh(1)),r=this.queue.pipe(Z2(()=>t),fr(i=>i.length>0),Gt(i=>i.sort((o,u)=>{const s=a=>{var c;return!!((c=a.payload.value)!=null&&c.config)};return s(u)?1:s(o)?-1:0}))),n=this.queue.pipe(J2(t));return P2(r.pipe(dn(i=>i)),n).pipe(Ca(this.client),As(([,i])=>i.readyState===WebSocket.OPEN),dn(async([i,o])=>{await cf({req:i,interceptors:this.interceptors,socket:o,knownID:this.knownID,runID:this.runID})})).subscribe({error:i=>{this._errors.next(i)}})}useSocketClient(t){return new pt(r=>{const n=new URL(this.runnerEndpoint);n.searchParams.set("id",t),n.searchParams.set("runID",this.runID);const i=new WebSocket(n.toString()),o=c=>{if(console.log(new Date,`WebSocket transport ${t} closed`,c),c.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},u=c=>{console.log(new Date,`WebSocket transport ${t} error`,c),this.autoReconnect||r.error(c)},s=c=>{var m,f;if(typeof c.data!="string"){console.warn("Unexpected WebSocket message type:",typeof c.data);return}let b;try{b=af(c.data),console.log("Received WebsocketResponse:",b)}catch(y){console.error("Failed to parse WebsocketResponse:",y)}const _=b.status;if(_&&_.code!==DE.OK){r.error(_);return}if(b.pong)return;const k=b.payload.value;if(k.stdoutData&&k.stdoutData.length>0&&((m=this.callback)==null||m.call(this,{type:Me.terminalStdout,output:{"runme.dev/id":this.knownID,data:k.stdoutData}}),this._stdout.next(k.stdoutData)),k.stderrData&&k.stderrData.length>0&&((f=this.callback)==null||f.call(this,{type:Me.terminalStderr,output:{"runme.dev/id":this.knownID,data:k.stderrData}}),this._stderr.next(k.stderrData)),k.exitCode!==void 0&&(this._exitCode.next(k.exitCode),r.complete()),k.pid!==void 0&&this._pid.next(k.pid),k.mimeType){const y=k.mimeType.split(";")[0];this._mimeType.next(y)}},a=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(i)};return i.addEventListener("close",o),i.addEventListener("error",u),i.addEventListener("message",s),i.addEventListener("open",a),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),i.removeEventListener("close",o),i.removeEventListener("error",u),i.removeEventListener("message",s),i.removeEventListener("open",a),i.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(_t(fc,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:n}){return new pt(i=>{const o=ec(t,"message").pipe(As(()=>t.readyState===WebSocket.OPEN),Gt(a=>af(a.data)),Gt(a=>a.pong),fr(a=>a!==void 0),Gt(a=>({receivedAt:BigInt(Date.now()),pong:a}))),u=(n==="INITIAL"?Si(0):Si(0,zE)).pipe(As(()=>t.readyState===WebSocket.OPEN),Gt(()=>{const a={timestamp:BigInt(Date.now())};return _t(fc,{ping:a})}),dn(async a=>(await cf({req:a,interceptors:this.interceptors,socket:t}),a)),Gt(a=>a.ping)).pipe(fr(a=>(a==null?void 0:a.timestamp)!==void 0),dn(a=>$2(o.pipe(fr(c=>c.pong.timestamp===a.timestamp),uh(1),Gt(c=>{const m=a.timestamp,f=c.receivedAt;return Number(f-m)})),Si(Ns).pipe(Gt(()=>{throw new Error(`Pong not received within ${Ns}ms for stream ${r}`)}))).pipe(Dg(c=>(this._latencies.next({streamID:r,latency:Ns,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",c.message),C2(null))))),Y2(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),z2(a=>{a!==null&&this._latencies.next({streamID:r,latency:a,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),s=[];return s.push(u.subscribe({error:a=>{console.error("Unexpected error sending heartbeat",a)}})),i.next(t),()=>{s.forEach(a=>a.unsubscribe())}})}connect(t="CONTINUOUS"){const r=QE(),n=this.latencies.pipe(Gt(i=>{const o=i.get(r);return o===void 0?null:o}),As(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),n}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function af(e){const t=JSON.parse(e);return SE(VE,t)}async function cf({req:e,interceptors:t,socket:r,knownID:n,runID:i}){n&&(e.knownId=n),i&&(e.runId=i);const o={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let u=async a=>({stream:!1,message:{},method:{},service:{},header:a.header});for(const a of t.concat().reverse())u=a(u);const s=(await u(o)).header.get("Authorization");s&&e&&(e.authorization=s),r.send(JSON.stringify(dE(fc,e)))}function QE(){return JE().replace(/-/g,"")}function Ul(){return`run_${ZE()}`}var e3=Object.defineProperty,t3=Object.getOwnPropertyDescriptor,rv=e=>{throw TypeError(e)},Rr=(e,t,r,n)=>{for(var i=n>1?void 0:n?t3(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(n?u(t,r,i):u(i))||i);return n&&i&&e3(t,r,i),i},Pl=(e,t,r)=>t.has(e)||rv("Cannot "+r),nt=(e,t,r)=>(Pl(e,t,"read from private field"),t.get(e)),Ts=(e,t,r)=>t.has(e)?rv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),co=(e,t,r,n)=>(Pl(e,t,"write to private field"),t.set(e,r),r),Zt=(e,t,r)=>(Pl(e,t,"access private method"),r),It,pr,fn,Dt,nv,Wl,iv,pc,lo,gc,sv,ov;const r3="runme-console";let vr=class extends At{constructor(){super(),Ts(this,Dt),this.disposables=[],Ts(this,It),Ts(this,pr,[]),Ts(this,fn,{rows:34,cols:100,x:0,y:0}),this.takeFocus=!0,this.view={theme:"dark",fontFamily:"monospace",fontSize:12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,smoothScrollDuration:0,scrollback:4e3},this.commands=[],this.stream={knownID:this.id,runID:Ul(),sequence:0,languageID:"sh",runnerEndpoint:"ws://localhost:8080/ws",reconnect:!0},this.interceptors=[],Zt(this,Dt,ov).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");Zt(this,Dt,nv).call(this),Zt(this,Dt,pc).call(this),Zt(this,Dt,gc).call(this)}disconnectedCallback(){super.disconnectedCallback(),Zt(this,Dt,lo).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&Zt(this,Dt,Wl).call(this),(e.has("id")||e.has("stream")||e.has("commands"))&&(Zt(this,Dt,pc).call(this),Zt(this,Dt,gc).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return Ne`<div></div>`}dispose(){Zt(this,Dt,lo).call(this),this.disposables.forEach(({dispose:e})=>e())}};It=new WeakMap;pr=new WeakMap;fn=new WeakMap;Dt=new WeakSet;nv=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),Zt(this,Dt,Wl).call(this),this.shadowRoot.appendChild(this.consoleView),Zt(this,Dt,iv).call(this))};Wl=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons","false"),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.view.theme),this.view.fontFamily&&this.consoleView.setAttribute("fontFamily",this.view.fontFamily),this.view.fontSize&&this.consoleView.setAttribute("fontSize",this.view.fontSize.toString()),this.view.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.view.cursorStyle),this.view.cursorBlink&&this.consoleView.setAttribute("cursorBlink",this.view.cursorBlink.toString()),this.view.cursorWidth&&this.consoleView.setAttribute("cursorWidth",this.view.cursorWidth.toString()),this.view.smoothScrollDuration&&this.consoleView.setAttribute("smoothScrollDuration",this.view.smoothScrollDuration.toString()),this.view.scrollback&&this.consoleView.setAttribute("scrollback",this.view.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()))};iv=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};pc=function(){if(nt(this,It))return;const e=this.stream.knownID??this.id;(!e||!this.stream.runID||!this.stream.runnerEndpoint)&&console.warn("Missing required stream properties"),co(this,It,new tv({knownID:e,runID:this.stream.runID,sequence:this.stream.sequence??0,options:{runnerEndpoint:this.stream.runnerEndpoint,autoReconnect:this.stream.reconnect,interceptors:this.interceptors??[]}}));const t=nt(this,It).connect().subscribe();nt(this,pr).push(()=>t.unsubscribe());const r=nt(this,It).stdout.subscribe(s=>{this.dispatchEvent(new CustomEvent("stdout",{detail:s})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(s)}),n=nt(this,It).stderr.subscribe(s=>{this.dispatchEvent(new CustomEvent("stderr",{detail:s}))}),i=nt(this,It).exitCode.subscribe(s=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:s})),Zt(this,Dt,lo).call(this)}),o=nt(this,It).pid.subscribe(s=>{this.dispatchEvent(new CustomEvent("pid",{detail:s}))}),u=nt(this,It).mimeType.subscribe(s=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:s}))});nt(this,pr).push(()=>r.unsubscribe()),nt(this,pr).push(()=>n.unsubscribe()),nt(this,pr).push(()=>i.unsubscribe()),nt(this,pr).push(()=>o.unsubscribe()),nt(this,pr).push(()=>u.unsubscribe())};lo=function(){var e;nt(this,pr).forEach(t=>{try{t()}catch{}}),co(this,pr,[]),(e=nt(this,It))==null||e.close(),co(this,It,void 0)};gc=function(){if(!nt(this,It)||!this.commands.length||!this.stream.runID)return;const e=Zt(this,Dt,sv).call(this);e&&nt(this,It).sendExecuteRequest(e)};sv=function(){const e=this.stream.languageID||"sh",t=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(e),r=_t(hc,{sessionStrategy:iE.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:e,background:!1,fileExtension:"",env:[`RUNME_ID=${this.stream.knownID??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:this.stream.runID,knownId:this.stream.knownID??this.id},winsize:_t(Gm,nt(this,fn))});return this.commands.length===0?(r.config.mode=Ta.INLINE,r.config.source={case:"commands",value:_t(qh,{items:["zsh -l"]})}):t?(r.config.source={case:"commands",value:_t(qh,{items:this.commands})},r.config.mode=Ta.INLINE):(r.config.source={case:"script",value:this.commands.join(`
|
|
1783
|
-
`)},
|
|
1781
|
+
`;ct([Te({type:String})],et.prototype,"id",2);ct([Te({type:Boolean,converter:e=>e!=="false"})],et.prototype,"buttons",2);ct([Te({type:Boolean,converter:e=>e!=="false"})],et.prototype,"takeFocus",2);ct([Te({type:String})],et.prototype,"theme",2);ct([Te({type:String})],et.prototype,"fontFamily",2);ct([Te({type:Number})],et.prototype,"fontSize",2);ct([Te({type:String})],et.prototype,"cursorStyle",2);ct([Te({type:Boolean})],et.prototype,"cursorBlink",2);ct([Te({type:Number})],et.prototype,"cursorWidth",2);ct([Te({type:Number})],et.prototype,"smoothScrollDuration",2);ct([Te({type:Number})],et.prototype,"scrollback",2);ct([Te({type:String})],et.prototype,"initialContent",2);ct([Te({type:Number})],et.prototype,"initialRows",2);ct([Te({type:Number})],et.prototype,"lastLine",2);ct([Te({type:Boolean})],et.prototype,"isLoading",2);ct([Te({type:Boolean})],et.prototype,"isCreatingEscalation",2);ct([Te()],et.prototype,"shareUrl",2);ct([Te()],et.prototype,"escalationUrl",2);ct([Te({type:Boolean})],et.prototype,"isUpdatedReady",2);ct([Te({type:Boolean})],et.prototype,"isAutoSaveEnabled",2);ct([Te({type:Boolean})],et.prototype,"isPlatformAuthEnabled",2);ct([Te({type:Boolean})],et.prototype,"isDaggerOutput",2);et=ct([zt(XS)],et);function um(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function JS(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function Vi(e){let t=!1;const r=[];for(let n=0;n<e.length;n++){let i=e.charAt(n);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),r.push(i);break}}return r.join("")}const zS=new Set(["constructor","toString","toJSON","valueOf"]);function Mi(e){return zS.has(e)?e+"$":e}function qS(){let e=0,t=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ka(e,t,r){for(let o=0;o<28;o=o+7){const l=e>>>o,s=!(!(l>>>7)&&t==0),a=(s?l|128:l)&255;if(r.push(a),!s)return}const n=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(r.push((i?n|128:n)&255),!!i){for(let o=3;o<31;o=o+7){const l=t>>>o,s=!!(l>>>7),a=(s?l|128:l)&255;if(r.push(a),!s)return}r.push(t>>>31&1)}}const Ws=4294967296;function wh(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let n=0,i=0;function o(l,s){const a=Number(e.slice(l,s));i*=r,n=n*r+a,n>=Ws&&(i=i+(n/Ws|0),n=n%Ws)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?hm(n,i):yl(n,i)}function QS(e,t){let r=yl(e,t);const n=r.hi&2147483648;n&&(r=hm(r.lo,r.hi));const i=dm(r.lo,r.hi);return n?"-"+i:i}function dm(e,t){if({lo:e,hi:t}=ew(e,t),t<=2097151)return String(Ws*t+e);const r=e&16777215,n=(e>>>24|t<<8)&16777215,i=t>>16&65535;let o=r+n*6777216+i*6710656,l=n+i*8147497,s=i*2;const a=1e7;return o>=a&&(l+=Math.floor(o/a),o%=a),l>=a&&(s+=Math.floor(l/a),l%=a),s.toString()+Eh(l)+Eh(o)}function ew(e,t){return{lo:e>>>0,hi:t>>>0}}function yl(e,t){return{lo:e|0,hi:t|0}}function hm(e,t){return t=~t,e?e=~e+1:t+=1,yl(e,t)}const Eh=e=>{const t=String(e);return"0000000".slice(t.length)+t};function oc(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function tw(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const ot=rw();function rw(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const l=typeof o=="bigint"?o:BigInt(o);if(l>r||l<t)throw new Error(`invalid int64: ${o}`);return l},uParse(o){const l=typeof o=="bigint"?o:BigInt(o);if(l>i||l<n)throw new Error(`invalid uint64: ${o}`);return l},enc(o){return e.setBigInt64(0,this.parse(o),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(o){return e.setBigInt64(0,this.uParse(o),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(o,l){return e.setInt32(0,o,!0),e.setInt32(4,l,!0),e.getBigInt64(0,!0)},uDec(o,l){return e.setInt32(0,o,!0),e.setInt32(4,l,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(t){return typeof t!="string"&&(t=t.toString()),Ch(t),t},uParse(t){return typeof t!="string"&&(t=t.toString()),kh(t),t},enc(t){return typeof t!="string"&&(t=t.toString()),Ch(t),wh(t)},uEnc(t){return typeof t!="string"&&(t=t.toString()),kh(t),wh(t)},dec(t,r){return QS(t,r)},uDec(t,r){return dm(t,r)}}}function Ch(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function kh(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var te;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(te||(te={}));function bn(e,t){switch(e){case te.STRING:return"";case te.BOOL:return!1;case te.DOUBLE:case te.FLOAT:return 0;case te.INT64:case te.UINT64:case te.SFIXED64:case te.FIXED64:case te.SINT64:return t?"0":ot.zero;case te.BYTES:return new Uint8Array(0);default:return 0}}function nw(e,t){switch(e){case te.BOOL:return t===!1;case te.STRING:return t==="";case te.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const fm=2,Ir=Symbol.for("reflect unsafe local");function pm(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(n=>n.localName===r)}function iw(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=fm)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!nw(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Ui(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function gm(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function mm(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function sw(e,t){const r=t.localName;if(t.oneof){const n=t.oneof.localName;e[n].case===r&&(e[n]={case:void 0})}else if(t.presence!=fm)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=bn(t.scalar,t.longAsString);break}}function Sl(e){for(const t of e.field)Ui(t,"jsonName")||(t.jsonName=Vi(t.name));e.nestedType.forEach(Sl)}function ow(e,t){const r=e.values.find(n=>n.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function aw(e,t){switch(e){case te.STRING:return t;case te.BYTES:{const r=cw(t);if(r===!1)throw new Error(`cannot parse ${te[e]} default value: ${t}`);return r}case te.INT64:case te.SFIXED64:case te.SINT64:return ot.parse(t);case te.UINT64:case te.FIXED64:return ot.uParse(t);case te.DOUBLE:case te.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case te.BOOL:return t==="true";case te.INT32:case te.UINT32:case te.SINT32:case te.FIXED32:case te.SFIXED32:return parseInt(t,10)}}function cw(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(n){if(this.tail.length>=n){const i=this.tail.substring(0,n);return this.tail=this.tail.substring(n),i}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,8);if(Number.isNaN(o))return!1;t.push(o);break}case"x":{const n=r.c,i=r.take(2);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;t.push(o);break}case"u":{const n=r.c,i=r.take(4);if(i===!1)return!1;const o=parseInt(n+i,16);if(Number.isNaN(o))return!1;const l=new Uint8Array(4);new DataView(l.buffer).setInt32(0,o,!0),t.push(l[0],l[1],l[2],l[3]);break}case"U":{const n=r.c,i=r.take(8);if(i===!1)return!1;const o=ot.uEnc(n+i),l=new Uint8Array(8),s=new DataView(l.buffer);s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),t.push(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*ac(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*ac(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*ac(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function vm(...e){const t=lw();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)Nh(r,t);return t}if("$typeName"in e[0]){let r=function(l){const s=[];for(const a of l.dependency){if(t.getFile(a)!=null||o.has(a))continue;const c=i(a);if(!c)throw new Error(`Unable to resolve ${a}, imported by ${l.name}`);"kind"in c?t.addFile(c,!1,!0):(o.add(c.name),s.push(c))}return s.concat(...s.map(r))};const n=e[0],i=e[1],o=new Set;for(const l of[n,...r(n)].reverse())Nh(l,t)}else for(const r of e)for(const n of r.files)t.addFile(n);return t}function lw(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(n,i,o){if(r.set(n.proto.name,n),!i)for(const l of ac(n))this.add(l);if(o)for(const l of n.dependencies)this.addFile(l,i,o)},add(n){if(n.kind=="extension"){let i=t.get(n.extendee.typeName);i||t.set(n.extendee.typeName,i=new Map),i.set(n.number,n)}e.set(n.typeName,n)},get(n){return e.get(n)},getFile(n){return r.get(n)},getMessage(n){const i=e.get(n);return(i==null?void 0:i.kind)=="message"?i:void 0},getEnum(n){const i=e.get(n);return(i==null?void 0:i.kind)=="enum"?i:void 0},getExtension(n){const i=e.get(n);return(i==null?void 0:i.kind)=="extension"?i:void 0},getExtensionFor(n,i){var o;return(o=t.get(n.typeName))===null||o===void 0?void 0:o.get(i)},getService(n){const i=e.get(n);return(i==null?void 0:i.kind)=="service"?i:void 0}}}const uw=998,dw=999,hw=9,Pi=10,wi=11,fw=12,Ih=14,wl=3,pw=2,Ah=1,gw=0,xh=1,Rh=2,mw=3,vw=1,bw=2,_w=1,bm={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Nh(e,t){var r,n;const i={kind:"file",proto:e,deprecated:(n=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&n!==void 0?n:!1,edition:Ew(e),name:e.name.replace(/\.proto$/,""),dependencies:Cw(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},o=new Map,l={get(s){return o.get(s)},add(s){var a;cr(((a=s.proto.options)===null||a===void 0?void 0:a.mapEntry)===!0),o.set(s.typeName,s)}};for(const s of e.enumType)_m(s,i,void 0,t);for(const s of e.messageType)ym(s,i,void 0,t,l);for(const s of e.service)yw(s,i,t);cc(i,t);for(const s of o.values())lc(s,t,l);for(const s of i.messages)lc(s,t,l),cc(s,t);t.addFile(i,!0)}function cc(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const n=uc(r,e,t);e.extensions.push(n),t.add(n)}break;case"message":for(const r of e.proto.extension){const n=uc(r,e,t);e.nestedExtensions.push(n),t.add(n)}for(const r of e.nestedMessages)cc(r,t);break}}function lc(e,t,r){const n=e.proto.oneofDecl.map(o=>ww(o,e)),i=new Set;for(const o of e.proto.field){const l=Aw(o,n),s=uc(o,e,t,l,r);e.fields.push(s),e.field[s.localName]=s,l===void 0?e.members.push(s):(l.fields.push(s),i.has(l)||(i.add(l),e.members.push(l)))}for(const o of n.filter(l=>i.has(l)))e.oneofs.push(o);for(const o of e.nestedMessages)lc(o,t,r)}function _m(e,t,r,n){var i,o,l,s,a;const c=kw(e.name,e.value),g={kind:"enum",proto:e,deprecated:(o=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,file:t,parent:r,open:!0,name:e.name,typeName:Eo(e,r,t),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};g.open=Tw(g),n.add(g);for(const f of e.value){const b=f.name;g.values.push(g.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(l=f.options)===null||l===void 0?void 0:l.deprecated)!==null&&s!==void 0?s:!1,parent:g,name:b,localName:Mi(c==null?b:b.substring(c.length)),number:f.number,toString(){return`enum value ${g.typeName}.${b}`}})}((a=r==null?void 0:r.nestedEnums)!==null&&a!==void 0?a:t.enums).push(g)}function ym(e,t,r,n,i){var o,l,s,a;const c={kind:"message",proto:e,deprecated:(l=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&l!==void 0?l:!1,file:t,parent:r,name:e.name,typeName:Eo(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?i.add(c):(((a=r==null?void 0:r.nestedMessages)!==null&&a!==void 0?a:t.messages).push(c),n.add(c));for(const g of e.enumType)_m(g,t,c,n);for(const g of e.nestedType)ym(g,t,c,n,i)}function yw(e,t,r){var n,i;const o={kind:"service",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:Eo(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),r.add(o);for(const l of e.method){const s=Sw(l,o,r);o.methods.push(s),o.method[s.localName]=s}}function Sw(e,t,r){var n,i,o,l;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const a=r.getMessage(Er(e.inputType)),c=r.getMessage(Er(e.outputType));cr(a,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),cr(c,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const g=e.name;return{kind:"rpc",proto:e,deprecated:(i=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:g,localName:Mi(g.length?Mi(g[0].toLowerCase()+g.substring(1)):g),methodKind:s,input:a,output:c,idempotency:(l=(o=e.options)===null||o===void 0?void 0:o.idempotencyLevel)!==null&&l!==void 0?l:gw,toString(){return`rpc ${t.typeName}.${g}`}}}function ww(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Mi(Vi(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function uc(e,t,r,n,i){var o,l,s;const a=i===void 0,c={kind:"field",proto:e,deprecated:(l=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&l!==void 0?l:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:xw(e,n,a,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(a){const _=t.kind=="file"?t:t.file,k=t.kind=="file"?void 0:t,y=Eo(e,k,_);c.kind="extension",c.file=_,c.parent=k,c.oneof=void 0,c.typeName=y,c.jsonName=`[${y}]`,c.toString=()=>`extension ${y}`;const d=r.getMessage(Er(e.extendee));cr(d,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),c.extendee=d}else{const _=t;cr(_.kind=="message"),c.parent=_,c.oneof=n,c.localName=n?Vi(e.name):Mi(Vi(e.name)),c.jsonName=e.jsonName,c.toString=()=>`field ${_.typeName}.${e.name}`}const g=e.label,f=e.type,b=(s=e.options)===null||s===void 0?void 0:s.jstype;if(g===wl){const _=f==wi?i==null?void 0:i.get(Er(e.typeName)):void 0;if(_){c.fieldKind="map";const{key:k,value:y}=Nw(_);return c.mapKey=k.scalar,c.mapKind=y.fieldKind,c.message=y.message,c.delimitedEncoding=!1,c.enum=y.enum,c.scalar=y.scalar,c}switch(c.fieldKind="list",f){case wi:case Pi:c.listKind="message",c.message=r.getMessage(Er(e.typeName)),cr(c.message),c.delimitedEncoding=Th(e,t);break;case Ih:c.listKind="enum",c.enum=r.getEnum(Er(e.typeName)),cr(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=b==Ah;break}return c.packed=Rw(e,t),c}switch(f){case wi:case Pi:c.fieldKind="message",c.message=r.getMessage(Er(e.typeName)),cr(c.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.delimitedEncoding=Th(e,t),c.getDefaultValue=()=>{};break;case Ih:{const _=r.getEnum(Er(e.typeName));cr(_!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),c.fieldKind="enum",c.enum=r.getEnum(Er(e.typeName)),c.getDefaultValue=()=>Ui(e,"defaultValue")?ow(_,e.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=b==Ah,c.getDefaultValue=()=>Ui(e,"defaultValue")?aw(f,e.defaultValue):void 0;break}}return c}function Ew(e){switch(e.syntax){case"":case"proto2":return uw;case"proto3":return dw;case"editions":if(e.edition in bm)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Cw(e,t){return e.dependency.map(r=>{const n=t.getFile(r);if(!n)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return n})}function kw(e,t){const r=Iw(e)+"_";for(const n of t){if(!n.name.toLowerCase().startsWith(r))return;const i=n.name.substring(r.length);if(i.length==0||/^\d/.test(i))return}return r}function Iw(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function Eo(e,t,r){let n;return t?n=`${t.typeName}.${e.name}`:r.proto.package.length>0?n=`${r.proto.package}.${e.name}`:n=`${e.name}`,n}function Er(e){return e.startsWith(".")?e.substring(1):e}function Aw(e,t){if(!Ui(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return cr(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function xw(e,t,r,n){if(e.label==pw)return mw;if(e.label==wl)return Rh;if(t||e.proto3Optional||r)return xh;const i=Yn("fieldPresence",{proto:e,parent:n});return i==Rh&&(e.type==wi||e.type==Pi)?xh:i}function Rw(e,t){if(e.label!=wl)return!1;switch(e.type){case hw:case fw:case Pi:case wi:return!1}const r=e.options;return r&&Ui(r,"packed")?r.packed:vw==Yn("repeatedFieldEncoding",{proto:e,parent:t})}function Nw(e){const t=e.fields.find(n=>n.number===1),r=e.fields.find(n=>n.number===2);return cr(t&&t.fieldKind=="scalar"&&t.scalar!=te.BYTES&&t.scalar!=te.FLOAT&&t.scalar!=te.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function Tw(e){var t;return _w==Yn("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function Th(e,t){return e.type==Pi?!0:bw==Yn("messageEncoding",{proto:e,parent:t})}function Yn(e,t){var r,n;const i=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(i){const o=i[e];if(o!=0)return o}if("kind"in t){if(t.kind=="message")return Yn(e,(n=t.parent)!==null&&n!==void 0?n:t.file);const o=bm[t.edition];if(!o)throw new Error(`feature default for edition ${t.edition} not found`);return o[e]}return Yn(e,t.parent)}function cr(e,t){if(!e)throw new Error(t)}function Bw(e){const t=Lw(e);return t.messageType.forEach(Sl),vm(t,()=>{}).getFile(t.name)}function Lw(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Sm),enumType:e.enumType.map(wm)}))}function Sm(e){var t,r,n,i,o,l,s,a;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(Ow))!==null&&r!==void 0?r:[],extension:[],nestedType:(i=(n=e.nestedType)===null||n===void 0?void 0:n.map(Sm))!==null&&i!==void 0?i:[],enumType:(l=(o=e.enumType)===null||o===void 0?void 0:o.map(wm))!==null&&l!==void 0?l:[],extensionRange:(a=(s=e.extensionRange)===null||s===void 0?void 0:s.map(c=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},c)))!==null&&a!==void 0?a:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Ow(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?Dw(e.options):void 0}))}function Dw(e){var t,r,n;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(n=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(i=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},i)))!==null&&n!==void 0?n:[],uninterpretedOption:[]}))}function wm(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(t=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},t))})}function Em(e){const t=Vw();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let n=new Uint8Array(r),i=0,o=0,l,s=0;for(let a=0;a<e.length;a++){if(l=t[e.charCodeAt(a)],l===void 0)switch(e[a]){case"=":o=0;case`
|
|
1782
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(o){case 0:s=l,o=1;break;case 1:n[i++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:n[i++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:n[i++]=(s&3)<<6|l,o=0;break}}if(o==1)throw Error("invalid base64 string");return n.subarray(0,i)}function Fw(e,t="std"){const r=Cm(t),n=t=="std";let i="",o=0,l,s=0;for(let a=0;a<e.length;a++)switch(l=e[a],o){case 0:i+=r[l>>2],s=(l&3)<<4,o=1;break;case 1:i+=r[s|l>>4],s=(l&15)<<2,o=2;break;case 2:i+=r[s|l>>6],i+=r[l&63],o=0;break}return o&&(i+=r[s],n&&(i+="=",o==1&&(i+="="))),i}let xs,Bh,Tn;function Cm(e){return xs||(xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Bh=xs.slice(0,-2).concat("-","_")),e=="url"?Bh:xs}function Vw(){if(!Tn){Tn=[];const e=Cm("std");for(let t=0;t<e.length;t++)Tn[e[t].charCodeAt(0)]=t;Tn[45]=e.indexOf("+"),Tn[95]=e.indexOf("/")}return Tn}function El(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const Mw=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Pt extends Error{constructor(t,r,n="FieldValueInvalidError"){super(r),this.name=n,this.field=()=>t}}function Uw(e){return e instanceof Error&&Mw.includes(e.name)&&"field"in e&&typeof e.field=="function"}function Hr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cl(e,t){var r,n,i,o;if(Hr(e)&&Ir in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const l=t,s=e.field();return l.listKind==s.listKind&&l.scalar===s.scalar&&((r=l.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=l.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function kl(e,t){var r,n,i,o;if(Hr(e)&&Ir in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const l=t,s=e.field();return l.mapKey===s.mapKey&&l.mapKind==s.mapKind&&l.scalar===s.scalar&&((r=l.message)===null||r===void 0?void 0:r.typeName)===((n=s.message)===null||n===void 0?void 0:n.typeName)&&((i=l.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function Il(e,t){return Hr(e)&&Ir in e&&"desc"in e&&Hr(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Ia=Symbol.for("@bufbuild/protobuf/text-encoding");function Al(){if(globalThis[Ia]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Ia]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Ia]}var pt;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(pt||(pt={}));const km=34028234663852886e22,Im=-34028234663852886e22,Am=4294967295,xm=2147483647,Rm=-2147483648;class Nm{constructor(t=Al().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let r=new Uint8Array(t),n=0;for(let i=0;i<this.chunks.length;i++)r.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Lh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Aa(t),oc(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){Pw(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){Lh(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Aa(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Aa(t),t=(t<<1^t>>31)>>>0,oc(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=ot.enc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),i=ot.uEnc(t);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(r)}int64(t){let r=ot.enc(t);return ka(r.lo,r.hi,this.buf),this}sint64(t){const r=ot.enc(t),n=r.hi>>31,i=r.lo<<1^n,o=(r.hi<<1|r.lo>>>31)^n;return ka(i,o,this.buf),this}uint64(t){const r=ot.uEnc(t);return ka(r.lo,r.hi,this.buf),this}}class xl{constructor(t,r=Al().decodeUtf8){this.decodeUtf8=r,this.varint64=qS,this.uint32=tw,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case pt.Varint:for(;this.buf[this.pos++]&128;);break;case pt.Bit64:this.pos+=4;case pt.Bit32:this.pos+=4;break;case pt.LengthDelimited:let i=this.uint32();this.pos+=i;break;case pt.StartGroup:for(;;){const[o,l]=this.tag();if(l===pt.EndGroup){if(r!==void 0&&o!==r)throw new Error("invalid end group tag");break}this.skip(l,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return ot.dec(...this.varint64())}uint64(){return ot.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,ot.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return ot.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return ot.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function Aa(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>xm||e<Rm)throw new Error("invalid int32: "+e)}function Lh(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Am||e<0)throw new Error("invalid uint32: "+e)}function Pw(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>km||e<Im))throw new Error("invalid float32: "+e)}function an(e,t){const r=e.fieldKind=="list"?Cl(t,e):e.fieldKind=="map"?kl(t,e):Rl(e,t);if(r===!0)return;let n;switch(e.fieldKind){case"list":n=`expected ${Lm(e)}, got ${wt(t)}`;break;case"map":n=`expected ${Om(e)}, got ${wt(t)}`;break;default:n=io(e,t,r)}return new Pt(e,n)}function Oh(e,t,r){const n=Rl(e,r);if(n!==!0)return new Pt(e,`list item #${t+1}: ${io(e,r,n)}`)}function Ww(e,t,r){const n=Tm(t,e.mapKey);if(n!==!0)return new Pt(e,`invalid map key: ${io({scalar:e.mapKey},t,n)}`);const i=Rl(e,r);if(i!==!0)return new Pt(e,`map entry ${wt(t)}: ${io(e,r,i)}`)}function Rl(e,t){return e.scalar!==void 0?Tm(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):Il(t,e.message)}function Tm(e,t){switch(t){case te.DOUBLE:return typeof e=="number";case te.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>km||e<Im?`${e.toFixed()} out of range`:!0;case te.INT32:case te.SFIXED32:case te.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>xm||e<Rm?`${e.toFixed()} out of range`:!0;case te.FIXED32:case te.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Am||e<0?`${e.toFixed()} out of range`:!0;case te.BOOL:return typeof e=="boolean";case te.STRING:return typeof e!="string"?!1:Al().checkUtf8(e)||"invalid UTF8";case te.BYTES:return e instanceof Uint8Array;case te.INT64:case te.SFIXED64:case te.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return ot.parse(e),!0}catch{return`${e} out of range`}return!1;case te.FIXED64:case te.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return ot.uParse(e),!0}catch{return`${e} out of range`}return!1}}function io(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${wt(t)}`,e.scalar!==void 0?`expected ${$w(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${Bm(e.message)}`+r}function wt(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:Cl(e)?Lm(e.field()):kl(e)?Om(e.field()):Il(e)?Bm(e.desc):El(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Bm(e){return`ReflectMessage (${e.typeName})`}function Lm(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${te[e.scalar]})`}}function Om(e){switch(e.mapKind){case"message":return`ReflectMap (${te[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${te[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${te[e.mapKey]}, ${te[e.scalar]})`}}function $w(e){switch(e){case te.STRING:return"string";case te.BOOL:return"boolean";case te.INT64:case te.SINT64:case te.SFIXED64:return"bigint (int64)";case te.UINT64:case te.FIXED64:return"bigint (uint64)";case te.BYTES:return"Uint8Array";case te.DOUBLE:return"number (float64)";case te.FLOAT:return"number (float32)";case te.FIXED32:case te.UINT32:return"number (uint32)";case te.INT32:case te.SFIXED32:case te.SINT32:return"number (int32)"}}function Hw(e){return Dm(e.$typeName)}function Ji(e){const t=e.fields[0];return Dm(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function Dm(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const jw=999,Zw=998,$s=2;function yt(e,t){if(El(t,e))return t;const r=Jw(e);return t!==void 0&&Gw(e,r,t),r}function Gw(e,t,r){for(const n of e.members){let i=r[n.localName];if(i==null)continue;let o;if(n.kind=="oneof"){const l=pm(r,n);if(!l)continue;o=l,i=gm(r,l)}else o=n;switch(o.fieldKind){case"message":i=Nl(o,i);break;case"scalar":i=Fm(o,i);break;case"list":i=Yw(o,i);break;case"map":i=Kw(o,i);break}mm(t,o,i)}return t}function Fm(e,t){return e.scalar==te.BYTES?Tl(t):t}function Kw(e,t){if(Hr(t)){if(e.scalar==te.BYTES)return Dh(t,Tl);if(e.mapKind=="message")return Dh(t,r=>Nl(e,r))}return t}function Yw(e,t){if(Array.isArray(t)){if(e.scalar==te.BYTES)return t.map(Tl);if(e.listKind=="message")return t.map(r=>Nl(e,r))}return t}function Nl(e,t){if(e.fieldKind=="message"&&!e.oneof&&Ji(e.message))return Fm(e.message.fields[0],t);if(Hr(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!El(t,e.message))return yt(e.message,t)}return t}function Tl(e){return Array.isArray(e)?new Uint8Array(e):e}function Dh(e,t){const r={};for(const n of Object.entries(e))r[n[0]]=t(n[1]);return r}const Xw=Symbol(),Fh=new WeakMap;function Jw(e){let t;if(zw(e)){const r=Fh.get(e);let n,i;if(r)({prototype:n,members:i}=r);else{n={},i=new Set;for(const o of e.members)o.kind!="oneof"&&(o.fieldKind!="scalar"&&o.fieldKind!="enum"||o.presence!=$s&&(i.add(o),n[o.localName]=xa(o)));Fh.set(e,{prototype:n,members:i})}t=Object.create(n),t.$typeName=e.typeName;for(const o of e.members)i.has(o)||o.kind=="field"&&(o.fieldKind=="message"||(o.fieldKind=="scalar"||o.fieldKind=="enum")&&o.presence!=$s)||(t[o.localName]=xa(o))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==$s)&&(t[r.localName]=xa(r))}return t}function zw(e){switch(e.file.edition){case jw:return!1;case Zw:return!0;default:return e.fields.some(t=>t.presence!=$s&&t.fieldKind!="message"&&!t.oneof)}}function xa(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return Xw;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?bn(e.scalar,e.longAsString):e.enum.values[0].number}function nr(e,t,r=!0){return new Vm(e,t,r)}class Vm{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,n)=>r.number-n.number)}constructor(t,r,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=t,this.message=this[Ir]=r??yt(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return fi(this.message,t),pm(this.message,t)}isSet(t){return fi(this.message,t),iw(this.message,t)}clear(t){fi(this.message,t),sw(this.message,t)}get(t){fi(this.message,t);const r=gm(this.message,t);switch(t.fieldKind){case"list":let n=this.lists.get(t);return(!n||n[Ir]!==r)&&this.lists.set(t,n=new qw(t,r,this.check)),n;case"map":let i=this.maps.get(t);return(!i||i[Ir]!==r)&&this.maps.set(t,i=new Qw(t,r,this.check)),i;case"message":return Ll(t,r,this.check);case"scalar":return r===void 0?bn(t.scalar,!1):Ol(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(fi(this.message,t),this.check){const i=an(t,r);if(i)throw i}let n;t.fieldKind=="message"?n=Bl(t,r):kl(r)||Cl(r)?n=r[Ir]:n=Dl(t,r),mm(this.message,t,n)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function fi(e,t){if(t.parent.typeName!==e.$typeName)throw new Pt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class qw{field(){return this._field}get size(){return this._arr.length}constructor(t,r,n){this._field=t,this._arr=this[Ir]=r,this.check=n}get(t){const r=this._arr[t];return r===void 0?void 0:Ra(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Pt(this._field,`list item #${t+1}: out of range`);if(this.check){const n=Oh(this._field,t,r);if(n)throw n}this._arr[t]=Vh(this._field,r)}add(t){if(this.check){const r=Oh(this._field,this._arr.length,t);if(r)throw r}this._arr.push(Vh(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield Ra(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,Ra(this._field,this._arr[t],this.check)]}}class Qw{constructor(t,r,n=!0){this.obj=this[Ir]=r??{},this.check=n,this._field=t}field(){return this._field}set(t,r){if(this.check){const n=Ww(this._field,t,r);if(n)throw n}return this.obj[Rs(t)]=eE(this._field,r),this}delete(t){const r=Rs(t),n=Object.prototype.hasOwnProperty.call(this.obj,r);return n&&delete this.obj[r],n}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[Rs(t)];return r!==void 0&&(r=Na(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,Rs(t))}*keys(){for(const t of Object.keys(this.obj))yield Mh(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[Mh(t[0],this._field.mapKey),Na(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Na(this._field,t,this.check)}forEach(t,r){for(const n of this.entries())t.call(r,n[1],n[0],this)}}function Bl(e,t){return Il(t)?Hw(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?Um(t.message):t.message:t}function Ll(e,t,r){return t!==void 0&&(Ji(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Ol(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&Hr(t)&&(t=Mm(t))),new Vm(e.message,t,r)}function Vh(e,t){return e.listKind=="message"?Bl(e,t):Dl(e,t)}function Ra(e,t,r){return e.listKind=="message"?Ll(e,t,r):Ol(e,t)}function eE(e,t){return e.mapKind=="message"?Bl(e,t):Dl(e,t)}function Na(e,t,r){return e.mapKind=="message"?Ll(e,t,r):t}function Rs(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function Mh(e,t){switch(t){case te.STRING:return e;case te.INT32:case te.FIXED32:case te.UINT32:case te.SFIXED32:case te.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case te.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case te.UINT64:case te.FIXED64:try{return ot.uParse(e)}catch{}break;default:try{return ot.parse(e)}catch{}break}return e}function Ol(e,t){switch(e.scalar){case te.INT64:case te.SFIXED64:case te.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=ot.parse(t));break;case te.FIXED64:case te.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=ot.uParse(t));break}return t}function Dl(e,t){switch(e.scalar){case te.INT64:case te.SFIXED64:case te.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=ot.parse(t));break;case te.FIXED64:case te.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=ot.uParse(t));break}return t}function Mm(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(Hr(e))for(const[r,n]of Object.entries(e))t.fields[r]=Wm(n);return t}function Um(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Pm(n);return t}function Pm(e){switch(e.kind.case){case"structValue":return Um(e.kind.value);case"listValue":return e.kind.value.values.map(Pm);case"nullValue":case void 0:return null;default:return e.kind.value}}function Wm(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const n of e)r.values.push(Wm(n));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:Mm(e)};break}return t}const tE=3,Uh={writeUnknownFields:!0};function rE(e){return e?Object.assign(Object.assign({},Uh),e):Uh}function nE(e,t,r){return so(new Nm,rE(r),nr(e,t)).finish()}function so(e,t,r){var n;for(const i of r.sortedFields){if(!r.isSet(i)){if(i.presence==tE)throw new Error(`cannot encode ${i} to binary: required field not set`);continue}$m(e,t,r,i)}if(t.writeUnknownFields)for(const{no:i,wireType:o,data:l}of(n=r.getUnknown())!==null&&n!==void 0?n:[])e.tag(i,o).raw(l);return e}function $m(e,t,r,n){var i;switch(n.fieldKind){case"scalar":case"enum":oo(e,r.desc.typeName,n.name,(i=n.scalar)!==null&&i!==void 0?i:te.INT32,n.number,r.get(n));break;case"list":iE(e,t,n,r.get(n));break;case"message":Hm(e,t,n,r.get(n));break;case"map":for(const[o,l]of r.get(n))sE(e,t,n,o,l);break}}function oo(e,t,r,n,i,o){jm(e.tag(i,oE(n)),t,r,n,o)}function Hm(e,t,r,n){r.delimitedEncoding?so(e.tag(r.number,pt.StartGroup),t,n).tag(r.number,pt.EndGroup):so(e.tag(r.number,pt.LengthDelimited).fork(),t,n).join()}function iE(e,t,r,n){var i;if(r.listKind=="message"){for(const l of n)Hm(e,t,r,l);return}const o=(i=r.scalar)!==null&&i!==void 0?i:te.INT32;if(r.packed){if(!n.size)return;e.tag(r.number,pt.LengthDelimited).fork();for(const l of n)jm(e,r.parent.typeName,r.name,o,l);e.join();return}for(const l of n)oo(e,r.parent.typeName,r.name,o,r.number,l)}function sE(e,t,r,n,i){var o;switch(e.tag(r.number,pt.LengthDelimited).fork(),oo(e,r.parent.typeName,r.name,r.mapKey,1,n),r.mapKind){case"scalar":case"enum":oo(e,r.parent.typeName,r.name,(o=r.scalar)!==null&&o!==void 0?o:te.INT32,2,i);break;case"message":so(e.tag(2,pt.LengthDelimited).fork(),t,i).join();break}e.join()}function jm(e,t,r,n,i){try{switch(n){case te.STRING:e.string(i);break;case te.BOOL:e.bool(i);break;case te.DOUBLE:e.double(i);break;case te.FLOAT:e.float(i);break;case te.INT32:e.int32(i);break;case te.INT64:e.int64(i);break;case te.UINT64:e.uint64(i);break;case te.FIXED64:e.fixed64(i);break;case te.BYTES:e.bytes(i);break;case te.FIXED32:e.fixed32(i);break;case te.SFIXED32:e.sfixed32(i);break;case te.SFIXED64:e.sfixed64(i);break;case te.SINT64:e.sint64(i);break;case te.UINT32:e.uint32(i);break;case te.SINT32:e.sint32(i);break}}catch(o){throw o instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${o.message}`):o}}function oE(e){switch(e){case te.BYTES:case te.STRING:return pt.LengthDelimited;case te.DOUBLE:case te.FIXED64:case te.SFIXED64:return pt.Bit64;case te.FIXED32:case te.SFIXED32:case te.FLOAT:return pt.Bit32;default:return pt.Varint}}function _r(e,t,...r){return r.reduce((n,i)=>n.nestedMessages[i],e.messages[t])}function Co(e,t,...r){if(r.length==0)return e.enums[t];const n=r.pop();return r.reduce((i,o)=>i.nestedMessages[o],e.messages[t]).nestedEnums[n]}function ko(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const aE=Bw({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),cE=_r(aE,1);var Ph;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(Ph||(Ph={}));var Wh;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Wh||(Wh={}));var $h;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})($h||($h={}));var Hh;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(Hh||(Hh={}));var jh;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(jh||(jh={}));var Zh;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(Zh||(Zh={}));var Gh;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Gh||(Gh={}));var Kh;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(Kh||(Kh={}));var Yh;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(Yh||(Yh={}));var Xh;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(Xh||(Xh={}));var Jh;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Jh||(Jh={}));var zh;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(zh||(zh={}));var qh;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(qh||(qh={}));var Qh;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(Qh||(Qh={}));var ef;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(ef||(ef={}));var tf;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(tf||(tf={}));var rf;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(rf||(rf={}));var nf;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(nf||(nf={}));var sf;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(sf||(sf={}));var of;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(of||(of={}));const lE={readUnknownFields:!0};function uE(e){return lE}function Zm(e,t,r){const n=nr(e,void 0,!1);return Gm(n,new xl(t),uE(),!1,t.byteLength),n.message}function Gm(e,t,r,n,i){var o;const l=n?t.len:t.pos+i;let s,a;const c=(o=e.getUnknown())!==null&&o!==void 0?o:[];for(;t.pos<l&&([s,a]=t.tag(),!(n&&a==pt.EndGroup));){const g=e.findNumber(s);if(!g){const f=t.skip(a,s);r.readUnknownFields&&c.push({no:s,wireType:a,data:f});continue}Km(e,t,g,a,r)}if(n&&(a!=pt.EndGroup||s!==i))throw new Error("invalid end group tag");c.length>0&&e.setUnknown(c)}function Km(e,t,r,n,i){var o;switch(r.fieldKind){case"scalar":e.set(r,Xn(t,r.scalar));break;case"enum":const l=Xn(t,te.INT32);if(r.enum.open)e.set(r,l);else if(r.enum.values.some(s=>s.number===l))e.set(r,l);else if(i.readUnknownFields){const s=[];oc(l,s);const a=(o=e.getUnknown())!==null&&o!==void 0?o:[];a.push({no:r.number,wireType:n,data:new Uint8Array(s)}),e.setUnknown(a)}break;case"message":e.set(r,Fl(t,i,r,e.get(r)));break;case"list":hE(t,n,e.get(r),i);break;case"map":dE(t,e.get(r),i);break}}function dE(e,t,r){const n=t.field();let i,o;const l=e.uint32(),s=e.pos+l;for(;e.pos<s;){const[a]=e.tag();switch(a){case 1:i=Xn(e,n.mapKey);break;case 2:switch(n.mapKind){case"scalar":o=Xn(e,n.scalar);break;case"enum":o=e.int32();break;case"message":o=Fl(e,r,n);break}break}}if(i===void 0&&(i=bn(n.mapKey,!1)),o===void 0)switch(n.mapKind){case"scalar":o=bn(n.scalar,!1);break;case"enum":o=n.enum.values[0].number;break;case"message":o=nr(n.message,void 0,!1);break}t.set(i,o)}function hE(e,t,r,n){var i;const o=r.field();if(o.listKind==="message"){r.add(Fl(e,n,o));return}const l=(i=o.scalar)!==null&&i!==void 0?i:te.INT32;if(!(t==pt.LengthDelimited&&l!=te.STRING&&l!=te.BYTES)){r.add(Xn(e,l));return}const s=e.uint32()+e.pos;for(;e.pos<s;)r.add(Xn(e,l))}function Fl(e,t,r,n){const i=r.delimitedEncoding,o=n??nr(r.message,void 0,!1);return Gm(o,e,t,i,i?r.number:e.uint32()),o}function Xn(e,t){switch(t){case te.STRING:return e.string();case te.BOOL:return e.bool();case te.DOUBLE:return e.double();case te.FLOAT:return e.float();case te.INT32:return e.int32();case te.INT64:return e.int64();case te.UINT64:return e.uint64();case te.FIXED64:return e.fixed64();case te.BYTES:return e.bytes();case te.FIXED32:return e.fixed32();case te.SFIXED32:return e.sfixed32();case te.SFIXED64:return e.sfixed64();case te.SINT64:return e.sint64();case te.UINT32:return e.uint32();case te.SINT32:return e.sint32()}}function yn(e,t){var r;const n=Zm(cE,Em(e));return n.messageType.forEach(Sl),n.dependency=(r=t==null?void 0:t.map(i=>i.proto.name))!==null&&r!==void 0?r:[],vm(n,i=>t==null?void 0:t.find(o=>o.proto.name===i)).getFile(n.name)}const Vl=yn("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),af=_r(Vl,0,0),fE=Co(Vl,0),Ta=ko(fE),pE=yn("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),gE=_r(pE,0);function mE(e,t,r){let n=!1;return r||(r=yt(gE),n=!0),r.value=nE(e,t),r.typeUrl=_E(t.$typeName),n?r:void 0}function vE(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,n=Ym(e.typeUrl);return r===n}function bE(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(Ym(e.typeUrl));if(!(!r||!vE(e,r)))return Zm(r,e.value)}function _E(e){return`type.googleapis.com/${e}`}function Ym(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const Ml=yn("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),yE=_r(Ml,0),Xm=_r(Ml,1),SE=_r(Ml,2);var dc;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(dc||(dc={}));const wE=yn("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),zi=yn("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QihwIKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCRIxCgNwd2QYByABKAsyJC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlLlB3ZBooCgNQd2QSDwoHY3VycmVudBgBIAEoCRIQCghwcmV2aW91cxgCIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[wE,Vl]),Jm=_r(zi,12),hc=_r(zi,13),EE=Co(zi,19,0),Cr=ko(EE),CE=Co(zi,2),kE=ko(CE);function IE(e,t){zm(t,e);const r=xE(e.$unknown,t),[n,i,o]=Io(t);for(const l of r)Km(n,new xl(l.data),i,l.wireType,{readUnknownFields:!0});return o()}function AE(e,t,r){var n;zm(t,e);const i=((n=e.$unknown)!==null&&n!==void 0?n:[]).filter(c=>c.no!==t.number),[o,l]=Io(t,r),s=new Nm;$m(s,{writeUnknownFields:!0},o,l);const a=new xl(s.finish());for(;a.pos<a.len;){const[c,g]=a.tag(),f=a.skip(g,c);i.push({no:c,wireType:g,data:f})}e.$unknown=i}function xE(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function Io(e,t){const r=e.typeName,n=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),i=Object.assign(Object.assign({},e.extendee),{fields:[n],members:[n],oneofs:[]}),o=yt(i,t!==void 0?{[r]:t}:void 0);return[nr(i,o),n,()=>{const l=o[r];if(l===void 0){const s=e.message;return Ji(s)?bn(s.fields[0].scalar,s.fields[0].longAsString):yt(s)}return l}]}function zm(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const RE=3,NE=2,cf={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function TE(e){return e?Object.assign(Object.assign({},cf),e):cf}function BE(e,t,r){return qi(nr(e,t),TE(r))}function qi(e,t){var r;const n=FE(e,t);if(n!==void 0)return n;const i={};for(const o of e.sortedFields){if(!e.isSet(o)){if(o.presence==RE)throw new Error(`cannot encode ${o} to JSON: required field not set`);if(!t.alwaysEmitImplicit||o.presence!==NE)continue}const l=lf(o,e.get(o),t);l!==void 0&&(i[DE(o,t)]=l)}if(t.registry){const o=new Set;for(const{no:l}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!o.has(l)){o.add(l);const s=t.registry.getExtensionFor(e.desc,l);if(!s)continue;const a=IE(e.message,s),[c,g]=Io(s,a),f=lf(g,c.get(g),t);f!==void 0&&(i[s.jsonName]=f)}}return i}function lf(e,t,r){switch(e.fieldKind){case"scalar":return Ao(e,t);case"message":return qi(t,r);case"enum":return Ul(e.enum,t,r.enumAsInteger);case"list":return OE(t,r);case"map":return LE(t,r)}}function LE(e,t){const r=e.field(),n={};switch(r.mapKind){case"scalar":for(const[i,o]of e)n[i]=Ao(r,o);break;case"message":for(const[i,o]of e)n[i]=qi(o,t);break;case"enum":for(const[i,o]of e)n[i]=Ul(r.enum,o,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?n:void 0}function OE(e,t){const r=e.field(),n=[];switch(r.listKind){case"scalar":for(const i of e)n.push(Ao(r,i));break;case"enum":for(const i of e)n.push(Ul(r.enum,i,t.enumAsInteger));break;case"message":for(const i of e)n.push(qi(i,t));break}return t.alwaysEmitImplicit||n.length>0?n:void 0}function Ul(e,t,r){var n;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${wt(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const i=e.value[t];return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:t}function Ao(e,t){var r,n,i,o,l,s;switch(e.scalar){case te.INT32:case te.SFIXED32:case te.SINT32:case te.FIXED32:case te.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=an(e,t))===null||r===void 0?void 0:r.message}`);return t;case te.FLOAT:case te.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(n=an(e,t))===null||n===void 0?void 0:n.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case te.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(i=an(e,t))===null||i===void 0?void 0:i.message}`);return t;case te.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(o=an(e,t))===null||o===void 0?void 0:o.message}`);return t;case te.UINT64:case te.FIXED64:case te.INT64:case te.SFIXED64:case te.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(l=an(e,t))===null||l===void 0?void 0:l.message}`);return t.toString();case te.BYTES:if(t instanceof Uint8Array)return Fw(t);throw new Error(`cannot encode ${e} to JSON: ${(s=an(e,t))===null||s===void 0?void 0:s.message}`)}}function DE(e,t){return t.useProtoFieldName?e.name:e.jsonName}function FE(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return VE(e.message,t);case"google.protobuf.Timestamp":return PE(e.message);case"google.protobuf.Duration":return ME(e.message);case"google.protobuf.FieldMask":return UE(e.message);case"google.protobuf.Struct":return qm(e.message);case"google.protobuf.Value":return Pl(e.message);case"google.protobuf.ListValue":return Qm(e.message);default:if(Ji(e.desc)){const r=e.desc.fields[0];return Ao(r,e.get(r))}return}}function VE(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let n,i;if(r&&(n=bE(e,r),n&&(i=r.getMessage(n.$typeName))),!i||!n)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let o=qi(nr(i,n),t);return(i.typeName.startsWith("google.protobuf.")||o===null||Array.isArray(o)||typeof o!="object")&&(o={value:o}),o["@type"]=e.typeUrl,o}function ME(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function UE(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Vi(t)}).join(",")}function qm(e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Pl(n);return t}function Pl(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return qm(e.kind.value);case"listValue":return Qm(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function Qm(e){return e.values.map(Pl)}function PE(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const n=(e.nanos+1e9).toString().substring(1);n.substring(3)==="000000"?r="."+n.substring(0,3)+"Z":n.substring(6)==="000"?r="."+n.substring(0,6)+"Z":r="."+n+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const uf={ignoreUnknownFields:!1};function WE(e){return e?Object.assign(Object.assign({},uf),e):uf}function $E(e,t,r){const n=nr(e);try{Jn(n,t,WE(r))}catch(i){throw Uw(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return n.message}function Jn(e,t,r){var n;if(XE(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${wt(t)}`);const i=new Map,o=new Map;for(const l of e.desc.fields)o.set(l.name,l).set(l.jsonName,l);for(const[l,s]of Object.entries(t)){const a=o.get(l);if(a){if(a.oneof){if(s===null&&a.fieldKind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Pt(a.oneof,`oneof set multiple times by ${c.name} and ${a.name}`);i.set(a.oneof,a)}df(e,a,s,r)}else{let c;if(l.startsWith("[")&&l.endsWith("]")&&(c=(n=r.registry)===null||n===void 0?void 0:n.getExtension(l.substring(1,l.length-1)))&&c.extendee.typeName===e.desc.typeName){const[g,f,b]=Io(c);df(g,f,s,r),AE(e.message,c,b())}if(!c&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${l}" is unknown`)}}}function df(e,t,r,n){switch(t.fieldKind){case"scalar":KE(e,t,r);break;case"enum":GE(e,t,r,n);break;case"message":ZE(e,t,r,n);break;case"list":jE(e.get(t),r,n);break;case"map":HE(e.get(t),r,n);break}}function HE(e,t,r){if(t===null)return;const n=e.field();if(typeof t!="object"||Array.isArray(t))throw new Pt(n,"expected object, got "+wt(t));for(const[i,o]of Object.entries(t)){if(o===null)throw new Pt(n,"map value must not be null");let l;switch(n.mapKind){case"message":const a=nr(n.message);Jn(a,o,r),l=a;break;case"enum":if(l=Wl(n.enum,o,r.ignoreUnknownFields,!0),l===xo)return;break;case"scalar":l=No(n,o,!0);break}const s=YE(n.mapKey,i);e.set(s,l)}}function jE(e,t,r){if(t===null)return;const n=e.field();if(!Array.isArray(t))throw new Pt(n,"expected Array, got "+wt(t));for(const i of t){if(i===null)throw new Pt(n,"list item must not be null");switch(n.listKind){case"message":const o=nr(n.message);Jn(o,i,r),e.add(o);break;case"enum":const l=Wl(n.enum,i,r.ignoreUnknownFields,!0);l!==xo&&e.add(l);break;case"scalar":e.add(No(n,i,!0));break}}}function ZE(e,t,r,n){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const i=e.isSet(t)?e.get(t):nr(t.message);Jn(i,r,n),e.set(t,i)}function GE(e,t,r,n){const i=Wl(t.enum,r,n.ignoreUnknownFields,!1);i===Ro?e.clear(t):i!==xo&&e.set(t,i)}function KE(e,t,r){const n=No(t,r,!1);n===Ro?e.clear(t):e.set(t,n)}const xo=Symbol();function Wl(e,t,r,n){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:n?e.values[0].number:Ro;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=e.values.find(o=>o.name===t);if(i!==void 0)return i.number;if(r)return xo;break}throw new Error(`cannot decode ${e} from JSON: ${wt(t)}`)}const Ro=Symbol();function No(e,t,r){if(t===null)return r?bn(e.scalar,!1):Ro;switch(e.scalar){case te.DOUBLE:case te.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Pt(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Pt(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const n=Number(t);if(!Number.isFinite(n))break;return n}break;case te.INT32:case te.FIXED32:case te.SFIXED32:case te.SINT32:case te.UINT32:return ev(t);case te.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return Em(t)}catch(n){const i=n instanceof Error?n.message:String(n);throw new Pt(e,i)}}break}return t}function YE(e,t){switch(e){case te.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case te.INT32:case te.FIXED32:case te.UINT32:case te.SFIXED32:case te.SINT32:return ev(t);default:return t}}function ev(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function XE(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return JE(e.message,t,r),!0;case"google.protobuf.Timestamp":return zE(e.message,t),!0;case"google.protobuf.Duration":return qE(e.message,t),!0;case"google.protobuf.FieldMask":return QE(e.message,t),!0;case"google.protobuf.Struct":return tv(e.message,t),!0;case"google.protobuf.Value":return $l(e.message,t),!0;case"google.protobuf.ListValue":return rv(e.message,t),!0;default:if(Ji(e.desc)){const n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,No(n,t,!0)),!0}return!1}}function JE(e,t,r){var n;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${wt(t)}`);if(Object.keys(t).length==0)return;const i=t["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const o=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!o.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const l=(n=r.registry)===null||n===void 0?void 0:n.getMessage(o);if(!l)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${i} is not in the type registry`);const s=nr(l);if(o.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const a=t.value;Jn(s,a,r)}else{const a=Object.assign({},t);delete a["@type"],Jn(s,a,r)}mE(s.desc,s.message,e)}function zE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${wt(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const n=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(n))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=ot.parse(n/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function qE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${wt(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${wt(t)}`);const n=Number(r[1]);if(n>315576e6||n<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${wt(t)}`);if(e.seconds=ot.parse(n),typeof r[2]!="string")return;const i=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(i),(n<0||Object.is(n,-0))&&(e.nanos=-e.nanos)}function QE(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${wt(t)}`);if(t==="")return;function r(n){if(n.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const i=n.replace(/[A-Z]/g,o=>"_"+o.toLowerCase());return i[0]==="_"?i.substring(1):i}e.paths=t.split(",").map(r)}function tv(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${wt(t)}`);for(const[r,n]of Object.entries(t)){const i=yt(Xm);$l(i,n),e.fields[r]=i}}function $l(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:dc.NULL_VALUE};else if(Array.isArray(t)){const r=yt(SE);rv(r,t),e.kind={case:"listValue",value:r}}else{const r=yt(yE);tv(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${wt(t)}`)}return e}function rv(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${wt(t)}`);for(const r of t){const n=yt(Xm);$l(n,r),e.values.push(n)}}const nv=yn("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),e3=Co(nv,0),t3=ko(e3),iv=yn("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[nv,zi]),fc=_r(iv,3),r3=_r(iv,4),sv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ao=32,n3=16,ov=10,hf=0xffffffffffff;var dn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(dn||(dn={}));class gi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function i3(e){const t=Math.floor(e()*ao)%ao;return sv.charAt(t)}function s3(e){const t=o3(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new gi(dn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function o3(){return l3()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function a3(e,t){let r="";for(;e>0;e--)r=i3(t)+r;return r}function c3(e,t=ov){if(isNaN(e))throw new gi(dn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>hf)throw new gi(dn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${hf}: ${e}`);if(e<0)throw new gi(dn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new gi(dn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%ao,n=sv.charAt(r)+n,e=(e-r)/ao;return n}function l3(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function u3(e,t){const r=s3(),n=Date.now();return c3(n,ov)+a3(n3,r)}const kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function d3(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}let Ba;const h3=new Uint8Array(16);function f3(){if(!Ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ba=crypto.getRandomValues.bind(crypto)}return Ba(h3)}const p3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ff={randomUUID:p3};function g3(e,t,r){var n;if(ff.randomUUID&&!e)return ff.randomUUID();e=e||{};const i=e.random??((n=e.rng)==null?void 0:n.call(e))??f3();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,d3(i)}const m3=5e3,v3=1e3,Ns=4e3,pf=1e3;var av=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(av||{});class cv{constructor({knownID:t,runID:r,sequence:n,options:i}){this.queue=new tr,this.subscriptions=[],this.reconnect=new tr,this.client=new gt,this._latencies=new tr,this._latenciesConnectable=sn(this._latencies.asObservable().pipe(mS((o,l)=>{if(l.latency<0){const s=o.get(l.streamID);s&&o.set(l.streamID,{...s,readyState:l.readyState})}else o.set(l.streamID,l);return o},new Map))),this._errors=new tr,this._errorsConnectable=sn(this._errors.asObservable()),this._stdout=new tr,this._stderr=new tr,this._exitCode=new tr,this._pid=new tr,this._mimeType=new tr,this._stdoutConnectable=sn(this._stdout.asObservable()),this._stderrConnectable=sn(this._stderr.asObservable()),this._exitCodeConnectable=sn(this._exitCode.asObservable()),this._pidConnectable=sn(this._pid.asObservable()),this._mimeTypeConnectable=sn(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=n,this.runnerEndpoint=i.runnerEndpoint,this.interceptors=i.interceptors,this.autoReconnect=i.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(yh(pf,Xi,{leading:!0,trailing:!0}),_h(o=>this.useSocketClient(o.streamID).pipe(_h(l=>this.useHeartbeat(l,o))))).pipe(jg()),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 oS(v3).pipe(pr(()=>this.autoReconnect),Ca(this.reconnect),pr(([,t])=>t.heartbeat==="CONTINUOUS"),Ca(this.latencies),Zt(([,t])=>Array.from(t.values()).filter(r=>r.readyState===WebSocket.OPEN&&r.latency>=Ns)),pr(t=>t.length>0),yh(pf)).subscribe({next:t=>{console.log(new Date,"Triggering reconnect",t),this.connect()},complete:()=>{console.log("Monitor complete")},error:t=>{console.error("Error in monitor",t)}})}process(){const t=this.client.pipe(pr(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN),bh(1)),r=this.queue.pipe(hS(()=>t),pr(i=>i.length>0),Zt(i=>i.sort((o,l)=>{const s=a=>{var c;return!!((c=a.payload.value)!=null&&c.config)};return s(l)?1:s(o)?-1:0}))),n=this.queue.pipe(vS(t));return aS(r.pipe(un(i=>i)),n).pipe(Ca(this.client),As(([,i])=>i.readyState===WebSocket.OPEN),un(async([i,o])=>{await mf({req:i,interceptors:this.interceptors,socket:o,knownID:this.knownID,runID:this.runID})})).subscribe({error:i=>{this._errors.next(i)}})}useSocketClient(t){return new gt(r=>{const n=new URL(this.runnerEndpoint);n.searchParams.set("id",t),n.searchParams.set("runID",this.runID);const i=new WebSocket(n.toString()),o=c=>{if(console.log(new Date,`WebSocket transport ${t} closed`,c),c.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},l=c=>{console.log(new Date,`WebSocket transport ${t} error`,c),this.autoReconnect||r.error(c)},s=c=>{var g,f;if(typeof c.data!="string"){console.warn("Unexpected WebSocket message type:",typeof c.data);return}let b;try{b=gf(c.data),console.log("Received WebsocketResponse:",b)}catch(y){console.error("Failed to parse WebsocketResponse:",y)}const _=b.status;if(_&&_.code!==t3.OK){r.error(_);return}if(b.pong)return;const k=b.payload.value;if(k.stdoutData&&k.stdoutData.length>0&&((g=this.callback)==null||g.call(this,{type:Me.terminalStdout,output:{"runme.dev/id":this.knownID,data:k.stdoutData}}),this._stdout.next(k.stdoutData)),k.stderrData&&k.stderrData.length>0&&((f=this.callback)==null||f.call(this,{type:Me.terminalStderr,output:{"runme.dev/id":this.knownID,data:k.stderrData}}),this._stderr.next(k.stderrData)),k.exitCode!==void 0&&(this._exitCode.next(k.exitCode),r.complete()),k.pid!==void 0&&this._pid.next(k.pid),k.mimeType){const y=k.mimeType.split(";")[0];this._mimeType.next(y)}},a=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(i)};return i.addEventListener("close",o),i.addEventListener("error",l),i.addEventListener("message",s),i.addEventListener("open",a),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),i.removeEventListener("close",o),i.removeEventListener("error",l),i.removeEventListener("message",s),i.removeEventListener("open",a),i.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(yt(fc,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:n}){return new gt(i=>{const o=ec(t,"message").pipe(As(()=>t.readyState===WebSocket.OPEN),Zt(a=>gf(a.data)),Zt(a=>a.pong),pr(a=>a!==void 0),Zt(a=>({receivedAt:BigInt(Date.now()),pong:a}))),l=(n==="INITIAL"?Si(0):Si(0,m3)).pipe(As(()=>t.readyState===WebSocket.OPEN),Zt(()=>{const a={timestamp:BigInt(Date.now())};return yt(fc,{ping:a})}),un(async a=>(await mf({req:a,interceptors:this.interceptors,socket:t}),a)),Zt(a=>a.ping)).pipe(pr(a=>(a==null?void 0:a.timestamp)!==void 0),un(a=>uS(o.pipe(pr(c=>c.pong.timestamp===a.timestamp),bh(1),Zt(c=>{const g=a.timestamp,f=c.receivedAt;return Number(f-g)})),Si(Ns).pipe(Zt(()=>{throw new Error(`Pong not received within ${Ns}ms for stream ${r}`)}))).pipe(Wg(c=>(this._latencies.next({streamID:r,latency:Ns,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",c.message),Z2(null))))),gS(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),bS(a=>{a!==null&&this._latencies.next({streamID:r,latency:a,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),s=[];return s.push(l.subscribe({error:a=>{console.error("Unexpected error sending heartbeat",a)}})),i.next(t),()=>{s.forEach(a=>a.unsubscribe())}})}connect(t="CONTINUOUS"){const r=b3(),n=this.latencies.pipe(Zt(i=>{const o=i.get(r);return o===void 0?null:o}),As(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),n}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function gf(e){const t=JSON.parse(e);return $E(r3,t)}async function mf({req:e,interceptors:t,socket:r,knownID:n,runID:i}){n&&(e.knownId=n),i&&(e.runId=i);const o={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let l=async a=>({stream:!1,message:{},method:{},service:{},header:a.header});for(const a of t.concat().reverse())l=a(l);const s=(await l(o)).header.get("Authorization");s&&e&&(e.authorization=s),r.send(JSON.stringify(BE(fc,e)))}function b3(){return g3().replace(/-/g,"")}function lv(){return`run_${u3()}`}var _3=Object.defineProperty,y3=Object.getOwnPropertyDescriptor,uv=e=>{throw TypeError(e)},Rr=(e,t,r,n)=>{for(var i=n>1?void 0:n?y3(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&_3(t,r,i),i},Hl=(e,t,r)=>t.has(e)||uv("Cannot "+r),nt=(e,t,r)=>(Hl(e,t,"read from private field"),t.get(e)),Ts=(e,t,r)=>t.has(e)?uv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),co=(e,t,r,n)=>(Hl(e,t,"write to private field"),t.set(e,r),r),Gt=(e,t,r)=>(Hl(e,t,"access private method"),r),At,gr,hn,Dt,dv,jl,hv,pc,lo,gc,fv,pv;const S3="runme-console";let br=class extends xt{constructor(){super(),Ts(this,Dt),this.disposables=[],Ts(this,At),Ts(this,gr,[]),Ts(this,hn,{rows:34,cols:100,x:0,y:0}),this.takeFocus=!0,this.view={theme:"dark",fontFamily:"monospace",fontSize:12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,smoothScrollDuration:0,scrollback:4e3},this.commands=[],this.interceptors=[],Gt(this,Dt,pv).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");Gt(this,Dt,dv).call(this),Gt(this,Dt,pc).call(this),Gt(this,Dt,gc).call(this)}disconnectedCallback(){super.disconnectedCallback(),Gt(this,Dt,lo).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&Gt(this,Dt,jl).call(this),(e.has("id")||e.has("stream")||e.has("commands"))&&(Gt(this,Dt,pc).call(this),Gt(this,Dt,gc).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return Ne`<div></div>`}dispose(){Gt(this,Dt,lo).call(this),this.disposables.forEach(({dispose:e})=>e())}};At=new WeakMap;gr=new WeakMap;hn=new WeakMap;Dt=new WeakSet;dv=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),Gt(this,Dt,jl).call(this),this.shadowRoot.appendChild(this.consoleView),Gt(this,Dt,hv).call(this))};jl=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons","false"),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.view.theme),this.view.fontFamily&&this.consoleView.setAttribute("fontFamily",this.view.fontFamily),this.view.fontSize&&this.consoleView.setAttribute("fontSize",this.view.fontSize.toString()),this.view.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.view.cursorStyle),this.view.cursorBlink&&this.consoleView.setAttribute("cursorBlink",this.view.cursorBlink.toString()),this.view.cursorWidth&&this.consoleView.setAttribute("cursorWidth",this.view.cursorWidth.toString()),this.view.smoothScrollDuration&&this.consoleView.setAttribute("smoothScrollDuration",this.view.smoothScrollDuration.toString()),this.view.scrollback&&this.consoleView.setAttribute("scrollback",this.view.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()))};hv=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};pc=function(){if(nt(this,At)||!this.stream)return;const e=this.stream.knownID??this.id;if(!e||!this.stream.runID||!this.stream.runnerEndpoint)throw new Error("Missing required stream properties");co(this,At,new cv({knownID:e,runID:this.stream.runID,sequence:this.stream.sequence??0,options:{runnerEndpoint:this.stream.runnerEndpoint,autoReconnect:this.stream.reconnect,interceptors:this.interceptors??[]}}));const t=nt(this,At).connect().subscribe();nt(this,gr).push(()=>t.unsubscribe());const r=nt(this,At).stdout.subscribe(s=>{this.dispatchEvent(new CustomEvent("stdout",{detail:s})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(s)}),n=nt(this,At).stderr.subscribe(s=>{this.dispatchEvent(new CustomEvent("stderr",{detail:s}))}),i=nt(this,At).exitCode.subscribe(s=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:s})),Gt(this,Dt,lo).call(this)}),o=nt(this,At).pid.subscribe(s=>{this.dispatchEvent(new CustomEvent("pid",{detail:s}))}),l=nt(this,At).mimeType.subscribe(s=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:s}))});nt(this,gr).push(()=>r.unsubscribe()),nt(this,gr).push(()=>n.unsubscribe()),nt(this,gr).push(()=>i.unsubscribe()),nt(this,gr).push(()=>o.unsubscribe()),nt(this,gr).push(()=>l.unsubscribe())};lo=function(){var e;nt(this,gr).forEach(t=>{try{t()}catch{}}),co(this,gr,[]),(e=nt(this,At))==null||e.close(),co(this,At,void 0)};gc=function(){var e;if(!nt(this,At)||!this.commands.length||!((e=this.stream)!=null&&e.runID))return;const t=Gt(this,Dt,fv).call(this);t&&nt(this,At).sendExecuteRequest(t)};fv=function(){var e,t,r,n,i;const o=((e=this.stream)==null?void 0:e.languageID)||"sh",l=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(o),s=yt(hc,{sessionStrategy:kE.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:o,background:!1,fileExtension:"",env:[`RUNME_ID=${((t=this.stream)==null?void 0:t.knownID)??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:(r=this.stream)==null?void 0:r.runID,knownId:((n=this.stream)==null?void 0:n.knownID)??this.id},winsize:yt(Jm,nt(this,hn))});return this.commands.length===0?(s.config.mode=Ta.INLINE,s.config.source={case:"commands",value:yt(af,{items:["zsh -l"]})}):l?(s.config.source={case:"commands",value:yt(af,{items:this.commands})},s.config.mode=Ta.INLINE):(s.config.source={case:"script",value:this.commands.join(`
|
|
1783
|
+
`)},s.config.mode=Ta.FILE,s.config.fileExtension=((i=this.stream)==null?void 0:i.languageID)??""),s};pv=function(){const e=new TextEncoder,t={postMessage:r=>{var n,i;if(r.type===Me.terminalOpen||r.type===Me.terminalResize){const o=Number(r.output.terminalDimensions.columns),l=Number(r.output.terminalDimensions.rows);if(Number.isFinite(o)&&Number.isFinite(l)){if(nt(this,hn).cols===o&&nt(this,hn).rows===l)return;co(this,hn,yt(Jm,{cols:o,rows:l,x:0,y:0}));const s=yt(hc,{winsize:nt(this,hn)});(n=nt(this,At))==null||n.sendExecuteRequest(s)}}if(r.type===Me.terminalStdin){const o=e.encode(r.output.input),l=yt(hc,{inputData:o});(i=nt(this,At))==null||i.sendExecuteRequest(l)}},onDidReceiveMessage:r=>{var n;(n=nt(this,At))==null||n.setCallback(r)}};try{CS(t)}catch{console.error("Failed to set context bridge")}};Rr([Te({type:String})],br.prototype,"id",2);Rr([Te({type:Boolean,converter:e=>e!=="false"})],br.prototype,"takeFocus",2);Rr([Te({type:Object})],br.prototype,"view",2);Rr([Te({type:Array})],br.prototype,"commands",2);Rr([Te({type:String})],br.prototype,"initialContent",2);Rr([Te({type:Number})],br.prototype,"initialRows",2);Rr([Te({type:Object})],br.prototype,"stream",2);Rr([Te({attribute:!1})],br.prototype,"interceptors",2);br=Rr([zt(S3)],br);var w3=Object.defineProperty,E3=Object.getOwnPropertyDescriptor,To=(e,t,r,n)=>{for(var i=n>1?void 0:n?E3(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&w3(t,r,i),i};let zn=class extends xt{constructor(){super(...arguments),this.columns=[],this.rows=[],this.renderer=(e,t)=>Ne`${e[t]}`,this.displayable=()=>!0,this.hasErrors=()=>!1}get heading(){var e,t;return(e=this.columns)!=null&&e.length?Ne`
|
|
1784
1784
|
<thead>
|
|
1785
1785
|
<tr>
|
|
1786
1786
|
${(t=this.columns)==null?void 0:t.map(r=>{if(typeof r=="string")return Ne`<th>${r}</th>`;if(typeof r=="object"){const{text:n,colspan:i}=r;return Ne`<th colspan="${i||1}">${n}</th>`}})}
|
|
1787
1787
|
</tr>
|
|
1788
1788
|
</thead>
|
|
1789
|
-
`:
|
|
1789
|
+
`:ft}render(){var e,t,r;return!((e=this.rows)!=null&&e.length)&&!((t=this.columns)!=null&&t.length)?ft:Ne`<table>
|
|
1790
1790
|
${this.heading}
|
|
1791
1791
|
<tbody>
|
|
1792
1792
|
${(r=this.rows)==null?void 0:r.map(n=>Ne`<tr
|
|
1793
|
-
class="${
|
|
1793
|
+
class="${dt(this.hasErrors&&this.hasErrors(n),()=>"row-error",()=>"")}"
|
|
1794
1794
|
>
|
|
1795
|
-
${Object.keys(n).map(i=>{var o;return
|
|
1795
|
+
${Object.keys(n).map(i=>{var o;return dt((o=this.displayable)==null?void 0:o.call(this,n,i),()=>{var l;return Ne`<td>${((l=this.renderer)==null?void 0:l.call(this,n,i))||n[i]}</td>`},()=>ft)})}
|
|
1796
1796
|
</tr>`)}
|
|
1797
1797
|
</tbody>
|
|
1798
|
-
</table>`}};zn.styles=
|
|
1798
|
+
</table>`}};zn.styles=lr`
|
|
1799
1799
|
:host {
|
|
1800
1800
|
width: 100%;
|
|
1801
1801
|
}
|
|
@@ -1936,7 +1936,7 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
1936
1936
|
.flex-center {
|
|
1937
1937
|
align-items: center;
|
|
1938
1938
|
}
|
|
1939
|
-
`;
|
|
1939
|
+
`;To([Te({type:Array})],zn.prototype,"columns",2);To([Te({type:Array})],zn.prototype,"rows",2);To([Te({type:Object})],zn.prototype,"renderer",2);zn=To([zt("table-view")],zn);const C3=Ne`
|
|
1940
1940
|
<svg
|
|
1941
1941
|
width="16"
|
|
1942
1942
|
height="16"
|
|
@@ -1951,7 +1951,7 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
1951
1951
|
fill="currentColor"
|
|
1952
1952
|
/>
|
|
1953
1953
|
</svg>
|
|
1954
|
-
`,
|
|
1954
|
+
`,k3=Ne`
|
|
1955
1955
|
<svg
|
|
1956
1956
|
width="16"
|
|
1957
1957
|
height="16"
|
|
@@ -1966,14 +1966,14 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
1966
1966
|
fill="currentColor"
|
|
1967
1967
|
/>
|
|
1968
1968
|
</svg>
|
|
1969
|
-
`;var
|
|
1969
|
+
`;var I3=Object.defineProperty,A3=Object.getOwnPropertyDescriptor,Zl=(e,t,r,n)=>{for(var i=n>1?void 0:n?A3(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&I3(t,r,i),i};let Wi=class extends xt{render(){return Ne`<div class="tooltip">
|
|
1970
1970
|
<div
|
|
1971
|
-
.class="${
|
|
1971
|
+
.class="${dt(this.classList,()=>this.classList,()=>"")}"
|
|
1972
1972
|
>
|
|
1973
1973
|
${this.value}
|
|
1974
1974
|
</div>
|
|
1975
1975
|
<div class="tooltiptext">${this.tooltipText}</div>
|
|
1976
|
-
</div>`}};Wi.styles=
|
|
1976
|
+
</div>`}};Wi.styles=lr`
|
|
1977
1977
|
.tooltip .tooltiptext {
|
|
1978
1978
|
background-color: var(--vscode-notifications-background);
|
|
1979
1979
|
box-shadow: 2px 2px 4px -2px var(--vscode-notifications-border);
|
|
@@ -2022,34 +2022,34 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2022
2022
|
.optional {
|
|
2023
2023
|
font-weight: 400;
|
|
2024
2024
|
}
|
|
2025
|
-
`;
|
|
2025
|
+
`;Zl([Te({type:String})],Wi.prototype,"tooltipText",2);Zl([Te({type:String})],Wi.prototype,"value",2);Wi=Zl([zt("tooltip-text")],Wi);var x3=Object.defineProperty,R3=Object.getOwnPropertyDescriptor,qn=(e,t,r,n)=>{for(var i=n>1?void 0:n?R3(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&x3(t,r,i),i};let jr=class extends xt{constructor(){super(...arguments),this.disposables=[],this.displaySecret=!1,this._copied=!1}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t),this._copied=!0,setTimeout(()=>this._copied=!1,1e3)}toggleVisibility(){this.displaySecret=!this.displaySecret}dispose(){this.disposables.forEach(e=>e.dispose())}render(){const e=[void 0,Cr.MASKED,Cr.LITERAL,Cr.UNSPECIFIED].includes(this.status);return Ne`
|
|
2026
2026
|
<div class="secret-container">
|
|
2027
|
-
${
|
|
2027
|
+
${dt(this.displaySecret,()=>Ne`<span class="secret-text">${this.value}</span>`,()=>dt(this.maskedValue,()=>Ne`<span class="secret-text"
|
|
2028
2028
|
>${this.maskedValue}</span
|
|
2029
2029
|
>`,()=>Array.from({length:20},(t,r)=>r+1).map(()=>"*").join("")))}
|
|
2030
2030
|
<div class="actions">
|
|
2031
|
-
${
|
|
2031
|
+
${dt(e,()=>Ne``,()=>dt(this.displaySecret,()=>Ne` <vscode-button
|
|
2032
2032
|
appearance="icon"
|
|
2033
2033
|
class="cursor-pointer"
|
|
2034
2034
|
@click=${this.toggleVisibility}
|
|
2035
2035
|
>
|
|
2036
|
-
${
|
|
2036
|
+
${k3}
|
|
2037
2037
|
</vscode-button>`,()=>Ne` <vscode-button
|
|
2038
2038
|
appearance="icon"
|
|
2039
2039
|
class="cursor-pointer"
|
|
2040
2040
|
@click=${this.toggleVisibility}
|
|
2041
2041
|
>
|
|
2042
|
-
${
|
|
2042
|
+
${Kg}
|
|
2043
2043
|
</vscode-button>`))}
|
|
2044
|
-
${
|
|
2044
|
+
${dt([Cr.LITERAL,Cr.HIDDEN].includes(this.status),()=>Ne` <vscode-button
|
|
2045
2045
|
appearance="icon"
|
|
2046
2046
|
class="cursor-pointer"
|
|
2047
2047
|
@click=${this.onCopy}
|
|
2048
|
-
>${
|
|
2048
|
+
>${dt(this._copied,()=>Ne`${C3}`,()=>Ne`${bg}`)}</vscode-button
|
|
2049
2049
|
>`,()=>Ne``)}
|
|
2050
2050
|
</div>
|
|
2051
2051
|
</div>
|
|
2052
|
-
`}};
|
|
2052
|
+
`}};jr.styles=lr`
|
|
2053
2053
|
vscode-button {
|
|
2054
2054
|
color: var(--vscode-button-foreground);
|
|
2055
2055
|
background-color: var(--vscode-button-background);
|
|
@@ -2081,7 +2081,7 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2081
2081
|
.cursor-pointer {
|
|
2082
2082
|
cursor: pointer;
|
|
2083
2083
|
}
|
|
2084
|
-
`;qn([Te({type:String})],
|
|
2084
|
+
`;qn([Te({type:String})],jr.prototype,"value",2);qn([Te({type:Number})],jr.prototype,"status",2);qn([Te({type:Boolean})],jr.prototype,"displaySecret",2);qn([Te({type:String})],jr.prototype,"maskedValue",2);qn([e2()],jr.prototype,"_copied",2);jr=qn([zt("env-viewer")],jr);Ne`
|
|
2085
2085
|
<svg
|
|
2086
2086
|
width="16"
|
|
2087
2087
|
height="16"
|
|
@@ -2096,7 +2096,7 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2096
2096
|
fill="#A1260D"
|
|
2097
2097
|
/>
|
|
2098
2098
|
</svg>
|
|
2099
|
-
`;const
|
|
2099
|
+
`;const N3=(e,t)=>Ne`
|
|
2100
2100
|
<svg
|
|
2101
2101
|
width="${t}px"
|
|
2102
2102
|
height="${e}px"
|
|
@@ -2111,21 +2111,21 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2111
2111
|
fill="#A1260D"
|
|
2112
2112
|
/>
|
|
2113
2113
|
</svg>
|
|
2114
|
-
`;var
|
|
2114
|
+
`;var T3=Object.defineProperty,B3=Object.getOwnPropertyDescriptor,gv=e=>{throw TypeError(e)},mv=(e,t,r,n)=>{for(var i=n>1?void 0:n?B3(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&T3(t,r,i),i},L3=(e,t,r)=>t.has(e)||gv("Cannot "+r),O3=(e,t,r)=>t.has(e)?gv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Bn=(e,t,r)=>(L3(e,t,"access private method"),r),Ur,vv,bv,mi;const D3="__",F3=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],V3=["resolvedValue","errors","status","specClass"];let mc=class extends xt{constructor(){super(...arguments),O3(this,Ur),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return Bn(this,Ur,bv).call(this),Ne` <div>
|
|
2115
2115
|
<table-view
|
|
2116
|
-
.columns="${
|
|
2117
|
-
.rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:
|
|
2118
|
-
.displayable="${(t,r)=>!
|
|
2119
|
-
.hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===
|
|
2116
|
+
.columns="${F3}"
|
|
2117
|
+
.rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:IS(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
|
|
2118
|
+
.displayable="${(t,r)=>!V3.includes(r)}"
|
|
2119
|
+
.hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===D3)}}"
|
|
2120
2120
|
.renderer="${(t,r)=>{switch(r){case"originalValue":const n=t.status===Cr.LITERAL;let i=t.status===Cr.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===Cr.UNSPECIFIED?i="[unset]":t.status===Cr.HIDDEN&&(i="[hidden]"),i=i.replace(/\n/g," ").replace(/\r/g,""),Ne`<env-viewer
|
|
2121
2121
|
.displaySecret="${n}"
|
|
2122
2122
|
.value="${t.originalValue}"
|
|
2123
2123
|
.maskedValue="${Bn(this,Ur,mi).call(this,t,r,()=>i)}"
|
|
2124
2124
|
.status="${t.status}"
|
|
2125
|
-
@onCopy="${async()=>Bn(this,Ur,
|
|
2126
|
-
></env-viewer>`;case"updatedAt":return Bn(this,Ur,mi).call(this,t,r,()=>t[r]?
|
|
2125
|
+
@onCopy="${async()=>Bn(this,Ur,vv).call(this,t.originalValue)}"
|
|
2126
|
+
></env-viewer>`;case"updatedAt":return Bn(this,Ur,mi).call(this,t,r,()=>t[r]?AS(new Date(t[r])):"");case"spec":return Bn(this,Ur,mi).call(this,t,r,()=>Ne`<span class="${t.specClass}">${t[r]}</span>`);default:return Bn(this,Ur,mi).call(this,t,r,()=>t[r])}}}"
|
|
2127
2127
|
></table-view>
|
|
2128
|
-
</div>`}};Ur=new WeakSet;
|
|
2128
|
+
</div>`}};Ur=new WeakSet;vv=function(e){return navigator.clipboard.writeText(e)};bv=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};mi=function(e,t,r){var n;const i=t==="name"?Ne`${N3(10,10)}`:Ne``;return(n=e.errors)!=null&&n.length?Ne`<div class="flex">
|
|
2129
2129
|
<tooltip-text
|
|
2130
2130
|
.tooltipText="${Ne`<div class="flex">
|
|
2131
2131
|
${e.errors.map(o=>Ne`<span>${i}${o.message}</span>`)}
|
|
@@ -2139,8 +2139,8 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2139
2139
|
</div>`}"
|
|
2140
2140
|
.value="${r()}"
|
|
2141
2141
|
></tooltip-text>
|
|
2142
|
-
</div>`:Ne`${r()}`};cv([Te({type:Array})],mc.prototype,"variables",2);mc=cv([zt("env-store")],mc);function _3({cellID:e,runID:t,sequence:r,languageID:n,commands:i,content:o,runner:u,settings:s={},onStdout:a,onStderr:c,onExitCode:m,onPid:f,onMimeType:b}){const{rows:_=20,className:k,fontSize:y=12,fontFamily:d="monospace",takeFocus:p=!0,scrollToFit:h=!0}=s,g=ue.useRef(null),S=ue.useMemo(()=>({id:e,takeFocus:p,initialContent:o||"",initialRows:_,view:{theme:"dark",fontFamily:d||"monospace",fontSize:y||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,smoothScrollDuration:0,scrollback:4e3}}),[e,d,y,p,h,_,o]),I=ue.useMemo(()=>({knownID:e,runID:t,sequence:r,languageID:n,runnerEndpoint:u.endpoint,reconnect:u.reconnect}),[e,t,r,n,u.endpoint,u.reconnect]);return ue.useEffect(()=>{const C=g.current;if(!C)return;const A=P=>a==null?void 0:a(P.detail),E=P=>c==null?void 0:c(P.detail),N=P=>m==null?void 0:m(P.detail),F=P=>f==null?void 0:f(P.detail),U=P=>b==null?void 0:b(P.detail);return C.addEventListener("stdout",A),C.addEventListener("stderr",E),C.addEventListener("exitcode",N),C.addEventListener("pid",F),C.addEventListener("mimetype",U),()=>{C.removeEventListener("stdout",A),C.removeEventListener("stderr",E),C.removeEventListener("exitcode",N),C.removeEventListener("pid",F),C.removeEventListener("mimetype",U)}},[a,c,m,f,b]),H.jsx("div",{className:k,ref:C=>{if(!C||C.hasChildNodes())return;const A=document.createElement("runme-console");g.current=A,A.setAttribute("id",S.id),typeof S.takeFocus=="boolean"&&A.setAttribute("takeFocus",S.takeFocus?"true":"false"),S.view&&A.setAttribute("view",JSON.stringify(S.view)),S.initialRows!==void 0&&A.setAttribute("initialRows",S.initialRows.toString()),S.initialContent!==void 0&&A.setAttribute("initialContent",S.initialContent),A.setAttribute("stream",JSON.stringify(I)),A.interceptors=u.interceptors,A.commands=i,C.appendChild(A);const E=document.createElement("div");E.setAttribute("className","h-1"),C.appendChild(E),setTimeout(()=>{h&&!y3(E)&&E.scrollIntoView({behavior:"smooth"})},0)}})}function y3(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}class vi extends Error{}vi.prototype.name="InvalidTokenError";function S3(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function w3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return S3(t)}catch{return atob(t)}}function dv(e,t){if(typeof e!="string")throw new vi("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new vi(`Invalid token specified: missing part #${r+1}`);let i;try{i=w3(n)}catch(o){throw new vi(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new vi(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}const hv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",uo=32,E3=16,fv=10,lf=0xffffffffffff;var pn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(pn||(pn={}));class bi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function C3(e){const t=Math.floor(e()*uo)%uo;return hv.charAt(t)}function k3(e){const t=I3(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new bi(pn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function I3(){return R3()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function A3(e,t){let r="";for(;e>0;e--)r=C3(t)+r;return r}function x3(e,t=fv){if(isNaN(e))throw new bi(pn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>lf)throw new bi(pn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${lf}: ${e}`);if(e<0)throw new bi(pn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new bi(pn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%uo,n=hv.charAt(r)+n,e=(e-r)/uo;return n}function R3(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function N3(e,t){const r=k3(),n=Date.now();return x3(n,fv)+A3(E3,r)}const T3=rr("ChphZ2VudC92MS9jcmVkZW50aWFscy5wcm90bxIIYWdlbnQudjEioQEKCk9BdXRoVG9rZW4SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEioKBmV4cGlyeRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEgoKZXhwaXJlc19pbhgGIAEoA0JAWj5naXRodWIuY29tL3J1bm1lZGV2L3J1bm1lL3YzL2FwaS9nZW4vcHJvdG8vZ28vYWdlbnQvdjE7YWdlbnR2MWIGcHJvdG8z",[Ib]),uf=Be(T3,0);/*! js-cookie v3.0.5 | MIT */function Bs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var B3={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vc(e,t){function r(i,o,u){if(!(typeof document>"u")){u=Bs({},t,u),typeof u.expires=="number"&&(u.expires=new Date(Date.now()+u.expires*864e5)),u.expires&&(u.expires=u.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in u)u[a]&&(s+="; "+a,u[a]!==!0&&(s+="="+u[a].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],u={},s=0;s<o.length;s++){var a=o[s].split("="),c=a.slice(1).join("=");try{var m=decodeURIComponent(a[0]);if(u[m]=e.read(c,m),i===m)break}catch{}}return i?u[i]:u}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",Bs({},o,{expires:-1}))},withAttributes:function(i){return vc(this.converter,Bs({},this.attributes,i))},withConverter:function(i){return vc(Bs({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var pv=vc(B3,{path:"/"});const L3=["agent-session","cassie-session"],O3=["agent-oauth-token","cassie-oauth-token"];function bc(){for(const e of L3){const t=pv.get(e);if(t&&t.length>0)return t}}function D3(){let e=Ge(uf);for(const t of O3){const r=pv.get(t);if(r&&r.length>0)try{const n=JSON.parse(r);return e=vp(uf,n),e.accessToken}catch(n){console.error("Failed to parse OAuthToken:",n)}}return e.accessToken}const gv=ue.createContext(void 0),cr=()=>{const e=ue.useContext(gv);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e},mv=({children:e,agentEndpoint:t,requireAuth:r,webApp:n,createAuthInterceptors:i})=>{const[o,u]=ue.useState(null),s=ue.useMemo(()=>{const y=bc();if(!y)return"unauthenticated";let d;try{return d=dv(y),d.email||d.sub||"unauthenticated"}catch(p){return console.error("Error decoding token",p),"unauthenticated"}},[]),a=ue.useMemo(()=>{const y=window.location.hostname==="localhost",d=window.location.protocol==="http:",p=window.location.port==="4173"||window.location.port==="5173",h=y&&d&&p;return{requireAuth:r??!1,agentEndpoint:t??(h?"http://localhost:8080":window.location.origin),webApp:{runner:(n==null?void 0:n.runner)??(h?"ws://localhost:8080/ws":`${d?"ws:":"wss:"}//${window.location.host}/ws`),reconnect:(n==null?void 0:n.reconnect)??!0,invertedOrder:(n==null?void 0:n.invertedOrder)??!1}}},[r,n]),[c,m]=ue.useState(()=>{const y=localStorage.getItem("cloudAssistantSettings"),d=y?JSON.parse(y):{};return d&&d.webApp&&d.webApp.reconnect!==void 0&&(d.webApp.reconnect=a.webApp.reconnect),y?{...a,...d}:a});ue.useEffect(()=>{localStorage.setItem("cloudAssistantSettings",JSON.stringify(c))},[c]);const f=ue.useCallback(y=>{const d=p=>{const h=window.location.pathname,g=Je.from(p);h!=="/login"&&g.code===Pe.Unauthenticated&&(window.location.href=`/login?error=${encodeURIComponent(g.name)}&error_description=${encodeURIComponent(g.message)}`)};return[p=>async h=>{const g=bc();return g&&h.header.set("Authorization",`Bearer ${g}`),y?p(h).catch(S=>{throw d(S),S}):p(h)}]},[]),b=ue.useMemo(()=>i??f,[i,f]),_=ue.useCallback(async()=>{if(!c.webApp.runner)return;u(null);const y=new tv({knownID:`check_${N3()}`,runID:Ul(),sequence:0,options:{runnerEndpoint:c.webApp.runner,interceptors:b(!1),autoReconnect:!1}}),d=[];return d.push(y.errors.subscribe({next:p=>u(p)})),d.push(y.connect(ev.INITIAL).subscribe(p=>{p!==null&&(console.log(`Initial heartbeat latency for streamID ${p.streamID} (${p.readyState===1?"open":"closed"}): ${p.latency}ms`),y.close())})),()=>{d.forEach(p=>p.unsubscribe())}},[i,c.webApp.runner]);ue.useEffect(()=>{_()},[_]);const k=y=>{m(d=>({...d,...y,webApp:{...d.webApp,...y.webApp}}))};return H.jsx(gv.Provider,{value:{principal:s,checkRunnerAuth:_,createAuthInterceptors:b,defaultSettings:a,runnerError:o,settings:c,updateSettings:k},children:e})},vv=ue.createContext(void 0),bv=()=>{const e=ue.useContext(vv);if(!e)throw new Error("useClient must be used within a ClientProvider");return e},_v=({children:e})=>{const[t,r]=ue.useState(),{settings:n,createAuthInterceptors:i}=cr();return ue.useEffect(()=>{r(F3(n.agentEndpoint,i(!0)))},[n.agentEndpoint,i]),H.jsx(vv.Provider,{value:{client:t,setClient:r},children:e})};function F3(e,t){console.log(`initializing the client: baseURL ${e}`);const r=Qp({baseUrl:e,interceptors:t});return Zp(b_,r)}const yv=ue.createContext(void 0),To=()=>{const e=ue.useContext(yv);if(!e)throw new Error("useOutput must be used within an OutputProvider");return e},Sv=({children:e})=>{const t=ue.useMemo(()=>new Map,[]),r=ue.useCallback((s,a)=>{t.set(s,a)},[t]),n=ue.useCallback(s=>{t.delete(s)},[t]),i=ue.useCallback(s=>t.get(s),[t]),o=ue.useCallback(()=>t,[t]),u=ue.useMemo(()=>({registerRenderer:r,unregisterRenderer:n,getRenderer:i,getAllRenderers:o}),[r,n,i,o]);return H.jsx(yv.Provider,{value:u,children:e})},wv=ue.createContext(void 0),_r=()=>{const e=ue.useContext(wv);if(!e)throw new Error("useCell must be used within a CellProvider");return e};function df(e,t){if(!e)return[];const r=e.positions.map(n=>{const i=e.cells[n];return i.kind===Lt.CODE&&(i.languageId=i.languageId||"sh"),i});return r.length===0?[]:t?r.reverse():r}const Ev=({children:e,getAccessToken:t})=>{const{settings:r,createAuthInterceptors:n,principal:i}=cr(),[o,u]=ue.useState(0),[s,a]=ue.useState(!1),[c,m]=ue.useState(!1),[f,b]=ue.useState(),{getAllRenderers:_}=To(),k=ue.useMemo(()=>{const ie=new URL(r.webApp.runner);return ie.protocol==="ws:"?ie.protocol="http:":ie.protocol="https:",ie.pathname="",ie.toString()},[r.webApp.runner]),y=ue.useMemo(()=>{if(i)return new ly("agent",i,Za($p,k,n(!0)))},[r.agentEndpoint,i]),d=ue.useMemo(()=>r.webApp.invertedOrder,[r.webApp.invertedOrder]),{client:p}=bv(),[h,g]=ue.useState(void 0),S=ue.useCallback(()=>{if(!h)return;const ie=df(h,d),B=Ge(js,{cells:ie});f&&(B.metadata[Ks.PreviousResponseId]=f),y==null||y.saveNotebook(h.runmeSession,B)},[h,d,f,y]),I=ue.useCallback(async({attemptRestore:ie})=>{if(!y)return;u(0),b(void 0);const B=y.createSession();let V;if(!ie)V=await B;else{const W=await y.listActiveSessions(),he=(await y.loadSessions(W)).filter(me=>me.data.cells.length!==0);if(he.length===0)V=await B;else{const me=he[0];let be=me.data.cells.map(J=>J.refId);d&&(be=be.reverse());const Ee=me.data.metadata[Ks.PreviousResponseId];Ee&&b(Ee),g({runmeSession:me.id,cells:me.data.cells.reduce((J,L)=>(J[L.refId]=L,J),{}),positions:be});return}}g({runmeSession:V,cells:{},positions:[]})},[d,y]);ue.useEffect(()=>{S()},[h,y,d,S]),ue.useEffect(()=>{g(ie=>({runmeSession:(ie==null?void 0:ie.runmeSession)??"",cells:(ie==null?void 0:ie.cells)??{},positions:[...(ie==null?void 0:ie.positions)??[]].reverse()}))},[d]),ue.useEffect(()=>{I&&I({attemptRestore:!0})},[I]);const C=ue.useMemo(()=>h?h.positions.map(ie=>h.cells[ie]).filter(ie=>!!ie&&(ie.kind===Lt.MARKUP||ie.kind===Lt.CODE)):[],[h]),A=ue.useMemo(()=>h?h.positions.map(ie=>h.cells[ie]).filter(ie=>!!ie&&ie.kind===Lt.CODE):[],[h]),E=ue.useMemo(()=>h?h.positions.map(ie=>h.cells[ie]).filter(ie=>!!ie&&ie.kind===Lt.DOC_RESULTS):[],[h]),N=()=>({chat:C,actions:A,files:E}),F=ie=>W0(gn,ie),U=async ie=>{const B=await t(),V=Ge(v_,{cells:ie,previousResponseId:f});V.openaiAccessToken=B,B||console.warn("No access token found (expected if oauth is disabled)");try{const W=p.generate(V);for await(const Z of W){for(const he of Z.cells)m(!1),te(he);b(Z.responseId)}}catch(W){console.log(W)}finally{m(!1),a(!1)}},P=async ie=>{if(!ie.trim())return;const B=Ge(gn,{refId:`user_${fd()}`,role:Kt.USER,kind:Lt.MARKUP,value:ie});te(B),a(!0),m(!0),await U([B])},O=async ie=>{ie.outputs.length!==0&&(console.log("sending output cell",ie.refId,"previousResponseId",f),a(!0),m(!0),await U([ie]))},te=ie=>{const B=_();for(const V of B.values())V.onCellUpdate(ie);g(V=>{if(V){if(!V.cells[ie.refId]){const W=d?[ie.refId,...V.positions]:[...V.positions,ie.refId];return{runmeSession:V.runmeSession,cells:{...V.cells,[ie.refId]:ie},positions:W}}return{...V,runmeSession:V.runmeSession,cells:{...V.cells,[ie.refId]:ie}}}})},le=()=>{const ie=`code_${fd().replace(/-/g,"")}`,B=Ge(gn,{metadata:{[Ft.ID]:ie,[Ft.RunmeID]:ie},refId:ie,languageId:"sh",role:Kt.USER,kind:Lt.CODE,value:""});te(B)},ge=ie=>{if(!A.find(W=>W.refId===ie.refId))return;const V=new CustomEvent("runCodeCell",{detail:{cellId:ie.refId}});ie.executionSummary=void 0,ie.outputs=ie.outputs.filter(W=>W.items.some(Z=>Z.mime===gr.StatefulRunmeTerminal)),u(W=>{const Z=W+1;return ie.metadata[Ft.Sequence]=Z.toString(),Z}),window.dispatchEvent(V)},ke=async({asSessionRecord:ie})=>{var L;const B=df(h,d);if(!h||B.length===0)return;const V=Ge(js,{cells:B}),W=Za(nl,r.agentEndpoint,n(!0)),Z=Ge(Qc,{notebook:V,options:Ge(qc,{outputs:Ge(zc,{enabled:!1,summary:!1})})});ie&&((L=Z.options)!=null&&L.outputs)&&(Z.options.outputs.enabled=!0,Z.options.outputs.summary=!0,Z.options.session=Ge(Jc,{id:h.runmeSession}));const he=await W.serialize(Z),me=new Blob([new Uint8Array(he.result)],{type:"text/plain"}),be=URL.createObjectURL(me),Ee=document.createElement("a");Ee.href=be;const J=ie?"Session":"Notebook";Ee.download=`${J}-${sg()}.md`,document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(be)};return H.jsx(wv.Provider,{value:{useColumns:N,sequence:o,saveState:S,exportDocument:ke,sendOutputCell:O,createOutputCell:F,sendUserCell:P,addCodeCell:le,isInputDisabled:s,isTyping:c,runCodeCell:ge,resetSession:I},children:e})},hf=new TextEncoder;function V3({pid:e,exitCode:t},r,n,i){let o;return e!==null&&t!==null&&(o=Ge(Yc,{pid:BigInt(e),exitReason:Ge(Kc,{type:"exit",code:t})})),[Ge(_o,{items:[Ge(Ai,{mime:gr.VSCodeNotebookStdOut,type:"Buffer",data:hf.encode(r)}),Ge(Ai,{mime:gr.VSCodeNotebookStdErr,type:"Buffer",data:hf.encode(n)})],processInfo:o})]}const M3=Ge(gn,{kind:Lt.MARKUP,role:Kt.ASSISTANT,value:"..."}),_c={fontSize:14,fontFamily:"monospace"},U3=new TextDecoder,P3=ue.memo(_3,(e,t)=>e.cellID===t.cellID&&e.runID===t.runID),Cv=({cell:e,onExitCode:t,onPid:r})=>{const{createAuthInterceptors:n,settings:{webApp:i}}=cr(),{sendOutputCell:o,saveState:u}=_r(),s=i.invertedOrder,[a,c]=ue.useState(!1),[m,f]=ue.useState({value:"",runID:""}),[b,_]=ue.useState(null),[k,y]=ue.useState(null),[d,p]=ue.useState(null),[h,g]=ue.useState(null),[S,I]=ue.useState(""),[C,A]=ue.useState(""),[E,N]=ue.useState(""),F=ue.useMemo(()=>Number(e.metadata[Ft.Sequence]??0),[e,k,d]),U=ue.useCallback((be=!1)=>{_(BigInt(Date.now())),I(""),A(""),y(null),p(null),c(be),f({value:e.value,runID:Ul()})},[e]),P=ue.useMemo(()=>({..._c,className:"rounded-md overflow-hidden",rows:14,scrollToFit:!s,takeFocus:a}),[s,a]);ue.useEffect(()=>{const be=Ee=>{Ee.detail.cellId===e.refId&&U()};return window.addEventListener("runCodeCell",be),()=>{window.removeEventListener("runCodeCell",be)}},[e.refId,U]);const O=ue.useMemo(()=>{const be=e.outputs.filter(J=>J.items.some(L=>L.mime===gr.StatefulRunmeTerminal)),Ee=V3({pid:k,exitCode:d},S,C);return[...be,...Ee]},[k,d,S,C,h,e.outputs]);ue.useEffect(()=>{b!==null&&(e.outputs=O,e.executionSummary=Ge(Xc,{timing:Ge(jc,{startTime:b,endTime:BigInt(Date.now())}),executionOrder:F,success:Number.isFinite(d)&&d===0}))},[e,O,d,F,b]);const te=ue.useMemo(()=>k===null||d===null||m.runID===""||!Number.isFinite(k)||!Number.isInteger(d)?null:e,[e,m.runID,d,k]);ue.useEffect(()=>{!te||E===m.runID||(N(m.runID),o(te))},[o,te,m.runID,E]),ue.useEffect(()=>{k!==null&&r(k)},[k,r]),ue.useEffect(()=>{d!==null&&t(d)},[d,t]),ue.useEffect(()=>{e.kind===Lt.CODE&&(m.runID!==""&&(e.metadata[Ft.LastRunID]=m.runID),k?e.metadata[Ft.Pid]=k.toString():delete e.metadata[Ft.Pid],d!==null&&Number.isFinite(d)?(delete e.metadata[Ft.Pid],e.metadata[Ft.ExitCode]=d.toString()):delete e.metadata[Ft.ExitCode],u())},[k,d,e,u,m.runID]);const le=ue.useMemo(()=>{if(e.kind!==Lt.CODE||E!=="")return;const be=e.outputs.flatMap(Ee=>Ee.items).find(Ee=>Ee.mime===gr.VSCodeNotebookStdOut);if(be)return U3.decode(be.data)},[e.kind,e.outputs,E]),ge=ue.useMemo(()=>{var Ee;return((Ee=e.metadata)==null?void 0:Ee[Ft.Pid])??""?e.metadata[Ft.LastRunID]??"":""},[e.metadata]),ke=ue.useMemo(()=>m.value===""||m.runID===""?[]:m.value.split(`
|
|
2143
|
-
`),[m]),ie=ue.useMemo(()=>m.runID===""?ge:m.runID,[m.runID,ge]),B=ue.useMemo(()=>({endpoint:i.runner,reconnect:i.reconnect,interceptors:n(!1)}),[i.runner,i.reconnect,n]),V=ue.useCallback(be=>{I(Ee=>Ee+new TextDecoder().decode(be))},[]),W=ue.useCallback(be=>{A(Ee=>Ee+new TextDecoder().decode(be))},[]),Z=ue.useCallback(be=>{y(be)},[]),he=ue.useCallback(be=>{p(be)},[]),me=ue.useCallback(be=>{g(be)},[]);return ke.length===0&&(!le||le.length===0)?null:H.jsx(P3,{cellID:e.refId,runID:ie,sequence:F,languageID:e.languageId,commands:ke,content:le,runner:B,settings:P,onPid:Z,onStdout:V,onStderr:W,onExitCode:he,onMimeType:me},ie)},ff="vs-dark",W3=ue.memo(({id:e,value:t,language:r,fontSize:n=14,fontFamily:i="monospace",onChange:o,onEnter:u})=>{const s=ue.useRef(u),a=ue.useRef(null),c=ue.useRef(null),[m,f]=ue.useState("140px"),[b,_]=ue.useState(!1),k=ue.useRef(0),y=ue.useRef(0);ue.useEffect(()=>{s.current=u},[u]),ue.useEffect(()=>{const h=S=>{if(!b)return;const I=S.clientY-k.current,C=Math.max(100,y.current+I);f(`${C}px`),a.current&&a.current.layout()},g=()=>{_(!1),document.body.style.cursor="default"};return b&&(document.addEventListener("mousemove",h),document.addEventListener("mouseup",g)),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",g)}},[b]);const d=(h,g)=>{a.current=h,g!=null&&g.editor&&(g.editor.setTheme(ff),h&&(h.onKeyDown(S=>{S.ctrlKey&&S.keyCode===3&&s.current()}),t===""&&h.focus()))},p=h=>{var g;_(!0),k.current=h.clientY,y.current=((g=c.current)==null?void 0:g.clientHeight)||140,document.body.style.cursor="ns-resize",h.preventDefault()};return H.jsxs("div",{className:"pb-1 w-full",ref:c,children:[H.jsx("div",{className:"rounded-md overflow-hidden",children:H.jsx(h0,{height:m,width:"100%",defaultLanguage:r,value:t,options:{scrollbar:{alwaysConsumeMouseWheel:!1},minimap:{enabled:!1},theme:ff,wordWrap:"wordWrapColumn",fontSize:n,fontFamily:i,lineHeight:20},onChange:h=>{h&&(t=h,o==null||o(h))},onMount:d,className:"rounded-lg",wrapperProps:{className:"rounded-lg"}},e)}),H.jsx("div",{className:"h-2 w-full cursor-ns-resize",onMouseDown:p})]})},(e,t)=>e.value===t.value),H3=()=>H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4338 7.5L4 3.57925Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",stroke:"currentColor",strokeWidth:"0.5"})}),$3=()=>H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M7.5 1.5C4.5 1.5 2 4 2 7C2 8.9 3 10.5 4.5 11.5L4 12.5C2 11.5 1 9.2 1 7C1 3.5 4 0.5 7.5 0.5C11 0.5 14 3.5 14 7C14 9.2 13 11.5 11 12.5L10.5 11.5C12 10.5 13 8.9 13 7C13 4 10.5 1.5 7.5 1.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),G3=()=>H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"#22c55e",fillRule:"evenodd",clipRule:"evenodd",stroke:"#22c55e",strokeWidth:"1"})}),Z3=({exitCode:e})=>H.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[H.jsx("circle",{cx:"12",cy:"12",r:"20",fill:"#ef4444",fillOpacity:"0.3"}),H.jsx("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",fill:"#ef4444",fontSize:"10",fontWeight:"bold",children:e})]});function j3(){return H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M7.5 0.75C7.91421 0.75 8.25 1.08579 8.25 1.5V7.25H14C14.4142 7.25 14.75 7.58579 14.75 8C14.75 8.41421 14.4142 8.75 14 8.75H8.25V14.5C8.25 14.9142 7.91421 15.25 7.5 15.25C7.08579 15.25 6.75 14.9142 6.75 14.5V8.75H1C0.585786 8.75 0.25 8.41421 0.25 8C0.25 7.58579 0.585786 7.25 1 7.25H6.75V1.5C6.75 1.08579 7.08579 0.75 7.5 0.75Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",strokeWidth:"0.5"})})}function K3(){return H.jsx("svg",{width:"28",height:"28",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.3",fillRule:"evenodd",clipRule:"evenodd"})})}function Y3({pid:e,exitCode:t,onClick:r}){const n=()=>t===null&&e===null?"Run code":t===null&&e!==null?"Running...":t!==null&&t===0?"Execution successful":t!==null&&t>0?`Execution failed with exit code ${t}`:"Run code";return H.jsxs(Se.Button,{variant:"soft",onClick:r,"aria-label":n(),children:[t===null&&e===null&&H.jsx(H3,{}),t===null&&e!==null&&H.jsx("div",{className:"animate-spin",children:H.jsx($3,{})}),t!==null&&t===0&&H.jsx(G3,{}),t!==null&&t>0&&H.jsx(Z3,{exitCode:t})]})}function kv({cell:e}){const{saveState:t,runCodeCell:r}=_r(),{getRenderer:n}=To(),[i,o]=ue.useState(null),[u,s]=ue.useState(null),a=ue.useCallback(()=>{r(e)},[e,r]),c=ue.useMemo(()=>{const m=Number(e.metadata[Ft.Sequence]);return m?m.toString():" "},[e,i,u]);return H.jsx("div",{children:H.jsx(Se.Box,{className:"w-full p-2",children:H.jsxs("div",{className:"flex justify-between items-top",children:[H.jsxs("div",{className:"flex flex-col items-center",children:[H.jsx(Y3,{pid:i,exitCode:u,onClick:a}),H.jsxs(Se.Text,{size:"2",className:"mt-1 p-2 font-bold text-gray-400 font-mono","data-testid":"sequence-label",children:["[",c,"]"]})]}),H.jsxs(Se.Card,{className:"whitespace-nowrap overflow-hidden flex-1 ml-2",children:[H.jsx(W3,{id:e.refId,value:e.value,language:"shellscript",fontSize:_c.fontSize,fontFamily:_c.fontFamily,onChange:m=>{e.value=m,t()},onEnter:a},`editor-${e.refId}`),e.outputs.flatMap(m=>(m.items??[]).map(f=>{const b=n(f.mime);if(!b)return null;const _=b.component;return H.jsx(_,{cell:e,onPid:o,onExitCode:s,...b.props},`${f.mime}-${e.refId}`)}))]})]})})})}function yc(){const{useColumns:e,addCodeCell:t}=_r(),{settings:r}=cr(),{actions:n}=e(),i=ue.useRef(null),o=ue.useRef(null);ue.useEffect(()=>{var a,c;if(r.webApp.invertedOrder){(a=i.current)==null||a.scrollIntoView({behavior:"smooth"});return}(c=o.current)==null||c.scrollIntoView({behavior:"smooth"})},[n,r.webApp.invertedOrder]);const{registerRenderer:u,unregisterRenderer:s}=To();return ue.useEffect(()=>(u(gr.StatefulRunmeTerminal,{onCellUpdate:a=>{a.kind!==Lt.CODE||a.outputs.length>0||(a.outputs=[Ge(_o,{items:[Ge(Ai,{mime:gr.StatefulRunmeTerminal,type:"Buffer",data:new Uint8Array})]})])},component:({cell:a,onPid:c,onExitCode:m})=>H.jsx(Cv,{cell:a,onPid:c,onExitCode:m},`console-${a.refId}`)}),()=>{s(gr.StatefulRunmeTerminal)}),[u,s]),H.jsxs("div",{className:"flex flex-col h-full",children:[H.jsxs("div",{className:"flex items-center mb-2",children:[H.jsx(Se.Text,{size:"5",weight:"bold",className:"pr-2",children:"Actions"}),H.jsx(Se.Button,{variant:"ghost",size:"1",className:"cursor-pointer",onClick:t,"aria-label":"Add code cell",children:H.jsx(j3,{})})]}),H.jsxs(Se.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-2",children:[H.jsx("div",{ref:i}),n.map(a=>H.jsx(kv,{cell:a},`action-${a.refId}`)),H.jsx("div",{ref:o})]})]})}const Iv=({role:e,children:t})=>{const r=e===Kt.USER?"self-end":"self-start",n={backgroundColor:e===Kt.USER?"var(--accent-9)":"var(--gray-a5)",color:e===Kt.USER?"var(--accent-contrast)":"var(--gray-background)",border:e===Kt.USER?"1px solid var(--accent-7)":"1px solid var(--gray-1)",borderRadius:"var(--radius-3)"};return H.jsx("div",{className:`${r} max-w-[80%] break-words m-1 p-3`,style:n,children:t})},X3=({cell:e})=>H.jsx(Iv,{role:Kt.USER,children:e.value}),J3=({cell:e})=>H.jsx(Iv,{role:Kt.ASSISTANT,children:H.jsx(f0,{components:{code:({children:t,...r})=>H.jsx("pre",{className:"whitespace-pre-wrap",children:H.jsx("code",{...r,children:String(t).replace(/\n$/,"")})})},children:e.value})}),z3=ue.memo(({cell:e,isRecentCodeCell:t,onClick:r})=>{var c,m;const{runCodeCell:n}=_r(),{settings:i}=cr(),o=((m=(c=e.value)==null?void 0:c.split(/&&|;|\n|\\n/)[0])==null?void 0:m.substring(0,50))||"",u=()=>{r?r():n(e)},s=i.webApp.invertedOrder?"justify-end":"justify-start",a=H.jsx("span",{className:"text-xs text-gray-400 p-2",children:"Press CTRL+ENTER to run"});return H.jsxs("div",{className:`flex ${s} items-center h-full`,children:[t&&i.webApp.invertedOrder&&a,H.jsxs("div",{className:"flex items-center m-1 p-2 bg-[#1e1e1e] rounded-md max-w-[60%] cursor-pointer",onClick:u,children:[H.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:H.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),H.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-1",children:[H.jsx("polyline",{points:"4 17 10 11 4 5"}),H.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),H.jsx("span",{className:"text-sm text-[#d4d4d4] italic truncate max-w-4/5",children:o})]}),t&&!i.webApp.invertedOrder&&a]})},(e,t)=>e.cell.refId===t.cell.refId&&JSON.stringify(e.cell.value)===JSON.stringify(t.cell.value)&&e.isRecentCodeCell===t.isRecentCodeCell),pf=({cell:e,isRecentCodeCell:t})=>{if(e.kind===Lt.CODE)return H.jsx(z3,{cell:e,isRecentCodeCell:t},e.refId);switch(e.role){case Kt.USER:return H.jsx(X3,{cell:e});case Kt.ASSISTANT:return H.jsx(J3,{cell:e});default:return null}},gf=()=>{const{useColumns:e,isTyping:t}=_r(),{settings:r}=cr(),{chat:n}=e(),i=ue.useRef(null);ue.useEffect(()=>{var a;r.webApp.invertedOrder||(a=i.current)==null||a.scrollIntoView({behavior:"smooth"})},[n,r.webApp.invertedOrder]);const o=r.webApp.invertedOrder?0:n.length-1,s=H.jsx("div",{className:"flex justify-start items-center h-full",children:H.jsx(pf,{cell:M3})});return H.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[t&&r.webApp.invertedOrder&&s,n.map((a,c)=>H.jsx(pf,{cell:a,isRecentCodeCell:a.kind===Lt.CODE&&c===o&&!t},c)),t&&!r.webApp.invertedOrder&&s,H.jsx("div",{ref:i})]})},mf=()=>{const{sendUserCell:e,isInputDisabled:t}=_r(),[r,n]=ue.useState(""),i=ue.useRef(null);ue.useEffect(()=>{var s;(s=i.current)==null||s.focus()},[]);const o=s=>{s.preventDefault(),r.trim()&&(e(r),n(""))},u=s=>{if(s.key==="Enter"&&!s.shiftKey){s.preventDefault();const a=s.currentTarget.form;a&&a.requestSubmit()}};return H.jsx("form",{onSubmit:o,className:"flex w-full",children:H.jsxs(Se.Flex,{className:"w-full flex flex-nowrap items-start gap-4 m-2",children:[H.jsx(Se.TextArea,{name:"userInput",value:r,onChange:s=>n(s.target.value),onKeyDown:u,placeholder:"Enter your question",size:"3",className:"flex-grow min-w-0",ref:i,rows:2,style:{resize:"vertical"}}),H.jsx(Se.Button,{type:"submit",disabled:t,children:H.jsx(K3,{})})]})})};function Sc(){const{useColumns:e,runCodeCell:t}=_r(),{settings:r}=cr(),{chat:n}=e(),i=ue.useRef(null);ue.useEffect(()=>{const u=a=>{if(a.ctrlKey&&a.key==="Enter"){const c=r.webApp.invertedOrder?n[0]:n[n.length-1];(c==null?void 0:c.kind)===Lt.CODE&&t(c)}},s=i.current;if(s)return s.addEventListener("keydown",u),()=>s.removeEventListener("keydown",u)},[n,t,r.webApp.invertedOrder]);const o=r.webApp.invertedOrder?"flex-col":"flex-col-reverse";return H.jsxs("div",{ref:i,className:"flex flex-col h-full",children:[H.jsx(Se.Text,{size:"5",weight:"bold",className:"mb-2",children:"How can I help you?"}),H.jsx(Se.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-4",children:H.jsx("div",{className:`flex ${o} h-full w-full`,children:r.webApp.invertedOrder?H.jsxs(H.Fragment,{children:[H.jsx(mf,{}),H.jsx(gf,{})]}):H.jsxs(H.Fragment,{children:[H.jsx(mf,{}),H.jsx(gf,{})]})})})]})}const Av=()=>{const{useColumns:e}=_r(),{files:t}=e(),r=ue.useRef(null),n=()=>{var u;(u=r.current)==null||u.scrollIntoView({behavior:"smooth"})},i=ue.useMemo(()=>{let u=Ge(gn,{});return t.length>0&&(u=t[t.length-1]),u},[t]);ue.useEffect(()=>{n()},[i]);const o=i.docResults.length>0;return H.jsxs("div",{className:"flex flex-col h-full",children:[H.jsx(Se.Text,{size:"5",weight:"bold",className:"mb-2",children:"Docs"}),H.jsx(Se.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 pt-4",children:o?H.jsxs("div",{className:"grow",children:[i.docResults.map(u=>H.jsx("div",{className:"mb-2",children:H.jsx(Se.Box,{p:"2",style:{borderRadius:"6px",border:"1px solid var(--gray-5)"},children:H.jsx(Se.Text,{size:"2",weight:"medium",children:H.jsx(Se.Link,{href:u.link,target:"_blank",className:"text-blue-500 hover:underline",children:u.fileName})})})},u.fileId)),H.jsx("div",{ref:r,className:"h-1"})]}):H.jsxs("div",{children:[H.jsx("div",{children:"No search results yet"}),H.jsx("div",{ref:r,className:"h-1"})]})})]})},q3=rr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Q3=Xt(q3,0),xv=Jt(Q3);function Rv(){const{runnerError:e}=cr(),[t]=jt.useSearchParams(),r=ue.useMemo(()=>e&&!(e instanceof Error)?xv[e.code]??e.code:t.get("error"),[e,t]),n=ue.useMemo(()=>e&&!(e instanceof Error)?e.message:t.get("error_description"),[e,t]),i=()=>{window.location.href="/oidc/login"};return H.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[r&&H.jsxs(Se.Callout.Root,{color:"red",children:[H.jsxs(Se.Callout.Text,{className:"font-bold",children:["Error: ",r]}),n&&H.jsx(Se.Callout.Text,{children:n})]}),H.jsx(Se.Button,{size:"4",onClick:i,className:"cursor-pointer",children:"Login"})]})}const Nv=()=>H.jsxs(Se.Container,{size:"3",style:{padding:"2rem",textAlign:"center"},children:[H.jsx(Se.Heading,{size:"8",mb:"4",children:"404"}),H.jsx(Se.Text,{size:"5",color:"gray",children:"Page not found"}),H.jsx(Se.Text,{as:"p",mt:"4",children:"The page you're looking for doesn't exist or has been moved."}),H.jsxs(Se.Text,{as:"p",mt:"4",children:["Click"," ",H.jsx(Se.Link,{href:"/",underline:"always",children:"here"})," ","to go back home."]})]});function Tv(){const e=jt.useNavigate(),{settings:t,updateSettings:r,runnerError:n,defaultSettings:i}=cr(),[o,u]=ue.useState(!1),[s,a]=ue.useState(t.agentEndpoint),[c,m]=ue.useState(t.webApp.runner),[f,b]=ue.useState(t.webApp.invertedOrder),_=()=>{r({agentEndpoint:s,webApp:{runner:c,reconnect:t.webApp.reconnect,invertedOrder:f}}),u(!0)};ue.useEffect(()=>{o&&(u(!1),n&&e("/"))},[n,o,e]);const k=()=>{a(i.agentEndpoint),m(i.webApp.runner),b(i.webApp.invertedOrder)},y=ue.useMemo(()=>{if(n&&!(!n||typeof n!="object"||!("message"in n)))return n.message},[n]),d=s!==t.agentEndpoint||c!==t.webApp.runner||f!==t.webApp.invertedOrder;return H.jsxs(Se.Box,{className:"w-full mx-auto",children:[H.jsx(Se.Text,{size:"5",weight:"bold",className:"mb-2",children:"Settings"}),H.jsxs(Se.Box,{className:"mt-4",children:[H.jsxs(Se.Flex,{direction:"column",gap:"4",children:[H.jsxs(Se.Flex,{direction:"column",gap:"2",children:[H.jsx(Se.Text,{size:"3",weight:"bold",children:"Agent Endpoint Configuration"}),H.jsx(Se.Text,{size:"2",color:"gray",children:"Configure the endpoint URL for the AI agent. Changes will take effect after saving."}),H.jsx(Se.TextArea,{size:"3",placeholder:"Enter AI endpoint URL",value:s,onChange:p=>a(p.target.value)})]}),H.jsxs(Se.Flex,{direction:"column",gap:"2",children:[H.jsx(Se.Text,{size:"3",weight:"bold",children:"Runner Endpoint Configuration"}),H.jsx(Se.Text,{size:"2",color:"gray",children:"Configure the WebSocket endpoint URL for the runner. Changes will take effect after saving."}),n&&H.jsx(Se.Callout.Root,{color:"red",children:H.jsxs(Se.Callout.Text,{className:"font-bold",children:["Runner error",y?": "+y:""]})}),H.jsx(Se.TextArea,{size:"3",placeholder:"Enter Runner WebSocket endpoint URL",value:c,onChange:p=>m(p.target.value)}),H.jsx(Se.Text,{size:"2",color:"gray",children:"Revert will reset endpoints to the default values, including protocol http(s), based on the current page."})]}),H.jsxs(Se.Flex,{direction:"column",gap:"2",children:[H.jsx(Se.Text,{size:"3",weight:"bold",children:"User Experience Mode"}),H.jsx(Se.Text,{as:"label",size:"2",children:H.jsxs(Se.Flex,{gap:"2",children:["Document Mode",H.jsx(Se.Switch,{checked:f,onCheckedChange:b}),"Console Mode"]})})]})]}),H.jsxs(Se.Flex,{gap:"3",justify:"end",mt:"4",children:[H.jsx(Se.Button,{size:"2",variant:"soft",onClick:()=>e("/"),children:"Back"}),H.jsx(Se.Button,{size:"2",variant:"soft",onClick:k,children:"Revert"}),H.jsx(Se.Button,{size:"2",onClick:_,disabled:!d,children:"Save"})]})]})]})}function eC(e,t=[]){let r=[];function n(o,u){const s=Ze.createContext(u),a=r.length;r=[...r,u];const c=f=>{var p;const{scope:b,children:_,...k}=f,y=((p=b==null?void 0:b[e])==null?void 0:p[a])||s,d=Ze.useMemo(()=>k,Object.values(k));return H.jsx(y.Provider,{value:d,children:_})};c.displayName=o+"Provider";function m(f,b){var y;const _=((y=b==null?void 0:b[e])==null?void 0:y[a])||s,k=Ze.useContext(_);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,m]}const i=()=>{const o=r.map(u=>Ze.createContext(u));return function(s){const a=(s==null?void 0:s[e])||o;return Ze.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[n,tC(i,...t)]}function tC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const u=n.reduce((s,{useScope:a,scopeName:c})=>{const f=a(o)[`__scope${c}`];return{...s,...f}},{});return Ze.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function rC(e){const t=Ze.useRef(e);return Ze.useEffect(()=>{t.current=e}),Ze.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var wc=globalThis!=null&&globalThis.document?Ze.useLayoutEffect:()=>{};function vf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nC(...e){return t=>{let r=!1;const n=e.map(i=>{const o=vf(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():vf(e[i],null)}}}}function iC(e){const t=sC(e),r=Ze.forwardRef((n,i)=>{const{children:o,...u}=n,s=Ze.Children.toArray(o),a=s.find(aC);if(a){const c=a.props.children,m=s.map(f=>f===a?Ze.Children.count(c)>1?Ze.Children.only(null):Ze.isValidElement(c)?c.props.children:null:f);return H.jsx(t,{...u,ref:i,children:Ze.isValidElement(c)?Ze.cloneElement(c,void 0,m):null})}return H.jsx(t,{...u,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function sC(e){const t=Ze.forwardRef((r,n)=>{const{children:i,...o}=r;if(Ze.isValidElement(i)){const u=lC(i),s=cC(o,i.props);return i.type!==Ze.Fragment&&(s.ref=n?nC(n,u):u),Ze.cloneElement(i,s)}return Ze.Children.count(i)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oC=Symbol("radix.slottable");function aC(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oC}function cC(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function lC(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$l=uC.reduce((e,t)=>{const r=iC(`Primitive.${t}`),n=Ze.forwardRef((i,o)=>{const{asChild:u,...s}=i,a=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ls={exports:{}},La={};/**
|
|
2142
|
+
</div>`:Ne`${r()}`};mv([Te({type:Array})],mc.prototype,"variables",2);mc=mv([zt("env-store")],mc);function M3({cellID:e,runID:t,sequence:r,languageID:n,commands:i,content:o,runner:l,settings:s={},onStdout:a,onStderr:c,onExitCode:g,onPid:f,onMimeType:b}){const{rows:_=20,className:k,fontSize:y=12,fontFamily:d="monospace",takeFocus:p=!0,scrollToFit:h=!0}=s,m=ue.useRef(null),S=ue.useMemo(()=>({id:e,takeFocus:p,initialContent:o||"",initialRows:_,view:{theme:"dark",fontFamily:d||"monospace",fontSize:y||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,smoothScrollDuration:0,scrollback:4e3}}),[e,d,y,p,h,_,o]),I=ue.useMemo(()=>({knownID:e,runID:t,sequence:r,languageID:n,runnerEndpoint:l.endpoint,reconnect:l.reconnect}),[e,t,r,n,l.endpoint,l.reconnect]);return ue.useEffect(()=>{const C=m.current;if(!C)return;const A=$=>a==null?void 0:a($.detail),E=$=>c==null?void 0:c($.detail),N=$=>g==null?void 0:g($.detail),O=$=>f==null?void 0:f($.detail),P=$=>b==null?void 0:b($.detail);return C.addEventListener("stdout",A),C.addEventListener("stderr",E),C.addEventListener("exitcode",N),C.addEventListener("pid",O),C.addEventListener("mimetype",P),()=>{C.removeEventListener("stdout",A),C.removeEventListener("stderr",E),C.removeEventListener("exitcode",N),C.removeEventListener("pid",O),C.removeEventListener("mimetype",P)}},[a,c,g,f,b]),M.jsx("div",{className:k,ref:C=>{if(!C||C.hasChildNodes())return;const A=document.createElement("runme-console");m.current=A,A.setAttribute("id",S.id),typeof S.takeFocus=="boolean"&&A.setAttribute("takeFocus",S.takeFocus?"true":"false"),S.view&&A.setAttribute("view",JSON.stringify(S.view)),S.initialRows!==void 0&&A.setAttribute("initialRows",S.initialRows.toString()),S.initialContent!==void 0&&A.setAttribute("initialContent",S.initialContent),I.runID&&A.setAttribute("stream",JSON.stringify(I)),A.interceptors=l.interceptors,A.commands=i,C.appendChild(A);const E=document.createElement("div");E.setAttribute("className","h-1"),C.appendChild(E),setTimeout(()=>{h&&!U3(E)&&E.scrollIntoView({behavior:"smooth"})},0)}})}function U3(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}class vi extends Error{}vi.prototype.name="InvalidTokenError";function P3(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function W3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return P3(t)}catch{return atob(t)}}function _v(e,t){if(typeof e!="string")throw new vi("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new vi(`Invalid token specified: missing part #${r+1}`);let i;try{i=W3(n)}catch(o){throw new vi(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new vi(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}const yv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",uo=32,$3=16,Sv=10,vf=0xffffffffffff;var fn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(fn||(fn={}));class bi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function H3(e){const t=Math.floor(e()*uo)%uo;return yv.charAt(t)}function j3(e){const t=Z3(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new bi(fn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Z3(){return Y3()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function G3(e,t){let r="";for(;e>0;e--)r=H3(t)+r;return r}function K3(e,t=Sv){if(isNaN(e))throw new bi(fn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>vf)throw new bi(fn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${vf}: ${e}`);if(e<0)throw new bi(fn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new bi(fn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%uo,n=yv.charAt(r)+n,e=(e-r)/uo;return n}function Y3(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function X3(e,t){const r=j3(),n=Date.now();return K3(n,Sv)+G3($3,r)}const J3=rr("ChphZ2VudC92MS9jcmVkZW50aWFscy5wcm90bxIIYWdlbnQudjEioQEKCk9BdXRoVG9rZW4SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEioKBmV4cGlyeRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEgoKZXhwaXJlc19pbhgGIAEoA0JAWj5naXRodWIuY29tL3J1bm1lZGV2L3J1bm1lL3YzL2FwaS9nZW4vcHJvdG8vZ28vYWdlbnQvdjE7YWdlbnR2MWIGcHJvdG8z",[Xb]),bf=Be(J3,0);/*! js-cookie v3.0.5 | MIT */function Bs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var z3={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vc(e,t){function r(i,o,l){if(!(typeof document>"u")){l=Bs({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in l)l[a]&&(s+="; "+a,l[a]!==!0&&(s+="="+l[a].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],l={},s=0;s<o.length;s++){var a=o[s].split("="),c=a.slice(1).join("=");try{var g=decodeURIComponent(a[0]);if(l[g]=e.read(c,g),i===g)break}catch{}}return i?l[i]:l}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",Bs({},o,{expires:-1}))},withAttributes:function(i){return vc(this.converter,Bs({},this.attributes,i))},withConverter:function(i){return vc(Bs({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var wv=vc(z3,{path:"/"});const q3=["agent-session","cassie-session"],Q3=["agent-oauth-token","cassie-oauth-token"];function bc(){for(const e of q3){const t=wv.get(e);if(t&&t.length>0)return t}}function eC(){let e=Ze(bf);for(const t of Q3){const r=wv.get(t);if(r&&r.length>0)try{const n=JSON.parse(r);return e=Op(bf,n),e.accessToken}catch(n){console.error("Failed to parse OAuthToken:",n)}}return e.accessToken}const Ev=ue.createContext(void 0),ir=()=>{const e=ue.useContext(Ev);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e},Cv=({children:e,agentEndpoint:t,systemShell:r,requireAuth:n,webApp:i,createAuthInterceptors:o})=>{const[l,s]=ue.useState(null),a=ue.useMemo(()=>{const d=bc();if(!d)return"unauthenticated";let p;try{return p=_v(d),p.email||p.sub||"unauthenticated"}catch(h){return console.error("Error decoding token",h),"unauthenticated"}},[]),c=ue.useMemo(()=>{const d=window.location.hostname==="localhost",p=window.location.protocol==="http:",h=window.location.port==="4173"||window.location.port==="5173"||window.location.port==="4321",m=d&&p&&h;return{requireAuth:n??!1,agentEndpoint:t||(m?"http://localhost:8080":window.location.origin),systemShell:r,webApp:{runner:(i==null?void 0:i.runner)||(m?"ws://localhost:8080/ws":`${p?"ws:":"wss:"}//${window.location.host}/ws`),reconnect:(i==null?void 0:i.reconnect)??!0,invertedOrder:(i==null?void 0:i.invertedOrder)??!1}}},[n,i]),[g,f]=ue.useState(()=>{const d=localStorage.getItem("cloudAssistantSettings"),p=d?JSON.parse(d):{};return p&&p.webApp&&p.webApp.reconnect!==void 0&&(p.webApp.reconnect=c.webApp.reconnect),d?{...c,...p}:c});ue.useEffect(()=>{localStorage.setItem("cloudAssistantSettings",JSON.stringify(g))},[g]);const b=ue.useCallback(d=>{const p=h=>{const m=window.location.pathname,S=Je.from(h);m!=="/login"&&S.code===He.Unauthenticated&&(window.location.href=`/login?error=${encodeURIComponent(S.name)}&error_description=${encodeURIComponent(S.message)}`)};return[h=>async m=>{const S=bc();return S&&m.header.set("Authorization",`Bearer ${S}`),d?h(m).catch(I=>{throw p(I),I}):h(m)}]},[]),_=ue.useMemo(()=>o??b,[o,b]),k=ue.useCallback(async()=>{if(!g.webApp.runner)return;s(null);const d=new cv({knownID:`check_${X3()}`,runID:lv(),sequence:0,options:{runnerEndpoint:g.webApp.runner,interceptors:_(!1),autoReconnect:!1}}),p=[];return p.push(d.errors.subscribe({next:h=>s(h)})),p.push(d.connect(av.INITIAL).subscribe(h=>{h!==null&&(console.log(`Initial heartbeat latency for streamID ${h.streamID} (${h.readyState===1?"open":"closed"}): ${h.latency}ms`),d.close())})),()=>{p.forEach(h=>h.unsubscribe())}},[o,g.webApp.runner]);ue.useEffect(()=>{k()},[k]);const y=d=>{f(p=>({...p,...d,webApp:{...p.webApp,...d.webApp}}))};return M.jsx(Ev.Provider,{value:{principal:a,checkRunnerAuth:k,createAuthInterceptors:_,defaultSettings:c,runnerError:l,settings:g,updateSettings:y},children:e})},kv=ue.createContext(void 0),Iv=()=>{const e=ue.useContext(kv);if(!e)throw new Error("useClient must be used within a ClientProvider");return e},Av=({children:e})=>{const[t,r]=ue.useState(),{settings:n,createAuthInterceptors:i}=ir();return ue.useEffect(()=>{r(tC(n.agentEndpoint,i(!0)))},[n.agentEndpoint,i]),M.jsx(kv.Provider,{value:{client:t,setClient:r},children:e})};function tC(e,t){console.log(`initializing the client: baseURL ${e}`);const r=og({baseUrl:e,interceptors:t});return qp(o_,r)}const _c={fontSize:14,fontFamily:"monospace"},rC=new TextDecoder,nC=ue.memo(M3,(e,t)=>e.cellID===t.cellID&&e.runID===t.runID),xv=({cell:e,onExitCode:t,onPid:r})=>{const{createAuthInterceptors:n,settings:{webApp:i}}=ir(),{sendOutputCell:o,saveState:l}=sr(),s=i.invertedOrder,[a,c]=ue.useState(!1),[g,f]=ue.useState({value:"",runID:""}),[b,_]=ue.useState(null),[k,y]=ue.useState(null),[d,p]=ue.useState(null),[h,m]=ue.useState(null),[S,I]=ue.useState(""),[C,A]=ue.useState(""),[E,N]=ue.useState(""),O=ue.useMemo(()=>Number(e.metadata[Ft.Sequence]??0),[e,k,d]),P=ue.useCallback((pe=!1)=>{_(BigInt(Date.now())),I(""),A(""),y(null),p(null),c(pe),f({value:e.value,runID:lv()})},[e]),$=ue.useMemo(()=>({..._c,className:"rounded-md overflow-hidden",rows:14,scrollToFit:!s,takeFocus:a}),[s,a]);ue.useEffect(()=>{const pe=_e=>{_e.detail.cellId===e.refId&&P()};return window.addEventListener("runCodeCell",pe),()=>{window.removeEventListener("runCodeCell",pe)}},[e.refId,P]);const D=ue.useMemo(()=>{const pe=e.outputs.filter(Y=>Y.items.some(L=>L.mime===mr.StatefulRunmeTerminal)),_e=iC({pid:k,exitCode:d},S,C);return[...pe,..._e]},[k,d,S,C,h,e.outputs]);ue.useEffect(()=>{b!==null&&(e.outputs=D,e.executionSummary=Ze(Gc,{timing:Ze(Hc,{startTime:b,endTime:BigInt(Date.now())}),executionOrder:O,success:Number.isFinite(d)&&d===0}))},[e,D,d,O,b]);const re=ue.useMemo(()=>k===null||d===null||g.runID===""||!Number.isFinite(k)||!Number.isInteger(d)?null:e,[e,g.runID,d,k]);ue.useEffect(()=>{!re||E===g.runID||(N(g.runID),o(re))},[o,re,g.runID,E]),ue.useEffect(()=>{k!==null&&r(k)},[k,r]),ue.useEffect(()=>{d!==null&&t(d)},[d,t]),ue.useEffect(()=>{e.kind===it.CODE&&(g.runID!==""&&(e.metadata[Ft.LastRunID]=g.runID),k?e.metadata[Ft.Pid]=k.toString():delete e.metadata[Ft.Pid],d!==null&&Number.isFinite(d)?(delete e.metadata[Ft.Pid],e.metadata[Ft.ExitCode]=d.toString()):delete e.metadata[Ft.ExitCode],l())},[k,d,e,l,g.runID]);const le=ue.useMemo(()=>{if(e.kind!==it.CODE||E!=="")return;const pe=e.outputs.flatMap(_e=>_e.items).find(_e=>_e.mime===mr.VSCodeNotebookStdOut);if(pe)return rC.decode(pe.data)},[e.kind,e.outputs,E]),ge=ue.useMemo(()=>{var _e;return((_e=e.metadata)==null?void 0:_e[Ft.Pid])??""?e.metadata[Ft.LastRunID]??"":""},[e.metadata]),Ie=ue.useMemo(()=>g.value===""||g.runID===""?[]:g.value.split(`
|
|
2143
|
+
`),[g]),me=ue.useMemo(()=>g.runID===""?ge:g.runID,[g.runID,ge]),B=ue.useMemo(()=>({endpoint:i.runner,reconnect:i.reconnect,interceptors:n(!1)}),[i.runner,i.reconnect,n]),U=ue.useCallback(pe=>{I(_e=>_e+new TextDecoder().decode(pe))},[]),F=ue.useCallback(pe=>{A(_e=>_e+new TextDecoder().decode(pe))},[]),j=ue.useCallback(pe=>{y(pe)},[]),oe=ue.useCallback(pe=>{p(pe)},[]),fe=ue.useCallback(pe=>{m(pe)},[]);return Ie.length===0&&(!le||le.length===0)?null:M.jsx(nC,{cellID:e.refId,runID:me,sequence:O,languageID:e.languageId,commands:Ie,content:le,runner:B,settings:$,onPid:j,onStdout:U,onStderr:F,onExitCode:oe,onMimeType:fe},me)},Rv=ue.createContext(void 0),Gl=()=>{const e=ue.useContext(Rv);if(!e)throw new Error("useOutput must be used within an OutputProvider");return e},Nv=({children:e})=>{const t=ue.useMemo(()=>new Map,[]),r=ue.useCallback((s,a)=>{t.set(s,a)},[t]),n=ue.useCallback(s=>{t.delete(s)},[t]),i=ue.useCallback(s=>t.get(s),[t]),o=ue.useCallback(()=>t,[t]),l=ue.useMemo(()=>({registerRenderer:r,unregisterRenderer:n,getRenderer:i,getAllRenderers:o}),[r,n,i,o]);return ue.useEffect(()=>(r(mr.StatefulRunmeTerminal,{onCellUpdate:s=>{s.kind!==it.CODE||s.outputs.length>0||(s.outputs=[Ze(go,{items:[Ze(Ai,{mime:mr.StatefulRunmeTerminal,type:"Buffer",data:new Uint8Array})]})])},component:({cell:s,onPid:a,onExitCode:c})=>M.jsx(xv,{cell:s,onPid:a,onExitCode:c},`console-${s.refId}`)}),()=>{n(mr.StatefulRunmeTerminal)}),[r,n]),M.jsx(Rv.Provider,{value:l,children:e})},Tv=ue.createContext(void 0),sr=()=>{const e=ue.useContext(Tv);if(!e)throw new Error("useCell must be used within a CellProvider");return e};function _f(e,t){if(!e)return[];const r=e.positions.map(n=>{const i=e.cells[n];return i.kind===it.CODE&&(i.languageId=i.languageId||"txt"),i});return r.length===0?[]:t?r.reverse():r}const Bv=({children:e,getAccessToken:t})=>{const{settings:r,createAuthInterceptors:n,principal:i}=ir(),[o,l]=ue.useState(0),[s,a]=ue.useState(!1),[c,g]=ue.useState(!1),[f,b]=ue.useState(),{getAllRenderers:_}=Gl(),k=ue.useMemo(()=>{const F=new URL(r.webApp.runner);return F.protocol==="ws:"?F.protocol="http:":F.protocol="https:",F.pathname="",F.toString()},[r.webApp.runner]),y=ue.useMemo(()=>{if(i)return new xy("agent",i,Za(Jp,k,n(!0)))},[r.agentEndpoint,i]),d=ue.useMemo(()=>r.webApp.invertedOrder,[r.webApp.invertedOrder]),{client:p}=Iv(),[h,m]=ue.useState(void 0),S=ue.useMemo(()=>h?_f(h,d):[],[h,d]),I=ue.useCallback(()=>{if(!h)return;const F=Ze(Gs,{cells:S});f&&(F.metadata[Ks.PreviousResponseId]=f),y==null||y.saveNotebook(h.runmeSession,F)},[S,f,y]),C=ue.useCallback(async({attemptRestore:F})=>{if(!y)return;l(0),b(void 0);const j=y.createSession();let oe;if(!F)oe=await j;else{const fe=await y.listActiveSessions(),_e=(await y.loadSessions(fe)).filter(Y=>Y.data.cells.length!==0);if(_e.length===0)oe=await j;else{const Y=_e[0];let L=Y.data.cells.map(ae=>ae.refId);d&&(L=L.reverse());const ie=Y.data.metadata[Ks.PreviousResponseId];ie&&b(ie),m({runmeSession:Y.id,cells:Y.data.cells.reduce((ae,ke)=>(ae[ke.refId]=ke,ae),{}),positions:L});return}}m({runmeSession:oe,cells:{},positions:[]})},[d,y]);ue.useEffect(()=>{I()},[h,y,d,I]),ue.useEffect(()=>{m(F=>({runmeSession:(F==null?void 0:F.runmeSession)??"",cells:(F==null?void 0:F.cells)??{},positions:[...(F==null?void 0:F.positions)??[]].reverse()}))},[d]),ue.useEffect(()=>{C&&C({attemptRestore:!0})},[C]);const A=ue.useMemo(()=>h?h.positions.map(F=>h.cells[F]).filter(F=>!!F&&(F.kind===it.MARKUP||F.kind===it.TOOL||F.kind===it.CODE)):[],[h]),E=ue.useMemo(()=>h?h.positions.map(F=>h.cells[F]).filter(F=>!!F&&F.kind===it.CODE):[],[h]),N=ue.useMemo(()=>h?h.positions.map(j=>h.cells[j]).filter(j=>!!j&&j.kind===it.TOOL&&j.value.trim()==="file_search"):[],[h]),O=ue.useMemo(()=>h?h.positions.map(F=>h.cells[F]).filter(F=>!!F):[],[h]),P=()=>({chat:A,actions:E,files:N,all:O}),$=F=>Hb(pn,F),D=async F=>{const j=await t(),oe=Ze(s_,{cells:F,previousResponseId:f});oe.openaiAccessToken=j,j||console.warn("No access token found (expected if oauth is disabled)");try{const fe=p.generate(oe);for await(const pe of fe){for(const _e of pe.cells)g(!1),ge(_e);b(pe.responseId)}}catch(fe){console.log(fe)}finally{g(!1),a(!1)}},re=async F=>{if(!F.trim())return;const j=Ze(pn,{refId:`user_${_d()}`,role:Kt.USER,kind:it.MARKUP,value:F});ge(j),a(!0),g(!0),await D([j])},le=async F=>{F.outputs.length!==0&&(console.log("sending output cell",F.refId,"previousResponseId",f),a(!0),g(!0),await D([F]))},ge=F=>{const j=_();for(const oe of j.values())oe.onCellUpdate(F);m(oe=>{var fe;if(oe){if(!oe.cells[F.refId]){if(F.kind===it.CODE&&oe.positions.length>0){const _e=_f(oe,d);let Y;for(let L=_e.length-1;L>=0;L--)if(((fe=_e[L])==null?void 0:fe.kind)===it.CODE){Y=_e[L];break}if(Y&&Ny(Y,F,2))return oe}const pe=d?[F.refId,...oe.positions]:[...oe.positions,F.refId];return{runmeSession:oe.runmeSession,cells:{...oe.cells,[F.refId]:F},positions:pe}}return{...oe,runmeSession:oe.runmeSession,cells:{...oe.cells,[F.refId]:F}}}})},Ie=({value:F,languageId:j}={})=>{const oe=`code_${_d().replace(/-/g,"")}`,fe=Ze(pn,{metadata:{[Ft.ID]:oe,[Ft.RunmeID]:oe},refId:oe,languageId:j??"txt",role:Kt.USER,kind:it.CODE,value:F??""});ge(fe)},me=F=>{if(!E.find(fe=>fe.refId===F.refId))return;const oe=new CustomEvent("runCodeCell",{detail:{cellId:F.refId}});F.executionSummary=void 0,F.outputs=F.outputs.filter(fe=>fe.items.some(pe=>pe.mime===mr.StatefulRunmeTerminal)),l(fe=>{const pe=fe+1;return F.metadata[Ft.Sequence]=pe.toString(),pe}),window.dispatchEvent(oe)},B=ue.useCallback(async(F,j)=>{var Y;const oe=Ze(Gs,{cells:F}),fe=Za(el,r.agentEndpoint,n(!0)),pe=Ze(Jc,{notebook:oe,options:Ze(Xc,{outputs:Ze(Yc,{enabled:!1,summary:!1})})});return j&&((Y=pe.options)!=null&&Y.outputs)&&(pe.options.outputs.enabled=!0,pe.options.outputs.summary=!0,pe.options.session=Ze(Kc,{id:(h==null?void 0:h.runmeSession)??""})),(await fe.serialize(pe)).result},[r.agentEndpoint,n,h==null?void 0:h.runmeSession]),U=async({asSessionRecord:F})=>{if(!h||S.length===0)return;const j=await B(S,F),oe=new Uint8Array(j),fe=new Blob([oe],{type:"text/plain"}),pe=URL.createObjectURL(fe),_e=document.createElement("a");_e.href=pe;const Y=F?"Session":"Notebook";_e.download=`${Y}-${ol()}.md`,document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(pe)};return M.jsx(Tv.Provider,{value:{useColumns:P,ascendingCells:S,sequence:o,saveState:I,serializeNotebook:B,exportDocument:U,sendOutputCell:le,createOutputCell:$,sendUserCell:re,addCodeCell:Ie,updateCell:ge,isInputDisabled:s,isTyping:c,runCodeCell:me,resetSession:C},children:e})},yf=new TextEncoder;function iC({pid:e,exitCode:t},r,n,i){let o;e!==null&&t!==null&&(o=Ze(Zc,{pid:BigInt(e),exitReason:Ze(jc,{type:"exit",code:t})}));const l=[Ze(Ai,{mime:mr.VSCodeNotebookStdOut,type:"Buffer",data:yf.encode(r)})];return n.length>0&&l.push(Ze(Ai,{mime:mr.VSCodeNotebookStdErr,type:"Buffer",data:yf.encode(n)})),[Ze(go,{items:l,processInfo:o})]}const Kl=Ze(pn,{kind:it.MARKUP,role:Kt.ASSISTANT,value:"..."}),Sf="vs-dark",sC=[{value:"plaintext",label:"Text"},{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"csharp",label:"C#"},{value:"cpp",label:"C++"},{value:"c",label:"C"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"ruby",label:"Ruby"},{value:"php",label:"PHP"},{value:"shellscript",label:"Shell"},{value:"bash",label:"Bash"},{value:"powershell",label:"PowerShell"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"xml",label:"XML"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"scss",label:"SCSS"},{value:"sql",label:"SQL"},{value:"markdown",label:"Markdown"},{value:"dockerfile",label:"Dockerfile"},{value:"makefile",label:"Makefile"},{value:"ini",label:"INI"},{value:"toml",label:"TOML"}],wf={sh:"shellscript",bash:"shellscript",shell:"shellscript",zsh:"shellscript",fish:"shellscript",ts:"typescript",js:"javascript",py:"python",rb:"ruby",md:"markdown",yml:"yaml",ps1:"powershell",ps:"powershell",txt:"plaintext"},oC=ue.memo(({id:e,value:t,language:r,fontSize:n=14,fontFamily:i="monospace",onChange:o,onEnter:l,showLanguageSelector:s=!1})=>{var E;const a=ue.useRef(l),c=ue.useRef(null),g=ue.useRef(null),f=ue.useRef(null),[b,_]=ue.useState("280px"),[k,y]=ue.useState(!1),[d,p]=ue.useState(r),h=ue.useRef(0),m=ue.useRef(0);ue.useEffect(()=>{a.current=l},[l]),ue.useEffect(()=>{if(p(r),c.current&&g.current){const N=c.current.getModel();N&&g.current.editor.setModelLanguage(N,r)}},[r]),ue.useEffect(()=>{const N=P=>{if(!k)return;const $=P.clientY-h.current,D=Math.max(100,m.current+$);_(`${D}px`),c.current&&c.current.layout()},O=()=>{y(!1),document.body.style.cursor="default"};return k&&(document.addEventListener("mousemove",N),document.addEventListener("mouseup",O)),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",O)}},[k]);const S=(N,O)=>{c.current=N,g.current=O,O!=null&&O.editor&&(O.editor.setTheme(Sf),N&&(N.onKeyDown(P=>{P.ctrlKey&&P.keyCode===3&&a.current()}),t===""&&N.focus()))},I=d&&wf[d.toLowerCase()]?wf[d.toLowerCase()]:d||"plaintext",C=((E=sC.find(N=>N.value===I))==null?void 0:E.label)||d,A=N=>{var O;y(!0),h.current=N.clientY,m.current=((O=f.current)==null?void 0:O.clientHeight)||140,document.body.style.cursor="ns-resize",N.preventDefault()};return M.jsxs("div",{className:"pb-1 w-full",ref:f,children:[M.jsxs("div",{className:"rounded-md overflow-hidden relative",children:[M.jsx(N0,{height:b,defaultLanguage:r,value:t,options:{scrollbar:{alwaysConsumeMouseWheel:!1},minimap:{enabled:!1},theme:Sf,wordWrap:"wordWrapColumn",fontSize:n,fontFamily:i,lineHeight:20,automaticLayout:!0},onChange:N=>{N&&(o==null||o(N))},onMount:S,className:"rounded-lg",wrapperProps:{className:"rounded-lg"}},e),s&&M.jsx("div",{className:"absolute bottom-2 right-2 z-10",children:M.jsx("div",{className:"px-2 py-1 text-xs bg-gray-800/90 border border-gray-700/50 rounded text-gray-300 backdrop-blur-sm",children:C})})]}),M.jsx("div",{className:"h-2 w-full cursor-ns-resize",onMouseDown:A})]})},(e,t)=>e.value===t.value),Lv=()=>M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4338 7.5L4 3.57925Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",stroke:"currentColor",strokeWidth:"0.5"})}),Ov=()=>M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M7.5 1.5C4.5 1.5 2 4 2 7C2 8.9 3 10.5 4.5 11.5L4 12.5C2 11.5 1 9.2 1 7C1 3.5 4 0.5 7.5 0.5C11 0.5 14 3.5 14 7C14 9.2 13 11.5 11 12.5L10.5 11.5C12 10.5 13 8.9 13 7C13 4 10.5 1.5 7.5 1.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),Dv=()=>M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"#22c55e",fillRule:"evenodd",clipRule:"evenodd",stroke:"#22c55e",strokeWidth:"1"})}),Fv=({exitCode:e})=>M.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[M.jsx("circle",{cx:"12",cy:"12",r:"20",fill:"#ef4444",fillOpacity:"0.3"}),M.jsx("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",fill:"#ef4444",fontSize:"10",fontWeight:"bold",children:e})]});function Vv(){return M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M7.5 0.75C7.91421 0.75 8.25 1.08579 8.25 1.5V7.25H14C14.4142 7.25 14.75 7.58579 14.75 8C14.75 8.41421 14.4142 8.75 14 8.75H8.25V14.5C8.25 14.9142 7.91421 15.25 7.5 15.25C7.08579 15.25 6.75 14.9142 6.75 14.5V8.75H1C0.585786 8.75 0.25 8.41421 0.25 8C0.25 7.58579 0.585786 7.25 1 7.25H6.75V1.5C6.75 1.08579 7.08579 0.75 7.5 0.75Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",strokeWidth:"0.5"})})}function Mv(){return M.jsx("svg",{width:"28",height:"28",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.3",fillRule:"evenodd",clipRule:"evenodd"})})}function aC({pid:e,exitCode:t,onClick:r}){const n=()=>t===null&&e===null?"Run code":t===null&&e!==null?"Running...":t!==null&&t===0?"Execution successful":t!==null&&t>0?`Execution failed with exit code ${t}`:"Run code";return M.jsxs(we.Button,{variant:"soft",onClick:r,"aria-label":n(),children:[t===null&&e===null&&M.jsx(Lv,{}),t===null&&e!==null&&M.jsx("div",{className:"animate-spin",children:M.jsx(Ov,{})}),t!==null&&t===0&&M.jsx(Dv,{}),t!==null&&t>0&&M.jsx(Fv,{exitCode:t})]})}function Yl({cell:e}){const{saveState:t,runCodeCell:r}=sr(),{getRenderer:n}=Gl(),[i,o]=ue.useState(null),[l,s]=ue.useState(null),a=ue.useCallback(()=>{r(e)},[e,r]),c=ue.useMemo(()=>{const g=Number(e.metadata[Ft.Sequence]);return g?g.toString():" "},[e,i,l]);return M.jsx("div",{className:"w-full min-w-0",children:M.jsx(we.Box,{className:"w-full p-2",children:M.jsxs("div",{className:"flex justify-between items-start gap-2 w-full",children:[M.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[M.jsx(aC,{pid:i,exitCode:l,onClick:a}),M.jsxs(we.Text,{size:"2",className:"mt-1 p-2 font-bold text-gray-400 font-mono","data-testid":"sequence-label",children:["[",c,"]"]})]}),M.jsxs(we.Card,{className:"flex-1 ml-2 min-w-0",children:[M.jsx(oC,{id:e.refId,value:e.value,language:e.languageId,fontSize:_c.fontSize,fontFamily:_c.fontFamily,showLanguageSelector:!0,onChange:g=>{e.value=g,t()},onEnter:a},`editor-${e.refId}`),e.outputs.flatMap(g=>(g.items??[]).map(f=>{const b=n(f.mime);if(!b)return null;const _=b.component;return M.jsx(_,{cell:e,onPid:o,onExitCode:s,...b.props},`${f.mime}-${e.refId}`)}))]})]})})})}function Uv({headline:e="Actions",scrollToLatest:t=!0}){const{useColumns:r,addCodeCell:n}=sr(),{settings:i}=ir(),{actions:o}=r(),l=ue.useRef(null),s=ue.useRef(null);return ue.useEffect(()=>{var a,c;if(t){if(i.webApp.invertedOrder){(a=l.current)==null||a.scrollIntoView({behavior:"smooth"});return}(c=s.current)==null||c.scrollIntoView({behavior:"smooth"})}},[o,i.webApp.invertedOrder]),M.jsxs("div",{className:"flex flex-col h-full w-full",children:[M.jsxs("div",{className:"flex items-center mb-2",children:[M.jsx(we.Text,{size:"5",weight:"bold",className:"pr-2",children:e}),M.jsx(we.Button,{variant:"ghost",size:"1",className:"cursor-pointer",onClick:()=>n({languageId:"sh"}),"aria-label":"Add code cell",children:M.jsx(Vv,{})})]}),M.jsxs(we.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-2",children:[M.jsx("div",{ref:l}),o.map(a=>M.jsx(Yl,{cell:a},`action-${a.refId}`)),M.jsx("div",{ref:s})]})]})}const ho=({role:e,kind:t,children:r})=>{const n=e===Kt.USER,i=t===it.TOOL,o=`${n?"self-end":"self-start"} max-w-[80%] break-words m-1 p-3`,s=i?{backgroundColor:"transparent",color:"var(--gray-10)",border:"1px solid var(--gray-7)",borderRadius:"var(--radius-3)",fontSize:"0.875rem"}:{backgroundColor:n?"var(--accent-9)":"var(--gray-a5)",color:n?"var(--accent-contrast)":"var(--gray-background)",border:n?"1px solid var(--accent-7)":"1px solid var(--gray-1)",borderRadius:"var(--radius-3)"};return M.jsx("div",{className:o,style:s,children:r})},Pv=({cell:e})=>M.jsx(ho,{role:Kt.USER,kind:e.kind,children:e.value}),Wv=({cell:e})=>M.jsx(ho,{role:Kt.ASSISTANT,kind:e.kind,children:M.jsx(T0,{components:{code:({children:t,...r})=>M.jsx("pre",{className:"whitespace-pre-wrap",children:M.jsx("code",{...r,children:String(t).replace(/\n$/,"")})})},children:e.value})}),cC=ue.memo(({cell:e,isRecentCodeCell:t,onClick:r})=>{var c,g;const{runCodeCell:n}=sr(),{settings:i}=ir(),o=((g=(c=e.value)==null?void 0:c.split(/&&|;|\n|\\n/)[0])==null?void 0:g.substring(0,50))||"",l=()=>{r?r():n(e)},s=i.webApp.invertedOrder?"justify-end":"justify-start",a=M.jsx("span",{className:"text-xs text-gray-400 p-2",children:"Press CTRL+ENTER to run"});return M.jsxs("div",{className:`flex ${s} items-center h-full`,children:[t&&i.webApp.invertedOrder&&a,M.jsxs("div",{className:"flex items-center m-1 p-2 bg-[#1e1e1e] rounded-md max-w-[60%] cursor-pointer",onClick:l,children:[M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:M.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),M.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-1",children:[M.jsx("polyline",{points:"4 17 10 11 4 5"}),M.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),M.jsx("span",{className:"text-sm text-[#d4d4d4] italic truncate max-w-4/5",children:o})]}),t&&!i.webApp.invertedOrder&&a]})},(e,t)=>e.cell.refId===t.cell.refId&&JSON.stringify(e.cell.value)===JSON.stringify(t.cell.value)&&e.isRecentCodeCell===t.isRecentCodeCell),yc=({cell:e,isRecentCodeCell:t})=>{switch(e.kind){case it.CODE:return M.jsx(cC,{cell:e,isRecentCodeCell:t},e.refId);case it.TOOL:return M.jsx($v,{cell:e},e.refId)}switch(e.role){case Kt.USER:return M.jsx(Pv,{cell:e});case Kt.ASSISTANT:return M.jsx(Wv,{cell:e});default:return null}},Ef=({scrollToLatest:e=!0})=>{const{useColumns:t,isTyping:r}=sr(),{settings:n}=ir(),{chat:i}=t(),o=ue.useRef(null);ue.useEffect(()=>{var c;e&&(n.webApp.invertedOrder||(c=o.current)==null||c.scrollIntoView({behavior:"smooth"}))},[i,n.webApp.invertedOrder]);const l=n.webApp.invertedOrder?0:i.length-1,a=M.jsx("div",{className:"flex justify-start items-center h-full",children:M.jsx(yc,{cell:Kl})});return M.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[r&&n.webApp.invertedOrder&&a,i.map((c,g)=>M.jsx(yc,{cell:c,isRecentCodeCell:c.kind===it.CODE&&g===l&&!r},g)),r&&!n.webApp.invertedOrder&&a,M.jsx("div",{ref:o})]})},Sc=({placeholder:e})=>{const{sendUserCell:t,isInputDisabled:r}=sr(),[n,i]=ue.useState(""),o=ue.useRef(null);ue.useEffect(()=>{var a;(a=o.current)==null||a.focus()},[]);const l=a=>{a.preventDefault(),n.trim()&&(t(n),i(""))},s=a=>{if(a.key==="Enter"&&!a.shiftKey){a.preventDefault();const c=a.currentTarget.form;c&&c.requestSubmit()}};return M.jsx("form",{onSubmit:l,className:"flex w-full",children:M.jsxs(we.Flex,{className:"w-full flex flex-nowrap items-start gap-4 m-2",children:[M.jsx(we.TextArea,{name:"userInput",value:n,onChange:a=>i(a.target.value),onKeyDown:s,placeholder:e||"Enter your question",size:"3",className:"flex-grow min-w-0",ref:o,rows:2,style:{resize:"vertical"}}),M.jsx(we.Button,{type:"submit",disabled:r,children:M.jsx(Mv,{})})]})})},lC=e=>{var l;const t=e.value,n=!((l=e.executionSummary)!=null&&l.success)?M.jsx("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",children:M.jsx("path",{d:"M7.5 1.5C4.5 1.5 2 4 2 7C2 8.9 3 10.5 4.5 11.5L4 12.5C2 11.5 1 9.2 1 7C1 3.5 4 0.5 7.5 0.5C11 0.5 14 3.5 14 7C14 9.2 13 11.5 11 12.5L10.5 11.5C12 10.5 13 8.9 13 7C13 4 10.5 1.5 7.5 1.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}):M.jsx("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",stroke:"currentColor",strokeWidth:"1"})});let i=t,o;switch(t){case"code":case"shell":i="Code Generation",o=M.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[M.jsx("polyline",{points:"16 18 22 12 16 6"}),M.jsx("polyline",{points:"8 6 2 12 8 18"})]});break;case"file_search":i="Searching",o=M.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[M.jsx("circle",{cx:"6.5",cy:"6.5",r:"4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),M.jsx("line",{x1:"10",y1:"10",x2:"13.5",y2:"13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});break;default:o=M.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[M.jsx("path",{d:"M12.5 2.5L2.5 12.5M2.5 2.5L12.5 12.5M7.5 1.5L7.5 3.5M7.5 11.5L7.5 13.5M1.5 7.5L3.5 7.5M11.5 7.5L13.5 7.5M10.5 4.5L12.5 2.5M4.5 10.5L2.5 12.5M4.5 4.5L2.5 2.5M10.5 10.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),M.jsx("path",{d:"M7.5 1.5C7.5 1.5 7.5 3.5 7.5 3.5M7.5 11.5C7.5 11.5 7.5 13.5 7.5 13.5M1.5 7.5C1.5 7.5 3.5 7.5 3.5 7.5M11.5 7.5C11.5 7.5 13.5 7.5 13.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}return{progressIcon:n,toolIcon:o,toolLabel:i}},uC=new TextDecoder,$v=({cell:e})=>{const t=ue.useMemo(()=>e.outputs.map(o=>o.items.map(l=>{const s=new Blob([uC.decode(l.data)],{type:l.mime}),a=URL.createObjectURL(s),c=`Demo-${new Date().toISOString()}.md`;return M.jsxs(ho,{role:Kt.ASSISTANT,kind:it.MARKUP,children:["Docs ready to download at"," ",M.jsx("a",{href:a,download:c,className:"underline",children:c})]})})),[e.outputs]),{progressIcon:r,toolIcon:n,toolLabel:i}=lC(e);return M.jsxs(M.Fragment,{children:[t,M.jsx(ho,{role:e.role,kind:e.kind,children:M.jsxs("div",{className:"flex items-center gap-2",children:[n,M.jsx("span",{className:"text-sm font-medium",children:i}),r]})})]})};function Hv(){const{useColumns:e}=sr(),{all:t}=e(),r=t.length>0?"What's next?":"What problem brings you here today?";return M.jsxs("div",{children:[M.jsx(dC,{}),M.jsx(Sc,{placeholder:r})]})}const dC=()=>{const{useColumns:e,isTyping:t}=sr(),{settings:r}=ir(),{all:n}=e(),o=M.jsx("div",{className:"flex justify-start items-center h-full",children:M.jsx(yc,{cell:Kl})});return M.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[t&&r.webApp.invertedOrder&&o,n.map(l=>{switch(l.kind){case it.CODE:return M.jsx(Yl,{cell:l},l.refId);case it.TOOL:return M.jsx($v,{cell:l},l.refId)}switch(l.role){case Kt.USER:return M.jsx(Pv,{cell:l},l.refId);case Kt.ASSISTANT:return M.jsx(Wv,{cell:l},l.refId);default:return null}}),t&&!r.webApp.invertedOrder&&o]})};function wc(){const{useColumns:e,runCodeCell:t}=sr(),{settings:r}=ir(),{chat:n}=e(),i=ue.useRef(null);ue.useEffect(()=>{const l=a=>{if(a.ctrlKey&&a.key==="Enter"){const c=r.webApp.invertedOrder?n[0]:n[n.length-1];(c==null?void 0:c.kind)===it.CODE&&t(c)}},s=i.current;if(s)return s.addEventListener("keydown",l),()=>s.removeEventListener("keydown",l)},[n,t,r.webApp.invertedOrder]);const o=r.webApp.invertedOrder?"flex-col":"flex-col-reverse";return M.jsxs("div",{ref:i,className:"flex flex-col h-full w-full",children:[M.jsx(we.Text,{size:"5",weight:"bold",className:"mb-2",children:"How can I help you?"}),M.jsx(we.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-4",children:M.jsx("div",{className:`flex ${o} h-full w-full`,children:r.webApp.invertedOrder?M.jsxs(M.Fragment,{children:[M.jsx(Sc,{}),M.jsx(Ef,{})]}):M.jsxs(M.Fragment,{children:[M.jsx(Sc,{}),M.jsx(Ef,{})]})})})]})}const jv=({headline:e,scrollToLatest:t=!0})=>{const{useColumns:r}=sr(),{files:n}=r(),i=ue.useRef(null),o=()=>{var a;(a=i.current)==null||a.scrollIntoView({behavior:"smooth"})},l=ue.useMemo(()=>{let a=Ze(pn,{});return n.length>0&&(a=n[n.length-1]),a},[n]);ue.useEffect(()=>{t&&o()},[l,t]);const s=l.docResults.length>0;return M.jsxs("div",{className:"flex flex-col h-full w-full",children:[e&&M.jsx(we.Text,{size:"5",weight:"bold",className:"mb-2",children:e}),M.jsx(we.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 w-min-content",children:s?M.jsxs("div",{className:"grow",children:[l.docResults.map(a=>M.jsx("div",{className:"mb-2",children:M.jsx(we.Box,{p:"2",style:{borderRadius:"6px",border:"1px solid var(--gray-5)"},children:M.jsx(we.Text,{size:"2",weight:"medium",children:M.jsx(we.Link,{href:a.link,target:"_blank",className:"text-blue-500 hover:underline",children:a.fileName})})})},a.fileId)),M.jsx("div",{ref:i,className:"h-1"})]}):M.jsxs("div",{children:[M.jsx("div",{children:"No search results yet"}),M.jsx("div",{ref:i,className:"h-1"})]})})]})},hC=rr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),fC=Xt(hC,0),Zv=Jt(fC);function Gv(){const{runnerError:e}=ir(),[t]=Vt.useSearchParams(),r=ue.useMemo(()=>e&&!(e instanceof Error)?Zv[e.code]??e.code:t.get("error"),[e,t]),n=ue.useMemo(()=>e&&!(e instanceof Error)?e.message:t.get("error_description"),[e,t]),i=()=>{window.location.href="/oidc/login"};return M.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[r&&M.jsxs(we.Callout.Root,{color:"red",children:[M.jsxs(we.Callout.Text,{className:"font-bold",children:["Error: ",r]}),n&&M.jsx(we.Callout.Text,{children:n})]}),M.jsx(we.Button,{size:"4",onClick:i,className:"cursor-pointer",children:"Login"})]})}const Kv=()=>M.jsxs(we.Container,{size:"3",style:{padding:"2rem",textAlign:"center"},children:[M.jsx(we.Heading,{size:"8",mb:"4",children:"404"}),M.jsx(we.Text,{size:"5",color:"gray",children:"Page not found"}),M.jsx(we.Text,{as:"p",mt:"4",children:"The page you're looking for doesn't exist or has been moved."}),M.jsxs(we.Text,{as:"p",mt:"4",children:["Click"," ",M.jsx(we.Link,{href:"/",underline:"always",children:"here"})," ","to go back home."]})]});function Yv(){const e=Vt.useNavigate(),{settings:t,updateSettings:r,runnerError:n,defaultSettings:i}=ir(),[o,l]=ue.useState(!1),[s,a]=ue.useState(t.agentEndpoint),[c,g]=ue.useState(t.webApp.runner),[f,b]=ue.useState(t.webApp.invertedOrder),_=()=>{r({agentEndpoint:s,systemShell:t.systemShell,webApp:{runner:c,reconnect:t.webApp.reconnect,invertedOrder:f}}),l(!0)};ue.useEffect(()=>{o&&(l(!1),n&&e("/"))},[n,o,e]);const k=()=>{a(i.agentEndpoint),g(i.webApp.runner),b(i.webApp.invertedOrder)},y=ue.useMemo(()=>{if(n&&!(!n||typeof n!="object"||!("message"in n)))return n.message},[n]),d=s!==t.agentEndpoint||c!==t.webApp.runner||f!==t.webApp.invertedOrder;return M.jsxs(we.Box,{className:"w-full mx-auto",children:[M.jsx(we.Text,{size:"5",weight:"bold",className:"mb-2",children:"Settings"}),M.jsxs(we.Box,{className:"mt-4",children:[M.jsxs(we.Flex,{direction:"column",gap:"4",children:[M.jsxs(we.Flex,{direction:"column",gap:"2",children:[M.jsx(we.Text,{size:"3",weight:"bold",children:"Agent Endpoint Configuration"}),M.jsx(we.Text,{size:"2",color:"gray",children:"Configure the endpoint URL for the AI agent. Changes will take effect after saving."}),M.jsx(we.TextArea,{size:"3",placeholder:"Enter AI endpoint URL",value:s,onChange:p=>a(p.target.value)})]}),M.jsxs(we.Flex,{direction:"column",gap:"2",children:[M.jsx(we.Text,{size:"3",weight:"bold",children:"Runner Endpoint Configuration"}),M.jsx(we.Text,{size:"2",color:"gray",children:"Configure the WebSocket endpoint URL for the runner. Changes will take effect after saving."}),n&&M.jsx(we.Callout.Root,{color:"red",children:M.jsxs(we.Callout.Text,{className:"font-bold",children:["Runner error",y?": "+y:""]})}),M.jsx(we.TextArea,{size:"3",placeholder:"Enter Runner WebSocket endpoint URL",value:c,onChange:p=>g(p.target.value)}),M.jsx(we.Text,{size:"2",color:"gray",children:"Revert will reset endpoints to the default values, including protocol http(s), based on the current page."})]}),M.jsxs(we.Flex,{direction:"column",gap:"2",children:[M.jsx(we.Text,{size:"3",weight:"bold",children:"User Experience Mode"}),M.jsx(we.Text,{as:"label",size:"2",children:M.jsxs(we.Flex,{gap:"2",children:["Document Mode",M.jsx(we.Switch,{checked:f,onCheckedChange:b}),"Console Mode"]})})]})]}),M.jsxs(we.Flex,{gap:"3",justify:"end",mt:"4",children:[M.jsx(we.Button,{size:"2",variant:"soft",onClick:()=>e("/"),children:"Back"}),M.jsx(we.Button,{size:"2",variant:"soft",onClick:k,children:"Revert"}),M.jsx(we.Button,{size:"2",onClick:_,disabled:!d,children:"Save"})]})]})]})}function pC(e,t=[]){let r=[];function n(o,l){const s=Ge.createContext(l),a=r.length;r=[...r,l];const c=f=>{var p;const{scope:b,children:_,...k}=f,y=((p=b==null?void 0:b[e])==null?void 0:p[a])||s,d=Ge.useMemo(()=>k,Object.values(k));return M.jsx(y.Provider,{value:d,children:_})};c.displayName=o+"Provider";function g(f,b){var y;const _=((y=b==null?void 0:b[e])==null?void 0:y[a])||s,k=Ge.useContext(_);if(k)return k;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,g]}const i=()=>{const o=r.map(l=>Ge.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return Ge.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[n,gC(i,...t)]}function gC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=n.reduce((s,{useScope:a,scopeName:c})=>{const f=a(o)[`__scope${c}`];return{...s,...f}},{});return Ge.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function mC(e){const t=Ge.useRef(e);return Ge.useEffect(()=>{t.current=e}),Ge.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Ec=globalThis!=null&&globalThis.document?Ge.useLayoutEffect:()=>{};function Cf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vC(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Cf(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():Cf(e[i],null)}}}}function bC(e){const t=_C(e),r=Ge.forwardRef((n,i)=>{const{children:o,...l}=n,s=Ge.Children.toArray(o),a=s.find(SC);if(a){const c=a.props.children,g=s.map(f=>f===a?Ge.Children.count(c)>1?Ge.Children.only(null):Ge.isValidElement(c)?c.props.children:null:f);return M.jsx(t,{...l,ref:i,children:Ge.isValidElement(c)?Ge.cloneElement(c,void 0,g):null})}return M.jsx(t,{...l,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function _C(e){const t=Ge.forwardRef((r,n)=>{const{children:i,...o}=r;if(Ge.isValidElement(i)){const l=EC(i),s=wC(o,i.props);return i.type!==Ge.Fragment&&(s.ref=n?vC(n,l):l),Ge.cloneElement(i,s)}return Ge.Children.count(i)>1?Ge.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yC=Symbol("radix.slottable");function SC(e){return Ge.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yC}function wC(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function EC(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var CC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xl=CC.reduce((e,t)=>{const r=bC(`Primitive.${t}`),n=Ge.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ls={exports:{}},La={};/**
|
|
2144
2144
|
* @license React
|
|
2145
2145
|
* use-sync-external-store-shim.production.js
|
|
2146
2146
|
*
|
|
@@ -2148,7 +2148,7 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2148
2148
|
*
|
|
2149
2149
|
* This source code is licensed under the MIT license found in the
|
|
2150
2150
|
* LICENSE file in the root directory of this source tree.
|
|
2151
|
-
*/var
|
|
2151
|
+
*/var kf;function kC(){if(kf)return La;kf=1;var e=ue;function t(f,b){return f===b&&(f!==0||1/f===1/b)||f!==f&&b!==b}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function s(f,b){var _=b(),k=n({inst:{value:_,getSnapshot:b}}),y=k[0].inst,d=k[1];return o(function(){y.value=_,y.getSnapshot=b,a(y)&&d({inst:y})},[f,_,b]),i(function(){return a(y)&&d({inst:y}),f(function(){a(y)&&d({inst:y})})},[f]),l(_),_}function a(f){var b=f.getSnapshot;f=f.value;try{var _=b();return!r(f,_)}catch{return!0}}function c(f,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return La.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,La}var Oa={};/**
|
|
2152
2152
|
* @license React
|
|
2153
2153
|
* use-sync-external-store-shim.development.js
|
|
2154
2154
|
*
|
|
@@ -2156,9 +2156,9 @@ Open Dashboard to configure it`)};rm=function(){var e;const t=Yt();if(!t.postMes
|
|
|
2156
2156
|
*
|
|
2157
2157
|
* This source code is licensed under the MIT license found in the
|
|
2158
2158
|
* LICENSE file in the root directory of this source tree.
|
|
2159
|
-
*/var
|
|
2159
|
+
*/var If;function IC(){return If||(If=1,process.env.NODE_ENV!=="production"&&(function(){function e(_,k){return _===k&&(_!==0||1/_===1/k)||_!==_&&k!==k}function t(_,k){g||i.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=k();if(!f){var d=k();o(y,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}d=l({inst:{value:y,getSnapshot:k}});var p=d[0].inst,h=d[1];return a(function(){p.value=y,p.getSnapshot=k,r(p)&&h({inst:p})},[_,y,k]),s(function(){return r(p)&&h({inst:p}),_(function(){r(p)&&h({inst:p})})},[_]),c(y),y}function r(_){var k=_.getSnapshot;_=_.value;try{var y=k();return!o(_,y)}catch{return!0}}function n(_,k){return k()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=ue,o=typeof Object.is=="function"?Object.is:e,l=i.useState,s=i.useEffect,a=i.useLayoutEffect,c=i.useDebugValue,g=!1,f=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;Oa.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Oa}var Af;function AC(){return Af||(Af=1,process.env.NODE_ENV==="production"?Ls.exports=kC():Ls.exports=IC()),Ls.exports}var xC=AC();function RC(){return xC.useSyncExternalStore(NC,()=>!0,()=>!1)}function NC(){return()=>{}}var Jl="Avatar",[TC]=pC(Jl),[BC,Xv]=TC(Jl),Jv=Ge.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,o]=Ge.useState("idle");return M.jsx(BC,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:M.jsx(Xl.span,{...n,ref:t})})});Jv.displayName=Jl;var zv="AvatarImage",qv=Ge.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...o}=e,l=Xv(zv,r),s=LC(n,o),a=mC(c=>{i(c),l.onImageLoadingStatusChange(c)});return Ec(()=>{s!=="idle"&&a(s)},[s,a]),s==="loaded"?M.jsx(Xl.img,{...o,ref:t,src:n}):null});qv.displayName=zv;var Qv="AvatarFallback",e0=Ge.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,o=Xv(Qv,r),[l,s]=Ge.useState(n===void 0);return Ge.useEffect(()=>{if(n!==void 0){const a=window.setTimeout(()=>s(!0),n);return()=>window.clearTimeout(a)}},[n]),l&&o.imageLoadingStatus!=="loaded"?M.jsx(Xl.span,{...i,ref:t}):null});e0.displayName=Qv;function xf(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function LC(e,{referrerPolicy:t,crossOrigin:r}){const n=RC(),i=Ge.useRef(null),o=n?(i.current||(i.current=new window.Image),i.current):null,[l,s]=Ge.useState(()=>xf(o,e));return Ec(()=>{s(xf(o,e))},[o,e]),Ec(()=>{const a=f=>()=>{s(f)};if(!o)return;const c=a("loaded"),g=a("error");return o.addEventListener("load",c),o.addEventListener("error",g),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",c),o.removeEventListener("error",g)}},[o,r,t]),l}var OC=Jv,DC=qv,FC=e0,Da={exports:{}},Fa={exports:{}},Rf;function VC(){return Rf||(Rf=1,(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(r,n){return r<<n|r>>>32-n},rotr:function(r,n){return r<<32-n|r>>>n},endian:function(r){if(r.constructor==Number)return t.rotl(r,8)&16711935|t.rotl(r,24)&4278255360;for(var n=0;n<r.length;n++)r[n]=t.endian(r[n]);return r},randomBytes:function(r){for(var n=[];r>0;r--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(r){for(var n=[],i=0,o=0;i<r.length;i++,o+=8)n[o>>>5]|=r[i]<<24-o%32;return n},wordsToBytes:function(r){for(var n=[],i=0;i<r.length*32;i+=8)n.push(r[i>>>5]>>>24-i%32&255);return n},bytesToHex:function(r){for(var n=[],i=0;i<r.length;i++)n.push((r[i]>>>4).toString(16)),n.push((r[i]&15).toString(16));return n.join("")},hexToBytes:function(r){for(var n=[],i=0;i<r.length;i+=2)n.push(parseInt(r.substr(i,2),16));return n},bytesToBase64:function(r){for(var n=[],i=0;i<r.length;i+=3)for(var o=r[i]<<16|r[i+1]<<8|r[i+2],l=0;l<4;l++)i*8+l*6<=r.length*8?n.push(e.charAt(o>>>6*(3-l)&63)):n.push("=");return n.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],i=0,o=0;i<r.length;o=++i%4)o!=0&&n.push((e.indexOf(r.charAt(i-1))&Math.pow(2,-2*o+8)-1)<<o*2|e.indexOf(r.charAt(i))>>>6-o*2);return n}};Fa.exports=t})()),Fa.exports}var Va,Nf;function Tf(){if(Nf)return Va;Nf=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n)&255);return r},bytesToString:function(t){for(var r=[],n=0;n<t.length;n++)r.push(String.fromCharCode(t[n]));return r.join("")}}};return Va=e,Va}/*!
|
|
2160
2160
|
* Determine if an object is a Buffer
|
|
2161
2161
|
*
|
|
2162
2162
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
2163
2163
|
* @license MIT
|
|
2164
|
-
*/var Ma,kf;function CC(){if(kf)return Ma;kf=1,Ma=function(r){return r!=null&&(e(r)||t(r)||!!r._isBuffer)};function e(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function t(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&e(r.slice(0,0))}return Ma}var If;function kC(){return If||(If=1,(function(){var e=EC(),t=Cf().utf8,r=CC(),n=Cf().bin,i=function(o,u){o.constructor==String?u&&u.encoding==="binary"?o=n.stringToBytes(o):o=t.stringToBytes(o):r(o)?o=Array.prototype.slice.call(o,0):!Array.isArray(o)&&o.constructor!==Uint8Array&&(o=o.toString());for(var s=e.bytesToWords(o),a=o.length*8,c=1732584193,m=-271733879,f=-1732584194,b=271733878,_=0;_<s.length;_++)s[_]=(s[_]<<8|s[_]>>>24)&16711935|(s[_]<<24|s[_]>>>8)&4278255360;s[a>>>5]|=128<<a%32,s[(a+64>>>9<<4)+14]=a;for(var k=i._ff,y=i._gg,d=i._hh,p=i._ii,_=0;_<s.length;_+=16){var h=c,g=m,S=f,I=b;c=k(c,m,f,b,s[_+0],7,-680876936),b=k(b,c,m,f,s[_+1],12,-389564586),f=k(f,b,c,m,s[_+2],17,606105819),m=k(m,f,b,c,s[_+3],22,-1044525330),c=k(c,m,f,b,s[_+4],7,-176418897),b=k(b,c,m,f,s[_+5],12,1200080426),f=k(f,b,c,m,s[_+6],17,-1473231341),m=k(m,f,b,c,s[_+7],22,-45705983),c=k(c,m,f,b,s[_+8],7,1770035416),b=k(b,c,m,f,s[_+9],12,-1958414417),f=k(f,b,c,m,s[_+10],17,-42063),m=k(m,f,b,c,s[_+11],22,-1990404162),c=k(c,m,f,b,s[_+12],7,1804603682),b=k(b,c,m,f,s[_+13],12,-40341101),f=k(f,b,c,m,s[_+14],17,-1502002290),m=k(m,f,b,c,s[_+15],22,1236535329),c=y(c,m,f,b,s[_+1],5,-165796510),b=y(b,c,m,f,s[_+6],9,-1069501632),f=y(f,b,c,m,s[_+11],14,643717713),m=y(m,f,b,c,s[_+0],20,-373897302),c=y(c,m,f,b,s[_+5],5,-701558691),b=y(b,c,m,f,s[_+10],9,38016083),f=y(f,b,c,m,s[_+15],14,-660478335),m=y(m,f,b,c,s[_+4],20,-405537848),c=y(c,m,f,b,s[_+9],5,568446438),b=y(b,c,m,f,s[_+14],9,-1019803690),f=y(f,b,c,m,s[_+3],14,-187363961),m=y(m,f,b,c,s[_+8],20,1163531501),c=y(c,m,f,b,s[_+13],5,-1444681467),b=y(b,c,m,f,s[_+2],9,-51403784),f=y(f,b,c,m,s[_+7],14,1735328473),m=y(m,f,b,c,s[_+12],20,-1926607734),c=d(c,m,f,b,s[_+5],4,-378558),b=d(b,c,m,f,s[_+8],11,-2022574463),f=d(f,b,c,m,s[_+11],16,1839030562),m=d(m,f,b,c,s[_+14],23,-35309556),c=d(c,m,f,b,s[_+1],4,-1530992060),b=d(b,c,m,f,s[_+4],11,1272893353),f=d(f,b,c,m,s[_+7],16,-155497632),m=d(m,f,b,c,s[_+10],23,-1094730640),c=d(c,m,f,b,s[_+13],4,681279174),b=d(b,c,m,f,s[_+0],11,-358537222),f=d(f,b,c,m,s[_+3],16,-722521979),m=d(m,f,b,c,s[_+6],23,76029189),c=d(c,m,f,b,s[_+9],4,-640364487),b=d(b,c,m,f,s[_+12],11,-421815835),f=d(f,b,c,m,s[_+15],16,530742520),m=d(m,f,b,c,s[_+2],23,-995338651),c=p(c,m,f,b,s[_+0],6,-198630844),b=p(b,c,m,f,s[_+7],10,1126891415),f=p(f,b,c,m,s[_+14],15,-1416354905),m=p(m,f,b,c,s[_+5],21,-57434055),c=p(c,m,f,b,s[_+12],6,1700485571),b=p(b,c,m,f,s[_+3],10,-1894986606),f=p(f,b,c,m,s[_+10],15,-1051523),m=p(m,f,b,c,s[_+1],21,-2054922799),c=p(c,m,f,b,s[_+8],6,1873313359),b=p(b,c,m,f,s[_+15],10,-30611744),f=p(f,b,c,m,s[_+6],15,-1560198380),m=p(m,f,b,c,s[_+13],21,1309151649),c=p(c,m,f,b,s[_+4],6,-145523070),b=p(b,c,m,f,s[_+11],10,-1120210379),f=p(f,b,c,m,s[_+2],15,718787259),m=p(m,f,b,c,s[_+9],21,-343485551),c=c+h>>>0,m=m+g>>>0,f=f+S>>>0,b=b+I>>>0}return e.endian([c,m,f,b])};i._ff=function(o,u,s,a,c,m,f){var b=o+(u&s|~u&a)+(c>>>0)+f;return(b<<m|b>>>32-m)+u},i._gg=function(o,u,s,a,c,m,f){var b=o+(u&a|s&~a)+(c>>>0)+f;return(b<<m|b>>>32-m)+u},i._hh=function(o,u,s,a,c,m,f){var b=o+(u^s^a)+(c>>>0)+f;return(b<<m|b>>>32-m)+u},i._ii=function(o,u,s,a,c,m,f){var b=o+(s^(u|~a))+(c>>>0)+f;return(b<<m|b>>>32-m)+u},i._blocksize=16,i._digestsize=16,Da.exports=function(o,u){if(o==null)throw new Error("Illegal argument "+o);var s=e.wordsToBytes(i(o,u));return u&&u.asBytes?s:u&&u.asString?n.bytesToString(s):e.bytesToHex(s)}})()),Da.exports}var IC=kC();const AC=eg(IC),xC=(e=24)=>{const t=bc();if(!t||t==="unauthenticated")return"unauthenticated";try{const r=dv(t),n=r.email||r.sub||"unauthenticated";return!n||n==="unauthenticated"||!n.includes("@")?"unauthenticated":`https://www.gravatar.com/avatar/${AC(n.trim().toLowerCase())}?s=${e}&d=identicon`}catch{return"unauthenticated"}},RC=()=>H.jsxs(Se.DropdownMenu.Root,{children:[H.jsx(Se.DropdownMenu.Trigger,{children:H.jsx("span",{children:H.jsxs(yC,{className:"inline-flex size-[24px] select-none items-center justify-center overflow-hidden rounded-full bg-blackA1 align-middle cursor-pointer",children:[H.jsx(SC,{className:"size-full rounded-[inherit] object-cover",src:xC()}),H.jsx(wC,{className:"leading-1 flex size-full items-center justify-center bg-white text-[15px] font-medium text-violet11",delayMs:600,children:H.jsx(p0.PersonIcon,{})})]})})}),H.jsx(Se.DropdownMenu.Content,{sideOffset:8,children:H.jsx(Se.DropdownMenu.Item,{asChild:!0,children:H.jsx("a",{href:"/oidc/logout",children:"Logout"})})})]}),Mv=()=>{const{resetSession:e,exportDocument:t}=_r(),r=jt.useNavigate(),n=jt.useLocation();return H.jsxs(H.Fragment,{children:[H.jsxs(Se.DropdownMenu.Root,{children:[H.jsx(Se.DropdownMenu.Trigger,{children:H.jsx(Se.Button,{variant:"soft",className:"cursor-pointer",children:H.jsxs(Se.Flex,{gap:"1",align:"center",className:"cursor-pointer",children:[H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:"currentColor"})}),H.jsx(Se.Text,{children:"Export"})]})})}),H.jsxs(Se.DropdownMenu.Content,{sideOffset:8,children:[H.jsx(Se.DropdownMenu.Item,{onClick:()=>{t({asSessionRecord:!1})},children:"Runnable Notebook (no outputs)"}),H.jsx(Se.DropdownMenu.Item,{onClick:()=>{t({asSessionRecord:!0})},children:"Session Record (with outputs)"})]})]}),H.jsx(Se.Button,{type:"button",onClick:()=>{e({attemptRestore:!1}),r("/")},variant:"soft",className:"cursor-pointer",children:H.jsxs(Se.Flex,{className:"cursor-pointer",gap:"1",align:"center",children:[H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M7.5 0.875C7.77614 0.875 8 1.09886 8 1.375V7.5H14.125C14.4011 7.5 14.625 7.72386 14.625 8C14.625 8.27614 14.4011 8.5 14.125 8.5H8V14.625C8 14.9011 7.77614 15.125 7.5 15.125C7.22386 15.125 7 14.9011 7 14.625V8.5H0.875C0.598858 8.5 0.375 8.27614 0.375 8C0.375 7.72386 0.598858 7.5 0.875 7.5H7V1.375C7 1.09886 7.22386 0.875 7.5 0.875Z",fill:"currentColor"})}),H.jsx(Se.Text,{children:"New Session"})]})}),H.jsx(Se.Button,{type:"button",onClick:()=>{n.pathname==="/settings"?r("/"):r("/settings")},variant:"soft",className:"cursor-pointer",children:H.jsxs(Se.Flex,{className:"cursor-pointer",gap:"1",align:"center",children:[H.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:"M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1887 4.92117C11.558 5.44798 11.8173 6.0575 11.9332 6.71638L13.5 7.07183V7.92897L11.9334 8.28444C11.8176 8.94342 11.5585 9.55301 11.1892 10.0798L12.0459 11.4394L11.4398 12.0455L10.0797 11.1889C9.55252 11.5583 8.94242 11.8176 8.28355 11.9334L7.92809 13.5002H7.07095L6.71543 11.9332C6.0569 11.8174 5.44772 11.5582 4.92116 11.189L3.56055 12.0455L2.95445 11.4394L3.81107 10.0794C3.4418 9.55266 3.18265 8.94307 3.06681 8.28395L1.50002 7.92897V7.07183L3.06697 6.71632C3.18305 6.05684 3.44247 5.44693 3.81203 4.91979L2.95424 3.56079L3.56034 2.9547L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.02516C8.34223 5.02516 9.02496 6.65789 9.02496 7.50008ZM9.97496 7.50008C9.97496 8.86866 8.86863 9.97499 7.50005 9.97499C6.13146 9.97499 5.02513 8.86866 5.02513 7.50008C5.02513 6.13149 6.13146 5.02516 7.50005 5.02516C8.86863 5.02516 9.97496 6.13149 9.97496 7.50008Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),H.jsx(Se.Text,{children:"Settings"})]})}),H.jsx(RC,{})]})};function Fn({branding:e,left:t,middle:r,right:n}){const i=jt.useNavigate(),{settings:o,runnerError:u}=cr();return ue.useEffect(()=>{if(!u)return;const s="/settings",a=window.location.pathname;if(a===s||a==="/login"||a==="/oidc/login")return;const c=o.requireAuth?"/oidc/login":"/login";if(!(u instanceof Error)&&!(u instanceof Event)){u.code===xv.UNAUTHENTICATED&&window.location.pathname!==c?window.location.href=c:i(s);return}i(s)},[u,o.requireAuth,i]),H.jsxs(Se.Box,{className:"w-screen h-[95vh] max-w-[95%] mx-auto flex flex-col",children:[H.jsx(Se.Box,{className:"w-full p-3 mb-1 border-b",children:H.jsxs(Se.Flex,{align:"center",justify:"between",children:[H.jsx(jt.Link,{to:"/",children:H.jsxs(Se.Flex,{align:"center",gap:"2",children:[H.jsx("img",{src:e.logo,className:"h-6 w-6"}),H.jsx(Se.Text,{size:"5",weight:"bold",children:e.name})]})}),H.jsx(Se.Flex,{gap:"4",children:H.jsx(Mv,{})})]})}),H.jsxs(Se.Flex,{className:"w-full h-[95%] flex-1 gap-2",children:[H.jsx(Se.Box,{className:"flex-none w-[33.33%] flex flex-col h-full p-2 border-r border-gray-400",children:t??H.jsx("div",{})}),H.jsx(Se.Box,{className:"flex-none w-[50.00%] flex flex-col h-full p-2 border-r border-gray-400",children:r??H.jsx("div",{})}),H.jsx(Se.Box,{className:"flex-none w-[16.67%] flex flex-col h-full p-2",children:n??H.jsx("div",{})})]})]})}function NC({branding:e}){return H.jsx(jt.BrowserRouter,{children:H.jsxs(jt.Routes,{children:[H.jsx(jt.Route,{path:"/",element:H.jsx(Fn,{branding:e,left:H.jsx(Sc,{}),middle:H.jsx(yc,{}),right:H.jsx(Av,{})})}),H.jsx(jt.Route,{path:"/settings",element:H.jsx(Fn,{branding:e,left:H.jsx(Sc,{}),middle:H.jsx(yc,{}),right:H.jsx(Tv,{})})}),H.jsx(jt.Route,{path:"/oidc/*",element:H.jsx(Fn,{branding:e,middle:H.jsx("div",{children:"OIDC routes are exclusively handled by the server."})})}),H.jsx(jt.Route,{path:"/login",element:H.jsx(Fn,{branding:e,left:H.jsx(Rv,{})})}),H.jsx(jt.Route,{path:"*",element:H.jsx(Fn,{branding:e,left:H.jsx(Nv,{})})})]})})}function TC({branding:e,initialState:t={}}){return H.jsxs(H.Fragment,{children:[H.jsx("title",{children:e.name}),H.jsx("meta",{name:"description",content:"An AI Assistant For Your Cloud"}),H.jsx("link",{rel:"icon",href:e.logo}),H.jsx(Se.Theme,{appearance:"light",accentColor:"violet",scaling:"100%",radius:"small",children:H.jsx(mv,{agentEndpoint:t==null?void 0:t.agentEndpoint,requireAuth:t==null?void 0:t.requireAuth,webApp:t==null?void 0:t.webApp,children:H.jsx(_v,{children:H.jsx(Sv,{children:H.jsx(Ev,{getAccessToken:D3,children:H.jsx(NC,{branding:e})})})})})})]})}exports.Action=kv;exports.Actions=yc;exports.AgentClientProvider=_v;exports.AgentMetadataKey=Ks;exports.App=TC;exports.CellConsole=Cv;exports.CellExecutionSummarySchema=Xc;exports.CellKind=Lt;exports.CellKindSchema=el;exports.CellOutputItemSchema=Ai;exports.CellOutputProcessInfoSchema=Yc;exports.CellOutputSchema=_o;exports.CellProvider=Ev;exports.CellRole=Kt;exports.CellRoleSchema=tl;exports.CellSchema=gn;exports.Chat=Sc;exports.DeserializeRequestOptionsSchema=kp;exports.DeserializeRequestSchema=Ip;exports.DeserializeResponseSchema=Ap;exports.ExecutionSummaryTimingSchema=jc;exports.FilesViewer=Av;exports.FrontmatterRunmeSchema=Ep;exports.FrontmatterSchema=Cp;exports.Layout=Fn;exports.Login=Rv;exports.MimeType=gr;exports.NotFound=Nv;exports.NotebookSchema=js;exports.OutputProvider=Sv;exports.ParserService=nl;exports.ProcessInfoExitReasonSchema=Kc;exports.RunmeIdentity=Rp;exports.RunmeIdentitySchema=rl;exports.RunmeMetadataKey=Ft;exports.RunmeSessionDocumentSchema=wp;exports.RunmeSessionSchema=Jc;exports.SerializeRequestOptionsSchema=qc;exports.SerializeRequestOutputOptionsSchema=zc;exports.SerializeRequestSchema=Qc;exports.SerializeResponseSchema=xp;exports.Settings=Tv;exports.SettingsProvider=mv;exports.TextRangeSchema=Sp;exports.TopNavigation=Mv;exports.createConnectClient=Za;exports.file_runme_parser_v1_parser=qe;exports.parser_pb=m_;exports.runner_pb=t1;exports.useCell=_r;exports.useClient=bv;exports.useOutput=To;exports.useSettings=cr;
|
|
2164
|
+
*/var Ma,Bf;function MC(){if(Bf)return Ma;Bf=1,Ma=function(r){return r!=null&&(e(r)||t(r)||!!r._isBuffer)};function e(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function t(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&e(r.slice(0,0))}return Ma}var Lf;function UC(){return Lf||(Lf=1,(function(){var e=VC(),t=Tf().utf8,r=MC(),n=Tf().bin,i=function(o,l){o.constructor==String?l&&l.encoding==="binary"?o=n.stringToBytes(o):o=t.stringToBytes(o):r(o)?o=Array.prototype.slice.call(o,0):!Array.isArray(o)&&o.constructor!==Uint8Array&&(o=o.toString());for(var s=e.bytesToWords(o),a=o.length*8,c=1732584193,g=-271733879,f=-1732584194,b=271733878,_=0;_<s.length;_++)s[_]=(s[_]<<8|s[_]>>>24)&16711935|(s[_]<<24|s[_]>>>8)&4278255360;s[a>>>5]|=128<<a%32,s[(a+64>>>9<<4)+14]=a;for(var k=i._ff,y=i._gg,d=i._hh,p=i._ii,_=0;_<s.length;_+=16){var h=c,m=g,S=f,I=b;c=k(c,g,f,b,s[_+0],7,-680876936),b=k(b,c,g,f,s[_+1],12,-389564586),f=k(f,b,c,g,s[_+2],17,606105819),g=k(g,f,b,c,s[_+3],22,-1044525330),c=k(c,g,f,b,s[_+4],7,-176418897),b=k(b,c,g,f,s[_+5],12,1200080426),f=k(f,b,c,g,s[_+6],17,-1473231341),g=k(g,f,b,c,s[_+7],22,-45705983),c=k(c,g,f,b,s[_+8],7,1770035416),b=k(b,c,g,f,s[_+9],12,-1958414417),f=k(f,b,c,g,s[_+10],17,-42063),g=k(g,f,b,c,s[_+11],22,-1990404162),c=k(c,g,f,b,s[_+12],7,1804603682),b=k(b,c,g,f,s[_+13],12,-40341101),f=k(f,b,c,g,s[_+14],17,-1502002290),g=k(g,f,b,c,s[_+15],22,1236535329),c=y(c,g,f,b,s[_+1],5,-165796510),b=y(b,c,g,f,s[_+6],9,-1069501632),f=y(f,b,c,g,s[_+11],14,643717713),g=y(g,f,b,c,s[_+0],20,-373897302),c=y(c,g,f,b,s[_+5],5,-701558691),b=y(b,c,g,f,s[_+10],9,38016083),f=y(f,b,c,g,s[_+15],14,-660478335),g=y(g,f,b,c,s[_+4],20,-405537848),c=y(c,g,f,b,s[_+9],5,568446438),b=y(b,c,g,f,s[_+14],9,-1019803690),f=y(f,b,c,g,s[_+3],14,-187363961),g=y(g,f,b,c,s[_+8],20,1163531501),c=y(c,g,f,b,s[_+13],5,-1444681467),b=y(b,c,g,f,s[_+2],9,-51403784),f=y(f,b,c,g,s[_+7],14,1735328473),g=y(g,f,b,c,s[_+12],20,-1926607734),c=d(c,g,f,b,s[_+5],4,-378558),b=d(b,c,g,f,s[_+8],11,-2022574463),f=d(f,b,c,g,s[_+11],16,1839030562),g=d(g,f,b,c,s[_+14],23,-35309556),c=d(c,g,f,b,s[_+1],4,-1530992060),b=d(b,c,g,f,s[_+4],11,1272893353),f=d(f,b,c,g,s[_+7],16,-155497632),g=d(g,f,b,c,s[_+10],23,-1094730640),c=d(c,g,f,b,s[_+13],4,681279174),b=d(b,c,g,f,s[_+0],11,-358537222),f=d(f,b,c,g,s[_+3],16,-722521979),g=d(g,f,b,c,s[_+6],23,76029189),c=d(c,g,f,b,s[_+9],4,-640364487),b=d(b,c,g,f,s[_+12],11,-421815835),f=d(f,b,c,g,s[_+15],16,530742520),g=d(g,f,b,c,s[_+2],23,-995338651),c=p(c,g,f,b,s[_+0],6,-198630844),b=p(b,c,g,f,s[_+7],10,1126891415),f=p(f,b,c,g,s[_+14],15,-1416354905),g=p(g,f,b,c,s[_+5],21,-57434055),c=p(c,g,f,b,s[_+12],6,1700485571),b=p(b,c,g,f,s[_+3],10,-1894986606),f=p(f,b,c,g,s[_+10],15,-1051523),g=p(g,f,b,c,s[_+1],21,-2054922799),c=p(c,g,f,b,s[_+8],6,1873313359),b=p(b,c,g,f,s[_+15],10,-30611744),f=p(f,b,c,g,s[_+6],15,-1560198380),g=p(g,f,b,c,s[_+13],21,1309151649),c=p(c,g,f,b,s[_+4],6,-145523070),b=p(b,c,g,f,s[_+11],10,-1120210379),f=p(f,b,c,g,s[_+2],15,718787259),g=p(g,f,b,c,s[_+9],21,-343485551),c=c+h>>>0,g=g+m>>>0,f=f+S>>>0,b=b+I>>>0}return e.endian([c,g,f,b])};i._ff=function(o,l,s,a,c,g,f){var b=o+(l&s|~l&a)+(c>>>0)+f;return(b<<g|b>>>32-g)+l},i._gg=function(o,l,s,a,c,g,f){var b=o+(l&a|s&~a)+(c>>>0)+f;return(b<<g|b>>>32-g)+l},i._hh=function(o,l,s,a,c,g,f){var b=o+(l^s^a)+(c>>>0)+f;return(b<<g|b>>>32-g)+l},i._ii=function(o,l,s,a,c,g,f){var b=o+(s^(l|~a))+(c>>>0)+f;return(b<<g|b>>>32-g)+l},i._blocksize=16,i._digestsize=16,Da.exports=function(o,l){if(o==null)throw new Error("Illegal argument "+o);var s=e.wordsToBytes(i(o,l));return l&&l.asBytes?s:l&&l.asString?n.bytesToString(s):e.bytesToHex(s)}})()),Da.exports}var PC=UC();const WC=ag(PC),$C=(e=24)=>{const t=bc();if(!t||t==="unauthenticated")return"unauthenticated";try{const r=_v(t),n=r.email||r.sub||"unauthenticated";return!n||n==="unauthenticated"||!n.includes("@")?"unauthenticated":`https://www.gravatar.com/avatar/${WC(n.trim().toLowerCase())}?s=${e}&d=identicon`}catch{return"unauthenticated"}},HC=()=>M.jsxs(we.DropdownMenu.Root,{children:[M.jsx(we.DropdownMenu.Trigger,{children:M.jsx("span",{children:M.jsxs(OC,{className:"inline-flex size-[24px] select-none items-center justify-center overflow-hidden rounded-full bg-blackA1 align-middle cursor-pointer",children:[M.jsx(DC,{className:"size-full rounded-[inherit] object-cover",src:$C()}),M.jsx(FC,{className:"leading-1 flex size-full items-center justify-center bg-white text-[15px] font-medium text-violet11",delayMs:600,children:M.jsx(B0.PersonIcon,{})})]})})}),M.jsx(we.DropdownMenu.Content,{sideOffset:8,children:M.jsx(we.DropdownMenu.Item,{asChild:!0,children:M.jsx("a",{href:"/oidc/logout",children:"Logout"})})})]}),t0=({actions:e})=>{const{resetSession:t,exportDocument:r}=sr(),n=Vt.useNavigate(),i=Vt.useLocation();return M.jsxs(M.Fragment,{children:[e==null?void 0:e.map(o=>o),M.jsxs(we.DropdownMenu.Root,{children:[M.jsx(we.DropdownMenu.Trigger,{children:M.jsx(we.Button,{variant:"soft",className:"cursor-pointer",children:M.jsxs(we.Flex,{gap:"1",align:"center",className:"cursor-pointer",children:[M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:"currentColor"})}),M.jsx(we.Text,{children:"Export"})]})})}),M.jsxs(we.DropdownMenu.Content,{sideOffset:8,children:[M.jsx(we.DropdownMenu.Item,{onClick:()=>{r({asSessionRecord:!1})},children:"Runnable Notebook (no outputs)"}),M.jsx(we.DropdownMenu.Item,{onClick:()=>{r({asSessionRecord:!0})},children:"Session Record (with outputs)"})]})]}),M.jsx(we.Button,{type:"button",onClick:()=>{t({attemptRestore:!1}),n("/")},variant:"soft",className:"cursor-pointer",children:M.jsxs(we.Flex,{className:"cursor-pointer",gap:"1",align:"center",children:[M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M7.5 0.875C7.77614 0.875 8 1.09886 8 1.375V7.5H14.125C14.4011 7.5 14.625 7.72386 14.625 8C14.625 8.27614 14.4011 8.5 14.125 8.5H8V14.625C8 14.9011 7.77614 15.125 7.5 15.125C7.22386 15.125 7 14.9011 7 14.625V8.5H0.875C0.598858 8.5 0.375 8.27614 0.375 8C0.375 7.72386 0.598858 7.5 0.875 7.5H7V1.375C7 1.09886 7.22386 0.875 7.5 0.875Z",fill:"currentColor"})}),M.jsx(we.Text,{children:"New Session"})]})}),M.jsx(we.Button,{type:"button",onClick:()=>{i.pathname==="/settings"?n("/"):n("/settings")},variant:"soft",className:"cursor-pointer",children:M.jsxs(we.Flex,{className:"cursor-pointer",gap:"1",align:"center",children:[M.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("path",{d:"M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1887 4.92117C11.558 5.44798 11.8173 6.0575 11.9332 6.71638L13.5 7.07183V7.92897L11.9334 8.28444C11.8176 8.94342 11.5585 9.55301 11.1892 10.0798L12.0459 11.4394L11.4398 12.0455L10.0797 11.1889C9.55252 11.5583 8.94242 11.8176 8.28355 11.9334L7.92809 13.5002H7.07095L6.71543 11.9332C6.0569 11.8174 5.44772 11.5582 4.92116 11.189L3.56055 12.0455L2.95445 11.4394L3.81107 10.0794C3.4418 9.55266 3.18265 8.94307 3.06681 8.28395L1.50002 7.92897V7.07183L3.06697 6.71632C3.18305 6.05684 3.44247 5.44693 3.81203 4.91979L2.95424 3.56079L3.56034 2.9547L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.02516C8.34223 5.02516 9.02496 6.65789 9.02496 7.50008ZM9.97496 7.50008C9.97496 8.86866 8.86863 9.97499 7.50005 9.97499C6.13146 9.97499 5.02513 8.86866 5.02513 7.50008C5.02513 6.13149 6.13146 5.02516 7.50005 5.02516C8.86863 5.02516 9.97496 6.13149 9.97496 7.50008Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),M.jsx(we.Text,{children:"Settings"})]})}),M.jsx(HC,{})]})};function Fn({branding:e,left:t,middle:r,right:n}){const i=Vt.useNavigate(),{settings:o,runnerError:l}=ir();return ue.useEffect(()=>{if(!l)return;const s="/settings",a=window.location.pathname;if(a===s||a==="/login"||a==="/oidc/login")return;const c=o.requireAuth?"/oidc/login":"/login";if(!(l instanceof Error)&&!(l instanceof Event)){l.code===Zv.UNAUTHENTICATED&&window.location.pathname!==c?window.location.href=c:i(s);return}i(s)},[l,o.requireAuth,i]),M.jsxs(we.Box,{className:"w-screen h-[95vh] max-w-[95%] mx-auto flex flex-col",children:[M.jsx(we.Box,{className:"w-full p-3 mb-1 border-b",children:M.jsxs(we.Flex,{align:"center",justify:"between",children:[M.jsx(Vt.Link,{to:"/",children:M.jsxs(we.Flex,{align:"center",gap:"2",children:[M.jsx("img",{src:e.logo,className:"h-6 w-6"}),M.jsx(we.Text,{size:"5",weight:"bold",children:e.name})]})}),M.jsx(we.Flex,{gap:"4",children:M.jsx(t0,{})})]})}),M.jsxs(we.Flex,{className:"w-full h-[95%] flex-1 gap-2",children:[M.jsx(we.Box,{className:"flex-none w-[33.33%] flex flex-col h-full p-2 border-r border-gray-400",children:t??M.jsx("div",{})}),M.jsx(we.Box,{className:"flex-none w-[50.00%] flex flex-col h-full p-2 border-r border-gray-400",children:r??M.jsx("div",{})}),M.jsx(we.Box,{className:"flex-none w-[16.67%] flex flex-col h-full p-2",children:n??M.jsx("div",{})})]})]})}function jC({branding:e}){const t=M.jsx(Uv,{headline:"Actions"}),r=M.jsx(jv,{headline:"Files"});return M.jsxs(Vt.Routes,{children:[M.jsx(Vt.Route,{path:"/",element:M.jsx(Fn,{branding:e,left:M.jsx(wc,{}),middle:t,right:r})}),M.jsx(Vt.Route,{path:"/settings",element:M.jsx(Fn,{branding:e,left:M.jsx(wc,{}),middle:t,right:M.jsx(Yv,{})})}),M.jsx(Vt.Route,{path:"/sequence",children:M.jsx(Vt.Route,{index:!0,element:M.jsx(Hv,{})})}),M.jsx(Vt.Route,{path:"/oidc/*",element:M.jsx(Fn,{branding:e,middle:M.jsx("div",{children:"OIDC routes are exclusively handled by the server."})})}),M.jsx(Vt.Route,{path:"/login",element:M.jsx(Fn,{branding:e,left:M.jsx(Gv,{})})}),M.jsx(Vt.Route,{path:"*",element:M.jsx(Fn,{branding:e,left:M.jsx(Kv,{})})})]})}function r0({branding:e,initialState:t={}}){return M.jsxs(M.Fragment,{children:[M.jsx("title",{children:e.name}),M.jsx("meta",{name:"description",content:"An AI Assistant For Your Cloud"}),M.jsx("link",{rel:"icon",href:e.logo}),M.jsx(we.Theme,{appearance:"light",accentColor:"violet",scaling:"100%",radius:"small",children:M.jsx(Cv,{agentEndpoint:t==null?void 0:t.agentEndpoint,systemShell:t==null?void 0:t.systemShell,requireAuth:t==null?void 0:t.requireAuth,webApp:t==null?void 0:t.webApp,children:M.jsx(Av,{children:M.jsx(Nv,{children:M.jsx(Bv,{getAccessToken:eC,children:M.jsx(jC,{branding:e})})})})})})]})}function ZC({branding:e,initialState:t={}}){return M.jsx(Vt.BrowserRouter,{children:M.jsx(r0,{branding:e,initialState:t})})}exports.Action=Yl;exports.Actions=Uv;exports.AgentClientProvider=Av;exports.AgentMetadataKey=Ks;exports.App=ZC;exports.AppProviders=r0;exports.CellConsole=xv;exports.CellExecutionSummarySchema=Gc;exports.CellKind=it;exports.CellKindSchema=zc;exports.CellOutputItemSchema=Ai;exports.CellOutputProcessInfoSchema=Zc;exports.CellOutputSchema=go;exports.CellProvider=Bv;exports.CellRole=Kt;exports.CellRoleSchema=qc;exports.CellSchema=pn;exports.Chat=wc;exports.ChatSequence=Hv;exports.DeserializeRequestOptionsSchema=kp;exports.DeserializeRequestSchema=Ip;exports.DeserializeResponseSchema=Ap;exports.ErrorIcon=Fv;exports.ExecutionSummaryTimingSchema=Hc;exports.FilesViewer=jv;exports.FrontmatterRunmeSchema=Ep;exports.FrontmatterSchema=Cp;exports.Layout=Fn;exports.Login=Gv;exports.MimeType=mr;exports.NotFound=Kv;exports.NotebookSchema=Gs;exports.OutputProvider=Nv;exports.ParserService=el;exports.PlayIcon=Lv;exports.PlusIcon=Vv;exports.ProcessInfoExitReasonSchema=jc;exports.RunmeIdentity=Rp;exports.RunmeIdentitySchema=Qc;exports.RunmeMetadataKey=Ft;exports.RunmeSessionDocumentSchema=wp;exports.RunmeSessionSchema=Kc;exports.SerializeRequestOptionsSchema=Xc;exports.SerializeRequestOutputOptionsSchema=Yc;exports.SerializeRequestSchema=Jc;exports.SerializeResponseSchema=xp;exports.Settings=Yv;exports.SettingsProvider=Cv;exports.SpinnerIcon=Ov;exports.SubmitQuestionIcon=Mv;exports.SuccessIcon=Dv;exports.TextRangeSchema=Sp;exports.TopNavigation=t0;exports.TypingCell=Kl;exports.createConnectClient=Za;exports.file_runme_parser_v1_parser=qe;exports.generateSessionName=ol;exports.parser_pb=i_;exports.runner_pb=y1;exports.useCell=sr;exports.useClient=Iv;exports.useOutput=Gl;exports.useSettings=ir;
|