devicetree-language-server 0.0.5 → 0.0.6
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/server.js +76 -76
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Sw=Object.create;var Pp=Object.defineProperty;var kw=Object.getOwnPropertyDescriptor;var Ew=Object.getOwnPropertyNames;var ww=Object.getPrototypeOf,Nw=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var _w=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ew(e))!Nw.call(n,r)&&r!==t&&Pp(n,r,{get:()=>e[r],enumerable:!(i=kw(e,r))||i.enumerable});return n};var G=(n,e,t)=>(t=n!=null?Sw(ww(n)):{},_w(e||!n||!n.__esModule?Pp(t,"default",{value:n,enumerable:!0}):t,n));var Wo=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.thenable=He.typedArray=He.stringArray=He.array=He.func=He.error=He.number=He.string=He.boolean=void 0;function Pw(n){return n===!0||n===!1}He.boolean=Pw;function Dp(n){return typeof n=="string"||n instanceof String}He.string=Dp;function Dw(n){return typeof n=="number"||n instanceof Number}He.number=Dw;function Rw(n){return n instanceof Error}He.error=Rw;function Rp(n){return typeof n=="function"}He.func=Rp;function Cp(n){return Array.isArray(n)}He.array=Cp;function Cw(n){return Cp(n)&&n.every(e=>Dp(e))}He.stringArray=Cw;function Ow(n,e){return Array.isArray(n)&&n.every(e)}He.typedArray=Ow;function Aw(n){return n&&Rp(n.then)}He.thenable=Aw});var rr=C(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function Iw(n){return n===!0||n===!1}mt.boolean=Iw;function Op(n){return typeof n=="string"||n instanceof String}mt.string=Op;function Lw(n){return typeof n=="number"||n instanceof Number}mt.number=Lw;function xw(n){return n instanceof Error}mt.error=xw;function Mw(n){return typeof n=="function"}mt.func=Mw;function Ap(n){return Array.isArray(n)}mt.array=Ap;function qw(n){return Ap(n)&&n.every(e=>Op(e))}mt.stringArray=qw});var Cu=C(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Message=Y.NotificationType9=Y.NotificationType8=Y.NotificationType7=Y.NotificationType6=Y.NotificationType5=Y.NotificationType4=Y.NotificationType3=Y.NotificationType2=Y.NotificationType1=Y.NotificationType0=Y.NotificationType=Y.RequestType9=Y.RequestType8=Y.RequestType7=Y.RequestType6=Y.RequestType5=Y.RequestType4=Y.RequestType3=Y.RequestType2=Y.RequestType1=Y.RequestType=Y.RequestType0=Y.AbstractMessageSignature=Y.ParameterStructures=Y.ResponseError=Y.ErrorCodes=void 0;var Ai=rr(),ou;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(ou||(Y.ErrorCodes=ou={}));var au=class n extends Error{constructor(e,t,i){super(t),this.code=Ai.number(e)?e:ou.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Y.ResponseError=au;var Pt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Y.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var Oe=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Pt.auto}};Y.AbstractMessageSignature=Oe;var cu=class extends Oe{constructor(e){super(e,0)}};Y.RequestType0=cu;var lu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType=lu;var uu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType1=uu;var fu=class extends Oe{constructor(e){super(e,2)}};Y.RequestType2=fu;var du=class extends Oe{constructor(e){super(e,3)}};Y.RequestType3=du;var hu=class extends Oe{constructor(e){super(e,4)}};Y.RequestType4=hu;var pu=class extends Oe{constructor(e){super(e,5)}};Y.RequestType5=pu;var mu=class extends Oe{constructor(e){super(e,6)}};Y.RequestType6=mu;var gu=class extends Oe{constructor(e){super(e,7)}};Y.RequestType7=gu;var yu=class extends Oe{constructor(e){super(e,8)}};Y.RequestType8=yu;var bu=class extends Oe{constructor(e){super(e,9)}};Y.RequestType9=bu;var Tu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType=Tu;var vu=class extends Oe{constructor(e){super(e,0)}};Y.NotificationType0=vu;var Su=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType1=Su;var ku=class extends Oe{constructor(e){super(e,2)}};Y.NotificationType2=ku;var Eu=class extends Oe{constructor(e){super(e,3)}};Y.NotificationType3=Eu;var wu=class extends Oe{constructor(e){super(e,4)}};Y.NotificationType4=wu;var Nu=class extends Oe{constructor(e){super(e,5)}};Y.NotificationType5=Nu;var _u=class extends Oe{constructor(e){super(e,6)}};Y.NotificationType6=_u;var Pu=class extends Oe{constructor(e){super(e,7)}};Y.NotificationType7=Pu;var Du=class extends Oe{constructor(e){super(e,8)}};Y.NotificationType8=Du;var Ru=class extends Oe{constructor(e){super(e,9)}};Y.NotificationType9=Ru;var Ip;(function(n){function e(r){let s=r;return s&&Ai.string(s.method)&&(Ai.string(s.id)||Ai.number(s.id))}n.isRequest=e;function t(r){let s=r;return s&&Ai.string(s.method)&&r.id===void 0}n.isNotification=t;function i(r){let s=r;return s&&(s.result!==void 0||!!s.error)&&(Ai.string(s.id)||Ai.number(s.id)||s.id===null)}n.isResponse=i})(Ip||(Y.Message=Ip={}))});var Au=C(Yn=>{"use strict";var Lp;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LRUCache=Yn.LinkedMap=Yn.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt||(Yn.Touch=gt={}));var Vo=class{constructor(){this[Lp]="LinkedMap",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}has(e){return this._map.has(e)}get(e,t=gt.None){let i=this._map.get(e);if(i)return t!==gt.None&&this.touch(i,t),i.value}set(e,t,i=gt.None){let r=this._map.get(e);if(r)r.value=t,i!==gt.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case gt.None:this.addItemLast(r);break;case gt.First:this.addItemFirst(r);break;case gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.key,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}values(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.value,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}entries(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:[t.key,t.value],done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}[(Lp=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Yn.LinkedMap=Vo;var Ou=class extends Vo{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yn.LRUCache=Ou});var Mp=C(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Disposable=void 0;var xp;(function(n){function e(t){return{dispose:t}}n.create=e})(xp||(Ho.Disposable=xp={}))});var Kn=C(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});var Iu;function Lu(){if(Iu===void 0)throw new Error("No runtime abstraction layer installed");return Iu}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Iu=t}n.install=e})(Lu||(Lu={}));xu.default=Lu});var or=C(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.Emitter=sr.Event=void 0;var Fw=Kn(),qp;(function(n){let e={dispose(){}};n.None=function(){return e}})(qp||(sr.Event=qp={}));var Mu=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let r=0,s=this._callbacks.length;r<s;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),r=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(r[s],e))}catch(a){(0,Fw.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Yo=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new Mu),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};sr.Emitter=Yo;Yo._noop=function(){}});var Go=C(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.CancellationTokenSource=ar.CancellationToken=void 0;var Bw=Kn(),jw=rr(),qu=or(),Ko;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:qu.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qu.Event.None});function e(t){let i=t;return i&&(i===n.None||i===n.Cancelled||jw.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Ko||(ar.CancellationToken=Ko={}));var Uw=Object.freeze(function(n,e){let t=(0,Bw.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),zo=class{constructor(){this._isCancelled=!1}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?Uw:(this._emitter||(this._emitter=new qu.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Fu=class{get token(){return this._token||(this._token=new zo),this._token}cancel(){this._token?this._token.cancel():this._token=Ko.Cancelled}dispose(){this._token?this._token instanceof zo&&this._token.dispose():this._token=Ko.None}};ar.CancellationTokenSource=Fu});var Fp=C(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.SharedArrayReceiverStrategy=cr.SharedArraySenderStrategy=void 0;var $w=Go(),us;(function(n){n.Continue=0,n.Cancelled=1})(us||(us={}));var Bu=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=us.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let i=this.buffers.get(t);if(i===void 0)return;let r=new Int32Array(i,0,1);Atomics.store(r,0,us.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};cr.SharedArraySenderStrategy=Bu;var ju=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===us.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Uu=class{constructor(e){this.token=new ju(e)}cancel(){}dispose(){}},$u=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new $w.CancellationTokenSource:new Uu(t)}};cr.SharedArrayReceiverStrategy=$u});var Vu=C(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Semaphore=void 0;var Ww=Kn(),Wu=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Ww.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Xo.Semaphore=Wu});var jp=C(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ReadableStreamMessageReader=zn.AbstractMessageReader=zn.MessageReader=void 0;var Yu=Kn(),lr=rr(),Hu=or(),Vw=Vu(),Bp;(function(n){function e(t){let i=t;return i&&lr.func(i.listen)&&lr.func(i.dispose)&&lr.func(i.onError)&&lr.func(i.onClose)&&lr.func(i.onPartialMessage)}n.is=e})(Bp||(zn.MessageReader=Bp={}));var Qo=class{constructor(){this.errorEmitter=new Hu.Emitter,this.closeEmitter=new Hu.Emitter,this.partialMessageEmitter=new Hu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${lr.string(e.message)?e.message:"unknown"}`)}};zn.AbstractMessageReader=Qo;var Ku;(function(n){function e(t){let i,r,s,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Yu.default)().applicationJson.decoder,c.set(a.name,a)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Ku||(Ku={}));var zu=class extends Qo{constructor(e,t){super(),this.readable=e,this.options=Ku.fromOptions(t),this.buffer=(0,Yu.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Vw.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let r=i.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(r);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=s}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,r=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(r)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Yu.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};zn.ReadableStreamMessageReader=zu});var Hp=C(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.WriteableStreamMessageWriter=Gn.AbstractMessageWriter=Gn.MessageWriter=void 0;var Up=Kn(),
|
|
4
|
-
`,Vp;(function(n){function e(t){let i=t;return i&&
|
|
5
|
-
`,Qu=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,r=0,s=0;e:for(;i<this._chunks.length;){let l=this._chunks[i];for(r=0;r<l.length;){switch(l[r]){case
|
|
6
|
-
${u}`);let p=u.substr(0,d),g=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let s=this._chunks[r];if(s.byteLength>e){let o=s.slice(0,e);t.set(o,i),i+=e,this._chunks[r]=s.slice(e),this._totalLength-=e,e-=e}else t.set(s,i),i+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return t}};Zo.AbstractMessageBuffer=Qu});var Qp=C(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.createMessageConnection=te.ConnectionOptions=te.MessageStrategy=te.CancellationStrategy=te.CancellationSenderStrategy=te.CancellationReceiverStrategy=te.RequestCancellationReceiverStrategy=te.IdCancellationReceiverStrategy=te.ConnectionStrategy=te.ConnectionError=te.ConnectionErrors=te.LogTraceNotification=te.SetTraceNotification=te.TraceFormat=te.TraceValues=te.Trace=te.NullLogger=te.ProgressType=te.ProgressToken=void 0;var Kp=Kn(),qe=
|
|
7
|
-
${JSON.stringify(S.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let I=S.id,B=w.get(I);if(Fo(S,B),B!==void 0){w.delete(I);try{if(S.error){let W=S.error;B.reject(new X.ResponseError(W.code,W.message,W.data))}else if(S.result!==void 0)B.resolve(S.result);else throw new Error("Should never happen.")}catch(W){W.message?r.error(`Response handler '${B.method}' failed with message: ${W.message}`):r.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function Lo(S){if(An())return;let I,B;if(S.method===
|
|
8
|
-
${JSON.stringify(S,null,4)}`);let I=S;if(qe.string(I.id)||qe.number(I.id)){let B=I.id,W=w.get(B);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function Jt(S){if(S!=null)switch(T){case
|
|
2
|
+
"use strict";var kw=Object.create;var Pp=Object.defineProperty;var Ew=Object.getOwnPropertyDescriptor;var ww=Object.getOwnPropertyNames;var Nw=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Pw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ww(e))!_w.call(n,r)&&r!==t&&Pp(n,r,{get:()=>e[r],enumerable:!(i=Ew(e,r))||i.enumerable});return n};var G=(n,e,t)=>(t=n!=null?kw(Nw(n)):{},Pw(e||!n||!n.__esModule?Pp(t,"default",{value:n,enumerable:!0}):t,n));var Wo=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.thenable=He.typedArray=He.stringArray=He.array=He.func=He.error=He.number=He.string=He.boolean=void 0;function Dw(n){return n===!0||n===!1}He.boolean=Dw;function Dp(n){return typeof n=="string"||n instanceof String}He.string=Dp;function Rw(n){return typeof n=="number"||n instanceof Number}He.number=Rw;function Cw(n){return n instanceof Error}He.error=Cw;function Rp(n){return typeof n=="function"}He.func=Rp;function Cp(n){return Array.isArray(n)}He.array=Cp;function Ow(n){return Cp(n)&&n.every(e=>Dp(e))}He.stringArray=Ow;function Aw(n,e){return Array.isArray(n)&&n.every(e)}He.typedArray=Aw;function Iw(n){return n&&Rp(n.then)}He.thenable=Iw});var sr=C(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function Lw(n){return n===!0||n===!1}mt.boolean=Lw;function Op(n){return typeof n=="string"||n instanceof String}mt.string=Op;function xw(n){return typeof n=="number"||n instanceof Number}mt.number=xw;function Mw(n){return n instanceof Error}mt.error=Mw;function qw(n){return typeof n=="function"}mt.func=qw;function Ap(n){return Array.isArray(n)}mt.array=Ap;function Fw(n){return Ap(n)&&n.every(e=>Op(e))}mt.stringArray=Fw});var Cu=C(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Message=Y.NotificationType9=Y.NotificationType8=Y.NotificationType7=Y.NotificationType6=Y.NotificationType5=Y.NotificationType4=Y.NotificationType3=Y.NotificationType2=Y.NotificationType1=Y.NotificationType0=Y.NotificationType=Y.RequestType9=Y.RequestType8=Y.RequestType7=Y.RequestType6=Y.RequestType5=Y.RequestType4=Y.RequestType3=Y.RequestType2=Y.RequestType1=Y.RequestType=Y.RequestType0=Y.AbstractMessageSignature=Y.ParameterStructures=Y.ResponseError=Y.ErrorCodes=void 0;var Ii=sr(),ou;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(ou||(Y.ErrorCodes=ou={}));var au=class n extends Error{constructor(e,t,i){super(t),this.code=Ii.number(e)?e:ou.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Y.ResponseError=au;var Pt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Y.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var Oe=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Pt.auto}};Y.AbstractMessageSignature=Oe;var cu=class extends Oe{constructor(e){super(e,0)}};Y.RequestType0=cu;var lu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType=lu;var uu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType1=uu;var fu=class extends Oe{constructor(e){super(e,2)}};Y.RequestType2=fu;var du=class extends Oe{constructor(e){super(e,3)}};Y.RequestType3=du;var hu=class extends Oe{constructor(e){super(e,4)}};Y.RequestType4=hu;var pu=class extends Oe{constructor(e){super(e,5)}};Y.RequestType5=pu;var mu=class extends Oe{constructor(e){super(e,6)}};Y.RequestType6=mu;var gu=class extends Oe{constructor(e){super(e,7)}};Y.RequestType7=gu;var yu=class extends Oe{constructor(e){super(e,8)}};Y.RequestType8=yu;var bu=class extends Oe{constructor(e){super(e,9)}};Y.RequestType9=bu;var Tu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType=Tu;var vu=class extends Oe{constructor(e){super(e,0)}};Y.NotificationType0=vu;var Su=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType1=Su;var ku=class extends Oe{constructor(e){super(e,2)}};Y.NotificationType2=ku;var Eu=class extends Oe{constructor(e){super(e,3)}};Y.NotificationType3=Eu;var wu=class extends Oe{constructor(e){super(e,4)}};Y.NotificationType4=wu;var Nu=class extends Oe{constructor(e){super(e,5)}};Y.NotificationType5=Nu;var _u=class extends Oe{constructor(e){super(e,6)}};Y.NotificationType6=_u;var Pu=class extends Oe{constructor(e){super(e,7)}};Y.NotificationType7=Pu;var Du=class extends Oe{constructor(e){super(e,8)}};Y.NotificationType8=Du;var Ru=class extends Oe{constructor(e){super(e,9)}};Y.NotificationType9=Ru;var Ip;(function(n){function e(r){let s=r;return s&&Ii.string(s.method)&&(Ii.string(s.id)||Ii.number(s.id))}n.isRequest=e;function t(r){let s=r;return s&&Ii.string(s.method)&&r.id===void 0}n.isNotification=t;function i(r){let s=r;return s&&(s.result!==void 0||!!s.error)&&(Ii.string(s.id)||Ii.number(s.id)||s.id===null)}n.isResponse=i})(Ip||(Y.Message=Ip={}))});var Au=C(Yn=>{"use strict";var Lp;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LRUCache=Yn.LinkedMap=Yn.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt||(Yn.Touch=gt={}));var Vo=class{constructor(){this[Lp]="LinkedMap",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}has(e){return this._map.has(e)}get(e,t=gt.None){let i=this._map.get(e);if(i)return t!==gt.None&&this.touch(i,t),i.value}set(e,t,i=gt.None){let r=this._map.get(e);if(r)r.value=t,i!==gt.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case gt.None:this.addItemLast(r);break;case gt.First:this.addItemFirst(r);break;case gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.key,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}values(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.value,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}entries(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:[t.key,t.value],done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}[(Lp=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Yn.LinkedMap=Vo;var Ou=class extends Vo{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yn.LRUCache=Ou});var Mp=C(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Disposable=void 0;var xp;(function(n){function e(t){return{dispose:t}}n.create=e})(xp||(Ho.Disposable=xp={}))});var Kn=C(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});var Iu;function Lu(){if(Iu===void 0)throw new Error("No runtime abstraction layer installed");return Iu}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Iu=t}n.install=e})(Lu||(Lu={}));xu.default=Lu});var ar=C(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.Emitter=or.Event=void 0;var Bw=Kn(),qp;(function(n){let e={dispose(){}};n.None=function(){return e}})(qp||(or.Event=qp={}));var Mu=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let r=0,s=this._callbacks.length;r<s;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),r=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(r[s],e))}catch(a){(0,Bw.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Yo=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new Mu),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};or.Emitter=Yo;Yo._noop=function(){}});var Go=C(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.CancellationTokenSource=cr.CancellationToken=void 0;var jw=Kn(),Uw=sr(),qu=ar(),Ko;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:qu.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qu.Event.None});function e(t){let i=t;return i&&(i===n.None||i===n.Cancelled||Uw.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Ko||(cr.CancellationToken=Ko={}));var $w=Object.freeze(function(n,e){let t=(0,jw.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),zo=class{constructor(){this._isCancelled=!1}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?$w:(this._emitter||(this._emitter=new qu.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Fu=class{get token(){return this._token||(this._token=new zo),this._token}cancel(){this._token?this._token.cancel():this._token=Ko.Cancelled}dispose(){this._token?this._token instanceof zo&&this._token.dispose():this._token=Ko.None}};cr.CancellationTokenSource=Fu});var Fp=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.SharedArrayReceiverStrategy=lr.SharedArraySenderStrategy=void 0;var Ww=Go(),fs;(function(n){n.Continue=0,n.Cancelled=1})(fs||(fs={}));var Bu=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=fs.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let i=this.buffers.get(t);if(i===void 0)return;let r=new Int32Array(i,0,1);Atomics.store(r,0,fs.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};lr.SharedArraySenderStrategy=Bu;var ju=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===fs.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Uu=class{constructor(e){this.token=new ju(e)}cancel(){}dispose(){}},$u=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new Ww.CancellationTokenSource:new Uu(t)}};lr.SharedArrayReceiverStrategy=$u});var Vu=C(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Semaphore=void 0;var Vw=Kn(),Wu=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Vw.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Xo.Semaphore=Wu});var jp=C(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ReadableStreamMessageReader=zn.AbstractMessageReader=zn.MessageReader=void 0;var Yu=Kn(),ur=sr(),Hu=ar(),Hw=Vu(),Bp;(function(n){function e(t){let i=t;return i&&ur.func(i.listen)&&ur.func(i.dispose)&&ur.func(i.onError)&&ur.func(i.onClose)&&ur.func(i.onPartialMessage)}n.is=e})(Bp||(zn.MessageReader=Bp={}));var Qo=class{constructor(){this.errorEmitter=new Hu.Emitter,this.closeEmitter=new Hu.Emitter,this.partialMessageEmitter=new Hu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ur.string(e.message)?e.message:"unknown"}`)}};zn.AbstractMessageReader=Qo;var Ku;(function(n){function e(t){let i,r,s,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Yu.default)().applicationJson.decoder,c.set(a.name,a)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Ku||(Ku={}));var zu=class extends Qo{constructor(e,t){super(),this.readable=e,this.options=Ku.fromOptions(t),this.buffer=(0,Yu.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Hw.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let r=i.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(r);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=s}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,r=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(r)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Yu.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};zn.ReadableStreamMessageReader=zu});var Hp=C(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.WriteableStreamMessageWriter=Gn.AbstractMessageWriter=Gn.MessageWriter=void 0;var Up=Kn(),ds=sr(),Yw=Vu(),$p=ar(),Kw="Content-Length: ",Wp=`\r
|
|
4
|
+
`,Vp;(function(n){function e(t){let i=t;return i&&ds.func(i.dispose)&&ds.func(i.onClose)&&ds.func(i.onError)&&ds.func(i.write)}n.is=e})(Vp||(Gn.MessageWriter=Vp={}));var Jo=class{constructor(){this.errorEmitter=new $p.Emitter,this.closeEmitter=new $p.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ds.string(e.message)?e.message:"unknown"}`)}};Gn.AbstractMessageWriter=Jo;var Gu;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Up.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Up.default)().applicationJson.encoder}}n.fromOptions=e})(Gu||(Gu={}));var Xu=class extends Jo{constructor(e,t){super(),this.writable=e,this.options=Gu.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Yw.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let r=[];return r.push(Kw,i.byteLength.toString(),Wp),r.push(Wp),this.doWrite(e,r,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Gn.WriteableStreamMessageWriter=Xu});var Yp=C(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.AbstractMessageBuffer=void 0;var zw=13,Gw=10,Xw=`\r
|
|
5
|
+
`,Qu=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,r=0,s=0;e:for(;i<this._chunks.length;){let l=this._chunks[i];for(r=0;r<l.length;){switch(l[r]){case zw:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case Gw:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}s+=l.byteLength,i++}if(t!==4)return;let o=this._read(s+r),a=new Map,c=this.toString(o,"ascii").split(Xw);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
|
|
6
|
+
${u}`);let p=u.substr(0,d),g=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let s=this._chunks[r];if(s.byteLength>e){let o=s.slice(0,e);t.set(o,i),i+=e,this._chunks[r]=s.slice(e),this._totalLength-=e,e-=e}else t.set(s,i),i+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return t}};Zo.AbstractMessageBuffer=Qu});var Qp=C(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.createMessageConnection=te.ConnectionOptions=te.MessageStrategy=te.CancellationStrategy=te.CancellationSenderStrategy=te.CancellationReceiverStrategy=te.RequestCancellationReceiverStrategy=te.IdCancellationReceiverStrategy=te.ConnectionStrategy=te.ConnectionError=te.ConnectionErrors=te.LogTraceNotification=te.SetTraceNotification=te.TraceFormat=te.TraceValues=te.Trace=te.NullLogger=te.ProgressType=te.ProgressToken=void 0;var Kp=Kn(),qe=sr(),X=Cu(),zp=Au(),hs=ar(),Ju=Go(),gs;(function(n){n.type=new X.NotificationType("$/cancelRequest")})(gs||(gs={}));var Zu;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Zu||(te.ProgressToken=Zu={}));var ps;(function(n){n.type=new X.NotificationType("$/progress")})(ps||(ps={}));var ef=class{constructor(){}};te.ProgressType=ef;var tf;(function(n){function e(t){return qe.func(t)}n.is=e})(tf||(tf={}));te.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var me;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(me||(te.Trace=me={}));var Gp;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(Gp||(te.TraceValues=Gp={}));(function(n){function e(i){if(!qe.string(i))return n.Off;switch(i=i.toLowerCase(),i){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(i){switch(i){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(me||(te.Trace=me={}));var xt;(function(n){n.Text="text",n.JSON="json"})(xt||(te.TraceFormat=xt={}));(function(n){function e(t){return qe.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(xt||(te.TraceFormat=xt={}));var nf;(function(n){n.type=new X.NotificationType("$/setTrace")})(nf||(te.SetTraceNotification=nf={}));var ea;(function(n){n.type=new X.NotificationType("$/logTrace")})(ea||(te.LogTraceNotification=ea={}));var ms;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(ms||(te.ConnectionErrors=ms={}));var fr=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};te.ConnectionError=fr;var rf;(function(n){function e(t){let i=t;return i&&qe.func(i.cancelUndispatched)}n.is=e})(rf||(te.ConnectionStrategy=rf={}));var ta;(function(n){function e(t){let i=t;return i&&(i.kind===void 0||i.kind==="id")&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(ta||(te.IdCancellationReceiverStrategy=ta={}));var sf;(function(n){function e(t){let i=t;return i&&i.kind==="request"&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(sf||(te.RequestCancellationReceiverStrategy=sf={}));var na;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Ju.CancellationTokenSource}});function e(t){return ta.is(t)||sf.is(t)}n.is=e})(na||(te.CancellationReceiverStrategy=na={}));var ia;(function(n){n.Message=Object.freeze({sendCancellation(t,i){return t.sendNotification(gs.type,{id:i})},cleanup(t){}});function e(t){let i=t;return i&&qe.func(i.sendCancellation)&&qe.func(i.cleanup)}n.is=e})(ia||(te.CancellationSenderStrategy=ia={}));var ra;(function(n){n.Message=Object.freeze({receiver:na.Message,sender:ia.Message});function e(t){let i=t;return i&&na.is(i.receiver)&&ia.is(i.sender)}n.is=e})(ra||(te.CancellationStrategy=ra={}));var sa;(function(n){function e(t){let i=t;return i&&qe.func(i.handleMessage)}n.is=e})(sa||(te.MessageStrategy=sa={}));var Xp;(function(n){function e(t){let i=t;return i&&(ra.is(i.cancellationStrategy)||rf.is(i.connectionStrategy)||sa.is(i.messageStrategy))}n.is=e})(Xp||(te.ConnectionOptions=Xp={}));var tn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(tn||(tn={}));function Qw(n,e,t,i){let r=t!==void 0?t:te.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,p=new Map,g=new Map,_,b=new zp.LinkedMap,w=new Map,R=new Set,v=new Map,T=me.Off,N=xt.Text,L,q=tn.New,H=new hs.Emitter,j=new hs.Emitter,ie=new hs.Emitter,Be=new hs.Emitter,Et=new hs.Emitter,ce=i&&i.cancellationStrategy?i.cancellationStrategy:ra.Message;function On(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function Zi(S){return S===null?"res-unknown-"+(++a).toString():"res-"+S.toString()}function Po(){return"not-"+(++o).toString()}function su(S,I){X.Message.isRequest(I)?S.set(On(I.id),I):X.Message.isResponse(I)?S.set(Zi(I.id),I):S.set(Po(),I)}function Do(S){}function ss(){return q===tn.Listening}function Ci(){return q===tn.Closed}function An(){return q===tn.Disposed}function er(){(q===tn.New||q===tn.Listening)&&(q=tn.Closed,j.fire(void 0))}function Oi(S){H.fire([S,void 0,void 0])}function Ro(S){H.fire(S)}n.onClose(er),n.onError(Oi),e.onClose(er),e.onError(Ro);function os(){_||b.size===0||(_=(0,Kp.default)().timer.setImmediate(()=>{_=void 0,Co()}))}function as(S){X.Message.isRequest(S)?Ao(S):X.Message.isNotification(S)?Lo(S):X.Message.isResponse(S)?Io(S):tr(S)}function Co(){if(b.size===0)return;let S=b.shift();try{let I=i?.messageStrategy;sa.is(I)?I.handleMessage(S,as):as(S)}finally{os()}}let Oo=S=>{try{if(X.Message.isNotification(S)&&S.method===gs.type.method){let I=S.params.id,B=On(I),W=b.get(B);if(X.Message.isRequest(W)){let ge=i?.connectionStrategy,Ce=ge&&ge.cancelUndispatched?ge.cancelUndispatched(W,Do):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){b.delete(B),v.delete(I),Ce.id=W.id,Ai(Ce,S.method,Date.now()),e.write(Ce).catch(()=>r.error("Sending response for canceled message failed."));return}}let ke=v.get(I);if(ke!==void 0){ke.cancel(),nr(S);return}else R.add(I)}su(b,S)}finally{os()}};function Ao(S){if(An())return;function I(se,Ee,fe){let je={jsonrpc:c,id:S.id};se instanceof X.ResponseError?je.error=se.toJson():je.result=se===void 0?null:se,Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function B(se,Ee,fe){let je={jsonrpc:c,id:S.id,error:se.toJson()};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function W(se,Ee,fe){se===void 0&&(se=null);let je={jsonrpc:c,id:S.id,result:se};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}qo(S);let ke=u.get(S.method),ge,Ce;ke&&(ge=ke.type,Ce=ke.handler);let Le=Date.now();if(Ce||l){let se=S.id??String(Date.now()),Ee=ta.is(ce.receiver)?ce.receiver.createCancellationTokenSource(se):ce.receiver.createCancellationTokenSource(S);S.id!==null&&R.has(S.id)&&Ee.cancel(),S.id!==null&&v.set(se,Ee);try{let fe;if(Ce)if(S.params===void 0){if(ge!==void 0&&ge.numberOfParams!==0){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines ${ge.numberOfParams} params but received none.`),S.method,Le);return}fe=Ce(Ee.token)}else if(Array.isArray(S.params)){if(ge!==void 0&&ge.parameterStructures===X.ParameterStructures.byName){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,Le);return}fe=Ce(...S.params,Ee.token)}else{if(ge!==void 0&&ge.parameterStructures===X.ParameterStructures.byPosition){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,Le);return}fe=Ce(S.params,Ee.token)}else l&&(fe=l(S.method,S.params,Ee.token));let je=fe;fe?je.then?je.then(nt=>{v.delete(se),I(nt,S.method,Le)},nt=>{v.delete(se),nt instanceof X.ResponseError?B(nt,S.method,Le):nt&&qe.string(nt.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${nt.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}):(v.delete(se),I(fe,S.method,Le)):(v.delete(se),W(fe,S.method,Le))}catch(fe){v.delete(se),fe instanceof X.ResponseError?I(fe,S.method,Le):fe&&qe.string(fe.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${fe.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}}else B(new X.ResponseError(X.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,Le)}function Io(S){if(!An())if(S.id===null)S.error?r.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(S.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let I=S.id,B=w.get(I);if(Fo(S,B),B!==void 0){w.delete(I);try{if(S.error){let W=S.error;B.reject(new X.ResponseError(W.code,W.message,W.data))}else if(S.result!==void 0)B.resolve(S.result);else throw new Error("Should never happen.")}catch(W){W.message?r.error(`Response handler '${B.method}' failed with message: ${W.message}`):r.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function Lo(S){if(An())return;let I,B;if(S.method===gs.type.method){let W=S.params.id;R.delete(W),nr(S);return}else{let W=p.get(S.method);W&&(B=W.handler,I=W.type)}if(B||d)try{if(nr(S),B)if(S.params===void 0)I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received none.`),B();else if(Array.isArray(S.params)){let W=S.params;S.method===ps.type.method&&W.length===2&&Zu.is(W[0])?B({token:W[0],value:W[1]}):(I!==void 0&&(I.parameterStructures===X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines parameters by name but received parameters by position`),I.numberOfParams!==S.params.length&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received ${W.length} arguments`)),B(...W))}else I!==void 0&&I.parameterStructures===X.ParameterStructures.byPosition&&r.error(`Notification ${S.method} defines parameters by position but received parameters by name`),B(S.params);else d&&d(S.method,S.params)}catch(W){W.message?r.error(`Notification handler '${S.method}' failed with message: ${W.message}`):r.error(`Notification handler '${S.method}' failed unexpectedly.`)}else ie.fire(S)}function tr(S){if(!S){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(S,null,4)}`);let I=S;if(qe.string(I.id)||qe.number(I.id)){let B=I.id,W=w.get(B);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function Jt(S){if(S!=null)switch(T){case me.Verbose:return JSON.stringify(S,null,4);case me.Compact:return JSON.stringify(S);default:return}}function xo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Jt(S.params)}
|
|
9
9
|
|
|
10
|
-
`),L.log(`Sending request '${S.method} - (${S.id})'.`,I)}else In("send-request",S)}function Mo(S){if(!(T===
|
|
10
|
+
`),L.log(`Sending request '${S.method} - (${S.id})'.`,I)}else In("send-request",S)}function Mo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Jt(S.params)}
|
|
11
11
|
|
|
12
12
|
`:I=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),L.log(`Sending notification '${S.method}'.`,I)}else In("send-notification",S)}function
|
|
14
|
+
`),L.log(`Sending notification '${S.method}'.`,I)}else In("send-notification",S)}function Ai(S,I,B){if(!(T===me.Off||!L))if(N===xt.Text){let W;(T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?W=`Error data: ${Jt(S.error.data)}
|
|
15
15
|
|
|
16
16
|
`:S.result?W=`Result: ${Jt(S.result)}
|
|
17
17
|
|
|
18
18
|
`:S.error===void 0&&(W=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),L.log(`Sending response '${I} - (${S.id})'. Processing request took ${Date.now()-B}ms`,W)}else In("send-response",S)}function qo(S){if(!(T===
|
|
20
|
+
`)),L.log(`Sending response '${I} - (${S.id})'. Processing request took ${Date.now()-B}ms`,W)}else In("send-response",S)}function qo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Jt(S.params)}
|
|
21
21
|
|
|
22
|
-
`),L.log(`Received request '${S.method} - (${S.id})'.`,I)}else In("receive-request",S)}function
|
|
22
|
+
`),L.log(`Received request '${S.method} - (${S.id})'.`,I)}else In("receive-request",S)}function nr(S){if(!(T===me.Off||!L||S.method===ea.type.method))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Jt(S.params)}
|
|
23
23
|
|
|
24
24
|
`:I=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),L.log(`Received notification '${S.method}'.`,I)}else In("receive-notification",S)}function Fo(S,I){if(!(T===
|
|
26
|
+
`),L.log(`Received notification '${S.method}'.`,I)}else In("receive-notification",S)}function Fo(S,I){if(!(T===me.Off||!L))if(N===xt.Text){let B;if((T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?B=`Error data: ${Jt(S.error.data)}
|
|
27
27
|
|
|
28
28
|
`:S.result?B=`Result: ${Jt(S.result)}
|
|
29
29
|
|
|
30
30
|
`:S.error===void 0&&(B=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),I){let W=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";L.log(`Received response '${I.method} - (${S.id})' in ${Date.now()-I.timerStart}ms.${W}`,B)}else L.log(`Received response ${S.id} without active response promise.`,B)}else In("receive-response",S)}function In(S,I){if(!L||T===pe.Off)return;let B={isLSPMessage:!0,type:S,message:I,timestamp:Date.now()};L.log(B)}function Hn(){if(Ri())throw new ur(ps.Closed,"Connection is closed.");if(An())throw new ur(ps.Disposed,"Connection is disposed.")}function Bo(){if(rs())throw new ur(ps.AlreadyListening,"Connection is already listening")}function jo(){if(!rs())throw new Error("Call listen() first.")}function pn(S){return S===void 0?null:S}function as(S){if(S!==null)return S}function cs(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function nr(S,I){switch(S){case X.ParameterStructures.auto:return cs(I)?as(I):[pn(I)];case X.ParameterStructures.byName:if(!cs(I))throw new Error("Received parameters by name but param is not an object literal.");return as(I);case X.ParameterStructures.byPosition:return[pn(I)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function ls(S,I){let B,W=S.numberOfParams;switch(W){case 0:B=void 0;break;case 1:B=nr(S.parameterStructures,I[0]);break;default:B=[];for(let Se=0;Se<I.length&&Se<W;Se++)B.push(pn(I[Se]));if(I.length<W)for(let Se=I.length;Se<W;Se++)B.push(null);break}return B}let Ln={sendNotification:(S,...I)=>{Hn();let B,W;if(qe.string(S)){B=S;let me=I[0],Ce=0,Le=X.ParameterStructures.auto;X.ParameterStructures.is(me)&&(Ce=1,Le=me);let se=I.length,ke=se-Ce;switch(ke){case 0:W=void 0;break;case 1:W=nr(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${ke} parameters for 'by Name' notification parameter structure.`);W=I.slice(Ce,se).map(ue=>pn(ue));break}}else{let me=I;B=S.method,W=ls(S,me)}let Se={jsonrpc:c,method:B,params:W};return Mo(Se),e.write(Se).catch(me=>{throw r.error("Sending notification failed."),me})},onNotification:(S,I)=>{Hn();let B;return qe.func(S)?d=S:I&&(qe.string(S)?(B=S,p.set(S,{type:void 0,handler:I})):(B=S.method,p.set(S.method,{type:S,handler:I}))),{dispose:()=>{B!==void 0?p.delete(B):d=void 0}}},onProgress:(S,I,B)=>{if(g.has(I))throw new Error(`Progress handler for token ${I} already registered`);return g.set(I,B),{dispose:()=>{g.delete(I)}}},sendProgress:(S,I,B)=>Ln.sendNotification(hs.type,{token:I,value:B}),onUnhandledProgress:Be.event,sendRequest:(S,...I)=>{Hn(),jo();let B,W,Se;if(qe.string(S)){B=S;let se=I[0],ke=I[I.length-1],ue=0,je=X.ParameterStructures.auto;X.ParameterStructures.is(se)&&(ue=1,je=se);let nt=I.length;Ju.CancellationToken.is(ke)&&(nt=nt-1,Se=ke);let Lt=nt-ue;switch(Lt){case 0:W=void 0;break;case 1:W=nr(je,I[ue]);break;default:if(je===X.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);W=I.slice(ue,nt).map(Uo=>pn(Uo));break}}else{let se=I;B=S.method,W=ls(S,se);let ke=S.numberOfParams;Se=Ju.CancellationToken.is(se[ke])?se[ke]:void 0}let me=s++,Ce;Se&&(Ce=Se.onCancellationRequested(()=>{let se=ce.sender.sendCancellation(Ln,me);return se===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${me}`),Promise.resolve()):se.catch(()=>{r.log(`Sending cancellation messages for id ${me} failed`)})}));let Le={jsonrpc:c,id:me,method:B,params:W};return xo(Le),typeof ce.sender.enableCancellation=="function"&&ce.sender.enableCancellation(Le),new Promise(async(se,ke)=>{let ue=Lt=>{se(Lt),ce.sender.cleanup(me),Ce?.dispose()},je=Lt=>{ke(Lt),ce.sender.cleanup(me),Ce?.dispose()},nt={method:B,timerStart:Date.now(),resolve:ue,reject:je};try{await e.write(Le),w.set(me,nt)}catch(Lt){throw r.error("Sending request failed."),nt.reject(new X.ResponseError(X.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(S,I)=>{Hn();let B=null;return tf.is(S)?(B=void 0,l=S):qe.string(S)?(B=null,I!==void 0&&(B=S,u.set(S,{handler:I,type:void 0}))):I!==void 0&&(B=S.method,u.set(S.method,{type:S,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>w.size>0,trace:async(S,I,B)=>{let W=!1,Se=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,Se=B.traceFormat||xt.Text)),T=S,N=Se,T===pe.Off?L=void 0:L=I,W&&!Ri()&&!An()&&await Ln.sendNotification(nf.type,{value:pe.toString(S)})},onError:H.event,onClose:j.event,onUnhandledNotification:ie.event,onDispose:Et.event,end:()=>{e.end()},dispose:()=>{if(An())return;q=tn.Disposed,Et.fire(void 0);let S=new X.ResponseError(X.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of w.values())I.reject(S);w=new Map,v=new Map,R=new Set,b=new zp.LinkedMap,qe.func(e.dispose)&&e.dispose(),qe.func(n.dispose)&&n.dispose()},listen:()=>{Hn(),Bo(),q=tn.Listening,n.listen(Oo)},inspect:()=>{(0,Kp.default)().console.log("inspect")}};return Ln.onNotification(ea.type,S=>{if(T===pe.Off||!L)return;let I=T===pe.Verbose||T===pe.Compact;L.log(S.message,I?S.verbose:void 0)}),Ln.onNotification(hs.type,S=>{let I=g.get(S.token);I?I(S.value):Be.fire(S)}),Ln}te.createMessageConnection=Xw});var oa=C(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var Ne=Cu();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return Ne.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return Ne.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return Ne.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return Ne.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return Ne.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return Ne.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return Ne.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return Ne.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return Ne.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return Ne.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return Ne.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return Ne.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return Ne.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return Ne.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return Ne.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return Ne.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return Ne.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return Ne.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return Ne.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return Ne.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return Ne.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return Ne.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return Ne.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return Ne.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return Ne.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return Ne.ParameterStructures}});var of=Au();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return of.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return of.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return of.Touch}});var Qw=Mp();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return Qw.Disposable}});var Jp=or();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return Jp.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return Jp.Emitter}});var Zp=Go();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return Zp.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return Zp.CancellationToken}});var em=Fp();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return em.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return em.SharedArrayReceiverStrategy}});var af=jp();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return af.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return af.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return af.ReadableStreamMessageReader}});var cf=Hp();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return cf.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return cf.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return cf.WriteableStreamMessageWriter}});var Jw=Yp();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Jw.AbstractMessageBuffer}});var ut=Qp();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return ut.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return ut.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return ut.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return ut.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return ut.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return ut.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return ut.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return ut.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return ut.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return ut.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return ut.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return ut.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return ut.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ut.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ut.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return ut.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return ut.MessageStrategy}});var Zw=Kn();O.RAL=Zw.default});var im=C(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var tm=require("util"),Mn=oa(),aa=class n extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new tm.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};aa.emptyBuffer=Buffer.allocUnsafe(0);var lf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},uf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let s=o=>{o==null?i():r(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},nm=Object.freeze({messageBuffer:Object.freeze({create:n=>new aa(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new tm.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new lf(n),asWritableStream:n=>new uf(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function ff(){return nm}(function(n){function e(){Mn.RAL.install(nm)}n.install=e})(ff||(ff={}));df.default=ff});var xi=C(ae=>{"use strict";var eN=ae&&ae.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),tN=ae&&ae.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&eN(e,n,t)};Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.createServerSocketTransport=ae.createClientSocketTransport=ae.createServerPipeTransport=ae.createClientPipeTransport=ae.generateRandomPipeName=ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;var fr=im();fr.default.install();var rm=require("path"),nN=require("os"),iN=require("crypto"),ua=require("net"),Mt=oa();tN(oa(),ae);var hf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mt.Disposable.create(()=>this.process.off("message",e))}};ae.IPCMessageReader=hf;var pf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.IPCMessageWriter=pf;var mf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.onData=new Mt.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ae.PortMessageReader=mf;var gf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.PortMessageWriter=gf;var Ii=class extends Mt.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,fr.default)().stream.asReadableStream(e),t)}};ae.SocketMessageReader=Ii;var Li=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,fr.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=Li;var ca=class extends Mt.ReadableStreamMessageReader{constructor(e,t){super((0,fr.default)().stream.asReadableStream(e),t)}};ae.StreamMessageReader=ca;var la=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,fr.default)().stream.asWritableStream(e),t)}};ae.StreamMessageWriter=la;var sm=process.env.XDG_RUNTIME_DIR,rN=new Map([["linux",107],["darwin",103]]);function sN(){let n=(0,iN.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;sm?e=rm.join(sm,`vscode-ipc-${n}.sock`):e=rm.join(nN.tmpdir(),`vscode-${n}.sock`);let t=rN.get(process.platform);return t!==void 0&&e.length>t&&(0,fr.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ae.generateRandomPipeName=sN;function oN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Ii(a,e),new Li(a,e)])});o.on("error",s),o.listen(n,()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientPipeTransport=oN;function aN(n,e="utf-8"){let t=(0,ua.createConnection)(n);return[new Ii(t,e),new Li(t,e)]}ae.createServerPipeTransport=aN;function cN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Ii(a,e),new Li(a,e)])});o.on("error",s),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientSocketTransport=cN;function lN(n,e="utf-8"){let t=(0,ua.createConnection)(n,"127.0.0.1");return[new Ii(t,e),new Li(t,e)]}ae.createServerSocketTransport=lN;function uN(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function fN(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function dN(n,e,t,i){t||(t=Mt.NullLogger);let r=uN(n)?new ca(n):n,s=fN(e)?new la(e):e;return Mt.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Mt.createMessageConnection)(r,s,t,i)}ae.createMessageConnection=dN});var yf=C((xA,om)=>{"use strict";om.exports=xi()});var da=C((am,fa)=>{(function(n){if(typeof fa=="object"&&typeof fa.exports=="object"){var e=n(require,am);e!==void 0&&(fa.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(h){function k(E){return typeof E=="string"}h.is=k})(t||(e.DocumentUri=t={}));var i;(function(h){function k(E){return typeof E=="string"}h.is=k})(i||(e.URI=i={}));var r;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(r||(e.integer=r={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(s||(e.uinteger=s={}));var o;(function(h){function k(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=E})(o||(e.Position=o={}));var a;(function(h){function k(m,f,P,x){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(P)&&D.uinteger(x))return{start:o.create(m,f),end:o.create(P,x)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(P,", ").concat(x,"]"))}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=E})(a||(e.Range=a={}));var c;(function(h){function k(m,f){return{uri:m,range:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=E})(c||(e.Location=c={}));var l;(function(h){function k(m,f,P,x){return{targetUri:m,targetRange:f,targetSelectionRange:P,originSelectionRange:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=E})(l||(e.LocationLink=l={}));var u;(function(h){function k(m,f,P,x){return{red:m,green:f,blue:P,alpha:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=E})(u||(e.Color=u={}));var d;(function(h){function k(m,f){return{range:m,color:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&u.is(f.color)}h.is=E})(d||(e.ColorInformation=d={}));var p;(function(h){function k(m,f,P){return{label:m,textEdit:f,additionalTextEdits:P}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||L.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,L.is))}h.is=E})(p||(e.ColorPresentation=p={}));var g;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(h){function k(m,f,P,x,ee,Ue){var we={startLine:m,endLine:f};return D.defined(P)&&(we.startCharacter=P),D.defined(x)&&(we.endCharacter=x),D.defined(ee)&&(we.kind=ee),D.defined(Ue)&&(we.collapsedText=Ue),we}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=E})(_||(e.FoldingRange=_={}));var b;(function(h){function k(m,f){return{location:m,message:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&c.is(f.location)&&D.string(f.message)}h.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var w;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(w||(e.DiagnosticSeverity=w={}));var R;(function(h){h.Unnecessary=1,h.Deprecated=2})(R||(e.DiagnosticTag=R={}));var v;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&D.string(m.href)}h.is=k})(v||(e.CodeDescription=v={}));var T;(function(h){function k(m,f,P,x,ee,Ue){var we={range:m,message:f};return D.defined(P)&&(we.severity=P),D.defined(x)&&(we.code=x),D.defined(ee)&&(we.source=ee),D.defined(Ue)&&(we.relatedInformation=Ue),we}h.create=k;function E(m){var f,P=m;return D.defined(P)&&a.is(P.range)&&D.string(P.message)&&(D.number(P.severity)||D.undefined(P.severity))&&(D.integer(P.code)||D.string(P.code)||D.undefined(P.code))&&(D.undefined(P.codeDescription)||D.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(P.source)||D.undefined(P.source))&&(D.undefined(P.relatedInformation)||D.typedArray(P.relatedInformation,b.is))}h.is=E})(T||(e.Diagnostic=T={}));var N;(function(h){function k(m,f){for(var P=[],x=2;x<arguments.length;x++)P[x-2]=arguments[x];var ee={title:m,command:f};return D.defined(P)&&P.length>0&&(ee.arguments=P),ee}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=E})(N||(e.Command=N={}));var L;(function(h){function k(P,x){return{range:P,newText:x}}h.replace=k;function E(P,x){return{range:{start:P,end:P},newText:x}}h.insert=E;function m(P){return{range:P,newText:""}}h.del=m;function f(P){var x=P;return D.objectLiteral(x)&&D.string(x.newText)&&a.is(x.range)}h.is=f})(L||(e.TextEdit=L={}));var q;(function(h){function k(m,f,P){var x={label:m};return f!==void 0&&(x.needsConfirmation=f),P!==void 0&&(x.description=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=E})(q||(e.ChangeAnnotation=q={}));var H;(function(h){function k(E){var m=E;return D.string(m)}h.is=k})(H||(e.ChangeAnnotationIdentifier=H={}));var j;(function(h){function k(P,x,ee){return{range:P,newText:x,annotationId:ee}}h.replace=k;function E(P,x,ee){return{range:{start:P,end:P},newText:x,annotationId:ee}}h.insert=E;function m(P,x){return{range:P,newText:"",annotationId:x}}h.del=m;function f(P){var x=P;return L.is(x)&&(q.is(x.annotationId)||H.is(x.annotationId))}h.is=f})(j||(e.AnnotatedTextEdit=j={}));var ie;(function(h){function k(m,f){return{textDocument:m,edits:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&Ri.is(f.textDocument)&&Array.isArray(f.edits)}h.is=E})(ie||(e.TextDocumentEdit=ie={}));var Be;(function(h){function k(m,f,P){var x={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Be||(e.CreateFile=Be={}));var Et;(function(h){function k(m,f,P,x){var ee={kind:"rename",oldUri:m,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ee.options=P),x!==void 0&&(ee.annotationId=x),ee}h.create=k;function E(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Et||(e.RenameFile=Et={}));var ce;(function(h){function k(m,f,P){var x={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(ce||(e.DeleteFile=ce={}));var On;(function(h){function k(E){var m=E;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?Be.is(f)||Et.is(f)||ce.is(f):ie.is(f)}))}h.is=k})(On||(e.WorkspaceEdit=On={}));var Ji=function(){function h(k,E){this.edits=k,this.changeAnnotations=E}return h.prototype.insert=function(k,E,m){var f,P;if(m===void 0?f=L.insert(k,E):H.is(m)?(P=m,f=j.insert(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.insert(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.replace=function(k,E,m){var f,P;if(m===void 0?f=L.replace(k,E):H.is(m)?(P=m,f=j.replace(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.replace(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.delete=function(k,E){var m,f;if(E===void 0?m=L.del(k):H.is(E)?(f=E,m=j.del(k,E)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(E),m=j.del(k,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(k){this.edits.push(k)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(k){if(k===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),Po=function(){function h(k){this._annotations=k===void 0?Object.create(null):k,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(k,E){var m;if(H.is(k)?m=k:(m=this.nextId(),E=k),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=E,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),su=function(){function h(k){var E=this;this._textEditChanges=Object.create(null),k!==void 0?(this._workspaceEdit=k,k.documentChanges?(this._changeAnnotations=new Po(k.changeAnnotations),k.changeAnnotations=this._changeAnnotations.all(),k.documentChanges.forEach(function(m){if(ie.is(m)){var f=new Ji(m.edits,E._changeAnnotations);E._textEditChanges[m.textDocument.uri]=f}})):k.changes&&Object.keys(k.changes).forEach(function(m){var f=new Ji(k.changes[m]);E._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(k){if(Ri.is(k)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:k.uri,version:k.version},m=this._textEditChanges[E.uri];if(!m){var f=[],P={textDocument:E,edits:f};this._workspaceEdit.documentChanges.push(P),m=new Ji(f,this._changeAnnotations),this._textEditChanges[E.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[k];if(!m){var f=[];this._workspaceEdit.changes[k]=f,m=new Ji(f),this._textEditChanges[k]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Po,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=Be.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=Be.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h.prototype.renameFile=function(k,E,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;q.is(m)||H.is(m)?P=m:f=m;var x,ee;if(P===void 0?x=Et.create(k,E,f):(ee=H.is(P)?P:this._changeAnnotations.manage(P),x=Et.create(k,E,f,ee)),this._workspaceEdit.documentChanges.push(x),ee!==void 0)return ee},h.prototype.deleteFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=ce.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=ce.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h}();e.WorkspaceChange=su;var Do;(function(h){function k(m){return{uri:m}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=E})(Do||(e.TextDocumentIdentifier=Do={}));var rs;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=E})(rs||(e.VersionedTextDocumentIdentifier=rs={}));var Ri;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=E})(Ri||(e.OptionalVersionedTextDocumentIdentifier=Ri={}));var An;(function(h){function k(m,f,P,x){return{uri:m,languageId:f,version:P,text:x}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=E})(An||(e.TextDocumentItem=An={}));var Zi;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function k(E){var m=E;return m===h.PlainText||m===h.Markdown}h.is=k})(Zi||(e.MarkupKind=Zi={}));var Ci;(function(h){function k(E){var m=E;return D.objectLiteral(E)&&Zi.is(m.kind)&&D.string(m.value)}h.is=k})(Ci||(e.MarkupContent=Ci={}));var Ro;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Ro||(e.CompletionItemKind=Ro={}));var ss;(function(h){h.PlainText=1,h.Snippet=2})(ss||(e.InsertTextFormat=ss={}));var os;(function(h){h.Deprecated=1})(os||(e.CompletionItemTag=os={}));var Co;(function(h){function k(m,f,P){return{newText:m,insert:f,replace:P}}h.create=k;function E(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=E})(Co||(e.InsertReplaceEdit=Co={}));var Oo;(function(h){h.asIs=1,h.adjustIndentation=2})(Oo||(e.InsertTextMode=Oo={}));var Ao;(function(h){function k(E){var m=E;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=k})(Ao||(e.CompletionItemLabelDetails=Ao={}));var Io;(function(h){function k(E){return{label:E}}h.create=k})(Io||(e.CompletionItem=Io={}));var Lo;(function(h){function k(E,m){return{items:E||[],isIncomplete:!!m}}h.create=k})(Lo||(e.CompletionList=Lo={}));var er;(function(h){function k(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=k;function E(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=E})(er||(e.MarkedString=er={}));var Jt;(function(h){function k(E){var m=E;return!!m&&D.objectLiteral(m)&&(Ci.is(m.contents)||er.is(m.contents)||D.typedArray(m.contents,er.is))&&(E.range===void 0||a.is(E.range))}h.is=k})(Jt||(e.Hover=Jt={}));var xo;(function(h){function k(E,m){return m?{label:E,documentation:m}:{label:E}}h.create=k})(xo||(e.ParameterInformation=xo={}));var Mo;(function(h){function k(E,m){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var x={label:E};return D.defined(m)&&(x.documentation=m),D.defined(f)?x.parameters=f:x.parameters=[],x}h.create=k})(Mo||(e.SignatureInformation=Mo={}));var Oi;(function(h){h.Text=1,h.Read=2,h.Write=3})(Oi||(e.DocumentHighlightKind=Oi={}));var qo;(function(h){function k(E,m){var f={range:E};return D.number(m)&&(f.kind=m),f}h.create=k})(qo||(e.DocumentHighlight=qo={}));var tr;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(tr||(e.SymbolKind=tr={}));var Fo;(function(h){h.Deprecated=1})(Fo||(e.SymbolTag=Fo={}));var In;(function(h){function k(E,m,f,P,x){var ee={name:E,kind:m,location:{uri:P,range:f}};return x&&(ee.containerName=x),ee}h.create=k})(In||(e.SymbolInformation=In={}));var Hn;(function(h){function k(E,m,f,P){return P!==void 0?{name:E,kind:m,location:{uri:f,range:P}}:{name:E,kind:m,location:{uri:f}}}h.create=k})(Hn||(e.WorkspaceSymbol=Hn={}));var Bo;(function(h){function k(m,f,P,x,ee,Ue){var we={name:m,detail:f,kind:P,range:x,selectionRange:ee};return Ue!==void 0&&(we.children=Ue),we}h.create=k;function E(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=E})(Bo||(e.DocumentSymbol=Bo={}));var jo;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(jo||(e.CodeActionKind=jo={}));var pn;(function(h){h.Invoked=1,h.Automatic=2})(pn||(e.CodeActionTriggerKind=pn={}));var as;(function(h){function k(m,f,P){var x={diagnostics:m};return f!=null&&(x.only=f),P!=null&&(x.triggerKind=P),x}h.create=k;function E(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,T.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===pn.Invoked||f.triggerKind===pn.Automatic)}h.is=E})(as||(e.CodeActionContext=as={}));var cs;(function(h){function k(m,f,P){var x={title:m},ee=!0;return typeof f=="string"?(ee=!1,x.kind=f):N.is(f)?x.command=f:x.edit=f,ee&&P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||N.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||On.is(f.edit))}h.is=E})(cs||(e.CodeAction=cs={}));var nr;(function(h){function k(m,f){var P={range:m};return D.defined(f)&&(P.data=f),P}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||N.is(f.command))}h.is=E})(nr||(e.CodeLens=nr={}));var ls;(function(h){function k(m,f){return{tabSize:m,insertSpaces:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=E})(ls||(e.FormattingOptions=ls={}));var Ln;(function(h){function k(m,f,P){return{range:m,target:f,data:P}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=E})(Ln||(e.DocumentLink=Ln={}));var S;(function(h){function k(m,f){return{range:m,parent:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=E})(S||(e.SelectionRange=S={}));var I;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var W;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=k})(W||(e.SemanticTokens=W={}));var Se;(function(h){function k(m,f){return{range:m,text:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=E})(Se||(e.InlineValueText=Se={}));var me;(function(h){function k(m,f,P){return{range:m,variableName:f,caseSensitiveLookup:P}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=E})(me||(e.InlineValueVariableLookup=me={}));var Ce;(function(h){function k(m,f){return{range:m,expression:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=E})(Ce||(e.InlineValueEvaluatableExpression=Ce={}));var Le;(function(h){function k(m,f){return{frameId:m,stoppedLocation:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=E})(Le||(e.InlineValueContext=Le={}));var se;(function(h){h.Type=1,h.Parameter=2;function k(E){return E===1||E===2}h.is=k})(se||(e.InlayHintKind=se={}));var ke;(function(h){function k(m){return{value:m}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Ci.is(f.tooltip))&&(f.location===void 0||c.is(f.location))&&(f.command===void 0||N.is(f.command))}h.is=E})(ke||(e.InlayHintLabelPart=ke={}));var ue;(function(h){function k(m,f,P){var x={position:m,label:f};return P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,ke.is))&&(f.kind===void 0||se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Ci.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=E})(ue||(e.InlayHint=ue={}));var je;(function(h){function k(E){return{kind:"snippet",value:E}}h.createSnippet=k})(je||(e.StringValue=je={}));var nt;(function(h){function k(E,m,f,P){return{insertText:E,filterText:m,range:f,command:P}}h.create=k})(nt||(e.InlineCompletionItem=nt={}));var Lt;(function(h){function k(E){return{items:E}}h.create=k})(Lt||(e.InlineCompletionList=Lt={}));var Uo;(function(h){h.Invoked=0,h.Automatic=1})(Uo||(e.InlineCompletionTriggerKind=Uo={}));var kp;(function(h){function k(E,m){return{range:E,text:m}}h.create=k})(kp||(e.SelectedCompletionInfo=kp={}));var Ep;(function(h){function k(E,m){return{triggerKind:E,selectedCompletionInfo:m}}h.create=k})(Ep||(e.InlineCompletionContext=Ep={}));var wp;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&i.is(m.uri)&&D.string(m.name)}h.is=k})(wp||(e.WorkspaceFolder=wp={})),e.EOL=[`
|
|
32
|
+
`)),I){let W=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";L.log(`Received response '${I.method} - (${S.id})' in ${Date.now()-I.timerStart}ms.${W}`,B)}else L.log(`Received response ${S.id} without active response promise.`,B)}else In("receive-response",S)}function In(S,I){if(!L||T===me.Off)return;let B={isLSPMessage:!0,type:S,message:I,timestamp:Date.now()};L.log(B)}function Hn(){if(Ci())throw new fr(ms.Closed,"Connection is closed.");if(An())throw new fr(ms.Disposed,"Connection is disposed.")}function Bo(){if(ss())throw new fr(ms.AlreadyListening,"Connection is already listening")}function jo(){if(!ss())throw new Error("Call listen() first.")}function pn(S){return S===void 0?null:S}function cs(S){if(S!==null)return S}function ls(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function ir(S,I){switch(S){case X.ParameterStructures.auto:return ls(I)?cs(I):[pn(I)];case X.ParameterStructures.byName:if(!ls(I))throw new Error("Received parameters by name but param is not an object literal.");return cs(I);case X.ParameterStructures.byPosition:return[pn(I)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function us(S,I){let B,W=S.numberOfParams;switch(W){case 0:B=void 0;break;case 1:B=ir(S.parameterStructures,I[0]);break;default:B=[];for(let ke=0;ke<I.length&&ke<W;ke++)B.push(pn(I[ke]));if(I.length<W)for(let ke=I.length;ke<W;ke++)B.push(null);break}return B}let Ln={sendNotification:(S,...I)=>{Hn();let B,W;if(qe.string(S)){B=S;let ge=I[0],Ce=0,Le=X.ParameterStructures.auto;X.ParameterStructures.is(ge)&&(Ce=1,Le=ge);let se=I.length,Ee=se-Ce;switch(Ee){case 0:W=void 0;break;case 1:W=ir(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${Ee} parameters for 'by Name' notification parameter structure.`);W=I.slice(Ce,se).map(fe=>pn(fe));break}}else{let ge=I;B=S.method,W=us(S,ge)}let ke={jsonrpc:c,method:B,params:W};return Mo(ke),e.write(ke).catch(ge=>{throw r.error("Sending notification failed."),ge})},onNotification:(S,I)=>{Hn();let B;return qe.func(S)?d=S:I&&(qe.string(S)?(B=S,p.set(S,{type:void 0,handler:I})):(B=S.method,p.set(S.method,{type:S,handler:I}))),{dispose:()=>{B!==void 0?p.delete(B):d=void 0}}},onProgress:(S,I,B)=>{if(g.has(I))throw new Error(`Progress handler for token ${I} already registered`);return g.set(I,B),{dispose:()=>{g.delete(I)}}},sendProgress:(S,I,B)=>Ln.sendNotification(ps.type,{token:I,value:B}),onUnhandledProgress:Be.event,sendRequest:(S,...I)=>{Hn(),jo();let B,W,ke;if(qe.string(S)){B=S;let se=I[0],Ee=I[I.length-1],fe=0,je=X.ParameterStructures.auto;X.ParameterStructures.is(se)&&(fe=1,je=se);let nt=I.length;Ju.CancellationToken.is(Ee)&&(nt=nt-1,ke=Ee);let Lt=nt-fe;switch(Lt){case 0:W=void 0;break;case 1:W=ir(je,I[fe]);break;default:if(je===X.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);W=I.slice(fe,nt).map(Uo=>pn(Uo));break}}else{let se=I;B=S.method,W=us(S,se);let Ee=S.numberOfParams;ke=Ju.CancellationToken.is(se[Ee])?se[Ee]:void 0}let ge=s++,Ce;ke&&(Ce=ke.onCancellationRequested(()=>{let se=ce.sender.sendCancellation(Ln,ge);return se===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${ge}`),Promise.resolve()):se.catch(()=>{r.log(`Sending cancellation messages for id ${ge} failed`)})}));let Le={jsonrpc:c,id:ge,method:B,params:W};return xo(Le),typeof ce.sender.enableCancellation=="function"&&ce.sender.enableCancellation(Le),new Promise(async(se,Ee)=>{let fe=Lt=>{se(Lt),ce.sender.cleanup(ge),Ce?.dispose()},je=Lt=>{Ee(Lt),ce.sender.cleanup(ge),Ce?.dispose()},nt={method:B,timerStart:Date.now(),resolve:fe,reject:je};try{await e.write(Le),w.set(ge,nt)}catch(Lt){throw r.error("Sending request failed."),nt.reject(new X.ResponseError(X.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(S,I)=>{Hn();let B=null;return tf.is(S)?(B=void 0,l=S):qe.string(S)?(B=null,I!==void 0&&(B=S,u.set(S,{handler:I,type:void 0}))):I!==void 0&&(B=S.method,u.set(S.method,{type:S,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>w.size>0,trace:async(S,I,B)=>{let W=!1,ke=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,ke=B.traceFormat||xt.Text)),T=S,N=ke,T===me.Off?L=void 0:L=I,W&&!Ci()&&!An()&&await Ln.sendNotification(nf.type,{value:me.toString(S)})},onError:H.event,onClose:j.event,onUnhandledNotification:ie.event,onDispose:Et.event,end:()=>{e.end()},dispose:()=>{if(An())return;q=tn.Disposed,Et.fire(void 0);let S=new X.ResponseError(X.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of w.values())I.reject(S);w=new Map,v=new Map,R=new Set,b=new zp.LinkedMap,qe.func(e.dispose)&&e.dispose(),qe.func(n.dispose)&&n.dispose()},listen:()=>{Hn(),Bo(),q=tn.Listening,n.listen(Oo)},inspect:()=>{(0,Kp.default)().console.log("inspect")}};return Ln.onNotification(ea.type,S=>{if(T===me.Off||!L)return;let I=T===me.Verbose||T===me.Compact;L.log(S.message,I?S.verbose:void 0)}),Ln.onNotification(ps.type,S=>{let I=g.get(S.token);I?I(S.value):Be.fire(S)}),Ln}te.createMessageConnection=Qw});var oa=C(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var _e=Cu();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return _e.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return _e.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return _e.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return _e.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return _e.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return _e.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return _e.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return _e.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return _e.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return _e.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return _e.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return _e.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return _e.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return _e.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return _e.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return _e.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return _e.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return _e.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return _e.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return _e.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return _e.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return _e.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return _e.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return _e.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return _e.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return _e.ParameterStructures}});var of=Au();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return of.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return of.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return of.Touch}});var Jw=Mp();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return Jw.Disposable}});var Jp=ar();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return Jp.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return Jp.Emitter}});var Zp=Go();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return Zp.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return Zp.CancellationToken}});var em=Fp();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return em.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return em.SharedArrayReceiverStrategy}});var af=jp();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return af.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return af.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return af.ReadableStreamMessageReader}});var cf=Hp();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return cf.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return cf.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return cf.WriteableStreamMessageWriter}});var Zw=Yp();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Zw.AbstractMessageBuffer}});var ut=Qp();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return ut.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return ut.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return ut.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return ut.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return ut.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return ut.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return ut.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return ut.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return ut.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return ut.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return ut.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return ut.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return ut.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ut.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ut.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return ut.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return ut.MessageStrategy}});var eN=Kn();O.RAL=eN.default});var im=C(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var tm=require("util"),Mn=oa(),aa=class n extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new tm.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};aa.emptyBuffer=Buffer.allocUnsafe(0);var lf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},uf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let s=o=>{o==null?i():r(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},nm=Object.freeze({messageBuffer:Object.freeze({create:n=>new aa(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new tm.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new lf(n),asWritableStream:n=>new uf(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function ff(){return nm}(function(n){function e(){Mn.RAL.install(nm)}n.install=e})(ff||(ff={}));df.default=ff});var Mi=C(ae=>{"use strict";var tN=ae&&ae.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),nN=ae&&ae.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tN(e,n,t)};Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.createServerSocketTransport=ae.createClientSocketTransport=ae.createServerPipeTransport=ae.createClientPipeTransport=ae.generateRandomPipeName=ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;var dr=im();dr.default.install();var rm=require("path"),iN=require("os"),rN=require("crypto"),ua=require("net"),Mt=oa();nN(oa(),ae);var hf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mt.Disposable.create(()=>this.process.off("message",e))}};ae.IPCMessageReader=hf;var pf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.IPCMessageWriter=pf;var mf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.onData=new Mt.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ae.PortMessageReader=mf;var gf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.PortMessageWriter=gf;var Li=class extends Mt.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,dr.default)().stream.asReadableStream(e),t)}};ae.SocketMessageReader=Li;var xi=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,dr.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=xi;var ca=class extends Mt.ReadableStreamMessageReader{constructor(e,t){super((0,dr.default)().stream.asReadableStream(e),t)}};ae.StreamMessageReader=ca;var la=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,dr.default)().stream.asWritableStream(e),t)}};ae.StreamMessageWriter=la;var sm=process.env.XDG_RUNTIME_DIR,sN=new Map([["linux",107],["darwin",103]]);function oN(){let n=(0,rN.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;sm?e=rm.join(sm,`vscode-ipc-${n}.sock`):e=rm.join(iN.tmpdir(),`vscode-${n}.sock`);let t=sN.get(process.platform);return t!==void 0&&e.length>t&&(0,dr.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ae.generateRandomPipeName=oN;function aN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientPipeTransport=aN;function cN(n,e="utf-8"){let t=(0,ua.createConnection)(n);return[new Li(t,e),new xi(t,e)]}ae.createServerPipeTransport=cN;function lN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientSocketTransport=lN;function uN(n,e="utf-8"){let t=(0,ua.createConnection)(n,"127.0.0.1");return[new Li(t,e),new xi(t,e)]}ae.createServerSocketTransport=uN;function fN(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function dN(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function hN(n,e,t,i){t||(t=Mt.NullLogger);let r=fN(n)?new ca(n):n,s=dN(e)?new la(e):e;return Mt.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Mt.createMessageConnection)(r,s,t,i)}ae.createMessageConnection=hN});var yf=C((qA,om)=>{"use strict";om.exports=Mi()});var da=C((am,fa)=>{(function(n){if(typeof fa=="object"&&typeof fa.exports=="object"){var e=n(require,am);e!==void 0&&(fa.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(h){function k(E){return typeof E=="string"}h.is=k})(t||(e.DocumentUri=t={}));var i;(function(h){function k(E){return typeof E=="string"}h.is=k})(i||(e.URI=i={}));var r;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(r||(e.integer=r={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(s||(e.uinteger=s={}));var o;(function(h){function k(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=E})(o||(e.Position=o={}));var a;(function(h){function k(m,f,P,x){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(P)&&D.uinteger(x))return{start:o.create(m,f),end:o.create(P,x)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(P,", ").concat(x,"]"))}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=E})(a||(e.Range=a={}));var c;(function(h){function k(m,f){return{uri:m,range:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=E})(c||(e.Location=c={}));var l;(function(h){function k(m,f,P,x){return{targetUri:m,targetRange:f,targetSelectionRange:P,originSelectionRange:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=E})(l||(e.LocationLink=l={}));var u;(function(h){function k(m,f,P,x){return{red:m,green:f,blue:P,alpha:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=E})(u||(e.Color=u={}));var d;(function(h){function k(m,f){return{range:m,color:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&u.is(f.color)}h.is=E})(d||(e.ColorInformation=d={}));var p;(function(h){function k(m,f,P){return{label:m,textEdit:f,additionalTextEdits:P}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||L.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,L.is))}h.is=E})(p||(e.ColorPresentation=p={}));var g;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(h){function k(m,f,P,x,ee,Ue){var Ne={startLine:m,endLine:f};return D.defined(P)&&(Ne.startCharacter=P),D.defined(x)&&(Ne.endCharacter=x),D.defined(ee)&&(Ne.kind=ee),D.defined(Ue)&&(Ne.collapsedText=Ue),Ne}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=E})(_||(e.FoldingRange=_={}));var b;(function(h){function k(m,f){return{location:m,message:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&c.is(f.location)&&D.string(f.message)}h.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var w;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(w||(e.DiagnosticSeverity=w={}));var R;(function(h){h.Unnecessary=1,h.Deprecated=2})(R||(e.DiagnosticTag=R={}));var v;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&D.string(m.href)}h.is=k})(v||(e.CodeDescription=v={}));var T;(function(h){function k(m,f,P,x,ee,Ue){var Ne={range:m,message:f};return D.defined(P)&&(Ne.severity=P),D.defined(x)&&(Ne.code=x),D.defined(ee)&&(Ne.source=ee),D.defined(Ue)&&(Ne.relatedInformation=Ue),Ne}h.create=k;function E(m){var f,P=m;return D.defined(P)&&a.is(P.range)&&D.string(P.message)&&(D.number(P.severity)||D.undefined(P.severity))&&(D.integer(P.code)||D.string(P.code)||D.undefined(P.code))&&(D.undefined(P.codeDescription)||D.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(P.source)||D.undefined(P.source))&&(D.undefined(P.relatedInformation)||D.typedArray(P.relatedInformation,b.is))}h.is=E})(T||(e.Diagnostic=T={}));var N;(function(h){function k(m,f){for(var P=[],x=2;x<arguments.length;x++)P[x-2]=arguments[x];var ee={title:m,command:f};return D.defined(P)&&P.length>0&&(ee.arguments=P),ee}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=E})(N||(e.Command=N={}));var L;(function(h){function k(P,x){return{range:P,newText:x}}h.replace=k;function E(P,x){return{range:{start:P,end:P},newText:x}}h.insert=E;function m(P){return{range:P,newText:""}}h.del=m;function f(P){var x=P;return D.objectLiteral(x)&&D.string(x.newText)&&a.is(x.range)}h.is=f})(L||(e.TextEdit=L={}));var q;(function(h){function k(m,f,P){var x={label:m};return f!==void 0&&(x.needsConfirmation=f),P!==void 0&&(x.description=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=E})(q||(e.ChangeAnnotation=q={}));var H;(function(h){function k(E){var m=E;return D.string(m)}h.is=k})(H||(e.ChangeAnnotationIdentifier=H={}));var j;(function(h){function k(P,x,ee){return{range:P,newText:x,annotationId:ee}}h.replace=k;function E(P,x,ee){return{range:{start:P,end:P},newText:x,annotationId:ee}}h.insert=E;function m(P,x){return{range:P,newText:"",annotationId:x}}h.del=m;function f(P){var x=P;return L.is(x)&&(q.is(x.annotationId)||H.is(x.annotationId))}h.is=f})(j||(e.AnnotatedTextEdit=j={}));var ie;(function(h){function k(m,f){return{textDocument:m,edits:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&Ci.is(f.textDocument)&&Array.isArray(f.edits)}h.is=E})(ie||(e.TextDocumentEdit=ie={}));var Be;(function(h){function k(m,f,P){var x={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Be||(e.CreateFile=Be={}));var Et;(function(h){function k(m,f,P,x){var ee={kind:"rename",oldUri:m,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ee.options=P),x!==void 0&&(ee.annotationId=x),ee}h.create=k;function E(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Et||(e.RenameFile=Et={}));var ce;(function(h){function k(m,f,P){var x={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(ce||(e.DeleteFile=ce={}));var On;(function(h){function k(E){var m=E;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?Be.is(f)||Et.is(f)||ce.is(f):ie.is(f)}))}h.is=k})(On||(e.WorkspaceEdit=On={}));var Zi=function(){function h(k,E){this.edits=k,this.changeAnnotations=E}return h.prototype.insert=function(k,E,m){var f,P;if(m===void 0?f=L.insert(k,E):H.is(m)?(P=m,f=j.insert(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.insert(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.replace=function(k,E,m){var f,P;if(m===void 0?f=L.replace(k,E):H.is(m)?(P=m,f=j.replace(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.replace(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.delete=function(k,E){var m,f;if(E===void 0?m=L.del(k):H.is(E)?(f=E,m=j.del(k,E)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(E),m=j.del(k,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(k){this.edits.push(k)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(k){if(k===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),Po=function(){function h(k){this._annotations=k===void 0?Object.create(null):k,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(k,E){var m;if(H.is(k)?m=k:(m=this.nextId(),E=k),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=E,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),su=function(){function h(k){var E=this;this._textEditChanges=Object.create(null),k!==void 0?(this._workspaceEdit=k,k.documentChanges?(this._changeAnnotations=new Po(k.changeAnnotations),k.changeAnnotations=this._changeAnnotations.all(),k.documentChanges.forEach(function(m){if(ie.is(m)){var f=new Zi(m.edits,E._changeAnnotations);E._textEditChanges[m.textDocument.uri]=f}})):k.changes&&Object.keys(k.changes).forEach(function(m){var f=new Zi(k.changes[m]);E._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(k){if(Ci.is(k)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:k.uri,version:k.version},m=this._textEditChanges[E.uri];if(!m){var f=[],P={textDocument:E,edits:f};this._workspaceEdit.documentChanges.push(P),m=new Zi(f,this._changeAnnotations),this._textEditChanges[E.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[k];if(!m){var f=[];this._workspaceEdit.changes[k]=f,m=new Zi(f),this._textEditChanges[k]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Po,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=Be.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=Be.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h.prototype.renameFile=function(k,E,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;q.is(m)||H.is(m)?P=m:f=m;var x,ee;if(P===void 0?x=Et.create(k,E,f):(ee=H.is(P)?P:this._changeAnnotations.manage(P),x=Et.create(k,E,f,ee)),this._workspaceEdit.documentChanges.push(x),ee!==void 0)return ee},h.prototype.deleteFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=ce.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=ce.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h}();e.WorkspaceChange=su;var Do;(function(h){function k(m){return{uri:m}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=E})(Do||(e.TextDocumentIdentifier=Do={}));var ss;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=E})(ss||(e.VersionedTextDocumentIdentifier=ss={}));var Ci;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=E})(Ci||(e.OptionalVersionedTextDocumentIdentifier=Ci={}));var An;(function(h){function k(m,f,P,x){return{uri:m,languageId:f,version:P,text:x}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=E})(An||(e.TextDocumentItem=An={}));var er;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function k(E){var m=E;return m===h.PlainText||m===h.Markdown}h.is=k})(er||(e.MarkupKind=er={}));var Oi;(function(h){function k(E){var m=E;return D.objectLiteral(E)&&er.is(m.kind)&&D.string(m.value)}h.is=k})(Oi||(e.MarkupContent=Oi={}));var Ro;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Ro||(e.CompletionItemKind=Ro={}));var os;(function(h){h.PlainText=1,h.Snippet=2})(os||(e.InsertTextFormat=os={}));var as;(function(h){h.Deprecated=1})(as||(e.CompletionItemTag=as={}));var Co;(function(h){function k(m,f,P){return{newText:m,insert:f,replace:P}}h.create=k;function E(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=E})(Co||(e.InsertReplaceEdit=Co={}));var Oo;(function(h){h.asIs=1,h.adjustIndentation=2})(Oo||(e.InsertTextMode=Oo={}));var Ao;(function(h){function k(E){var m=E;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=k})(Ao||(e.CompletionItemLabelDetails=Ao={}));var Io;(function(h){function k(E){return{label:E}}h.create=k})(Io||(e.CompletionItem=Io={}));var Lo;(function(h){function k(E,m){return{items:E||[],isIncomplete:!!m}}h.create=k})(Lo||(e.CompletionList=Lo={}));var tr;(function(h){function k(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=k;function E(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=E})(tr||(e.MarkedString=tr={}));var Jt;(function(h){function k(E){var m=E;return!!m&&D.objectLiteral(m)&&(Oi.is(m.contents)||tr.is(m.contents)||D.typedArray(m.contents,tr.is))&&(E.range===void 0||a.is(E.range))}h.is=k})(Jt||(e.Hover=Jt={}));var xo;(function(h){function k(E,m){return m?{label:E,documentation:m}:{label:E}}h.create=k})(xo||(e.ParameterInformation=xo={}));var Mo;(function(h){function k(E,m){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var x={label:E};return D.defined(m)&&(x.documentation=m),D.defined(f)?x.parameters=f:x.parameters=[],x}h.create=k})(Mo||(e.SignatureInformation=Mo={}));var Ai;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ai||(e.DocumentHighlightKind=Ai={}));var qo;(function(h){function k(E,m){var f={range:E};return D.number(m)&&(f.kind=m),f}h.create=k})(qo||(e.DocumentHighlight=qo={}));var nr;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(nr||(e.SymbolKind=nr={}));var Fo;(function(h){h.Deprecated=1})(Fo||(e.SymbolTag=Fo={}));var In;(function(h){function k(E,m,f,P,x){var ee={name:E,kind:m,location:{uri:P,range:f}};return x&&(ee.containerName=x),ee}h.create=k})(In||(e.SymbolInformation=In={}));var Hn;(function(h){function k(E,m,f,P){return P!==void 0?{name:E,kind:m,location:{uri:f,range:P}}:{name:E,kind:m,location:{uri:f}}}h.create=k})(Hn||(e.WorkspaceSymbol=Hn={}));var Bo;(function(h){function k(m,f,P,x,ee,Ue){var Ne={name:m,detail:f,kind:P,range:x,selectionRange:ee};return Ue!==void 0&&(Ne.children=Ue),Ne}h.create=k;function E(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=E})(Bo||(e.DocumentSymbol=Bo={}));var jo;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(jo||(e.CodeActionKind=jo={}));var pn;(function(h){h.Invoked=1,h.Automatic=2})(pn||(e.CodeActionTriggerKind=pn={}));var cs;(function(h){function k(m,f,P){var x={diagnostics:m};return f!=null&&(x.only=f),P!=null&&(x.triggerKind=P),x}h.create=k;function E(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,T.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===pn.Invoked||f.triggerKind===pn.Automatic)}h.is=E})(cs||(e.CodeActionContext=cs={}));var ls;(function(h){function k(m,f,P){var x={title:m},ee=!0;return typeof f=="string"?(ee=!1,x.kind=f):N.is(f)?x.command=f:x.edit=f,ee&&P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||N.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||On.is(f.edit))}h.is=E})(ls||(e.CodeAction=ls={}));var ir;(function(h){function k(m,f){var P={range:m};return D.defined(f)&&(P.data=f),P}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||N.is(f.command))}h.is=E})(ir||(e.CodeLens=ir={}));var us;(function(h){function k(m,f){return{tabSize:m,insertSpaces:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=E})(us||(e.FormattingOptions=us={}));var Ln;(function(h){function k(m,f,P){return{range:m,target:f,data:P}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=E})(Ln||(e.DocumentLink=Ln={}));var S;(function(h){function k(m,f){return{range:m,parent:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=E})(S||(e.SelectionRange=S={}));var I;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var W;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=k})(W||(e.SemanticTokens=W={}));var ke;(function(h){function k(m,f){return{range:m,text:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=E})(ke||(e.InlineValueText=ke={}));var ge;(function(h){function k(m,f,P){return{range:m,variableName:f,caseSensitiveLookup:P}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=E})(ge||(e.InlineValueVariableLookup=ge={}));var Ce;(function(h){function k(m,f){return{range:m,expression:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=E})(Ce||(e.InlineValueEvaluatableExpression=Ce={}));var Le;(function(h){function k(m,f){return{frameId:m,stoppedLocation:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=E})(Le||(e.InlineValueContext=Le={}));var se;(function(h){h.Type=1,h.Parameter=2;function k(E){return E===1||E===2}h.is=k})(se||(e.InlayHintKind=se={}));var Ee;(function(h){function k(m){return{value:m}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.location===void 0||c.is(f.location))&&(f.command===void 0||N.is(f.command))}h.is=E})(Ee||(e.InlayHintLabelPart=Ee={}));var fe;(function(h){function k(m,f,P){var x={position:m,label:f};return P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,Ee.is))&&(f.kind===void 0||se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=E})(fe||(e.InlayHint=fe={}));var je;(function(h){function k(E){return{kind:"snippet",value:E}}h.createSnippet=k})(je||(e.StringValue=je={}));var nt;(function(h){function k(E,m,f,P){return{insertText:E,filterText:m,range:f,command:P}}h.create=k})(nt||(e.InlineCompletionItem=nt={}));var Lt;(function(h){function k(E){return{items:E}}h.create=k})(Lt||(e.InlineCompletionList=Lt={}));var Uo;(function(h){h.Invoked=0,h.Automatic=1})(Uo||(e.InlineCompletionTriggerKind=Uo={}));var kp;(function(h){function k(E,m){return{range:E,text:m}}h.create=k})(kp||(e.SelectedCompletionInfo=kp={}));var Ep;(function(h){function k(E,m){return{triggerKind:E,selectedCompletionInfo:m}}h.create=k})(Ep||(e.InlineCompletionContext=Ep={}));var wp;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&i.is(m.uri)&&D.string(m.name)}h.is=k})(wp||(e.WorkspaceFolder=wp={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var Np;(function(h){function k(P,x,ee,Ue){return new
|
|
34
|
+
`,"\r"];var Np;(function(h){function k(P,x,ee,Ue){return new Sw(P,x,ee,Ue)}h.create=k;function E(P){var x=P;return!!(D.defined(x)&&D.string(x.uri)&&(D.undefined(x.languageId)||D.string(x.languageId))&&D.uinteger(x.lineCount)&&D.func(x.getText)&&D.func(x.positionAt)&&D.func(x.offsetAt))}h.is=E;function m(P,x){for(var ee=P.getText(),Ue=f(x,function(rr,$o){var _p=rr.range.start.line-$o.range.start.line;return _p===0?rr.range.start.character-$o.range.start.character:_p}),Ne=ee.length,Zt=Ue.length-1;Zt>=0;Zt--){var en=Ue[Zt],xn=P.offsetAt(en.range.start),oe=P.offsetAt(en.range.end);if(oe<=Ne)ee=ee.substring(0,xn)+en.newText+ee.substring(oe,ee.length);else throw new Error("Overlapping edit");Ne=xn}return ee}h.applyEdits=m;function f(P,x){if(P.length<=1)return P;var ee=P.length/2|0,Ue=P.slice(0,ee),Ne=P.slice(ee);f(Ue,x),f(Ne,x);for(var Zt=0,en=0,xn=0;Zt<Ue.length&&en<Ne.length;){var oe=x(Ue[Zt],Ne[en]);oe<=0?P[xn++]=Ue[Zt++]:P[xn++]=Ne[en++]}for(;Zt<Ue.length;)P[xn++]=Ue[Zt++];for(;en<Ne.length;)P[xn++]=Ne[en++];return P}})(Np||(e.TextDocument=Np={}));var Sw=function(){function h(k,E,m,f){this._uri=k,this._languageId=E,this._version=m,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(k){if(k){var E=this.offsetAt(k.start),m=this.offsetAt(k.end);return this._content.substring(E,m)}return this._content},h.prototype.update=function(k,E){this._content=k.text,this._version=E,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var k=[],E=this._content,m=!0,f=0;f<E.length;f++){m&&(k.push(f),m=!1);var P=E.charAt(f);m=P==="\r"||P===`
|
|
35
35
|
`,P==="\r"&&f+1<E.length&&E.charAt(f+1)===`
|
|
36
|
-
`&&f++}m&&E.length>0&&k.push(E.length),this._lineOffsets=k}return this._lineOffsets},h.prototype.positionAt=function(k){k=Math.max(Math.min(k,this._content.length),0);var E=this.getLineOffsets(),m=0,f=E.length;if(f===0)return o.create(0,k);for(;m<f;){var P=Math.floor((m+f)/2);E[P]>k?f=P:m=P+1}var x=m-1;return o.create(x,k-E[x])},h.prototype.offsetAt=function(k){var E=this.getLineOffsets();if(k.line>=E.length)return this._content.length;if(k.line<0)return 0;var m=E[k.line],f=k.line+1<E.length?E[k.line+1]:this._content.length;return Math.max(Math.min(m+k.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var k=Object.prototype.toString;function E(oe){return typeof oe<"u"}h.defined=E;function m(oe){return typeof oe>"u"}h.undefined=m;function f(oe){return oe===!0||oe===!1}h.boolean=f;function P(oe){return k.call(oe)==="[object String]"}h.string=P;function x(oe){return k.call(oe)==="[object Number]"}h.number=x;function ee(oe,ir,$o){return k.call(oe)==="[object Number]"&&ir<=oe&&oe<=$o}h.numberRange=ee;function Ue(oe){return k.call(oe)==="[object Number]"&&-2147483648<=oe&&oe<=2147483647}h.integer=Ue;function we(oe){return k.call(oe)==="[object Number]"&&0<=oe&&oe<=2147483647}h.uinteger=we;function Zt(oe){return k.call(oe)==="[object Function]"}h.func=Zt;function en(oe){return oe!==null&&typeof oe=="object"}h.objectLiteral=en;function xn(oe,ir){return Array.isArray(oe)&&oe.every(ir)}h.typedArray=xn})(D||(D={}))})});var xe=C(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var dr=xi(),cm;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(cm||(Dt.MessageDirection=cm={}));var bf=class{constructor(e){this.method=e}};Dt.RegistrationType=bf;var Tf=class extends dr.RequestType0{constructor(e){super(e)}};Dt.ProtocolRequestType0=Tf;var vf=class extends dr.RequestType{constructor(e){super(e,dr.ParameterStructures.byName)}};Dt.ProtocolRequestType=vf;var Sf=class extends dr.NotificationType0{constructor(e){super(e)}};Dt.ProtocolNotificationType0=Sf;var kf=class extends dr.NotificationType{constructor(e){super(e,dr.ParameterStructures.byName)}};Dt.ProtocolNotificationType=kf});var ha=C(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.objectLiteral=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function hN(n){return n===!0||n===!1}Ye.boolean=hN;function lm(n){return typeof n=="string"||n instanceof String}Ye.string=lm;function pN(n){return typeof n=="number"||n instanceof Number}Ye.number=pN;function mN(n){return n instanceof Error}Ye.error=mN;function gN(n){return typeof n=="function"}Ye.func=gN;function um(n){return Array.isArray(n)}Ye.array=um;function yN(n){return um(n)&&n.every(e=>lm(e))}Ye.stringArray=yN;function bN(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=bN;function TN(n){return n!==null&&typeof n=="object"}Ye.objectLiteral=TN});var hm=C(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ImplementationRequest=void 0;var fm=xe(),dm;(function(n){n.method="textDocument/implementation",n.messageDirection=fm.MessageDirection.clientToServer,n.type=new fm.ProtocolRequestType(n.method)})(dm||(pa.ImplementationRequest=dm={}))});var gm=C(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.TypeDefinitionRequest=void 0;var pm=xe(),mm;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=pm.MessageDirection.clientToServer,n.type=new pm.ProtocolRequestType(n.method)})(mm||(ma.TypeDefinitionRequest=mm={}))});var Tm=C(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.DidChangeWorkspaceFoldersNotification=hr.WorkspaceFoldersRequest=void 0;var ga=xe(),ym;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=ga.MessageDirection.serverToClient,n.type=new ga.ProtocolRequestType0(n.method)})(ym||(hr.WorkspaceFoldersRequest=ym={}));var bm;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=ga.MessageDirection.clientToServer,n.type=new ga.ProtocolNotificationType(n.method)})(bm||(hr.DidChangeWorkspaceFoldersNotification=bm={}))});var km=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ConfigurationRequest=void 0;var vm=xe(),Sm;(function(n){n.method="workspace/configuration",n.messageDirection=vm.MessageDirection.serverToClient,n.type=new vm.ProtocolRequestType(n.method)})(Sm||(ya.ConfigurationRequest=Sm={}))});var Nm=C(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ColorPresentationRequest=pr.DocumentColorRequest=void 0;var ba=xe(),Em;(function(n){n.method="textDocument/documentColor",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(Em||(pr.DocumentColorRequest=Em={}));var wm;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(wm||(pr.ColorPresentationRequest=wm={}))});var Dm=C(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.FoldingRangeRefreshRequest=mr.FoldingRangeRequest=void 0;var Ta=xe(),_m;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Ta.MessageDirection.clientToServer,n.type=new Ta.ProtocolRequestType(n.method)})(_m||(mr.FoldingRangeRequest=_m={}));var Pm;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Ta.MessageDirection.serverToClient,n.type=new Ta.ProtocolRequestType0(n.method)})(Pm||(mr.FoldingRangeRefreshRequest=Pm={}))});var Om=C(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.DeclarationRequest=void 0;var Rm=xe(),Cm;(function(n){n.method="textDocument/declaration",n.messageDirection=Rm.MessageDirection.clientToServer,n.type=new Rm.ProtocolRequestType(n.method)})(Cm||(va.DeclarationRequest=Cm={}))});var Lm=C(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.SelectionRangeRequest=void 0;var Am=xe(),Im;(function(n){n.method="textDocument/selectionRange",n.messageDirection=Am.MessageDirection.clientToServer,n.type=new Am.ProtocolRequestType(n.method)})(Im||(Sa.SelectionRangeRequest=Im={}))});var Fm=C(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WorkDoneProgressCancelNotification=Xn.WorkDoneProgressCreateRequest=Xn.WorkDoneProgress=void 0;var vN=xi(),ka=xe(),xm;(function(n){n.type=new vN.ProgressType;function e(t){return t===n.type}n.is=e})(xm||(Xn.WorkDoneProgress=xm={}));var Mm;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=ka.MessageDirection.serverToClient,n.type=new ka.ProtocolRequestType(n.method)})(Mm||(Xn.WorkDoneProgressCreateRequest=Mm={}));var qm;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=ka.MessageDirection.clientToServer,n.type=new ka.ProtocolNotificationType(n.method)})(qm||(Xn.WorkDoneProgressCancelNotification=qm={}))});var $m=C(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallHierarchyOutgoingCallsRequest=Qn.CallHierarchyIncomingCallsRequest=Qn.CallHierarchyPrepareRequest=void 0;var gr=xe(),Bm;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolRequestType(n.method)})(Bm||(Qn.CallHierarchyPrepareRequest=Bm={}));var jm;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolRequestType(n.method)})(jm||(Qn.CallHierarchyIncomingCallsRequest=jm={}));var Um;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=gr.MessageDirection.clientToServer,n.type=new gr.ProtocolRequestType(n.method)})(Um||(Qn.CallHierarchyOutgoingCallsRequest=Um={}))});var zm=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var qn=xe(),Wm;(function(n){n.Relative="relative"})(Wm||(Rt.TokenFormat=Wm={}));var gs;(function(n){n.method="textDocument/semanticTokens",n.type=new qn.RegistrationType(n.method)})(gs||(Rt.SemanticTokensRegistrationType=gs={}));var Vm;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=gs.method})(Vm||(Rt.SemanticTokensRequest=Vm={}));var Hm;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=gs.method})(Hm||(Rt.SemanticTokensDeltaRequest=Hm={}));var Ym;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=gs.method})(Ym||(Rt.SemanticTokensRangeRequest=Ym={}));var Km;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=qn.MessageDirection.serverToClient,n.type=new qn.ProtocolRequestType0(n.method)})(Km||(Rt.SemanticTokensRefreshRequest=Km={}))});var Qm=C(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.ShowDocumentRequest=void 0;var Gm=xe(),Xm;(function(n){n.method="window/showDocument",n.messageDirection=Gm.MessageDirection.serverToClient,n.type=new Gm.ProtocolRequestType(n.method)})(Xm||(Ea.ShowDocumentRequest=Xm={}))});var eg=C(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.LinkedEditingRangeRequest=void 0;var Jm=xe(),Zm;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=Jm.MessageDirection.clientToServer,n.type=new Jm.ProtocolRequestType(n.method)})(Zm||(wa.LinkedEditingRangeRequest=Zm={}))});var cg=C(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var Ut=xe(),tg;(function(n){n.file="file",n.folder="folder"})(tg||(yt.FileOperationPatternKind=tg={}));var ng;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ng||(yt.WillCreateFilesRequest=ng={}));var ig;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(ig||(yt.DidCreateFilesNotification=ig={}));var rg;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(rg||(yt.WillRenameFilesRequest=rg={}));var sg;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(sg||(yt.DidRenameFilesNotification=sg={}));var og;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(og||(yt.DidDeleteFilesNotification=og={}));var ag;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ag||(yt.WillDeleteFilesRequest=ag={}))});var hg=C(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.MonikerRequest=Jn.MonikerKind=Jn.UniquenessLevel=void 0;var lg=xe(),ug;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(ug||(Jn.UniquenessLevel=ug={}));var fg;(function(n){n.$import="import",n.$export="export",n.local="local"})(fg||(Jn.MonikerKind=fg={}));var dg;(function(n){n.method="textDocument/moniker",n.messageDirection=lg.MessageDirection.clientToServer,n.type=new lg.ProtocolRequestType(n.method)})(dg||(Jn.MonikerRequest=dg={}))});var yg=C(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TypeHierarchySubtypesRequest=Zn.TypeHierarchySupertypesRequest=Zn.TypeHierarchyPrepareRequest=void 0;var yr=xe(),pg;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(pg||(Zn.TypeHierarchyPrepareRequest=pg={}));var mg;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(mg||(Zn.TypeHierarchySupertypesRequest=mg={}));var gg;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(gg||(Zn.TypeHierarchySubtypesRequest=gg={}))});var vg=C(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.InlineValueRefreshRequest=br.InlineValueRequest=void 0;var Na=xe(),bg;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Na.MessageDirection.clientToServer,n.type=new Na.ProtocolRequestType(n.method)})(bg||(br.InlineValueRequest=bg={}));var Tg;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Na.MessageDirection.serverToClient,n.type=new Na.ProtocolRequestType0(n.method)})(Tg||(br.InlineValueRefreshRequest=Tg={}))});var wg=C(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.InlayHintRefreshRequest=ei.InlayHintResolveRequest=ei.InlayHintRequest=void 0;var Tr=xe(),Sg;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(Sg||(ei.InlayHintRequest=Sg={}));var kg;(function(n){n.method="inlayHint/resolve",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(kg||(ei.InlayHintResolveRequest=kg={}));var Eg;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Tr.MessageDirection.serverToClient,n.type=new Tr.ProtocolRequestType0(n.method)})(Eg||(ei.InlayHintRefreshRequest=Eg={}))});var Og=C($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.DiagnosticRefreshRequest=$t.WorkspaceDiagnosticRequest=$t.DocumentDiagnosticRequest=$t.DocumentDiagnosticReportKind=$t.DiagnosticServerCancellationData=void 0;var Cg=xi(),SN=ha(),vr=xe(),Ng;(function(n){function e(t){let i=t;return i&&SN.boolean(i.retriggerRequest)}n.is=e})(Ng||($t.DiagnosticServerCancellationData=Ng={}));var _g;(function(n){n.Full="full",n.Unchanged="unchanged"})(_g||($t.DocumentDiagnosticReportKind=_g={}));var Pg;(function(n){n.method="textDocument/diagnostic",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Pg||($t.DocumentDiagnosticRequest=Pg={}));var Dg;(function(n){n.method="workspace/diagnostic",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Dg||($t.WorkspaceDiagnosticRequest=Dg={}));var Rg;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=vr.MessageDirection.serverToClient,n.type=new vr.ProtocolRequestType0(n.method)})(Rg||($t.DiagnosticRefreshRequest=Rg={}))});var Fg=C($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var ys=da(),nn=ha(),mn=xe(),Ef;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(Ef||($e.NotebookCellKind=Ef={}));var wf;(function(n){function e(r,s){let o={executionOrder:r};return(s===!0||s===!1)&&(o.success=s),o}n.create=e;function t(r){let s=r;return nn.objectLiteral(s)&&ys.uinteger.is(s.executionOrder)&&(s.success===void 0||nn.boolean(s.success))}n.is=t;function i(r,s){return r===s?!0:r==null||s===null||s===void 0?!1:r.executionOrder===s.executionOrder&&r.success===s.success}n.equals=i})(wf||($e.ExecutionSummary=wf={}));var _a;(function(n){function e(s,o){return{kind:s,document:o}}n.create=e;function t(s){let o=s;return nn.objectLiteral(o)&&Ef.is(o.kind)&&ys.DocumentUri.is(o.document)&&(o.metadata===void 0||nn.objectLiteral(o.metadata))}n.is=t;function i(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!r(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!wf.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function r(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!r(s[l],o[l]))return!1}if(nn.objectLiteral(s)&&nn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!r(l,u)))return!1;for(let d=0;d<l.length;d++){let p=l[d];if(!r(s[p],o[p]))return!1}}return!0}})(_a||($e.NotebookCell=_a={}));var Ag;(function(n){function e(i,r,s,o){return{uri:i,notebookType:r,version:s,cells:o}}n.create=e;function t(i){let r=i;return nn.objectLiteral(r)&&nn.string(r.uri)&&ys.integer.is(r.version)&&nn.typedArray(r.cells,_a.is)}n.is=t})(Ag||($e.NotebookDocument=Ag={}));var Sr;(function(n){n.method="notebookDocument/sync",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.RegistrationType(n.method)})(Sr||($e.NotebookDocumentSyncRegistrationType=Sr={}));var Ig;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=Sr.method})(Ig||($e.DidOpenNotebookDocumentNotification=Ig={}));var Lg;(function(n){function e(i){let r=i;return nn.objectLiteral(r)&&ys.uinteger.is(r.start)&&ys.uinteger.is(r.deleteCount)&&(r.cells===void 0||nn.typedArray(r.cells,_a.is))}n.is=e;function t(i,r,s){let o={start:i,deleteCount:r};return s!==void 0&&(o.cells=s),o}n.create=t})(Lg||($e.NotebookCellArrayChange=Lg={}));var xg;(function(n){n.method="notebookDocument/didChange",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=Sr.method})(xg||($e.DidChangeNotebookDocumentNotification=xg={}));var Mg;(function(n){n.method="notebookDocument/didSave",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=Sr.method})(Mg||($e.DidSaveNotebookDocumentNotification=Mg={}));var qg;(function(n){n.method="notebookDocument/didClose",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=Sr.method})(qg||($e.DidCloseNotebookDocumentNotification=qg={}))});var Ug=C(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.InlineCompletionRequest=void 0;var Bg=xe(),jg;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=Bg.MessageDirection.clientToServer,n.type=new Bg.ProtocolRequestType(n.method)})(jg||(Pa.InlineCompletionRequest=jg={}))});var eb=C(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var F=xe(),$g=da(),it=ha(),kN=hm();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return kN.ImplementationRequest}});var EN=gm();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return EN.TypeDefinitionRequest}});var Xy=Tm();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Xy.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Xy.DidChangeWorkspaceFoldersNotification}});var wN=km();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return wN.ConfigurationRequest}});var Qy=Nm();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return Qy.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return Qy.ColorPresentationRequest}});var Jy=Dm();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRefreshRequest}});var NN=Om();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return NN.DeclarationRequest}});var _N=Lm();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return _N.SelectionRangeRequest}});var Rf=Fm();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return Rf.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCancelNotification}});var Cf=$m();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyPrepareRequest}});var kr=zm();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return kr.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return kr.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return kr.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return kr.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return kr.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return kr.SemanticTokensRegistrationType}});var PN=Qm();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return PN.ShowDocumentRequest}});var DN=eg();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return DN.LinkedEditingRangeRequest}});var Mi=cg();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return Mi.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Mi.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Mi.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Mi.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Mi.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Mi.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Mi.WillDeleteFilesRequest}});var Of=hg();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return Of.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return Of.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return Of.MonikerRequest}});var Af=yg();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Af.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySupertypesRequest}});var Zy=vg();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return Zy.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Zy.InlineValueRefreshRequest}});var If=wg();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return If.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return If.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return If.InlayHintRefreshRequest}});var bs=Og();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return bs.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return bs.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return bs.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return bs.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return bs.DiagnosticRefreshRequest}});var gn=Fg();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return gn.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return gn.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return gn.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return gn.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return gn.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidCloseNotebookDocumentNotification}});var RN=Ug();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return RN.InlineCompletionRequest}});var Nf;(function(n){function e(t){let i=t;return it.string(i)||it.string(i.language)||it.string(i.scheme)||it.string(i.pattern)}n.is=e})(Nf||(y.TextDocumentFilter=Nf={}));var _f;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebookType)||it.string(i.scheme)||it.string(i.pattern))}n.is=e})(_f||(y.NotebookDocumentFilter=_f={}));var Pf;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebook)||_f.is(i.notebook))&&(i.language===void 0||it.string(i.language))}n.is=e})(Pf||(y.NotebookCellTextDocumentFilter=Pf={}));var Df;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!it.string(i)&&!Nf.is(i)&&!Pf.is(i))return!1;return!0}n.is=e})(Df||(y.DocumentSelector=Df={}));var Wg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Wg||(y.RegistrationRequest=Wg={}));var Vg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Vg||(y.UnregistrationRequest=Vg={}));var Hg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Hg||(y.ResourceOperationKind=Hg={}));var Yg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(Yg||(y.FailureHandlingKind=Yg={}));var Kg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Kg||(y.PositionEncodingKind=Kg={}));var zg;(function(n){function e(t){let i=t;return i&&it.string(i.id)&&i.id.length>0}n.hasId=e})(zg||(y.StaticRegistrationOptions=zg={}));var Gg;(function(n){function e(t){let i=t;return i&&(i.documentSelector===null||Df.is(i.documentSelector))}n.is=e})(Gg||(y.TextDocumentRegistrationOptions=Gg={}));var Xg;(function(n){function e(i){let r=i;return it.objectLiteral(r)&&(r.workDoneProgress===void 0||it.boolean(r.workDoneProgress))}n.is=e;function t(i){let r=i;return r&&it.boolean(r.workDoneProgress)}n.hasWorkDoneProgress=t})(Xg||(y.WorkDoneProgressOptions=Xg={}));var Qg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Qg||(y.InitializeRequest=Qg={}));var Jg;(function(n){n.unknownProtocolVersion=1})(Jg||(y.InitializeErrorCodes=Jg={}));var Zg;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Zg||(y.InitializedNotification=Zg={}));var ey;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ey||(y.ShutdownRequest=ey={}));var ty;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(ty||(y.ExitNotification=ty={}));var ny;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ny||(y.DidChangeConfigurationNotification=ny={}));var iy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(iy||(y.MessageType=iy={}));var ry;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ry||(y.ShowMessageNotification=ry={}));var sy;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(sy||(y.ShowMessageRequest=sy={}));var oy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(y.LogMessageNotification=oy={}));var ay;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ay||(y.TelemetryEventNotification=ay={}));var cy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(cy||(y.TextDocumentSyncKind=cy={}));var ly;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ly||(y.DidOpenTextDocumentNotification=ly={}));var uy;(function(n){function e(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}n.isIncremental=e;function t(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}n.isFull=t})(uy||(y.TextDocumentContentChangeEvent=uy={}));var fy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(y.DidChangeTextDocumentNotification=fy={}));var dy;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(dy||(y.DidCloseTextDocumentNotification=dy={}));var hy;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(y.DidSaveTextDocumentNotification=hy={}));var py;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(py||(y.TextDocumentSaveReason=py={}));var my;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(y.WillSaveTextDocumentNotification=my={}));var gy;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(gy||(y.WillSaveTextDocumentWaitUntilRequest=gy={}));var yy;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(y.DidChangeWatchedFilesNotification=yy={}));var by;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(by||(y.FileChangeType=by={}));var Ty;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&($g.URI.is(i.baseUri)||$g.WorkspaceFolder.is(i.baseUri))&&it.string(i.pattern)}n.is=e})(Ty||(y.RelativePattern=Ty={}));var vy;(function(n){n.Create=1,n.Change=2,n.Delete=4})(vy||(y.WatchKind=vy={}));var Sy;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Sy||(y.PublishDiagnosticsNotification=Sy={}));var ky;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(ky||(y.CompletionTriggerKind=ky={}));var Ey;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ey||(y.CompletionRequest=Ey={}));var wy;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(wy||(y.CompletionResolveRequest=wy={}));var Ny;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(y.HoverRequest=Ny={}));var _y;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(_y||(y.SignatureHelpTriggerKind=_y={}));var Py;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(y.SignatureHelpRequest=Py={}));var Dy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Dy||(y.DefinitionRequest=Dy={}));var Ry;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(y.ReferencesRequest=Ry={}));var Cy;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(y.DocumentHighlightRequest=Cy={}));var Oy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(y.DocumentSymbolRequest=Oy={}));var Ay;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(y.CodeActionRequest=Ay={}));var Iy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(y.CodeActionResolveRequest=Iy={}));var Ly;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(y.WorkspaceSymbolRequest=Ly={}));var xy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(y.WorkspaceSymbolResolveRequest=xy={}));var My;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(y.CodeLensRequest=My={}));var qy;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(y.CodeLensResolveRequest=qy={}));var Fy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(Fy||(y.CodeLensRefreshRequest=Fy={}));var By;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(y.DocumentLinkRequest=By={}));var jy;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(jy||(y.DocumentLinkResolveRequest=jy={}));var Uy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(y.DocumentFormattingRequest=Uy={}));var $y;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(y.DocumentRangeFormattingRequest=$y={}));var Wy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(y.DocumentRangesFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(y.DocumentOnTypeFormattingRequest=Vy={}));var Hy;(function(n){n.Identifier=1})(Hy||(y.PrepareSupportDefaultBehavior=Hy={}));var Yy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(y.RenameRequest=Yy={}));var Ky;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ky||(y.PrepareRenameRequest=Ky={}));var zy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(y.ExecuteCommandRequest=zy={}));var Gy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Gy||(y.ApplyWorkspaceEditRequest=Gy={}))});var nb=C(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createProtocolConnection=void 0;var tb=xi();function CN(n,e,t,i){return tb.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,tb.createMessageConnection)(n,e,t,i)}Da.createProtocolConnection=CN});var rb=C(Ct=>{"use strict";var ON=Ct&&Ct.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Ra=Ct&&Ct.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ON(e,n,t)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LSPErrorCodes=Ct.createProtocolConnection=void 0;Ra(xi(),Ct);Ra(da(),Ct);Ra(xe(),Ct);Ra(eb(),Ct);var AN=nb();Object.defineProperty(Ct,"createProtocolConnection",{enumerable:!0,get:function(){return AN.createProtocolConnection}});var ib;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(ib||(Ct.LSPErrorCodes=ib={}))});var We=C(yn=>{"use strict";var IN=yn&&yn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),sb=yn&&yn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&IN(e,n,t)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createProtocolConnection=void 0;var LN=yf();sb(yf(),yn);sb(rb(),yn);function xN(n,e,t,i){return(0,LN.createMessageConnection)(n,e,t,i)}yn.createProtocolConnection=xN});var Lf=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.generateUuid=Wt.parse=Wt.isUUID=Wt.v4=Wt.empty=void 0;var Ts=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},vs=class n extends Ts{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};vs._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];vs._timeHighBits=["8","9","a","b"];Wt.empty=new Ts("00000000-0000-0000-0000-000000000000");function ob(){return new vs}Wt.v4=ob;var MN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ab(n){return MN.test(n)}Wt.isUUID=ab;function qN(n){if(!ab(n))throw new Error("invalid uuid");return new Ts(n)}Wt.parse=qN;function FN(){return ob().asHex()}Wt.generateUuid=FN});var cb=C(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.attachPartialResult=ni.ProgressFeature=ni.attachWorkDone=void 0;var ti=We(),BN=Lf(),qi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,i,r){let s={kind:"begin",title:e,percentage:t,message:i,cancellable:r};this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,s)}report(e,t){let i={kind:"report"};typeof e=="number"?(i.percentage=e,t!==void 0&&(i.message=t)):i.message=e,this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,i)}done(){n.Instances.delete(this._token),this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,{kind:"end"})}};qi.Instances=new Map;var Ca=class extends qi{constructor(e,t){super(e,t),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ss=class{constructor(){}begin(){}report(){}done(){}},Oa=class extends Ss{constructor(){super(),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function jN(n,e){if(e===void 0||e.workDoneToken===void 0)return new Ss;let t=e.workDoneToken;return delete e.workDoneToken,new qi(n,t)}ni.attachWorkDone=jN;var UN=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ti.WorkDoneProgressCancelNotification.type,t=>{let i=qi.Instances.get(t.token);(i instanceof Ca||i instanceof Oa)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ss:new qi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,BN.generateUuid)();return this.connection.sendRequest(ti.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ca(this.connection,e))}else return Promise.resolve(new Oa)}};ni.ProgressFeature=UN;var xf;(function(n){n.type=new ti.ProgressType})(xf||(xf={}));var Mf=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(xf.type,this._token,e)}};function $N(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Mf(n,t)}ni.attachPartialResult=$N});var lb=C(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ConfigurationFeature=void 0;var WN=We(),VN=Wo(),HN=n=>class extends n{getConfiguration(e){return e?VN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(WN.ConfigurationRequest.type,t).then(i=>Array.isArray(i)?Array.isArray(e)?i:i[0]:Array.isArray(e)?[]:null)}};Aa.ConfigurationFeature=HN});var ub=C(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.WorkspaceFoldersFeature=void 0;var Ia=We(),YN=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ia.Emitter,this.connection.onNotification(Ia.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ia.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Ia.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};La.WorkspaceFoldersFeature=YN});var fb=C(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.CallHierarchyFeature=void 0;var qf=We(),KN=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(qf.CallHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=qf.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onOutgoingCalls:e=>{let t=qf.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};xa.CallHierarchyFeature=KN});var Bf=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.SemanticTokensBuilder=ii.SemanticTokensDiff=ii.SemanticTokensFeature=void 0;var Ma=We(),zN=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ma.SemanticTokensRefreshRequest.type),on:e=>{let t=Ma.SemanticTokensRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onDelta:e=>{let t=Ma.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onRange:e=>{let t=Ma.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};ii.SemanticTokensFeature=zN;var qa=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,i=0;for(;i<t&&i<e&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<t&&i<e){let r=e-1,s=t-1;for(;r>=i&&s>=i&&this.originalSequence[r]===this.modifiedSequence[s];)r--,s--;(r<i||s<i)&&(r++,s++);let o=r-i+1,a=this.modifiedSequence.slice(i,s+1);return a.length===1&&a[0]===this.originalSequence[r]?[{start:i,deleteCount:o-1}]:[{start:i,deleteCount:o,data:a}]}else return i<t?[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}]:i<e?[{start:i,deleteCount:e-i}]:[]}};ii.SemanticTokensDiff=qa;var Ff=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,i,r,s){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new qa(this._prevData,this._data).computeDiff()}:this.build()}};ii.SemanticTokensBuilder=Ff});var db=C(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ShowDocumentFeature=void 0;var GN=We(),XN=n=>class extends n{showDocument(e){return this.connection.sendRequest(GN.ShowDocumentRequest.type,e)}};Fa.ShowDocumentFeature=XN});var hb=C(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.FileOperationsFeature=void 0;var Er=We(),QN=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(Er.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Er.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Er.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Er.WillCreateFilesRequest.type,(t,i)=>e(t,i))}onWillRenameFiles(e){return this.connection.onRequest(Er.WillRenameFilesRequest.type,(t,i)=>e(t,i))}onWillDeleteFiles(e){return this.connection.onRequest(Er.WillDeleteFilesRequest.type,(t,i)=>e(t,i))}};Ba.FileOperationsFeature=QN});var pb=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.LinkedEditingRangeFeature=void 0;var JN=We(),ZN=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(JN.LinkedEditingRangeRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0))}};ja.LinkedEditingRangeFeature=ZN});var mb=C(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.TypeHierarchyFeature=void 0;var jf=We(),e_=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(jf.TypeHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=jf.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onSubtypes:e=>{let t=jf.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Ua.TypeHierarchyFeature=e_});var yb=C($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.InlineValueFeature=void 0;var gb=We(),t_=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(gb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(gb.InlineValueRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};$a.InlineValueFeature=t_});var Tb=C(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.FoldingRangeFeature=void 0;var bb=We(),n_=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(bb.FoldingRangeRefreshRequest.type),on:e=>{let t=bb.FoldingRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Wa.FoldingRangeFeature=n_});var vb=C(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.InlayHintFeature=void 0;var Uf=We(),i_=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Uf.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Uf.InlayHintRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Uf.InlayHintResolveRequest.type,(t,i)=>e(t,i))}}};Va.InlayHintFeature=i_});var Sb=C(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.DiagnosticFeature=void 0;var ks=We(),r_=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ks.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ks.DocumentDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ks.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(ks.WorkspaceDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ks.WorkspaceDiagnosticRequest.partialResult,t)))}}};Ha.DiagnosticFeature=r_});var Wf=C(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.TextDocuments=void 0;var Fi=We(),$f=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Fi.Emitter,this._onDidOpen=new Fi.Emitter,this._onDidClose=new Fi.Emitter,this._onDidSave=new Fi.Emitter,this._onWillSave=new Fi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Fi.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(i=>{let r=i.textDocument,s=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(i=>{let r=i.textDocument,s=i.contentChanges;if(s.length===0)return;let{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),t.push(e.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((i,r)=>{let s=this._syncedDocuments.get(i.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:i.reason}),r):[]})),t.push(e.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Fi.Disposable.create(()=>{t.forEach(i=>i.dispose())})}};Ya.TextDocuments=$f});var Hf=C(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.NotebookDocuments=wr.NotebookSyncFeature=void 0;var Vt=We(),kb=Wf(),s_=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Vt.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Vt.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Vt.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Vt.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};wr.NotebookSyncFeature=s_;var Ka=class n{onDidOpenTextDocument(e){return this.openHandler=e,Vt.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Vt.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Vt.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Ka.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Vf=class{constructor(e){e instanceof kb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new kb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Vt.Emitter,this._onDidChange=new Vt.Emitter,this._onDidSave=new Vt.Emitter,this._onDidClose=new Vt.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,i=this.notebookCellMap.get(t);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Ka,i=[];return i.push(this.cellTextDocuments.listen(t)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let s of r.cellTextDocuments)t.openTextDocument({textDocument:s});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s===void 0)return;s.version=r.notebookDocument.version;let o=s.metadata,a=!1,c=r.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],p=[];if(c.cells!==void 0){let R=c.cells;if(R.structure!==void 0){let v=R.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),R.structure.didOpen!==void 0)for(let T of R.structure.didOpen)t.openTextDocument({textDocument:T}),l.push(T.uri);if(R.structure.didClose)for(let T of R.structure.didClose)t.closeTextDocument({textDocument:T}),u.push(T.uri)}if(R.data!==void 0){let v=new Map(R.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let N=v.get(s.cells[T].document);if(N!==void 0){let L=s.cells.splice(T,1,N);if(d.push({old:L[0],new:N}),v.delete(N.document),v.size===0)break}}}if(R.textContent!==void 0)for(let v of R.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),p.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let R of l)_.push(this.getNotebookCell(R));let b=[];for(let R of u)b.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||b.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:b,changed:{data:d,textContent:w}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of r.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(r.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Vt.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};wr.NotebookDocuments=Vf});var Eb=C(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.MonikerFeature=void 0;var o_=We(),a_=n=>class extends n{get moniker(){return{on:e=>{let t=o_.MonikerRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};za.MonikerFeature=a_});var Qf=C(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.createConnection=fe.combineFeatures=fe.combineNotebooksFeatures=fe.combineLanguagesFeatures=fe.combineWorkspaceFeatures=fe.combineWindowFeatures=fe.combineClientFeatures=fe.combineTracerFeatures=fe.combineTelemetryFeatures=fe.combineConsoleFeatures=fe._NotebooksImpl=fe._LanguagesImpl=fe.BulkUnregistration=fe.BulkRegistration=fe.ErrorMessageTracker=void 0;var U=We(),Ht=Wo(),Kf=Lf(),Z=cb(),c_=lb(),l_=ub(),u_=fb(),f_=Bf(),d_=db(),h_=hb(),p_=pb(),m_=mb(),g_=yb(),y_=Tb(),b_=vb(),T_=Sb(),v_=Hf(),S_=Eb();function Yf(n){if(n!==null)return n}var zf=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};fe.ErrorMessageTracker=zf;var Ga=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Gf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let i={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showWarningMessage(e,...t){let i={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showInformationMessage(e,...t){let i={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}},wb=(0,d_.ShowDocumentFeature)((0,Z.ProgressFeature)(Gf)),Nb;(function(n){function e(){return new Xa}n.create=e})(Nb||(fe.BulkRegistration=Nb={}));var Xa=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let i=Ht.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);let r=Kf.generateUuid();this._registrations.push({id:r,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},_b;(function(n){function e(){return new Es(void 0,[])}n.create=e})(_b||(fe.BulkUnregistration=_b={}));var Es=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let i of this._unregistrations.values())e.push(i);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Ht.string(e)?e:e.method,i=this._unregistrations.get(t);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(U.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(t)},s=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},Qa=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,i){return e instanceof Xa?this.registerMany(e):e instanceof Es?this.registerSingle1(e,t,i):this.registerSingle2(e,t)}registerSingle1(e,t,i){let r=Ht.string(t)?t:t.method,s=Kf.generateUuid(),o={registrations:[{id:s,method:r,registerOptions:i||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:r}),e),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(e,t){let i=Ht.string(e)?e:e.method,r=Kf.generateUuid(),s={registrations:[{id:r,method:i,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,s).then(o=>U.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let i={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new Es(this._connection,t.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}},Xf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(r){return r&&!!r.edit}let i=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,i)}},Pb=(0,h_.FileOperationsFeature)((0,l_.WorkspaceFoldersFeature)((0,c_.ConfigurationFeature)(Xf))),Ja=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Za=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},ec=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};fe._LanguagesImpl=ec;var Db=(0,y_.FoldingRangeFeature)((0,S_.MonikerFeature)((0,T_.DiagnosticFeature)((0,b_.InlayHintFeature)((0,g_.InlineValueFeature)((0,m_.TypeHierarchyFeature)((0,p_.LinkedEditingRangeFeature)((0,f_.SemanticTokensFeature)((0,u_.CallHierarchyFeature)(ec))))))))),tc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};fe._NotebooksImpl=tc;var Rb=(0,v_.NotebookSyncFeature)(tc);function Cb(n,e){return function(t){return e(n(t))}}fe.combineConsoleFeatures=Cb;function Ob(n,e){return function(t){return e(n(t))}}fe.combineTelemetryFeatures=Ob;function Ab(n,e){return function(t){return e(n(t))}}fe.combineTracerFeatures=Ab;function Ib(n,e){return function(t){return e(n(t))}}fe.combineClientFeatures=Ib;function Lb(n,e){return function(t){return e(n(t))}}fe.combineWindowFeatures=Lb;function xb(n,e){return function(t){return e(n(t))}}fe.combineWorkspaceFeatures=xb;function Mb(n,e){return function(t){return e(n(t))}}fe.combineLanguagesFeatures=Mb;function qb(n,e){return function(t){return e(n(t))}}fe.combineNotebooksFeatures=qb;function k_(n,e){function t(r,s,o){return r&&s?o(r,s):r||s}return{__brand:"features",console:t(n.console,e.console,Cb),tracer:t(n.tracer,e.tracer,Ab),telemetry:t(n.telemetry,e.telemetry,Ob),client:t(n.client,e.client,Ib),window:t(n.window,e.window,Lb),workspace:t(n.workspace,e.workspace,xb),languages:t(n.languages,e.languages,Mb),notebooks:t(n.notebooks,e.notebooks,qb)}}fe.combineFeatures=k_;function E_(n,e,t){let i=t&&t.console?new(t.console(Ga)):new Ga,r=n(i);i.rawAttach(r);let s=t&&t.tracer?new(t.tracer(Ja)):new Ja,o=t&&t.telemetry?new(t.telemetry(Za)):new Za,a=t&&t.client?new(t.client(Qa)):new Qa,c=t&&t.window?new(t.window(wb)):new wb,l=t&&t.workspace?new(t.workspace(Pb)):new Pb,u=t&&t.languages?new(t.languages(Db)):new Db,d=t&&t.notebooks?new(t.notebooks(Rb)):new Rb,p=[i,s,o,a,c,l,u,d];function g(v){return v instanceof Promise?v:Ht.thenable(v)?new Promise((T,N)=>{v.then(L=>T(L),L=>N(L))}):Promise.resolve(v)}let _,b,w,R={listen:()=>r.listen(),sendRequest:(v,...T)=>r.sendRequest(Ht.string(v)?v:v.method,...T),onRequest:(v,T)=>r.onRequest(v,T),sendNotification:(v,T)=>{let N=Ht.string(v)?v:v.method;return r.sendNotification(N,T)},onNotification:(v,T)=>r.onNotification(v,T),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:v=>(b=v,{dispose:()=>{b=void 0}}),onInitialized:v=>r.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(_=v,{dispose:()=>{_=void 0}}),onExit:v=>(w=v,{dispose:()=>{w=void 0}}),get console(){return i},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>r.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>r.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>r.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>r.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>r.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>r.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>r.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>r.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>r.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>r.onRequest(U.HoverRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onCompletion:v=>r.onRequest(U.CompletionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCompletionResolve:v=>r.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>r.onRequest(U.SignatureHelpRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDeclaration:v=>r.onRequest(U.DeclarationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDefinition:v=>r.onRequest(U.DefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onTypeDefinition:v=>r.onRequest(U.TypeDefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onImplementation:v=>r.onRequest(U.ImplementationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onReferences:v=>r.onRequest(U.ReferencesRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentHighlight:v=>r.onRequest(U.DocumentHighlightRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentSymbol:v=>r.onRequest(U.DocumentSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbol:v=>r.onRequest(U.WorkspaceSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbolResolve:v=>r.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>r.onRequest(U.CodeActionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeActionResolve:v=>r.onRequest(U.CodeActionResolveRequest.type,(T,N)=>v(T,N)),onCodeLens:v=>r.onRequest(U.CodeLensRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeLensResolve:v=>r.onRequest(U.CodeLensResolveRequest.type,(T,N)=>v(T,N)),onDocumentFormatting:v=>r.onRequest(U.DocumentFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentRangeFormatting:v=>r.onRequest(U.DocumentRangeFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentOnTypeFormatting:v=>r.onRequest(U.DocumentOnTypeFormattingRequest.type,(T,N)=>v(T,N)),onRenameRequest:v=>r.onRequest(U.RenameRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onPrepareRename:v=>r.onRequest(U.PrepareRenameRequest.type,(T,N)=>v(T,N)),onDocumentLinks:v=>r.onRequest(U.DocumentLinkRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentLinkResolve:v=>r.onRequest(U.DocumentLinkResolveRequest.type,(T,N)=>v(T,N)),onDocumentColor:v=>r.onRequest(U.DocumentColorRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onColorPresentation:v=>r.onRequest(U.ColorPresentationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onFoldingRanges:v=>r.onRequest(U.FoldingRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onSelectionRanges:v=>r.onRequest(U.SelectionRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onExecuteCommand:v=>r.onRequest(U.ExecuteCommandRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),dispose:()=>r.dispose()};for(let v of p)v.attach(R);return r.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Ht.string(v.trace)&&(s.trace=U.Trace.fromString(v.trace));for(let T of p)T.initialize(v.capabilities);if(b){let T=b(v,new U.CancellationTokenSource().token,(0,Z.attachWorkDone)(r,v),void 0);return g(T).then(N=>{if(N instanceof U.ResponseError)return N;let L=N;L||(L={capabilities:{}});let q=L.capabilities;q||(q={},L.capabilities=q),q.textDocumentSync===void 0||q.textDocumentSync===null?q.textDocumentSync=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None:!Ht.number(q.textDocumentSync)&&!Ht.number(q.textDocumentSync.change)&&(q.textDocumentSync.change=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(q);return L})}else{let T={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let N of p)N.fillServerCapabilities(T.capabilities);return T}}),r.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new U.CancellationTokenSource().token)}),r.onNotification(U.ExitNotification.type,()=>{try{w&&w()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),r.onNotification(U.SetTraceNotification.type,v=>{s.trace=U.Trace.fromString(v.value)}),R}fe.createConnection=E_});var Fb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.resolveModulePath=Ot.FileSystem=Ot.resolveGlobalYarnPath=Ot.resolveGlobalNodePath=Ot.resolve=Ot.uriToFilePath=void 0;var w_=require("url"),rn=require("path"),Jf=require("fs"),nd=require("child_process");function N_(n){let e=w_.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var i=0,r=t.length;i<r;i++)t[i]=decodeURIComponent(t[i]);if(process.platform==="win32"&&t.length>1){let s=t[0],o=t[1];s.length===0&&o.length>1&&o[1]===":"&&t.shift()}return rn.normalize(t.join("/"))}Ot.uriToFilePath=N_;function Zf(){return process.platform==="win32"}function nc(n,e,t,i){let r="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Jf.existsSync(e)&&(l[r]?l[r]=e+rn.delimiter+l[r]:l[r]=e,i&&i(`NODE_PATH value is: ${l[r]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,nd.fork)("",[],{cwd:t,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",p=>{a(p)}),u.on("message",p=>{p.c==="r"&&(u.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}Ot.resolve=nc;function ed(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(s=>t[s]=process.env[s]),t.NO_UPDATE_NOTIFIER="true";let i={encoding:"utf8",env:t};Zf()&&(e="npm.cmd",i.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,nd.spawnSync)(e,["config","get","prefix"],i).stdout;if(!s){n&&n("'npm config get prefix' didn't return a value.");return}let o=s.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Zf()?rn.join(o,"node_modules"):rn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}Ot.resolveGlobalNodePath=ed;function __(n){let e="yarn",t={encoding:"utf8"};Zf()&&(e="yarn.cmd",t.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let r=(0,nd.spawnSync)(e,["global","dir","--json"],t),s=r.stdout;if(!s){n&&(n("'yarn global dir' didn't return a value."),r.stderr&&n(r.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return rn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",i)}}Ot.resolveGlobalYarnPath=__;var td;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Jf.existsSync(__filename.toUpperCase())||!Jf.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function i(r,s){return t()?rn.normalize(s).indexOf(rn.normalize(r))===0:rn.normalize(s).toLowerCase().indexOf(rn.normalize(r).toLowerCase())===0}n.isParent=i})(td||(Ot.FileSystem=td={}));function P_(n,e,t,i){return t?(rn.isAbsolute(t)||(t=rn.join(n,t)),nc(e,t,t,i).then(r=>td.isParent(t,r)?r:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,r=>nc(e,ed(i),n,i))):nc(e,ed(i),n,i)}Ot.resolveModulePath=P_});var id=C((WI,Bb)=>{"use strict";Bb.exports=We()});var jb=C(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.InlineCompletionFeature=void 0;var D_=We(),R_=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(D_.InlineCompletionRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};ic.InlineCompletionFeature=R_});var Wb=C(bt=>{"use strict";var C_=bt&&bt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),$b=bt&&bt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&C_(e,n,t)};Object.defineProperty(bt,"__esModule",{value:!0});bt.ProposedFeatures=bt.NotebookDocuments=bt.TextDocuments=bt.SemanticTokensBuilder=void 0;var O_=Bf();Object.defineProperty(bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return O_.SemanticTokensBuilder}});var A_=jb();$b(We(),bt);var I_=Wf();Object.defineProperty(bt,"TextDocuments",{enumerable:!0,get:function(){return I_.TextDocuments}});var L_=Hf();Object.defineProperty(bt,"NotebookDocuments",{enumerable:!0,get:function(){return L_.NotebookDocuments}});$b(Qf(),bt);var Ub;(function(n){n.all={__brand:"features",languages:A_.InlineCompletionFeature}})(Ub||(bt.ProposedFeatures=Ub={}))});var Q=C(Yt=>{"use strict";var x_=Yt&&Yt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Kb=Yt&&Yt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&x_(e,n,t)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.createConnection=Yt.Files=void 0;var Vb=require("node:util"),rd=Wo(),M_=Qf(),ws=Fb(),Bi=id();Kb(id(),Yt);Kb(Wb(),Yt);var Hb;(function(n){n.uriToFilePath=ws.uriToFilePath,n.resolveGlobalNodePath=ws.resolveGlobalNodePath,n.resolveGlobalYarnPath=ws.resolveGlobalYarnPath,n.resolve=ws.resolve,n.resolveModulePath=ws.resolveModulePath})(Hb||(Yt.Files=Hb={}));var Yb;function rc(){if(Yb!==void 0)try{Yb.end()}catch{}}var Nr=!1,zb;function q_(){let n="--clientProcessId";function e(t){try{let i=parseInt(t);isNaN(i)||(zb=setInterval(()=>{try{process.kill(i,0)}catch{rc(),process.exit(Nr?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let i=process.argv[t];if(i===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let r=i.split("=");r[0]===n&&e(r[1])}}}q_();var F_={initialize:n=>{let e=n.processId;rd.number(e)&&zb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Nr?0:1)}},3e3)},get shutdownReceived(){return Nr},set shutdownReceived(n){Nr=n},exit:n=>{rc(),process.exit(n)}};function B_(n,e,t,i){let r,s,o,a;return n!==void 0&&n.__brand==="features"&&(r=n,n=e,e=t,t=i),Bi.ConnectionStrategy.is(n)||Bi.ConnectionOptions.is(n)?a=n:(s=n,o=e,a=t),j_(s,o,a,r)}Yt.createConnection=B_;function j_(n,e,t,i){let r=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let p=u[d];if(p==="--node-ipc"){n=new Bi.IPCMessageReader(process),e=new Bi.IPCMessageWriter(process);break}else if(p==="--stdio"){r=!0,n=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(u[d+1]);break}else if(p==="--pipe"){l=u[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,Bi.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,Bi.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(rd.func(n.read)&&rd.func(n.on)){let c=n;c.on("end",()=>{rc(),process.exit(Nr?0:1)}),c.on("close",()=>{rc(),process.exit(Nr?0:1)})}let a=c=>{let l=(0,Bi.createProtocolConnection)(n,e,c,t);return r&&U_(c),l};return(0,M_.createConnection)(a,F_,i)}function U_(n){function e(i){return i.map(r=>typeof r=="string"?r:(0,Vb.inspect)(r)).join(" ")}let t=new Map;console.assert=function(r,...s){if(!r)if(s.length===0)n.error("Assertion failed");else{let[o,...a]=s;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(r="default"){let s=String(r),o=t.get(s)??0;o+=1,t.set(s,o),n.log(`${s}: ${s}`)},console.countReset=function(r){r===void 0?t.clear():t.delete(String(r))},console.debug=function(...r){n.log(e(r))},console.dir=function(r,s){n.log((0,Vb.inspect)(r,s))},console.log=function(...r){n.log(e(r))},console.error=function(...r){n.error(e(r))},console.trace=function(...r){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";r.length!==0&&(o+=`: ${e(r)}`),n.log(`${o}
|
|
37
|
-
${s}`)},console.warn=function(...r){n.warn(e(r))}}});var Xb=C((
|
|
38
|
-
`)}};
|
|
36
|
+
`&&f++}m&&E.length>0&&k.push(E.length),this._lineOffsets=k}return this._lineOffsets},h.prototype.positionAt=function(k){k=Math.max(Math.min(k,this._content.length),0);var E=this.getLineOffsets(),m=0,f=E.length;if(f===0)return o.create(0,k);for(;m<f;){var P=Math.floor((m+f)/2);E[P]>k?f=P:m=P+1}var x=m-1;return o.create(x,k-E[x])},h.prototype.offsetAt=function(k){var E=this.getLineOffsets();if(k.line>=E.length)return this._content.length;if(k.line<0)return 0;var m=E[k.line],f=k.line+1<E.length?E[k.line+1]:this._content.length;return Math.max(Math.min(m+k.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var k=Object.prototype.toString;function E(oe){return typeof oe<"u"}h.defined=E;function m(oe){return typeof oe>"u"}h.undefined=m;function f(oe){return oe===!0||oe===!1}h.boolean=f;function P(oe){return k.call(oe)==="[object String]"}h.string=P;function x(oe){return k.call(oe)==="[object Number]"}h.number=x;function ee(oe,rr,$o){return k.call(oe)==="[object Number]"&&rr<=oe&&oe<=$o}h.numberRange=ee;function Ue(oe){return k.call(oe)==="[object Number]"&&-2147483648<=oe&&oe<=2147483647}h.integer=Ue;function Ne(oe){return k.call(oe)==="[object Number]"&&0<=oe&&oe<=2147483647}h.uinteger=Ne;function Zt(oe){return k.call(oe)==="[object Function]"}h.func=Zt;function en(oe){return oe!==null&&typeof oe=="object"}h.objectLiteral=en;function xn(oe,rr){return Array.isArray(oe)&&oe.every(rr)}h.typedArray=xn})(D||(D={}))})});var xe=C(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var hr=Mi(),cm;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(cm||(Dt.MessageDirection=cm={}));var bf=class{constructor(e){this.method=e}};Dt.RegistrationType=bf;var Tf=class extends hr.RequestType0{constructor(e){super(e)}};Dt.ProtocolRequestType0=Tf;var vf=class extends hr.RequestType{constructor(e){super(e,hr.ParameterStructures.byName)}};Dt.ProtocolRequestType=vf;var Sf=class extends hr.NotificationType0{constructor(e){super(e)}};Dt.ProtocolNotificationType0=Sf;var kf=class extends hr.NotificationType{constructor(e){super(e,hr.ParameterStructures.byName)}};Dt.ProtocolNotificationType=kf});var ha=C(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.objectLiteral=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function pN(n){return n===!0||n===!1}Ye.boolean=pN;function lm(n){return typeof n=="string"||n instanceof String}Ye.string=lm;function mN(n){return typeof n=="number"||n instanceof Number}Ye.number=mN;function gN(n){return n instanceof Error}Ye.error=gN;function yN(n){return typeof n=="function"}Ye.func=yN;function um(n){return Array.isArray(n)}Ye.array=um;function bN(n){return um(n)&&n.every(e=>lm(e))}Ye.stringArray=bN;function TN(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=TN;function vN(n){return n!==null&&typeof n=="object"}Ye.objectLiteral=vN});var hm=C(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ImplementationRequest=void 0;var fm=xe(),dm;(function(n){n.method="textDocument/implementation",n.messageDirection=fm.MessageDirection.clientToServer,n.type=new fm.ProtocolRequestType(n.method)})(dm||(pa.ImplementationRequest=dm={}))});var gm=C(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.TypeDefinitionRequest=void 0;var pm=xe(),mm;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=pm.MessageDirection.clientToServer,n.type=new pm.ProtocolRequestType(n.method)})(mm||(ma.TypeDefinitionRequest=mm={}))});var Tm=C(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.DidChangeWorkspaceFoldersNotification=pr.WorkspaceFoldersRequest=void 0;var ga=xe(),ym;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=ga.MessageDirection.serverToClient,n.type=new ga.ProtocolRequestType0(n.method)})(ym||(pr.WorkspaceFoldersRequest=ym={}));var bm;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=ga.MessageDirection.clientToServer,n.type=new ga.ProtocolNotificationType(n.method)})(bm||(pr.DidChangeWorkspaceFoldersNotification=bm={}))});var km=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ConfigurationRequest=void 0;var vm=xe(),Sm;(function(n){n.method="workspace/configuration",n.messageDirection=vm.MessageDirection.serverToClient,n.type=new vm.ProtocolRequestType(n.method)})(Sm||(ya.ConfigurationRequest=Sm={}))});var Nm=C(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.ColorPresentationRequest=mr.DocumentColorRequest=void 0;var ba=xe(),Em;(function(n){n.method="textDocument/documentColor",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(Em||(mr.DocumentColorRequest=Em={}));var wm;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(wm||(mr.ColorPresentationRequest=wm={}))});var Dm=C(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.FoldingRangeRefreshRequest=gr.FoldingRangeRequest=void 0;var Ta=xe(),_m;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Ta.MessageDirection.clientToServer,n.type=new Ta.ProtocolRequestType(n.method)})(_m||(gr.FoldingRangeRequest=_m={}));var Pm;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Ta.MessageDirection.serverToClient,n.type=new Ta.ProtocolRequestType0(n.method)})(Pm||(gr.FoldingRangeRefreshRequest=Pm={}))});var Om=C(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.DeclarationRequest=void 0;var Rm=xe(),Cm;(function(n){n.method="textDocument/declaration",n.messageDirection=Rm.MessageDirection.clientToServer,n.type=new Rm.ProtocolRequestType(n.method)})(Cm||(va.DeclarationRequest=Cm={}))});var Lm=C(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.SelectionRangeRequest=void 0;var Am=xe(),Im;(function(n){n.method="textDocument/selectionRange",n.messageDirection=Am.MessageDirection.clientToServer,n.type=new Am.ProtocolRequestType(n.method)})(Im||(Sa.SelectionRangeRequest=Im={}))});var Fm=C(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WorkDoneProgressCancelNotification=Xn.WorkDoneProgressCreateRequest=Xn.WorkDoneProgress=void 0;var SN=Mi(),ka=xe(),xm;(function(n){n.type=new SN.ProgressType;function e(t){return t===n.type}n.is=e})(xm||(Xn.WorkDoneProgress=xm={}));var Mm;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=ka.MessageDirection.serverToClient,n.type=new ka.ProtocolRequestType(n.method)})(Mm||(Xn.WorkDoneProgressCreateRequest=Mm={}));var qm;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=ka.MessageDirection.clientToServer,n.type=new ka.ProtocolNotificationType(n.method)})(qm||(Xn.WorkDoneProgressCancelNotification=qm={}))});var $m=C(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallHierarchyOutgoingCallsRequest=Qn.CallHierarchyIncomingCallsRequest=Qn.CallHierarchyPrepareRequest=void 0;var yr=xe(),Bm;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(Bm||(Qn.CallHierarchyPrepareRequest=Bm={}));var jm;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(jm||(Qn.CallHierarchyIncomingCallsRequest=jm={}));var Um;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(Um||(Qn.CallHierarchyOutgoingCallsRequest=Um={}))});var zm=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var qn=xe(),Wm;(function(n){n.Relative="relative"})(Wm||(Rt.TokenFormat=Wm={}));var ys;(function(n){n.method="textDocument/semanticTokens",n.type=new qn.RegistrationType(n.method)})(ys||(Rt.SemanticTokensRegistrationType=ys={}));var Vm;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Vm||(Rt.SemanticTokensRequest=Vm={}));var Hm;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Hm||(Rt.SemanticTokensDeltaRequest=Hm={}));var Ym;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Ym||(Rt.SemanticTokensRangeRequest=Ym={}));var Km;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=qn.MessageDirection.serverToClient,n.type=new qn.ProtocolRequestType0(n.method)})(Km||(Rt.SemanticTokensRefreshRequest=Km={}))});var Qm=C(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.ShowDocumentRequest=void 0;var Gm=xe(),Xm;(function(n){n.method="window/showDocument",n.messageDirection=Gm.MessageDirection.serverToClient,n.type=new Gm.ProtocolRequestType(n.method)})(Xm||(Ea.ShowDocumentRequest=Xm={}))});var eg=C(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.LinkedEditingRangeRequest=void 0;var Jm=xe(),Zm;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=Jm.MessageDirection.clientToServer,n.type=new Jm.ProtocolRequestType(n.method)})(Zm||(wa.LinkedEditingRangeRequest=Zm={}))});var cg=C(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var Ut=xe(),tg;(function(n){n.file="file",n.folder="folder"})(tg||(yt.FileOperationPatternKind=tg={}));var ng;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ng||(yt.WillCreateFilesRequest=ng={}));var ig;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(ig||(yt.DidCreateFilesNotification=ig={}));var rg;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(rg||(yt.WillRenameFilesRequest=rg={}));var sg;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(sg||(yt.DidRenameFilesNotification=sg={}));var og;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(og||(yt.DidDeleteFilesNotification=og={}));var ag;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ag||(yt.WillDeleteFilesRequest=ag={}))});var hg=C(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.MonikerRequest=Jn.MonikerKind=Jn.UniquenessLevel=void 0;var lg=xe(),ug;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(ug||(Jn.UniquenessLevel=ug={}));var fg;(function(n){n.$import="import",n.$export="export",n.local="local"})(fg||(Jn.MonikerKind=fg={}));var dg;(function(n){n.method="textDocument/moniker",n.messageDirection=lg.MessageDirection.clientToServer,n.type=new lg.ProtocolRequestType(n.method)})(dg||(Jn.MonikerRequest=dg={}))});var yg=C(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TypeHierarchySubtypesRequest=Zn.TypeHierarchySupertypesRequest=Zn.TypeHierarchyPrepareRequest=void 0;var br=xe(),pg;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(pg||(Zn.TypeHierarchyPrepareRequest=pg={}));var mg;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(mg||(Zn.TypeHierarchySupertypesRequest=mg={}));var gg;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(gg||(Zn.TypeHierarchySubtypesRequest=gg={}))});var vg=C(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.InlineValueRefreshRequest=Tr.InlineValueRequest=void 0;var Na=xe(),bg;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Na.MessageDirection.clientToServer,n.type=new Na.ProtocolRequestType(n.method)})(bg||(Tr.InlineValueRequest=bg={}));var Tg;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Na.MessageDirection.serverToClient,n.type=new Na.ProtocolRequestType0(n.method)})(Tg||(Tr.InlineValueRefreshRequest=Tg={}))});var wg=C(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.InlayHintRefreshRequest=ei.InlayHintResolveRequest=ei.InlayHintRequest=void 0;var vr=xe(),Sg;(function(n){n.method="textDocument/inlayHint",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method)})(Sg||(ei.InlayHintRequest=Sg={}));var kg;(function(n){n.method="inlayHint/resolve",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method)})(kg||(ei.InlayHintResolveRequest=kg={}));var Eg;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=vr.MessageDirection.serverToClient,n.type=new vr.ProtocolRequestType0(n.method)})(Eg||(ei.InlayHintRefreshRequest=Eg={}))});var Og=C($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.DiagnosticRefreshRequest=$t.WorkspaceDiagnosticRequest=$t.DocumentDiagnosticRequest=$t.DocumentDiagnosticReportKind=$t.DiagnosticServerCancellationData=void 0;var Cg=Mi(),kN=ha(),Sr=xe(),Ng;(function(n){function e(t){let i=t;return i&&kN.boolean(i.retriggerRequest)}n.is=e})(Ng||($t.DiagnosticServerCancellationData=Ng={}));var _g;(function(n){n.Full="full",n.Unchanged="unchanged"})(_g||($t.DocumentDiagnosticReportKind=_g={}));var Pg;(function(n){n.method="textDocument/diagnostic",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Pg||($t.DocumentDiagnosticRequest=Pg={}));var Dg;(function(n){n.method="workspace/diagnostic",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Dg||($t.WorkspaceDiagnosticRequest=Dg={}));var Rg;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=Sr.MessageDirection.serverToClient,n.type=new Sr.ProtocolRequestType0(n.method)})(Rg||($t.DiagnosticRefreshRequest=Rg={}))});var Fg=C($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var bs=da(),nn=ha(),mn=xe(),Ef;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(Ef||($e.NotebookCellKind=Ef={}));var wf;(function(n){function e(r,s){let o={executionOrder:r};return(s===!0||s===!1)&&(o.success=s),o}n.create=e;function t(r){let s=r;return nn.objectLiteral(s)&&bs.uinteger.is(s.executionOrder)&&(s.success===void 0||nn.boolean(s.success))}n.is=t;function i(r,s){return r===s?!0:r==null||s===null||s===void 0?!1:r.executionOrder===s.executionOrder&&r.success===s.success}n.equals=i})(wf||($e.ExecutionSummary=wf={}));var _a;(function(n){function e(s,o){return{kind:s,document:o}}n.create=e;function t(s){let o=s;return nn.objectLiteral(o)&&Ef.is(o.kind)&&bs.DocumentUri.is(o.document)&&(o.metadata===void 0||nn.objectLiteral(o.metadata))}n.is=t;function i(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!r(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!wf.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function r(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!r(s[l],o[l]))return!1}if(nn.objectLiteral(s)&&nn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!r(l,u)))return!1;for(let d=0;d<l.length;d++){let p=l[d];if(!r(s[p],o[p]))return!1}}return!0}})(_a||($e.NotebookCell=_a={}));var Ag;(function(n){function e(i,r,s,o){return{uri:i,notebookType:r,version:s,cells:o}}n.create=e;function t(i){let r=i;return nn.objectLiteral(r)&&nn.string(r.uri)&&bs.integer.is(r.version)&&nn.typedArray(r.cells,_a.is)}n.is=t})(Ag||($e.NotebookDocument=Ag={}));var kr;(function(n){n.method="notebookDocument/sync",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.RegistrationType(n.method)})(kr||($e.NotebookDocumentSyncRegistrationType=kr={}));var Ig;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(Ig||($e.DidOpenNotebookDocumentNotification=Ig={}));var Lg;(function(n){function e(i){let r=i;return nn.objectLiteral(r)&&bs.uinteger.is(r.start)&&bs.uinteger.is(r.deleteCount)&&(r.cells===void 0||nn.typedArray(r.cells,_a.is))}n.is=e;function t(i,r,s){let o={start:i,deleteCount:r};return s!==void 0&&(o.cells=s),o}n.create=t})(Lg||($e.NotebookCellArrayChange=Lg={}));var xg;(function(n){n.method="notebookDocument/didChange",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(xg||($e.DidChangeNotebookDocumentNotification=xg={}));var Mg;(function(n){n.method="notebookDocument/didSave",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(Mg||($e.DidSaveNotebookDocumentNotification=Mg={}));var qg;(function(n){n.method="notebookDocument/didClose",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(qg||($e.DidCloseNotebookDocumentNotification=qg={}))});var Ug=C(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.InlineCompletionRequest=void 0;var Bg=xe(),jg;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=Bg.MessageDirection.clientToServer,n.type=new Bg.ProtocolRequestType(n.method)})(jg||(Pa.InlineCompletionRequest=jg={}))});var eb=C(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var F=xe(),$g=da(),it=ha(),EN=hm();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return EN.ImplementationRequest}});var wN=gm();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return wN.TypeDefinitionRequest}});var Xy=Tm();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Xy.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Xy.DidChangeWorkspaceFoldersNotification}});var NN=km();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return NN.ConfigurationRequest}});var Qy=Nm();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return Qy.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return Qy.ColorPresentationRequest}});var Jy=Dm();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRefreshRequest}});var _N=Om();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return _N.DeclarationRequest}});var PN=Lm();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return PN.SelectionRangeRequest}});var Rf=Fm();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return Rf.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCancelNotification}});var Cf=$m();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyPrepareRequest}});var Er=zm();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return Er.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Er.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Er.SemanticTokensRegistrationType}});var DN=Qm();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return DN.ShowDocumentRequest}});var RN=eg();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return RN.LinkedEditingRangeRequest}});var qi=cg();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Of=hg();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return Of.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return Of.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return Of.MonikerRequest}});var Af=yg();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Af.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySupertypesRequest}});var Zy=vg();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return Zy.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Zy.InlineValueRefreshRequest}});var If=wg();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return If.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return If.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return If.InlayHintRefreshRequest}});var Ts=Og();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ts.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ts.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ts.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ts.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ts.DiagnosticRefreshRequest}});var gn=Fg();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return gn.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return gn.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return gn.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return gn.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return gn.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidCloseNotebookDocumentNotification}});var CN=Ug();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return CN.InlineCompletionRequest}});var Nf;(function(n){function e(t){let i=t;return it.string(i)||it.string(i.language)||it.string(i.scheme)||it.string(i.pattern)}n.is=e})(Nf||(y.TextDocumentFilter=Nf={}));var _f;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebookType)||it.string(i.scheme)||it.string(i.pattern))}n.is=e})(_f||(y.NotebookDocumentFilter=_f={}));var Pf;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebook)||_f.is(i.notebook))&&(i.language===void 0||it.string(i.language))}n.is=e})(Pf||(y.NotebookCellTextDocumentFilter=Pf={}));var Df;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!it.string(i)&&!Nf.is(i)&&!Pf.is(i))return!1;return!0}n.is=e})(Df||(y.DocumentSelector=Df={}));var Wg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Wg||(y.RegistrationRequest=Wg={}));var Vg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Vg||(y.UnregistrationRequest=Vg={}));var Hg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Hg||(y.ResourceOperationKind=Hg={}));var Yg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(Yg||(y.FailureHandlingKind=Yg={}));var Kg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Kg||(y.PositionEncodingKind=Kg={}));var zg;(function(n){function e(t){let i=t;return i&&it.string(i.id)&&i.id.length>0}n.hasId=e})(zg||(y.StaticRegistrationOptions=zg={}));var Gg;(function(n){function e(t){let i=t;return i&&(i.documentSelector===null||Df.is(i.documentSelector))}n.is=e})(Gg||(y.TextDocumentRegistrationOptions=Gg={}));var Xg;(function(n){function e(i){let r=i;return it.objectLiteral(r)&&(r.workDoneProgress===void 0||it.boolean(r.workDoneProgress))}n.is=e;function t(i){let r=i;return r&&it.boolean(r.workDoneProgress)}n.hasWorkDoneProgress=t})(Xg||(y.WorkDoneProgressOptions=Xg={}));var Qg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Qg||(y.InitializeRequest=Qg={}));var Jg;(function(n){n.unknownProtocolVersion=1})(Jg||(y.InitializeErrorCodes=Jg={}));var Zg;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Zg||(y.InitializedNotification=Zg={}));var ey;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ey||(y.ShutdownRequest=ey={}));var ty;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(ty||(y.ExitNotification=ty={}));var ny;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ny||(y.DidChangeConfigurationNotification=ny={}));var iy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(iy||(y.MessageType=iy={}));var ry;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ry||(y.ShowMessageNotification=ry={}));var sy;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(sy||(y.ShowMessageRequest=sy={}));var oy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(y.LogMessageNotification=oy={}));var ay;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ay||(y.TelemetryEventNotification=ay={}));var cy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(cy||(y.TextDocumentSyncKind=cy={}));var ly;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ly||(y.DidOpenTextDocumentNotification=ly={}));var uy;(function(n){function e(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}n.isIncremental=e;function t(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}n.isFull=t})(uy||(y.TextDocumentContentChangeEvent=uy={}));var fy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(y.DidChangeTextDocumentNotification=fy={}));var dy;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(dy||(y.DidCloseTextDocumentNotification=dy={}));var hy;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(y.DidSaveTextDocumentNotification=hy={}));var py;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(py||(y.TextDocumentSaveReason=py={}));var my;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(y.WillSaveTextDocumentNotification=my={}));var gy;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(gy||(y.WillSaveTextDocumentWaitUntilRequest=gy={}));var yy;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(y.DidChangeWatchedFilesNotification=yy={}));var by;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(by||(y.FileChangeType=by={}));var Ty;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&($g.URI.is(i.baseUri)||$g.WorkspaceFolder.is(i.baseUri))&&it.string(i.pattern)}n.is=e})(Ty||(y.RelativePattern=Ty={}));var vy;(function(n){n.Create=1,n.Change=2,n.Delete=4})(vy||(y.WatchKind=vy={}));var Sy;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Sy||(y.PublishDiagnosticsNotification=Sy={}));var ky;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(ky||(y.CompletionTriggerKind=ky={}));var Ey;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ey||(y.CompletionRequest=Ey={}));var wy;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(wy||(y.CompletionResolveRequest=wy={}));var Ny;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(y.HoverRequest=Ny={}));var _y;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(_y||(y.SignatureHelpTriggerKind=_y={}));var Py;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(y.SignatureHelpRequest=Py={}));var Dy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Dy||(y.DefinitionRequest=Dy={}));var Ry;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(y.ReferencesRequest=Ry={}));var Cy;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(y.DocumentHighlightRequest=Cy={}));var Oy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(y.DocumentSymbolRequest=Oy={}));var Ay;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(y.CodeActionRequest=Ay={}));var Iy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(y.CodeActionResolveRequest=Iy={}));var Ly;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(y.WorkspaceSymbolRequest=Ly={}));var xy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(y.WorkspaceSymbolResolveRequest=xy={}));var My;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(y.CodeLensRequest=My={}));var qy;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(y.CodeLensResolveRequest=qy={}));var Fy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(Fy||(y.CodeLensRefreshRequest=Fy={}));var By;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(y.DocumentLinkRequest=By={}));var jy;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(jy||(y.DocumentLinkResolveRequest=jy={}));var Uy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(y.DocumentFormattingRequest=Uy={}));var $y;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(y.DocumentRangeFormattingRequest=$y={}));var Wy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(y.DocumentRangesFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(y.DocumentOnTypeFormattingRequest=Vy={}));var Hy;(function(n){n.Identifier=1})(Hy||(y.PrepareSupportDefaultBehavior=Hy={}));var Yy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(y.RenameRequest=Yy={}));var Ky;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ky||(y.PrepareRenameRequest=Ky={}));var zy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(y.ExecuteCommandRequest=zy={}));var Gy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Gy||(y.ApplyWorkspaceEditRequest=Gy={}))});var nb=C(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createProtocolConnection=void 0;var tb=Mi();function ON(n,e,t,i){return tb.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,tb.createMessageConnection)(n,e,t,i)}Da.createProtocolConnection=ON});var rb=C(Ct=>{"use strict";var AN=Ct&&Ct.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Ra=Ct&&Ct.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AN(e,n,t)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LSPErrorCodes=Ct.createProtocolConnection=void 0;Ra(Mi(),Ct);Ra(da(),Ct);Ra(xe(),Ct);Ra(eb(),Ct);var IN=nb();Object.defineProperty(Ct,"createProtocolConnection",{enumerable:!0,get:function(){return IN.createProtocolConnection}});var ib;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(ib||(Ct.LSPErrorCodes=ib={}))});var We=C(yn=>{"use strict";var LN=yn&&yn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),sb=yn&&yn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&LN(e,n,t)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createProtocolConnection=void 0;var xN=yf();sb(yf(),yn);sb(rb(),yn);function MN(n,e,t,i){return(0,xN.createMessageConnection)(n,e,t,i)}yn.createProtocolConnection=MN});var Lf=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.generateUuid=Wt.parse=Wt.isUUID=Wt.v4=Wt.empty=void 0;var vs=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ss=class n extends vs{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};Ss._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ss._timeHighBits=["8","9","a","b"];Wt.empty=new vs("00000000-0000-0000-0000-000000000000");function ob(){return new Ss}Wt.v4=ob;var qN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ab(n){return qN.test(n)}Wt.isUUID=ab;function FN(n){if(!ab(n))throw new Error("invalid uuid");return new vs(n)}Wt.parse=FN;function BN(){return ob().asHex()}Wt.generateUuid=BN});var cb=C(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.attachPartialResult=ni.ProgressFeature=ni.attachWorkDone=void 0;var ti=We(),jN=Lf(),Fi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,i,r){let s={kind:"begin",title:e,percentage:t,message:i,cancellable:r};this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,s)}report(e,t){let i={kind:"report"};typeof e=="number"?(i.percentage=e,t!==void 0&&(i.message=t)):i.message=e,this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,i)}done(){n.Instances.delete(this._token),this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,{kind:"end"})}};Fi.Instances=new Map;var Ca=class extends Fi{constructor(e,t){super(e,t),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ks=class{constructor(){}begin(){}report(){}done(){}},Oa=class extends ks{constructor(){super(),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function UN(n,e){if(e===void 0||e.workDoneToken===void 0)return new ks;let t=e.workDoneToken;return delete e.workDoneToken,new Fi(n,t)}ni.attachWorkDone=UN;var $N=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ti.WorkDoneProgressCancelNotification.type,t=>{let i=Fi.Instances.get(t.token);(i instanceof Ca||i instanceof Oa)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ks:new Fi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,jN.generateUuid)();return this.connection.sendRequest(ti.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ca(this.connection,e))}else return Promise.resolve(new Oa)}};ni.ProgressFeature=$N;var xf;(function(n){n.type=new ti.ProgressType})(xf||(xf={}));var Mf=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(xf.type,this._token,e)}};function WN(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Mf(n,t)}ni.attachPartialResult=WN});var lb=C(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ConfigurationFeature=void 0;var VN=We(),HN=Wo(),YN=n=>class extends n{getConfiguration(e){return e?HN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(VN.ConfigurationRequest.type,t).then(i=>Array.isArray(i)?Array.isArray(e)?i:i[0]:Array.isArray(e)?[]:null)}};Aa.ConfigurationFeature=YN});var ub=C(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.WorkspaceFoldersFeature=void 0;var Ia=We(),KN=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ia.Emitter,this.connection.onNotification(Ia.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ia.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Ia.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};La.WorkspaceFoldersFeature=KN});var fb=C(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.CallHierarchyFeature=void 0;var qf=We(),zN=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(qf.CallHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=qf.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onOutgoingCalls:e=>{let t=qf.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};xa.CallHierarchyFeature=zN});var Bf=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.SemanticTokensBuilder=ii.SemanticTokensDiff=ii.SemanticTokensFeature=void 0;var Ma=We(),GN=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ma.SemanticTokensRefreshRequest.type),on:e=>{let t=Ma.SemanticTokensRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onDelta:e=>{let t=Ma.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onRange:e=>{let t=Ma.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};ii.SemanticTokensFeature=GN;var qa=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,i=0;for(;i<t&&i<e&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<t&&i<e){let r=e-1,s=t-1;for(;r>=i&&s>=i&&this.originalSequence[r]===this.modifiedSequence[s];)r--,s--;(r<i||s<i)&&(r++,s++);let o=r-i+1,a=this.modifiedSequence.slice(i,s+1);return a.length===1&&a[0]===this.originalSequence[r]?[{start:i,deleteCount:o-1}]:[{start:i,deleteCount:o,data:a}]}else return i<t?[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}]:i<e?[{start:i,deleteCount:e-i}]:[]}};ii.SemanticTokensDiff=qa;var Ff=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,i,r,s){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new qa(this._prevData,this._data).computeDiff()}:this.build()}};ii.SemanticTokensBuilder=Ff});var db=C(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ShowDocumentFeature=void 0;var XN=We(),QN=n=>class extends n{showDocument(e){return this.connection.sendRequest(XN.ShowDocumentRequest.type,e)}};Fa.ShowDocumentFeature=QN});var hb=C(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.FileOperationsFeature=void 0;var wr=We(),JN=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(wr.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(wr.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(wr.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(wr.WillCreateFilesRequest.type,(t,i)=>e(t,i))}onWillRenameFiles(e){return this.connection.onRequest(wr.WillRenameFilesRequest.type,(t,i)=>e(t,i))}onWillDeleteFiles(e){return this.connection.onRequest(wr.WillDeleteFilesRequest.type,(t,i)=>e(t,i))}};Ba.FileOperationsFeature=JN});var pb=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.LinkedEditingRangeFeature=void 0;var ZN=We(),e_=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(ZN.LinkedEditingRangeRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0))}};ja.LinkedEditingRangeFeature=e_});var mb=C(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.TypeHierarchyFeature=void 0;var jf=We(),t_=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(jf.TypeHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=jf.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onSubtypes:e=>{let t=jf.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Ua.TypeHierarchyFeature=t_});var yb=C($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.InlineValueFeature=void 0;var gb=We(),n_=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(gb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(gb.InlineValueRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};$a.InlineValueFeature=n_});var Tb=C(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.FoldingRangeFeature=void 0;var bb=We(),i_=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(bb.FoldingRangeRefreshRequest.type),on:e=>{let t=bb.FoldingRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Wa.FoldingRangeFeature=i_});var vb=C(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.InlayHintFeature=void 0;var Uf=We(),r_=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Uf.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Uf.InlayHintRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Uf.InlayHintResolveRequest.type,(t,i)=>e(t,i))}}};Va.InlayHintFeature=r_});var Sb=C(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.DiagnosticFeature=void 0;var Es=We(),s_=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Es.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Es.DocumentDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Es.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Es.WorkspaceDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Es.WorkspaceDiagnosticRequest.partialResult,t)))}}};Ha.DiagnosticFeature=s_});var Wf=C(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.TextDocuments=void 0;var Bi=We(),$f=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Bi.Emitter,this._onDidOpen=new Bi.Emitter,this._onDidClose=new Bi.Emitter,this._onDidSave=new Bi.Emitter,this._onWillSave=new Bi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Bi.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(i=>{let r=i.textDocument,s=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(i=>{let r=i.textDocument,s=i.contentChanges;if(s.length===0)return;let{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),t.push(e.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((i,r)=>{let s=this._syncedDocuments.get(i.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:i.reason}),r):[]})),t.push(e.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Bi.Disposable.create(()=>{t.forEach(i=>i.dispose())})}};Ya.TextDocuments=$f});var Hf=C(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.NotebookDocuments=Nr.NotebookSyncFeature=void 0;var Vt=We(),kb=Wf(),o_=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Vt.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Vt.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Vt.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Vt.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};Nr.NotebookSyncFeature=o_;var Ka=class n{onDidOpenTextDocument(e){return this.openHandler=e,Vt.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Vt.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Vt.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Ka.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Vf=class{constructor(e){e instanceof kb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new kb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Vt.Emitter,this._onDidChange=new Vt.Emitter,this._onDidSave=new Vt.Emitter,this._onDidClose=new Vt.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,i=this.notebookCellMap.get(t);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Ka,i=[];return i.push(this.cellTextDocuments.listen(t)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let s of r.cellTextDocuments)t.openTextDocument({textDocument:s});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s===void 0)return;s.version=r.notebookDocument.version;let o=s.metadata,a=!1,c=r.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],p=[];if(c.cells!==void 0){let R=c.cells;if(R.structure!==void 0){let v=R.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),R.structure.didOpen!==void 0)for(let T of R.structure.didOpen)t.openTextDocument({textDocument:T}),l.push(T.uri);if(R.structure.didClose)for(let T of R.structure.didClose)t.closeTextDocument({textDocument:T}),u.push(T.uri)}if(R.data!==void 0){let v=new Map(R.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let N=v.get(s.cells[T].document);if(N!==void 0){let L=s.cells.splice(T,1,N);if(d.push({old:L[0],new:N}),v.delete(N.document),v.size===0)break}}}if(R.textContent!==void 0)for(let v of R.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),p.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let R of l)_.push(this.getNotebookCell(R));let b=[];for(let R of u)b.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||b.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:b,changed:{data:d,textContent:w}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of r.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(r.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Vt.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};Nr.NotebookDocuments=Vf});var Eb=C(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.MonikerFeature=void 0;var a_=We(),c_=n=>class extends n{get moniker(){return{on:e=>{let t=a_.MonikerRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};za.MonikerFeature=c_});var Qf=C(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.createConnection=de.combineFeatures=de.combineNotebooksFeatures=de.combineLanguagesFeatures=de.combineWorkspaceFeatures=de.combineWindowFeatures=de.combineClientFeatures=de.combineTracerFeatures=de.combineTelemetryFeatures=de.combineConsoleFeatures=de._NotebooksImpl=de._LanguagesImpl=de.BulkUnregistration=de.BulkRegistration=de.ErrorMessageTracker=void 0;var U=We(),Ht=Wo(),Kf=Lf(),Z=cb(),l_=lb(),u_=ub(),f_=fb(),d_=Bf(),h_=db(),p_=hb(),m_=pb(),g_=mb(),y_=yb(),b_=Tb(),T_=vb(),v_=Sb(),S_=Hf(),k_=Eb();function Yf(n){if(n!==null)return n}var zf=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};de.ErrorMessageTracker=zf;var Ga=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Gf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let i={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showWarningMessage(e,...t){let i={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showInformationMessage(e,...t){let i={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}},wb=(0,h_.ShowDocumentFeature)((0,Z.ProgressFeature)(Gf)),Nb;(function(n){function e(){return new Xa}n.create=e})(Nb||(de.BulkRegistration=Nb={}));var Xa=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let i=Ht.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);let r=Kf.generateUuid();this._registrations.push({id:r,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},_b;(function(n){function e(){return new ws(void 0,[])}n.create=e})(_b||(de.BulkUnregistration=_b={}));var ws=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let i of this._unregistrations.values())e.push(i);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Ht.string(e)?e:e.method,i=this._unregistrations.get(t);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(U.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(t)},s=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},Qa=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,i){return e instanceof Xa?this.registerMany(e):e instanceof ws?this.registerSingle1(e,t,i):this.registerSingle2(e,t)}registerSingle1(e,t,i){let r=Ht.string(t)?t:t.method,s=Kf.generateUuid(),o={registrations:[{id:s,method:r,registerOptions:i||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:r}),e),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(e,t){let i=Ht.string(e)?e:e.method,r=Kf.generateUuid(),s={registrations:[{id:r,method:i,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,s).then(o=>U.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let i={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new ws(this._connection,t.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}},Xf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(r){return r&&!!r.edit}let i=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,i)}},Pb=(0,p_.FileOperationsFeature)((0,u_.WorkspaceFoldersFeature)((0,l_.ConfigurationFeature)(Xf))),Ja=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Za=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},ec=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._LanguagesImpl=ec;var Db=(0,b_.FoldingRangeFeature)((0,k_.MonikerFeature)((0,v_.DiagnosticFeature)((0,T_.InlayHintFeature)((0,y_.InlineValueFeature)((0,g_.TypeHierarchyFeature)((0,m_.LinkedEditingRangeFeature)((0,d_.SemanticTokensFeature)((0,f_.CallHierarchyFeature)(ec))))))))),tc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._NotebooksImpl=tc;var Rb=(0,S_.NotebookSyncFeature)(tc);function Cb(n,e){return function(t){return e(n(t))}}de.combineConsoleFeatures=Cb;function Ob(n,e){return function(t){return e(n(t))}}de.combineTelemetryFeatures=Ob;function Ab(n,e){return function(t){return e(n(t))}}de.combineTracerFeatures=Ab;function Ib(n,e){return function(t){return e(n(t))}}de.combineClientFeatures=Ib;function Lb(n,e){return function(t){return e(n(t))}}de.combineWindowFeatures=Lb;function xb(n,e){return function(t){return e(n(t))}}de.combineWorkspaceFeatures=xb;function Mb(n,e){return function(t){return e(n(t))}}de.combineLanguagesFeatures=Mb;function qb(n,e){return function(t){return e(n(t))}}de.combineNotebooksFeatures=qb;function E_(n,e){function t(r,s,o){return r&&s?o(r,s):r||s}return{__brand:"features",console:t(n.console,e.console,Cb),tracer:t(n.tracer,e.tracer,Ab),telemetry:t(n.telemetry,e.telemetry,Ob),client:t(n.client,e.client,Ib),window:t(n.window,e.window,Lb),workspace:t(n.workspace,e.workspace,xb),languages:t(n.languages,e.languages,Mb),notebooks:t(n.notebooks,e.notebooks,qb)}}de.combineFeatures=E_;function w_(n,e,t){let i=t&&t.console?new(t.console(Ga)):new Ga,r=n(i);i.rawAttach(r);let s=t&&t.tracer?new(t.tracer(Ja)):new Ja,o=t&&t.telemetry?new(t.telemetry(Za)):new Za,a=t&&t.client?new(t.client(Qa)):new Qa,c=t&&t.window?new(t.window(wb)):new wb,l=t&&t.workspace?new(t.workspace(Pb)):new Pb,u=t&&t.languages?new(t.languages(Db)):new Db,d=t&&t.notebooks?new(t.notebooks(Rb)):new Rb,p=[i,s,o,a,c,l,u,d];function g(v){return v instanceof Promise?v:Ht.thenable(v)?new Promise((T,N)=>{v.then(L=>T(L),L=>N(L))}):Promise.resolve(v)}let _,b,w,R={listen:()=>r.listen(),sendRequest:(v,...T)=>r.sendRequest(Ht.string(v)?v:v.method,...T),onRequest:(v,T)=>r.onRequest(v,T),sendNotification:(v,T)=>{let N=Ht.string(v)?v:v.method;return r.sendNotification(N,T)},onNotification:(v,T)=>r.onNotification(v,T),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:v=>(b=v,{dispose:()=>{b=void 0}}),onInitialized:v=>r.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(_=v,{dispose:()=>{_=void 0}}),onExit:v=>(w=v,{dispose:()=>{w=void 0}}),get console(){return i},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>r.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>r.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>r.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>r.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>r.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>r.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>r.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>r.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>r.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>r.onRequest(U.HoverRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onCompletion:v=>r.onRequest(U.CompletionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCompletionResolve:v=>r.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>r.onRequest(U.SignatureHelpRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDeclaration:v=>r.onRequest(U.DeclarationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDefinition:v=>r.onRequest(U.DefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onTypeDefinition:v=>r.onRequest(U.TypeDefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onImplementation:v=>r.onRequest(U.ImplementationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onReferences:v=>r.onRequest(U.ReferencesRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentHighlight:v=>r.onRequest(U.DocumentHighlightRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentSymbol:v=>r.onRequest(U.DocumentSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbol:v=>r.onRequest(U.WorkspaceSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbolResolve:v=>r.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>r.onRequest(U.CodeActionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeActionResolve:v=>r.onRequest(U.CodeActionResolveRequest.type,(T,N)=>v(T,N)),onCodeLens:v=>r.onRequest(U.CodeLensRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeLensResolve:v=>r.onRequest(U.CodeLensResolveRequest.type,(T,N)=>v(T,N)),onDocumentFormatting:v=>r.onRequest(U.DocumentFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentRangeFormatting:v=>r.onRequest(U.DocumentRangeFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentOnTypeFormatting:v=>r.onRequest(U.DocumentOnTypeFormattingRequest.type,(T,N)=>v(T,N)),onRenameRequest:v=>r.onRequest(U.RenameRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onPrepareRename:v=>r.onRequest(U.PrepareRenameRequest.type,(T,N)=>v(T,N)),onDocumentLinks:v=>r.onRequest(U.DocumentLinkRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentLinkResolve:v=>r.onRequest(U.DocumentLinkResolveRequest.type,(T,N)=>v(T,N)),onDocumentColor:v=>r.onRequest(U.DocumentColorRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onColorPresentation:v=>r.onRequest(U.ColorPresentationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onFoldingRanges:v=>r.onRequest(U.FoldingRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onSelectionRanges:v=>r.onRequest(U.SelectionRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onExecuteCommand:v=>r.onRequest(U.ExecuteCommandRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),dispose:()=>r.dispose()};for(let v of p)v.attach(R);return r.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Ht.string(v.trace)&&(s.trace=U.Trace.fromString(v.trace));for(let T of p)T.initialize(v.capabilities);if(b){let T=b(v,new U.CancellationTokenSource().token,(0,Z.attachWorkDone)(r,v),void 0);return g(T).then(N=>{if(N instanceof U.ResponseError)return N;let L=N;L||(L={capabilities:{}});let q=L.capabilities;q||(q={},L.capabilities=q),q.textDocumentSync===void 0||q.textDocumentSync===null?q.textDocumentSync=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None:!Ht.number(q.textDocumentSync)&&!Ht.number(q.textDocumentSync.change)&&(q.textDocumentSync.change=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(q);return L})}else{let T={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let N of p)N.fillServerCapabilities(T.capabilities);return T}}),r.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new U.CancellationTokenSource().token)}),r.onNotification(U.ExitNotification.type,()=>{try{w&&w()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),r.onNotification(U.SetTraceNotification.type,v=>{s.trace=U.Trace.fromString(v.value)}),R}de.createConnection=w_});var Fb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.resolveModulePath=Ot.FileSystem=Ot.resolveGlobalYarnPath=Ot.resolveGlobalNodePath=Ot.resolve=Ot.uriToFilePath=void 0;var N_=require("url"),rn=require("path"),Jf=require("fs"),nd=require("child_process");function __(n){let e=N_.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var i=0,r=t.length;i<r;i++)t[i]=decodeURIComponent(t[i]);if(process.platform==="win32"&&t.length>1){let s=t[0],o=t[1];s.length===0&&o.length>1&&o[1]===":"&&t.shift()}return rn.normalize(t.join("/"))}Ot.uriToFilePath=__;function Zf(){return process.platform==="win32"}function nc(n,e,t,i){let r="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Jf.existsSync(e)&&(l[r]?l[r]=e+rn.delimiter+l[r]:l[r]=e,i&&i(`NODE_PATH value is: ${l[r]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,nd.fork)("",[],{cwd:t,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",p=>{a(p)}),u.on("message",p=>{p.c==="r"&&(u.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}Ot.resolve=nc;function ed(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(s=>t[s]=process.env[s]),t.NO_UPDATE_NOTIFIER="true";let i={encoding:"utf8",env:t};Zf()&&(e="npm.cmd",i.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,nd.spawnSync)(e,["config","get","prefix"],i).stdout;if(!s){n&&n("'npm config get prefix' didn't return a value.");return}let o=s.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Zf()?rn.join(o,"node_modules"):rn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}Ot.resolveGlobalNodePath=ed;function P_(n){let e="yarn",t={encoding:"utf8"};Zf()&&(e="yarn.cmd",t.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let r=(0,nd.spawnSync)(e,["global","dir","--json"],t),s=r.stdout;if(!s){n&&(n("'yarn global dir' didn't return a value."),r.stderr&&n(r.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return rn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",i)}}Ot.resolveGlobalYarnPath=P_;var td;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Jf.existsSync(__filename.toUpperCase())||!Jf.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function i(r,s){return t()?rn.normalize(s).indexOf(rn.normalize(r))===0:rn.normalize(s).toLowerCase().indexOf(rn.normalize(r).toLowerCase())===0}n.isParent=i})(td||(Ot.FileSystem=td={}));function D_(n,e,t,i){return t?(rn.isAbsolute(t)||(t=rn.join(n,t)),nc(e,t,t,i).then(r=>td.isParent(t,r)?r:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,r=>nc(e,ed(i),n,i))):nc(e,ed(i),n,i)}Ot.resolveModulePath=D_});var id=C((HI,Bb)=>{"use strict";Bb.exports=We()});var jb=C(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.InlineCompletionFeature=void 0;var R_=We(),C_=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(R_.InlineCompletionRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};ic.InlineCompletionFeature=C_});var Wb=C(bt=>{"use strict";var O_=bt&&bt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),$b=bt&&bt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&O_(e,n,t)};Object.defineProperty(bt,"__esModule",{value:!0});bt.ProposedFeatures=bt.NotebookDocuments=bt.TextDocuments=bt.SemanticTokensBuilder=void 0;var A_=Bf();Object.defineProperty(bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return A_.SemanticTokensBuilder}});var I_=jb();$b(We(),bt);var L_=Wf();Object.defineProperty(bt,"TextDocuments",{enumerable:!0,get:function(){return L_.TextDocuments}});var x_=Hf();Object.defineProperty(bt,"NotebookDocuments",{enumerable:!0,get:function(){return x_.NotebookDocuments}});$b(Qf(),bt);var Ub;(function(n){n.all={__brand:"features",languages:I_.InlineCompletionFeature}})(Ub||(bt.ProposedFeatures=Ub={}))});var Q=C(Yt=>{"use strict";var M_=Yt&&Yt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Kb=Yt&&Yt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&M_(e,n,t)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.createConnection=Yt.Files=void 0;var Vb=require("node:util"),rd=Wo(),q_=Qf(),Ns=Fb(),ji=id();Kb(id(),Yt);Kb(Wb(),Yt);var Hb;(function(n){n.uriToFilePath=Ns.uriToFilePath,n.resolveGlobalNodePath=Ns.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ns.resolveGlobalYarnPath,n.resolve=Ns.resolve,n.resolveModulePath=Ns.resolveModulePath})(Hb||(Yt.Files=Hb={}));var Yb;function rc(){if(Yb!==void 0)try{Yb.end()}catch{}}var _r=!1,zb;function F_(){let n="--clientProcessId";function e(t){try{let i=parseInt(t);isNaN(i)||(zb=setInterval(()=>{try{process.kill(i,0)}catch{rc(),process.exit(_r?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let i=process.argv[t];if(i===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let r=i.split("=");r[0]===n&&e(r[1])}}}F_();var B_={initialize:n=>{let e=n.processId;rd.number(e)&&zb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(_r?0:1)}},3e3)},get shutdownReceived(){return _r},set shutdownReceived(n){_r=n},exit:n=>{rc(),process.exit(n)}};function j_(n,e,t,i){let r,s,o,a;return n!==void 0&&n.__brand==="features"&&(r=n,n=e,e=t,t=i),ji.ConnectionStrategy.is(n)||ji.ConnectionOptions.is(n)?a=n:(s=n,o=e,a=t),U_(s,o,a,r)}Yt.createConnection=j_;function U_(n,e,t,i){let r=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let p=u[d];if(p==="--node-ipc"){n=new ji.IPCMessageReader(process),e=new ji.IPCMessageWriter(process);break}else if(p==="--stdio"){r=!0,n=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(u[d+1]);break}else if(p==="--pipe"){l=u[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,ji.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ji.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(rd.func(n.read)&&rd.func(n.on)){let c=n;c.on("end",()=>{rc(),process.exit(_r?0:1)}),c.on("close",()=>{rc(),process.exit(_r?0:1)})}let a=c=>{let l=(0,ji.createProtocolConnection)(n,e,c,t);return r&&$_(c),l};return(0,q_.createConnection)(a,B_,i)}function $_(n){function e(i){return i.map(r=>typeof r=="string"?r:(0,Vb.inspect)(r)).join(" ")}let t=new Map;console.assert=function(r,...s){if(!r)if(s.length===0)n.error("Assertion failed");else{let[o,...a]=s;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(r="default"){let s=String(r),o=t.get(s)??0;o+=1,t.set(s,o),n.log(`${s}: ${s}`)},console.countReset=function(r){r===void 0?t.clear():t.delete(String(r))},console.debug=function(...r){n.log(e(r))},console.dir=function(r,s){n.log((0,Vb.inspect)(r,s))},console.log=function(...r){n.log(e(r))},console.error=function(...r){n.error(e(r))},console.trace=function(...r){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";r.length!==0&&(o+=`: ${e(r)}`),n.log(`${o}
|
|
37
|
+
${s}`)},console.warn=function(...r){n.warn(e(r))}}});var Xb=C((XI,Gb)=>{"use strict";Gb.exports=Q()});var le=C(ht=>{"use strict";var gd=Symbol.for("yaml.alias"),pv=Symbol.for("yaml.document"),Bc=Symbol.for("yaml.map"),mv=Symbol.for("yaml.pair"),yd=Symbol.for("yaml.scalar"),jc=Symbol.for("yaml.seq"),Un=Symbol.for("yaml.node.type"),kP=n=>!!n&&typeof n=="object"&&n[Un]===gd,EP=n=>!!n&&typeof n=="object"&&n[Un]===pv,wP=n=>!!n&&typeof n=="object"&&n[Un]===Bc,NP=n=>!!n&&typeof n=="object"&&n[Un]===mv,gv=n=>!!n&&typeof n=="object"&&n[Un]===yd,_P=n=>!!n&&typeof n=="object"&&n[Un]===jc;function yv(n){if(n&&typeof n=="object")switch(n[Un]){case Bc:case jc:return!0}return!1}function PP(n){if(n&&typeof n=="object")switch(n[Un]){case gd:case Bc:case yd:case jc:return!0}return!1}var DP=n=>(gv(n)||yv(n))&&!!n.anchor;ht.ALIAS=gd;ht.DOC=pv;ht.MAP=Bc;ht.NODE_TYPE=Un;ht.PAIR=mv;ht.SCALAR=yd;ht.SEQ=jc;ht.hasAnchor=DP;ht.isAlias=kP;ht.isCollection=yv;ht.isDocument=EP;ht.isMap=wP;ht.isNode=PP;ht.isPair=NP;ht.isScalar=gv;ht.isSeq=_P});var Os=C(bd=>{"use strict";var tt=le(),At=Symbol("break visit"),bv=Symbol("skip children"),Nn=Symbol("remove node");function Uc(n,e){let t=Tv(e);tt.isDocument(n)?qr(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):qr(null,n,t,Object.freeze([]))}Uc.BREAK=At;Uc.SKIP=bv;Uc.REMOVE=Nn;function qr(n,e,t,i){let r=vv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Sv(n,i,r),qr(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=qr(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=qr("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=qr("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}async function $c(n,e){let t=Tv(e);tt.isDocument(n)?await Fr(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):await Fr(null,n,t,Object.freeze([]))}$c.BREAK=At;$c.SKIP=bv;$c.REMOVE=Nn;async function Fr(n,e,t,i){let r=await vv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Sv(n,i,r),Fr(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await Fr(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=await Fr("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=await Fr("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}function Tv(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function vv(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(tt.isMap(e))return t.Map?.(n,e,i);if(tt.isSeq(e))return t.Seq?.(n,e,i);if(tt.isPair(e))return t.Pair?.(n,e,i);if(tt.isScalar(e))return t.Scalar?.(n,e,i);if(tt.isAlias(e))return t.Alias?.(n,e,i)}function Sv(n,e,t){let i=e[e.length-1];if(tt.isCollection(i))i.items[n]=t;else if(tt.isPair(i))n==="key"?i.key=t:i.value=t;else if(tt.isDocument(i))i.contents=t;else{let r=tt.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}bd.visit=Uc;bd.visitAsync=$c});var Td=C(Ev=>{"use strict";var kv=le(),RP=Os(),CP={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},OP=n=>n.replace(/[!,[\]{}]/g,e=>CP[e]),As=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+OP(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&kv.isNode(e.contents)){let s={};RP.visit(e.contents,(o,a)=>{kv.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
|
|
38
|
+
`)}};As.defaultYaml={explicit:!1,version:"1.2"};As.defaultTags={"!!":"tag:yaml.org,2002:"};Ev.Directives=As});var Wc=C(Is=>{"use strict";var wv=le(),AP=Os();function IP(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Nv(n){let e=new Set;return AP.visit(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function _v(n,e){for(let t=1;;++t){let i=`${n}${t}`;if(!e.has(i))return i}}function LP(n,e){let t=[],i=new Map,r=null;return{onAnchor:s=>{t.push(s),r||(r=Nv(n));let o=_v(e,r);return r.add(o),o},setAnchors:()=>{for(let s of t){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(wv.isScalar(o.node)||wv.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}Is.anchorIsValid=IP;Is.anchorNames=Nv;Is.createNodeAnchors=LP;Is.findNewAnchor=_v});var vd=C(Pv=>{"use strict";function Ls(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=Ls(n,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=Ls(n,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Ls(n,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=Ls(n,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return n.call(e,t,i)}Pv.applyReviver=Ls});var mi=C(Rv=>{"use strict";var xP=le();function Dv(n,e,t){if(Array.isArray(n))return n.map((i,r)=>Dv(i,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!xP.hasAnchor(n))return n.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=s=>{i.res=s,delete t.onCreate};let r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}Rv.toJS=Dv});var Vc=C(Ov=>{"use strict";var MP=vd(),Cv=le(),qP=mi(),Sd=class{constructor(e){Object.defineProperty(this,Cv.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Cv.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=qP.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?MP.applyReviver(s,{"":a},"",a):a}};Ov.NodeBase=Sd});var xs=C(Iv=>{"use strict";var FP=Wc(),Av=Os(),Hc=le(),BP=Vc(),jP=mi(),kd=class extends BP.NodeBase{constructor(e){super(Hc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Av.visit(e,{Node:(i,r)=>{if(r===this)return Av.visit.BREAK;r.anchor===this.source&&(t=r)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=t,o=this.resolve(r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(jP.toJS(o,null,t),a=i.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Yc(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,i){let r=`*${this.source}`;if(e){if(FP.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Yc(n,e,t){if(Hc.isAlias(e)){let i=e.resolve(n),r=t&&i&&t.get(i);return r?r.count*r.aliasCount:0}else if(Hc.isCollection(e)){let i=0;for(let r of e.items){let s=Yc(n,r,t);s>i&&(i=s)}return i}else if(Hc.isPair(e)){let i=Yc(n,e.key,t),r=Yc(n,e.value,t);return Math.max(i,r)}return 1}Iv.Alias=kd});var Qe=C(Ed=>{"use strict";var UP=le(),$P=Vc(),WP=mi(),VP=n=>!n||typeof n!="function"&&typeof n!="object",gi=class extends $P.NodeBase{constructor(e){super(UP.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:WP.toJS(this.value,e,t)}toString(){return String(this.value)}};gi.BLOCK_FOLDED="BLOCK_FOLDED";gi.BLOCK_LITERAL="BLOCK_LITERAL";gi.PLAIN="PLAIN";gi.QUOTE_DOUBLE="QUOTE_DOUBLE";gi.QUOTE_SINGLE="QUOTE_SINGLE";Ed.Scalar=gi;Ed.isScalarValue=VP});var Ms=C(xv=>{"use strict";var HP=xs(),Wi=le(),Lv=Qe(),YP="tag:yaml.org,2002:";function KP(n,e,t){if(e){let i=t.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>i.identify?.(n)&&!i.format)}function zP(n,e,t){if(Wi.isDocument(n)&&(n=n.contents),Wi.isNode(n))return n;if(Wi.isPair(n)){let d=t.schema[Wi.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=t,c;if(i&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=r(n)),new HP.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=YP+e.slice(2));let l=KP(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new Lv.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[Wi.MAP]:Symbol.iterator in Object(n)?o[Wi.SEQ]:o[Wi.MAP]}s&&(s(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new Lv.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}xv.createNode=zP});var zc=C(Kc=>{"use strict";var GP=Ms(),_n=le(),XP=Vc();function wd(n,e,t){let i=t;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return GP.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Mv=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Nd=class extends XP.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>_n.isNode(i)||_n.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Mv(e))this.add(t);else{let[i,...r]=e,s=this.get(i,!0);if(_n.isCollection(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(i,wd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let r=this.get(t,!0);if(_n.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!t&&_n.isScalar(s)?s.value:s:_n.isCollection(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!_n.isPair(t))return!1;let i=t.value;return i==null||e&&_n.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let r=this.get(t,!0);return _n.isCollection(r)?r.hasIn(i):!1}setIn(e,t){let[i,...r]=e;if(r.length===0)this.set(i,t);else{let s=this.get(i,!0);if(_n.isCollection(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(i,wd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Kc.Collection=Nd;Kc.collectionFromPath=wd;Kc.isEmptyPath=Mv});var qs=C(Gc=>{"use strict";var QP=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function _d(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var JP=(n,e,t)=>n.endsWith(`
|
|
39
39
|
`)?_d(t,e):t.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+_d(t,e):(n.endsWith(" ")?"":" ")+t;Gc.indentComment=_d;Gc.lineComment=
|
|
41
|
+
`+_d(t,e):(n.endsWith(" ")?"":" ")+t;Gc.indentComment=_d;Gc.lineComment=JP;Gc.stringifyComment=QP});var Fv=C(Fs=>{"use strict";var ZP="flow",Pd="block",Xc="quoted";function eD(n,e,t="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return n;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(n.length<=c)return n;let l=[],u={},d=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):d=r-i);let p,g,_=!1,b=-1,w=-1,R=-1;t===Pd&&(b=qv(n,b,e.length),b!==-1&&(d=b+c));for(let T;T=n[b+=1];){if(t===Xc&&T==="\\"){switch(w=b,n[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}R=b}if(T===`
|
|
42
42
|
`)t===Pd&&(b=qv(n,b,e.length)),d=b+e.length+c,p=void 0;else{if(T===" "&&g&&g!==" "&&g!==`
|
|
43
43
|
`&&g!==" "){let N=n[b+1];N&&N!==" "&&N!==`
|
|
44
44
|
`&&N!==" "&&(p=b)}if(b>=d)if(p)l.push(p),d=p+c,p=void 0;else if(t===Xc){for(;g===" "||g===" ";)g=T,T=n[b+=1],_=!0;let N=b>R+1?b-2:w-1;if(u[N])return n;l.push(N),u[N]=!0,d=N+c,p=void 0}else _=!0}g=T}if(_&&a&&a(),l.length===0)return n;o&&o();let v=n.slice(0,l[0]);for(let T=0;T<l.length;++T){let N=l[T],L=l[T+1]||n.length;N===0?v=`
|
|
45
45
|
${e}${n.slice(0,L)}`:(t===Xc&&u[N]&&(v+=`${n[N]}\\`),v+=`
|
|
46
46
|
${e}${n.slice(N+1,L)}`)}return v}function qv(n,e,t){let i=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
|
|
47
|
-
`);i=e,r=e+1,s=n[r]}return i}
|
|
48
|
-
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function
|
|
47
|
+
`);i=e,r=e+1,s=n[r]}return i}Fs.FOLD_BLOCK=Pd;Fs.FOLD_FLOW=ZP;Fs.FOLD_QUOTED=Xc;Fs.foldFlowLines=eD});var js=C(Bv=>{"use strict";var cn=Qe(),yi=Fv(),Jc=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Zc=n=>/^(%|---|\.\.\.)/m.test(n);function tD(n,e,t){if(!e||e<0)return!1;let i=e-t,r=n.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(n[s]===`
|
|
48
|
+
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Bs(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Zc(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||t[c+2]==='"'||t.length<r)c+=1;else{for(o+=t.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
51
51
|
`,c+=2;o+=s,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,i?o:yi.foldFlowLines(o,s,yi.FOLD_QUOTED,Jc(e,!1))}function Dd(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return
|
|
53
|
-
${t}`)+"'";return e.implicitKey?i:yi.foldFlowLines(i,t,yi.FOLD_FLOW,Jc(e,!1))}function
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Bs(n,e);let t=e.indent||(Zc(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${t}`)+"'";return e.implicitKey?i:yi.foldFlowLines(i,t,yi.FOLD_FLOW,Jc(e,!1))}function Br(n,e){let{singleQuote:t}=e.options,i;if(t===!1)i=Bs;else{let r=n.includes('"'),s=n.includes("'");r&&!s?i=Dd:s&&!r?i=Bs:i=t?Dd:Bs}return i(n,e)}var Rd;try{Rd=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{Rd=/\n+(?!\n|$)/g}function Qc({comment:n,type:e,value:t},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return
|
|
56
|
+
|$)`,"g")}catch{Rd=/\n+(?!\n|$)/g}function Qc({comment:n,type:e,value:t},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Br(t,i);let l=i.indent||(i.forceBlockIndent||Zc(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===cn.Scalar.BLOCK_FOLDED?!1:e===cn.Scalar.BLOCK_LITERAL?!0:!tD(t,c,l.length);if(!t)return u?`|
|
|
57
57
|
`:`>
|
|
58
58
|
`;let d,p;for(p=t.length;p>0;--p){let L=t[p-1];if(L!==`
|
|
59
59
|
`&&L!==" "&&L!==" ")break}let g=t.substring(p),_=g.indexOf(`
|
|
@@ -62,47 +62,47 @@ ${t}`)+"'";return e.implicitKey?i:yi.foldFlowLines(i,t,yi.FOLD_FLOW,Jc(e,!1))}fu
|
|
|
62
62
|
`)R=w;else break}let v=t.substring(0,R<w?R+1:w);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let N=(b?l?"2":"1":"")+d;if(n&&(N+=" "+a(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let L=t.replace(/\n+/g,`
|
|
63
63
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),q=!1,H=Jc(i,!0);o!=="folded"&&e!==cn.Scalar.BLOCK_FOLDED&&(H.onOverflow=()=>{q=!0});let j=yi.foldFlowLines(`${v}${L}${g}`,l,yi.FOLD_BLOCK,H);if(!q)return`>${N}
|
|
64
64
|
${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${N}
|
|
65
|
-
${l}${v}${t}${g}`}function
|
|
66
|
-
`)||u&&/[[\]{},]/.test(s))return
|
|
67
|
-
`)?
|
|
68
|
-
`))return Qc(n,e,t,i);if(Zc(s)){if(c==="")return e.forceBlockIndent=!0,Qc(n,e,t,i);if(a&&c===l)return
|
|
69
|
-
${c}`);if(o){let p=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(d),{compat:g,tags:_}=e.doc.schema;if(_.some(p)||g?.some(p))return
|
|
70
|
-
${e.indent}${a}`:a}Cd.createStringifyContext=
|
|
71
|
-
${a}:`):(w=`${w}:`,p&&(w
|
|
65
|
+
${l}${v}${t}${g}`}function nD(n,e,t,i){let{type:r,value:s}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(s))return Br(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
67
|
+
`)?Br(s,e):Qc(n,e,t,i);if(!a&&!u&&r!==cn.Scalar.PLAIN&&s.includes(`
|
|
68
|
+
`))return Qc(n,e,t,i);if(Zc(s)){if(c==="")return e.forceBlockIndent=!0,Qc(n,e,t,i);if(a&&c===l)return Br(s,e)}let d=s.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let p=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(d),{compat:g,tags:_}=e.doc.schema;if(_.some(p)||g?.some(p))return Br(s,e)}return a?d:yi.foldFlowLines(d,c,yi.FOLD_FLOW,Jc(e,!1))}function iD(n,e,t,i){let{implicitKey:r,inFlow:s}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==cn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=cn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case cn.Scalar.BLOCK_FOLDED:case cn.Scalar.BLOCK_LITERAL:return r||s?Br(o.value,e):Qc(o,e,t,i);case cn.Scalar.QUOTE_DOUBLE:return Bs(o.value,e);case cn.Scalar.QUOTE_SINGLE:return Dd(o.value,e);case cn.Scalar.PLAIN:return nD(o,e,t,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}Bv.stringifyString=iD});var Us=C(Cd=>{"use strict";var rD=Wc(),bi=le(),sD=qs(),oD=js();function aD(n,e){let t=Object.assign({blockQuote:!0,commentString:sD.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function cD(n,e){if(e.tag){let r=n.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let t,i;if(bi.isScalar(e)){i=e.value;let r=n.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}t=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,t=n.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!t){let r=i?.constructor?.name??typeof i;throw new Error(`Tag not resolved for ${r} value`)}return t}function lD(n,e,{anchors:t,doc:i}){if(!i.directives)return"";let r=[],s=(bi.isScalar(n)||bi.isCollection(n))&&n.anchor;s&&rD.anchorIsValid(s)&&(t.add(s),r.push(`&${s}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&r.push(i.directives.tagString(o)),r.join(" ")}function uD(n,e,t,i){if(bi.isPair(n))return n.toString(e,t,i);if(bi.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r,s=bi.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>r=c});r||(r=cD(e.doc.schema.tags,s));let o=lD(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,t,i):bi.isScalar(s)?oD.stringifyString(s,e,t,i):s.toString(e,t,i);return o?bi.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}Cd.createStringifyContext=aD;Cd.stringify=uD});var Wv=C($v=>{"use strict";var $n=le(),jv=Qe(),Uv=Us(),$s=qs();function fD({key:n,value:e},t,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,p=$n.isNode(n)&&n.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if($n.isCollection(n)||!$n.isNode(n)&&typeof n=="object"){let H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let g=!d&&(!n||p&&e==null&&!t.inFlow||$n.isCollection(n)||($n.isScalar(n)?n.type===jv.Scalar.BLOCK_FOLDED||n.type===jv.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(d||!s),indent:a+c});let _=!1,b=!1,w=Uv.stringify(n,t,()=>_=!0,()=>b=!0);if(!g&&!t.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(s||e==null)return _&&i&&i(),w===""?"?":g?`? ${w}`:w}else if(s&&!d||e==null&&g)return w=`? ${w}`,p&&!_?w+=$s.lineComment(w,t.indent,l(p)):b&&r&&r(),w;_&&(p=null),g?(p&&(w+=$s.lineComment(w,t.indent,l(p))),w=`? ${w}
|
|
71
|
+
${a}:`):(w=`${w}:`,p&&(w+=$s.lineComment(w,t.indent,l(p))));let R,v,T;$n.isNode(e)?(R=!!e.spaceBefore,v=e.commentBefore,T=e.comment):(R=!1,v=null,T=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!p&&$n.isScalar(e)&&(t.indentAtStart=w.length+1),b=!1,!u&&c.length>=2&&!t.inFlow&&!g&&$n.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,L=Uv.stringify(e,t,()=>N=!0,()=>b=!0),q=" ";if(p||R||v){if(q=R?`
|
|
72
72
|
`:"",v){let H=l(v);q+=`
|
|
73
|
-
${
|
|
73
|
+
${$s.indentComment(H,t.indent)}`}L===""&&!t.inFlow?q===`
|
|
74
74
|
`&&(q=`
|
|
75
75
|
|
|
76
76
|
`):q+=`
|
|
77
77
|
${t.indent}`}else if(!g&&$n.isCollection(e)){let H=L[0],j=L.indexOf(`
|
|
78
78
|
`),ie=j!==-1,Be=t.inFlow??e.flow??e.items.length===0;if(ie||!Be){let Et=!1;if(ie&&(H==="&"||H==="!")){let ce=L.indexOf(" ");H==="&"&&ce!==-1&&ce<j&&L[ce+1]==="!"&&(ce=L.indexOf(" ",ce+1)),(ce===-1||j<ce)&&(Et=!0)}Et||(q=`
|
|
79
79
|
${t.indent}`)}}else(L===""||L[0]===`
|
|
80
|
-
`)&&(q="");return w+=q+L,t.inFlow?N&&i&&i():T&&!N?w
|
|
80
|
+
`)&&(q="");return w+=q+L,t.inFlow?N&&i&&i():T&&!N?w+=$s.lineComment(w,t.indent,l(T)):b&&r&&r(),w}$v.stringifyPair=fD});var Ad=C(Od=>{"use strict";function dD(n,...e){n==="debug"&&console.log(...e)}function hD(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Od.debug=dD;Od.warn=hD});var il=C(nl=>{"use strict";var Ws=le(),Vv=Qe(),el="<<",tl={identify:n=>n===el||typeof n=="symbol"&&n.description===el,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Vv.Scalar(Symbol(el)),{addToJSMap:Hv}),stringify:()=>el},pD=(n,e)=>(tl.identify(e)||Ws.isScalar(e)&&(!e.type||e.type===Vv.Scalar.PLAIN)&&tl.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===tl.tag&&t.default);function Hv(n,e,t){if(t=n&&Ws.isAlias(t)?t.resolve(n.doc):t,Ws.isSeq(t))for(let i of t.items)Id(n,e,i);else if(Array.isArray(t))for(let i of t)Id(n,e,i);else Id(n,e,t)}function Id(n,e,t){let i=n&&Ws.isAlias(t)?t.resolve(n.doc):t;if(!Ws.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,n,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}nl.addMergeToJSMap=Hv;nl.isMergeKey=pD;nl.merge=tl});var xd=C(zv=>{"use strict";var mD=Ad(),Yv=il(),gD=Us(),Kv=le(),Ld=mi();function yD(n,e,{key:t,value:i}){if(Kv.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(Yv.isMergeKey(n,t))Yv.addMergeToJSMap(n,e,i);else{let r=Ld.toJS(t,"",n);if(e instanceof Map)e.set(r,Ld.toJS(i,r,n));else if(e instanceof Set)e.add(r);else{let s=bD(t,r,n),o=Ld.toJS(i,s,n);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function bD(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Kv.isNode(n)&&t?.doc){let i=gD.createStringifyContext(t.doc,{});i.anchors=new Set;for(let s of t.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=n.toString(i);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),mD.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}zv.addPairToJSMap=yD});var Ti=C(Md=>{"use strict";var Gv=Ms(),TD=Wv(),vD=xd(),rl=le();function SD(n,e,t){let i=Gv.createNode(n,void 0,t),r=Gv.createNode(e,void 0,t);return new sl(i,r)}var sl=class n{constructor(e,t=null){Object.defineProperty(this,rl.NODE_TYPE,{value:rl.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return rl.isNode(t)&&(t=t.clone(e)),rl.isNode(i)&&(i=i.clone(e)),new n(t,i)}toJSON(e,t){let i=t?.mapAsMap?new Map:{};return vD.addPairToJSMap(t,i,this)}toString(e,t,i){return e?.doc?TD.stringifyPair(this,e,t,i):JSON.stringify(this)}};Md.Pair=sl;Md.createPair=SD});var qd=C(Qv=>{"use strict";var Vi=le(),Xv=Us(),ol=qs();function kD(n,e,t){return(e.inFlow??n.flow?wD:ED)(n,e,t)}function ED({comment:n,items:e},t,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:s,type:null}),d=!1,p=[];for(let _=0;_<e.length;++_){let b=e[_],w=null;if(Vi.isNode(b))!d&&b.spaceBefore&&p.push(""),al(t,p,b.commentBefore,d),b.comment&&(w=b.comment);else if(Vi.isPair(b)){let v=Vi.isNode(b.key)?b.key:null;v&&(!d&&v.spaceBefore&&p.push(""),al(t,p,v.commentBefore,d))}d=!1;let R=Xv.stringify(b,u,()=>w=null,()=>d=!0);w&&(R+=ol.lineComment(R,s,l(w))),d&&w&&(d=!1),p.push(i+R)}let g;if(p.length===0)g=r.start+r.end;else{g=p[0];for(let _=1;_<p.length;++_){let b=p[_];g+=b?`
|
|
81
81
|
${c}${b}`:`
|
|
82
82
|
`}}return n?(g+=`
|
|
83
|
-
`+ol.indentComment(l(n),c),a&&a()):d&&o&&o(),g}function
|
|
83
|
+
`+ol.indentComment(l(n),c),a&&a()):d&&o&&o(),g}function wD({items:n},e,{flowChars:t,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let _=0;_<n.length;++_){let b=n[_],w=null;if(Vi.isNode(b))b.spaceBefore&&d.push(""),al(e,d,b.commentBefore,!1),b.comment&&(w=b.comment);else if(Vi.isPair(b)){let v=Vi.isNode(b.key)?b.key:null;v&&(v.spaceBefore&&d.push(""),al(e,d,v.commentBefore,!1),v.comment&&(l=!0));let T=Vi.isNode(b.value)?b.value:null;T?(T.comment&&(w=T.comment),T.commentBefore&&(l=!0)):b.value==null&&v?.comment&&(w=v.comment)}w&&(l=!0);let R=Xv.stringify(b,c,()=>w=null);_<n.length-1&&(R+=","),w&&(R+=ol.lineComment(R,i,a(w))),!l&&(d.length>u||R.includes(`
|
|
84
84
|
`))&&(l=!0),d.push(R),u=d.length}let{start:p,end:g}=t;if(d.length===0)return p+g;if(!l){let _=d.reduce((b,w)=>b+w.length+2,2);l=e.options.lineWidth>0&&_>e.options.lineWidth}if(l){let _=p;for(let b of d)_+=b?`
|
|
85
85
|
${s}${r}${b}`:`
|
|
86
86
|
`;return`${_}
|
|
87
|
-
${r}${g}`}else return`${p}${o}${d.join(" ")}${o}${g}`}function al({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=ol.indentComment(e(i),n);t.push(s.trimStart())}}Qv.stringifyCollection=
|
|
88
|
-
`:" ")}return
|
|
87
|
+
${r}${g}`}else return`${p}${o}${d.join(" ")}${o}${g}`}function al({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=ol.indentComment(e(i),n);t.push(s.trimStart())}}Qv.stringifyCollection=kD});var Si=C(Bd=>{"use strict";var ND=qd(),_D=xd(),PD=zc(),vi=le(),cl=Ti(),DD=Qe();function Vs(n,e){let t=vi.isScalar(e)?e.value:e;for(let i of n)if(vi.isPair(i)&&(i.key===e||i.key===t||vi.isScalar(i.key)&&i.key.value===t))return i}var Fd=class extends PD.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(vi.MAP,e),this.items=[]}static from(e,t,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(t,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(cl.createPair(c,l,i))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let i;vi.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new cl.Pair(e,e?.value):i=new cl.Pair(e.key,e.value);let r=Vs(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${i.key} already set`);vi.isScalar(r.value)&&DD.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let t=Vs(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Vs(this.items,e)?.value;return(!t&&vi.isScalar(r)?r.value:r)??void 0}has(e){return!!Vs(this.items,e)}set(e,t){this.add(new cl.Pair(e,t),!0)}toJSON(e,t,i){let r=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let s of this.items)_D.addPairToJSMap(t,r,s);return r}toString(e,t,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!vi.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ND.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}};Bd.YAMLMap=Fd;Bd.findPair=Vs});var jr=C(Zv=>{"use strict";var RD=le(),Jv=Si(),CD={collection:"map",default:!0,nodeClass:Jv.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return RD.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Jv.YAMLMap.from(n,e,t)};Zv.map=CD});var ki=C(eS=>{"use strict";var OD=Ms(),AD=qd(),ID=zc(),ul=le(),LD=Qe(),xD=mi(),jd=class extends ID.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ul.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ll(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let i=ll(e);if(typeof i!="number")return;let r=this.items[i];return!t&&ul.isScalar(r)?r.value:r}has(e){let t=ll(e);return typeof t=="number"&&t<this.items.length}set(e,t){let i=ll(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];ul.isScalar(r)&&LD.isScalarValue(t)?r.value=t:this.items[i]=t}toJSON(e,t){let i=[];t?.onCreate&&t.onCreate(i);let r=0;for(let s of this.items)i.push(xD.toJS(s,String(r++),t));return i}toString(e,t,i){return e?AD.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){let c=t instanceof Set?a:String(o++);a=r.call(t,c,a)}s.items.push(OD.createNode(a,void 0,i))}}return s}};function ll(n){let e=ul.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}eS.YAMLSeq=jd});var Ur=C(nS=>{"use strict";var MD=le(),tS=ki(),qD={collection:"seq",default:!0,nodeClass:tS.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return MD.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>tS.YAMLSeq.from(n,e,t)};nS.seq=qD});var Hs=C(iS=>{"use strict";var FD=js(),BD={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),FD.stringifyString(n,e,t,i)}};iS.string=BD});var fl=C(oS=>{"use strict";var rS=Qe(),sS={identify:n=>n==null,createNode:()=>new rS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rS.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&sS.test.test(n)?n:e.options.nullStr};oS.nullTag=sS});var Ud=C(cS=>{"use strict";var jD=Qe(),aS={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new jD.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&aS.test.test(n)){let i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};cS.boolTag=aS});var $r=C(lS=>{"use strict";function UD({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}lS.stringifyNumber=UD});var Wd=C(dl=>{"use strict";var $D=Qe(),$d=$r(),WD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$d.stringifyNumber},VD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():$d.stringifyNumber(n)}},HD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new $D.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:$d.stringifyNumber};dl.float=HD;dl.floatExp=VD;dl.floatNaN=WD});var Hd=C(pl=>{"use strict";var uS=$r(),hl=n=>typeof n=="bigint"||Number.isInteger(n),Vd=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function fS(n,e,t){let{value:i}=n;return hl(i)&&i>=0?t+i.toString(e):uS.stringifyNumber(n)}var YD={identify:n=>hl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Vd(n,2,8,t),stringify:n=>fS(n,8,"0o")},KD={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Vd(n,0,10,t),stringify:uS.stringifyNumber},zD={identify:n=>hl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Vd(n,2,16,t),stringify:n=>fS(n,16,"0x")};pl.int=KD;pl.intHex=zD;pl.intOct=YD});var hS=C(dS=>{"use strict";var GD=jr(),XD=fl(),QD=Ur(),JD=Hs(),ZD=Ud(),Yd=Wd(),Kd=Hd(),eR=[GD.map,QD.seq,JD.string,XD.nullTag,ZD.boolTag,Kd.intOct,Kd.int,Kd.intHex,Yd.floatNaN,Yd.floatExp,Yd.float];dS.schema=eR});var gS=C(mS=>{"use strict";var tR=Qe(),nR=jr(),iR=Ur();function pS(n){return typeof n=="bigint"||Number.isInteger(n)}var ml=({value:n})=>JSON.stringify(n),rR=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:ml},{identify:n=>n==null,createNode:()=>new tR.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ml},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:ml},{identify:pS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>pS(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:ml}],sR={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},oR=[nR.map,iR.seq].concat(rR,sR);mS.schema=oR});var Gd=C(yS=>{"use strict";var zd=Qe(),aR=js(),cR={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,r,s){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=zd.Scalar.BLOCK_LITERAL),e!==zd.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=a.substr(p,c);a=u.join(e===zd.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return aR.stringifyString({comment:n,type:e,value:a},i,r,s)}};yS.binary=cR});var bl=C(yl=>{"use strict";var gl=le(),Xd=Ti(),lR=Qe(),uR=ki();function bS(n,e){if(gl.isSeq(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!gl.isPair(i)){if(gl.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Xd.Pair(new lR.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
89
89
|
${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
90
|
-
${s.comment}`:i.comment}i=r}n.items[t]=gl.isPair(i)?i:new Xd.Pair(i)}}else e("Expected a sequence for this tag");return n}function TS(n,e,t){let{replacer:i}=t,r=new lR.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Xd.createPair(a,c,t))}return r}var uR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bS,createNode:TS};yl.createPairs=TS;yl.pairs=uR;yl.resolvePairs=bS});var Zd=C(Jd=>{"use strict";var vS=le(),Qd=mi(),Hs=Si(),fR=ki(),SS=bl(),Vi=class n extends fR.YAMLSeq{constructor(){super(),this.add=Hs.YAMLMap.prototype.add.bind(this),this.delete=Hs.YAMLMap.prototype.delete.bind(this),this.get=Hs.YAMLMap.prototype.get.bind(this),this.has=Hs.YAMLMap.prototype.has.bind(this),this.set=Hs.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let r of this.items){let s,o;if(vS.isPair(r)?(s=Qd.toJS(r.key,"",t),o=Qd.toJS(r.value,s,t)):s=Qd.toJS(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,t,i){let r=SS.createPairs(e,t,i),s=new this;return s.items=r.items,s}};Vi.tag="tag:yaml.org,2002:omap";var dR={collection:"seq",identify:n=>n instanceof Map,nodeClass:Vi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=SS.resolvePairs(n,e),i=[];for(let{key:r}of t.items)vS.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Vi,t)},createNode:(n,e,t)=>Vi.from(n,e,t)};Jd.YAMLOMap=Vi;Jd.omap=dR});var _S=C(eh=>{"use strict";var kS=Qe();function ES({value:n,source:e},t){return e&&(n?wS:NS).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var wS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kS.Scalar(!0),stringify:ES},NS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kS.Scalar(!1),stringify:ES};eh.falseTag=NS;eh.trueTag=wS});var PS=C(Tl=>{"use strict";var hR=Qe(),th=Ur(),pR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:th.stringifyNumber},mR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():th.stringifyNumber(n)}},gR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new hR.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:th.stringifyNumber};Tl.float=gR;Tl.floatExp=mR;Tl.floatNaN=pR});var RS=C(Ks=>{"use strict";var DS=Ur(),Ys=n=>typeof n=="bigint"||Number.isInteger(n);function vl(n,e,t,{intAsBigInt:i}){let r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return r==="-"?BigInt(-1)*o:o}let s=parseInt(n,t);return r==="-"?-1*s:s}function nh(n,e,t){let{value:i}=n;if(Ys(i)){let r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return DS.stringifyNumber(n)}var yR={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>vl(n,2,2,t),stringify:n=>nh(n,2,"0b")},bR={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>vl(n,1,8,t),stringify:n=>nh(n,8,"0")},TR={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>vl(n,0,10,t),stringify:DS.stringifyNumber},vR={identify:Ys,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>vl(n,2,16,t),stringify:n=>nh(n,16,"0x")};Ks.int=TR;Ks.intBin=yR;Ks.intHex=vR;Ks.intOct=bR});var rh=C(ih=>{"use strict";var El=le(),Sl=Ti(),kl=Si(),Hi=class n extends kl.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;El.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Sl.Pair(e.key,null):t=new Sl.Pair(e,null),kl.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let i=kl.findPair(this.items,e);return!t&&El.isPair(i)?El.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=kl.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new Sl.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),s.items.push(Sl.createPair(o,null,i));return s}};Hi.tag="tag:yaml.org,2002:set";var SR={collection:"map",identify:n=>n instanceof Set,nodeClass:Hi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Hi.from(n,e,t),resolve(n,e){if(El.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Hi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ih.YAMLSet=Hi;ih.set=SR});var oh=C(wl=>{"use strict";var kR=Ur();function sh(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*s:s}function CS(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return kR.stringifyNumber(n);let i="";e<0&&(i="-",e*=t(-1));let r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ER={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>sh(n,t),stringify:CS},wR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>sh(n,!1),stringify:CS},OS={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(OS.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=sh(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};wl.floatTime=wR;wl.intTime=ER;wl.timestamp=OS});var LS=C(IS=>{"use strict";var NR=Br(),_R=fl(),PR=jr(),DR=Vs(),RR=Gd(),AS=_S(),ah=PS(),Nl=RS(),CR=il(),OR=Zd(),AR=bl(),IR=rh(),ch=oh(),LR=[NR.map,PR.seq,DR.string,_R.nullTag,AS.trueTag,AS.falseTag,Nl.intBin,Nl.intOct,Nl.int,Nl.intHex,ah.floatNaN,ah.floatExp,ah.float,RR.binary,CR.merge,OR.omap,AR.pairs,IR.set,ch.intTime,ch.floatTime,ch.timestamp];IS.schema=LR});var VS=C(fh=>{"use strict";var FS=Br(),xR=fl(),BS=jr(),MR=Vs(),qR=Ud(),lh=Wd(),uh=Hd(),FR=hS(),BR=gS(),jS=Gd(),zs=il(),US=Zd(),$S=bl(),xS=LS(),WS=rh(),_l=oh(),MS=new Map([["core",FR.schema],["failsafe",[FS.map,BS.seq,MR.string]],["json",BR.schema],["yaml11",xS.schema],["yaml-1.1",xS.schema]]),qS={binary:jS.binary,bool:qR.boolTag,float:lh.float,floatExp:lh.floatExp,floatNaN:lh.floatNaN,floatTime:_l.floatTime,int:uh.int,intHex:uh.intHex,intOct:uh.intOct,intTime:_l.intTime,map:FS.map,merge:zs.merge,null:xR.nullTag,omap:US.omap,pairs:$S.pairs,seq:BS.seq,set:WS.set,timestamp:_l.timestamp},jR={"tag:yaml.org,2002:binary":jS.binary,"tag:yaml.org,2002:merge":zs.merge,"tag:yaml.org,2002:omap":US.omap,"tag:yaml.org,2002:pairs":$S.pairs,"tag:yaml.org,2002:set":WS.set,"tag:yaml.org,2002:timestamp":_l.timestamp};function UR(n,e,t){let i=MS.get(e);if(i&&!n)return t&&!i.includes(zs.merge)?i.concat(zs.merge):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{let s=Array.from(MS.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(let s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(zs.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?qS[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(qS).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}fh.coreKnownTags=jR;fh.getTags=UR});var ph=C(HS=>{"use strict";var dh=le(),$R=Br(),WR=jr(),VR=Vs(),Pl=VS(),HR=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,hh=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Pl.getTags(e,"compat"):e?Pl.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Pl.coreKnownTags:{},this.tags=Pl.getTags(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,dh.MAP,{value:$R.map}),Object.defineProperty(this,dh.SCALAR,{value:VR.string}),Object.defineProperty(this,dh.SEQ,{value:WR.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?HR:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};HS.Schema=hh});var KS=C(YS=>{"use strict";var YR=le(),mh=js(),Gs=Ms();function KR(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let r=mh.createStringifyContext(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=s(n.commentBefore);t.unshift(Gs.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(YR.isNode(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let u=s(n.contents.commentBefore);t.push(Gs.indentComment(u,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=mh.stringify(n.contents,r,()=>a=null,c);a&&(l+=Gs.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(mh.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=s(n.comment);c.includes(`
|
|
91
|
-
`)?(t.push("..."),t.push(
|
|
90
|
+
${s.comment}`:i.comment}i=r}n.items[t]=gl.isPair(i)?i:new Xd.Pair(i)}}else e("Expected a sequence for this tag");return n}function TS(n,e,t){let{replacer:i}=t,r=new uR.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Xd.createPair(a,c,t))}return r}var fR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bS,createNode:TS};yl.createPairs=TS;yl.pairs=fR;yl.resolvePairs=bS});var Zd=C(Jd=>{"use strict";var vS=le(),Qd=mi(),Ys=Si(),dR=ki(),SS=bl(),Hi=class n extends dR.YAMLSeq{constructor(){super(),this.add=Ys.YAMLMap.prototype.add.bind(this),this.delete=Ys.YAMLMap.prototype.delete.bind(this),this.get=Ys.YAMLMap.prototype.get.bind(this),this.has=Ys.YAMLMap.prototype.has.bind(this),this.set=Ys.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let r of this.items){let s,o;if(vS.isPair(r)?(s=Qd.toJS(r.key,"",t),o=Qd.toJS(r.value,s,t)):s=Qd.toJS(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,t,i){let r=SS.createPairs(e,t,i),s=new this;return s.items=r.items,s}};Hi.tag="tag:yaml.org,2002:omap";var hR={collection:"seq",identify:n=>n instanceof Map,nodeClass:Hi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=SS.resolvePairs(n,e),i=[];for(let{key:r}of t.items)vS.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Hi,t)},createNode:(n,e,t)=>Hi.from(n,e,t)};Jd.YAMLOMap=Hi;Jd.omap=hR});var _S=C(eh=>{"use strict";var kS=Qe();function ES({value:n,source:e},t){return e&&(n?wS:NS).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var wS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kS.Scalar(!0),stringify:ES},NS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kS.Scalar(!1),stringify:ES};eh.falseTag=NS;eh.trueTag=wS});var PS=C(Tl=>{"use strict";var pR=Qe(),th=$r(),mR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:th.stringifyNumber},gR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():th.stringifyNumber(n)}},yR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new pR.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:th.stringifyNumber};Tl.float=yR;Tl.floatExp=gR;Tl.floatNaN=mR});var RS=C(zs=>{"use strict";var DS=$r(),Ks=n=>typeof n=="bigint"||Number.isInteger(n);function vl(n,e,t,{intAsBigInt:i}){let r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return r==="-"?BigInt(-1)*o:o}let s=parseInt(n,t);return r==="-"?-1*s:s}function nh(n,e,t){let{value:i}=n;if(Ks(i)){let r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return DS.stringifyNumber(n)}var bR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>vl(n,2,2,t),stringify:n=>nh(n,2,"0b")},TR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>vl(n,1,8,t),stringify:n=>nh(n,8,"0")},vR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>vl(n,0,10,t),stringify:DS.stringifyNumber},SR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>vl(n,2,16,t),stringify:n=>nh(n,16,"0x")};zs.int=vR;zs.intBin=bR;zs.intHex=SR;zs.intOct=TR});var rh=C(ih=>{"use strict";var El=le(),Sl=Ti(),kl=Si(),Yi=class n extends kl.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;El.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Sl.Pair(e.key,null):t=new Sl.Pair(e,null),kl.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let i=kl.findPair(this.items,e);return!t&&El.isPair(i)?El.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=kl.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new Sl.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),s.items.push(Sl.createPair(o,null,i));return s}};Yi.tag="tag:yaml.org,2002:set";var kR={collection:"map",identify:n=>n instanceof Set,nodeClass:Yi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Yi.from(n,e,t),resolve(n,e){if(El.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Yi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ih.YAMLSet=Yi;ih.set=kR});var oh=C(wl=>{"use strict";var ER=$r();function sh(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*s:s}function CS(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ER.stringifyNumber(n);let i="";e<0&&(i="-",e*=t(-1));let r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var wR={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>sh(n,t),stringify:CS},NR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>sh(n,!1),stringify:CS},OS={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(OS.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=sh(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};wl.floatTime=NR;wl.intTime=wR;wl.timestamp=OS});var LS=C(IS=>{"use strict";var _R=jr(),PR=fl(),DR=Ur(),RR=Hs(),CR=Gd(),AS=_S(),ah=PS(),Nl=RS(),OR=il(),AR=Zd(),IR=bl(),LR=rh(),ch=oh(),xR=[_R.map,DR.seq,RR.string,PR.nullTag,AS.trueTag,AS.falseTag,Nl.intBin,Nl.intOct,Nl.int,Nl.intHex,ah.floatNaN,ah.floatExp,ah.float,CR.binary,OR.merge,AR.omap,IR.pairs,LR.set,ch.intTime,ch.floatTime,ch.timestamp];IS.schema=xR});var VS=C(fh=>{"use strict";var FS=jr(),MR=fl(),BS=Ur(),qR=Hs(),FR=Ud(),lh=Wd(),uh=Hd(),BR=hS(),jR=gS(),jS=Gd(),Gs=il(),US=Zd(),$S=bl(),xS=LS(),WS=rh(),_l=oh(),MS=new Map([["core",BR.schema],["failsafe",[FS.map,BS.seq,qR.string]],["json",jR.schema],["yaml11",xS.schema],["yaml-1.1",xS.schema]]),qS={binary:jS.binary,bool:FR.boolTag,float:lh.float,floatExp:lh.floatExp,floatNaN:lh.floatNaN,floatTime:_l.floatTime,int:uh.int,intHex:uh.intHex,intOct:uh.intOct,intTime:_l.intTime,map:FS.map,merge:Gs.merge,null:MR.nullTag,omap:US.omap,pairs:$S.pairs,seq:BS.seq,set:WS.set,timestamp:_l.timestamp},UR={"tag:yaml.org,2002:binary":jS.binary,"tag:yaml.org,2002:merge":Gs.merge,"tag:yaml.org,2002:omap":US.omap,"tag:yaml.org,2002:pairs":$S.pairs,"tag:yaml.org,2002:set":WS.set,"tag:yaml.org,2002:timestamp":_l.timestamp};function $R(n,e,t){let i=MS.get(e);if(i&&!n)return t&&!i.includes(Gs.merge)?i.concat(Gs.merge):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{let s=Array.from(MS.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(let s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(Gs.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?qS[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(qS).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}fh.coreKnownTags=UR;fh.getTags=$R});var ph=C(HS=>{"use strict";var dh=le(),WR=jr(),VR=Ur(),HR=Hs(),Pl=VS(),YR=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,hh=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Pl.getTags(e,"compat"):e?Pl.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Pl.coreKnownTags:{},this.tags=Pl.getTags(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,dh.MAP,{value:WR.map}),Object.defineProperty(this,dh.SCALAR,{value:HR.string}),Object.defineProperty(this,dh.SEQ,{value:VR.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?YR:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};HS.Schema=hh});var KS=C(YS=>{"use strict";var KR=le(),mh=Us(),Xs=qs();function zR(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let r=mh.createStringifyContext(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=s(n.commentBefore);t.unshift(Xs.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(KR.isNode(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let u=s(n.contents.commentBefore);t.push(Xs.indentComment(u,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=mh.stringify(n.contents,r,()=>a=null,c);a&&(l+=Xs.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(mh.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=s(n.comment);c.includes(`
|
|
91
|
+
`)?(t.push("..."),t.push(Xs.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Xs.indentComment(s(c),"")))}return t.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}YS.stringifyDocument=
|
|
93
|
+
`}YS.stringifyDocument=zR});var Qs=C(zS=>{"use strict";var GR=xs(),Wr=zc(),zt=le(),XR=Ti(),QR=mi(),JR=ph(),ZR=KS(),gh=Wc(),eC=vd(),tC=Ms(),yh=Td(),bh=class n{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,zt.NODE_TYPE,{value:zt.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new yh.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(n.prototype,{[zt.NODE_TYPE]:{value:zt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=zt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Vr(this.contents)&&this.contents.add(e)}addIn(e,t){Vr(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let i=gh.anchorNames(this);e.anchor=!t||i.has(t)?gh.findNewAnchor(t||"a",i):t}return new GR.Alias(e.anchor)}createNode(e,t,i){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let w=v=>typeof v=="number"||v instanceof String||v instanceof Number,R=t.filter(w).map(String);R.length>0&&(t=t.concat(R)),r=t}else i===void 0&&t&&(i=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:g}=gh.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:g},b=tC.createNode(e,u,_);return a&&zt.isCollection(b)&&(b.flow=!0),p(),b}createPair(e,t,i={}){let r=this.createNode(e,null,i),s=this.createNode(t,null,i);return new XR.Pair(r,s)}delete(e){return Vr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Wr.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Vr(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return zt.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Wr.isEmptyPath(e)?!t&&zt.isScalar(this.contents)?this.contents.value:this.contents:zt.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return zt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Wr.isEmptyPath(e)?this.contents!==void 0:zt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Wr.collectionFromPath(this.schema,[e],t):Vr(this.contents)&&this.contents.set(e,t)}setIn(e,t){Wr.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Wr.collectionFromPath(this.schema,Array.from(e),t):Vr(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new yh.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new yh.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new JR.Schema(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=QR.toJS(this.contents,t??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?eC.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ZR.stringifyDocument(this,e)}};function Vr(n){if(zt.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}zS.Document=bh});var eo=C(Zs=>{"use strict";var Js=class extends Error{constructor(e,t,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=t}},Th=class extends Js{constructor(e,t,i){super("YAMLParseError",e,t,i)}},vh=class extends Js{constructor(e,t,i){super("YAMLWarning",e,t,i)}},nC=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:i,col:r}=t.linePos[0];t.message+=` at line ${i}, column ${r}`;let s=r-1,o=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let a=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
94
94
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-s)));let l=" ".repeat(s)+"^".repeat(a);t.message+=`:
|
|
95
95
|
|
|
96
96
|
${o}
|
|
97
97
|
${l}
|
|
98
|
-
`}};
|
|
99
|
-
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Sh(e.key)||Sh(e.value))return!0}return!1;default:return!0}}XS.containsNewline=Sh});var kh=C(QS=>{"use strict";var
|
|
100
|
-
`+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||
|
|
101
|
-
`+T.comment:v.comment=T.comment);let N=new ek.Pair(v);t.options.keepSourceTokens&&(N.srcToken=u),a.items.push(N)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}rk.resolveBlockMap=
|
|
102
|
-
`+q.comment:l.comment=q.comment),d=q.end;continue}!o&&t.options.strict&&
|
|
98
|
+
`}};Zs.YAMLError=Js;Zs.YAMLParseError=Th;Zs.YAMLWarning=vh;Zs.prettifyError=nC});var to=C(GS=>{"use strict";function iC(n,{flow:e,indicator:t,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",g=!1,_=!1,b=null,w=null,R=null,v=null,T=null,N=null,L=null;for(let j of n)switch(_&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&s(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),b&&(l&&j.type!=="comment"&&j.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),j.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&j.source.includes(" ")&&(b=j),u=!0;break;case"comment":{u||s(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ie=j.source.substring(1)||" ";d?d+=p+ie:d=ie,p="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:p+=j.source,l=!0,g=!0,(w||R)&&(v=j),u=!0;break;case"anchor":w&&s(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&s(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break;case"tag":{R&&s(j,"MULTIPLE_TAGS","A node can have at most one tag"),R=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break}case t:(w||R)&&s(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),N&&s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),N=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){T&&s(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=j,l=!1,u=!1;break}default:s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let q=n[n.length-1],H=q?q.offset+q.source.length:r;return _&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(l&&b.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:N,spaceBefore:c,comment:d,hasNewline:g,anchor:w,tag:R,newlineAfterProp:v,end:H,start:L??H}}GS.resolveProps=iC});var Dl=C(XS=>{"use strict";function Sh(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
99
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Sh(e.key)||Sh(e.value))return!0}return!1;default:return!0}}XS.containsNewline=Sh});var kh=C(QS=>{"use strict";var rC=Dl();function sC(n,e,t){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&rC.containsNewline(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}QS.flowIndentCheck=sC});var Eh=C(ZS=>{"use strict";var JS=le();function oC(n,e,t){let{uniqueKeys:i}=n.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||JS.isScalar(s)&&JS.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,t))}ZS.mapIncludes=oC});var sk=C(rk=>{"use strict";var ek=Ti(),aC=Si(),tk=to(),cC=Dl(),nk=kh(),lC=Eh(),ik="All mapping items must start at the same column";function uC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??aC.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:g,value:_}=u,b=tk.resolveProps(d,{indicator:"explicit-key-ind",next:p??g?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),w=!b.found;if(w){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",ik)),!b.anchor&&!b.tag&&!g){l=b.end,b.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||cC.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==i.indent&&r(c,"BAD_INDENT",ik);t.atKey=!0;let R=b.end,v=p?n(t,p,b,r):e(t,R,d,null,b,r);t.schema.compat&&nk.flowIndentCheck(i.indent,p,r),t.atKey=!1,lC.mapIncludes(t,a.items,v)&&r(R,"DUPLICATE_KEY","Map keys must be unique");let T=tk.resolveProps(g??[],{indicator:"map-value-ind",next:_,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=T.end,T.found){w&&(_?.type==="block-map"&&!T.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<T.found.offset-1024&&r(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let N=_?n(t,_,T,r):e(t,c,g,null,T,r);t.schema.compat&&nk.flowIndentCheck(i.indent,_,r),c=N.range[2];let L=new ek.Pair(v,N);t.options.keepSourceTokens&&(L.srcToken=u),a.items.push(L)}else{w&&r(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(v.comment?v.comment+=`
|
|
101
|
+
`+T.comment:v.comment=T.comment);let N=new ek.Pair(v);t.options.keepSourceTokens&&(N.srcToken=u),a.items.push(N)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}rk.resolveBlockMap=uC});var ak=C(ok=>{"use strict";var fC=ki(),dC=to(),hC=kh();function pC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??fC.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=dC.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d&&d.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let g=d?n(t,d,p,r):e(t,p.end,u,null,p,r);t.schema.compat&&hC.flowIndentCheck(i.indent,d,r),c=g.range[2],a.items.push(g)}return a.range=[i.offset,c,l??c],a}ok.resolveBlockSeq=pC});var Hr=C(ck=>{"use strict";function mC(n,e,t,i){let r="";if(n){let s=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{t&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}ck.resolveEnd=mC});var dk=C(fk=>{"use strict";var gC=le(),yC=Ti(),lk=Si(),bC=ki(),TC=Hr(),uk=to(),vC=Dl(),SC=Eh(),wh="Block collections are not allowed within flow collections",Nh=n=>n&&(n.type==="block-map"||n.type==="block-seq");function kC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?lk.YAMLMap:bC.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=i.offset+i.start.source.length;for(let w=0;w<i.items.length;++w){let R=i.items[w],{start:v,key:T,sep:N,value:L}=R,q=uk.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:T??N?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!N&&!L){w===0&&q.comma?r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<i.items.length-1&&r(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),q.comment&&(l.comment?l.comment+=`
|
|
102
|
+
`+q.comment:l.comment=q.comment),d=q.end;continue}!o&&t.options.strict&&vC.containsNewline(T)&&r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)q.comma&&r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(q.comma||r(q.start,"MISSING_CHAR",`Missing , between ${a} items`),q.comment){let H="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":H=j.source.substring(1);break e;default:break e}if(H){let j=l.items[l.items.length-1];gC.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
|
|
103
103
|
`+H:j.comment=H,q.comment=q.comment.substring(H.length+1)}}if(!o&&!N&&!q.found){let H=L?n(t,L,q,r):e(t,q.end,N,null,q,r);l.items.push(H),d=H.range[2],Nh(L)&&r(H.range,"BLOCK_IN_FLOW",wh)}else{t.atKey=!0;let H=q.end,j=T?n(t,T,q,r):e(t,H,v,null,q,r);Nh(T)&&r(j.range,"BLOCK_IN_FLOW",wh),t.atKey=!1;let ie=uk.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:L,offset:j.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(ie.found){if(!o&&!q.found&&t.options.strict){if(N)for(let ce of N){if(ce===ie.found)break;if(ce.type==="newline"){r(ce,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}q.start<ie.found.offset-1024&&r(ie.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source&&L.source[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${a}`):r(ie.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Be=L?n(t,L,ie,r):ie.found?e(t,ie.end,N,null,ie,r):null;Be?Nh(L)&&r(Be.range,"BLOCK_IN_FLOW",wh):ie.comment&&(j.comment?j.comment+=`
|
|
104
|
-
`+ie.comment:j.comment=ie.comment);let Et=new
|
|
105
|
-
`+w.comment:l.comment=w.comment),l.range=[i.offset,b,w.offset]}else l.range=[i.offset,b,b];return l}fk.resolveFlowCollection=
|
|
104
|
+
`+ie.comment:j.comment=ie.comment);let Et=new yC.Pair(j,Be);if(t.options.keepSourceTokens&&(Et.srcToken=R),o){let ce=l;SC.mapIncludes(t,ce.items,j)&&r(H,"DUPLICATE_KEY","Map keys must be unique"),ce.items.push(Et)}else{let ce=new lk.YAMLMap(t.schema);ce.flow=!0,ce.items.push(Et);let On=(Be??j).range;ce.range=[j.range[0],On[1],On[2]],l.items.push(ce)}d=Be?Be.range[2]:ie.end}}let p=o?"}":"]",[g,..._]=i.end,b=d;if(g&&g.source===p)b=g.offset+g.source.length;else{let w=a[0].toUpperCase()+a.substring(1),R=u?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;r(d,u?"MISSING_CHAR":"BAD_INDENT",R),g&&g.source.length!==1&&_.unshift(g)}if(_.length>0){let w=TC.resolveEnd(_,b,t.options.strict,r);w.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+w.comment:l.comment=w.comment),l.range=[i.offset,b,w.offset]}else l.range=[i.offset,b,b];return l}fk.resolveFlowCollection=kC});var pk=C(hk=>{"use strict";var EC=le(),wC=Qe(),NC=Si(),_C=ki(),PC=sk(),DC=ak(),RC=dk();function _h(n,e,t,i,r,s){let o=t.type==="block-map"?PC.resolveBlockMap(n,e,t,i,s):t.type==="block-seq"?DC.resolveBlockSeq(n,e,t,i,s):RC.resolveFlowCollection(n,e,t,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function CC(n,e,t,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,p=>r(s,"TAG_RESOLVE_FAILED",p)):null;if(t.type==="block-seq"){let{anchor:p,newlineAfterProp:g}=i,_=p&&s?p.offset>s.offset?p:s:p??s;_&&(!g||g.offset<_.offset)&&r(_,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===NC.YAMLMap.tagName&&a==="map"||o===_C.YAMLSeq.tagName&&a==="seq")return _h(n,e,t,r,o);let c=e.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!c){let p=e.schema.knownTags[o];if(p&&p.collection===a)e.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?.collection?r(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),_h(n,e,t,r,o)}let l=_h(n,e,t,r,o,c),u=c.resolve?.(l,p=>r(s,"TAG_RESOLVE_FAILED",p),e.options)??l,d=EC.isNode(u)?u:new wC.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}hk.composeCollection=CC});var Dh=C(mk=>{"use strict";var Ph=Qe();function OC(n,e,t){let i=e.offset,r=AC(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?Ph.Scalar.BLOCK_FOLDED:Ph.Scalar.BLOCK_LITERAL,o=e.source?IC(e.source):[],a=o.length;for(let b=o.length-1;b>=0;--b){let w=o[b][1];if(w===""||w==="\r")a=b;else break}if(a===0){let b=r.chomp==="+"&&o.length>0?`
|
|
106
106
|
`.repeat(Math.max(1,o.length-1)):"",w=i+r.length;return e.source&&(w+=e.source.length),{value:b,type:s,comment:r.comment,range:[i,w,w]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let b=0;b<a;++b){let[w,R]=o[b];if(R===""||R==="\r")r.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&t(l+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=w.length),u=b,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=w.length+R.length+1}for(let b=o.length-1;b>=a;--b)o[b][0].length>c&&(a=b+1);let d="",p="",g=!1;for(let b=0;b<u;++b)d+=o[b][0].slice(c)+`
|
|
107
107
|
`;for(let b=u;b<a;++b){let[w,R]=o[b];l+=w.length+R.length+1;let v=R[R.length-1]==="\r";if(v&&(R=R.slice(0,-1)),R&&w.length<c){let N=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(l-R.length-(v?2:1),"BAD_INDENT",N),w=""}s===Ph.Scalar.BLOCK_LITERAL?(d+=p+w.slice(c)+R,p=`
|
|
108
108
|
`):w.length>c||R[0]===" "?(p===" "?p=`
|
|
@@ -117,70 +117,70 @@ ${l}
|
|
|
117
117
|
`+o[b][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let _=i+r.length+e.source.length;return{value:d,type:s,comment:r.comment,range:[i,_,_]}}function
|
|
120
|
+
`}let _=i+r.length+e.source.length;return{value:d,type:s,comment:r.comment,range:[i,_,_]}}function AC({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let p=1;p<r.length;++p){let g=r[p];if(!a&&(g==="-"||g==="+"))a=g;else{let _=Number(g);!o&&_?o=_:c===-1&&(c=n+p)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",d=r.length;for(let p=1;p<e.length;++p){let g=e[p];switch(g.type){case"space":l=!0;case"newline":d+=g.source.length;break;case"comment":t&&!l&&i(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=g.source.length,u=g.source.substring(1);break;case"error":i(g,"UNEXPECTED_TOKEN",g.message),d+=g.source.length;break;default:{let _=`Unexpected token in block scalar header: ${g.type}`;i(g,"UNEXPECTED_TOKEN",_);let b=g.source;b&&typeof b=="string"&&(d+=b.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function IC(n){let e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),s=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}mk.resolveBlockScalar=OC});var Ch=C(yk=>{"use strict";var Rh=Qe(),LC=Hr();function xC(n,e,t){let{offset:i,type:r,source:s,end:o}=n,a,c,l=(p,g,_)=>t(i+p,g,_);switch(r){case"scalar":a=Rh.Scalar.PLAIN,c=MC(s,l);break;case"single-quoted-scalar":a=Rh.Scalar.QUOTE_SINGLE,c=qC(s,l);break;case"double-quoted-scalar":a=Rh.Scalar.QUOTE_DOUBLE,c=FC(s,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,d=LC.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function MC(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),gk(n)}function qC(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),gk(n.slice(1,-1)).replace(/''/g,"'")}function gk(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
122
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(n);if(!i)return n;let r=i[1],s=" ",o=e.lastIndex;for(t.lastIndex=o;i=t.exec(n);)i[1]===""?s===`
|
|
123
123
|
`?r+=s:s=`
|
|
124
|
-
`:(r+=s+i[1],s=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(n),r+s+(i?.[1]??"")}function
|
|
124
|
+
`:(r+=s+i[1],s=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(n),r+s+(i?.[1]??"")}function FC(n,e){let t="";for(let i=1;i<n.length-1;++i){let r=n[i];if(!(r==="\r"&&n[i+1]===`
|
|
125
125
|
`))if(r===`
|
|
126
|
-
`){let{fold:s,offset:o}=
|
|
126
|
+
`){let{fold:s,offset:o}=BC(n,i);t+=s,i=o}else if(r==="\\"){let s=n[++i],o=jC[s];if(o)t+=o;else if(s===`
|
|
127
127
|
`)for(s=n[i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="\r"&&n[i+1]===`
|
|
128
|
-
`)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];t+=
|
|
128
|
+
`)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];t+=UC(n,i+1,a,e),i+=a}else{let a=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r===" "){let s=i,o=n[i+1];for(;o===" "||o===" ";)o=n[++i+1];o!==`
|
|
129
129
|
`&&!(o==="\r"&&n[i+2]===`
|
|
130
|
-
`)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
130
|
+
`)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function BC(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
|
|
131
131
|
`||i==="\r")&&!(i==="\r"&&n[e+2]!==`
|
|
132
132
|
`);)i===`
|
|
133
133
|
`&&(t+=`
|
|
134
|
-
`),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}var jC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
135
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function UC(n,e,t,i){let r=n.substr(e,t),o=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}yk.resolveFlowScalar=xC});var vk=C(Tk=>{"use strict";var Ki=le(),bk=Qe(),$C=Dh(),WC=Ch();function VC(n,e,t,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?$C.resolveBlockScalar(n,e,i):WC.resolveFlowScalar(e,n.options.strict,i),c=t?n.directives.tagName(t.source,d=>i(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[Ki.SCALAR]:c?l=HC(n.schema,r,c,t,i):e.type==="scalar"?l=YC(n,r,e,i):l=n.schema[Ki.SCALAR];let u;try{let d=l.resolve(r,p=>i(t??e,"TAG_RESOLVE_FAILED",p),n.options);u=Ki.isScalar(d)?d:new bk.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(t??e,"TAG_RESOLVE_FAILED",p),u=new bk.Scalar(r)}return u.range=a,u.source=r,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function HC(n,e,t,i,r){if(t==="!")return n[Ki.SCALAR];let s=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[Ki.SCALAR])}function YC({atKey:n,directives:e,schema:t},i,r,s){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(i))||t[Ki.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(i))??t[Ki.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}Tk.composeScalar=VC});var kk=C(Sk=>{"use strict";function KC(n,e,t){if(e){t===null&&(t=e.length);for(let i=t-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++i];r?.type==="space";)n+=r.source.length,r=e[++i];break}}return n}Sk.emptyScalarPosition=KC});var Nk=C(Ah=>{"use strict";var zC=xs(),GC=le(),XC=pk(),Ek=vk(),QC=Hr(),JC=kk(),ZC={composeNode:wk,composeEmptyNode:Oh};function wk(n,e,t,i){let r=n.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=eO(n,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Ek.composeScalar(n,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=XC.composeCollection(ZC,n,e,t,i),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",d),l=Oh(n,e.offset,void 0,null,t,i),u=!1}}return a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!GC.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Oh(n,e,t,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:JC.emptyScalarPosition(e,t,i),indent:-1,source:""},d=Ek.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function eO({options:n},{offset:e,source:t,end:i},r){let s=new zC.Alias(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=QC.resolveEnd(i,o,n.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Ah.composeEmptyNode=Oh;Ah.composeNode=wk});var Dk=C(Pk=>{"use strict";var tO=Qs(),_k=Nk(),nO=Hr(),iO=to();function rO(n,e,{offset:t,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},n),c=new tO.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=iO.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?_k.composeNode(l,r,u,o):_k.composeEmptyNode(l,u.end,i,null,u,o);let d=c.contents.range[2],p=nO.resolveEnd(s,d,!1,o);return p.comment&&(c.comment=p.comment),c.range=[t,d,p.offset],c}Pk.composeDoc=rO});var Lh=C(Ok=>{"use strict";var sO=Td(),oO=Qs(),no=eo(),Rk=le(),aO=Dk(),cO=Hr();function io(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Ck(n){let e="",t=!1,i=!1;for(let r=0;r<n.length;++r){let s=n[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}var Ih=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{let o=
|
|
138
|
+
`)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}var Ih=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{let o=io(t);s?this.warnings.push(new no.YAMLWarning(o,i,r)):this.errors.push(new no.YAMLParseError(o,i,r))},this.directives=new sO.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:i,afterEmptyLine:r}=Ck(this.prelude);if(i){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
139
139
|
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Rk.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Rk.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
140
140
|
${a}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
|
|
141
|
-
${o}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ck(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{let s=
|
|
142
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
141
|
+
${o}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ck(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{let s=io(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=aO.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let t=cO.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
142
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new oO.Document(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};Ok.Composer=Ih});var Lk=C(Rl=>{"use strict";var lO=Dh(),uO=Ch(),fO=eo(),Ak=js();function dO(n,e=!0,t){if(n){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(a,s,o);else throw new fO.YAMLParseError([a,a+1],s,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uO.resolveFlowScalar(n,e,i);case"block-scalar":return lO.resolveBlockScalar({options:{strict:e}},n,i)}}return null}function hO(n,e){let{implicitKey:t=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Ak.stringifyString({type:o,value:n},{implicitKey:t,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
143
143
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
144
144
|
`),u=a.substring(0,l),d=a.substring(l+1)+`
|
|
145
145
|
`,p=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return Ik(p,c)||p.push({type:"newline",offset:-1,indent:i,source:`
|
|
146
|
-
`}),{type:"block-scalar",offset:s,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function
|
|
146
|
+
`}),{type:"block-scalar",offset:s,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function pO(n,e,t={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=t,a="indent"in n?n.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Ak.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":mO(n,c);break;case'"':xh(n,c,"double-quoted-scalar");break;case"'":xh(n,c,"single-quoted-scalar");break;default:xh(n,c,"scalar")}}function mO(n,e){let t=e.indexOf(`
|
|
147
147
|
`),i=e.substring(0,t),r=e.substring(t+1)+`
|
|
148
148
|
`;if(n.type==="block-scalar"){let s=n.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,n.source=r}else{let{offset:s}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];Ik(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
149
|
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:r})}}function Ik(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function xh(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let i=n.props.slice(1),r=e.length;n.props[0].type==="block-scalar-header"&&(r-=n.props[0].source.length);for(let s of i)s.offset+=r;delete n.props,Object.assign(n,{type:t,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
150
|
-
`};delete n.items,Object.assign(n,{type:t,source:e,end:[r]});break}default:{let i="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:t,indent:i,source:e,end:r})}}}Rl.createScalarToken=
|
|
150
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[r]});break}default:{let i="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:t,indent:i,source:e,end:r})}}}Rl.createScalarToken=hO;Rl.resolveAsScalar=dO;Rl.setScalarValue=pO});var Mk=C(xk=>{"use strict";var gO=n=>"type"in n?Ol(n):Cl(n);function Ol(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Ol(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Cl(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Cl(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Cl(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Cl({start:n,key:e,sep:t,value:i}){let r="";for(let s of n)r+=s.source;if(e&&(r+=Ol(e)),t)for(let s of t)r+=s.source;return i&&(r+=Ol(i)),r}xk.stringify=gO});var jk=C(Bk=>{"use strict";var Mh=Symbol("break visit"),yO=Symbol("skip children"),qk=Symbol("remove item");function zi(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Fk(Object.freeze([]),n,e)}zi.BREAK=Mh;zi.SKIP=yO;zi.REMOVE=qk;zi.itemAtPath=(n,e)=>{let t=n;for(let[i,r]of e){let s=t?.[i];if(s&&"items"in s)t=s.items[r];else return}return t};zi.parentCollection=(n,e)=>{let t=zi.itemAtPath(n,e.slice(0,-1)),i=e[e.length-1][0],r=t?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Fk(n,e,t){let i=t(e,n);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Fk(Object.freeze(n.concat([[r,o]])),s.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Mh)return Mh;a===qk&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,n))}}return typeof i=="function"?i(e,n):i}Bk.visit=zi});var Al=C(It=>{"use strict";var qh=Lk(),bO=Mk(),TO=jk(),Fh="\uFEFF",Bh="",jh="",Uh="",vO=n=>!!n&&"items"in n,SO=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function kO(n){switch(n){case Fh:return"<BOM>";case Bh:return"<DOC>";case jh:return"<FLOW_END>";case Uh:return"<SCALAR>";default:return JSON.stringify(n)}}function EO(n){switch(n){case Fh:return"byte-order-mark";case Bh:return"doc-mode";case jh:return"flow-error-end";case Uh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
151
151
|
`:case`\r
|
|
152
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}It.createScalarToken=qh.createScalarToken;It.resolveAsScalar=qh.resolveAsScalar;It.setScalarValue=qh.setScalarValue;It.stringify=
|
|
153
|
-
`:case"\r":case" ":return!0;default:return!1}}var Uk=new Set("0123456789ABCDEFabcdef"),
|
|
154
|
-
\r `),$h=n=>!n||
|
|
152
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}It.createScalarToken=qh.createScalarToken;It.resolveAsScalar=qh.resolveAsScalar;It.setScalarValue=qh.setScalarValue;It.stringify=bO.stringify;It.visit=TO.visit;It.BOM=Fh;It.DOCUMENT=Bh;It.FLOW_END=jh;It.SCALAR=Uh;It.isCollection=vO;It.isScalar=SO;It.prettyToken=kO;It.tokenType=EO});var Vh=C($k=>{"use strict";var ro=Al();function ln(n){switch(n){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var Uk=new Set("0123456789ABCDEFabcdef"),wO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Il=new Set(",[]{}"),NO=new Set(` ,[]{}
|
|
154
|
+
\r `),$h=n=>!n||NO.has(n),Wh=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
155
155
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
156
156
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let i=0;for(;t===" ";)t=this.buffer[++i+e];if(t==="\r"){let r=this.buffer[i+e+1];if(r===`
|
|
157
157
|
`||!r&&!this.atEnd)return e+i+1}return t===`
|
|
158
158
|
`||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ln(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
159
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
159
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ro.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[t-1];if(s===" "||s===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ro.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&ln(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ln(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ln(t)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($h),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ln(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield ro.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil($h),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ln(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}let i=this.buffer.substring(0,t),r=i.indexOf(`
|
|
160
160
|
`,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
161
161
|
`,s)}r!==-1&&(t=r-(i[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>ln(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":t+=1;break;case`
|
|
162
162
|
`:e=s,t=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
163
163
|
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
164
164
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
165
165
|
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
166
|
-
`&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield
|
|
166
|
+
`&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield ro.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ln(s)||e&&Il.has(s))break;t=i}else if(ln(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
167
167
|
`?(i+=1,r=`
|
|
168
168
|
`,s=this.buffer[i+1]):t=i),s==="#"||e&&Il.has(s))break;if(r===`
|
|
169
|
-
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Il.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield
|
|
169
|
+
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Il.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield ro.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($h))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(ln(t)||e&&Il.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!ln(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(wO.has(t))t=this.buffer[++e];else if(t==="%"&&Uk.has(this.buffer[e+1])&&Uk.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
170
170
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
171
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};$k.Lexer=Wh});var Yh=C(Wk=>{"use strict";var Hh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){let s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Wk.LineCounter=Hh});var zh=C(zk=>{"use strict";var Vk=Al(),
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};$k.Lexer=Wh});var Yh=C(Wk=>{"use strict";var Hh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){let s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Wk.LineCounter=Hh});var zh=C(zk=>{"use strict";var Vk=Al(),_O=Vh();function Gi(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Hk(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Kk(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ll(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Yr(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Yk(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!Gi(e.start,"explicit-key-ind")&&!Gi(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Kk(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Kh=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new _O.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,t))yield*this.next(i);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",Vk.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Vk.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Yk(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Hk(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Hk(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Ll(this.peek(2)),i=Yr(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
173
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(
|
|
173
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Gi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Kk(t.key)&&!Gi(t.sep,"newline")){let o=Yr(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(Gi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Yr(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Gi(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||t.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){i&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Gi(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i&&i.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Ll(i),s=Yr(r);Yk(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
175
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ll(e),i=Hr(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ll(e),i=Hr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};zk.Parser=Kh});var Zk=C(so=>{"use strict";var Gk=Lh(),_O=Xs(),ro=Zs(),PO=Ad(),DO=le(),RO=Yh(),Xk=zh();function Qk(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new RO.LineCounter||null,prettyErrors:e}}function CO(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=Array.from(s.compose(r.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(ro.prettifyError(n,t)),a.warnings.forEach(ro.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Jk(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=null;for(let a of s.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ro.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(ro.prettifyError(n,t)),o.warnings.forEach(ro.prettifyError(n,t))),o}function OO(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=Jk(n,t);if(!r)return null;if(r.warnings.forEach(s=>PO.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function AO(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return DO.isDocument(n)&&!i?n.toString(t):new _O.Document(n,i,t).toString(t)}so.parse=OO;so.parseAllDocuments=CO;so.parseDocument=Jk;so.stringify=AO});var tE=C(ye=>{"use strict";var IO=Lh(),LO=Xs(),xO=ph(),Gh=Zs(),MO=Ls(),Ei=le(),qO=Ti(),FO=Qe(),BO=Si(),jO=ki(),UO=Al(),$O=Vh(),WO=Yh(),VO=zh(),xl=Zk(),eE=Cs();ye.Composer=IO.Composer;ye.Document=LO.Document;ye.Schema=xO.Schema;ye.YAMLError=Gh.YAMLError;ye.YAMLParseError=Gh.YAMLParseError;ye.YAMLWarning=Gh.YAMLWarning;ye.Alias=MO.Alias;ye.isAlias=Ei.isAlias;ye.isCollection=Ei.isCollection;ye.isDocument=Ei.isDocument;ye.isMap=Ei.isMap;ye.isNode=Ei.isNode;ye.isPair=Ei.isPair;ye.isScalar=Ei.isScalar;ye.isSeq=Ei.isSeq;ye.Pair=qO.Pair;ye.Scalar=FO.Scalar;ye.YAMLMap=BO.YAMLMap;ye.YAMLSeq=jO.YAMLSeq;ye.CST=UO;ye.Lexer=$O.Lexer;ye.LineCounter=WO.LineCounter;ye.Parser=VO.Parser;ye.parse=xl.parse;ye.parseAllDocuments=xl.parseAllDocuments;ye.parseDocument=xl.parseDocument;ye.stringify=xl.stringify;ye.visit=eE.visit;ye.visitAsync=eE.visitAsync});var oE=C((x$,sE)=>{"use strict";sE.exports=iE;function iE(n,e,t){n instanceof RegExp&&(n=nE(n,t)),e instanceof RegExp&&(e=nE(e,t));var i=rE(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function nE(n,e){var t=e.match(n);return t?t[0]:null}iE.range=rE;function rE(n,e,t){var i,r,s,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],s=t.length;u>=0&&!a;)u==c?(i.push(u),c=t.indexOf(n,u+1)):i.length==1?a=[i.pop(),l]:(r=i.pop(),r<s&&(s=r,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}});var pE=C((M$,hE)=>{var aE=oE();hE.exports=KO;var cE="\0SLASH"+Math.random()+"\0",lE="\0OPEN"+Math.random()+"\0",Qh="\0CLOSE"+Math.random()+"\0",uE="\0COMMA"+Math.random()+"\0",fE="\0PERIOD"+Math.random()+"\0";function Xh(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function HO(n){return n.split("\\\\").join(cE).split("\\{").join(lE).split("\\}").join(Qh).split("\\,").join(uE).split("\\.").join(fE)}function YO(n){return n.split(cE).join("\\").split(lE).join("{").split(Qh).join("}").split(uE).join(",").split(fE).join(".")}function dE(n){if(!n)return[""];var e=[],t=aE("{","}",n);if(!t)return n.split(",");var i=t.pre,r=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+r+"}";var a=dE(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function KO(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),oo(HO(n),!0).map(YO)):[]}function zO(n){return"{"+n+"}"}function GO(n){return/^-?0\d/.test(n)}function XO(n,e){return n<=e}function QO(n,e){return n>=e}function oo(n,e){var t=[],i=aE("{","}",n);if(!i)return[n];var r=i.pre,s=i.post.length?oo(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o<s.length;o++){var a=r+"{"+i.body+"}"+s[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+Qh+i.post,oo(n)):[n];var p;if(u)p=i.body.split(/\.\./);else if(p=dE(i.body),p.length===1&&(p=oo(p[0],!1).map(zO),p.length===1))return s.map(function(Be){return i.pre+p[0]+Be});var g;if(u){var _=Xh(p[0]),b=Xh(p[1]),w=Math.max(p[0].length,p[1].length),R=p.length==3?Math.abs(Xh(p[2])):1,v=XO,T=b<_;T&&(R*=-1,v=QO);var N=p.some(GO);g=[];for(var L=_;v(L,b);L+=R){var q;if(l)q=String.fromCharCode(L),q==="\\"&&(q="");else if(q=String(L),N){var H=w-q.length;if(H>0){var j=new Array(H+1).join("0");L<0?q="-"+j+q.slice(1):q=j+q}}g.push(q)}}else{g=[];for(var ie=0;ie<p.length;ie++)g.push.apply(g,oo(p[ie],!1))}for(var ie=0;ie<g.length;ie++)for(var o=0;o<s.length;o++){var a=r+g[ie]+s[o];(!e||u||a)&&t.push(a)}}return t}});var Re=G(Xb());var sc=class n{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(n.isIncremental(i)){let r=Jb(i.range),s=this.offsetAt(r.start),o=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(o,this._content.length);let a=Math.max(r.start.line,0),c=Math.max(r.end.line,0),l=this._lineOffsets,u=Qb(i.text,!1,s);if(c-a===u.length)for(let p=0,g=u.length;p<g;p++)l[p+a+1]=u[p];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=i.text.length-(o-s);if(d!==0)for(let p=a+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+d}else if(n.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Qb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},oc;(function(n){function e(r,s,o,a){return new sc(r,s,o,a)}n.create=e;function t(r,s,o){if(r instanceof sc)return r.update(s,o),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function i(r,s){let o=r.getText(),a=sd(s.map($_),(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=0,l=[];for(let u of a){let d=r.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=r.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=i})(oc||(oc={}));function sd(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);sd(i,e),sd(r,e);let s=0,o=0,a=0;for(;s<i.length&&o<r.length;)e(i[s],r[o])<=0?n[a++]=i[s++]:n[a++]=r[o++];for(;s<i.length;)n[a++]=i[s++];for(;o<r.length;)n[a++]=r[o++];return n}function Qb(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function Jb(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function $_(n){let e=Jb(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var ac=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],cc=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Zb=G(Q());var ne=n=>({start:{line:n.tokenIndexes?.start?.pos.line??0,character:n.tokenIndexes?.start?.pos.col??0},end:{line:n.tokenIndexes?.end?.pos.line??0,character:(n.tokenIndexes?.end?.pos.col??0)+(n.tokenIndexes?.end?.pos.len??0)}}),eT=" ",tT=n=>{eT=n},od=()=>eT,ri=n=>ac.findIndex(e=>e===n),si=n=>cc.findIndex(e=>e===n),bn=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),nT=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),iT=(n,e,t)=>{if(!n)return!1;let r=n.filter(s=>s.pos.line===t.line).at(-1);return r&&r.pos.col>=t.character?!1:e.tokenIndexes?.end===r};var Tn=(n,e,t)=>{let i=n,r=n;for(;r;)i=r,r=[...i.children].reverse().find(s=>bn(s,e,t));return i},A=(n,e,t=Zb.DiagnosticSeverity.Error,i=[],r=void 0,s=[],o)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:i,tags:r,templateStrings:s,edit:o}),rT=n=>[...n].sort((t,i)=>{if(t.sortKey===void 0||i.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==i.sortKey)return t.sortKey-i.sortKey;if(!t.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function ft(n,e,t,i){let r=n.textDocument.uri.replace("file://",""),s=await _r(e,r,i);if(!s)return[];console.time("search");let a=(await s.context.getRuntime()).getDeepestAstNode(r,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===r?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function z(n,e){return{start:n,end:e??n}}var M=(n,e)=>n?.tokens.some(t=>t===e),Je=n=>e=>e?.value&&n===e.value?"yes":W_(n)(e),Ee=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",W_=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Fn=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,Bn=(n,e)=>!!n&&!!e&&Fn(n,e)&&n.pos.col+n.pos.len===e.pos.col,lc=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),_r=async(n,e,t)=>(await lc(n)).sort(r=>r.context.name===t?-1:0).find(r=>r.files.some(s=>s===e)),sT=async(n,e)=>(await lc(n)).filter(i=>i.files.some(r=>r===e));var Pr=G(Q()),$=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(i=>i.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=ne(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(i=>i.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=ne(this);return[{location:Pr.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Pr.SymbolKind.File||t.kind===Pr.SymbolKind.Class||t.kind===Pr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(ri(this.semanticTokenType),si(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Dr=G(Q());var uT=G(Q());var oT=G(Q()),Tt=class extends ${constructor(t,i){super(i);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:oT.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}};var aT=G(Q()),Ke=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:aT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}};var cT=G(Q());var vn=class extends ${},Ns=class extends vn{constructor(t,i){super();this.expression=t;this.join=i;this.addChild(t),i&&(this.addChild(i.operator),this.addChild(i.expression))}addExpression(t,i){this.addChild(t),this.addChild(i)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var vt=class extends vn{constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:cT.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}};var lT=G(Q()),oi=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:lT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}};var _e=class extends ${constructor(t,i){super(i);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Me=class extends ${constructor(t,i=[]){super();this.propertyName=t;this.labels=i;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:uT.SymbolKind.Property},this.labels.forEach(r=>this.addChild(r)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Tt?t.value.value:t.value instanceof Ke?t.value.values.map(i=>i.value instanceof vt?i.value.value:NaN):t.value instanceof oi?t.value.values.map(i=>i.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var fT=G(Q()),Sn=class extends ${constructor(t,i){super();this.keyword=i;this.addChild(i),this.docSymbolsMeta={name:t,kind:fT.SymbolKind.Function}}};var Kt=class extends Sn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ae=class extends Sn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var Pe=class n extends ${constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof qt)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof Kt)}addNodeChild(e){this.addChild(e)}},qt=class extends Pe{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Dr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Me)}get deleteProperties(){return this.children.filter(e=>e instanceof Ae)}get nodes(){return this.children.filter(e=>e instanceof de)}get pathName(){return"/"}},rt=class extends Pe{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Dr.SymbolKind.Class},t.forEach(i=>{super.addChild(i)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Dr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof de)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},de=class n extends Pe{constructor(t=[],i){super();this.labels=t;this.omitIfNoRef=i;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Dr.SymbolKind.Class},i&&this.addChild(i),t.forEach(r=>{this.addChild(r)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Dr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},Te=class extends ${constructor(t,i,r){super(i);this.name=t;this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}toString(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let i={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};if(t(ri("type"),si("declaration"),{start:i,end:i}),this.address!==void 0){let r={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.tokenIndexes.start.pos.col+this.name.length+1,len:this.tokenIndexes.start.pos.len-this.name.length-1}},s={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.name.length+2,len:1}};t(ri("decorator"),si("declaration"),{start:s,end:s}),t(ri("number"),si("declaration"),{start:r,end:r})}}};var dT=G(Q()),he=class extends ${constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:dT.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}};var En=G(Q());var Ze=n=>n instanceof Sn?!0:n instanceof Pe?!1:n.parentNode?Ze(n.parentNode):!1;var uc=n=>[...n.filter(t=>t instanceof de||t instanceof rt).map(t=>t instanceof de?t.name:t.labelReference)].filter(t=>!!t);var et=G(Q());var hT=G(Q());var jn=class extends ${constructor(){super();this._pathParts=[]}addPath(t,i){this._pathParts.push(t),i&&this.addChild(i),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},sn=class extends ${constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:hT.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}};var Fe=G(Q());var fc=G(Q());var pT=require("path"),ai=class extends ${constructor(t,i){super();this.keyword=t;this.path=i;this.docSymbolsMeta={name:`Include ${i}`,kind:fc.SymbolKind.File},this.addChild(t),this.addChild(i)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:fc.SymbolKind.File},this._reolvedPath=t}},dc=class extends ${constructor(t,i,r){super(r);this._path=t;this.relative=i;this.docSymbolsMeta={name:(0,pT.basename)(this.path),kind:fc.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var kn=class extends ${constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var V_=async(n,e,t)=>{let i=Fe.Position.create(n.pos.line,n.pos.col),r=t.find(s=>bn(s,e,i));if(r)return Tn(r,e,i)},ad=n=>{if(n)return n instanceof Pe?n:ad(n?.parentNode)},hc=(n,e,t=0)=>!e||e.uri!==n?t:hc(n,ad(e.parentNode),t+1),H_=(n,e)=>async t=>{let i=await V_(t.firstToken,e,n);return!i||i===t||t.allDescendants.some(s=>s===i)?0:i instanceof Pe?hc(e,ad(i)):void 0};async function mT(n,e){let t=[],i=n.textDocument.uri.replace("file://",""),r=(await e.getRuntime()).fileTopMostAst(i);return t.push(...(await Promise.all(r.flatMap(async s=>await gT(n,s,i,H_(r,i))))).flat()),t}var ji=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),Fe.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
|
|
176
|
-
`))}},
|
|
177
|
-
${i}${"".padStart(e*t.length,t)}`)},ci=(n,e,t,i="")=>Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,0),Fe.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${i}`),ze=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let i=
|
|
175
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ll(e),i=Yr(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ll(e),i=Yr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};zk.Parser=Kh});var Zk=C(oo=>{"use strict";var Gk=Lh(),PO=Qs(),so=eo(),DO=Ad(),RO=le(),CO=Yh(),Xk=zh();function Qk(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new CO.LineCounter||null,prettyErrors:e}}function OO(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=Array.from(s.compose(r.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(so.prettifyError(n,t)),a.warnings.forEach(so.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Jk(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=null;for(let a of s.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new so.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(so.prettifyError(n,t)),o.warnings.forEach(so.prettifyError(n,t))),o}function AO(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=Jk(n,t);if(!r)return null;if(r.warnings.forEach(s=>DO.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function IO(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return RO.isDocument(n)&&!i?n.toString(t):new PO.Document(n,i,t).toString(t)}oo.parse=AO;oo.parseAllDocuments=OO;oo.parseDocument=Jk;oo.stringify=IO});var tE=C(be=>{"use strict";var LO=Lh(),xO=Qs(),MO=ph(),Gh=eo(),qO=xs(),Ei=le(),FO=Ti(),BO=Qe(),jO=Si(),UO=ki(),$O=Al(),WO=Vh(),VO=Yh(),HO=zh(),xl=Zk(),eE=Os();be.Composer=LO.Composer;be.Document=xO.Document;be.Schema=MO.Schema;be.YAMLError=Gh.YAMLError;be.YAMLParseError=Gh.YAMLParseError;be.YAMLWarning=Gh.YAMLWarning;be.Alias=qO.Alias;be.isAlias=Ei.isAlias;be.isCollection=Ei.isCollection;be.isDocument=Ei.isDocument;be.isMap=Ei.isMap;be.isNode=Ei.isNode;be.isPair=Ei.isPair;be.isScalar=Ei.isScalar;be.isSeq=Ei.isSeq;be.Pair=FO.Pair;be.Scalar=BO.Scalar;be.YAMLMap=jO.YAMLMap;be.YAMLSeq=UO.YAMLSeq;be.CST=$O;be.Lexer=WO.Lexer;be.LineCounter=VO.LineCounter;be.Parser=HO.Parser;be.parse=xl.parse;be.parseAllDocuments=xl.parseAllDocuments;be.parseDocument=xl.parseDocument;be.stringify=xl.stringify;be.visit=eE.visit;be.visitAsync=eE.visitAsync});var oE=C((q$,sE)=>{"use strict";sE.exports=iE;function iE(n,e,t){n instanceof RegExp&&(n=nE(n,t)),e instanceof RegExp&&(e=nE(e,t));var i=rE(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function nE(n,e){var t=e.match(n);return t?t[0]:null}iE.range=rE;function rE(n,e,t){var i,r,s,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],s=t.length;u>=0&&!a;)u==c?(i.push(u),c=t.indexOf(n,u+1)):i.length==1?a=[i.pop(),l]:(r=i.pop(),r<s&&(s=r,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}});var pE=C((F$,hE)=>{var aE=oE();hE.exports=zO;var cE="\0SLASH"+Math.random()+"\0",lE="\0OPEN"+Math.random()+"\0",Qh="\0CLOSE"+Math.random()+"\0",uE="\0COMMA"+Math.random()+"\0",fE="\0PERIOD"+Math.random()+"\0";function Xh(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function YO(n){return n.split("\\\\").join(cE).split("\\{").join(lE).split("\\}").join(Qh).split("\\,").join(uE).split("\\.").join(fE)}function KO(n){return n.split(cE).join("\\").split(lE).join("{").split(Qh).join("}").split(uE).join(",").split(fE).join(".")}function dE(n){if(!n)return[""];var e=[],t=aE("{","}",n);if(!t)return n.split(",");var i=t.pre,r=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+r+"}";var a=dE(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function zO(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),ao(YO(n),!0).map(KO)):[]}function GO(n){return"{"+n+"}"}function XO(n){return/^-?0\d/.test(n)}function QO(n,e){return n<=e}function JO(n,e){return n>=e}function ao(n,e){var t=[],i=aE("{","}",n);if(!i)return[n];var r=i.pre,s=i.post.length?ao(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o<s.length;o++){var a=r+"{"+i.body+"}"+s[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+Qh+i.post,ao(n)):[n];var p;if(u)p=i.body.split(/\.\./);else if(p=dE(i.body),p.length===1&&(p=ao(p[0],!1).map(GO),p.length===1))return s.map(function(Be){return i.pre+p[0]+Be});var g;if(u){var _=Xh(p[0]),b=Xh(p[1]),w=Math.max(p[0].length,p[1].length),R=p.length==3?Math.abs(Xh(p[2])):1,v=QO,T=b<_;T&&(R*=-1,v=JO);var N=p.some(XO);g=[];for(var L=_;v(L,b);L+=R){var q;if(l)q=String.fromCharCode(L),q==="\\"&&(q="");else if(q=String(L),N){var H=w-q.length;if(H>0){var j=new Array(H+1).join("0");L<0?q="-"+j+q.slice(1):q=j+q}}g.push(q)}}else{g=[];for(var ie=0;ie<p.length;ie++)g.push.apply(g,ao(p[ie],!1))}for(var ie=0;ie<g.length;ie++)for(var o=0;o<s.length;o++){var a=r+g[ie]+s[o];(!e||u||a)&&t.push(a)}}return t}});var Se=G(Xb());var sc=class n{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(n.isIncremental(i)){let r=Jb(i.range),s=this.offsetAt(r.start),o=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(o,this._content.length);let a=Math.max(r.start.line,0),c=Math.max(r.end.line,0),l=this._lineOffsets,u=Qb(i.text,!1,s);if(c-a===u.length)for(let p=0,g=u.length;p<g;p++)l[p+a+1]=u[p];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=i.text.length-(o-s);if(d!==0)for(let p=a+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+d}else if(n.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Qb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},oc;(function(n){function e(r,s,o,a){return new sc(r,s,o,a)}n.create=e;function t(r,s,o){if(r instanceof sc)return r.update(s,o),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function i(r,s){let o=r.getText(),a=sd(s.map(W_),(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=0,l=[];for(let u of a){let d=r.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=r.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=i})(oc||(oc={}));function sd(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);sd(i,e),sd(r,e);let s=0,o=0,a=0;for(;s<i.length&&o<r.length;)e(i[s],r[o])<=0?n[a++]=i[s++]:n[a++]=r[o++];for(;s<i.length;)n[a++]=i[s++];for(;o<r.length;)n[a++]=r[o++];return n}function Qb(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function Jb(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function W_(n){let e=Jb(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var ac=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],cc=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Zb=G(Q());var ne=n=>({start:{line:n.tokenIndexes?.start?.pos.line??0,character:n.tokenIndexes?.start?.pos.col??0},end:{line:n.tokenIndexes?.end?.pos.line??0,character:(n.tokenIndexes?.end?.pos.col??0)+(n.tokenIndexes?.end?.pos.len??0)}}),eT=" ",tT=n=>{eT=n},od=()=>eT,ri=n=>ac.findIndex(e=>e===n),si=n=>cc.findIndex(e=>e===n),bn=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),nT=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),iT=(n,e,t)=>{if(!n)return!1;let r=n.filter(s=>s.pos.line===t.line).at(-1);return r&&r.pos.col>=t.character?!1:e.tokenIndexes?.end===r};var Tn=(n,e,t)=>{let i=n,r=n;for(;r;)i=r,r=[...i.children].reverse().find(s=>bn(s,e,t));return i},A=(n,e,t=Zb.DiagnosticSeverity.Error,i=[],r=void 0,s=[],o)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:i,tags:r,templateStrings:s,edit:o}),rT=n=>[...n].sort((t,i)=>{if(t.sortKey===void 0||i.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==i.sortKey)return t.sortKey-i.sortKey;if(!t.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function ft(n,e,t,i){let r=n.textDocument.uri.replace("file://",""),s=await Pr(e,r,i);if(!s)return[];console.time("search");let a=(await s.context.getRuntime()).getDeepestAstNode(r,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===r?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function z(n,e){return{start:n,end:e??n}}var M=(n,e)=>n?.tokens.some(t=>t===e),Je=n=>e=>e?.value&&n===e.value?"yes":V_(n)(e),we=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",V_=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Fn=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,Bn=(n,e)=>!!n&&!!e&&Fn(n,e)&&n.pos.col+n.pos.len===e.pos.col,lc=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),Pr=async(n,e,t)=>(await lc(n)).sort(r=>r.context.name===t?-1:0).find(r=>r.files.some(s=>s===e)),sT=async(n,e)=>(await lc(n)).filter(i=>i.files.some(r=>r===e));var Dr=G(Q()),$=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(i=>i.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=ne(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(i=>i.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=ne(this);return[{location:Dr.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Dr.SymbolKind.File||t.kind===Dr.SymbolKind.Class||t.kind===Dr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(ri(this.semanticTokenType),si(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Rr=G(Q());var uT=G(Q());var oT=G(Q()),Tt=class extends ${constructor(t,i){super(i);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:oT.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}};var aT=G(Q()),Ke=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:aT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}};var cT=G(Q());var vn=class extends ${},_s=class extends vn{constructor(t,i){super();this.expression=t;this.join=i;this.addChild(t),i&&(this.addChild(i.operator),this.addChild(i.expression))}addExpression(t,i){this.addChild(t),this.addChild(i)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var vt=class extends vn{constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:cT.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}};var lT=G(Q()),oi=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:lT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}};var Pe=class extends ${constructor(t,i){super(i);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Me=class extends ${constructor(t,i=[]){super();this.propertyName=t;this.labels=i;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:uT.SymbolKind.Property},this.labels.forEach(r=>this.addChild(r)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Tt?t.value.value:t.value instanceof Ke?t.value.values.map(i=>i.value instanceof vt?i.value.value:NaN):t.value instanceof oi?t.value.values.map(i=>i.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var fT=G(Q()),Sn=class extends ${constructor(t,i){super();this.keyword=i;this.addChild(i),this.docSymbolsMeta={name:t,kind:fT.SymbolKind.Function}}};var Kt=class extends Sn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ae=class extends Sn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var De=class n extends ${constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof qt)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof Kt)}addNodeChild(e){this.addChild(e)}},qt=class extends De{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Rr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Me)}get deleteProperties(){return this.children.filter(e=>e instanceof Ae)}get nodes(){return this.children.filter(e=>e instanceof he)}get pathName(){return"/"}},rt=class extends De{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},t.forEach(i=>{super.addChild(i)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof he)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},he=class n extends De{constructor(t=[],i){super();this.labels=t;this.omitIfNoRef=i;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},i&&this.addChild(i),t.forEach(r=>{this.addChild(r)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},Te=class extends ${constructor(t,i,r){super(i);this.name=t;this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}toString(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let i={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};if(t(ri("type"),si("declaration"),{start:i,end:i}),this.address!==void 0){let r={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.tokenIndexes.start.pos.col+this.name.length+1,len:this.tokenIndexes.start.pos.len-this.name.length-1}},s={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.name.length+2,len:1}};t(ri("decorator"),si("declaration"),{start:s,end:s}),t(ri("number"),si("declaration"),{start:r,end:r})}}};var dT=G(Q()),pe=class extends ${constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:dT.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}};var En=G(Q());var Ze=n=>n instanceof Sn?!0:n instanceof De?!1:n.parentNode?Ze(n.parentNode):!1;var uc=n=>[...n.filter(t=>t instanceof he||t instanceof rt).map(t=>t instanceof he?t.name:t.labelReference)].filter(t=>!!t);var et=G(Q());var hT=G(Q());var jn=class extends ${constructor(){super();this._pathParts=[]}addPath(t,i){this._pathParts.push(t),i&&this.addChild(i),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},sn=class extends ${constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:hT.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}};var Fe=G(Q());var fc=G(Q());var pT=require("path"),ai=class extends ${constructor(t,i){super();this.keyword=t;this.path=i;this.docSymbolsMeta={name:`Include ${i}`,kind:fc.SymbolKind.File},this.addChild(t),this.addChild(i)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:fc.SymbolKind.File},this._reolvedPath=t}},dc=class extends ${constructor(t,i,r){super(r);this._path=t;this.relative=i;this.docSymbolsMeta={name:(0,pT.basename)(this.path),kind:fc.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var kn=class extends ${constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var H_=async(n,e,t)=>{let i=Fe.Position.create(n.pos.line,n.pos.col),r=t.find(s=>bn(s,e,i));if(r)return Tn(r,e,i)},ad=n=>{if(n)return n instanceof De?n:ad(n?.parentNode)},hc=(n,e,t=0)=>!e||e.uri!==n?t:hc(n,ad(e.parentNode),t+1),Y_=(n,e)=>async t=>{let i=await H_(t.firstToken,e,n);return!i||i===t||t.allDescendants.some(s=>s===i)?0:i instanceof De?hc(e,ad(i)):void 0};async function mT(n,e){let t=[],i=n.textDocument.uri.replace("file://",""),r=(await e.getRuntime()).fileTopMostAst(i);return t.push(...(await Promise.all(r.flatMap(async s=>await gT(n,s,i,Y_(r,i))))).flat()),t}var Ui=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),Fe.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
|
|
176
|
+
`))}},Cr=(n,e,t,i="")=>{if(n.pos.line===n.prevToken?.pos.line)return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col),Fe.Position.create(n.pos.line,n.pos.col)),`
|
|
177
|
+
${i}${"".padStart(e*t.length,t)}`)},ci=(n,e,t,i="")=>Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,0),Fe.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${i}`),ze=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let i=Ui(n.nextToken,0);if(!i)throw new Error("remove new LinesEdit must be defined");return[Fe.TextEdit.insert(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),"".padEnd(e," ")),i]}return n.nextToken.pos.col-(n.pos.col+n.pos.len)===e?[]:[Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),Fe.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},K_=async(n,e,t,i,r,s)=>{if(e.uri!==t)return[];let o=[],a=Cr(e.firstToken,i,r);if(a)o.push(a);else{o.push(ci(e.firstToken,i,r));let l=Ui(e.firstToken);l&&o.push(l)}if(e instanceof he||e instanceof rt)if(o.push(...e.labels.flatMap(l=>ze(l.lastToken))),e instanceof he){let l=e.name&&e.openScope?ze(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?ze(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>gT(n,l,t,s,i+1)))).flat()),e.closeScope){let l=Cr(e.closeScope,i,r);if(l)o.push(l);else{o.push(ci(e.closeScope,i,r));let u=Ui(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?ze(e.lastToken.prevToken,0):[];return o.push(...c),o},z_=(n,e,t,i)=>{let r=[];if(r.push(...ze(n.lastToken,i?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let s=Ui(n.firstToken);s&&r.push(s),r.push(ci(n.firstToken,e+1,t))}return n.value,r},G_=(n,e,t,i)=>{let r=[];return n instanceof Ke||n instanceof oi?(n.openBracket&&r.push(...ze(n.openBracket,0)),r.push(...n.values.flatMap((s,o)=>z_(s,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&r.push(...ze(n.closeBracket,0))):n?.lastToken&&i&&r.push(...ze(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),r},X_=(n,e,t,i)=>{let r=[];return r.push(...n.startLabels.flatMap((s,o)=>o+1===n.startLabels.length?[]:ze(s.lastToken))),r.push(...G_(n.value,e,t,!i||n.endLabels.length>0)),r.push(...n.endLabels.flatMap((s,o)=>o+1===n.endLabels.length?[]:ze(s.lastToken))),r},Q_=(n,e,t)=>{let i=[],r=s=>{if(s&&bn(n,n.uri,Fe.Position.create(s.pos.line,s.pos.col)))return s.value===","?s:r(s.nextToken)};return n.values.forEach((s,o)=>{if(!s)return[];let a=r(s.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)i.push(...ze(a,1));else if(c?.firstToken){let l=Ui(c?.firstToken);l&&i.push(l),i.push(ci(c?.firstToken,e+1,t))}}}),[...i,...n.values.flatMap((s,o)=>s?X_(s,e,t,o+1===n.values.length):[])]},J_=(n,e,t)=>{let i=[],r=Cr(n.firstToken,e,t);if(r)i.push(r);else{i.push(ci(n.firstToken,e,t));let o=Ui(n.firstToken);o&&i.push(o)}if(i.push(...n.labels.flatMap(o=>ze(o.lastToken))),n.values){if(n.propertyName){i.push(...ze(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&i.push(...ze(a))}i.push(...Q_(n.values,e,t))}let s=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...s),i},Z_=(n,e,t)=>{let i=[],r=Cr(n.firstToken,e,t);r?i.push(r):i.push(ci(n.firstToken,e,t));let s=ze(n.keyword.lastToken);i.push(...s);let o=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...o),i},eP=(n,e,t,i)=>{if(t===void 0)return[];if(n.uri!==e)return[];let r=[],s=Cr(n.firstToken,t,i);s?r.push(s):r.push(ci(n.firstToken,t,i));let o=ze(n.keyword.lastToken);return r.push(...o),r},tP=(n,e,t)=>{let i=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&i.push(...ze(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return i.push(...ze(n.firstToken.prevToken)),i;if(e===void 0)return i;let r=n.firstToken.value.startsWith("*")?" ":"",s=Cr(n.firstToken,e,t,r);if(s)i.push(s);else{i.push(ci(n.firstToken,e,t,r));let o=Ui(n.firstToken);o&&i.push(o)}return i},gT=async(n,e,t,i,r=0)=>{let s=n.options.tabSize,a=n.options.insertSpaces?"".padStart(s," "):" ";return tT(a),e instanceof De?K_(n,e,t,r,a,i):e instanceof Me?J_(e,r,a):e instanceof Sn?Z_(e,r,a):e instanceof ai?eP(e,t,await i(e),a):e instanceof kn?tP(e,await i(e),a):[]};var K=class{constructor(e,t,i="optional",r=void 0,s=[],o){this.name=e;this.type=t;this.def=r;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:et.MarkupKind.Markdown,value:[...this.desctiption?["### Desctiption",this.desctiption.join(`
|
|
178
178
|
|
|
179
179
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
180
180
|
|
|
181
181
|
`)]:[]].join(`
|
|
182
182
|
`)});typeof i!="function"?this.required=()=>i:this.required=i,typeof s!="function"?this.values=()=>r&&s.indexOf(r)===-1?[r,...s]:s:this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,i,r){let s=this.required(t);if(r){if(s==="omitted")return[A(11,r.ast,et.DiagnosticSeverity.Error,void 0,[],[i])]}else{if(s==="required"){let l=e.getOrderedNodeAst(t),u=uc(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case 1:case 2:case 4:d=" = <>";break;case 3:case 5:d=' = ""';break;case 6:d=" = []";break}return[...l.map((p,g)=>{let _=p.openScope??u[g].lastToken;return A(0,u[g],et.DiagnosticSeverity.Error,[],[],[i],et.TextEdit.insert(et.Position.create(_.pos.line,_.pos.col+1),`
|
|
183
|
-
${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=tP(r),a=[],c=(l,u,d)=>{if(d??=r.ast,!(l.some(g=>g==u)||l.some(g=>g==5)&&(u===3||u===5)||l.some(g=>g==4)&&(u===1||u===2))){let g=[];l.forEach(_=>{switch(_){case 0:g.push(1);break;case 3:g.push(2);break;case 5:g.push(3);break;case 1:g.push(5);break;case 2:g.push(6);break;case 4:g.push(7);break}}),g.length&&a.push(A(g,d,et.DiagnosticSeverity.Error,[],[],[r.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,r.ast.values??r.ast,et.DiagnosticSeverity.Error,[],[],[i,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(p=>p!==u)&&a.push(A(3,r.ast.values?.values[d]??r.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,r.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,r.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,r.ast.propertyName??r.ast,et.DiagnosticSeverity.Error,(r.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[r.name])):o.length===1&&c(this.type[0].types,o[0],r.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(r)??[]),this.values(r).length&&this.type[0].types.some(l=>l===3))){let l=r.ast.values?.values[0]?.value;this.values(r).some(u=>l.value===u)||a.push(A(9,r.ast.values?.values[0]?.value??r.ast,et.DiagnosticSeverity.Error,[],[],[this.values(r).map(u=>`'${u}'`).join(" or ")]))}return a}validate(e,t){if(typeof this.name=="string"){let s=t.getProperty(this.name);return this.validateProperty(e,t,this.name,s)}let i=t.properties.filter(s=>this.getNameMatch(s.name)),r=t.nodeType?.properties.filter(s=>s!==this)??[];return i.filter(s=>r.some(o=>o.getNameMatch(s.name)))?[]:i.flatMap(s=>this.validateProperty(e,t,s.name,s))}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:`"${i}"`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):t?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:`<${i}>`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},tP=n=>n.ast.values?n.ast.values.values.map(e=>nP(e)):[0],nP=n=>n?n.value instanceof Tt?3:n.value instanceof Ke?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof he||n.value instanceof sn?1:6:7,pc=class{constructor(){this._properties=[]}getIssue(e,t){let i=[],r=t.getProperty("status"),s=r?.ast.values?.values.at(0)?.value;return s instanceof Tt&&s.value==="disabled"?([...t.definitions,...t.referencedBy].forEach(o=>i.push(A(22,o,et.DiagnosticSeverity.Hint,[...r?.ast.parentNode?[r?.ast.parentNode]:[]],[et.DiagnosticTag.Unnecessary]))),i):[...i,...this.properties.flatMap(o=>o.validate(e,t))]}get properties(){return this._properties}addProperty(e){Array.isArray(e)?e.forEach(t=>this._properties.push(t)):this._properties.push(e),this._properties.sort(t=>typeof t.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(e){e&&(e.bindingsPath=this.bindingsPath,this._childNodeType=e)}getOnPropertyHover(e){let t=this.properties.find(i=>i.getNameMatch(e));return t?.onHover.bind(t)()}};var on=class extends ${constructor(t,i,r){super();this.startLabels=t;this.value=i;this.endLabels=r;this.startLabels.forEach(s=>{this.addChild(s)}),this.addChild(i),this.endLabels.forEach(s=>{this.addChild(s)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}};var wt=n=>{if(!n?.values.some(e=>!(e?.value instanceof Ke)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},De=(n,e,t)=>{let i=n.ast.values?.values.at(e)?.value;if(i instanceof Ke){let r=i.values.at(t);if(r?.value instanceof vt)return r.value.value}},an=(n,e,t=0)=>{if(n instanceof on){if(n?.value instanceof Ke){let i=n.value.values.at(t);if(i?.value instanceof vt)return e.getPhandle(i.value.value);if(i?.value instanceof he)return i.value.linksTo;if(i?.value instanceof sn)return i.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof vt)return e.getPhandle(n.value);if(n instanceof he)return n.linksTo;if(n instanceof sn)return n.path?.pathParts.at(-1)?.linksTo}},yT=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values.at(0)?.value;if(i instanceof vt)return{cellsProperty:e,node:n,value:i.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var bT=()=>{let n=new K("compatible",V(5));return n.desctiption=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var cd=G(Q()),TT=()=>{let n=new K("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"optional":"omitted",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Tt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]}return[]});return n.desctiption=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var vT=()=>{let n=new K("#interrupt-cells",V(1));return n.desctiption=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var ST=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.desctiption=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var kT=()=>{let n=new K("interrupt-parent",V(1));return n.desctiption=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var ET=G(Q()),wT=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupt-parent"),s=i.root;return(r?an(r?.ast.values?.values.at(0),s):i.parent)?t:r?(t.push(A(18,r.ast.values?.values.at(0)?.value??r.ast)),t):(t.push(A(16,e.ast,ET.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.desctiption=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Cr=G(Q()),NT=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupts");r&&t.push(A(15,r.ast,Cr.DiagnosticSeverity.Warning,[e.ast],[],[r.name,"is ignored when 'interrupts-extended' is used"]));let s=i.getProperty("interrupt-parent");s&&t.push(A(15,s.ast,Cr.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.root,a=wt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=an(a[c],o);if(!l)return t.push(A(18,a[c],Cr.DiagnosticSeverity.Error)),t;let u=yT(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Cr.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Cr.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.desctiption=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var _T=()=>{let n=new K("dma-noncoherent",V(0));return n.desctiption=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var PT=()=>{let n=new K("dma-coherent",V(0));return n.desctiption=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var DT=G(Q()),RT=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?De(r,0,0)??1:1,c=s?De(s,0,0)??2:2,l=o?De(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,DT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var CT=G(Q()),OT=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?De(r,0,0)??1:1,c=s?De(s,0,0)??2:2,l=o?De(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,CT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
183
|
+
${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=nP(r),a=[],c=(l,u,d)=>{if(d??=r.ast,!(l.some(g=>g==u)||l.some(g=>g==5)&&(u===3||u===5)||l.some(g=>g==4)&&(u===1||u===2))){let g=[];l.forEach(_=>{switch(_){case 0:g.push(1);break;case 3:g.push(2);break;case 5:g.push(3);break;case 1:g.push(5);break;case 2:g.push(6);break;case 4:g.push(7);break}}),g.length&&a.push(A(g,d,et.DiagnosticSeverity.Error,[],[],[r.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,r.ast.values??r.ast,et.DiagnosticSeverity.Error,[],[],[i,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(p=>p!==u)&&a.push(A(3,r.ast.values?.values[d]??r.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,r.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,r.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,r.ast.propertyName??r.ast,et.DiagnosticSeverity.Error,(r.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[r.name])):o.length===1&&c(this.type[0].types,o[0],r.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(r)??[]),this.values(r).length&&this.type[0].types.some(l=>l===3))){let l=r.ast.values?.values[0]?.value;this.values(r).some(u=>l.value===u)||a.push(A(9,r.ast.values?.values[0]?.value??r.ast,et.DiagnosticSeverity.Error,[],[],[this.values(r).map(u=>`'${u}'`).join(" or ")]))}return a}validate(e,t){if(typeof this.name=="string"){let s=t.getProperty(this.name);return this.validateProperty(e,t,this.name,s)}let i=t.properties.filter(s=>this.getNameMatch(s.name)),r=t.nodeType?.properties.filter(s=>s!==this)??[];return i.filter(s=>r.some(o=>o.getNameMatch(s.name)))?[]:i.flatMap(s=>this.validateProperty(e,t,s.name,s))}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:`"${i}"`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):t?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:`<${i}>`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},nP=n=>n.ast.values?n.ast.values.values.map(e=>iP(e)):[0],iP=n=>n?n.value instanceof Tt?3:n.value instanceof Ke?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof pe||n.value instanceof sn?1:6:7,pc=class{constructor(){this._properties=[]}getIssue(e,t){let i=[],r=t.getProperty("status"),s=r?.ast.values?.values.at(0)?.value;return s instanceof Tt&&s.value==="disabled"?([...t.definitions,...t.referencedBy].forEach(o=>i.push(A(22,o,et.DiagnosticSeverity.Hint,[...r?.ast.parentNode?[r?.ast.parentNode]:[]],[et.DiagnosticTag.Unnecessary]))),i):[...i,...this.properties.flatMap(o=>o.validate(e,t))]}get properties(){return this._properties}addProperty(e){Array.isArray(e)?e.forEach(t=>this._properties.push(t)):this._properties.push(e),this._properties.sort(t=>typeof t.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(e){e&&(e.bindingsPath=this.bindingsPath,this._childNodeType=e)}getOnPropertyHover(e){let t=this.properties.find(i=>i.getNameMatch(e));return t?.onHover.bind(t)()}};var on=class extends ${constructor(t,i,r){super();this.startLabels=t;this.value=i;this.endLabels=r;this.startLabels.forEach(s=>{this.addChild(s)}),this.addChild(i),this.endLabels.forEach(s=>{this.addChild(s)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}};var wt=n=>{if(!n?.values.some(e=>!(e?.value instanceof Ke)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Re=(n,e,t)=>{let i=n.ast.values?.values.at(e)?.value;if(i instanceof Ke){let r=i.values.at(t);if(r?.value instanceof vt)return r.value.value}},an=(n,e,t=0)=>{if(n instanceof on){if(n?.value instanceof Ke){let i=n.value.values.at(t);if(i?.value instanceof vt)return e.getPhandle(i.value.value);if(i?.value instanceof pe)return i.value.linksTo;if(i?.value instanceof sn)return i.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof vt)return e.getPhandle(n.value);if(n instanceof pe)return n.linksTo;if(n instanceof sn)return n.path?.pathParts.at(-1)?.linksTo}},yT=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values.at(0)?.value;if(i instanceof vt)return{cellsProperty:e,node:n,value:i.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var bT=()=>{let n=new K("compatible",V(5));return n.desctiption=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var cd=G(Q()),TT=()=>{let n=new K("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"optional":"omitted",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Tt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]}return[]});return n.desctiption=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var vT=()=>{let n=new K("#interrupt-cells",V(1));return n.desctiption=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var ST=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.desctiption=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var kT=()=>{let n=new K("interrupt-parent",V(1));return n.desctiption=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var ET=G(Q()),wT=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupt-parent"),s=i.root;return(r?an(r?.ast.values?.values.at(0),s):i.parent)?t:r?(t.push(A(18,r.ast.values?.values.at(0)?.value??r.ast)),t):(t.push(A(16,e.ast,ET.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.desctiption=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Or=G(Q()),NT=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupts");r&&t.push(A(15,r.ast,Or.DiagnosticSeverity.Warning,[e.ast],[],[r.name,"is ignored when 'interrupts-extended' is used"]));let s=i.getProperty("interrupt-parent");s&&t.push(A(15,s.ast,Or.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.root,a=wt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=an(a[c],o);if(!l)return t.push(A(18,a[c],Or.DiagnosticSeverity.Error)),t;let u=yT(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Or.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Or.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.desctiption=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var _T=()=>{let n=new K("dma-noncoherent",V(0));return n.desctiption=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var PT=()=>{let n=new K("dma-coherent",V(0));return n.desctiption=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var DT=G(Q()),RT=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,DT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var CT=G(Q()),OT=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,CT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
184
184
|
compatible = "simple-bus";
|
|
185
185
|
#address-cells = <1>;
|
|
186
186
|
#size-cells = <1>;
|
|
@@ -195,7 +195,7 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=tP(r
|
|
|
195
195
|
};
|
|
196
196
|
};`,"```"].join(`
|
|
197
197
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
198
|
-
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var AT=()=>{let n=new K("virtual-reg",V(1));return n.desctiption=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var ld=G(Q()),IT=()=>{let n=new K("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i)return[];let r=e.parent.parent?.getProperty("#size-cells"),s=e.parent.parent?.getProperty("#address-cells"),o=r?
|
|
198
|
+
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var AT=()=>{let n=new K("virtual-reg",V(1));return n.desctiption=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var ld=G(Q()),IT=()=>{let n=new K("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i)return[];let r=e.parent.parent?.getProperty("#size-cells"),s=e.parent.parent?.getProperty("#address-cells"),o=r?Re(r,0,0)??1:1,a=s?Re(s,0,0)??2:2;if(i.length===0||i.length%(o+a)!==0)return t.push(A(20,i.at(i.length-i.length%(o+a))??e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<i.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);i.slice(0,a).map((d,p)=>Re(e,0,p)??0).forEach((d,p)=>{u.setUint32(p*4,d)}),e.parent.address&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address)||a===1&&u.getUint32(0)!==e.parent.address)&&t.push(A(10,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return n.desctiption=["The reg property describes the address of the device's resources within the address space defined by its parent bus. Most commonly this means the offsets and lengths of memory-mapped IO register blocks, but may have a different meaning on some bus types. Addresses in the address space defined by the root node are CPU real addresses.","The value is a <prop-encoded-array>, composed of an arbitrary number of pairs of address and length, <ad-dress length>. The number of <u32> cells required to specify the address and length are bus-specific and are specified by the #address-cells and #size-cells properties in the parent of the device node. If the parent node specifies a value of 0 for #size-cells, the length field in the value of reg shall be omitted."],n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var LT=()=>new K("#size-cells",V(1),"optional",1);var xT=()=>{let n=new K("#address-cells",V(1),"optional",2);return n.desctiption=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
|
|
199
199
|
#address-cells = <1>;
|
|
200
200
|
#size-cells = <1>;
|
|
201
201
|
serial@4600 {
|
|
@@ -207,7 +207,7 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=tP(r
|
|
|
207
207
|
};
|
|
208
208
|
};`,"```"].join(`
|
|
209
209
|
`),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var MT=()=>{let n=new K("status",V(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.desctiption=[`The status property indicates the operational status of a device.
|
|
210
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var qT=G(Q()),FT=()=>{let n=new K("phandle",V(1),"optional",void 0,[],e=>{let t=
|
|
210
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var qT=G(Q()),FT=()=>{let n=new K("phandle",V(1),"optional",void 0,[],e=>{let t=Re(e,0,0);if(t){let i=e.parent.root.getAllPhandle(t);if(i.length>1&&i.at(-1)===e.parent)return[A(19,e.ast.values?.values.at(0)??e.ast,qT.DiagnosticSeverity.Error,i.slice(0,-1).flatMap(r=>r.getProperty("phandle")?.ast).filter(r=>!!r),[],[e.name])]}return[]});return n.desctiption=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
|
|
211
211
|
phandle = <1>;
|
|
212
212
|
interrupt-controller;
|
|
213
213
|
reg = <0x10000000 0x100>;
|
|
@@ -215,18 +215,18 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=tP(r
|
|
|
215
215
|
`),"A phandle value of 1 is defined. Another device node could reference the pic node with a phandle value of 1:",["```devicetree",`another-device-node {
|
|
216
216
|
interrupt-parent = <1>;
|
|
217
217
|
};`,"```"].join(`
|
|
218
|
-
`)],n};var BT=()=>{let n=new K("model",V(3));return n.desctiption=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var mc=G(Q()),jT=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[A(14,e.ast,mc.DiagnosticSeverity.Warning,[],[mc.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var li=G(Q());var UT=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=e.parent.root,s=wt(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#address-cells"),a=i.getProperty("#interrupt-cells");if(o||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),a||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)return t;let c=0;for(;c<s.length;){let l=De(o,0,0),u=De(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,s.length<c+1){let R=l+u+1;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}let p=an(s[c],r);if(!p){t.push(A(18,s[c],li.DiagnosticSeverity.Error));break}let g=p.getProperty("#address-cells"),_=p.getProperty("#interrupt-cells");if(g||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),_||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)break;c++;let b=De(g,0,0),w=De(_,0,0);if(b==null||w==null)break;if(c+=b+w,s.length<c){let R=l+u+1+b+w;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:b},()=>"ParentUnitAddress"),...Array.from({length:w},()=>"ParentInterruptSpecifier")].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=De(o,0,0),p=De(a,0,0);if(d==null||p==null||!(u.value instanceof Ke))return t}return t});return n.desctiption=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var $T=()=>{let n=new K("interrupt-map-mask",V(4));return n.desctiption=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Or=G(Q()),WT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],i=[],r=e.parent,s=e.parent.root,o=r.getProperty(`#${t}-cells`);if(!o)return i.push(A(16,e.ast,Or.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;let a=De(o,0,0);if(a==null)return i;let c=wt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let _=a+1;i.push(A(21,c[c.length-1],Or.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}let d=an(c[l],s);if(!d){i.push(A(18,c[l],Or.DiagnosticSeverity.Error));break}let p=d.getProperty(`#${t}-cells`);if(!p)return i.push(A(16,c[l],Or.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;l++;let g=De(p,0,0);if(g==null)break;if(l+=g,c.length<l){let _=a+1+g;i.push(A(21,c[c.length-1],Or.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentSpecifier")].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}u=l}return i});return n.desctiption=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var VT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.desctiption=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var HT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.desctiption=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var YT=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.desctiption=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function ui(){let n=new pc;return n.addProperty([bT(),BT(),FT(),MT(),xT(),LT(),IT(),AT(),OT(),RT(),PT(),_T(),jT(),TT(),wT(),kT(),NT(),vT(),ST(),UT(),$T(),WT(),VT(),HT(),YT()]),n}var ge=class{constructor(e,t,i,r=null){this.bindingLoader=e;this.name=t;this.address=i;this.parent=r;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[ui()];r?.addNode(this)}get nodeTypes(){let e=this.parent?.nodeTypes.at(0)?.childNodeType;return e?[e]:this._nodeTypes??[ui()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return uc([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let i=[...this.definitions,...this.referencedBy].find(r=>bn(r,e,t));if(i){let r=this.deletes.map(c=>({item:this,ast:Tn(c,e,t)})).find(c=>bn(c.ast,e,t));if(r)return r;let s=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>c.ast.lastToken.value===";"?bn(c.ast,e,t):nT(c.ast,e,t));if(s)return s.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Tn(i,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof de).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.properties.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.properties.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.properties.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof de),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:En.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[t instanceof de?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get properties(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(i=>i.name===e&&i.address===t)}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,i){let r=this._nodes.findIndex(s=>s.name===e&&i===s.address);r!==-1&&(this._deletedNodes.push({node:this._nodes[r],by:t}),this._nodes.splice(r,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]}return this._nodes.flatMap(i=>i.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return this}return this._nodes.flatMap(i=>i.getPhandle(e)).find(i=>!!i)}getNode(e,t,i=!0){let r=i||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!r||o.address===t));if(s!==-1)return this._nodes[s]}deleteProperty(e,t){let i=this._properties.findIndex(r=>r.name===e);i!==-1&&(this._deletedProperties.push({property:this._properties[i],by:t}),this._properties.splice(i,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(i=>i.name===e.name);if(t===-1)this._properties.push(e);else{let i=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=i,i.replacedBy=e}e.name==="compatible"&&(this._nodeTypes=this.bindingLoader?.getNodeTypes(this)??[ui()])}getChild(e,t=!0){let i=[...e];i.splice(0,1);let r=i[0].split("@"),s=r[0],o=r[1]!==void 0?Number.parseInt(r[1],16):void 0,a=this.getNode(s,o,t);return i.length===1||!a?a:a.getChild(i)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let i=[...e];return i.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!t(s.by)).map(s=>s.node)].find(s=>s.fullName===i[0])?.getChildFromScope(i,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.properties.length?`
|
|
218
|
+
`)],n};var BT=()=>{let n=new K("model",V(3));return n.desctiption=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var mc=G(Q()),jT=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[A(14,e.ast,mc.DiagnosticSeverity.Warning,[],[mc.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var li=G(Q());var UT=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=e.parent.root,s=wt(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#address-cells"),a=i.getProperty("#interrupt-cells");if(o||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),a||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)return t;let c=0;for(;c<s.length;){let l=Re(o,0,0),u=Re(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,s.length<c+1){let R=l+u+1;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}let p=an(s[c],r);if(!p){t.push(A(18,s[c],li.DiagnosticSeverity.Error));break}let g=p.getProperty("#address-cells"),_=p.getProperty("#interrupt-cells");if(g||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),_||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)break;c++;let b=Re(g,0,0),w=Re(_,0,0);if(b==null||w==null)break;if(c+=b+w,s.length<c){let R=l+u+1+b+w;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:b},()=>"ParentUnitAddress"),...Array.from({length:w},()=>"ParentInterruptSpecifier")].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Re(o,0,0),p=Re(a,0,0);if(d==null||p==null||!(u.value instanceof Ke))return t}return t});return n.desctiption=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var $T=()=>{let n=new K("interrupt-map-mask",V(4));return n.desctiption=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Ar=G(Q()),WT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],i=[],r=e.parent,s=e.parent.root,o=r.getProperty(`#${t}-cells`);if(!o)return i.push(A(16,e.ast,Ar.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;let a=Re(o,0,0);if(a==null)return i;let c=wt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let _=a+1;i.push(A(21,c[c.length-1],Ar.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}let d=an(c[l],s);if(!d){i.push(A(18,c[l],Ar.DiagnosticSeverity.Error));break}let p=d.getProperty(`#${t}-cells`);if(!p)return i.push(A(16,c[l],Ar.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;l++;let g=Re(p,0,0);if(g==null)break;if(l+=g,c.length<l){let _=a+1+g;i.push(A(21,c[c.length-1],Ar.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentSpecifier")].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}u=l}return i});return n.desctiption=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var VT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.desctiption=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var HT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.desctiption=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var YT=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.desctiption=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function ui(){let n=new pc;return n.addProperty([bT(),BT(),FT(),MT(),xT(),LT(),IT(),AT(),OT(),RT(),PT(),_T(),jT(),TT(),wT(),kT(),NT(),vT(),ST(),UT(),$T(),WT(),VT(),HT(),YT()]),n}var ye=class{constructor(e,t,i,r=null){this.bindingLoader=e;this.name=t;this.address=i;this.parent=r;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[ui()];r?.addNode(this)}get nodeTypes(){let e=this.parent?.nodeTypes.at(0)?.childNodeType;return e?[e]:this._nodeTypes??[ui()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return uc([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let i=[...this.definitions,...this.referencedBy].find(r=>bn(r,e,t));if(i){let r=this.deletes.map(c=>({item:this,ast:Tn(c,e,t)})).find(c=>bn(c.ast,e,t));if(r)return r;let s=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>c.ast.lastToken.value===";"?bn(c.ast,e,t):nT(c.ast,e,t));if(s)return s.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Tn(i,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof he).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.properties.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.properties.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.properties.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof he),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:En.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[t instanceof he?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get properties(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(i=>i.name===e&&i.address===t)}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,i){let r=this._nodes.findIndex(s=>s.name===e&&i===s.address);r!==-1&&(this._deletedNodes.push({node:this._nodes[r],by:t}),this._nodes.splice(r,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]}return this._nodes.flatMap(i=>i.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return this}return this._nodes.flatMap(i=>i.getPhandle(e)).find(i=>!!i)}getNode(e,t,i=!0){let r=i||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!r||o.address===t));if(s!==-1)return this._nodes[s]}deleteProperty(e,t){let i=this._properties.findIndex(r=>r.name===e);i!==-1&&(this._deletedProperties.push({property:this._properties[i],by:t}),this._properties.splice(i,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(i=>i.name===e.name);if(t===-1)this._properties.push(e);else{let i=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=i,i.replacedBy=e}e.name==="compatible"&&(this._nodeTypes=this.bindingLoader?.getNodeTypes(this)??[ui()])}getChild(e,t=!0){let i=[...e];i.splice(0,1);let r=i[0].split("@"),s=r[0],o=r[1]!==void 0?Number.parseInt(r[1],16):void 0,a=this.getNode(s,o,t);return i.length===1||!a?a:a.getChild(i)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let i=[...e];return i.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!t(s.by)).map(s=>s.node)].find(s=>s.fullName===i[0])?.getChildFromScope(i,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.properties.length?`
|
|
219
219
|
`:""}${this.properties.map(e=>e.toString()).join(`
|
|
220
220
|
`)}${this.nodes.length?`
|
|
221
221
|
${this.nodes.map(e=>`${e.fullName}{ /* ... */ };`).join(`
|
|
222
222
|
`)}`:""}
|
|
223
223
|
};`}toMarkupContent(){return{kind:En.MarkupKind.Markdown,value:["### Current State","```devicetree",this.toString(),"```",...this.nodeType?.description?["### Description",this.nodeType?.description]:[]].join(`
|
|
224
|
-
`)}}};var yc=G(Q());var ud=G(Q());var fi=class extends ${constructor(t,i){super(i);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:ud.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},Ge=class extends ${constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value,kind:ud.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let i=this.parentNode;if(!(i instanceof
|
|
224
|
+
`)}}};var yc=G(Q());var ud=G(Q());var fi=class extends ${constructor(t,i){super(i);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:ud.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},Ge=class extends ${constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value,kind:ud.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let i=this.parentNode;if(!(i instanceof pe&&i.linksTo)){super.buildSemanticTokens(t);return}t(ri("type"),si("declaration"),{start:this.firstToken,end:this.lastToken})}};var Xe=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){return{item:this,ast:Tn(this.ast,e,t)}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof fi)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[{issues:[0],severity:yc.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[yc.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var zT=G(Q());var Tc=require("fs");var bc=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
225
225
|
`,`
|
|
226
226
|
`).split(/\n/).map(i=>`${i}
|
|
227
227
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
228
|
-
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let i=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,i===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let i=this._tokens.at(-1);return t&&!i?.tokens.some(r=>r===21)&&i&&i.pos.len<e.length?this.process(e.slice(i.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},i=this._tokens.at(-1);t.prevToken=i,i&&(i.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let i=this.lineNumber,r=this.columnNumber,s=this.getString(t[0]);return this.pushToken({tokens:[21],value:s,pos:{col:r-1,line:i,len:s.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var KT,fd=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(i=>({...i}));return t.forEach((i,r)=>{i.prevToken=t[r-1],i.nextToken=t[r+1]}),t}renewLexer(e,t){if(!e||!(0,Tc.existsSync)(e))return[];t??=(0,Tc.readFileSync)(e).toString();let i=new bc(t,e);return this.fileMap.set(e,i),n.clone(i.tokens)}requestTokens(e,t){let i=this.fileMap.get(e)?.tokens;return!i&&t?[...this.renewLexer(e)]:n.clone(i??[])}};function di(){return KT??=new fd,KT}var vc=class n{constructor(e){this.bindingLoader=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new ge(this.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(i=>n.getFileTopMostAst(i,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let r=this.fileTopMostAst(e).find(s=>bn(s,e,t)||iT(di().requestTokens(e,!1),s,t));if(r instanceof rt){let o=this.rootNode.getReferenceBy(r)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Tn(r,e,t)}}else if(r instanceof qt&&r.path){let s=this.rootNode.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r instanceof de&&r.path){let s=n.getNodeFromPath(r.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r)return{runtime:this,item:null,ast:Tn(r,e,t)}}static getNodeFromPath(e,t){if(e.length===0)return t;let i=e[0].split("@"),r=i[0],s=i.at(1),o=s?Number.parseInt(s,16):void 0,a=e.slice(1),c=t.getNode(r,o);return c?n.getNodeFromPath(a,c):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let i=this.labelsUsedCache.get(e[0].slice(1));return i||(t??=this.rootNode.allDescendantsLabels,t.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof Pe)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(i=>{t.has(i.label.label.value)?t.get(i.label.label.value)?.push(i):t.set(i.label.label.value,[i])}),Array.from(t).forEach(i=>{let r=i[1];if(r.length>1){let s=r.find(a=>a.owner instanceof ge);if(!r.every(a=>a&&a.owner===s?.owner)||!s){let a=r.filter(c=>!(c&&c.owner===s?.owner));e.push(A(4,r.at(0).label,zT.DiagnosticSeverity.Error,r.slice(1).map(c=>c.label),[],[r.at(0).label.label.value]))}}}),e}get typesIssues(){if(this.typeIssueCache)return this.typeIssueCache;let e=t=>[...t.nodeTypes.at(0)?.getIssue(this,t)??[],...t.nodes.flatMap(i=>e(i))];return this.typeIssueCache=e(this.rootNode),this.typeIssueCache}getOrderedNodeAst(e){return rT([...e.definitions,...e.referencedBy])}};var st=class extends ${constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var GT=G(Q()),Sc=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:GT.SymbolKind.String},this.values.forEach(i=>this.addChild(i))}};var XT=G(Q()),kc=class extends ${constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:XT.SymbolKind.Function}}};var wn=class extends ${constructor(t,i){super();this.value=t;this.labels=i;this.labels.forEach(r=>{this.addChild(r)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var dd=G(Q());var Ec=class extends vn{constructor(t,i,r){super(i);this.value=t;this.docSymbolsMeta={name:`param${r+1}`,kind:dd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},wc=class extends vn{constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:dd.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var QT=G(Q());var Ar=class extends vn{constructor(t,i){super(i);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:QT.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Nc=class extends ${constructor(t,i){super(i);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var hi=class{constructor(){this.positionStack=[];this.issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{if(this.currentToken?.pos.line!==e)return;let i=this.currentToken,r=i;for(;this.currentToken?.pos.line===e;)r=this.moveToNextToken;if(t){let s=new $(z(i,r));this.issues.push(A(22,s))}return r};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this.issues=[]}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this.issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this.issues.length&&this.issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(i=>{let r=this.currentToken,s=i(r),o=!1;return s!=="no"&&r&&(t.push(r),this.moveToNextToken,o=Bn(r,this.currentToken)),s==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],i,r=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&r);)t.push(this.currentToken),i=this.currentToken,this.moveToNextToken,r=Bn(i,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let i=[],r=(s,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;i.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(r)}),i.sort((s,o)=>s.line===o.line?s.char-o.char:s.line-o.line).forEach(s=>e.push(s.line,s.char,s.length,s.tokenType,s.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(Ee));if(!e.length){this.popStack();return}let t=e.map(r=>r.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Ar(t,z(e[0],e.at(-1)));return this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,i;if(M(e,40)?(i="&",M(this.currentToken,40)&&(i="&&",t=this.moveToNextToken)):M(e,10)?(i="!",M(this.currentToken,0)&&(i="==",t=this.moveToNextToken)):M(e,8)?(i="|",M(this.currentToken,8)&&(i="||",t=this.moveToNextToken)):M(e,9)?i="^":M(e,4)?(i=">",M(this.currentToken,4)?(i="<<",t=this.moveToNextToken):M(this.currentToken,0)&&(i=">=",t=this.moveToNextToken)):M(e,5)?(i=">",M(this.currentToken,5)?(i=">>",t=this.moveToNextToken):M(this.currentToken,0)&&(i="<=",t=this.moveToNextToken)):M(e,15)?i="+":M(e,16)?i="-":M(e,17)?i="*":M(e,13)?i="/":M(e,18)?i="%":M(e,46)&&M(this.currentToken,46)&&(i="##",t=this.moveToNextToken),i){let r=new Nc(i,z(e,t));return this.mergeStack(),r}this.popStack()}parseScopedBlock(e,t,i){this.enqueueToStack();let r=this.moveToNextToken;if(!r||!e(r)){this.popStack();return}let s=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(i?.(l)&&(o[o.length]=[]),l&&(s.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,i);u&&(s.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:r,items:s,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var hd=require("fs"),Ir=require("path");var Pc=class n extends hi{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let i=0;i<this.tokens.length;i++){let r=n.processBlockComments(this.tokens,i)||n.processLineComments(this.tokens,i);r&&(i=r.index,t.push(...r.tokenUsed),this.comments.push(...r.comments))}t.reverse().forEach(i=>this.tokens.splice(i,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=di().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,i){let r=[],s=()=>(r.push(i++),t[i]),o=()=>t[i],a=()=>t[i-1],c=o(),l=c;if(!c||!M(c,13)||(l=s(),!M(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!M(a(),17)||!M(o(),13)||!Bn(a(),o())),d=l.pos.line,p=c,g=[];l=s();do{if(o()?.pos.line!==d){let b=new kn(z(p,a()));g.push(b),d=o().pos.line??0,p=o()}l=s()}while(i<t.length&&!u());let _=new kn(z(p,o()));return g.push(_),s(),{comments:g,tokenUsed:r,index:i-1}}static processLineComments(t,i){let r=[];if(!M(t[i],13)||t.length===i+1||!M(t[i+1],13)||!Bn(t[i],t[i+1]))return;let s=[];for(;t[i].pos.line===t.at(i+1)?.pos.line;)r.push(i++);r.push(i++);let o=t[r.at(-1)],a=new kn(z(t[r[0]],t[r.at(-1)]));return s.push(a),{comments:s,tokenUsed:r,index:i-1}}};var Dc=class extends ${constructor(t,i){super(t);this.content=i}toString(){let t=this.content.filter(i=>!M(i,14));return t.map((i,r)=>{let s=i.value;return i.pos.line===t.at(r+1)?.pos.line?s=s.padEnd(t[r+1].pos.col-i.pos.col," "):t.at(r+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Rc=class extends ${constructor(t,i,r){super();this.keyword=t;this.identifier=i;this.content=r;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ar?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var JT=G(Q());var Cc=class extends st{toString(){return"..."}},Oc=class extends ${constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:JT.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Ps=class extends ${constructor(e){super(e)}},Ac=class extends ${constructor(t,i){super();this.keyword=t;this.content=i;this.addChild(t)}},Ds=class extends Ac{constructor(t,i,r){super(t,r);this.identifier=i;this.addChild(i),this.addChild(r)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Ic=class extends Ds{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Lc=class extends Ac{};var xc=class extends ${constructor(t,i,r){super();this.ifDef=t;this.endIf=i;this.elseOption=r;this.addChild(t),r&&this.addChild(r),this.addChild(i)}getInValidTokenRange(t,i){let r=[],s=a=>i.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];r.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&r.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(r.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&r.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&r.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),r}};var Mc=class n extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.macros=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(r).forEach(([s,o])=>this.macroSnapShot.set(s,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,i])=>this.macros.set(t,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(i=>{t.then(()=>{this.reset(),this.parse().then(i)})}),this.parsing}async parse(){let t=new Pc(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),this.prevToken&&this.prevToken.pos.line===this.currentToken?.pos.line){this.moveEndOfLine(this.prevToken.pos.line,!1),this.mergeStack();return}let t=this.currentToken?.pos.line,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();t!==void 0&&this.moveEndOfLine(t,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken;if(!i||!M(i,25))return this.popStack(),!1;let r=new st(z(i)),s=this.isFunctionDefinition()||this.processCIdentifier();if(!s)return this.issues.push(A(30,r)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Dc(z(o[0],o.at(-1)),o));let c=new Rc(r,s,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],i=this.prevToken;for(;Fn(i,this.currentToken)||i&&M(i,14)&&i.pos.line+1===this.currentToken?.pos.line;)i=this.moveToNextToken,i&&t.push(i);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.moveToNextToken;if(!M(i,42)){this.popStack();return}let r=[],s=this.processCIdentifier()||this.processVariadic();for(;s;)r.push(s),!M(this.currentToken,24)&&!M(this.currentToken,43)?this.issues.push(A(28,s)):M(this.currentToken,43)||(i=this.moveToNextToken),s=this.processCIdentifier()||this.processVariadic();let o=new Oc(t,r);return M(this.currentToken,43)?(i=this.moveToNextToken,o.lastToken=i):(o.lastToken=this.prevToken,this.issues.push(A(26,r.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ee(45),Ee(45),Ee(45)]);if(t.length!==3){this.popStack();return}let i=new Cc(z(t[0],t.at(-1)));return this.mergeStack(),i}processIfDefBlocks(){let t=this.peekIndex(),i=this.parseScopedBlock(r=>{let s=this.getTokenIndex(r)-1;return!!r&&[33,34].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[37].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[36].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)});if(i&&(M(i.startToken,33)||M(i.startToken,34))){let r;M(i.startToken,33)?r=this.processIfDefBlock(i,(o,a,c)=>new Ds(o,a??null,c)):r=this.processIfDefBlock(i,(o,a,c)=>new Ic(o,a??null,c)),this.nodes.push(r),r.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,i){this.enqueueToStack();let r=new st(z(t.startToken)),s=new st(z(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this.issues.push(A(31,r));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new Ps(z(this.currentToken,this.tokens[a])),l=i(r,o??null,c),u;if(t.splitTokens.length>1){let p=this.getTokenIndex(t.splitTokens[1][0]),g=new st(z(this.tokens[p])),_=new Ps(z(this.tokens[p+1],t.splitTokens[1].at(-1)));u=new Lc(g,_)}let d=new xc(l,s,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,Ir.resolve)((0,Ir.dirname)(t.uri),t.path.path),...this.incudes.map(i=>(0,Ir.resolve)(i,t.path.path))].find(i=>(0,hd.existsSync)(i)):this.incudes.map(i=>(0,Ir.resolve)(i,t.path.path)).find(i=>(0,hd.existsSync)(i))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken,r=i;if(!r||!M(r,26))return this.popStack(),!1;let s=i?.pos.line,o=new st(z(r));r=this.moveToNextToken;let a=r,c=!!M(r,21);if(!a||!c&&!M(r,5))return s&&this.moveEndOfLine(s),this.mergeStack(),!0;let l="";if(c)l=r?.value??"";else for(;this.currentToken?.pos.line===s&&!M(this.currentToken,4);)l+=this.currentToken?.value??"",r=this.moveToNextToken;let u=new dc(l,c,z(a,r)),d=new ai(o,u);this.dtsIncludes.push(d),c||(this.currentToken?.pos.line!==s||!M(this.currentToken,4)?this.issues.push(A(12,d)):(r=this.moveToNextToken,u.lastToken=r)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(d);if(d.reolvedPath=g,g&&!g.endsWith(".h")){di().requestTokens(g,!0);let _=new n(g,this.incudes,this.macros);await _.stable,this.tokens.splice(t,p-t,..._.tokens),this.nodes.push(..._.nodes),this.dtsIncludes.push(..._.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var Rs=class extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.tokens=[];this.others=[];this.rootDocument=new Pe;this.issues=[];this.unhandledStatements=new qt;this.cPreprocessorParser=new Mc(this.uri,this.incudes,r)}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new Pe,this.issues=[],this.unhandledStatements=new qt}async reparse(){let t=performance.now(),i=this.stable;return this.parsing=new Promise(r=>{i.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),r()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let i=async()=>{if(!(this.isDtsDocumentVersion()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let r=this.moveToNextToken;if(r){let s=new $(z(r));this.issues.push(A(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await i();if(this.unhandledStatements.properties.forEach(r=>{this.issues.push(A(32,r))}),this.unhandledStatements.deleteProperties.forEach(r=>{this.issues.push(A(33,r))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let i=this.moveToNextToken,r=i,s=13;if(!i||!M(i,s))return this.popStack(),!1;if(r=this.moveToNextToken,s=2,!r||!M(r,s))return this.popStack(),!1;let o=new qt;o.openScope=r,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??r;return o.firstToken=i,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let i=this.currentToken;if(M(i,3))this.moveToNextToken;else{let r=this.prevToken;if(r){let s=new $(z(r));this.issues.push(A(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return M(this.currentToken,3)||M(this.currentToken,1)}endStatement(t=!0){let i=this.currentToken;if(!M(i,1)){let r=this.prevToken;if(r&&t){let s=new $(z(this.prevToken));return this.issues.push(A(1,s)),r}}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;M(this.currentToken,1);){let t=this.moveToNextToken;if(t){let i=new $(z(t));this.issues.push(A(23,i))}}}processNode(t,i){if(this.done)return!1;let r=!1,s=!1;do{if(s=this.isChildNode(t,i)||this.isProperty(t)||this.isDeleteNode(t,i)||this.isDeleteProperty(t),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new $(z(o));this.issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;r=r||s}while(!this.isNodeEnd());return r}processOptionalLabelAssign(t=!1){let i=[],r=this.isLabelAssign(t);for(;r;)i.push(r),r=this.isLabelAssign(t);return i}isChildNode(t,i){this.enqueueToStack();let r;i==="Name"&&(r=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=i==="Ref"?new rt(s):new de(s,r);if(i==="Ref"?a=this.isLabelRef():i==="Name"&&(o=this.isNodeName()),!a&&!o){if(!M(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this.issues.push(A(i==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof rt?(c.labelReference=a,l=!0):o&&c instanceof de&&(l=o.address!==void 0,c.name=o),M(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this.issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Ee));if(!t.length){this.popStack();return}let i=t.map(o=>o.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=this.checkConcurrentTokens([Ee(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(Ee)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new Te(i,z(t[0],o.at(-1)??t.at(-1)),a);if(!Bn(t.at(-1),r[0])){let l=new $(z(t.at(-1),r[0]));this.issues.push(A(29,l))}if(Number.isNaN(a)&&this.issues.push(A(8,c)),!Number.isNaN(a)&&!Bn(r.at(-1),o[0])){let l=new $(z(r[0],o.at(0)));this.issues.push(A(29,l))}return this.mergeStack(),c}let s=new Te(i,z(t[0],t.at(-1)));return this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Ee));if(!t.length){this.popStack();return}let i=new _e(t.map(r=>r.value).join(""),z(t[0],t.at(-1)));return this.mergeStack(),i}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Ee));if(!t.length){this.popStack();return}let i=t.map(s=>s.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=new Ge(i,z(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(Ee));if(!i.length){this.popStack();return}let r=i.map(c=>c.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&M(s,50),a=new fi(new Ge(r,z(i[0],i.at(-1))),z(i[0],o?s:i.at(-1)));if(o){let c=i.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.col+c.pos.len)&&this.issues.push(A(29,new $(z(c,s)))),this.moveToNextToken}else if(t)this.issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(),r=this.isPropertyName();if(!r)return this.popStack(),!1;if(M(this.currentToken,2)||M(this.currentToken,49))return this.popStack(),!1;let s=new Me(r,i),o;M(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this.issues.push(A(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,t.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ee(13),Je("d"),Je("ts"),Ee(16),Je("v"),Je("1")]);if(!t.length)return this.popStack(),!1;let i=t[0],r=i;if(t.length===1&&!M(this.currentToken,2))return this.popStack(),!1;if(t.length!==6)return this.popStack(),!1;let s=new st;s.firstToken=i;let o=new kc(s);if(this.others.push(o),M(this.currentToken,13))r=this.moveToNextToken;else return s.lastToken=t.at(-1),this.issues.push(A(21,o)),this.mergeStack(),!0;return s.lastToken=r,o.lastToken=this.endStatement(),this.mergeStack(),!0}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ee(13),Je("omit"),Ee(16),Je("if"),Ee(16),Je("no"),Ee(16),Je("ref"),Ee(13)]);if(t.length!==9){this.popStack();return}let i=new st(z(t[0],t.at(-1)));return this.mergeStack(),i}isDeleteNode(t,i){this.enqueueToStack();let r=this.checkConcurrentTokens([Ee(13),Je("d"),Je("e"),Je("lete"),Ee(16),Je("node")]);if(!r.length)return this.popStack(),!1;let s=r[0],o=s,a=new st;if(a.firstToken=s,r.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,a)),a.lastToken=r.at(-1);let d=new Kt(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=r.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=r.at(-1),c!=="/delete-node"?this.issues.push(A(c.startsWith("/delete-n")?34:25,a)):M(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this.issues.push(A(21,a));let l=new Kt(a);if(Fn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&i==="Name"&&this.issues.push(A(7,d));let p=d?void 0:this.isLabelRef();p&&i==="Name"&&this.issues.push(A(7,p));let g=d||p?void 0:this.isNodeName();g&&i==="Ref"&&this.issues.push(A(10,g)),!d&&!g&&!p&&this.issues.push(A([7,10],l)),l.nodeNameOrRef=d??p??g??null}else i==="Name"?this.issues.push(A(7,a)):i==="Ref"&&this.issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let i=this.checkConcurrentTokens([Ee(13),Je("d"),Je("e"),Je("lete"),Ee(16),Je("property")]);if(!i.length)return this.popStack(),!1;let r=i[0],s=r,o=new st;if(o.firstToken=r,i.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,o)),o.lastToken=i.at(-1);let u=new Ae(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=i.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=i.at(-1),a!=="/delete-property"?this.issues.push(A(a.startsWith("/delete-p")?35:25,o)):M(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this.issues.push(A(21,o));let c=new Ae(o);if(Fn(o.tokenIndexes?.end,r)){let u=this.isPropertyName();u||this.issues.push(A(6,c)),c.propertyName=u??null}else this.issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.processNodePathRef();if(!i){this.popStack();return}let r=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&r.push(...this.processOptionalLabelAssign(!0));let s=new on(t,i,r);return this.mergeStack(),s}processValue(t){this.enqueueToStack();let r=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!M(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=M(this.currentToken,24);d&&this.moveToNextToken;let p=o();if(u&&p===null&&d){let g=new $(z(u,this.currentToken));this.issues.push(A(0,g))}if(!d&&p===null)break;if(l&&!d&&p){let g=new $(z(l));this.issues.push(A(28,g))}c.push(p)}return c})();if(r.length===0){this.popStack();return}return this.mergeStack(),new Sc(r)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken;if(!M(i,21)){this.popStack();return}if(!i?.value)throw new Error("Token must have value");let r=i.value;r.match(/["']$/)&&(r=r.slice(1,-1));let s=new Tt(r,z(i));i.value.match(/["']$/)||this.issues.push(A(i.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new on(t,s,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.currentToken;if(M(r,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues(t)??null;s.openBracket=r;let o=this.processOptionalLabelAssign(!0)??[],a=new on(i,s,o);M(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this.issues.push(A(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=r,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken,r=i;if(!M(r,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this.issues.push(A(15,u))});let a=new oi(s??[]);a.openBracket=r,a.values.length===0&&(a.firstToken=i,this.issues.push(A(14,a)));let c=new on(t,a,o);M(this.currentToken,12)?a.openBracket=this.moveToNextToken:this.issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let i=t(),r=[];if(!i)return this.popStack(),[];for(;i;)r=[...r,i],i=t();if(r){let s=t();s&&(r=[...r,s])}return this.mergeStack(),r}processArrayValues(t){this.enqueueToStack();let i=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new Ke(i);return i.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processHex();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Je("0"),Je("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(Ee));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(o=>o.value).join(""),16),s=new vt(r,z(t[0],i.at(-1)));return this.mergeStack(),s}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.checkConcurrentTokens([20,20].map(Ee));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(a=>a.value).join(""),16),s=new vt(r,z(i[0],i.at(-1))),o=new wn(s,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processDec();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(Ee));if(!t.length){this.popStack();return}let i=Number.parseInt(t.map(s=>s.value).join(""),10),r=new vt(i,z(t[0],t.at(-1)));return this.mergeStack(),r}processLabeledExpression(t=!0,i=t){this.enqueueToStack();let r=[];t&&(r=this.processOptionalLabelAssign(i));let s=this.processExpression();if(!s){this.popStack();return}let o=new wn(s,r);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.processMacroCallParams();if(!i){this.popStack();return}let r=new wc(t,i);return this.mergeStack(),r}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.processExpression();if(!i){this.popStack();return}let r=this.processOptionalLabelAssign(!0),s=new on(t,i,r);return this.mergeStack(),s}processExpression(){this.enqueueToStack();let t=!1,i,r;M(this.currentToken,42)&&(t=!0,i=this.moveToNextToken,r=i);let s=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!s){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?s instanceof Ns?s.addExpression(o,a):s=new Ns(s,{operator:o,expression:a}):this.issues.push(A(27,o)),o=this.isOperator()}M(this.currentToken,43)?r=this.moveToNextToken:this.issues.push(A(26,o??s))}return this.mergeStack(),s}processMacroCallParams(){return M(this.currentToken,42)?this.parseScopedBlock(r=>!!M(r,42),r=>!!M(r,43),r=>!!M(r,24))?.splitTokens.map((r,s)=>{if(r.length===0||M(r[0],24)&&r.length===1)return null;let o=s?r.slice(1):r;return new Ec(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),z(o[0],o.at(-1)),s)}):void 0}isLabelRef(t){this.enqueueToStack();let i=this.currentToken;if(M(i,40))this.moveToNextToken;else{this.popStack();return}let r=this.isLabelName();if(!r){let o=new he(null);return this.issues.push(A(18,t??o)),o.firstToken=i,this.mergeStack(),o}i&&(r.firstToken.pos.line!==i.pos.line||r.firstToken.pos.col!==i.pos.col+i.pos.len)&&this.issues.push(A(29,new $(z(i,r.firstToken))));let s=new he(r);return s.firstToken=i,this.mergeStack(),s}isLabelRefValue(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.isLabelRef(t);if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new on(i,r,s);return this.mergeStack(),o}processRefValue(t,i){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.currentToken;if(!M(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new wn(o,r);return this.mergeStack(),l}let a=this.isLabelRef(i);if(a===void 0){this.issues.push(A([18,9],i));let l=new wn(null,r);return l.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),l}let c=new wn(a,r);return c.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(t=!0,i=new jn){this.enqueueToStack();let r;if(M(this.currentToken,13))r=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this.issues.push(A(19,new $(z(this.prevToken))))}let s=this.isNodeName();return s||this.issues.push(A(7,new $(z(r??this.prevToken)))),i.addPath(s??null,r?new $(z(r)):void 0),this.processNodePath(!1,i),this.mergeStack(),i}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,i=t;if(!M(i,40)){this.popStack();return}let r=this.moveToNextToken;if(i=r,!M(i,2)){this.popStack();return}let s=this.processNodePath(),o=new sn(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&l.lastToken.pos.col+l.lastToken.pos.len!==c.pos.col){this.issues.push(A(29,new $(z(l.lastToken,c))));return}if(u===0&&r&&r.pos.col+r.pos.len!==l?.firstToken.pos.col){this.issues.push(A(29,new $(z(r,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&l.lastToken.pos.col+l.lastToken.pos.len!==d?.firstToken.pos.col&&this.issues.push(A(29,new $(z(l.lastToken,d?.firstToken))))}),M(a,3)?this.moveToNextToken:this.prevToken&&this.issues.push(A(3,new $(z(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof ai)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Lr=G(Q());var ZT=require("fs"),ev=require("path");var xr=class{constructor(e,t,i,r=[],s){this.bindingLoader=i;this._issues=[];this.overlays=[];this.overlays=Array.isArray(r)?r:[r],this.overlays.filter(ZT.existsSync),this.parser=new Rs(e,t),this.name=s??(0,ev.basename)(e),this.overlayParsers=this.overlays?.map(o=>new Rs(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(r=>r.ast.uri===e).flatMap(r=>r.ast.values?.values.flatMap(s=>{let a=r.parent?.nodeTypes.find(c=>s?.value instanceof Tt&&c.compatible===s.value.value);return a?{range:ne(s.value),target:`file://${a.bindingsPath}`}:void 0})).filter(r=>r)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(r=>r.uri===e).map(r=>{let s=this.parser.cPreprocessorParser.resolveInclude(r);if(s)return{range:ne(r.path),target:`file://${s}`}}).filter(r=>r)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let t=s=>[...s.properties,...s.nodes.flatMap(t)],i=t(e.rootNode),r=e.rootNode.allDescendantsLabels;i.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof he){let a=e.resolvePath([`&${o.label?.value}`],r);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,Lr.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof jn){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let p=a?.getNode(d.name,d.address,!1);d.linksTo=p,!u&&!p&&(u=!0,this._issues.push(A(8,d,Lr.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(g=>g?.linksTo).map(g=>g?.toString()).join("/")}`]))),p?.linkedNodeNamePaths.push(d),a=p}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new vc(this.bindingLoader);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let i=0;i<this.overlayParsers.length;i++)this.processRoot(this.overlayParsers[i].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(i=>i instanceof kn),(await this.getAllParsers()).flatMap(i=>i.tokens).forEach((i,r)=>i.sortKey=r),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let i=0;i<e.children.length;i++){let r=e.children[i];this.processChild(r,t.rootNode,t)}}processChild(e,t,i){e instanceof Pe?this.processDtcBaseNode(e,t,i):e instanceof Me?this.processDtcProperty(e,t,i):e instanceof Kt?this.processDeleteNode(e,t,i):e instanceof Ae&&this.processDeleteProperty(e,t,i)}checkNodeUniqueNames(e,t){let i=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address===a.address)),r=t.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof de&&o.name)i(s,o.name)&&this._issues.push(A(2,o.name)),s.push(o.name);else if(o instanceof Kt&&o.nodeNameOrRef instanceof Te){let a=o.nodeNameOrRef;i(r,a)&&(s=s.filter(c=>i(s,c)))}})}processDtcBaseNode(e,t,i){e instanceof qt?this.processDtcRootNode(e,i):e instanceof de?this.processDtcChildNode(e,t,i):e instanceof rt&&this.processDtcRefNode(e,i)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((i,r)=>i instanceof Me&&r instanceof Ae||r instanceof Me&&i instanceof Ae?0:r instanceof Me?1:0).forEach(i=>this.processChild(i,t.rootNode,t))}processDtcChildNode(e,t,i){if(e.name?.name){let r=e.path?i.resolvePath(e.path):void 0,o=(r?i.rootNode.getChild(r):void 0)??new ge(this.bindingLoader,e.name.name,e.name.address,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((r,s)=>r instanceof Pe&&s instanceof Pe?0:r instanceof Pe?-1:0).forEach(r=>this.processChild(r,t,i))}processDtcRefNode(e,t){let i;if(e.labelReference){let r=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);r?(e.resolveNodePath??=[...r],i=t.rootNode.getChild(r),e.labelReference.linksTo=i,e.labels.forEach(s=>s.lastLinkedTo=i),i?.linkedRefLabels.push(e.labelReference),i?.referencedBy.push(e),e.labels.forEach(s=>{t.labelsUsedCache.set(s.label.value,r)}),i?(t.references.push(e),this.checkNodeUniqueNames(e,i)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,Lr.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((r,s)=>r instanceof Pe&&s instanceof Pe?0:r instanceof Pe?-1:0).forEach(r=>this.processChild(r,i??new ge(this.bindingLoader,""),t))}processDtcProperty(e,t,i){e.propertyName?.name&&t.addProperty(new Xe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof Te&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let r=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address);e.nodeNameOrRef.linksTo=r,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address),r?.labels.forEach(s=>{i.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof he&&e.nodeNameOrRef.value){let r=i.resolvePath([`&${e.nodeNameOrRef.value}`]),s;r?(s=i.rootNode.getChild(r),t.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{i.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof Pe&&!e.parentNode.pathName&&i.globalDeletes.push(e)):(i.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,Lr.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof sn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(r=>!r)){let r=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=i.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let p=s?.getNode(d.name,d.address,!1);d.linksTo=p,p?.linkedNodeNamePaths.push(d),s=p}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(i.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,Lr.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{i.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Pe&&!e.parentNode.pathName&&i.globalDeletes.push(e)}else i.unlinkedDeletes.push(e);e.children.forEach(r=>this.processChild(r,t,i))}processDeleteProperty(e,t,i){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(r=>this.processChild(r,t,i))}};var dt=G(Q());var qc=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>qc(t.node,e)),...n.nodes.flatMap(t=>qc(t,e))],pd=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>pd(t.node,e)),...n.nodes.flatMap(t=>pd(t,e))];function iP(n,e){if(!n||!(n.item instanceof Xe)||!(n.ast instanceof he))return[];let t=i=>pd(i,e);return Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Method}))}function rP(n,e){if(!n||n.item!==null||!(n.ast instanceof he)||!(n.ast.parentNode instanceof rt))return[];let t=i=>qc(i,e).filter(r=>e(r));return[...Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:i,insertText:`${i} {
|
|
228
|
+
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let i=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,i===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let i=this._tokens.at(-1);return t&&!i?.tokens.some(r=>r===21)&&i&&i.pos.len<e.length?this.process(e.slice(i.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},i=this._tokens.at(-1);t.prevToken=i,i&&(i.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let i=this.lineNumber,r=this.columnNumber,s=this.getString(t[0]);return this.pushToken({tokens:[21],value:s,pos:{col:r-1,line:i,len:s.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var KT,fd=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(i=>({...i}));return t.forEach((i,r)=>{i.prevToken=t[r-1],i.nextToken=t[r+1]}),t}renewLexer(e,t){if(!e||!(0,Tc.existsSync)(e))return[];t??=(0,Tc.readFileSync)(e).toString();let i=new bc(t,e);return this.fileMap.set(e,i),n.clone(i.tokens)}requestTokens(e,t){let i=this.fileMap.get(e)?.tokens;return!i&&t?[...this.renewLexer(e)]:n.clone(i??[])}};function di(){return KT??=new fd,KT}var vc=class n{constructor(e){this.bindingLoader=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new ye(this.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(i=>n.getFileTopMostAst(i,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let r=this.fileTopMostAst(e).find(s=>bn(s,e,t)||iT(di().requestTokens(e,!1),s,t));if(r instanceof rt){let o=this.rootNode.getReferenceBy(r)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Tn(r,e,t)}}else if(r instanceof qt&&r.path){let s=this.rootNode.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r instanceof he&&r.path){let s=n.getNodeFromPath(r.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r)return{runtime:this,item:null,ast:Tn(r,e,t)}}static getNodeFromPath(e,t){if(e.length===0)return t;let i=e[0].split("@"),r=i[0],s=i.at(1),o=s?Number.parseInt(s,16):void 0,a=e.slice(1),c=t.getNode(r,o);return c?n.getNodeFromPath(a,c):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let i=this.labelsUsedCache.get(e[0].slice(1));return i||(t??=this.rootNode.allDescendantsLabels,t.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof De)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(i=>{t.has(i.label.label.value)?t.get(i.label.label.value)?.push(i):t.set(i.label.label.value,[i])}),Array.from(t).forEach(i=>{let r=i[1];if(r.length>1){let s=r.find(a=>a.owner instanceof ye);if(!r.every(a=>a&&a.owner===s?.owner)||!s){let a=r.filter(c=>!(c&&c.owner===s?.owner));e.push(A(4,r.at(0).label,zT.DiagnosticSeverity.Error,r.slice(1).map(c=>c.label),[],[r.at(0).label.label.value]))}}}),e}get typesIssues(){if(this.typeIssueCache)return this.typeIssueCache;let e=t=>[...t.nodeTypes.at(0)?.getIssue(this,t)??[],...t.nodes.flatMap(i=>e(i))];return this.typeIssueCache=e(this.rootNode),this.typeIssueCache}getOrderedNodeAst(e){return rT([...e.definitions,...e.referencedBy])}};var st=class extends ${constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var GT=G(Q()),Sc=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:GT.SymbolKind.String},this.values.forEach(i=>this.addChild(i))}};var XT=G(Q()),kc=class extends ${constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:XT.SymbolKind.Function}}};var wn=class extends ${constructor(t,i){super();this.value=t;this.labels=i;this.labels.forEach(r=>{this.addChild(r)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var dd=G(Q());var Ec=class extends vn{constructor(t,i,r){super(i);this.value=t;this.docSymbolsMeta={name:`param${r+1}`,kind:dd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},wc=class extends vn{constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:dd.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var QT=G(Q());var Ir=class extends vn{constructor(t,i){super(i);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:QT.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Nc=class extends ${constructor(t,i){super(i);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var hi=class{constructor(){this.positionStack=[];this.issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{if(this.currentToken?.pos.line!==e)return;let i=this.currentToken,r=i;for(;this.currentToken?.pos.line===e;)r=this.moveToNextToken;if(t){let s=new $(z(i,r));this.issues.push(A(22,s))}return r};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this.issues=[]}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this.issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this.issues.length&&this.issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(i=>{let r=this.currentToken,s=i(r),o=!1;return s!=="no"&&r&&(t.push(r),this.moveToNextToken,o=Bn(r,this.currentToken)),s==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],i,r=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&r);)t.push(this.currentToken),i=this.currentToken,this.moveToNextToken,r=Bn(i,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let i=[],r=(s,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;i.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(r)}),i.sort((s,o)=>s.line===o.line?s.char-o.char:s.line-o.line).forEach(s=>e.push(s.line,s.char,s.length,s.tokenType,s.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!e.length){this.popStack();return}let t=e.map(r=>r.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Ir(t,z(e[0],e.at(-1)));return this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,i;if(M(e,40)?(i="&",M(this.currentToken,40)&&(i="&&",t=this.moveToNextToken)):M(e,10)?(i="!",M(this.currentToken,0)&&(i="==",t=this.moveToNextToken)):M(e,8)?(i="|",M(this.currentToken,8)&&(i="||",t=this.moveToNextToken)):M(e,9)?i="^":M(e,4)?(i=">",M(this.currentToken,4)?(i="<<",t=this.moveToNextToken):M(this.currentToken,0)&&(i=">=",t=this.moveToNextToken)):M(e,5)?(i=">",M(this.currentToken,5)?(i=">>",t=this.moveToNextToken):M(this.currentToken,0)&&(i="<=",t=this.moveToNextToken)):M(e,15)?i="+":M(e,16)?i="-":M(e,17)?i="*":M(e,13)?i="/":M(e,18)?i="%":M(e,46)&&M(this.currentToken,46)&&(i="##",t=this.moveToNextToken),i){let r=new Nc(i,z(e,t));return this.mergeStack(),r}this.popStack()}parseScopedBlock(e,t,i){this.enqueueToStack();let r=this.moveToNextToken;if(!r||!e(r)){this.popStack();return}let s=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(i?.(l)&&(o[o.length]=[]),l&&(s.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,i);u&&(s.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:r,items:s,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var hd=require("fs"),Lr=require("path");var Pc=class n extends hi{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let i=0;i<this.tokens.length;i++){let r=n.processBlockComments(this.tokens,i)||n.processLineComments(this.tokens,i);r&&(i=r.index,t.push(...r.tokenUsed),this.comments.push(...r.comments))}t.reverse().forEach(i=>this.tokens.splice(i,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=di().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,i){let r=[],s=()=>(r.push(i++),t[i]),o=()=>t[i],a=()=>t[i-1],c=o(),l=c;if(!c||!M(c,13)||(l=s(),!M(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!M(a(),17)||!M(o(),13)||!Bn(a(),o())),d=l.pos.line,p=c,g=[];l=s();do{if(o()?.pos.line!==d){let b=new kn(z(p,a()));g.push(b),d=o().pos.line??0,p=o()}l=s()}while(i<t.length&&!u());let _=new kn(z(p,o()));return g.push(_),s(),{comments:g,tokenUsed:r,index:i-1}}static processLineComments(t,i){let r=[];if(!M(t[i],13)||t.length===i+1||!M(t[i+1],13)||!Bn(t[i],t[i+1]))return;let s=[];for(;t[i].pos.line===t.at(i+1)?.pos.line;)r.push(i++);r.push(i++);let o=t[r.at(-1)],a=new kn(z(t[r[0]],t[r.at(-1)]));return s.push(a),{comments:s,tokenUsed:r,index:i-1}}};var Dc=class extends ${constructor(t,i){super(t);this.content=i}toString(){let t=this.content.filter(i=>!M(i,14));return t.map((i,r)=>{let s=i.value;return i.pos.line===t.at(r+1)?.pos.line?s=s.padEnd(t[r+1].pos.col-i.pos.col," "):t.at(r+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Rc=class extends ${constructor(t,i,r){super();this.keyword=t;this.identifier=i;this.content=r;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ir?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var JT=G(Q());var Cc=class extends st{toString(){return"..."}},Oc=class extends ${constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:JT.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Ds=class extends ${constructor(e){super(e)}},Ac=class extends ${constructor(t,i){super();this.keyword=t;this.content=i;this.addChild(t)}},Rs=class extends Ac{constructor(t,i,r){super(t,r);this.identifier=i;this.addChild(i),this.addChild(r)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Ic=class extends Rs{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Lc=class extends Ac{};var xc=class extends ${constructor(t,i,r){super();this.ifDef=t;this.endIf=i;this.elseOption=r;this.addChild(t),r&&this.addChild(r),this.addChild(i)}getInValidTokenRange(t,i){let r=[],s=a=>i.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];r.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&r.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(r.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&r.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&r.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),r}};var Mc=class n extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.macros=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(r).forEach(([s,o])=>this.macroSnapShot.set(s,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,i])=>this.macros.set(t,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(i=>{t.then(()=>{this.reset(),this.parse().then(i)})}),this.parsing}async parse(){let t=new Pc(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),this.prevToken&&this.prevToken.pos.line===this.currentToken?.pos.line){this.moveEndOfLine(this.prevToken.pos.line,!1),this.mergeStack();return}let t=this.currentToken?.pos.line,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();t!==void 0&&this.moveEndOfLine(t,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken;if(!i||!M(i,25))return this.popStack(),!1;let r=new st(z(i)),s=this.isFunctionDefinition()||this.processCIdentifier();if(!s)return this.issues.push(A(30,r)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Dc(z(o[0],o.at(-1)),o));let c=new Rc(r,s,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],i=this.prevToken;for(;Fn(i,this.currentToken)||i&&M(i,14)&&i.pos.line+1===this.currentToken?.pos.line;)i=this.moveToNextToken,i&&t.push(i);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.moveToNextToken;if(!M(i,42)){this.popStack();return}let r=[],s=this.processCIdentifier()||this.processVariadic();for(;s;)r.push(s),!M(this.currentToken,24)&&!M(this.currentToken,43)?this.issues.push(A(28,s)):M(this.currentToken,43)||(i=this.moveToNextToken),s=this.processCIdentifier()||this.processVariadic();let o=new Oc(t,r);return M(this.currentToken,43)?(i=this.moveToNextToken,o.lastToken=i):(o.lastToken=this.prevToken,this.issues.push(A(26,r.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(45),we(45),we(45)]);if(t.length!==3){this.popStack();return}let i=new Cc(z(t[0],t.at(-1)));return this.mergeStack(),i}processIfDefBlocks(){let t=this.peekIndex(),i=this.parseScopedBlock(r=>{let s=this.getTokenIndex(r)-1;return!!r&&[33,34].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[37].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[36].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)});if(i&&(M(i.startToken,33)||M(i.startToken,34))){let r;M(i.startToken,33)?r=this.processIfDefBlock(i,(o,a,c)=>new Rs(o,a??null,c)):r=this.processIfDefBlock(i,(o,a,c)=>new Ic(o,a??null,c)),this.nodes.push(r),r.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,i){this.enqueueToStack();let r=new st(z(t.startToken)),s=new st(z(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this.issues.push(A(31,r));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new Ds(z(this.currentToken,this.tokens[a])),l=i(r,o??null,c),u;if(t.splitTokens.length>1){let p=this.getTokenIndex(t.splitTokens[1][0]),g=new st(z(this.tokens[p])),_=new Ds(z(this.tokens[p+1],t.splitTokens[1].at(-1)));u=new Lc(g,_)}let d=new xc(l,s,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,Lr.resolve)((0,Lr.dirname)(t.uri),t.path.path),...this.incudes.map(i=>(0,Lr.resolve)(i,t.path.path))].find(i=>(0,hd.existsSync)(i)):this.incudes.map(i=>(0,Lr.resolve)(i,t.path.path)).find(i=>(0,hd.existsSync)(i))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken,r=i;if(!r||!M(r,26))return this.popStack(),!1;let s=i?.pos.line,o=new st(z(r));r=this.moveToNextToken;let a=r,c=!!M(r,21);if(!a||!c&&!M(r,5))return s&&this.moveEndOfLine(s),this.mergeStack(),!0;let l="";if(c)l=r?.value??"";else for(;this.currentToken?.pos.line===s&&!M(this.currentToken,4);)l+=this.currentToken?.value??"",r=this.moveToNextToken;let u=new dc(l,c,z(a,r)),d=new ai(o,u);this.dtsIncludes.push(d),c||(this.currentToken?.pos.line!==s||!M(this.currentToken,4)?this.issues.push(A(12,d)):(r=this.moveToNextToken,u.lastToken=r)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(d);if(d.reolvedPath=g,g&&!g.endsWith(".h")){di().requestTokens(g,!0);let _=new n(g,this.incudes,this.macros);await _.stable,this.tokens.splice(t,p-t,..._.tokens),this.nodes.push(..._.nodes),this.dtsIncludes.push(..._.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var Cs=class extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.tokens=[];this.others=[];this.rootDocument=new De;this.issues=[];this.unhandledStatements=new qt;this.cPreprocessorParser=new Mc(this.uri,this.incudes,r)}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new De,this.issues=[],this.unhandledStatements=new qt}async reparse(){let t=performance.now(),i=this.stable;return this.parsing=new Promise(r=>{i.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),r()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let i=async()=>{if(!(this.isDtsDocumentVersion()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let r=this.moveToNextToken;if(r){let s=new $(z(r));this.issues.push(A(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await i();if(this.unhandledStatements.properties.forEach(r=>{this.issues.push(A(32,r))}),this.unhandledStatements.deleteProperties.forEach(r=>{this.issues.push(A(33,r))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let i=this.moveToNextToken,r=i,s=13;if(!i||!M(i,s))return this.popStack(),!1;if(r=this.moveToNextToken,s=2,!r||!M(r,s))return this.popStack(),!1;let o=new qt;o.openScope=r,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??r;return o.firstToken=i,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let i=this.currentToken;if(M(i,3))this.moveToNextToken;else{let r=this.prevToken;if(r){let s=new $(z(r));this.issues.push(A(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return M(this.currentToken,3)||M(this.currentToken,1)}endStatement(t=!0){let i=this.currentToken;if(!M(i,1)){let r=this.prevToken;if(r&&t){let s=new $(z(this.prevToken));return this.issues.push(A(1,s)),r}}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;M(this.currentToken,1);){let t=this.moveToNextToken;if(t){let i=new $(z(t));this.issues.push(A(23,i))}}}processNode(t,i){if(this.done)return!1;let r=!1,s=!1;do{if(s=this.isChildNode(t,i)||this.isProperty(t)||this.isDeleteNode(t,i)||this.isDeleteProperty(t),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new $(z(o));this.issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;r=r||s}while(!this.isNodeEnd());return r}processOptionalLabelAssign(t=!1){let i=[],r=this.isLabelAssign(t);for(;r;)i.push(r),r=this.isLabelAssign(t);return i}isChildNode(t,i){this.enqueueToStack();let r;i==="Name"&&(r=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=i==="Ref"?new rt(s):new he(s,r);if(i==="Ref"?a=this.isLabelRef():i==="Name"&&(o=this.isNodeName()),!a&&!o){if(!M(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this.issues.push(A(i==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof rt?(c.labelReference=a,l=!0):o&&c instanceof he&&(l=o.address!==void 0,c.name=o),M(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this.issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(we));if(!t.length){this.popStack();return}let i=t.map(o=>o.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=this.checkConcurrentTokens([we(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(we)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new Te(i,z(t[0],o.at(-1)??t.at(-1)),a);if(!Bn(t.at(-1),r[0])){let l=new $(z(t.at(-1),r[0]));this.issues.push(A(29,l))}if(Number.isNaN(a)&&this.issues.push(A(8,c)),!Number.isNaN(a)&&!Bn(r.at(-1),o[0])){let l=new $(z(r[0],o.at(0)));this.issues.push(A(29,l))}return this.mergeStack(),c}let s=new Te(i,z(t[0],t.at(-1)));return this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(we));if(!t.length){this.popStack();return}let i=new Pe(t.map(r=>r.value).join(""),z(t[0],t.at(-1)));return this.mergeStack(),i}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!t.length){this.popStack();return}let i=t.map(s=>s.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=new Ge(i,z(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!i.length){this.popStack();return}let r=i.map(c=>c.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&M(s,50),a=new fi(new Ge(r,z(i[0],i.at(-1))),z(i[0],o?s:i.at(-1)));if(o){let c=i.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.col+c.pos.len)&&this.issues.push(A(29,new $(z(c,s)))),this.moveToNextToken}else if(t)this.issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(),r=this.isPropertyName();if(!r)return this.popStack(),!1;if(M(this.currentToken,2)||M(this.currentToken,49))return this.popStack(),!1;let s=new Me(r,i),o;M(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this.issues.push(A(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,t.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("d"),Je("ts"),we(16),Je("v"),Je("1")]);if(!t.length)return this.popStack(),!1;let i=t[0],r=i;if(t.length===1&&!M(this.currentToken,2))return this.popStack(),!1;if(t.length!==6)return this.popStack(),!1;let s=new st;s.firstToken=i;let o=new kc(s);if(this.others.push(o),M(this.currentToken,13))r=this.moveToNextToken;else return s.lastToken=t.at(-1),this.issues.push(A(21,o)),this.mergeStack(),!0;return s.lastToken=r,o.lastToken=this.endStatement(),this.mergeStack(),!0}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("omit"),we(16),Je("if"),we(16),Je("no"),we(16),Je("ref"),we(13)]);if(t.length!==9){this.popStack();return}let i=new st(z(t[0],t.at(-1)));return this.mergeStack(),i}isDeleteNode(t,i){this.enqueueToStack();let r=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("node")]);if(!r.length)return this.popStack(),!1;let s=r[0],o=s,a=new st;if(a.firstToken=s,r.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,a)),a.lastToken=r.at(-1);let d=new Kt(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=r.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=r.at(-1),c!=="/delete-node"?this.issues.push(A(c.startsWith("/delete-n")?34:25,a)):M(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this.issues.push(A(21,a));let l=new Kt(a);if(Fn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&i==="Name"&&this.issues.push(A(7,d));let p=d?void 0:this.isLabelRef();p&&i==="Name"&&this.issues.push(A(7,p));let g=d||p?void 0:this.isNodeName();g&&i==="Ref"&&this.issues.push(A(10,g)),!d&&!g&&!p&&this.issues.push(A([7,10],l)),l.nodeNameOrRef=d??p??g??null}else i==="Name"?this.issues.push(A(7,a)):i==="Ref"&&this.issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let i=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("property")]);if(!i.length)return this.popStack(),!1;let r=i[0],s=r,o=new st;if(o.firstToken=r,i.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,o)),o.lastToken=i.at(-1);let u=new Ae(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=i.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=i.at(-1),a!=="/delete-property"?this.issues.push(A(a.startsWith("/delete-p")?35:25,o)):M(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this.issues.push(A(21,o));let c=new Ae(o);if(Fn(o.tokenIndexes?.end,r)){let u=this.isPropertyName();u||this.issues.push(A(6,c)),c.propertyName=u??null}else this.issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.processNodePathRef();if(!i){this.popStack();return}let r=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&r.push(...this.processOptionalLabelAssign(!0));let s=new on(t,i,r);return this.mergeStack(),s}processValue(t){this.enqueueToStack();let r=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!M(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=M(this.currentToken,24);d&&this.moveToNextToken;let p=o();if(u&&p===null&&d){let g=new $(z(u,this.currentToken));this.issues.push(A(0,g))}if(!d&&p===null)break;if(l&&!d&&p){let g=new $(z(l));this.issues.push(A(28,g))}c.push(p)}return c})();if(r.length===0){this.popStack();return}return this.mergeStack(),new Sc(r)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken;if(!M(i,21)){this.popStack();return}if(!i?.value)throw new Error("Token must have value");let r=i.value;r.match(/["']$/)&&(r=r.slice(1,-1));let s=new Tt(r,z(i));i.value.match(/["']$/)||this.issues.push(A(i.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new on(t,s,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.currentToken;if(M(r,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues(t)??null;s.openBracket=r;let o=this.processOptionalLabelAssign(!0)??[],a=new on(i,s,o);M(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this.issues.push(A(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=r,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken,r=i;if(!M(r,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this.issues.push(A(15,u))});let a=new oi(s??[]);a.openBracket=r,a.values.length===0&&(a.firstToken=i,this.issues.push(A(14,a)));let c=new on(t,a,o);M(this.currentToken,12)?a.openBracket=this.moveToNextToken:this.issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let i=t(),r=[];if(!i)return this.popStack(),[];for(;i;)r=[...r,i],i=t();if(r){let s=t();s&&(r=[...r,s])}return this.mergeStack(),r}processArrayValues(t){this.enqueueToStack();let i=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new Ke(i);return i.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processHex();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Je("0"),Je("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(o=>o.value).join(""),16),s=new vt(r,z(t[0],i.at(-1)));return this.mergeStack(),s}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.checkConcurrentTokens([20,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(a=>a.value).join(""),16),s=new vt(r,z(i[0],i.at(-1))),o=new wn(s,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processDec();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(we));if(!t.length){this.popStack();return}let i=Number.parseInt(t.map(s=>s.value).join(""),10),r=new vt(i,z(t[0],t.at(-1)));return this.mergeStack(),r}processLabeledExpression(t=!0,i=t){this.enqueueToStack();let r=[];t&&(r=this.processOptionalLabelAssign(i));let s=this.processExpression();if(!s){this.popStack();return}let o=new wn(s,r);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.processMacroCallParams();if(!i){this.popStack();return}let r=new wc(t,i);return this.mergeStack(),r}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.processExpression();if(!i){this.popStack();return}let r=this.processOptionalLabelAssign(!0),s=new on(t,i,r);return this.mergeStack(),s}processExpression(){this.enqueueToStack();let t=!1,i,r;M(this.currentToken,42)&&(t=!0,i=this.moveToNextToken,r=i);let s=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!s){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?s instanceof _s?s.addExpression(o,a):s=new _s(s,{operator:o,expression:a}):this.issues.push(A(27,o)),o=this.isOperator()}M(this.currentToken,43)?r=this.moveToNextToken:this.issues.push(A(26,o??s))}return this.mergeStack(),s}processMacroCallParams(){return M(this.currentToken,42)?this.parseScopedBlock(r=>!!M(r,42),r=>!!M(r,43),r=>!!M(r,24))?.splitTokens.map((r,s)=>{if(r.length===0||M(r[0],24)&&r.length===1)return null;let o=s?r.slice(1):r;return new Ec(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),z(o[0],o.at(-1)),s)}):void 0}isLabelRef(t){this.enqueueToStack();let i=this.currentToken;if(M(i,40))this.moveToNextToken;else{this.popStack();return}let r=this.isLabelName();if(!r){let o=new pe(null);return this.issues.push(A(18,t??o)),o.firstToken=i,this.mergeStack(),o}i&&(r.firstToken.pos.line!==i.pos.line||r.firstToken.pos.col!==i.pos.col+i.pos.len)&&this.issues.push(A(29,new $(z(i,r.firstToken))));let s=new pe(r);return s.firstToken=i,this.mergeStack(),s}isLabelRefValue(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.isLabelRef(t);if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new on(i,r,s);return this.mergeStack(),o}processRefValue(t,i){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.currentToken;if(!M(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new wn(o,r);return this.mergeStack(),l}let a=this.isLabelRef(i);if(a===void 0){this.issues.push(A([18,9],i));let l=new wn(null,r);return l.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),l}let c=new wn(a,r);return c.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(t=!0,i=new jn){this.enqueueToStack();let r;if(M(this.currentToken,13))r=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this.issues.push(A(19,new $(z(this.prevToken))))}let s=this.isNodeName();return s||this.issues.push(A(7,new $(z(r??this.prevToken)))),i.addPath(s??null,r?new $(z(r)):void 0),this.processNodePath(!1,i),this.mergeStack(),i}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,i=t;if(!M(i,40)){this.popStack();return}let r=this.moveToNextToken;if(i=r,!M(i,2)){this.popStack();return}let s=this.processNodePath(),o=new sn(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&l.lastToken.pos.col+l.lastToken.pos.len!==c.pos.col){this.issues.push(A(29,new $(z(l.lastToken,c))));return}if(u===0&&r&&r.pos.col+r.pos.len!==l?.firstToken.pos.col){this.issues.push(A(29,new $(z(r,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&l.lastToken.pos.col+l.lastToken.pos.len!==d?.firstToken.pos.col&&this.issues.push(A(29,new $(z(l.lastToken,d?.firstToken))))}),M(a,3)?this.moveToNextToken:this.prevToken&&this.issues.push(A(3,new $(z(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof ai)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var xr=G(Q());var ZT=require("fs"),ev=require("path");var Mr=class{constructor(e,t,i,r=[],s){this.bindingLoader=i;this._issues=[];this.overlays=[];this.overlays=Array.isArray(r)?r:[r],this.overlays.filter(ZT.existsSync),this.parser=new Cs(e,t),this.name=s??(0,ev.basename)(e),this.overlayParsers=this.overlays?.map(o=>new Cs(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(r=>r.ast.uri===e).flatMap(r=>r.ast.values?.values.flatMap(s=>{let a=r.parent?.nodeTypes.find(c=>s?.value instanceof Tt&&c.compatible===s.value.value);return a?{range:ne(s.value),target:`file://${a.bindingsPath}`}:void 0})).filter(r=>r)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(r=>r.uri===e).map(r=>{let s=this.parser.cPreprocessorParser.resolveInclude(r);if(s)return{range:ne(r.path),target:`file://${s}`}}).filter(r=>r)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let t=s=>[...s.properties,...s.nodes.flatMap(t)],i=t(e.rootNode),r=e.rootNode.allDescendantsLabels;i.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof pe){let a=e.resolvePath([`&${o.label?.value}`],r);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,xr.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof jn){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let p=a?.getNode(d.name,d.address,!1);d.linksTo=p,!u&&!p&&(u=!0,this._issues.push(A(8,d,xr.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(g=>g?.linksTo).map(g=>g?.toString()).join("/")}`]))),p?.linkedNodeNamePaths.push(d),a=p}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new vc(this.bindingLoader);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let i=0;i<this.overlayParsers.length;i++)this.processRoot(this.overlayParsers[i].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(i=>i instanceof kn),(await this.getAllParsers()).flatMap(i=>i.tokens).forEach((i,r)=>i.sortKey=r),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let i=0;i<e.children.length;i++){let r=e.children[i];this.processChild(r,t.rootNode,t)}}processChild(e,t,i){e instanceof De?this.processDtcBaseNode(e,t,i):e instanceof Me?this.processDtcProperty(e,t,i):e instanceof Kt?this.processDeleteNode(e,t,i):e instanceof Ae&&this.processDeleteProperty(e,t,i)}checkNodeUniqueNames(e,t){let i=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address===a.address)),r=t.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof he&&o.name)i(s,o.name)&&this._issues.push(A(2,o.name)),s.push(o.name);else if(o instanceof Kt&&o.nodeNameOrRef instanceof Te){let a=o.nodeNameOrRef;i(r,a)&&(s=s.filter(c=>i(s,c)))}})}processDtcBaseNode(e,t,i){e instanceof qt?this.processDtcRootNode(e,i):e instanceof he?this.processDtcChildNode(e,t,i):e instanceof rt&&this.processDtcRefNode(e,i)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((i,r)=>i instanceof Me&&r instanceof Ae||r instanceof Me&&i instanceof Ae?0:r instanceof Me?1:0).forEach(i=>this.processChild(i,t.rootNode,t))}processDtcChildNode(e,t,i){if(e.name?.name){let r=e.path?i.resolvePath(e.path):void 0,o=(r?i.rootNode.getChild(r):void 0)??new ye(this.bindingLoader,e.name.name,e.name.address,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,t,i))}processDtcRefNode(e,t){let i;if(e.labelReference){let r=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);r?(e.resolveNodePath??=[...r],i=t.rootNode.getChild(r),e.labelReference.linksTo=i,e.labels.forEach(s=>s.lastLinkedTo=i),i?.linkedRefLabels.push(e.labelReference),i?.referencedBy.push(e),e.labels.forEach(s=>{t.labelsUsedCache.set(s.label.value,r)}),i?(t.references.push(e),this.checkNodeUniqueNames(e,i)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,xr.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,i??new ye(this.bindingLoader,""),t))}processDtcProperty(e,t,i){e.propertyName?.name&&t.addProperty(new Xe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof Te&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let r=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address);e.nodeNameOrRef.linksTo=r,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address),r?.labels.forEach(s=>{i.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof pe&&e.nodeNameOrRef.value){let r=i.resolvePath([`&${e.nodeNameOrRef.value}`]),s;r?(s=i.rootNode.getChild(r),t.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{i.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)):(i.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,xr.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof sn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(r=>!r)){let r=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=i.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let p=s?.getNode(d.name,d.address,!1);d.linksTo=p,p?.linkedNodeNamePaths.push(d),s=p}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(i.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,xr.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{i.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)}else i.unlinkedDeletes.push(e);e.children.forEach(r=>this.processChild(r,t,i))}processDeleteProperty(e,t,i){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(r=>this.processChild(r,t,i))}};var dt=G(Q());var qc=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>qc(t.node,e)),...n.nodes.flatMap(t=>qc(t,e))],pd=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>pd(t.node,e)),...n.nodes.flatMap(t=>pd(t,e))];function rP(n,e){if(!n||!(n.item instanceof Xe)||!(n.ast instanceof pe))return[];let t=i=>pd(i,e);return Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Method}))}function sP(n,e){if(!n||n.item!==null||!(n.ast instanceof pe)||!(n.ast.parentNode instanceof rt))return[];let t=i=>qc(i,e).filter(r=>e(r));return[...Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:i,insertText:`${i} {
|
|
229
229
|
$1
|
|
230
|
-
};`,kind:dt.CompletionItemKind.Value,insertTextFormat:dt.InsertTextFormat.Snippet}))]}function sP(n,e){let t=r=>r?r.parentNode instanceof rt||r.parentNode instanceof qt||r.parentNode instanceof de?!1:t(r.parentNode):!0;if(!n||n.item!==null||!Ze(n.ast)||!t(n.ast))return[];let i=r=>qc(r,e).filter(s=>e(s));return n.ast instanceof st?i(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(i(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:dt.CompletionItemKind.Variable}))}function oP(n,e){if(!n||!(n.item instanceof ge)||n.item===null)return[];let t=i=>[...i.nodes,...i.deletedNodes.filter(r=>!e(r.by)).map(r=>r.node)].flatMap(r=>r.definitions.filter(s=>s instanceof de)).filter(r=>e(r));return n.ast instanceof Te||n.ast instanceof Kt?Array.from(new Set(t(n.item).map(i=>i.name?.toString()))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function aP(n,e){if(!n||!(n.item instanceof ge))return[];let t=i=>[...i.properties,...i.deletedProperties.filter(r=>!e(r.by)).map(r=>r.property)].flatMap(r=>[r,...r.allReplaced]).filter(r=>e(r.ast));return n.ast instanceof _e||n.ast instanceof Ae?Array.from(new Set(t(n.item).map(i=>i.name))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:dt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:dt.InsertTextFormat.Snippet}]:[]}function cP(n,e){let t=n?.ast instanceof jn?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof jn))return[];let i=t.pathParts.slice(0,-1);if(i.some(o=>!o))return[];let r=i.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...r],e);return[...o?.nodes.filter(a=>!Ze(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...r,o].join("/")}`,kind:dt.CompletionItemKind.Variable}))}async function tv(n,e,t){return ft(n,e,(i,r)=>[...aP(i,r),...oP(i,r),...sP(i,r),...cP(i,r),...rP(i,r),...iP(i,r)],t)}var Ui=G(Q());function lP(n){if(!n||n.item===null||!(n.ast instanceof _e))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if(r instanceof Me)return Ui.Location.create(`file://${r.uri}`,ne(r.propertyName??r));if(r instanceof Ae)return Ui.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof _e)return t(e(n.item));if(n.item instanceof ge&&n.ast instanceof _e&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function uP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof de)return Ui.Location.create(`file://${i.uri}`,ne(i.name??i));if(i instanceof Te)return Ui.Location.create(`file://${i.uri}`,ne(i));if(i instanceof he)return Ui.Location.create(`file://${i.uri}`,ne(i.label??i))}).filter(i=>i);return n.item instanceof ge&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof he&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),Ui.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function nv(n,e,t){return ft(n,e,i=>[...uP(i),...lP(i)],t)}var pi=G(Q());function iv(n){if(!n||n.item===null||!(n.ast instanceof _e))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if((r instanceof Me||r instanceof Ae)&&r.propertyName)return pi.Location.create(`file://${r.uri}`,ne(r.propertyName))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof _e)return t(e(n.item));if(n.item instanceof ge&&n.ast instanceof _e&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function rv(n,e){if(!e||!(e.ast instanceof Ge))return[];"newName"in n&&(e.ast.parentNode instanceof he&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof fi&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,i=r=>[...r.definitions.filter(s=>s instanceof de).flatMap(s=>s.labels.map(o=>o.label)),...r.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===t).map(s=>{if(s)return pi.Location.create(`file://${s.uri}`,ne(s))}).filter(s=>s);return e.item instanceof ge&&!Ze(e.ast)?i(e.item):e.ast instanceof Ge&&e.ast.parentNode instanceof he&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function sv(n){if(!n||!(n.ast instanceof Te))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof de&&i.name)return pi.Location.create(`file://${i.uri}`,ne(i.name));if(i instanceof Te)return pi.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ge&&!Ze(n.ast)?e(n.item):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),pi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function ov(n,e,t){let i={};return(await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],t)).forEach(s=>{i[s.uri]??=[],i[s.uri].push(pi.TextEdit.replace(s.range,n.newName))}),{changes:i}}async function av(n,e,t,i){let r=await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],i);if(r.some(s=>t.some(o=>s.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var Fc=G(Q());function fP(n){if(!n||n.item===null||!(n.ast instanceof _e))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast)].map(r=>{if(r instanceof Me)return Fc.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof _e)return t(e(n.item));if(n.item instanceof ge&&n.ast instanceof _e&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function dP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.definitions,...t.referencedBy].map(i=>{if(i instanceof de)return Fc.Location.create(`file://${i.uri}`,ne(i));if(i instanceof rt)return Fc.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ge&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof he&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function cv(n,e,t){return ft(n,e,i=>[...dP(i),...fP(i)],t)}var md=G(Q());function hP(n){if(!n||n.item===null||!(n.ast instanceof _e))return;let e=i=>i.replaces?e(i.replaces):i,t=i=>md.Location.create(`file://${i.ast.uri}`,ne(i.ast.propertyName??i.ast));if(n.item instanceof Xe&&n.ast instanceof _e)return t(e(n.item));if(n.item instanceof ge&&n.ast instanceof _e&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(e(i))}}function pP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return;let e=t=>{let i=t.definitions.at(0);return i?md.Location.create(`file://${i.uri}`,ne(i)):void 0};if(n.item instanceof ge&&!Ze(n.ast))return e(n.item);if(n.ast instanceof Ge&&n.ast.parentNode instanceof he&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Te&&n.ast.linksTo)return e(n.ast.linksTo)}async function lv(n,e,t){return(await ft(n,e,i=>[pP(i)||hP(i)],t)).at(0)}var J=G(Q());var mP=(n,e,t,i,r)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(J.Range.create(J.Position.create(i.range.start.line,n.pos.col+n.pos.len),J.Position.create(i.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.del(i.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),">")]}}}];default:return}},gP=(n,e,t,i,r,s)=>{if(!s)return[];switch(t){case 0:return[{title:`Add Property "${s.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[s]}}}];default:return}};function uv(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>mP(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>gP(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit))}}).filter(a=>!!a),t=e.filter(a=>a.kind===J.CodeActionKind.SourceFixAll),i=e.filter(a=>a.title.startsWith("Add Property")),r=e.filter(a=>a.kind!==J.CodeActionKind.SourceFixAll),s=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return i.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...r,...t.map(a=>({...a,kind:J.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var fv=G(Q());function yP(n){return!n||!(n.item instanceof Xe)||!(n.ast instanceof Me&&(n.ast.values||n.ast.values===null))?[]:n.item.parent.nodeType?.properties.find(e=>e.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]}function bP(n){if(!n||!(n.item instanceof Xe&&n.ast instanceof _e&&n.item.ast.values===null||n.item instanceof ge)||Ze(n.ast))return[];let e=t=>t.nodeType?.properties.filter(i=>!i.hideAutoComplete&&i.required(t)!=="omitted"&&typeof i.name=="string").map(i=>{let r=t&&i.required(t),s=!!t.properties.some(a=>i.getNameMatch(a.name)),o="a";return r?o=s?"Y":"A":o=s?"Z":"B",{label:`${i.name}`,kind:fv.CompletionItemKind.Property,sortText:`${o}${i.name}`}})??[];return n.item instanceof Xe?e(n.item.parent):e(n.item)}async function dv(n,e,t){return ft(n,e,i=>[...yP(i),...bP(i)],t)}function TP(n){if(n?.item instanceof ge)return{contents:n.item.toMarkupContent(),range:ne(n.ast)};if(n?.ast instanceof Te){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}if(n?.ast.parentNode instanceof he){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}}function vP(n){if(n?.item instanceof Xe&&n.ast instanceof _e){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:ne(n.ast)}}}function hv(n,e,t){return ft(n,e,i=>[TP(i)||vP(i)],t)}var rw=G(tE());var kE=G(pE(),1);var ao=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var JO={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},co=n=>n.replace(/[[\]\\-]/g,"\\$&"),ZO=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mE=n=>n.join(""),gE=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;s<n.length;){let b=n.charAt(s);if((b==="!"||b==="^")&&s===t+1){l=!0,s++;continue}if(b==="]"&&o&&!c){u=s+1;break}if(o=!0,b==="\\"&&!c){c=!0,s++;continue}if(b==="["&&!c){for(let[w,[R,v,T]]of Object.entries(JO))if(n.startsWith(w,s)){if(d)return["$.",!1,n.length-t,!0];s+=w.length,T?r.push(R):i.push(R),a=a||v;continue e}}if(c=!1,d){b>d?i.push(co(d)+"-"+co(b)):b===d&&i.push(co(b)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(co(b+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=b,s+=2;continue}i.push(co(b)),s++}if(u<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,n.length-t,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let b=i[0].length===2?i[0].slice(-1):i[0];return[ZO(b),!1,u-t,!1]}let p="["+(l?"^":"")+mE(i)+"]",g="["+(l?"":"^")+mE(r)+"]";return[i.length&&r.length?"("+p+"|"+g+")":i.length?p:g,a,u-t,!0]};var un=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var e0=new Set(["!","?","+","*","@"]),yE=n=>e0.has(n),t0="(?!(?:^|/)\\.\\.?(?:$|/))",Ml="(?!\\.)",n0=new Set(["[","."]),i0=new Set(["..","."]),r0=new Set("().*{}+?[]^$\\!"),s0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Jh="[^/]",bE=Jh+"*?",TE=Jh+"+?",Yr=class n{type;#e;#t;#s=!1;#i=[];#o;#v;#l;#f=!1;#a;#c;#r=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,i=t.#o;for(;i;){for(let r=t.#v+1;!i.type&&r<i.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[r])}t=i,i=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let t=0;t<this.#v;t++){let i=e.#i[t];if(!(i instanceof n&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#y(e,t,i,r){let s=!1,o=!1,a=-1,c=!1;if(t.type===null){let g=i,_="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,_+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(c=!0):b==="]"&&!(g===a+2&&c)&&(o=!1),_+=b;continue}else if(b==="["){o=!0,a=g,c=!1,_+=b;continue}if(!r.noext&&yE(b)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(b,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=b}return t.push(_),g}let l=i+1,u=new n(null,t),d=[],p="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,p+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(l===a+2&&c)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=l,c=!1,p+=g;continue}if(yE(g)&&e.charAt(l)==="("){u.push(p),p="";let _=new n(g,u);u.push(_),l=n.#y(e,_,l,r);continue}if(g==="|"){u.push(p),p="",d.push(u),u=new n(null,t);continue}if(g===")")return p===""&&t.#i.length===0&&(t.#r=!0),u.push(p),p="",t.push(...d,u),l;p+=g}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],l}static fromGlob(e,t={}){let i=new n(null,void 0,t);return n.#y(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,r,s]=this.toRegExpSource();if(!(r||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#i.map(g=>{let[_,b,w,R]=typeof g=="string"?n.#d(g,this.#t,c):g.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||R,_}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&i0.has(this.#i[0]))){let _=n0,b=t&&_.has(l.charAt(0))||l.startsWith("\\.")&&_.has(l.charAt(2))||l.startsWith("\\.\\.")&&_.has(l.charAt(4)),w=!t&&!e&&_.has(l.charAt(0));u=b?t0:w?Ml:""}let d="";return this.isEnd()&&this.#e.#f&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,un(l),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,un(this.toString()),!1,!1]}let o=!i||e||t||!Ml?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!t?Ml:"")+TE;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ml:"")+bE+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+c}return[a,un(s),this.#t=!!this.#t,this.#s]}#h(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,r,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#d(e,t,i=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(r){r=!1,s+=(r0.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(c==="["){let[l,u,d,p]=gE(e,a);if(d){s+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){i&&e==="*"?s+=TE:s+=bE,t=!0;continue}if(c==="?"){s+=Jh,t=!0;continue}s+=s0(c)}return[s,un(e),!!t,o]}};var Kr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var Nt=(n,e,t={})=>(ao(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Bt(e,t).match(n)),o0=/^\*+([^+@!?\*\[\(]*)$/,a0=n=>e=>!e.startsWith(".")&&e.endsWith(n),c0=n=>e=>e.endsWith(n),l0=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),u0=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),f0=/^\*+\.\*+$/,d0=n=>!n.startsWith(".")&&n.includes("."),h0=n=>n!=="."&&n!==".."&&n.includes("."),p0=/^\.\*+$/,m0=n=>n!=="."&&n!==".."&&n.startsWith("."),g0=/^\*+$/,y0=n=>n.length!==0&&!n.startsWith("."),b0=n=>n.length!==0&&n!=="."&&n!=="..",T0=/^\?+([^+@!?\*\[\(]*)?$/,v0=([n,e=""])=>{let t=EE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},S0=([n,e=""])=>{let t=wE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},k0=([n,e=""])=>{let t=wE([n]);return e?i=>t(i)&&i.endsWith(e):t},E0=([n,e=""])=>{let t=EE([n]);return e?i=>t(i)&&i.endsWith(e):t},EE=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},wE=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},NE=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",vE={win32:{sep:"\\"},posix:{sep:"/"}},w0=NE==="win32"?vE.win32.sep:vE.posix.sep;Nt.sep=w0;var pt=Symbol("globstar **");Nt.GLOBSTAR=pt;var N0="[^/]",_0=N0+"*?",P0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",D0="(?:(?!(?:\\/|^)\\.).)*?",R0=(n,e={})=>t=>Nt(t,n,e);Nt.filter=R0;var Gt=(n,e={})=>Object.assign({},n,e),C0=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Nt;let e=Nt;return Object.assign((i,r,s={})=>e(i,r,Gt(n,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Gt(n,s))}static defaults(r){return e.defaults(Gt(n,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Gt(n,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Gt(n,s))}},unescape:(i,r={})=>e.unescape(i,Gt(n,r)),escape:(i,r={})=>e.escape(i,Gt(n,r)),filter:(i,r={})=>e.filter(i,Gt(n,r)),defaults:i=>e.defaults(Gt(n,i)),makeRe:(i,r={})=>e.makeRe(i,Gt(n,r)),braceExpand:(i,r={})=>e.braceExpand(i,Gt(n,r)),match:(i,r,s={})=>e.match(i,r,Gt(n,s)),sep:e.sep,GLOBSTAR:pt})};Nt.defaults=C0;var _E=(n,e={})=>(ao(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,kE.default)(n));Nt.braceExpand=_E;var O0=(n,e={})=>new Bt(n,e).makeRe();Nt.makeRe=O0;var A0=(n,e,t={})=>{let i=new Bt(e,t);return n=n.filter(r=>i.match(r)),i.options.nonull&&!n.length&&n.push(e),n};Nt.match=A0;var SE=/[?*]|[+@!]\(.*?\)|\[|\]/,I0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){ao(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||NE,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!SE.test(s[2]))&&!SE.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let r=0;r<e[i].length;r++)e[i][r]==="**"&&(e[i][r]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let r=i;for(;t[r+1]==="**";)r++;r!==i&&t.splice(i,r-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let r=e[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let o=r;for(;i[o+1]==="**";)o++;o>r&&i.splice(r+1,o-r);let a=i[r+1],c=i[r+2],l=i[r+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,i.splice(r,1);let u=i.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(t=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let o=i[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let r=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(r){e[t]=[],e[i]=r;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<t.length;)if(e[r]===t[s])o.push(a==="b"?t[s]:e[r]),r++,s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])o.push(e[r]),r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])o.push(t[s]),s++;else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),r++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let r=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),R=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!R&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:b?0:void 0,N=v?3:R?0:void 0;if(typeof T=="number"&&typeof N=="number"){let[L,q]=[e[T],t[N]];L.toLowerCase()===q.toLowerCase()&&(t[N]=L,N>T?t=t.slice(N):T>N&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===pt){this.debug("GLOBSTAR",[t,u,d]);var p=o,g=a+1;if(g===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var _=e[p];if(this.debug(`
|
|
230
|
+
};`,kind:dt.CompletionItemKind.Value,insertTextFormat:dt.InsertTextFormat.Snippet}))]}function oP(n,e){let t=r=>r?r.parentNode instanceof rt||r.parentNode instanceof qt||r.parentNode instanceof he?!1:t(r.parentNode):!0;if(!n||n.item!==null||!Ze(n.ast)||!t(n.ast))return[];let i=r=>qc(r,e).filter(s=>e(s));return n.ast instanceof st?i(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(i(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:dt.CompletionItemKind.Variable}))}function aP(n,e){if(!n||!(n.item instanceof ye)||n.item===null)return[];let t=i=>[...i.nodes,...i.deletedNodes.filter(r=>!e(r.by)).map(r=>r.node)].flatMap(r=>r.definitions.filter(s=>s instanceof he)).filter(r=>e(r));return n.ast instanceof Te||n.ast instanceof Kt?Array.from(new Set(t(n.item).map(i=>i.name?.toString()))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function cP(n,e){if(!n||!(n.item instanceof ye))return[];let t=i=>[...i.properties,...i.deletedProperties.filter(r=>!e(r.by)).map(r=>r.property)].flatMap(r=>[r,...r.allReplaced]).filter(r=>e(r.ast));return n.ast instanceof Pe||n.ast instanceof Ae?Array.from(new Set(t(n.item).map(i=>i.name))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:dt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:dt.InsertTextFormat.Snippet}]:[]}function lP(n,e){let t=n?.ast instanceof jn?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof jn))return[];let i=t.pathParts.slice(0,-1);if(i.some(o=>!o))return[];let r=i.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...r],e);return[...o?.nodes.filter(a=>!Ze(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...r,o].join("/")}`,kind:dt.CompletionItemKind.Variable}))}async function tv(n,e,t){return ft(n,e,(i,r)=>[...cP(i,r),...aP(i,r),...oP(i,r),...lP(i,r),...sP(i,r),...rP(i,r)],t)}var $i=G(Q());function uP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if(r instanceof Me)return $i.Location.create(`file://${r.uri}`,ne(r.propertyName??r));if(r instanceof Ae)return $i.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function fP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he)return $i.Location.create(`file://${i.uri}`,ne(i.name??i));if(i instanceof Te)return $i.Location.create(`file://${i.uri}`,ne(i));if(i instanceof pe)return $i.Location.create(`file://${i.uri}`,ne(i.label??i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),$i.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function nv(n,e,t){return ft(n,e,i=>[...fP(i),...uP(i)],t)}var pi=G(Q());function iv(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if((r instanceof Me||r instanceof Ae)&&r.propertyName)return pi.Location.create(`file://${r.uri}`,ne(r.propertyName))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function rv(n,e){if(!e||!(e.ast instanceof Ge))return[];"newName"in n&&(e.ast.parentNode instanceof pe&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof fi&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,i=r=>[...r.definitions.filter(s=>s instanceof he).flatMap(s=>s.labels.map(o=>o.label)),...r.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===t).map(s=>{if(s)return pi.Location.create(`file://${s.uri}`,ne(s))}).filter(s=>s);return e.item instanceof ye&&!Ze(e.ast)?i(e.item):e.ast instanceof Ge&&e.ast.parentNode instanceof pe&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function sv(n){if(!n||!(n.ast instanceof Te))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he&&i.name)return pi.Location.create(`file://${i.uri}`,ne(i.name));if(i instanceof Te)return pi.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),pi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function ov(n,e,t){let i={};return(await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],t)).forEach(s=>{i[s.uri]??=[],i[s.uri].push(pi.TextEdit.replace(s.range,n.newName))}),{changes:i}}async function av(n,e,t,i){let r=await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],i);if(r.some(s=>t.some(o=>s.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var Fc=G(Q());function dP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast)].map(r=>{if(r instanceof Me)return Fc.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function hP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.definitions,...t.referencedBy].map(i=>{if(i instanceof he)return Fc.Location.create(`file://${i.uri}`,ne(i));if(i instanceof rt)return Fc.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function cv(n,e,t){return ft(n,e,i=>[...hP(i),...dP(i)],t)}var md=G(Q());function pP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return;let e=i=>i.replaces?e(i.replaces):i,t=i=>md.Location.create(`file://${i.ast.uri}`,ne(i.ast.propertyName??i.ast));if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(e(i))}}function mP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return;let e=t=>{let i=t.definitions.at(0);return i?md.Location.create(`file://${i.uri}`,ne(i)):void 0};if(n.item instanceof ye&&!Ze(n.ast))return e(n.item);if(n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Te&&n.ast.linksTo)return e(n.ast.linksTo)}async function lv(n,e,t){return(await ft(n,e,i=>[mP(i)||pP(i)],t)).at(0)}var J=G(Q());var gP=(n,e,t,i,r)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(J.Range.create(J.Position.create(i.range.start.line,n.pos.col+n.pos.len),J.Position.create(i.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.del(i.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),">")]}}}];default:return}},yP=(n,e,t,i,r,s)=>{if(!s)return[];switch(t){case 0:return[{title:`Add Property "${s.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[s]}}}];default:return}};function uv(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>gP(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>yP(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit))}}).filter(a=>!!a),t=e.filter(a=>a.kind===J.CodeActionKind.SourceFixAll),i=e.filter(a=>a.title.startsWith("Add Property")),r=e.filter(a=>a.kind!==J.CodeActionKind.SourceFixAll),s=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return i.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...r,...t.map(a=>({...a,kind:J.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var fv=G(Q());function bP(n){return!n||!(n.item instanceof Xe)||!(n.ast instanceof Me&&(n.ast.values||n.ast.values===null))?[]:n.item.parent.nodeType?.properties.find(e=>e.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]}function TP(n){if(!n||!(n.item instanceof Xe&&n.ast instanceof Pe&&n.item.ast.values===null||n.item instanceof ye)||Ze(n.ast))return[];let e=t=>t.nodeType?.properties.filter(i=>!i.hideAutoComplete&&i.required(t)!=="omitted"&&typeof i.name=="string").map(i=>{let r=t&&i.required(t),s=!!t.properties.some(a=>i.getNameMatch(a.name)),o="a";return r?o=s?"Y":"A":o=s?"Z":"B",{label:`${i.name}`,kind:fv.CompletionItemKind.Property,sortText:`${o}${i.name}`}})??[];return n.item instanceof Xe?e(n.item.parent):e(n.item)}async function dv(n,e,t){return ft(n,e,i=>[...bP(i),...TP(i)],t)}function vP(n){if(n?.item instanceof ye)return{contents:n.item.toMarkupContent(),range:ne(n.ast)};if(n?.ast instanceof Te){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}if(n?.ast.parentNode instanceof pe){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}}function SP(n){if(n?.item instanceof Xe&&n.ast instanceof Pe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:ne(n.ast)}}}function hv(n,e,t){return ft(n,e,i=>[vP(i)||SP(i)],t)}var rw=G(tE());var kE=G(pE(),1);var co=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var ZO={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},lo=n=>n.replace(/[[\]\\-]/g,"\\$&"),e0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mE=n=>n.join(""),gE=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;s<n.length;){let b=n.charAt(s);if((b==="!"||b==="^")&&s===t+1){l=!0,s++;continue}if(b==="]"&&o&&!c){u=s+1;break}if(o=!0,b==="\\"&&!c){c=!0,s++;continue}if(b==="["&&!c){for(let[w,[R,v,T]]of Object.entries(ZO))if(n.startsWith(w,s)){if(d)return["$.",!1,n.length-t,!0];s+=w.length,T?r.push(R):i.push(R),a=a||v;continue e}}if(c=!1,d){b>d?i.push(lo(d)+"-"+lo(b)):b===d&&i.push(lo(b)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(lo(b+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=b,s+=2;continue}i.push(lo(b)),s++}if(u<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,n.length-t,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let b=i[0].length===2?i[0].slice(-1):i[0];return[e0(b),!1,u-t,!1]}let p="["+(l?"^":"")+mE(i)+"]",g="["+(l?"":"^")+mE(r)+"]";return[i.length&&r.length?"("+p+"|"+g+")":i.length?p:g,a,u-t,!0]};var un=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var t0=new Set(["!","?","+","*","@"]),yE=n=>t0.has(n),n0="(?!(?:^|/)\\.\\.?(?:$|/))",Ml="(?!\\.)",i0=new Set(["[","."]),r0=new Set(["..","."]),s0=new Set("().*{}+?[]^$\\!"),o0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Jh="[^/]",bE=Jh+"*?",TE=Jh+"+?",Kr=class n{type;#e;#t;#s=!1;#i=[];#o;#v;#l;#f=!1;#a;#c;#r=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,i=t.#o;for(;i;){for(let r=t.#v+1;!i.type&&r<i.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[r])}t=i,i=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let t=0;t<this.#v;t++){let i=e.#i[t];if(!(i instanceof n&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#y(e,t,i,r){let s=!1,o=!1,a=-1,c=!1;if(t.type===null){let g=i,_="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,_+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(c=!0):b==="]"&&!(g===a+2&&c)&&(o=!1),_+=b;continue}else if(b==="["){o=!0,a=g,c=!1,_+=b;continue}if(!r.noext&&yE(b)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(b,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=b}return t.push(_),g}let l=i+1,u=new n(null,t),d=[],p="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,p+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(l===a+2&&c)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=l,c=!1,p+=g;continue}if(yE(g)&&e.charAt(l)==="("){u.push(p),p="";let _=new n(g,u);u.push(_),l=n.#y(e,_,l,r);continue}if(g==="|"){u.push(p),p="",d.push(u),u=new n(null,t);continue}if(g===")")return p===""&&t.#i.length===0&&(t.#r=!0),u.push(p),p="",t.push(...d,u),l;p+=g}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],l}static fromGlob(e,t={}){let i=new n(null,void 0,t);return n.#y(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,r,s]=this.toRegExpSource();if(!(r||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#i.map(g=>{let[_,b,w,R]=typeof g=="string"?n.#d(g,this.#t,c):g.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||R,_}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&r0.has(this.#i[0]))){let _=i0,b=t&&_.has(l.charAt(0))||l.startsWith("\\.")&&_.has(l.charAt(2))||l.startsWith("\\.\\.")&&_.has(l.charAt(4)),w=!t&&!e&&_.has(l.charAt(0));u=b?n0:w?Ml:""}let d="";return this.isEnd()&&this.#e.#f&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,un(l),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,un(this.toString()),!1,!1]}let o=!i||e||t||!Ml?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!t?Ml:"")+TE;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ml:"")+bE+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+c}return[a,un(s),this.#t=!!this.#t,this.#s]}#h(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,r,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#d(e,t,i=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(r){r=!1,s+=(s0.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(c==="["){let[l,u,d,p]=gE(e,a);if(d){s+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){i&&e==="*"?s+=TE:s+=bE,t=!0;continue}if(c==="?"){s+=Jh,t=!0;continue}s+=o0(c)}return[s,un(e),!!t,o]}};var zr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var Nt=(n,e,t={})=>(co(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Bt(e,t).match(n)),a0=/^\*+([^+@!?\*\[\(]*)$/,c0=n=>e=>!e.startsWith(".")&&e.endsWith(n),l0=n=>e=>e.endsWith(n),u0=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),f0=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),d0=/^\*+\.\*+$/,h0=n=>!n.startsWith(".")&&n.includes("."),p0=n=>n!=="."&&n!==".."&&n.includes("."),m0=/^\.\*+$/,g0=n=>n!=="."&&n!==".."&&n.startsWith("."),y0=/^\*+$/,b0=n=>n.length!==0&&!n.startsWith("."),T0=n=>n.length!==0&&n!=="."&&n!=="..",v0=/^\?+([^+@!?\*\[\(]*)?$/,S0=([n,e=""])=>{let t=EE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},k0=([n,e=""])=>{let t=wE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},E0=([n,e=""])=>{let t=wE([n]);return e?i=>t(i)&&i.endsWith(e):t},w0=([n,e=""])=>{let t=EE([n]);return e?i=>t(i)&&i.endsWith(e):t},EE=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},wE=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},NE=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",vE={win32:{sep:"\\"},posix:{sep:"/"}},N0=NE==="win32"?vE.win32.sep:vE.posix.sep;Nt.sep=N0;var pt=Symbol("globstar **");Nt.GLOBSTAR=pt;var _0="[^/]",P0=_0+"*?",D0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",R0="(?:(?!(?:\\/|^)\\.).)*?",C0=(n,e={})=>t=>Nt(t,n,e);Nt.filter=C0;var Gt=(n,e={})=>Object.assign({},n,e),O0=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Nt;let e=Nt;return Object.assign((i,r,s={})=>e(i,r,Gt(n,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Gt(n,s))}static defaults(r){return e.defaults(Gt(n,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Gt(n,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Gt(n,s))}},unescape:(i,r={})=>e.unescape(i,Gt(n,r)),escape:(i,r={})=>e.escape(i,Gt(n,r)),filter:(i,r={})=>e.filter(i,Gt(n,r)),defaults:i=>e.defaults(Gt(n,i)),makeRe:(i,r={})=>e.makeRe(i,Gt(n,r)),braceExpand:(i,r={})=>e.braceExpand(i,Gt(n,r)),match:(i,r,s={})=>e.match(i,r,Gt(n,s)),sep:e.sep,GLOBSTAR:pt})};Nt.defaults=O0;var _E=(n,e={})=>(co(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,kE.default)(n));Nt.braceExpand=_E;var A0=(n,e={})=>new Bt(n,e).makeRe();Nt.makeRe=A0;var I0=(n,e,t={})=>{let i=new Bt(e,t);return n=n.filter(r=>i.match(r)),i.options.nonull&&!n.length&&n.push(e),n};Nt.match=I0;var SE=/[?*]|[+@!]\(.*?\)|\[|\]/,L0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){co(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||NE,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!SE.test(s[2]))&&!SE.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let r=0;r<e[i].length;r++)e[i][r]==="**"&&(e[i][r]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let r=i;for(;t[r+1]==="**";)r++;r!==i&&t.splice(i,r-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let r=e[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let o=r;for(;i[o+1]==="**";)o++;o>r&&i.splice(r+1,o-r);let a=i[r+1],c=i[r+2],l=i[r+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,i.splice(r,1);let u=i.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(t=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let o=i[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let r=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(r){e[t]=[],e[i]=r;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<t.length;)if(e[r]===t[s])o.push(a==="b"?t[s]:e[r]),r++,s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])o.push(e[r]),r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])o.push(t[s]),s++;else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),r++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let r=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),R=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!R&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:b?0:void 0,N=v?3:R?0:void 0;if(typeof T=="number"&&typeof N=="number"){let[L,q]=[e[T],t[N]];L.toLowerCase()===q.toLowerCase()&&(t[N]=L,N>T?t=t.slice(N):T>N&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===pt){this.debug("GLOBSTAR",[t,u,d]);var p=o,g=a+1;if(g===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var _=e[p];if(this.debug(`
|
|
231
231
|
globstar while`,e,p,t,g,_),this.matchOne(e.slice(p),t.slice(g),i))return this.debug("globstar found match!",p,c,_),!0;if(_==="."||_===".."||!r.dot&&_.charAt(0)==="."){this.debug("dot detected!",e,p,t,g);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(i&&(this.debug(`
|
|
232
|
-
>>> no match, partial?`,e,p,t,g),p===c))}let b;if(typeof u=="string"?(b=d===u,this.debug("string match",u,d,b)):(b=u.test(d),this.debug("pattern match",u,d,b)),!b)return!1}if(o===c&&a===l)return!0;if(o===c)return i;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return _E(this.pattern,this.options)}parse(e){ao(e);let t=this.options;if(e==="**")return pt;if(e==="")return"";let i,r=null;(i=e.match(g0))?r=t.dot?b0:y0:(i=e.match(o0))?r=(t.nocase?t.dot?u0:l0:t.dot?c0:a0)(i[1]):(i=e.match(T0))?r=(t.nocase?t.dot?S0:v0:t.dot?k0:E0)(i):(i=e.match(f0))?r=t.dot?h0:d0:(i=e.match(p0))&&(r=m0);let s=Yr.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?_0:t.dot?P0:D0,r=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))r.add(d);return typeof u=="string"?I0(u):u===pt?pt:u._src});return l.forEach((u,d)=>{let p=l[d+1],g=l[d-1];u!==pt||g===pt||(g===void 0?p!==void 0&&p!==pt?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=g+"(?:\\/|"+i+")?":p!==pt&&(l[d-1]=g+"(?:\\/|\\/"+i+"\\/)"+p,l[d+1]=pt))}),l.filter(u=>u!==pt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let c=s[a],l=r;if(i.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Nt.defaults(e).Minimatch}};Nt.AST=Yr;Nt.Minimatch=Bt;Nt.escape=Kr;Nt.unescape=un;var XE=require("node:url");var zr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,DE=new Set,Zh=typeof process=="object"&&process?process:{},RE=(n,e,t,i)=>{typeof Zh.emitWarning=="function"?Zh.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},ql=globalThis.AbortController,PE=globalThis.AbortSignal;if(typeof ql>"u"){PE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},ql=class{constructor(){e()}signal=new PE;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=Zh.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,RE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var L0=n=>!DE.has(n),nW=Symbol("type"),wi=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),CE=n=>wi(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Gr:null:null,Gr=class extends Array{constructor(e){super(e),this.fill(0)}},ep=class n{heap;length;static#e=!1;static create(e){let t=CE(e);if(!t)return[];n.#e=!0;let i=new n(e,t);return n.#e=!1,i}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},lo=class n{#e;#t;#s;#i;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#c;#r;#g;#y;#h;#d;#E;#m;#w;#N;#T;#S;#k;#p;static unsafeExposeInternals(e){return{starts:e.#N,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#r,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#d},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,i,r,s)=>e.#F(t,i,r,s),moveToTail:t=>e.#j(t),indexes:t=>e.#P(t),rindexes:t=>e.#D(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:w,memoMethod:R,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:L,ignoreFetchAbort:q}=e;if(t!==0&&!wi(t))throw new TypeError("max option must be a nonnegative integer");let H=t?CE(t):Array;if(!H)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=R,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#k=!!w,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#r=new Array(t).fill(void 0),this.#g=new H(t),this.#y=new H(t),this.#h=0,this.#d=0,this.#E=ep.create(t),this.#l=0,this.#f=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#S=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#t!==0&&!wi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=wi(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!wi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";L0(j)&&(DE.add(j),RE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new Gr(this.#e),t=new Gr(this.#e);this.#T=e,this.#N=t,this.#A=(s,o,a=zr.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#O(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#_=s=>{t[s]=e[s]!==0?zr.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=zr.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#b=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#_=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Gr(this.#e);this.#f=0,this.#w=e,this.#I=t=>{this.#f-=e[t],e[t]=0},this.#x=(t,i,r,s)=>{if(this.#u(i))return 0;if(!wi(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!wi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,i,r)=>{if(e[t]=i,this.#t){let s=this.#t-e[t];for(;this.#f>s;)this.#q(!0)}this.#f+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#f)}}#I=e=>{};#L=(e,t,i)=>{};#x=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#d;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#d));)t=this.#g[t]}#M(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*rentries(){for(let e of this.#D())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#D())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#c[i],this))return this.get(this.#c[i],t)}}forEach(e,t=this){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#r[t],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#T&&this.#N){let o=this.#T[t],a=this.#N[t];if(o&&a){let c=o-(zr.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#c[t],r=this.#r[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#T&&this.#N){o.ttl=this.#T[t];let a=zr.now()-this.#N[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=zr.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#x(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#d:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#r[d]=t,this.#a.set(e,d),this.#g[this.#d]=d,this.#y[d]=this.#d,this.#d=d,this.#l++,this.#L(d,u,c),c&&(c.set="add"),l=!1;else{this.#j(d);let p=this.#r[d];if(t!==p){if(this.#k&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=p;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#m?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]));if(this.#I(d),this.#L(d,u,c),this.#r[d]=t,c){c.set="replace";let g=p&&this.#u(p)?p.__staleWhileFetching:p;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(r!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#A(d,r,s),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let p=this.#m,g;for(;g=p?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#r[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#q(e){let t=this.#h,i=this.#c[t],r=this.#r[t];return this.#k&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(r,i,"evict"),this.#p&&this.#m?.push([r,i,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#r[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#d=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(i),this.#l--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#a.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))r&&(r.has="stale",this.#n(r,s));else return i&&this.#_(s),r&&(r.has="hit",this.#n(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!i&&this.#b(r))return;let s=this.#r[r];return this.#u(s)?s.__staleWhileFetching:s}#F(e,t,i,r){let s=t===void 0?void 0:this.#r[t];if(this.#u(s))return s;let o=new ql,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(b,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(R&&!w?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),R&&!v&&!w)return d(o.signal.reason);let T=g;return this.#r[t]===g&&(b===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),d(b)),d=b=>{let{aborted:w}=o.signal,R=w&&i.allowStaleOnFetchAbort,v=R||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,N=g;if(this.#r[t]===g&&(!T||N.__staleWhileFetching===void 0?this.#O(e,"fetch"):R||(this.#r[t]=N.__staleWhileFetching)),v)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw b},p=(b,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>b(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=v=>l(v,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(p).then(l,u),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...c.options,status:void 0}),t=this.#a.get(e)):this.#r[t]=_,_}#u(e){if(!this.#k)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ql}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:w=!1,status:R,signal:v}=t;if(!this.#k)return R&&(R.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:R});let T={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:R,signal:v},N=this.#a.get(e);if(N===void 0){R&&(R.fetch="miss");let L=this.#F(e,N,T,b);return L.__returned=L}else{let L=this.#r[N];if(this.#u(L)){let Be=i&&L.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",Be&&(R.returnedStale=!0)),Be?L.__staleWhileFetching:L.__returned=L}let q=this.#b(N);if(!w&&!q)return R&&(R.fetch="hit"),this.#j(N),r&&this.#_(N),R&&this.#n(R,N),L;let H=this.#F(e,N,T,b),ie=H.__staleWhileFetching!==void 0&&i;return R&&(R.fetch=q?"stale":"refresh",ie&&q&&(R.returnedStale=!0)),ie?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#r[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#j(a),r&&this.#_(a),c))}else o&&(o.get="miss")}#B(e,t){this.#y[t]=e,this.#g[e]=t}#j(e){e!==this.#d&&(e===this.#h?this.#h=this.#g[e]:this.#B(this.#y[e],this.#g[e]),this.#B(this.#d,e),this.#d=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let i=!1;if(this.#l!==0){let r=this.#a.get(e);if(r!==void 0)if(i=!0,this.#l===1)this.#U(t);else{this.#I(r);let s=this.#r[r];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,t),this.#p&&this.#m?.push([s,e,t])),this.#a.delete(e),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#d)this.#d=this.#y[r];else if(r===this.#h)this.#h=this.#g[r];else{let o=this.#y[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#y[a]=this.#y[r]}this.#l--,this.#E.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,s;for(;s=r?.shift();)this.#i?.(...s)}return i}clear(){return this.#U("delete")}#U(e){for(let t of this.#D({allowStale:!0})){let i=this.#r[t];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#c[t];this.#S&&this.#s?.(i,r,e),this.#p&&this.#m?.push([i,r,e])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#T&&this.#N&&(this.#T.fill(0),this.#N.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#d=0,this.#E.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};var Jr=require("node:path"),jE=require("node:url"),Rn=require("fs"),V0=G(require("node:fs"),1),Pi=require("node:fs/promises");var Vl=require("node:events"),ap=G(require("node:stream"),1),xE=require("node:string_decoder"),OE=typeof process=="object"&&process?process:{stdout:null,stderr:null},x0=n=>!!n&&typeof n=="object"&&(n instanceof _i||n instanceof ap.default||M0(n)||q0(n)),M0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ap.default.Writable.prototype.pipe,q0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Wn=Symbol("EOF"),Vn=Symbol("maybeEmitEnd"),Ni=Symbol("emittedEnd"),Fl=Symbol("emittingEnd"),uo=Symbol("emittedError"),Bl=Symbol("closed"),AE=Symbol("read"),jl=Symbol("flush"),IE=Symbol("flushChunk"),fn=Symbol("encoding"),Xr=Symbol("decoder"),ot=Symbol("flowing"),fo=Symbol("paused"),Qr=Symbol("resume"),at=Symbol("buffer"),_t=Symbol("pipes"),ct=Symbol("bufferLength"),tp=Symbol("bufferPush"),Ul=Symbol("bufferShift"),St=Symbol("objectMode"),Ve=Symbol("destroyed"),np=Symbol("error"),ip=Symbol("emitData"),LE=Symbol("emitEnd"),rp=Symbol("emitEnd2"),Pn=Symbol("async"),sp=Symbol("abort"),$l=Symbol("aborted"),ho=Symbol("signal"),Gi=Symbol("dataListeners"),jt=Symbol("discarded"),po=n=>Promise.resolve().then(n),F0=n=>n(),B0=n=>n==="end"||n==="finish"||n==="prefinish",j0=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,U0=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Wl=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Qr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},op=class extends Wl{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>t.emit("error",r),e.on("error",this.proxyErrors)}},$0=n=>!!n.objectMode,W0=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",_i=class extends Vl.EventEmitter{[ot]=!1;[fo]=!1;[_t]=[];[at]=[];[St];[fn];[Pn];[Xr];[Wn]=!1;[Ni]=!1;[Fl]=!1;[Bl]=!1;[uo]=null;[ct]=0;[Ve]=!1;[ho];[$l]=!1;[Gi]=0;[jt]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");$0(t)?(this[St]=!0,this[fn]=null):W0(t)?(this[fn]=t.encoding,this[St]=!1):(this[St]=!1,this[fn]=null),this[Pn]=!!t.async,this[Xr]=this[fn]?new xE.StringDecoder(this[fn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[at]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_t]});let{signal:i}=t;i&&(this[ho]=i,i.aborted?this[sp]():i.addEventListener("abort",()=>this[sp]()))}get bufferLength(){return this[ct]}get encoding(){return this[fn]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[St]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Pn]}set async(e){this[Pn]=this[Pn]||!!e}[sp](){this[$l]=!0,this.emit("abort",this[ho]?.reason),this.destroy(this[ho]?.reason)}get aborted(){return this[$l]}set aborted(e){}write(e,t,i){if(this[$l])return!1;if(this[Wn])throw new Error("write after end");if(this[Ve])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[Pn]?po:F0;if(!this[St]&&!Buffer.isBuffer(e)){if(U0(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(j0(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[St]?(this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):e.length?(typeof e=="string"&&!(t===this[fn]&&!this[Xr]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[fn]&&(e=this[Xr].write(e)),this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):(this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot])}read(e){if(this[Ve])return null;if(this[jt]=!1,this[ct]===0||e===0||e&&e>this[ct])return this[Vn](),null;this[St]&&(e=null),this[at].length>1&&!this[St]&&(this[at]=[this[fn]?this[at].join(""):Buffer.concat(this[at],this[ct])]);let t=this[AE](e||null,this[at][0]);return this[Vn](),t}[AE](e,t){if(this[St])this[Ul]();else{let i=t;e===i.length||e===null?this[Ul]():typeof i=="string"?(this[at][0]=i.slice(e),t=i.slice(0,e),this[ct]-=e):(this[at][0]=i.subarray(e),t=i.subarray(0,e),this[ct]-=e)}return this.emit("data",t),!this[at].length&&!this[Wn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Wn]=!0,this.writable=!1,(this[ot]||!this[fo])&&this[Vn](),this}[Qr](){this[Ve]||(!this[Gi]&&!this[_t].length&&(this[jt]=!0),this[fo]=!1,this[ot]=!0,this.emit("resume"),this[at].length?this[jl]():this[Wn]?this[Vn]():this.emit("drain"))}resume(){return this[Qr]()}pause(){this[ot]=!1,this[fo]=!0,this[jt]=!1}get destroyed(){return this[Ve]}get flowing(){return this[ot]}get paused(){return this[fo]}[tp](e){this[St]?this[ct]+=1:this[ct]+=e.length,this[at].push(e)}[Ul](){return this[St]?this[ct]-=1:this[ct]-=this[at][0].length,this[at].shift()}[jl](e=!1){do;while(this[IE](this[Ul]())&&this[at].length);!e&&!this[at].length&&!this[Wn]&&this.emit("drain")}[IE](e){return this.emit("data",e),this[ot]}pipe(e,t){if(this[Ve])return e;this[jt]=!1;let i=this[Ni];return t=t||{},e===OE.stdout||e===OE.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[_t].push(t.proxyErrors?new op(this,e,t):new Wl(this,e,t)),this[Pn]?po(()=>this[Qr]()):this[Qr]()),e}unpipe(e){let t=this[_t].find(i=>i.dest===e);t&&(this[_t].length===1?(this[ot]&&this[Gi]===0&&(this[ot]=!1),this[_t]=[]):this[_t].splice(this[_t].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[jt]=!1,this[Gi]++,!this[_t].length&&!this[ot]&&this[Qr]();else if(e==="readable"&&this[ct]!==0)super.emit("readable");else if(B0(e)&&this[Ni])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[uo]){let r=t;this[Pn]?po(()=>r.call(this,this[uo])):r.call(this,this[uo])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Gi]=this.listeners("data").length,this[Gi]===0&&!this[jt]&&!this[_t].length&&(this[ot]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Gi]=0,!this[jt]&&!this[_t].length&&(this[ot]=!1)),t}get emittedEnd(){return this[Ni]}[Vn](){!this[Fl]&&!this[Ni]&&!this[Ve]&&this[at].length===0&&this[Wn]&&(this[Fl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Bl]&&this.emit("close"),this[Fl]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==Ve&&this[Ve])return!1;if(e==="data")return!this[St]&&!i?!1:this[Pn]?(po(()=>this[ip](i)),!0):this[ip](i);if(e==="end")return this[LE]();if(e==="close"){if(this[Bl]=!0,!this[Ni]&&!this[Ve])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[uo]=i,super.emit(np,i);let s=!this[ho]||this.listeners("error").length?super.emit("error",i):!1;return this[Vn](),s}else if(e==="resume"){let s=super.emit("resume");return this[Vn](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let r=super.emit(e,...t);return this[Vn](),r}[ip](e){for(let i of this[_t])i.dest.write(e)===!1&&this.pause();let t=this[jt]?!1:super.emit("data",e);return this[Vn](),t}[LE](){return this[Ni]?!1:(this[Ni]=!0,this.readable=!1,this[Pn]?(po(()=>this[rp]()),!0):this[rp]())}[rp](){if(this[Xr]){let t=this[Xr].end();if(t){for(let i of this[_t])i.dest.write(t);this[jt]||super.emit("data",t)}}for(let t of this[_t])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[St]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[St]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[St])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[fn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Ve,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[jt]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Wn])return t();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Ve,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Ve,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Ve,u),t(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,s=d,this.once(Ve,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[jt]=!1;let e=!1,t=()=>(this.pause(),this.off(np,t),this.off(Ve,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(np,t),this.once(Ve,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Ve])return e?this.emit("error",e):this.emit(Ve),this;this[Ve]=!0,this[jt]=!0,this[at].length=0,this[ct]=0;let t=this;return typeof t.close=="function"&&!this[Bl]&&t.close(),e?this.emit("error",e):this.emit(Ve),this}static get isStream(){return x0}};var H0=Rn.realpathSync.native,go={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:H0,promises:{lstat:Pi.lstat,readdir:Pi.readdir,readlink:Pi.readlink,realpath:Pi.realpath}},UE=n=>!n||n===go||n===V0?go:{...go,...n,promises:{...go.promises,...n.promises||{}}},$E=/^\\\\\?\\([a-z]:)\\?$/i,Y0=n=>n.replace(/\//g,"\\").replace($E,"$1\\"),K0=/[\\\/]/,Qt=0,WE=1,VE=2,Dn=4,HE=6,YE=8,Xi=10,KE=12,Xt=15,mo=~Xt,cp=16,ME=32,yo=64,dn=128,Hl=256,Kl=512,qE=yo|dn|Kl,z0=1023,lp=n=>n.isFile()?YE:n.isDirectory()?Dn:n.isSymbolicLink()?Xi:n.isCharacterDevice()?VE:n.isBlockDevice()?HE:n.isSocket()?KE:n.isFIFO()?WE:Qt,FE=new Map,bo=n=>{let e=FE.get(n);if(e)return e;let t=n.normalize("NFKD");return FE.set(n,t),t},BE=new Map,Yl=n=>{let e=BE.get(n);if(e)return e;let t=bo(n.toLowerCase());return BE.set(n,t),t},zl=class extends lo{constructor(){super({max:256})}},up=class extends lo{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},zE=Symbol("PathScurry setAsCwd"),kt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#d;get birthtimeMs(){return this.#d}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#N;get birthtime(){return this.#N}#T;#S;#k;#p;#R;#_;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Qt,i,r,s,o,a){this.name=e,this.#T=s?Yl(e):bo(e),this.#n=t&z0,this.nocase=s,this.roots=r,this.root=i||this,this.#A=o,this.#k=a.fullpath,this.#R=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=UE(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),r=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(r):this.#I(r)}#I(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~cp,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),r=this.nocase?Yl(e):bo(e);for(let c of i)if(c.#T===r)return c;let s=this.parent?this.sep:"",o=this.#k?this.#k+s+e:void 0,a=this.newChild(e,Qt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=dn),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#k!==void 0)return this.#k;let e=this.name,t=this.parent;if(!t)return this.#k=this.name;let r=t.fullpath()+(t.parent?this.sep:"")+e;return this.#k=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Xt)===Qt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Xt)===YE}isDirectory(){return(this.#n&Xt)===Dn}isCharacterDevice(){return(this.#n&Xt)===VE}isBlockDevice(){return(this.#n&Xt)===HE}isFIFO(){return(this.#n&Xt)===WE}isSocket(){return(this.#n&Xt)===KE}isSymbolicLink(){return(this.#n&Xi)===Xi}lstatCached(){return this.#n&ME?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Xt;return!(e!==Qt&&e!==Xi||this.#n&Hl||this.#n&dn)}calledReaddir(){return!!(this.#n&cp)}isENOENT(){return!!(this.#n&dn)}isNamed(e){return this.nocase?this.#T===Yl(e):this.#T===bo(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}#L(e){this.#n|=cp;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#x()}}#x(){this.#n&dn||(this.#n=(this.#n|dn)&mo,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#D(){this.#n|=Kl,this.#M()}#M(){if(this.#n&yo)return;let e=this.#n;(e&Xt)===Dn&&(e&=mo),this.#n=e|yo,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#x():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=Hl,e==="ENOENT"&&(t|=dn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=mo),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#B(e,t){return this.#O(e,t)||this.#j(e,t)}#j(e,t){let i=lp(e),r=this.newChild(e.name,i,{parent:this}),s=r.#n&Xt;return s!==Dn&&s!==Xi&&s!==Qt&&(r.#n|=yo),t.unshift(r),t.provisional++,r}#O(e,t){for(let i=t.provisional;i<t.length;i++){let r=t[i];if((this.nocase?Yl(e.name):bo(e.name))===r.#T)return this.#U(e,r,i,t)}}#U(e,t,i,r){let s=t.name;return t.#n=t.#n&mo|lp(e),s!==e.name&&(t.name=e.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(t)),r.provisional++,t}async lstat(){if(!(this.#n&dn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if(!(this.#n&dn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:t,atimeMs:i,birthtime:r,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:g,mtime:_,mtimeMs:b,nlink:w,rdev:R,size:v,uid:T}=e;this.#E=t,this.#g=i,this.#N=r,this.#d=s,this.#f=o,this.#r=a,this.#w=c,this.#h=l,this.#t=u,this.#v=d,this.#a=p,this.#s=g,this.#m=_,this.#y=b,this.#i=w,this.#l=R,this.#c=v,this.#o=T;let N=lp(e);this.#n=this.#n&mo|N|ME,N!==Qt&&N!==Dn&&N!==Xi&&(this.#n|=yo)}#W=[];#V=!1;#Y(e){this.#V=!1;let t=this.#W.slice();this.#W.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#V)return;this.#V=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),i.provisional=0;else{for(let a of o)this.#B(a,i);this.#L(i)}this.#Y(i.slice(0,i.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#$)await this.#$;else{let i=()=>{};this.#$=new Promise(r=>i=r);try{for(let r of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(r,e);this.#L(e)}catch(r){this.#q(r.code),e.provisional=0}this.#$=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(i,e);this.#L(e)}catch(i){this.#q(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&qE)return!1;let e=Xt&this.#n;return e===Qt||e===Dn||e===Xi}shouldWalk(e,t){return(this.#n&Dn)===Dn&&!(this.#n&qE)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}[zE](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],r=this;for(;r&&r.parent;)t.add(r),r.#R=i.join(this.sep),r.#_=i.join("/"),r=r.parent,i.push("..");for(r=e;r&&r.parent&&!t.has(r);)r.#R=void 0,r.#_=void 0,r=r.parent}},Gl=class n extends kt{sep="\\";splitSep=K0;constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Jr.win32.parse(e).root}getRoot(e){if(e=Y0(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new Zr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($E,"$1\\"),e===t}},Xl=class n extends kt{splitSep="/";sep="/";constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Ql=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:r,childrenCacheSize:s=16*1024,fs:o=go}={}){this.#i=UE(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,jE.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new zl,this.#t=new zl,this.#s=new up(s);let c=a.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,g=!1;for(let _ of c){let b=u--;l=l.child(_,{relative:new Array(b).fill("..").join(d),relativePosix:new Array(b).fill("..").join("/"),fullpath:p+=(g?"":d)+_}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#e.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#t.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let r=await e.readdir();return i?r:r.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(r=>r.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((g,_)=>{if(g)return p(g);let b=_.length;if(!b)return p();let w=()=>{--b===0&&p()};for(let R of _)(!s||s(R))&&a.push(i?R:R.fullpath()),r&&R.isSymbolicLink()?R.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,w):w()):R.shouldWalk(c,o)?l(R,w):w()},!0)},u=e;return new Promise((d,p)=>{l(u,g=>{if(g)return p(g);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(i?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(r&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield i?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(r&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0});(!s||s(e))&&a.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=(w,R,v=!1)=>{if(w)return a.emit("error",w);if(r&&!v){let T=[];for(let N of R)N.isSymbolicLink()&&T.push(N.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,R,!0));return}}for(let T of R)T&&(!s||s(T))&&(a.write(i?T:T.fullpath())||(p=!0));u--;for(let T of R){let N=T.realpathCached()||T;N.shouldWalk(c,o)&&l.push(N)}p&&!a.flowing?a.once("drain",d):b||d()},b=!0;g.readdirCB(_,!0),b=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=g.readdirSync();for(let b of _)(!s||s(b))&&(a.write(i?b:b.fullpath())||(p=!0));u--;for(let b of _){let w=b;if(b.isSymbolicLink()){if(!(r&&(w=b.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(c,o)&&l.push(w)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[zE](t)}},Zr=class extends Ql{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,Jr.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(e){return Jr.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},es=class extends Ql{sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,Jr.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Xl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},To=class extends es{constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}},aW=process.platform==="win32"?Gl:Xl,GE=process.platform==="win32"?Zr:process.platform==="darwin"?To:es;var G0=n=>n.length>=1,X0=n=>n.length>=1,ts=class n{#e;#t;#s;length;#i;#o;#v;#l;#f;#a;#c=!0;constructor(e,t,i,r){if(!G0(e))throw new TypeError("empty pattern list");if(!X0(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=i,this.#i=r,this.#s===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,p,g,..._]=this.#t;l[0]===""&&(l.shift(),_.shift());let b=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[b,...l],this.#t=[w,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=s+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===pt}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var Q0=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ns=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:r,noglobstar:s,platform:o=Q0}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:r,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Bt(e,this.mmopts);for(let i=0;i<t.set.length;i++){let r=t.set[i],s=t.globParts[i];if(!r||!s)throw new Error("invalid pattern object");for(;r[0]==="."&&s[0]===".";)r.shift(),s.shift();let o=new ts(r,s,0,this.platform),a=new Bt(o.globString(),this.mmopts),c=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),i=`${t}/`,r=e.relative()||".",s=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(t))return!0;return!1}};var fp=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),r=this.store.get(i);r?r.add(t.globString()):this.store.set(i,new Set([t.globString()]))}},dp=class{store=new Map;add(e,t,i){let r=(t?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?r:r&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},hp=class{store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(r=>r.globString()===t.globString())||i.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},vo=class n{hasWalkedCache;matches=new dp;subwalks=new hp;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new fp}processPatterns(e,t){this.patterns=t;let i=t.map(r=>[e,r]);for(let[r,s]of i){this.hasWalkedCache.storeWalked(r,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)r=r.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(r,s))continue;this.hasWalkedCache.storeWalked(r,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,d);continue}else if(c===pt){(!r.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(r,s);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(r,a,d===""||d===".");else if(d===".."){let g=r.parent||r;p?this.hasWalkedCache.hasWalked(g,p)||this.subwalks.add(g,p):this.matches.add(g,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),r=this.child();for(let s of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===pt?r.testGlobstar(s,o,l,a):c instanceof RegExp?r.testRegExp(s,c,l,a):r.testString(s,c,l,a)}return r}testGlobstar(e,t,i,r){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),r);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),r)}}testRegExp(e,t,i,r){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}testString(e,t,i,r){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}};var J0=(n,e)=>typeof n=="string"?new ns([n],e):Array.isArray(n)?new ns(n,e):n,Jl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=J0(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+r)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+r:"."+r)}}async match(e,t,i){let r=await this.matchCheck(e,i);r&&this.matchFinish(r,t)}matchSync(e,t,i){let r=this.matchCheckSync(e,i);r&&this.matchFinish(r,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new vo(this.opts),i)}walkCB2(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,i,o):a.readdirCB((l,u)=>this.walkCB3(a,u,i,o),!0)}o()}walkCB3(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of i.subwalks.entries())s++,this.walkCB2(a,c,i.child(),o);o()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new vo(this.opts),i)}walkCB2Sync(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,i,o)}o()}walkCB3Sync(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of i.subwalks.entries())s++,this.walkCB2Sync(a,c,i.child(),o);o()}},So=class extends Jl{matches=new Set;constructor(e,t,i){super(e,t,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ko=class extends Jl{results;constructor(e,t,i){super(e,t,i),this.results=new _i({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var Z0=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",hn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,XE.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||Z0,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?Zr:t.platform==="darwin"?To:t.platform?es:GE;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new Bt(c,r)),[o,a]=s.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new ts(c,u,0,this.platform)})}async walk(){return[...await new So(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new So(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var pp=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Bt(t,e).hasMagic())return!0;return!1};function eu(n,e={}){return new hn(n,e).streamSync()}function JE(n,e={}){return new hn(n,e).stream()}function ZE(n,e={}){return new hn(n,e).walkSync()}async function QE(n,e={}){return new hn(n,e).walk()}function tu(n,e={}){return new hn(n,e).iterateSync()}function ew(n,e={}){return new hn(n,e).iterate()}var eA=eu,tA=Object.assign(JE,{sync:eu}),nA=tu,iA=Object.assign(ew,{sync:tu}),rA=Object.assign(ZE,{stream:eu,iterate:tu}),Zl=Object.assign(QE,{glob:QE,globSync:ZE,sync:rA,globStream:JE,stream:tA,globStreamSync:eu,streamSync:eA,globIterate:ew,iterate:iA,globIterateSync:tu,iterateSync:nA,Glob:hn,hasMagic:pp,escape:Kr,unescape:un});Zl.glob=Zl;var Eo=require("path"),sw=require("fs");var Cn=G(Q()),sA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},tw=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},nu=(n,e)=>{if(e=e.include.reduce((t,i)=>{let r=n.find(s=>(0,Eo.basename)(s.filePath)===i.name);if(r){let s=i["property-blocklist"];return t.include=t.include.filter(o=>o!==i),oA(n,r,t,s)??t}return console.warn(`Unable to find ${i}`),t},e),e["child-binding"]&&(e["child-binding"].include=ow(e["child-binding"].include),e["child-binding"]=nu(n,e["child-binding"])),!e.include.length)return e},oA=(n,e,t,i=[])=>{let r=nu(n,e),s=nu(n,t);if(!r||!s)return;let o=new Set;Object.keys(r?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let p=i?.some(_=>_===d)?{}:r.properties?.[d]??{},g=s.properties?.[d]??{};a={...a,[d]:{...p,...g}}}),s.properties=a;let c=new Set;return Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let p=r[d]??[],g=s[d]??[];s[d]=Array.from([...p,...g])}),s},ow=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],mp=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values;if(!i?.values.some(r=>!(r?.value instanceof Tt)))return i?.values.map(r=>(r?.value).value)}getNodeTypes(e,t){let i=n.getNodeCompatible(t);if(!i)return[ui()];let r=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(r.length)return r;this.loadTypeAndCache(e);let s=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return s.length?s:[ui()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let r=Zl.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,Eo.resolve)(t,o);try{let a=rw.default.parse((0,sw.readFileSync)(o,"utf-8"));return{...a,include:ow(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=r.map(o=>nu(r,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...aA(s))})}},nw,aw=()=>(nw??=new mp,nw),aA=n=>n.map(cw),cw=n=>{let e=ui();e.compatible=n.compatible??(n.filePath?(0,Eo.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let i=Object.keys(n).filter(r=>r.endsWith("-cells")).map(r=>({specifier:r.replace(/-cells$/,""),values:n[r]}));return n.properties&&Object.keys(n.properties).forEach(r=>{let s=n.properties[r];cA(e,r,s),e.cellsValues=i}),n["child-binding"]&&(e.childNodeType=cw(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},cA=(n,e,t)=>{let i=n.properties.find(r=>typeof r.name=="string"&&r.getNameMatch(e));if(i){i.required=()=>t.required?"required":"optional",i.values=()=>t.enum??[],i.constValue=tw(t.type,t.const);let r=i.additionalTypeCheck;i.additionalTypeCheck=s=>[...iw(t,e)(s),...r?.(s)??[]]}else{let r=new K(e,sA(t.type),t.required?"required":"optional",void 0,t.enum,iw(t,e));r.desctiption=t.description?[t.description]:void 0,r.constValue=tw(t.type,t.const),n.addProperty(r)}},iw=(n,e)=>{let t=n;return i=>{let r=i.parent.root,s=[];if(t.const){let o=i.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||s.push(A(25,i.ast.values??i.ast,Cn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&s.push(A(14,i.ast,Cn.DiagnosticSeverity.Warning,[],[Cn.DiagnosticTag.Deprecated],[i.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&wt(i.ast.values)?.forEach(a=>{an(a,r)||s.push(A(23,a,Cn.DiagnosticSeverity.Error))}),t.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Tt){let o=i.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=r.getNode(c);return l?a.push(c):s.push(A(24,o,Cn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=wt(i.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=an(c,r);if(!l){s.push(A(23,c??i.ast,Cn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){s.push(A(16,i.ast,Cn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[i.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let p=d?De(d,0,0)??0:0;if(1+p>o.length-a){let g=l.nodeType?.cellsValues?.find(_=>_.specifier===u)?.values;s.push(A(20,c??i.ast,Cn.DiagnosticSeverity.Error,[],[],[i.name,`<${["phandel",...g??[],...Array.from({length:p-(g?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+p}}return s}};var iu=(n,e)=>({getNodeTypes:t=>{switch(e){case"Zephyr":return aw().getNodeTypes(n,t)}}});var lw=G(Q()),gp=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(gp):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:lw.FoldingRangeKind.Region},...n.nodes.flatMap(gp)];function uw(n){return n.rootDocument.nodes.flatMap(gp)}var Qi=G(Q());function lA(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>t.nodeType?.bindingsPath?[Qi.Location.create(`file://${t.nodeType.bindingsPath}`,Qi.Range.create(Qi.Position.create(0,0),Qi.Position.create(0,0)))]:[];return n.item instanceof ge&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof he&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function fw(n,e,t){return ft(n,e,i=>[...lA(i)],t)}var is=require("path"),ve=[],Di,bp,wo=new WeakMap,uA=n=>{let e=wo.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},lt=async()=>{await yw,await Promise.all(ve.map(uA))},Tp=n=>{let e=dw(n);return ve.filter(t=>!e.some(i=>i===t))},dw=n=>ve.filter(e=>{let t=n.contexts?.find(i=>i.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(i=>e.overlays.some(r=>r===i))}),fA=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes),i=(await e.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes);return t.every(r=>i.some(s=>s.reolvedPath===r.reolvedPath&&s.firstToken.pos.col===r.firstToken.pos.col&&s.firstToken.pos.len===r.firstToken.pos.len&&s.firstToken.pos.line===r.firstToken.pos.line&&s.lastToken.pos.col===r.lastToken.pos.col&&s.lastToken.pos.len===r.lastToken.pos.len&&s.lastToken.pos.line===r.lastToken.pos.line))},hw=async n=>{let e=Tp(re),t=await dw(re),i=await lc(e);if(ve.indexOf(n)===-1)return;let r=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(ve.indexOf(n)===-1)return;let s=await Promise.all(i.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await fA(a.context,c)})))),o=i.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&r.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{wo.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),ve=ve.filter(a=>o.indexOf(a)===-1))},be=(0,Re.createConnection)(Re.ProposedFeatures.all),No=new Re.TextDocuments(oc),Sp=!0,vp=!1;be.onInitialize(n=>{let e=n.capabilities;Sp=!!(e.workspace&&e.workspace.configuration),vp=!!(e.workspace&&e.workspace.workspaceFolders);let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Re.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0},codeActionProvider:{codeActionKinds:[Re.CodeActionKind.QuickFix,Re.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:ac,tokenModifiers:cc},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return vp&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});be.onInitialized(()=>{Sp&&be.client.register(Re.DidChangeConfigurationNotification.type,{}),vp&&be.workspace.onDidChangeWorkspaceFolders(n=>{be.console.log("Workspace folder change event received")})});var pw={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},re=pw,mw=new Map,gw=!1,yw=new Promise(n=>{let e=setInterval(()=>{gw&&(n(),clearInterval(e))},100)});be.onDidChangeConfiguration(n=>{if(gw=!0,!n.settings)return;console.log("Configuration changed",n),Sp&&mw.clear();let e=re;re={...pw,...n.settings?.devicetree},re.contexts?.forEach((r,s)=>{if(r.cwd||re.cwd){let o=r.cwd??re.cwd;r.includePaths??=re.defaultIncludePaths,r.zephyrBindings??=re.defaultIncludePaths,r.bindingType??=re.defaultBindingType,o&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(a=>(0,is.resolve)(o,a)),r.includePaths=r.includePaths?.map(a=>(0,is.resolve)(o,a)),r.dtsFile=(0,is.resolve)(o,r.dtsFile)}});let t=Tp(e);ve=[],wo=new WeakMap,re.contexts?.forEach((r,s)=>{let o=r.bindingType,a=new xr(r.dtsFile,r.includePaths??[],o?iu(r.zephyrBindings??[],o):void 0,r.overlays,r.ctxName);ve.push(a),console.log(`New context with ID ${a.name} for ${r.dtsFile}`)});let i=bw();ve=[...ve,...t.map(r=>{let s=re.defaultBindingType,o=new xr(r.parser.uri,i.defaultIncludePaths,s?iu(i.defaultZephyrBindings,s):void 0);return console.log(`New context with ID ${o.name} for ${r.parser.uri}`),o})],t=Tp(re),t.forEach(hw),bp&&_o(bp,!0),be.languages.diagnostics.refresh()});var bw=()=>{let n=(re.defaultIncludePaths??[]).map(t=>re.cwd?(0,is.resolve)(re.cwd,t):t);re.cwd&&re.defaultBindingType==="Zephyr"&&!re.defaultZephyrBindings&&(re.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(re.defaultZephyrBindings??[]).map(t=>re.cwd?(0,is.resolve)(re.cwd,t):t);return{defaultIncludePaths:n,defaultZephyrBindings:e}};No.onDidClose(n=>{mw.delete(n.document.uri)});be.languages.diagnostics.on(async n=>{await lt();let e=n.textDocument.uri.replace("file://",""),t=await Di;return{kind:Re.DocumentDiagnosticReportKind.Full,items:t?await Tw(t,e):[{severity:Re.DiagnosticSeverity.Warning,range:Re.Range.create(Re.Position.create(0,0),Re.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}});var dA=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node"}},hA=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),pA=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},mA=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),gA=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};No.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");di().renewLexer(e,n.document.getText()),await yw;let t=await sT(ve,e);if(t.length)t.forEach(i=>{wo.get(i.context)?.abort.abort();let r=new AbortController,s=new Promise(o=>{setTimeout(async()=>{if(r.signal.aborted){o();return}let a=performance.now();ru.delete(i.context),await i.context.reevaluate(e),o(),console.log("reevaluate",performance.now()-a)},50)});wo.set(i.context,{abort:r,promise:s})});else{if(re.allowAdhocContexts===!1||!e.endsWith(".dts"))return;let i=re.defaultBindingType,r=bw(),s=new xr(e,r.defaultIncludePaths,i?iu(r.defaultZephyrBindings,i):void 0);console.log(`New ad hoc context with ID ${s.name} for ${e}`),ve.push(s),_o(e),await s.parser.stable,hw(s)}});var yp=[];be.languages.diagnostics.onWorkspace(async()=>{await lt();let n=await Di,e=yp.filter(i=>!n?.getContextFiles().some(r=>r===i)).map(i=>({uri:`file://${i}`,kind:Re.DocumentDiagnosticReportKind.Full,items:[],version:No.get(`file://${i}`)?.version??null}));return yp=[],n?{items:[...await Promise.all(n.getContextFiles().map(async i=>{let r=await Tw(n,i);return yp.push(i),{uri:`file://${i}`,kind:Re.DocumentDiagnosticReportKind.Full,items:r,version:No.get(`file://${i}`)?.version??null}})),...e.flat()]}:{items:e}});var ru=new WeakMap;async function Tw(n,e){let t=performance.now(),i=ru.get(n);if(i){let r=i.get(e);if(r)return r}else ru.set(n,new Map);try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:a.issues?a.issues.map(dA).join(" or "):"",source:"devicetree",data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:a.issues,edit:a.edit}}};r.push(c)}),(await n.getContextIssues()??[]).filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:hA(a),source:"devicetree",tags:a.tags,relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(pA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))]};r.push(c)}),(await n.getRuntime())?.typesIssues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:mA(a),relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(gA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))],source:"devicetree",tags:a.tags,data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:a.issues,edit:a.edit}}};r.push(c)}),console.log("diagnostics",e,performance.now()-t),ru.get(n)?.set(e,r),r):[]}catch(r){throw console.error(r),r}}be.onDidChangeWatchedFiles(n=>{be.console.log("We received a file change event")});be.onCompletion(async n=>(await lt(),ve?[...await tv(n,ve,re.preferredContext),...await dv(n,ve,re.preferredContext)]:[]));be.onCompletionResolve(n=>n);No.listen(be);be.listen();var _o=async(n,e=!1)=>{if(!e&&re.autoChangeContext===!1)return;bp=n,await lt();let t=await Di;Di=_r(ve,n,re.preferredContext).then(r=>r?.context);let i=await Di;t!==i&&(console.log(`(ID: ${i?.name??-1}) activeContext:`,i?.parser.uri),ve.forEach((r,s)=>{console.log(`Context with ID ${r.name} for ${r.parser.uri}`)}))};be.onDocumentSymbol(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let i=await(await Di)?.parser;return i?i.getDocumentSymbols(e):[]});be.onWorkspaceSymbol(async()=>{await lt();let n=await Di;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});be.languages.semanticTokens.on(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=new Re.SemanticTokensBuilder,i=await _r(ve,e,re.preferredContext),r=i?.context.isInContext(e);return!i||!r?{data:[]}:(i.context.parser.buildSemanticTokens(t,e),t.build())});be.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await lt(),(await _r(ve,e,re.preferredContext))?.context.getDocumentLinks(e)});be.onPrepareRename(async n=>(await lt(),av(n,ve,re.lockRenameEdits??[],re.preferredContext)));be.onRenameRequest(async n=>(await lt(),ov(n,ve,re.preferredContext)));be.onReferences(async n=>(await lt(),nv(n,ve,re.preferredContext)));be.onDefinition(async n=>(await lt(),cv(n,ve,re.preferredContext)));be.onDeclaration(async n=>(await lt(),lv(n,ve,re.preferredContext)));be.onCodeAction(async n=>uv(n));be.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await lt();let t=await _r(ve,e,re.preferredContext);return t?mT(n,t.context):[]});be.onHover(async n=>(await lt(),(await hv(n,ve,re.preferredContext)).at(0)));be.onRequest("devicetree/contexts",async()=>(await lt(),ve.map(n=>n.parser.uri)));be.onFoldingRanges(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=await Di,i=t?.isInContext(e);return!t||!i?[]:uw(t.parser)});be.onTypeDefinition(async n=>(await lt(),fw(n,ve)));
|
|
232
|
+
>>> no match, partial?`,e,p,t,g),p===c))}let b;if(typeof u=="string"?(b=d===u,this.debug("string match",u,d,b)):(b=u.test(d),this.debug("pattern match",u,d,b)),!b)return!1}if(o===c&&a===l)return!0;if(o===c)return i;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return _E(this.pattern,this.options)}parse(e){co(e);let t=this.options;if(e==="**")return pt;if(e==="")return"";let i,r=null;(i=e.match(y0))?r=t.dot?T0:b0:(i=e.match(a0))?r=(t.nocase?t.dot?f0:u0:t.dot?l0:c0)(i[1]):(i=e.match(v0))?r=(t.nocase?t.dot?k0:S0:t.dot?E0:w0)(i):(i=e.match(d0))?r=t.dot?p0:h0:(i=e.match(m0))&&(r=g0);let s=Kr.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?P0:t.dot?D0:R0,r=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))r.add(d);return typeof u=="string"?L0(u):u===pt?pt:u._src});return l.forEach((u,d)=>{let p=l[d+1],g=l[d-1];u!==pt||g===pt||(g===void 0?p!==void 0&&p!==pt?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=g+"(?:\\/|"+i+")?":p!==pt&&(l[d-1]=g+"(?:\\/|\\/"+i+"\\/)"+p,l[d+1]=pt))}),l.filter(u=>u!==pt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let c=s[a],l=r;if(i.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Nt.defaults(e).Minimatch}};Nt.AST=Kr;Nt.Minimatch=Bt;Nt.escape=zr;Nt.unescape=un;var XE=require("node:url");var Gr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,DE=new Set,Zh=typeof process=="object"&&process?process:{},RE=(n,e,t,i)=>{typeof Zh.emitWarning=="function"?Zh.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},ql=globalThis.AbortController,PE=globalThis.AbortSignal;if(typeof ql>"u"){PE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},ql=class{constructor(){e()}signal=new PE;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=Zh.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,RE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var x0=n=>!DE.has(n),rW=Symbol("type"),wi=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),CE=n=>wi(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Xr:null:null,Xr=class extends Array{constructor(e){super(e),this.fill(0)}},ep=class n{heap;length;static#e=!1;static create(e){let t=CE(e);if(!t)return[];n.#e=!0;let i=new n(e,t);return n.#e=!1,i}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},uo=class n{#e;#t;#s;#i;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#c;#r;#g;#y;#h;#d;#E;#m;#w;#N;#T;#S;#k;#p;static unsafeExposeInternals(e){return{starts:e.#N,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#r,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#d},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,i,r,s)=>e.#F(t,i,r,s),moveToTail:t=>e.#j(t),indexes:t=>e.#P(t),rindexes:t=>e.#D(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:w,memoMethod:R,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:L,ignoreFetchAbort:q}=e;if(t!==0&&!wi(t))throw new TypeError("max option must be a nonnegative integer");let H=t?CE(t):Array;if(!H)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=R,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#k=!!w,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#r=new Array(t).fill(void 0),this.#g=new H(t),this.#y=new H(t),this.#h=0,this.#d=0,this.#E=ep.create(t),this.#l=0,this.#f=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#S=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#t!==0&&!wi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=wi(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!wi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";x0(j)&&(DE.add(j),RE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new Xr(this.#e),t=new Xr(this.#e);this.#T=e,this.#N=t,this.#A=(s,o,a=Gr.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#O(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#_=s=>{t[s]=e[s]!==0?Gr.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=Gr.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#b=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#_=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Xr(this.#e);this.#f=0,this.#w=e,this.#I=t=>{this.#f-=e[t],e[t]=0},this.#x=(t,i,r,s)=>{if(this.#u(i))return 0;if(!wi(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!wi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,i,r)=>{if(e[t]=i,this.#t){let s=this.#t-e[t];for(;this.#f>s;)this.#q(!0)}this.#f+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#f)}}#I=e=>{};#L=(e,t,i)=>{};#x=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#d;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#d));)t=this.#g[t]}#M(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*rentries(){for(let e of this.#D())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#D())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#c[i],this))return this.get(this.#c[i],t)}}forEach(e,t=this){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#r[t],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#T&&this.#N){let o=this.#T[t],a=this.#N[t];if(o&&a){let c=o-(Gr.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#c[t],r=this.#r[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#T&&this.#N){o.ttl=this.#T[t];let a=Gr.now()-this.#N[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=Gr.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#x(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#d:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#r[d]=t,this.#a.set(e,d),this.#g[this.#d]=d,this.#y[d]=this.#d,this.#d=d,this.#l++,this.#L(d,u,c),c&&(c.set="add"),l=!1;else{this.#j(d);let p=this.#r[d];if(t!==p){if(this.#k&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=p;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#m?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]));if(this.#I(d),this.#L(d,u,c),this.#r[d]=t,c){c.set="replace";let g=p&&this.#u(p)?p.__staleWhileFetching:p;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(r!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#A(d,r,s),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let p=this.#m,g;for(;g=p?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#r[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#q(e){let t=this.#h,i=this.#c[t],r=this.#r[t];return this.#k&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(r,i,"evict"),this.#p&&this.#m?.push([r,i,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#r[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#d=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(i),this.#l--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#a.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))r&&(r.has="stale",this.#n(r,s));else return i&&this.#_(s),r&&(r.has="hit",this.#n(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!i&&this.#b(r))return;let s=this.#r[r];return this.#u(s)?s.__staleWhileFetching:s}#F(e,t,i,r){let s=t===void 0?void 0:this.#r[t];if(this.#u(s))return s;let o=new ql,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(b,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(R&&!w?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),R&&!v&&!w)return d(o.signal.reason);let T=g;return this.#r[t]===g&&(b===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),d(b)),d=b=>{let{aborted:w}=o.signal,R=w&&i.allowStaleOnFetchAbort,v=R||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,N=g;if(this.#r[t]===g&&(!T||N.__staleWhileFetching===void 0?this.#O(e,"fetch"):R||(this.#r[t]=N.__staleWhileFetching)),v)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw b},p=(b,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>b(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=v=>l(v,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(p).then(l,u),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...c.options,status:void 0}),t=this.#a.get(e)):this.#r[t]=_,_}#u(e){if(!this.#k)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ql}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:w=!1,status:R,signal:v}=t;if(!this.#k)return R&&(R.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:R});let T={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:R,signal:v},N=this.#a.get(e);if(N===void 0){R&&(R.fetch="miss");let L=this.#F(e,N,T,b);return L.__returned=L}else{let L=this.#r[N];if(this.#u(L)){let Be=i&&L.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",Be&&(R.returnedStale=!0)),Be?L.__staleWhileFetching:L.__returned=L}let q=this.#b(N);if(!w&&!q)return R&&(R.fetch="hit"),this.#j(N),r&&this.#_(N),R&&this.#n(R,N),L;let H=this.#F(e,N,T,b),ie=H.__staleWhileFetching!==void 0&&i;return R&&(R.fetch=q?"stale":"refresh",ie&&q&&(R.returnedStale=!0)),ie?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#r[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#j(a),r&&this.#_(a),c))}else o&&(o.get="miss")}#B(e,t){this.#y[t]=e,this.#g[e]=t}#j(e){e!==this.#d&&(e===this.#h?this.#h=this.#g[e]:this.#B(this.#y[e],this.#g[e]),this.#B(this.#d,e),this.#d=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let i=!1;if(this.#l!==0){let r=this.#a.get(e);if(r!==void 0)if(i=!0,this.#l===1)this.#U(t);else{this.#I(r);let s=this.#r[r];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,t),this.#p&&this.#m?.push([s,e,t])),this.#a.delete(e),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#d)this.#d=this.#y[r];else if(r===this.#h)this.#h=this.#g[r];else{let o=this.#y[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#y[a]=this.#y[r]}this.#l--,this.#E.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,s;for(;s=r?.shift();)this.#i?.(...s)}return i}clear(){return this.#U("delete")}#U(e){for(let t of this.#D({allowStale:!0})){let i=this.#r[t];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#c[t];this.#S&&this.#s?.(i,r,e),this.#p&&this.#m?.push([i,r,e])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#T&&this.#N&&(this.#T.fill(0),this.#N.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#d=0,this.#E.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};var Zr=require("node:path"),jE=require("node:url"),Rn=require("fs"),H0=G(require("node:fs"),1),Pi=require("node:fs/promises");var Vl=require("node:events"),ap=G(require("node:stream"),1),xE=require("node:string_decoder"),OE=typeof process=="object"&&process?process:{stdout:null,stderr:null},M0=n=>!!n&&typeof n=="object"&&(n instanceof _i||n instanceof ap.default||q0(n)||F0(n)),q0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ap.default.Writable.prototype.pipe,F0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Wn=Symbol("EOF"),Vn=Symbol("maybeEmitEnd"),Ni=Symbol("emittedEnd"),Fl=Symbol("emittingEnd"),fo=Symbol("emittedError"),Bl=Symbol("closed"),AE=Symbol("read"),jl=Symbol("flush"),IE=Symbol("flushChunk"),fn=Symbol("encoding"),Qr=Symbol("decoder"),ot=Symbol("flowing"),ho=Symbol("paused"),Jr=Symbol("resume"),at=Symbol("buffer"),_t=Symbol("pipes"),ct=Symbol("bufferLength"),tp=Symbol("bufferPush"),Ul=Symbol("bufferShift"),St=Symbol("objectMode"),Ve=Symbol("destroyed"),np=Symbol("error"),ip=Symbol("emitData"),LE=Symbol("emitEnd"),rp=Symbol("emitEnd2"),Pn=Symbol("async"),sp=Symbol("abort"),$l=Symbol("aborted"),po=Symbol("signal"),Xi=Symbol("dataListeners"),jt=Symbol("discarded"),mo=n=>Promise.resolve().then(n),B0=n=>n(),j0=n=>n==="end"||n==="finish"||n==="prefinish",U0=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,$0=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Wl=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Jr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},op=class extends Wl{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>t.emit("error",r),e.on("error",this.proxyErrors)}},W0=n=>!!n.objectMode,V0=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",_i=class extends Vl.EventEmitter{[ot]=!1;[ho]=!1;[_t]=[];[at]=[];[St];[fn];[Pn];[Qr];[Wn]=!1;[Ni]=!1;[Fl]=!1;[Bl]=!1;[fo]=null;[ct]=0;[Ve]=!1;[po];[$l]=!1;[Xi]=0;[jt]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");W0(t)?(this[St]=!0,this[fn]=null):V0(t)?(this[fn]=t.encoding,this[St]=!1):(this[St]=!1,this[fn]=null),this[Pn]=!!t.async,this[Qr]=this[fn]?new xE.StringDecoder(this[fn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[at]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_t]});let{signal:i}=t;i&&(this[po]=i,i.aborted?this[sp]():i.addEventListener("abort",()=>this[sp]()))}get bufferLength(){return this[ct]}get encoding(){return this[fn]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[St]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Pn]}set async(e){this[Pn]=this[Pn]||!!e}[sp](){this[$l]=!0,this.emit("abort",this[po]?.reason),this.destroy(this[po]?.reason)}get aborted(){return this[$l]}set aborted(e){}write(e,t,i){if(this[$l])return!1;if(this[Wn])throw new Error("write after end");if(this[Ve])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[Pn]?mo:B0;if(!this[St]&&!Buffer.isBuffer(e)){if($0(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(U0(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[St]?(this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):e.length?(typeof e=="string"&&!(t===this[fn]&&!this[Qr]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[fn]&&(e=this[Qr].write(e)),this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):(this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot])}read(e){if(this[Ve])return null;if(this[jt]=!1,this[ct]===0||e===0||e&&e>this[ct])return this[Vn](),null;this[St]&&(e=null),this[at].length>1&&!this[St]&&(this[at]=[this[fn]?this[at].join(""):Buffer.concat(this[at],this[ct])]);let t=this[AE](e||null,this[at][0]);return this[Vn](),t}[AE](e,t){if(this[St])this[Ul]();else{let i=t;e===i.length||e===null?this[Ul]():typeof i=="string"?(this[at][0]=i.slice(e),t=i.slice(0,e),this[ct]-=e):(this[at][0]=i.subarray(e),t=i.subarray(0,e),this[ct]-=e)}return this.emit("data",t),!this[at].length&&!this[Wn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Wn]=!0,this.writable=!1,(this[ot]||!this[ho])&&this[Vn](),this}[Jr](){this[Ve]||(!this[Xi]&&!this[_t].length&&(this[jt]=!0),this[ho]=!1,this[ot]=!0,this.emit("resume"),this[at].length?this[jl]():this[Wn]?this[Vn]():this.emit("drain"))}resume(){return this[Jr]()}pause(){this[ot]=!1,this[ho]=!0,this[jt]=!1}get destroyed(){return this[Ve]}get flowing(){return this[ot]}get paused(){return this[ho]}[tp](e){this[St]?this[ct]+=1:this[ct]+=e.length,this[at].push(e)}[Ul](){return this[St]?this[ct]-=1:this[ct]-=this[at][0].length,this[at].shift()}[jl](e=!1){do;while(this[IE](this[Ul]())&&this[at].length);!e&&!this[at].length&&!this[Wn]&&this.emit("drain")}[IE](e){return this.emit("data",e),this[ot]}pipe(e,t){if(this[Ve])return e;this[jt]=!1;let i=this[Ni];return t=t||{},e===OE.stdout||e===OE.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[_t].push(t.proxyErrors?new op(this,e,t):new Wl(this,e,t)),this[Pn]?mo(()=>this[Jr]()):this[Jr]()),e}unpipe(e){let t=this[_t].find(i=>i.dest===e);t&&(this[_t].length===1?(this[ot]&&this[Xi]===0&&(this[ot]=!1),this[_t]=[]):this[_t].splice(this[_t].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[jt]=!1,this[Xi]++,!this[_t].length&&!this[ot]&&this[Jr]();else if(e==="readable"&&this[ct]!==0)super.emit("readable");else if(j0(e)&&this[Ni])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[fo]){let r=t;this[Pn]?mo(()=>r.call(this,this[fo])):r.call(this,this[fo])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Xi]=this.listeners("data").length,this[Xi]===0&&!this[jt]&&!this[_t].length&&(this[ot]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Xi]=0,!this[jt]&&!this[_t].length&&(this[ot]=!1)),t}get emittedEnd(){return this[Ni]}[Vn](){!this[Fl]&&!this[Ni]&&!this[Ve]&&this[at].length===0&&this[Wn]&&(this[Fl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Bl]&&this.emit("close"),this[Fl]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==Ve&&this[Ve])return!1;if(e==="data")return!this[St]&&!i?!1:this[Pn]?(mo(()=>this[ip](i)),!0):this[ip](i);if(e==="end")return this[LE]();if(e==="close"){if(this[Bl]=!0,!this[Ni]&&!this[Ve])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[fo]=i,super.emit(np,i);let s=!this[po]||this.listeners("error").length?super.emit("error",i):!1;return this[Vn](),s}else if(e==="resume"){let s=super.emit("resume");return this[Vn](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let r=super.emit(e,...t);return this[Vn](),r}[ip](e){for(let i of this[_t])i.dest.write(e)===!1&&this.pause();let t=this[jt]?!1:super.emit("data",e);return this[Vn](),t}[LE](){return this[Ni]?!1:(this[Ni]=!0,this.readable=!1,this[Pn]?(mo(()=>this[rp]()),!0):this[rp]())}[rp](){if(this[Qr]){let t=this[Qr].end();if(t){for(let i of this[_t])i.dest.write(t);this[jt]||super.emit("data",t)}}for(let t of this[_t])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[St]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[St]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[St])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[fn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Ve,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[jt]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Wn])return t();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Ve,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Ve,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Ve,u),t(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,s=d,this.once(Ve,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[jt]=!1;let e=!1,t=()=>(this.pause(),this.off(np,t),this.off(Ve,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(np,t),this.once(Ve,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Ve])return e?this.emit("error",e):this.emit(Ve),this;this[Ve]=!0,this[jt]=!0,this[at].length=0,this[ct]=0;let t=this;return typeof t.close=="function"&&!this[Bl]&&t.close(),e?this.emit("error",e):this.emit(Ve),this}static get isStream(){return M0}};var Y0=Rn.realpathSync.native,yo={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:Y0,promises:{lstat:Pi.lstat,readdir:Pi.readdir,readlink:Pi.readlink,realpath:Pi.realpath}},UE=n=>!n||n===yo||n===H0?yo:{...yo,...n,promises:{...yo.promises,...n.promises||{}}},$E=/^\\\\\?\\([a-z]:)\\?$/i,K0=n=>n.replace(/\//g,"\\").replace($E,"$1\\"),z0=/[\\\/]/,Qt=0,WE=1,VE=2,Dn=4,HE=6,YE=8,Qi=10,KE=12,Xt=15,go=~Xt,cp=16,ME=32,bo=64,dn=128,Hl=256,Kl=512,qE=bo|dn|Kl,G0=1023,lp=n=>n.isFile()?YE:n.isDirectory()?Dn:n.isSymbolicLink()?Qi:n.isCharacterDevice()?VE:n.isBlockDevice()?HE:n.isSocket()?KE:n.isFIFO()?WE:Qt,FE=new Map,To=n=>{let e=FE.get(n);if(e)return e;let t=n.normalize("NFKD");return FE.set(n,t),t},BE=new Map,Yl=n=>{let e=BE.get(n);if(e)return e;let t=To(n.toLowerCase());return BE.set(n,t),t},zl=class extends uo{constructor(){super({max:256})}},up=class extends uo{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},zE=Symbol("PathScurry setAsCwd"),kt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#d;get birthtimeMs(){return this.#d}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#N;get birthtime(){return this.#N}#T;#S;#k;#p;#R;#_;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Qt,i,r,s,o,a){this.name=e,this.#T=s?Yl(e):To(e),this.#n=t&G0,this.nocase=s,this.roots=r,this.root=i||this,this.#A=o,this.#k=a.fullpath,this.#R=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=UE(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),r=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(r):this.#I(r)}#I(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~cp,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),r=this.nocase?Yl(e):To(e);for(let c of i)if(c.#T===r)return c;let s=this.parent?this.sep:"",o=this.#k?this.#k+s+e:void 0,a=this.newChild(e,Qt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=dn),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#k!==void 0)return this.#k;let e=this.name,t=this.parent;if(!t)return this.#k=this.name;let r=t.fullpath()+(t.parent?this.sep:"")+e;return this.#k=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Xt)===Qt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Xt)===YE}isDirectory(){return(this.#n&Xt)===Dn}isCharacterDevice(){return(this.#n&Xt)===VE}isBlockDevice(){return(this.#n&Xt)===HE}isFIFO(){return(this.#n&Xt)===WE}isSocket(){return(this.#n&Xt)===KE}isSymbolicLink(){return(this.#n&Qi)===Qi}lstatCached(){return this.#n&ME?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Xt;return!(e!==Qt&&e!==Qi||this.#n&Hl||this.#n&dn)}calledReaddir(){return!!(this.#n&cp)}isENOENT(){return!!(this.#n&dn)}isNamed(e){return this.nocase?this.#T===Yl(e):this.#T===To(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}#L(e){this.#n|=cp;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#x()}}#x(){this.#n&dn||(this.#n=(this.#n|dn)&go,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#D(){this.#n|=Kl,this.#M()}#M(){if(this.#n&bo)return;let e=this.#n;(e&Xt)===Dn&&(e&=go),this.#n=e|bo,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#x():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=Hl,e==="ENOENT"&&(t|=dn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=go),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#B(e,t){return this.#O(e,t)||this.#j(e,t)}#j(e,t){let i=lp(e),r=this.newChild(e.name,i,{parent:this}),s=r.#n&Xt;return s!==Dn&&s!==Qi&&s!==Qt&&(r.#n|=bo),t.unshift(r),t.provisional++,r}#O(e,t){for(let i=t.provisional;i<t.length;i++){let r=t[i];if((this.nocase?Yl(e.name):To(e.name))===r.#T)return this.#U(e,r,i,t)}}#U(e,t,i,r){let s=t.name;return t.#n=t.#n&go|lp(e),s!==e.name&&(t.name=e.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(t)),r.provisional++,t}async lstat(){if(!(this.#n&dn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if(!(this.#n&dn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:t,atimeMs:i,birthtime:r,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:g,mtime:_,mtimeMs:b,nlink:w,rdev:R,size:v,uid:T}=e;this.#E=t,this.#g=i,this.#N=r,this.#d=s,this.#f=o,this.#r=a,this.#w=c,this.#h=l,this.#t=u,this.#v=d,this.#a=p,this.#s=g,this.#m=_,this.#y=b,this.#i=w,this.#l=R,this.#c=v,this.#o=T;let N=lp(e);this.#n=this.#n&go|N|ME,N!==Qt&&N!==Dn&&N!==Qi&&(this.#n|=bo)}#W=[];#V=!1;#Y(e){this.#V=!1;let t=this.#W.slice();this.#W.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#V)return;this.#V=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),i.provisional=0;else{for(let a of o)this.#B(a,i);this.#L(i)}this.#Y(i.slice(0,i.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#$)await this.#$;else{let i=()=>{};this.#$=new Promise(r=>i=r);try{for(let r of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(r,e);this.#L(e)}catch(r){this.#q(r.code),e.provisional=0}this.#$=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(i,e);this.#L(e)}catch(i){this.#q(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&qE)return!1;let e=Xt&this.#n;return e===Qt||e===Dn||e===Qi}shouldWalk(e,t){return(this.#n&Dn)===Dn&&!(this.#n&qE)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}[zE](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],r=this;for(;r&&r.parent;)t.add(r),r.#R=i.join(this.sep),r.#_=i.join("/"),r=r.parent,i.push("..");for(r=e;r&&r.parent&&!t.has(r);)r.#R=void 0,r.#_=void 0,r=r.parent}},Gl=class n extends kt{sep="\\";splitSep=z0;constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Zr.win32.parse(e).root}getRoot(e){if(e=K0(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new es(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($E,"$1\\"),e===t}},Xl=class n extends kt{splitSep="/";sep="/";constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Ql=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:r,childrenCacheSize:s=16*1024,fs:o=yo}={}){this.#i=UE(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,jE.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new zl,this.#t=new zl,this.#s=new up(s);let c=a.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,g=!1;for(let _ of c){let b=u--;l=l.child(_,{relative:new Array(b).fill("..").join(d),relativePosix:new Array(b).fill("..").join("/"),fullpath:p+=(g?"":d)+_}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#e.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#t.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let r=await e.readdir();return i?r:r.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(r=>r.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((g,_)=>{if(g)return p(g);let b=_.length;if(!b)return p();let w=()=>{--b===0&&p()};for(let R of _)(!s||s(R))&&a.push(i?R:R.fullpath()),r&&R.isSymbolicLink()?R.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,w):w()):R.shouldWalk(c,o)?l(R,w):w()},!0)},u=e;return new Promise((d,p)=>{l(u,g=>{if(g)return p(g);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(i?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(r&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield i?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(r&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0});(!s||s(e))&&a.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=(w,R,v=!1)=>{if(w)return a.emit("error",w);if(r&&!v){let T=[];for(let N of R)N.isSymbolicLink()&&T.push(N.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,R,!0));return}}for(let T of R)T&&(!s||s(T))&&(a.write(i?T:T.fullpath())||(p=!0));u--;for(let T of R){let N=T.realpathCached()||T;N.shouldWalk(c,o)&&l.push(N)}p&&!a.flowing?a.once("drain",d):b||d()},b=!0;g.readdirCB(_,!0),b=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=g.readdirSync();for(let b of _)(!s||s(b))&&(a.write(i?b:b.fullpath())||(p=!0));u--;for(let b of _){let w=b;if(b.isSymbolicLink()){if(!(r&&(w=b.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(c,o)&&l.push(w)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[zE](t)}},es=class extends Ql{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,Zr.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(e){return Zr.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ts=class extends Ql{sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,Zr.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Xl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},vo=class extends ts{constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}},lW=process.platform==="win32"?Gl:Xl,GE=process.platform==="win32"?es:process.platform==="darwin"?vo:ts;var X0=n=>n.length>=1,Q0=n=>n.length>=1,ns=class n{#e;#t;#s;length;#i;#o;#v;#l;#f;#a;#c=!0;constructor(e,t,i,r){if(!X0(e))throw new TypeError("empty pattern list");if(!Q0(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=i,this.#i=r,this.#s===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,p,g,..._]=this.#t;l[0]===""&&(l.shift(),_.shift());let b=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[b,...l],this.#t=[w,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=s+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===pt}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var J0=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",is=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:r,noglobstar:s,platform:o=J0}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:r,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Bt(e,this.mmopts);for(let i=0;i<t.set.length;i++){let r=t.set[i],s=t.globParts[i];if(!r||!s)throw new Error("invalid pattern object");for(;r[0]==="."&&s[0]===".";)r.shift(),s.shift();let o=new ns(r,s,0,this.platform),a=new Bt(o.globString(),this.mmopts),c=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),i=`${t}/`,r=e.relative()||".",s=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(t))return!0;return!1}};var fp=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),r=this.store.get(i);r?r.add(t.globString()):this.store.set(i,new Set([t.globString()]))}},dp=class{store=new Map;add(e,t,i){let r=(t?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?r:r&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},hp=class{store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(r=>r.globString()===t.globString())||i.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},So=class n{hasWalkedCache;matches=new dp;subwalks=new hp;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new fp}processPatterns(e,t){this.patterns=t;let i=t.map(r=>[e,r]);for(let[r,s]of i){this.hasWalkedCache.storeWalked(r,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)r=r.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(r,s))continue;this.hasWalkedCache.storeWalked(r,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,d);continue}else if(c===pt){(!r.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(r,s);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(r,a,d===""||d===".");else if(d===".."){let g=r.parent||r;p?this.hasWalkedCache.hasWalked(g,p)||this.subwalks.add(g,p):this.matches.add(g,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),r=this.child();for(let s of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===pt?r.testGlobstar(s,o,l,a):c instanceof RegExp?r.testRegExp(s,c,l,a):r.testString(s,c,l,a)}return r}testGlobstar(e,t,i,r){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),r);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),r)}}testRegExp(e,t,i,r){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}testString(e,t,i,r){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}};var Z0=(n,e)=>typeof n=="string"?new is([n],e):Array.isArray(n)?new is(n,e):n,Jl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=Z0(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+r)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+r:"."+r)}}async match(e,t,i){let r=await this.matchCheck(e,i);r&&this.matchFinish(r,t)}matchSync(e,t,i){let r=this.matchCheckSync(e,i);r&&this.matchFinish(r,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new So(this.opts),i)}walkCB2(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,i,o):a.readdirCB((l,u)=>this.walkCB3(a,u,i,o),!0)}o()}walkCB3(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of i.subwalks.entries())s++,this.walkCB2(a,c,i.child(),o);o()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new So(this.opts),i)}walkCB2Sync(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,i,o)}o()}walkCB3Sync(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of i.subwalks.entries())s++,this.walkCB2Sync(a,c,i.child(),o);o()}},ko=class extends Jl{matches=new Set;constructor(e,t,i){super(e,t,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Eo=class extends Jl{results;constructor(e,t,i){super(e,t,i),this.results=new _i({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var eA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",hn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,XE.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||eA,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?es:t.platform==="darwin"?vo:t.platform?ts:GE;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new Bt(c,r)),[o,a]=s.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new ns(c,u,0,this.platform)})}async walk(){return[...await new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var pp=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Bt(t,e).hasMagic())return!0;return!1};function eu(n,e={}){return new hn(n,e).streamSync()}function JE(n,e={}){return new hn(n,e).stream()}function ZE(n,e={}){return new hn(n,e).walkSync()}async function QE(n,e={}){return new hn(n,e).walk()}function tu(n,e={}){return new hn(n,e).iterateSync()}function ew(n,e={}){return new hn(n,e).iterate()}var tA=eu,nA=Object.assign(JE,{sync:eu}),iA=tu,rA=Object.assign(ew,{sync:tu}),sA=Object.assign(ZE,{stream:eu,iterate:tu}),Zl=Object.assign(QE,{glob:QE,globSync:ZE,sync:sA,globStream:JE,stream:nA,globStreamSync:eu,streamSync:tA,globIterate:ew,iterate:rA,globIterateSync:tu,iterateSync:iA,Glob:hn,hasMagic:pp,escape:zr,unescape:un});Zl.glob=Zl;var wo=require("path"),sw=require("fs");var Cn=G(Q()),oA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},tw=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},nu=(n,e)=>{if(e=e.include.reduce((t,i)=>{let r=n.find(s=>(0,wo.basename)(s.filePath)===i.name);if(r){let s=i["property-blocklist"];return t.include=t.include.filter(o=>o!==i),aA(n,r,t,s)??t}return console.warn(`Unable to find ${i}`),t},e),e["child-binding"]&&(e["child-binding"].include=ow(e["child-binding"].include),e["child-binding"]=nu(n,e["child-binding"])),!e.include.length)return e},aA=(n,e,t,i=[])=>{let r=nu(n,e),s=nu(n,t);if(!r||!s)return;let o=new Set;Object.keys(r?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let p=i?.some(_=>_===d)?{}:r.properties?.[d]??{},g=s.properties?.[d]??{};a={...a,[d]:{...p,...g}}}),s.properties=a;let c=new Set;return Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let p=r[d]??[],g=s[d]??[];s[d]=Array.from([...p,...g])}),s},ow=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],mp=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values;if(!i?.values.some(r=>!(r?.value instanceof Tt)))return i?.values.map(r=>(r?.value).value)}getNodeTypes(e,t){let i=n.getNodeCompatible(t);if(!i)return[ui()];let r=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(r.length)return r;this.loadTypeAndCache(e);let s=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return s.length?s:[ui()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let r=Zl.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,wo.resolve)(t,o);try{let a=rw.default.parse((0,sw.readFileSync)(o,"utf-8"));return{...a,include:ow(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=r.map(o=>nu(r,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...cA(s))})}},nw,aw=()=>(nw??=new mp,nw),cA=n=>n.map(cw),cw=n=>{let e=ui();e.compatible=n.compatible??(n.filePath?(0,wo.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let i=Object.keys(n).filter(r=>r.endsWith("-cells")).map(r=>({specifier:r.replace(/-cells$/,""),values:n[r]}));return n.properties&&Object.keys(n.properties).forEach(r=>{let s=n.properties[r];lA(e,r,s),e.cellsValues=i}),n["child-binding"]&&(e.childNodeType=cw(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},lA=(n,e,t)=>{let i=n.properties.find(r=>typeof r.name=="string"&&r.getNameMatch(e));if(i){i.required=()=>t.required?"required":"optional",i.values=()=>t.enum??[],i.constValue=tw(t.type,t.const);let r=i.additionalTypeCheck;i.additionalTypeCheck=s=>[...iw(t,e)(s),...r?.(s)??[]]}else{let r=new K(e,oA(t.type),t.required?"required":"optional",void 0,t.enum,iw(t,e));r.desctiption=t.description?[t.description]:void 0,r.constValue=tw(t.type,t.const),n.addProperty(r)}},iw=(n,e)=>{let t=n;return i=>{let r=i.parent.root,s=[];if(t.const){let o=i.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||s.push(A(25,i.ast.values??i.ast,Cn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&s.push(A(14,i.ast,Cn.DiagnosticSeverity.Warning,[],[Cn.DiagnosticTag.Deprecated],[i.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&wt(i.ast.values)?.forEach(a=>{an(a,r)||s.push(A(23,a,Cn.DiagnosticSeverity.Error))}),t.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Tt){let o=i.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=r.getNode(c);return l?a.push(c):s.push(A(24,o,Cn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=wt(i.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=an(c,r);if(!l){s.push(A(23,c??i.ast,Cn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){s.push(A(16,i.ast,Cn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[i.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let p=d?Re(d,0,0)??0:0;if(1+p>o.length-a){let g=l.nodeType?.cellsValues?.find(_=>_.specifier===u)?.values;s.push(A(20,c??i.ast,Cn.DiagnosticSeverity.Error,[],[],[i.name,`<${["phandel",...g??[],...Array.from({length:p-(g?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+p}}return s}};var iu=(n,e)=>({getNodeTypes:t=>{switch(e){case"Zephyr":return aw().getNodeTypes(n,t)}}});var lw=G(Q()),gp=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(gp):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:lw.FoldingRangeKind.Region},...n.nodes.flatMap(gp)];function uw(n){return n.rootDocument.nodes.flatMap(gp)}var Ji=G(Q());function uA(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>t.nodeType?.bindingsPath?[Ji.Location.create(`file://${t.nodeType.bindingsPath}`,Ji.Range.create(Ji.Position.create(0,0),Ji.Position.create(0,0)))]:[];return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function fw(n,e,t){return ft(n,e,i=>[...uA(i)],t)}var rs=require("path"),ve=[],Di,yp,No=new WeakMap,fA=n=>{let e=No.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},lt=async()=>{await yw,await Promise.all(ve.map(fA))},bp=n=>{let e=dw(n);return ve.filter(t=>!e.some(i=>i===t))},dw=n=>ve.filter(e=>{let t=n.contexts?.find(i=>i.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(i=>e.overlays.some(r=>r===i))}),dA=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes),i=(await e.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes);return t.length?t.every(r=>i.some(s=>s.reolvedPath===r.reolvedPath&&s.firstToken.pos.col===r.firstToken.pos.col&&s.firstToken.pos.len===r.firstToken.pos.len&&s.firstToken.pos.line===r.firstToken.pos.line&&s.lastToken.pos.col===r.lastToken.pos.col&&s.lastToken.pos.len===r.lastToken.pos.len&&s.lastToken.pos.line===r.lastToken.pos.line)):e.getContextFiles().some(r=>r===n.parser.uri)},hw=async n=>{let e=bp(re),t=await dw(re),i=await lc(e);if(ve.indexOf(n)===-1)return;let r=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(ve.indexOf(n)===-1)return;let s=await Promise.all(i.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await dA(a.context,c)})))),o=i.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&r.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{Tw(a),No.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),ve=ve.filter(a=>o.indexOf(a)===-1))},ue=(0,Se.createConnection)(Se.ProposedFeatures.all),Ri=new Se.TextDocuments(oc),vp=!0,Tp=!1;ue.onInitialize(n=>{let e=n.capabilities;vp=!!(e.workspace&&e.workspace.configuration),Tp=!!(e.workspace&&e.workspace.workspaceFolders);let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Se.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Se.CodeActionKind.QuickFix,Se.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:ac,tokenModifiers:cc},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return Tp&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});ue.onInitialized(()=>{vp&&ue.client.register(Se.DidChangeConfigurationNotification.type,{}),Tp&&ue.workspace.onDidChangeWorkspaceFolders(n=>{ue.console.log("Workspace folder change event received")})});var pw={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},re=pw,mw=new Map,gw=!1,yw=new Promise(n=>{let e=setInterval(()=>{gw&&(n(),clearInterval(e))},100)});ue.onDidChangeConfiguration(n=>{if(gw=!0,!n.settings)return;console.log("Configuration changed",n),vp&&mw.clear();let e=re;re={...pw,...n.settings?.devicetree},re.contexts?.forEach((r,s)=>{if(r.cwd||re.cwd){let o=r.cwd??re.cwd;r.includePaths??=re.defaultIncludePaths,r.zephyrBindings??=re.defaultIncludePaths,r.bindingType??=re.defaultBindingType,o&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(a=>(0,rs.resolve)(o,a)),r.includePaths=r.includePaths?.map(a=>(0,rs.resolve)(o,a)),r.dtsFile=(0,rs.resolve)(o,r.dtsFile)}});let t=bp(e);ve=[],No=new WeakMap,re.contexts?.forEach((r,s)=>{let o=r.bindingType,a=new Mr(r.dtsFile,r.includePaths??[],o?iu(r.zephyrBindings??[],o):void 0,r.overlays,r.ctxName);ve.push(a),console.log(`New context with ID ${a.name} for ${r.dtsFile}`)});let i=bw();ve=[...ve,...t.map(r=>{let s=re.defaultBindingType,o=new Mr(r.parser.uri,i.defaultIncludePaths,s?iu(i.defaultZephyrBindings,s):void 0);return console.log(`New context with ID ${o.name} for ${r.parser.uri}`),o})],t=bp(re),t.forEach(hw),yp&&_o(yp,!0),ue.languages.diagnostics.refresh()});var bw=()=>{let n=(re.defaultIncludePaths??[]).map(t=>re.cwd?(0,rs.resolve)(re.cwd,t):t);re.cwd&&re.defaultBindingType==="Zephyr"&&!re.defaultZephyrBindings&&(re.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(re.defaultZephyrBindings??[]).map(t=>re.cwd?(0,rs.resolve)(re.cwd,t):t);return{defaultIncludePaths:n,defaultZephyrBindings:e}};Ri.onDidClose(n=>{ue.sendDiagnostics({uri:n.document.uri,version:Ri.get(n.document.uri)?.version,diagnostics:[]}),mw.delete(n.document.uri)});Ri.onDidOpen(async n=>{ue.sendDiagnostics({uri:n.document.uri,version:Ri.get(n.document.uri)?.version,diagnostics:(await hA(n.document.uri)).items??[]})});var hA=async n=>{n=n.replace("file://",""),await lt();let e=await Di;return{kind:Se.DocumentDiagnosticReportKind.Full,items:e?await vw(e,n):[{severity:Se.DiagnosticSeverity.Warning,range:Se.Range.create(Se.Position.create(0,0),Se.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}},pA=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node"}},mA=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),gA=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},yA=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),bA=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};Ri.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");di().renewLexer(e,n.document.getText()),await yw;let t=await sT(ve,e);if(t.length)t.forEach(i=>{No.get(i.context)?.abort.abort();let r=new AbortController,s=new Promise(o=>{setTimeout(async()=>{if(r.signal.aborted){o();return}let a=performance.now();ru.delete(i.context),await i.context.reevaluate(e),Sp(i.context).then(c=>{c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{ue.sendDiagnostics(l)})}),o(),console.log("reevaluate",performance.now()-a)},50)});No.set(i.context,{abort:r,promise:s})});else{if(re.allowAdhocContexts===!1)return;let i=re.defaultBindingType,r=bw(),s=new Mr(e,r.defaultIncludePaths,i?iu(r.defaultZephyrBindings,i):void 0);console.log(`New ad hoc context with ID ${s.name} for ${e}`),ve.push(s),_o(e),await s.parser.stable,hw(s)}});var Tw=async n=>{n.getContextFiles().forEach(e=>{ue.sendDiagnostics({uri:e,version:Ri.get(`file://${e}`)?.version,diagnostics:[]})})},Sp=async n=>({items:[...await Promise.all(n.getContextFiles().map(async t=>{let i=await vw(n,t);return{uri:`file://${t}`,kind:Se.DocumentDiagnosticReportKind.Full,items:i,version:Ri.get(`file://${t}`)?.version??null}}))]});ue.languages.diagnostics.onWorkspace(async()=>{await lt();let n=await Di;return n?Sp(n):{items:[]}});var ru=new WeakMap;async function vw(n,e){let t=performance.now(),i=ru.get(n);if(i){let r=i.get(e);if(r)return r}else ru.set(n,new Map);try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:a.issues?a.issues.map(pA).join(" or "):"",source:"devicetree",data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:a.issues,edit:a.edit}}};r.push(c)}),(await n.getContextIssues()??[]).filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:mA(a),source:"devicetree",tags:a.tags,relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(gA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))]};r.push(c)}),(await n.getRuntime())?.typesIssues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:yA(a),relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(bA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))],source:"devicetree",tags:a.tags,data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:a.issues,edit:a.edit}}};r.push(c)}),console.log("diagnostics",e,performance.now()-t),ru.get(n)?.set(e,r),r):[{severity:Se.DiagnosticSeverity.Warning,range:Se.Range.create(Se.Position.create(0,0),Se.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}ue.onDidChangeWatchedFiles(n=>{ue.console.log("We received a file change event")});ue.onCompletion(async n=>(await lt(),ve?[...await tv(n,ve,re.preferredContext),...await dv(n,ve,re.preferredContext)]:[]));ue.onCompletionResolve(n=>n);Ri.listen(ue);ue.listen();var _o=async(n,e=!1)=>{if(!e&&re.autoChangeContext===!1)return;yp=n,await lt();let t=await Di;Di=Pr(ve,n,re.preferredContext).then(r=>r?.context);let i=await Di;t!==i&&(t&&Tw(t),i&&Sp(i).then(r=>{r.items.map(s=>({uri:s.uri,version:s.version??void 0,diagnostics:s.items})).forEach(s=>{ue.sendDiagnostics(s)})}),console.log(`(ID: ${i?.name??-1}) activeContext:`,i?.parser.uri),ve.forEach((r,s)=>{console.log(`Context with ID ${r.name} for ${r.parser.uri}`)}))};ue.onDocumentSymbol(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let i=await(await Di)?.parser;return i?i.getDocumentSymbols(e):[]});ue.onWorkspaceSymbol(async()=>{await lt();let n=await Di;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ue.languages.semanticTokens.on(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=new Se.SemanticTokensBuilder,i=await Pr(ve,e,re.preferredContext),r=i?.context.isInContext(e);return!i||!r?{data:[]}:(i.context.parser.buildSemanticTokens(t,e),t.build())});ue.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await lt(),(await Pr(ve,e,re.preferredContext))?.context.getDocumentLinks(e)});ue.onPrepareRename(async n=>(await lt(),av(n,ve,re.lockRenameEdits??[],re.preferredContext)));ue.onRenameRequest(async n=>(await lt(),ov(n,ve,re.preferredContext)));ue.onReferences(async n=>(await lt(),nv(n,ve,re.preferredContext)));ue.onDefinition(async n=>(await lt(),cv(n,ve,re.preferredContext)));ue.onDeclaration(async n=>(await lt(),lv(n,ve,re.preferredContext)));ue.onCodeAction(async n=>uv(n));ue.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await lt();let t=await Pr(ve,e,re.preferredContext);return t?mT(n,t.context):[]});ue.onHover(async n=>(await lt(),(await hv(n,ve,re.preferredContext)).at(0)));ue.onRequest("devicetree/contexts",async()=>(await lt(),ve.map(n=>n.parser.uri)));ue.onFoldingRanges(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=await Di,i=t?.isInContext(e);return!t||!i?[]:uw(t.parser)});ue.onTypeDefinition(async n=>(await lt(),fw(n,ve)));
|