@codingame/monaco-vscode-json-language-features-default-extension 34.1.2 → 35.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Om=Object.create;var Br=Object.defineProperty;var Mm=Object.getOwnPropertyDescriptor;var Nm=Object.getOwnPropertyNames;var Em=Object.getPrototypeOf,Am=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cm=(e,t)=>{for(var n in t)Br(e,n,{get:t[n],enumerable:!0})},el=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nm(t))!Am.call(e,i)&&i!==n&&Br(e,i,{get:()=>t[i],enumerable:!(r=Mm(t,i))||r.enumerable});return e};var zr=(e,t,n)=>(n=e!=null?Om(Em(e)):{},el(t||!e||!e.__esModule?Br(n,"default",{value:e,enumerable:!0}):n,e)),Io=e=>el(Br({},"__esModule",{value:!0}),e);var v=oe(()=>{});async function jm(e){if(e.protocol==="http:"||e.protocol==="https:")return await(await fetch(e)).text();throw new Error("Unsupported protocol")}function qm(e){throw new Error("Unsupported in browser")}function nl(e){if("contents"in e){typeof e.contents=="string"?dr=JSON.parse(e.contents):dr=e.contents;return}if("fsPath"in e){let t=qm(e.fsPath),n=JSON.parse(t);dr=tl(n)?n.contents.bundle:n;return}if(e.uri){let t=e.uri;return typeof e.uri=="string"&&(t=new URL(e.uri)),new Promise((n,r)=>{jm(t).then(i=>{try{let o=JSON.parse(i);dr=tl(o)?o.contents.bundle:o,n()}catch(o){r(o)}}).catch(i=>{r(i)})})}}function C(...e){let t=e[0],n,r,i;if(typeof t=="string")n=t,r=t,e.splice(0,1),i=!e||typeof e[0]!="object"?e:e[0];else if(t instanceof Array){let s=e.slice(1);if(t.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=t[0];for(let f=1;f<t.length;f++)a+=`{${f-1}}`+t[f];return C(a,...s)}else r=t.message,n=r,t.comment&&t.comment.length>0&&(n+=`/${Array.isArray(t.comment)?t.comment.join(""):t.comment}`),i=t.args??{};let o=dr?.[n];return o?typeof o=="string"?Jr(o,i):o.comment?Jr(o.message,i):Jr(r,i):Jr(r,i)}function Jr(e,t){return Object.keys(t).length===0?e:e.replace(Lm,(n,r)=>t[r]??n)}function tl(e){return typeof e?.contents?.bundle=="object"&&typeof e?.version=="string"}var dr,Lm,Rt=oe(()=>{"use strict";v();Lm=/{([^}]+)}/g});var Sn=J(Ot=>{"use strict";v();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.boolean=Im;Ot.string=rl;Ot.number=Fm;Ot.error=$m;Ot.func=Vm;Ot.array=il;Ot.stringArray=Wm;function Im(e){return e===!0||e===!1}function rl(e){return typeof e=="string"||e instanceof String}function Fm(e){return typeof e=="number"||e instanceof Number}function $m(e){return e instanceof Error}function Vm(e){return typeof e=="function"}function il(e){return Array.isArray(e)}function Wm(e){return il(e)&&e.every(t=>rl(t))}});var us=J(G=>{"use strict";v();var Um=G&&G.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Hm=G&&G.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Bm=G&&G.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Um(n,t,r[i]);return Hm(n,t),n}})();Object.defineProperty(G,"__esModule",{value:!0});G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;var un=Bm(Sn()),Fo;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(Fo||(G.ErrorCodes=Fo={}));var $o=class e extends Error{code;data;constructor(t,n,r){super(n),this.code=un.number(t)?t:Fo.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};G.ResponseError=$o;var Vt=class e{kind;static auto=new e("auto");static byPosition=new e("byPosition");static byName=new e("byName");constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};G.ParameterStructures=Vt;var he=class{method;numberOfParams;constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return Vt.auto}};G.AbstractMessageSignature=he;var Vo=class extends he{_;constructor(t){super(t,0)}};G.RequestType0=Vo;var Wo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.RequestType=Wo;var Uo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.RequestType1=Uo;var Ho=class extends he{_;constructor(t){super(t,2)}};G.RequestType2=Ho;var Bo=class extends he{_;constructor(t){super(t,3)}};G.RequestType3=Bo;var zo=class extends he{_;constructor(t){super(t,4)}};G.RequestType4=zo;var Jo=class extends he{_;constructor(t){super(t,5)}};G.RequestType5=Jo;var Xo=class extends he{_;constructor(t){super(t,6)}};G.RequestType6=Xo;var Go=class extends he{_;constructor(t){super(t,7)}};G.RequestType7=Go;var Qo=class extends he{_;constructor(t){super(t,8)}};G.RequestType8=Qo;var Zo=class extends he{_;constructor(t){super(t,9)}};G.RequestType9=Zo;var Yo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.NotificationType=Yo;var Ko=class extends he{_;constructor(t){super(t,0)}};G.NotificationType0=Ko;var es=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.NotificationType1=es;var ts=class extends he{_;constructor(t){super(t,2)}};G.NotificationType2=ts;var ns=class extends he{_;constructor(t){super(t,3)}};G.NotificationType3=ns;var rs=class extends he{_;constructor(t){super(t,4)}};G.NotificationType4=rs;var is=class extends he{_;constructor(t){super(t,5)}};G.NotificationType5=is;var os=class extends he{_;constructor(t){super(t,6)}};G.NotificationType6=os;var ss=class extends he{_;constructor(t){super(t,7)}};G.NotificationType7=ss;var as=class extends he{_;constructor(t){super(t,8)}};G.NotificationType8=as;var cs=class extends he{_;constructor(t){super(t,9)}};G.NotificationType9=cs;var ol;(function(e){function t(i){let o=i;return o&&un.string(o.method)&&(un.string(o.id)||un.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&un.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(un.string(o.id)||un.number(o.id)||o.id===null)}e.isResponse=r})(ol||(G.Message=ol={}))});var fs=J(Wt=>{"use strict";v();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LRUCache=Wt.LinkedMap=Wt.Touch=void 0;var Fe;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Fe||(Wt.Touch=Fe={}));var Xr=class{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(t){let n=this._map.get(t);return n?n.previous?.value:void 0}after(t){let n=this._map.get(t);return n?n.next?.value:void 0}has(t){return this._map.has(t)}get(t,n=Fe.None){let r=this._map.get(t);if(r)return n!==Fe.None&&this.touch(r,n),r.value}set(t,n,r=Fe.None){let i=this._map.get(t);if(i)i.value=n,r!==Fe.None&&this.touch(i,r);else{switch(i={key:t,value:n,next:void 0,previous:void 0},r){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let r=this._state,i=this._head;for(;i;){if(n?t.bind(n)(i.value,i.key,this):t(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[Symbol.iterator](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>t;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,r=t.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Fe.First&&n!==Fe.Last)){if(n===Fe.First){if(t===this._head)return;let r=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Fe.Last){if(t===this._tail)return;let r=t.next,i=t.previous;t===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,r)=>{t.push([r,n])}),t}fromJSON(t){this.clear();for(let[n,r]of t)this.set(n,r)}};Wt.LinkedMap=Xr;var ls=class extends Xr{_limit;_ratio;constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Fe.AsNew){return super.get(t,n)}peek(t){return super.get(t,Fe.None)}set(t,n){return super.set(t,n,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Wt.LRUCache=ls});var al=J(Gr=>{"use strict";v();Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Disposable=void 0;var sl;(function(e){function t(n){return{dispose:n}}e.create=t})(sl||(Gr.Disposable=sl={}))});var Ut=J(hs=>{"use strict";v();Object.defineProperty(hs,"__esModule",{value:!0});var ds;function ps(){if(ds===void 0)throw new Error("No runtime abstraction layer installed");return ds}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");ds=n}e.install=t})(ps||(ps={}));hs.default=ps});var Pn=J(Ht=>{"use strict";v();var zm=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Emitter=Ht.Event=void 0;var Jm=zm(Ut()),cl;(function(e){let t={dispose(){}};e.None=function(){return t}})(cl||(Ht.Event=cl={}));var gs=class{_callbacks;_contexts;add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,Jm.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ms=class e{_options;static _noop=function(){};_event;_callbacks;constructor(t){this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new gs),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ht.Emitter=ms});var Yr=J(Xe=>{"use strict";v();var Xm=Xe&&Xe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Gm=Xe&&Xe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Qm=Xe&&Xe.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Xm(n,t,r[i]);return Gm(n,t),n}})(),Zm=Xe&&Xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.CancellationTokenSource=Xe.CancellationToken=void 0;var Ym=Zm(Ut()),Km=Qm(Sn()),ys=Pn(),Qr;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ys.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ys.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||Km.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Qr||(Xe.CancellationToken=Qr={}));var ey=Object.freeze(function(e,t){let n=(0,Ym.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Zr=class{_isCancelled=!1;_emitter;cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ey:(this._emitter||(this._emitter=new ys.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},bs=class{_token;get token(){return this._token||(this._token=new Zr),this._token}cancel(){this._token?this._token.cancel():this._token=Qr.Cancelled}dispose(){this._token?this._token instanceof Zr&&this._token.dispose():this._token=Qr.None}};Xe.CancellationTokenSource=bs});var ul=J(kn=>{"use strict";v();Object.defineProperty(kn,"__esModule",{value:!0});kn.SharedArrayReceiverStrategy=kn.SharedArraySenderStrategy=void 0;var ty=Yr(),pr;(function(e){e.Continue=0,e.Cancelled=1})(pr||(pr={}));var vs=class{buffers;constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=pr.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,pr.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};kn.SharedArraySenderStrategy=vs;var _s=class{data;constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===pr.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},ws=class{token;constructor(t){this.token=new _s(t)}cancel(){}dispose(){}},Ds=class{kind="request";createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new ty.CancellationTokenSource:new ws(n)}};kn.SharedArrayReceiverStrategy=Ds});var Ss=J(Tn=>{"use strict";v();var ny=Tn&&Tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.Semaphore=void 0;var ry=ny(Ut()),xs=class{_capacity;_active;_waiting;constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,r)=>{this._waiting.push({thunk:t,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ry.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(r=>{this._active--,t.resolve(r),this.runNext()},r=>{this._active--,t.reject(r),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};Tn.Semaphore=xs});var fl=J($e=>{"use strict";v();var iy=$e&&$e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),oy=$e&&$e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sy=$e&&$e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&iy(n,t,r[i]);return oy(n,t),n}})(),ay=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.ReadableStreamMessageReader=$e.AbstractMessageReader=$e.MessageReader=void 0;var ks=ay(Ut()),Rn=sy(Sn()),Ps=Pn(),cy=Ss(),ll;(function(e){function t(n){let r=n;return r&&Rn.func(r.listen)&&Rn.func(r.dispose)&&Rn.func(r.onError)&&Rn.func(r.onClose)&&Rn.func(r.onPartialMessage)}e.is=t})(ll||($e.MessageReader=ll={}));var Kr=class{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new Ps.Emitter,this.closeEmitter=new Ps.Emitter,this.partialMessageEmitter=new Ps.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${Rn.string(t.message)?t.message:"unknown"}`)}};$e.AbstractMessageReader=Kr;var Ts;(function(e){function t(n){let r,i,o,s=new Map,a,f=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,s.set(o.name,o)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,f.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)f.set(c.name,c)}return a===void 0&&(a=(0,ks.default)().applicationJson.decoder,f.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:f}}e.fromOptions=t})(Ts||(Ts={}));var Rs=class extends Kr{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor(t,n){super(),this.readable=t,this.options=Ts.fromOptions(n),this.buffer=(0,ks.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new cy.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
1
+ var Om=Object.create;var Br=Object.defineProperty;var Mm=Object.getOwnPropertyDescriptor;var Nm=Object.getOwnPropertyNames;var Em=Object.getPrototypeOf,Am=Object.prototype.hasOwnProperty;var oe=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var J=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cm=(e,t)=>{for(var n in t)Br(e,n,{get:t[n],enumerable:!0})},el=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nm(t))!Am.call(e,i)&&i!==n&&Br(e,i,{get:()=>t[i],enumerable:!(r=Mm(t,i))||r.enumerable});return e};var zr=(e,t,n)=>(n=e!=null?Om(Em(e)):{},el(t||!e||!e.__esModule?Br(n,"default",{value:e,enumerable:!0}):n,e)),Io=e=>el(Br({},"__esModule",{value:!0}),e);var v=oe(()=>{});async function jm(e){if(e.protocol==="http:"||e.protocol==="https:")return await(await fetch(e)).text();throw new Error("Unsupported protocol")}function qm(e){throw new Error("Unsupported in browser")}function nl(e){if("contents"in e){typeof e.contents=="string"?dr=JSON.parse(e.contents):dr=e.contents;return}if("fsPath"in e){let t=qm(e.fsPath),n=JSON.parse(t);dr=tl(n)?n.contents.bundle:n;return}if(e.uri){let t=e.uri;return typeof e.uri=="string"&&(t=new URL(e.uri)),new Promise((n,r)=>{jm(t).then(i=>{try{let o=JSON.parse(i);dr=tl(o)?o.contents.bundle:o,n()}catch(o){r(o)}}).catch(i=>{r(i)})})}}function C(...e){let t=e[0],n,r,i;if(typeof t=="string")n=t,r=t,e.splice(0,1),i=!e||typeof e[0]!="object"?e:e[0];else if(t instanceof Array){let s=e.slice(1);if(t.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=t[0];for(let f=1;f<t.length;f++)a+=`{${f-1}}`+t[f];return C(a,...s)}else r=t.message,n=r,t.comment&&t.comment.length>0&&(n+=`/${Array.isArray(t.comment)?t.comment.join(""):t.comment}`),i=t.args??{};let o=dr?.[n];return o?typeof o=="string"?Jr(o,i):o.comment?Jr(o.message,i):Jr(r,i):Jr(r,i)}function Jr(e,t){return Object.keys(t).length===0?e:e.replace(Lm,(n,r)=>t[r]??n)}function tl(e){return typeof e?.contents?.bundle=="object"&&typeof e?.version=="string"}var dr,Lm,Rt=oe(()=>{"use strict";v();Lm=/{([^}]+)}/g});var Sn=J(Ot=>{"use strict";v();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.boolean=Im;Ot.string=rl;Ot.number=Fm;Ot.error=$m;Ot.func=Vm;Ot.array=il;Ot.stringArray=Wm;function Im(e){return e===!0||e===!1}function rl(e){return typeof e=="string"||e instanceof String}function Fm(e){return typeof e=="number"||e instanceof Number}function $m(e){return e instanceof Error}function Vm(e){return typeof e=="function"}function il(e){return Array.isArray(e)}function Wm(e){return il(e)&&e.every(t=>rl(t))}});var us=J(G=>{"use strict";v();var Um=G&&G.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Hm=G&&G.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Bm=G&&G.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Um(n,t,r[i]);return Hm(n,t),n}})();Object.defineProperty(G,"__esModule",{value:!0});G.Message=G.NotificationType9=G.NotificationType8=G.NotificationType7=G.NotificationType6=G.NotificationType5=G.NotificationType4=G.NotificationType3=G.NotificationType2=G.NotificationType1=G.NotificationType0=G.NotificationType=G.RequestType9=G.RequestType8=G.RequestType7=G.RequestType6=G.RequestType5=G.RequestType4=G.RequestType3=G.RequestType2=G.RequestType1=G.RequestType=G.RequestType0=G.AbstractMessageSignature=G.ParameterStructures=G.ResponseError=G.ErrorCodes=void 0;var un=Bm(Sn()),Fo;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(Fo||(G.ErrorCodes=Fo={}));var $o=class e extends Error{code;data;constructor(t,n,r){super(n),this.code=un.number(t)?t:Fo.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};G.ResponseError=$o;var Vt=class e{kind;static auto=new e("auto");static byPosition=new e("byPosition");static byName=new e("byName");constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};G.ParameterStructures=Vt;var he=class{method;numberOfParams;constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return Vt.auto}};G.AbstractMessageSignature=he;var Vo=class extends he{_;constructor(t){super(t,0)}};G.RequestType0=Vo;var Wo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.RequestType=Wo;var Uo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.RequestType1=Uo;var Ho=class extends he{_;constructor(t){super(t,2)}};G.RequestType2=Ho;var Bo=class extends he{_;constructor(t){super(t,3)}};G.RequestType3=Bo;var zo=class extends he{_;constructor(t){super(t,4)}};G.RequestType4=zo;var Jo=class extends he{_;constructor(t){super(t,5)}};G.RequestType5=Jo;var Xo=class extends he{_;constructor(t){super(t,6)}};G.RequestType6=Xo;var Go=class extends he{_;constructor(t){super(t,7)}};G.RequestType7=Go;var Qo=class extends he{_;constructor(t){super(t,8)}};G.RequestType8=Qo;var Zo=class extends he{_;constructor(t){super(t,9)}};G.RequestType9=Zo;var Yo=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.NotificationType=Yo;var Ko=class extends he{_;constructor(t){super(t,0)}};G.NotificationType0=Ko;var es=class extends he{_parameterStructures;_;constructor(t,n=Vt.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};G.NotificationType1=es;var ts=class extends he{_;constructor(t){super(t,2)}};G.NotificationType2=ts;var ns=class extends he{_;constructor(t){super(t,3)}};G.NotificationType3=ns;var rs=class extends he{_;constructor(t){super(t,4)}};G.NotificationType4=rs;var is=class extends he{_;constructor(t){super(t,5)}};G.NotificationType5=is;var os=class extends he{_;constructor(t){super(t,6)}};G.NotificationType6=os;var ss=class extends he{_;constructor(t){super(t,7)}};G.NotificationType7=ss;var as=class extends he{_;constructor(t){super(t,8)}};G.NotificationType8=as;var cs=class extends he{_;constructor(t){super(t,9)}};G.NotificationType9=cs;var ol;(function(e){function t(i){let o=i;return o&&un.string(o.method)&&(un.string(o.id)||un.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&un.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(un.string(o.id)||un.number(o.id)||o.id===null)}e.isResponse=r})(ol||(G.Message=ol={}))});var fs=J(Wt=>{"use strict";v();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LRUCache=Wt.LinkedMap=Wt.Touch=void 0;var Fe;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Fe||(Wt.Touch=Fe={}));var Xr=class{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(t){let n=this._map.get(t);return n?n.previous?.value:void 0}after(t){let n=this._map.get(t);return n?n.next?.value:void 0}has(t){return this._map.has(t)}get(t,n=Fe.None){let r=this._map.get(t);if(r)return n!==Fe.None&&this.touch(r,n),r.value}set(t,n,r=Fe.None){let i=this._map.get(t);if(i)i.value=n,r!==Fe.None&&this.touch(i,r);else{switch(i={key:t,value:n,next:void 0,previous:void 0},r){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let r=this._state,i=this._head;for(;i;){if(n?t.bind(n)(i.value,i.key,this):t(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[Symbol.iterator](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>t;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,r=t.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Fe.First&&n!==Fe.Last)){if(n===Fe.First){if(t===this._head)return;let r=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Fe.Last){if(t===this._tail)return;let r=t.next,i=t.previous;t===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,r)=>{t.push([r,n])}),t}fromJSON(t){this.clear();for(let[n,r]of t)this.set(n,r)}};Wt.LinkedMap=Xr;var ls=class extends Xr{_limit;_ratio;constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Fe.AsNew){return super.get(t,n)}peek(t){return super.get(t,Fe.None)}set(t,n){return super.set(t,n,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Wt.LRUCache=ls});var al=J(Gr=>{"use strict";v();Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Disposable=void 0;var sl;(function(e){function t(n){return{dispose:n}}e.create=t})(sl||(Gr.Disposable=sl={}))});var Ut=J(hs=>{"use strict";v();Object.defineProperty(hs,"__esModule",{value:!0});var ds;function ps(){if(ds===void 0)throw new Error("No runtime abstraction layer installed");return ds}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");ds=n}e.install=t})(ps||(ps={}));hs.default=ps});var Pn=J(Ht=>{"use strict";v();var zm=Ht&&Ht.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Emitter=Ht.Event=void 0;var Jm=zm(Ut()),cl;(function(e){let t={dispose(){}};e.None=function(){return t}})(cl||(Ht.Event=cl={}));var gs=class{_callbacks;_contexts;add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,Jm.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ms=class e{_options;static _noop=function(){};_event;_callbacks;constructor(t){this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new gs),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ht.Emitter=ms});var Yr=J(Xe=>{"use strict";v();var Xm=Xe&&Xe.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Gm=Xe&&Xe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Qm=Xe&&Xe.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Xm(n,t,r[i]);return Gm(n,t),n}})(),Zm=Xe&&Xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.CancellationTokenSource=Xe.CancellationToken=void 0;var Ym=Zm(Ut()),Km=Qm(Sn()),ys=Pn(),Qr;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ys.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ys.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||Km.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Qr||(Xe.CancellationToken=Qr={}));var ey=Object.freeze(function(e,t){let n=(0,Ym.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Zr=class{_isCancelled=!1;_emitter;cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ey:(this._emitter||(this._emitter=new ys.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},bs=class{_token;get token(){return this._token||(this._token=new Zr),this._token}cancel(){this._token?this._token.cancel():this._token=Qr.Cancelled}dispose(){this._token?this._token instanceof Zr&&this._token.dispose():this._token=Qr.None}};Xe.CancellationTokenSource=bs});var ul=J(kn=>{"use strict";v();Object.defineProperty(kn,"__esModule",{value:!0});kn.SharedArrayReceiverStrategy=kn.SharedArraySenderStrategy=void 0;var ty=Yr(),pr;(function(e){e.Continue=0,e.Cancelled=1})(pr||(pr={}));var vs=class{buffers;constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=pr.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,pr.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};kn.SharedArraySenderStrategy=vs;var _s=class{data;constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===pr.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},ws=class{token;constructor(t){this.token=new _s(t)}cancel(){}dispose(){}},Ds=class{kind="request";createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new ty.CancellationTokenSource:new ws(n)}};kn.SharedArrayReceiverStrategy=Ds});var Ss=J(Tn=>{"use strict";v();var ny=Tn&&Tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.Semaphore=void 0;var ry=ny(Ut()),xs=class{_capacity;_active;_waiting;constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,r)=>{this._waiting.push({thunk:t,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ry.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(r=>{this._active--,t.resolve(r),this.runNext()},r=>{this._active--,t.reject(r),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};Tn.Semaphore=xs});var fl=J($e=>{"use strict";v();var iy=$e&&$e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),oy=$e&&$e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sy=$e&&$e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&iy(n,t,r[i]);return oy(n,t),n}})(),ay=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.ReadableStreamMessageReader=$e.AbstractMessageReader=$e.MessageReader=void 0;var ks=ay(Ut()),Rn=sy(Sn()),Ps=Pn(),cy=Ss(),ll;(function(e){function t(n){let r=n;return r&&Rn.func(r.listen)&&Rn.func(r.dispose)&&Rn.func(r.onError)&&Rn.func(r.onClose)&&Rn.func(r.onPartialMessage)}e.is=t})(ll||($e.MessageReader=ll={}));var Kr=class{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new Ps.Emitter,this.closeEmitter=new Ps.Emitter,this.partialMessageEmitter=new Ps.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${Rn.string(t.message)?t.message:"unknown"}`)}};$e.AbstractMessageReader=Kr;var Ts;(function(e){function t(n){let r,i,o,s=new Map,a,f=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,s.set(o.name,o)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)s.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,f.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)f.set(c.name,c)}return a===void 0&&(a=(0,ks.default)().applicationJson.decoder,f.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:f}}e.fromOptions=t})(Ts||(Ts={}));var Rs=class extends Kr{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor(t,n){super(),this.readable=t,this.options=Ts.fromOptions(n),this.buffer=(0,ks.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new cy.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
2
2
  ${JSON.stringify(Object.fromEntries(r))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ks.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};$e.ReadableStreamMessageReader=Rs});var ml=J(Ve=>{"use strict";v();var uy=Ve&&Ve.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),ly=Ve&&Ve.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fy=Ve&&Ve.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&uy(n,t,r[i]);return ly(n,t),n}})(),dy=Ve&&Ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WriteableStreamMessageWriter=Ve.AbstractMessageWriter=Ve.MessageWriter=void 0;var dl=dy(Ut()),hr=fy(Sn()),py=Ss(),pl=Pn(),hy="Content-Length: ",hl=`\r
3
3
  `,gl;(function(e){function t(n){let r=n;return r&&hr.func(r.dispose)&&hr.func(r.onClose)&&hr.func(r.onError)&&hr.func(r.write)}e.is=t})(gl||(Ve.MessageWriter=gl={}));var ei=class{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new pl.Emitter,this.closeEmitter=new pl.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,r){this.errorEmitter.fire([this.asError(t),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${hr.string(t.message)?t.message:"unknown"}`)}};Ve.AbstractMessageWriter=ei;var Os;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,dl.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,dl.default)().applicationJson.encoder}}e.fromOptions=t})(Os||(Os={}));var Ms=class extends ei{writable;options;errorCount;writeSemaphore;constructor(t,n){super(),this.writable=t,this.options=Os.fromOptions(n),this.errorCount=0,this.writeSemaphore=new py.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(hy,r.byteLength.toString(),hl),i.push(hl),this.doWrite(t,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(t,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,t),Promise.reject(i)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){this.writable.end()}};Ve.WriteableStreamMessageWriter=Ms});var yl=J(ti=>{"use strict";v();Object.defineProperty(ti,"__esModule",{value:!0});ti.AbstractMessageBuffer=void 0;var gy=13,my=10,yy=`\r
4
4
  `,Ns=class{_encoding;_chunks;_totalLength;constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case gy:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case my:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}o+=c.byteLength,r++}if(n!==4)return;let s=this._read(o+i),a=new Map,f=this.toString(s,"ascii").split(yy);if(f.length<2)return a;for(let c=0;c<f.length-2;c++){let d=f[c],b=d.indexOf(":");if(b===-1)throw new Error(`Message header must separate key and value using ':'