devicetree-language-server 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1,50 +1,50 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var bB=Object.create;var Om=Object.defineProperty;var _B=Object.getOwnPropertyDescriptor;var SB=Object.getOwnPropertyNames;var NB=Object.getPrototypeOf,kB=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),RB=(t,e)=>{for(var r in e)Om(t,r,{get:e[r],enumerable:!0})},PB=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of SB(e))!kB.call(t,i)&&i!==r&&Om(t,i,{get:()=>e[i],enumerable:!(n=_B(e,i))||n.enumerable});return t};var $=(t,e,r)=>(r=t!=null?bB(NB(t)):{},PB(e||!t||!t.__esModule?Om(r,"default",{value:t,enumerable:!0}):r,t));var Bu=k(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.thenable=Mt.typedArray=Mt.stringArray=Mt.array=Mt.func=Mt.error=Mt.number=Mt.string=Mt.boolean=void 0;function EB(t){return t===!0||t===!1}Mt.boolean=EB;function BS(t){return typeof t=="string"||t instanceof String}Mt.string=BS;function wB(t){return typeof t=="number"||t instanceof Number}Mt.number=wB;function DB(t){return t instanceof Error}Mt.error=DB;function FS(t){return typeof t=="function"}Mt.func=FS;function jS(t){return Array.isArray(t)}Mt.array=jS;function CB(t){return jS(t)&&t.every(e=>BS(e))}Mt.stringArray=CB;function AB(t,e){return Array.isArray(t)&&t.every(e)}Mt.typedArray=AB;function OB(t){return t&&FS(t.then)}Mt.thenable=OB});var _o=k(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.stringArray=ir.array=ir.func=ir.error=ir.number=ir.string=ir.boolean=void 0;function IB(t){return t===!0||t===!1}ir.boolean=IB;function US(t){return typeof t=="string"||t instanceof String}ir.string=US;function MB(t){return typeof t=="number"||t instanceof Number}ir.number=MB;function xB(t){return t instanceof Error}ir.error=xB;function LB(t){return typeof t=="function"}ir.func=LB;function HS(t){return Array.isArray(t)}ir.array=HS;function qB(t){return HS(t)&&t.every(e=>US(e))}ir.stringArray=qB});var ng=k(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.Message=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var xs=_o(),Im;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Im||(ae.ErrorCodes=Im={}));var Mm=class t extends Error{constructor(e,r,n){super(r),this.code=xs.number(e)?e:Im.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ae.ResponseError=Mm;var kr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ae.ParameterStructures=kr;kr.auto=new kr("auto");kr.byPosition=new kr("byPosition");kr.byName=new kr("byName");var ft=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return kr.auto}};ae.AbstractMessageSignature=ft;var xm=class extends ft{constructor(e){super(e,0)}};ae.RequestType0=xm;var Lm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType=Lm;var qm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=qm;var $m=class extends ft{constructor(e){super(e,2)}};ae.RequestType2=$m;var Bm=class extends ft{constructor(e){super(e,3)}};ae.RequestType3=Bm;var Fm=class extends ft{constructor(e){super(e,4)}};ae.RequestType4=Fm;var jm=class extends ft{constructor(e){super(e,5)}};ae.RequestType5=jm;var Um=class extends ft{constructor(e){super(e,6)}};ae.RequestType6=Um;var Hm=class extends ft{constructor(e){super(e,7)}};ae.RequestType7=Hm;var Vm=class extends ft{constructor(e){super(e,8)}};ae.RequestType8=Vm;var zm=class extends ft{constructor(e){super(e,9)}};ae.RequestType9=zm;var Wm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Wm;var Gm=class extends ft{constructor(e){super(e,0)}};ae.NotificationType0=Gm;var Ym=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=Ym;var Km=class extends ft{constructor(e){super(e,2)}};ae.NotificationType2=Km;var Xm=class extends ft{constructor(e){super(e,3)}};ae.NotificationType3=Xm;var Jm=class extends ft{constructor(e){super(e,4)}};ae.NotificationType4=Jm;var Qm=class extends ft{constructor(e){super(e,5)}};ae.NotificationType5=Qm;var Zm=class extends ft{constructor(e){super(e,6)}};ae.NotificationType6=Zm;var eg=class extends ft{constructor(e){super(e,7)}};ae.NotificationType7=eg;var tg=class extends ft{constructor(e){super(e,8)}};ae.NotificationType8=tg;var rg=class extends ft{constructor(e){super(e,9)}};ae.NotificationType9=rg;var VS;(function(t){function e(i){let s=i;return s&&xs.string(s.method)&&(xs.string(s.id)||xs.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&xs.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(xs.string(s.id)||xs.number(s.id)||s.id===null)}t.isResponse=n})(VS||(ae.Message=VS={}))});var sg=k(Bi=>{"use strict";var zS;Object.defineProperty(Bi,"__esModule",{value:!0});Bi.LRUCache=Bi.LinkedMap=Bi.Touch=void 0;var sr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(sr||(Bi.Touch=sr={}));var Fu=class{constructor(){this[zS]="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,r=sr.None){let n=this._map.get(e);if(n)return r!==sr.None&&this.touch(n,r),n.value}set(e,r,n=sr.None){let i=this._map.get(e);if(i)i.value=r,n!==sr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case sr.None:this.addItemLast(i);break;case sr.First:this.addItemFirst(i);break;case sr.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(zS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==sr.First&&r!==sr.Last)){if(r===sr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===sr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Bi.LinkedMap=Fu;var ig=class extends Fu{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=sr.AsNew){return super.get(e,r)}peek(e){return super.get(e,sr.None)}set(e,r){return super.set(e,r,sr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Bi.LRUCache=ig});var GS=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.Disposable=void 0;var WS;(function(t){function e(r){return{dispose:r}}t.create=e})(WS||(ju.Disposable=WS={}))});var Fi=k(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});var og;function ag(){if(og===void 0)throw new Error("No runtime abstraction layer installed");return og}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");og=r}t.install=e})(ag||(ag={}));cg.default=ag});var No=k(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.Emitter=So.Event=void 0;var $B=Fi(),YS;(function(t){let e={dispose(){}};t.None=function(){return e}})(YS||(So.Event=YS={}));var lg=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)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 r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=n.length;s<o;s++)try{r.push(n[s].apply(i[s],e))}catch(a){(0,$B.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Uu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new lg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};So.Emitter=Uu;Uu._noop=function(){}});var zu=k(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.CancellationTokenSource=ko.CancellationToken=void 0;var BB=Fi(),FB=_o(),ug=No(),Hu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ug.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ug.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||FB.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Hu||(ko.CancellationToken=Hu={}));var jB=Object.freeze(function(t,e){let r=(0,BB.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Vu=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?jB:(this._emitter||(this._emitter=new ug.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},dg=class{get token(){return this._token||(this._token=new Vu),this._token}cancel(){this._token?this._token.cancel():this._token=Hu.Cancelled}dispose(){this._token?this._token instanceof Vu&&this._token.dispose():this._token=Hu.None}};ko.CancellationTokenSource=dg});var KS=k(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.SharedArrayReceiverStrategy=Ro.SharedArraySenderStrategy=void 0;var UB=zu(),ec;(function(t){t.Continue=0,t.Cancelled=1})(ec||(ec={}));var fg=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=ec.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,ec.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ro.SharedArraySenderStrategy=fg;var pg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===ec.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},hg=class{constructor(e){this.token=new pg(e)}cancel(){}dispose(){}},mg=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new UB.CancellationTokenSource:new hg(r)}};Ro.SharedArrayReceiverStrategy=mg});var yg=k(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.Semaphore=void 0;var HB=Fi(),gg=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,HB.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Wu.Semaphore=gg});var JS=k(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.ReadableStreamMessageReader=ji.AbstractMessageReader=ji.MessageReader=void 0;var vg=Fi(),Po=_o(),Tg=No(),VB=yg(),XS;(function(t){function e(r){let n=r;return n&&Po.func(n.listen)&&Po.func(n.dispose)&&Po.func(n.onError)&&Po.func(n.onClose)&&Po.func(n.onPartialMessage)}t.is=e})(XS||(ji.MessageReader=XS={}));var Gu=class{constructor(){this.errorEmitter=new Tg.Emitter,this.closeEmitter=new Tg.Emitter,this.partialMessageEmitter=new Tg.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: ${Po.string(e.message)?e.message:"unknown"}`)}};ji.AbstractMessageReader=Gu;var bg;(function(t){function e(r){let n,i,s,o=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)o.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,vg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(bg||(bg={}));var _g=class extends Gu{constructor(e,r){super(),this.readable=e,this.options=bg.fromOptions(r),this.buffer=(0,vg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new VB.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
2
+ "use strict";var bB=Object.create;var Im=Object.defineProperty;var _B=Object.getOwnPropertyDescriptor;var SB=Object.getOwnPropertyNames;var NB=Object.getPrototypeOf,kB=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),RB=(t,e)=>{for(var r in e)Im(t,r,{get:e[r],enumerable:!0})},PB=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of SB(e))!kB.call(t,i)&&i!==r&&Im(t,i,{get:()=>e[i],enumerable:!(n=_B(e,i))||n.enumerable});return t};var $=(t,e,r)=>(r=t!=null?bB(NB(t)):{},PB(e||!t||!t.__esModule?Im(r,"default",{value:t,enumerable:!0}):r,t));var Bu=k(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.thenable=Mt.typedArray=Mt.stringArray=Mt.array=Mt.func=Mt.error=Mt.number=Mt.string=Mt.boolean=void 0;function wB(t){return t===!0||t===!1}Mt.boolean=wB;function BS(t){return typeof t=="string"||t instanceof String}Mt.string=BS;function EB(t){return typeof t=="number"||t instanceof Number}Mt.number=EB;function CB(t){return t instanceof Error}Mt.error=CB;function FS(t){return typeof t=="function"}Mt.func=FS;function jS(t){return Array.isArray(t)}Mt.array=jS;function DB(t){return jS(t)&&t.every(e=>BS(e))}Mt.stringArray=DB;function AB(t,e){return Array.isArray(t)&&t.every(e)}Mt.typedArray=AB;function IB(t){return t&&FS(t.then)}Mt.thenable=IB});var _o=k(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.stringArray=ir.array=ir.func=ir.error=ir.number=ir.string=ir.boolean=void 0;function OB(t){return t===!0||t===!1}ir.boolean=OB;function US(t){return typeof t=="string"||t instanceof String}ir.string=US;function MB(t){return typeof t=="number"||t instanceof Number}ir.number=MB;function xB(t){return t instanceof Error}ir.error=xB;function LB(t){return typeof t=="function"}ir.func=LB;function HS(t){return Array.isArray(t)}ir.array=HS;function qB(t){return HS(t)&&t.every(e=>US(e))}ir.stringArray=qB});var ng=k(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.Message=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var xs=_o(),Om;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Om||(ae.ErrorCodes=Om={}));var Mm=class t extends Error{constructor(e,r,n){super(r),this.code=xs.number(e)?e:Om.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ae.ResponseError=Mm;var kr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ae.ParameterStructures=kr;kr.auto=new kr("auto");kr.byPosition=new kr("byPosition");kr.byName=new kr("byName");var ft=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return kr.auto}};ae.AbstractMessageSignature=ft;var xm=class extends ft{constructor(e){super(e,0)}};ae.RequestType0=xm;var Lm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType=Lm;var qm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=qm;var $m=class extends ft{constructor(e){super(e,2)}};ae.RequestType2=$m;var Bm=class extends ft{constructor(e){super(e,3)}};ae.RequestType3=Bm;var Fm=class extends ft{constructor(e){super(e,4)}};ae.RequestType4=Fm;var jm=class extends ft{constructor(e){super(e,5)}};ae.RequestType5=jm;var Um=class extends ft{constructor(e){super(e,6)}};ae.RequestType6=Um;var Hm=class extends ft{constructor(e){super(e,7)}};ae.RequestType7=Hm;var Vm=class extends ft{constructor(e){super(e,8)}};ae.RequestType8=Vm;var zm=class extends ft{constructor(e){super(e,9)}};ae.RequestType9=zm;var Wm=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Wm;var Gm=class extends ft{constructor(e){super(e,0)}};ae.NotificationType0=Gm;var Km=class extends ft{constructor(e,r=kr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=Km;var Ym=class extends ft{constructor(e){super(e,2)}};ae.NotificationType2=Ym;var Xm=class extends ft{constructor(e){super(e,3)}};ae.NotificationType3=Xm;var Jm=class extends ft{constructor(e){super(e,4)}};ae.NotificationType4=Jm;var Qm=class extends ft{constructor(e){super(e,5)}};ae.NotificationType5=Qm;var Zm=class extends ft{constructor(e){super(e,6)}};ae.NotificationType6=Zm;var eg=class extends ft{constructor(e){super(e,7)}};ae.NotificationType7=eg;var tg=class extends ft{constructor(e){super(e,8)}};ae.NotificationType8=tg;var rg=class extends ft{constructor(e){super(e,9)}};ae.NotificationType9=rg;var VS;(function(t){function e(i){let s=i;return s&&xs.string(s.method)&&(xs.string(s.id)||xs.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&xs.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(xs.string(s.id)||xs.number(s.id)||s.id===null)}t.isResponse=n})(VS||(ae.Message=VS={}))});var sg=k(Bi=>{"use strict";var zS;Object.defineProperty(Bi,"__esModule",{value:!0});Bi.LRUCache=Bi.LinkedMap=Bi.Touch=void 0;var sr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(sr||(Bi.Touch=sr={}));var Fu=class{constructor(){this[zS]="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,r=sr.None){let n=this._map.get(e);if(n)return r!==sr.None&&this.touch(n,r),n.value}set(e,r,n=sr.None){let i=this._map.get(e);if(i)i.value=r,n!==sr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case sr.None:this.addItemLast(i);break;case sr.First:this.addItemFirst(i);break;case sr.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(zS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==sr.First&&r!==sr.Last)){if(r===sr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===sr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Bi.LinkedMap=Fu;var ig=class extends Fu{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=sr.AsNew){return super.get(e,r)}peek(e){return super.get(e,sr.None)}set(e,r){return super.set(e,r,sr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Bi.LRUCache=ig});var GS=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.Disposable=void 0;var WS;(function(t){function e(r){return{dispose:r}}t.create=e})(WS||(ju.Disposable=WS={}))});var Fi=k(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});var og;function ag(){if(og===void 0)throw new Error("No runtime abstraction layer installed");return og}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");og=r}t.install=e})(ag||(ag={}));cg.default=ag});var No=k(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.Emitter=So.Event=void 0;var $B=Fi(),KS;(function(t){let e={dispose(){}};t.None=function(){return e}})(KS||(So.Event=KS={}));var lg=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)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 r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=n.length;s<o;s++)try{r.push(n[s].apply(i[s],e))}catch(a){(0,$B.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Uu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new lg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};So.Emitter=Uu;Uu._noop=function(){}});var zu=k(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.CancellationTokenSource=ko.CancellationToken=void 0;var BB=Fi(),FB=_o(),ug=No(),Hu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ug.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ug.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||FB.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Hu||(ko.CancellationToken=Hu={}));var jB=Object.freeze(function(t,e){let r=(0,BB.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Vu=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?jB:(this._emitter||(this._emitter=new ug.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},dg=class{get token(){return this._token||(this._token=new Vu),this._token}cancel(){this._token?this._token.cancel():this._token=Hu.Cancelled}dispose(){this._token?this._token instanceof Vu&&this._token.dispose():this._token=Hu.None}};ko.CancellationTokenSource=dg});var YS=k(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.SharedArrayReceiverStrategy=Ro.SharedArraySenderStrategy=void 0;var UB=zu(),ec;(function(t){t.Continue=0,t.Cancelled=1})(ec||(ec={}));var fg=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=ec.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,ec.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ro.SharedArraySenderStrategy=fg;var pg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===ec.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},hg=class{constructor(e){this.token=new pg(e)}cancel(){}dispose(){}},mg=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new UB.CancellationTokenSource:new hg(r)}};Ro.SharedArrayReceiverStrategy=mg});var yg=k(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.Semaphore=void 0;var HB=Fi(),gg=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,HB.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Wu.Semaphore=gg});var JS=k(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.ReadableStreamMessageReader=ji.AbstractMessageReader=ji.MessageReader=void 0;var vg=Fi(),Po=_o(),Tg=No(),VB=yg(),XS;(function(t){function e(r){let n=r;return n&&Po.func(n.listen)&&Po.func(n.dispose)&&Po.func(n.onError)&&Po.func(n.onClose)&&Po.func(n.onPartialMessage)}t.is=e})(XS||(ji.MessageReader=XS={}));var Gu=class{constructor(){this.errorEmitter=new Tg.Emitter,this.closeEmitter=new Tg.Emitter,this.partialMessageEmitter=new Tg.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: ${Po.string(e.message)?e.message:"unknown"}`)}};ji.AbstractMessageReader=Gu;var bg;(function(t){function e(r){let n,i,s,o=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)o.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,vg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(bg||(bg={}));var _g=class extends Gu{constructor(e,r){super(),this.readable=e,this.options=bg.fromOptions(r),this.buffer=(0,vg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new VB.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
3
3
  ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,vg.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ji.ReadableStreamMessageReader=_g});var rN=k(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.WriteableStreamMessageWriter=Ui.AbstractMessageWriter=Ui.MessageWriter=void 0;var QS=Fi(),tc=_o(),zB=yg(),ZS=No(),WB="Content-Length: ",eN=`\r
4
- `,tN;(function(t){function e(r){let n=r;return n&&tc.func(n.dispose)&&tc.func(n.onClose)&&tc.func(n.onError)&&tc.func(n.write)}t.is=e})(tN||(Ui.MessageWriter=tN={}));var Yu=class{constructor(){this.errorEmitter=new ZS.Emitter,this.closeEmitter=new ZS.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${tc.string(e.message)?e.message:"unknown"}`)}};Ui.AbstractMessageWriter=Yu;var Sg;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,QS.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,QS.default)().applicationJson.encoder}}t.fromOptions=e})(Sg||(Sg={}));var Ng=class extends Yu{constructor(e,r){super(),this.writable=e,this.options=Sg.fromOptions(r),this.errorCount=0,this.writeSemaphore=new zB.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(WB,n.byteLength.toString(),eN),i.push(eN),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Ui.WriteableStreamMessageWriter=Ng});var nN=k(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.AbstractMessageBuffer=void 0;var GB=13,YB=10,KB=`\r
5
- `,kg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case GB:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case YB:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=l.byteLength,n++}if(r!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(KB);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 f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}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 r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Ku.AbstractMessageBuffer=kg});var cN=k(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 iN=Fi(),bt=_o(),de=ng(),sN=sg(),rc=No(),Rg=zu(),sc;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(sc||(sc={}));var Pg;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Pg||(Te.ProgressToken=Pg={}));var nc;(function(t){t.type=new de.NotificationType("$/progress")})(nc||(nc={}));var Eg=class{constructor(){}};Te.ProgressType=Eg;var wg;(function(t){function e(r){return bt.func(r)}t.is=e})(wg||(wg={}));Te.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ze;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ze||(Te.Trace=ze={}));var oN;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(oN||(Te.TraceValues=oN={}));(function(t){function e(n){if(!bt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ze||(Te.Trace=ze={}));var Hr;(function(t){t.Text="text",t.JSON="json"})(Hr||(Te.TraceFormat=Hr={}));(function(t){function e(r){return bt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Hr||(Te.TraceFormat=Hr={}));var Dg;(function(t){t.type=new de.NotificationType("$/setTrace")})(Dg||(Te.SetTraceNotification=Dg={}));var Xu;(function(t){t.type=new de.NotificationType("$/logTrace")})(Xu||(Te.LogTraceNotification=Xu={}));var ic;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ic||(Te.ConnectionErrors=ic={}));var Eo=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Te.ConnectionError=Eo;var Cg;(function(t){function e(r){let n=r;return n&&bt.func(n.cancelUndispatched)}t.is=e})(Cg||(Te.ConnectionStrategy=Cg={}));var Ju;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Ju||(Te.IdCancellationReceiverStrategy=Ju={}));var Ag;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Ag||(Te.RequestCancellationReceiverStrategy=Ag={}));var Qu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Rg.CancellationTokenSource}});function e(r){return Ju.is(r)||Ag.is(r)}t.is=e})(Qu||(Te.CancellationReceiverStrategy=Qu={}));var Zu;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(sc.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&bt.func(n.sendCancellation)&&bt.func(n.cleanup)}t.is=e})(Zu||(Te.CancellationSenderStrategy=Zu={}));var ed;(function(t){t.Message=Object.freeze({receiver:Qu.Message,sender:Zu.Message});function e(r){let n=r;return n&&Qu.is(n.receiver)&&Zu.is(n.sender)}t.is=e})(ed||(Te.CancellationStrategy=ed={}));var td;(function(t){function e(r){let n=r;return n&&bt.func(n.handleMessage)}t.is=e})(td||(Te.MessageStrategy=td={}));var aN;(function(t){function e(r){let n=r;return n&&(ed.is(n.cancellationStrategy)||Cg.is(n.connectionStrategy)||td.is(n.messageStrategy))}t.is=e})(aN||(Te.ConnectionOptions=aN={}));var En;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(En||(En={}));function XB(t,e,r,n){let i=r!==void 0?r:Te.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,p=new Map,g,h=new sN.LinkedMap,T=new Map,S=new Set,_=new Map,v=ze.Off,R=Hr.Text,D,B=En.New,M=new rc.Emitter,F=new rc.Emitter,ge=new rc.Emitter,Je=new rc.Emitter,Ft=new rc.Emitter,Ne=n&&n.cancellationStrategy?n.cancellationStrategy:ed.Message;function Xr(P){if(P===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+P.toString()}function qi(P){return P===null?"res-unknown-"+(++a).toString():"res-"+P.toString()}function Nu(){return"not-"+(++o).toString()}function Am(P,L){de.Message.isRequest(L)?P.set(Xr(L.id),L):de.Message.isResponse(L)?P.set(qi(L.id),L):P.set(Nu(),L)}function ku(P){}function Ya(){return B===En.Listening}function Os(){return B===En.Closed}function hi(){return B===En.Disposed}function go(){(B===En.New||B===En.Listening)&&(B=En.Closed,F.fire(void 0))}function Is(P){M.fire([P,void 0,void 0])}function Ru(P){M.fire(P)}t.onClose(go),t.onError(Is),e.onClose(go),e.onError(Ru);function Ka(){g||h.size===0||(g=(0,iN.default)().timer.setImmediate(()=>{g=void 0,Pu()}))}function Xa(P){de.Message.isRequest(P)?wu(P):de.Message.isNotification(P)?Cu(P):de.Message.isResponse(P)?Du(P):yo(P)}function Pu(){if(h.size===0)return;let P=h.shift();try{let L=n?.messageStrategy;td.is(L)?L.handleMessage(P,Xa):Xa(P)}finally{Ka()}}let Eu=P=>{try{if(de.Message.isNotification(P)&&P.method===sc.type.method){let L=P.params.id,G=Xr(L),re=h.get(G);if(de.Message.isRequest(re)){let Ge=n?.connectionStrategy,dt=Ge&&Ge.cancelUndispatched?Ge.cancelUndispatched(re,ku):void 0;if(dt&&(dt.error!==void 0||dt.result!==void 0)){h.delete(G),_.delete(L),dt.id=re.id,Ms(dt,P.method,Date.now()),e.write(dt).catch(()=>i.error("Sending response for canceled message failed."));return}}let Qe=_.get(L);if(Qe!==void 0){Qe.cancel(),To(P);return}else S.add(L)}Am(h,P)}finally{Ka()}};function wu(P){if(hi())return;function L(ke,rt,je){let kt={jsonrpc:c,id:P.id};ke instanceof de.ResponseError?kt.error=ke.toJson():kt.result=ke===void 0?null:ke,Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}function G(ke,rt,je){let kt={jsonrpc:c,id:P.id,error:ke.toJson()};Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}function re(ke,rt,je){ke===void 0&&(ke=null);let kt={jsonrpc:c,id:P.id,result:ke};Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}Iu(P);let Qe=u.get(P.method),Ge,dt;Qe&&(Ge=Qe.type,dt=Qe.handler);let Tt=Date.now();if(dt||l){let ke=P.id??String(Date.now()),rt=Ju.is(Ne.receiver)?Ne.receiver.createCancellationTokenSource(ke):Ne.receiver.createCancellationTokenSource(P);P.id!==null&&S.has(P.id)&&rt.cancel(),P.id!==null&&_.set(ke,rt);try{let je;if(dt)if(P.params===void 0){if(Ge!==void 0&&Ge.numberOfParams!==0){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines ${Ge.numberOfParams} params but received none.`),P.method,Tt);return}je=dt(rt.token)}else if(Array.isArray(P.params)){if(Ge!==void 0&&Ge.parameterStructures===de.ParameterStructures.byName){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by name but received parameters by position`),P.method,Tt);return}je=dt(...P.params,rt.token)}else{if(Ge!==void 0&&Ge.parameterStructures===de.ParameterStructures.byPosition){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by position but received parameters by name`),P.method,Tt);return}je=dt(P.params,rt.token)}else l&&(je=l(P.method,P.params,rt.token));let kt=je;je?kt.then?kt.then(Vt=>{_.delete(ke),L(Vt,P.method,Tt)},Vt=>{_.delete(ke),Vt instanceof de.ResponseError?G(Vt,P.method,Tt):Vt&&bt.string(Vt.message)?G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${Vt.message}`),P.method,Tt):G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Tt)}):(_.delete(ke),L(je,P.method,Tt)):(_.delete(ke),re(je,P.method,Tt))}catch(je){_.delete(ke),je instanceof de.ResponseError?L(je,P.method,Tt):je&&bt.string(je.message)?G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${je.message}`),P.method,Tt):G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Tt)}}else G(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${P.method}`),P.method,Tt)}function Du(P){if(!hi())if(P.id===null)P.error?i.error(`Received response message without id: Error is:
7
- ${JSON.stringify(P.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let L=P.id,G=T.get(L);if(Mu(P,G),G!==void 0){T.delete(L);try{if(P.error){let re=P.error;G.reject(new de.ResponseError(re.code,re.message,re.data))}else if(P.result!==void 0)G.resolve(P.result);else throw new Error("Should never happen.")}catch(re){re.message?i.error(`Response handler '${G.method}' failed with message: ${re.message}`):i.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Cu(P){if(hi())return;let L,G;if(P.method===sc.type.method){let re=P.params.id;S.delete(re),To(P);return}else{let re=f.get(P.method);re&&(G=re.handler,L=re.type)}if(G||d)try{if(To(P),G)if(P.params===void 0)L!==void 0&&L.numberOfParams!==0&&L.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${P.method} defines ${L.numberOfParams} params but received none.`),G();else if(Array.isArray(P.params)){let re=P.params;P.method===nc.type.method&&re.length===2&&Pg.is(re[0])?G({token:re[0],value:re[1]}):(L!==void 0&&(L.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${P.method} defines parameters by name but received parameters by position`),L.numberOfParams!==P.params.length&&i.error(`Notification ${P.method} defines ${L.numberOfParams} params but received ${re.length} arguments`)),G(...re))}else L!==void 0&&L.parameterStructures===de.ParameterStructures.byPosition&&i.error(`Notification ${P.method} defines parameters by position but received parameters by name`),G(P.params);else d&&d(P.method,P.params)}catch(re){re.message?i.error(`Notification handler '${P.method}' failed with message: ${re.message}`):i.error(`Notification handler '${P.method}' failed unexpectedly.`)}else ge.fire(P)}function yo(P){if(!P){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
- ${JSON.stringify(P,null,4)}`);let L=P;if(bt.string(L.id)||bt.number(L.id)){let G=L.id,re=T.get(G);re&&re.reject(new Error("The received response has neither a result nor an error property."))}}function kn(P){if(P!=null)switch(v){case ze.Verbose:return JSON.stringify(P,null,4);case ze.Compact:return JSON.stringify(P);default:return}}function Au(P){if(!(v===ze.Off||!D))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&P.params&&(L=`Params: ${kn(P.params)}
4
+ `,tN;(function(t){function e(r){let n=r;return n&&tc.func(n.dispose)&&tc.func(n.onClose)&&tc.func(n.onError)&&tc.func(n.write)}t.is=e})(tN||(Ui.MessageWriter=tN={}));var Ku=class{constructor(){this.errorEmitter=new ZS.Emitter,this.closeEmitter=new ZS.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${tc.string(e.message)?e.message:"unknown"}`)}};Ui.AbstractMessageWriter=Ku;var Sg;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,QS.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,QS.default)().applicationJson.encoder}}t.fromOptions=e})(Sg||(Sg={}));var Ng=class extends Ku{constructor(e,r){super(),this.writable=e,this.options=Sg.fromOptions(r),this.errorCount=0,this.writeSemaphore=new zB.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(WB,n.byteLength.toString(),eN),i.push(eN),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Ui.WriteableStreamMessageWriter=Ng});var nN=k(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.AbstractMessageBuffer=void 0;var GB=13,KB=10,YB=`\r
5
+ `,kg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case GB:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case KB:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=l.byteLength,n++}if(r!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(YB);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 f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}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 r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Yu.AbstractMessageBuffer=kg});var cN=k(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 iN=Fi(),bt=_o(),de=ng(),sN=sg(),rc=No(),Rg=zu(),sc;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(sc||(sc={}));var Pg;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Pg||(Te.ProgressToken=Pg={}));var nc;(function(t){t.type=new de.NotificationType("$/progress")})(nc||(nc={}));var wg=class{constructor(){}};Te.ProgressType=wg;var Eg;(function(t){function e(r){return bt.func(r)}t.is=e})(Eg||(Eg={}));Te.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ze;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ze||(Te.Trace=ze={}));var oN;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(oN||(Te.TraceValues=oN={}));(function(t){function e(n){if(!bt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ze||(Te.Trace=ze={}));var Hr;(function(t){t.Text="text",t.JSON="json"})(Hr||(Te.TraceFormat=Hr={}));(function(t){function e(r){return bt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Hr||(Te.TraceFormat=Hr={}));var Cg;(function(t){t.type=new de.NotificationType("$/setTrace")})(Cg||(Te.SetTraceNotification=Cg={}));var Xu;(function(t){t.type=new de.NotificationType("$/logTrace")})(Xu||(Te.LogTraceNotification=Xu={}));var ic;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ic||(Te.ConnectionErrors=ic={}));var wo=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Te.ConnectionError=wo;var Dg;(function(t){function e(r){let n=r;return n&&bt.func(n.cancelUndispatched)}t.is=e})(Dg||(Te.ConnectionStrategy=Dg={}));var Ju;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Ju||(Te.IdCancellationReceiverStrategy=Ju={}));var Ag;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Ag||(Te.RequestCancellationReceiverStrategy=Ag={}));var Qu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Rg.CancellationTokenSource}});function e(r){return Ju.is(r)||Ag.is(r)}t.is=e})(Qu||(Te.CancellationReceiverStrategy=Qu={}));var Zu;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(sc.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&bt.func(n.sendCancellation)&&bt.func(n.cleanup)}t.is=e})(Zu||(Te.CancellationSenderStrategy=Zu={}));var ed;(function(t){t.Message=Object.freeze({receiver:Qu.Message,sender:Zu.Message});function e(r){let n=r;return n&&Qu.is(n.receiver)&&Zu.is(n.sender)}t.is=e})(ed||(Te.CancellationStrategy=ed={}));var td;(function(t){function e(r){let n=r;return n&&bt.func(n.handleMessage)}t.is=e})(td||(Te.MessageStrategy=td={}));var aN;(function(t){function e(r){let n=r;return n&&(ed.is(n.cancellationStrategy)||Dg.is(n.connectionStrategy)||td.is(n.messageStrategy))}t.is=e})(aN||(Te.ConnectionOptions=aN={}));var wn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(wn||(wn={}));function XB(t,e,r,n){let i=r!==void 0?r:Te.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,p=new Map,g,h=new sN.LinkedMap,T=new Map,S=new Set,_=new Map,v=ze.Off,R=Hr.Text,C,B=wn.New,M=new rc.Emitter,F=new rc.Emitter,ge=new rc.Emitter,Je=new rc.Emitter,Ft=new rc.Emitter,Ne=n&&n.cancellationStrategy?n.cancellationStrategy:ed.Message;function Xr(P){if(P===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+P.toString()}function qi(P){return P===null?"res-unknown-"+(++a).toString():"res-"+P.toString()}function Nu(){return"not-"+(++o).toString()}function Am(P,L){de.Message.isRequest(L)?P.set(Xr(L.id),L):de.Message.isResponse(L)?P.set(qi(L.id),L):P.set(Nu(),L)}function ku(P){}function Ka(){return B===wn.Listening}function Is(){return B===wn.Closed}function hi(){return B===wn.Disposed}function go(){(B===wn.New||B===wn.Listening)&&(B=wn.Closed,F.fire(void 0))}function Os(P){M.fire([P,void 0,void 0])}function Ru(P){M.fire(P)}t.onClose(go),t.onError(Os),e.onClose(go),e.onError(Ru);function Ya(){g||h.size===0||(g=(0,iN.default)().timer.setImmediate(()=>{g=void 0,Pu()}))}function Xa(P){de.Message.isRequest(P)?Eu(P):de.Message.isNotification(P)?Du(P):de.Message.isResponse(P)?Cu(P):yo(P)}function Pu(){if(h.size===0)return;let P=h.shift();try{let L=n?.messageStrategy;td.is(L)?L.handleMessage(P,Xa):Xa(P)}finally{Ya()}}let wu=P=>{try{if(de.Message.isNotification(P)&&P.method===sc.type.method){let L=P.params.id,G=Xr(L),re=h.get(G);if(de.Message.isRequest(re)){let Ge=n?.connectionStrategy,dt=Ge&&Ge.cancelUndispatched?Ge.cancelUndispatched(re,ku):void 0;if(dt&&(dt.error!==void 0||dt.result!==void 0)){h.delete(G),_.delete(L),dt.id=re.id,Ms(dt,P.method,Date.now()),e.write(dt).catch(()=>i.error("Sending response for canceled message failed."));return}}let Qe=_.get(L);if(Qe!==void 0){Qe.cancel(),To(P);return}else S.add(L)}Am(h,P)}finally{Ya()}};function Eu(P){if(hi())return;function L(ke,rt,je){let kt={jsonrpc:c,id:P.id};ke instanceof de.ResponseError?kt.error=ke.toJson():kt.result=ke===void 0?null:ke,Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}function G(ke,rt,je){let kt={jsonrpc:c,id:P.id,error:ke.toJson()};Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}function re(ke,rt,je){ke===void 0&&(ke=null);let kt={jsonrpc:c,id:P.id,result:ke};Ms(kt,rt,je),e.write(kt).catch(()=>i.error("Sending response failed."))}Ou(P);let Qe=u.get(P.method),Ge,dt;Qe&&(Ge=Qe.type,dt=Qe.handler);let Tt=Date.now();if(dt||l){let ke=P.id??String(Date.now()),rt=Ju.is(Ne.receiver)?Ne.receiver.createCancellationTokenSource(ke):Ne.receiver.createCancellationTokenSource(P);P.id!==null&&S.has(P.id)&&rt.cancel(),P.id!==null&&_.set(ke,rt);try{let je;if(dt)if(P.params===void 0){if(Ge!==void 0&&Ge.numberOfParams!==0){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines ${Ge.numberOfParams} params but received none.`),P.method,Tt);return}je=dt(rt.token)}else if(Array.isArray(P.params)){if(Ge!==void 0&&Ge.parameterStructures===de.ParameterStructures.byName){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by name but received parameters by position`),P.method,Tt);return}je=dt(...P.params,rt.token)}else{if(Ge!==void 0&&Ge.parameterStructures===de.ParameterStructures.byPosition){G(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by position but received parameters by name`),P.method,Tt);return}je=dt(P.params,rt.token)}else l&&(je=l(P.method,P.params,rt.token));let kt=je;je?kt.then?kt.then(Vt=>{_.delete(ke),L(Vt,P.method,Tt)},Vt=>{_.delete(ke),Vt instanceof de.ResponseError?G(Vt,P.method,Tt):Vt&&bt.string(Vt.message)?G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${Vt.message}`),P.method,Tt):G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Tt)}):(_.delete(ke),L(je,P.method,Tt)):(_.delete(ke),re(je,P.method,Tt))}catch(je){_.delete(ke),je instanceof de.ResponseError?L(je,P.method,Tt):je&&bt.string(je.message)?G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${je.message}`),P.method,Tt):G(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Tt)}}else G(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${P.method}`),P.method,Tt)}function Cu(P){if(!hi())if(P.id===null)P.error?i.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(P.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let L=P.id,G=T.get(L);if(Mu(P,G),G!==void 0){T.delete(L);try{if(P.error){let re=P.error;G.reject(new de.ResponseError(re.code,re.message,re.data))}else if(P.result!==void 0)G.resolve(P.result);else throw new Error("Should never happen.")}catch(re){re.message?i.error(`Response handler '${G.method}' failed with message: ${re.message}`):i.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Du(P){if(hi())return;let L,G;if(P.method===sc.type.method){let re=P.params.id;S.delete(re),To(P);return}else{let re=f.get(P.method);re&&(G=re.handler,L=re.type)}if(G||d)try{if(To(P),G)if(P.params===void 0)L!==void 0&&L.numberOfParams!==0&&L.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${P.method} defines ${L.numberOfParams} params but received none.`),G();else if(Array.isArray(P.params)){let re=P.params;P.method===nc.type.method&&re.length===2&&Pg.is(re[0])?G({token:re[0],value:re[1]}):(L!==void 0&&(L.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${P.method} defines parameters by name but received parameters by position`),L.numberOfParams!==P.params.length&&i.error(`Notification ${P.method} defines ${L.numberOfParams} params but received ${re.length} arguments`)),G(...re))}else L!==void 0&&L.parameterStructures===de.ParameterStructures.byPosition&&i.error(`Notification ${P.method} defines parameters by position but received parameters by name`),G(P.params);else d&&d(P.method,P.params)}catch(re){re.message?i.error(`Notification handler '${P.method}' failed with message: ${re.message}`):i.error(`Notification handler '${P.method}' failed unexpectedly.`)}else ge.fire(P)}function yo(P){if(!P){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(P,null,4)}`);let L=P;if(bt.string(L.id)||bt.number(L.id)){let G=L.id,re=T.get(G);re&&re.reject(new Error("The received response has neither a result nor an error property."))}}function kn(P){if(P!=null)switch(v){case ze.Verbose:return JSON.stringify(P,null,4);case ze.Compact:return JSON.stringify(P);default:return}}function Au(P){if(!(v===ze.Off||!C))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&P.params&&(L=`Params: ${kn(P.params)}
9
9
 
10
- `),D.log(`Sending request '${P.method} - (${P.id})'.`,L)}else mi("send-request",P)}function Ou(P){if(!(v===ze.Off||!D))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&(P.params?L=`Params: ${kn(P.params)}
10
+ `),C.log(`Sending request '${P.method} - (${P.id})'.`,L)}else mi("send-request",P)}function Iu(P){if(!(v===ze.Off||!C))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&(P.params?L=`Params: ${kn(P.params)}
11
11
 
12
12
  `:L=`No parameters provided.
13
13
 
14
- `),D.log(`Sending notification '${P.method}'.`,L)}else mi("send-notification",P)}function Ms(P,L,G){if(!(v===ze.Off||!D))if(R===Hr.Text){let re;(v===ze.Verbose||v===ze.Compact)&&(P.error&&P.error.data?re=`Error data: ${kn(P.error.data)}
14
+ `),C.log(`Sending notification '${P.method}'.`,L)}else mi("send-notification",P)}function Ms(P,L,G){if(!(v===ze.Off||!C))if(R===Hr.Text){let re;(v===ze.Verbose||v===ze.Compact)&&(P.error&&P.error.data?re=`Error data: ${kn(P.error.data)}
15
15
 
16
16
  `:P.result?re=`Result: ${kn(P.result)}
17
17
 
18
18
  `:P.error===void 0&&(re=`No result returned.
19
19
 
20
- `)),D.log(`Sending response '${L} - (${P.id})'. Processing request took ${Date.now()-G}ms`,re)}else mi("send-response",P)}function Iu(P){if(!(v===ze.Off||!D))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&P.params&&(L=`Params: ${kn(P.params)}
20
+ `)),C.log(`Sending response '${L} - (${P.id})'. Processing request took ${Date.now()-G}ms`,re)}else mi("send-response",P)}function Ou(P){if(!(v===ze.Off||!C))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&P.params&&(L=`Params: ${kn(P.params)}
21
21
 
22
- `),D.log(`Received request '${P.method} - (${P.id})'.`,L)}else mi("receive-request",P)}function To(P){if(!(v===ze.Off||!D||P.method===Xu.type.method))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&(P.params?L=`Params: ${kn(P.params)}
22
+ `),C.log(`Received request '${P.method} - (${P.id})'.`,L)}else mi("receive-request",P)}function To(P){if(!(v===ze.Off||!C||P.method===Xu.type.method))if(R===Hr.Text){let L;(v===ze.Verbose||v===ze.Compact)&&(P.params?L=`Params: ${kn(P.params)}
23
23
 
24
24
  `:L=`No parameters provided.
25
25
 
26
- `),D.log(`Received notification '${P.method}'.`,L)}else mi("receive-notification",P)}function Mu(P,L){if(!(v===ze.Off||!D))if(R===Hr.Text){let G;if((v===ze.Verbose||v===ze.Compact)&&(P.error&&P.error.data?G=`Error data: ${kn(P.error.data)}
26
+ `),C.log(`Received notification '${P.method}'.`,L)}else mi("receive-notification",P)}function Mu(P,L){if(!(v===ze.Off||!C))if(R===Hr.Text){let G;if((v===ze.Verbose||v===ze.Compact)&&(P.error&&P.error.data?G=`Error data: ${kn(P.error.data)}
27
27
 
28
28
  `:P.result?G=`Result: ${kn(P.result)}
29
29
 
30
30
  `:P.error===void 0&&(G=`No result returned.
31
31
 
32
- `)),L){let re=P.error?` Request failed: ${P.error.message} (${P.error.code}).`:"";D.log(`Received response '${L.method} - (${P.id})' in ${Date.now()-L.timerStart}ms.${re}`,G)}else D.log(`Received response ${P.id} without active response promise.`,G)}else mi("receive-response",P)}function mi(P,L){if(!D||v===ze.Off)return;let G={isLSPMessage:!0,type:P,message:L,timestamp:Date.now()};D.log(G)}function $i(){if(Os())throw new Eo(ic.Closed,"Connection is closed.");if(hi())throw new Eo(ic.Disposed,"Connection is disposed.")}function xu(){if(Ya())throw new Eo(ic.AlreadyListening,"Connection is already listening")}function Lu(){if(!Ya())throw new Error("Call listen() first.")}function zn(P){return P===void 0?null:P}function Ja(P){if(P!==null)return P}function Qa(P){return P!=null&&!Array.isArray(P)&&typeof P=="object"}function vo(P,L){switch(P){case de.ParameterStructures.auto:return Qa(L)?Ja(L):[zn(L)];case de.ParameterStructures.byName:if(!Qa(L))throw new Error("Received parameters by name but param is not an object literal.");return Ja(L);case de.ParameterStructures.byPosition:return[zn(L)];default:throw new Error(`Unknown parameter structure ${P.toString()}`)}}function Za(P,L){let G,re=P.numberOfParams;switch(re){case 0:G=void 0;break;case 1:G=vo(P.parameterStructures,L[0]);break;default:G=[];for(let Qe=0;Qe<L.length&&Qe<re;Qe++)G.push(zn(L[Qe]));if(L.length<re)for(let Qe=L.length;Qe<re;Qe++)G.push(null);break}return G}let gi={sendNotification:(P,...L)=>{$i();let G,re;if(bt.string(P)){G=P;let Ge=L[0],dt=0,Tt=de.ParameterStructures.auto;de.ParameterStructures.is(Ge)&&(dt=1,Tt=Ge);let ke=L.length,rt=ke-dt;switch(rt){case 0:re=void 0;break;case 1:re=vo(Tt,L[dt]);break;default:if(Tt===de.ParameterStructures.byName)throw new Error(`Received ${rt} parameters for 'by Name' notification parameter structure.`);re=L.slice(dt,ke).map(je=>zn(je));break}}else{let Ge=L;G=P.method,re=Za(P,Ge)}let Qe={jsonrpc:c,method:G,params:re};return Ou(Qe),e.write(Qe).catch(Ge=>{throw i.error("Sending notification failed."),Ge})},onNotification:(P,L)=>{$i();let G;return bt.func(P)?d=P:L&&(bt.string(P)?(G=P,f.set(P,{type:void 0,handler:L})):(G=P.method,f.set(P.method,{type:P,handler:L}))),{dispose:()=>{G!==void 0?f.delete(G):d=void 0}}},onProgress:(P,L,G)=>{if(p.has(L))throw new Error(`Progress handler for token ${L} already registered`);return p.set(L,G),{dispose:()=>{p.delete(L)}}},sendProgress:(P,L,G)=>gi.sendNotification(nc.type,{token:L,value:G}),onUnhandledProgress:Je.event,sendRequest:(P,...L)=>{$i(),Lu();let G,re,Qe;if(bt.string(P)){G=P;let ke=L[0],rt=L[L.length-1],je=0,kt=de.ParameterStructures.auto;de.ParameterStructures.is(ke)&&(je=1,kt=ke);let Vt=L.length;Rg.CancellationToken.is(rt)&&(Vt=Vt-1,Qe=rt);let Ur=Vt-je;switch(Ur){case 0:re=void 0;break;case 1:re=vo(kt,L[je]);break;default:if(kt===de.ParameterStructures.byName)throw new Error(`Received ${Ur} parameters for 'by Name' request parameter structure.`);re=L.slice(je,Vt).map(qu=>zn(qu));break}}else{let ke=L;G=P.method,re=Za(P,ke);let rt=P.numberOfParams;Qe=Rg.CancellationToken.is(ke[rt])?ke[rt]:void 0}let Ge=s++,dt;Qe&&(dt=Qe.onCancellationRequested(()=>{let ke=Ne.sender.sendCancellation(gi,Ge);return ke===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ge}`),Promise.resolve()):ke.catch(()=>{i.log(`Sending cancellation messages for id ${Ge} failed`)})}));let Tt={jsonrpc:c,id:Ge,method:G,params:re};return Au(Tt),typeof Ne.sender.enableCancellation=="function"&&Ne.sender.enableCancellation(Tt),new Promise(async(ke,rt)=>{let je=Ur=>{ke(Ur),Ne.sender.cleanup(Ge),dt?.dispose()},kt=Ur=>{rt(Ur),Ne.sender.cleanup(Ge),dt?.dispose()},Vt={method:G,timerStart:Date.now(),resolve:je,reject:kt};try{await e.write(Tt),T.set(Ge,Vt)}catch(Ur){throw i.error("Sending request failed."),Vt.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Ur.message?Ur.message:"Unknown reason")),Ur}})},onRequest:(P,L)=>{$i();let G=null;return wg.is(P)?(G=void 0,l=P):bt.string(P)?(G=null,L!==void 0&&(G=P,u.set(P,{handler:L,type:void 0}))):L!==void 0&&(G=P.method,u.set(P.method,{type:P,handler:L})),{dispose:()=>{G!==null&&(G!==void 0?u.delete(G):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(P,L,G)=>{let re=!1,Qe=Hr.Text;G!==void 0&&(bt.boolean(G)?re=G:(re=G.sendNotification||!1,Qe=G.traceFormat||Hr.Text)),v=P,R=Qe,v===ze.Off?D=void 0:D=L,re&&!Os()&&!hi()&&await gi.sendNotification(Dg.type,{value:ze.toString(P)})},onError:M.event,onClose:F.event,onUnhandledNotification:ge.event,onDispose:Ft.event,end:()=>{e.end()},dispose:()=>{if(hi())return;B=En.Disposed,Ft.fire(void 0);let P=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let L of T.values())L.reject(P);T=new Map,_=new Map,S=new Set,h=new sN.LinkedMap,bt.func(e.dispose)&&e.dispose(),bt.func(t.dispose)&&t.dispose()},listen:()=>{$i(),xu(),B=En.Listening,t.listen(Eu)},inspect:()=>{(0,iN.default)().console.log("inspect")}};return gi.onNotification(Xu.type,P=>{if(v===ze.Off||!D)return;let L=v===ze.Verbose||v===ze.Compact;D.log(P.message,L?P.verbose:void 0)}),gi.onNotification(nc.type,P=>{let L=p.get(P.token);L?L(P.value):Je.fire(P)}),gi}Te.createMessageConnection=XB});var rd=k(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.ProgressType=I.ProgressToken=I.createMessageConnection=I.NullLogger=I.ConnectionOptions=I.ConnectionStrategy=I.AbstractMessageBuffer=I.WriteableStreamMessageWriter=I.AbstractMessageWriter=I.MessageWriter=I.ReadableStreamMessageReader=I.AbstractMessageReader=I.MessageReader=I.SharedArrayReceiverStrategy=I.SharedArraySenderStrategy=I.CancellationToken=I.CancellationTokenSource=I.Emitter=I.Event=I.Disposable=I.LRUCache=I.Touch=I.LinkedMap=I.ParameterStructures=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.ErrorCodes=I.ResponseError=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType0=I.RequestType=I.Message=I.RAL=void 0;I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=void 0;var ct=ng();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return ct.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var Og=sg();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Og.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Og.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Og.Touch}});var JB=GS();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return JB.Disposable}});var lN=No();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return lN.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return lN.Emitter}});var uN=zu();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return uN.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return uN.CancellationToken}});var dN=KS();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return dN.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return dN.SharedArrayReceiverStrategy}});var Ig=JS();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return Ig.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return Ig.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ig.ReadableStreamMessageReader}});var Mg=rN();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Mg.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Mg.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Mg.WriteableStreamMessageWriter}});var QB=nN();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return QB.AbstractMessageBuffer}});var Qt=cN();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Qt.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Qt.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Qt.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Qt.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Qt.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Qt.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Qt.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Qt.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Qt.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Qt.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Qt.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Qt.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Qt.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qt.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qt.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Qt.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Qt.MessageStrategy}});var ZB=Fi();I.RAL=ZB.default});var hN=k($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});var fN=require("util"),Ti=rd(),nd=class t extends Ti.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new fN.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};nd.emptyBuffer=Buffer.allocUnsafe(0);var xg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ti.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ti.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ti.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Ti.Disposable.create(()=>this.stream.off("data",e))}},Lg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ti.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ti.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ti.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},pN=Object.freeze({messageBuffer:Object.freeze({create:t=>new nd(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new fN.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new xg(t),asWritableStream:t=>new Lg(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function qg(){return pN}(function(t){function e(){Ti.RAL.install(pN)}t.install=e})(qg||(qg={}));$g.default=qg});var $s=k(Ae=>{"use strict";var eF=Ae&&Ae.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tF=Ae&&Ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eF(e,t,r)};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 wo=hN();wo.default.install();var mN=require("path"),rF=require("os"),nF=require("crypto"),od=require("net"),Vr=rd();tF(rd(),Ae);var Bg=class extends Vr.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Vr.Disposable.create(()=>this.process.off("message",e))}};Ae.IPCMessageReader=Bg;var Fg=class extends Vr.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ae.IPCMessageWriter=Fg;var jg=class extends Vr.AbstractMessageReader{constructor(e){super(),this.onData=new Vr.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ae.PortMessageReader=jg;var Ug=class extends Vr.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ae.PortMessageWriter=Ug;var Ls=class extends Vr.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,wo.default)().stream.asReadableStream(e),r)}};Ae.SocketMessageReader=Ls;var qs=class extends Vr.WriteableStreamMessageWriter{constructor(e,r){super((0,wo.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=qs;var id=class extends Vr.ReadableStreamMessageReader{constructor(e,r){super((0,wo.default)().stream.asReadableStream(e),r)}};Ae.StreamMessageReader=id;var sd=class extends Vr.WriteableStreamMessageWriter{constructor(e,r){super((0,wo.default)().stream.asWritableStream(e),r)}};Ae.StreamMessageWriter=sd;var gN=process.env.XDG_RUNTIME_DIR,iF=new Map([["linux",107],["darwin",103]]);function sF(){let t=(0,nF.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gN?e=mN.join(gN,`vscode-ipc-${t}.sock`):e=mN.join(rF.tmpdir(),`vscode-${t}.sock`);let r=iF.get(process.platform);return r!==void 0&&e.length>r&&(0,wo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Ae.generateRandomPipeName=sF;function oF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,od.createServer)(a=>{o.close(),r([new Ls(a,e),new qs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ae.createClientPipeTransport=oF;function aF(t,e="utf-8"){let r=(0,od.createConnection)(t);return[new Ls(r,e),new qs(r,e)]}Ae.createServerPipeTransport=aF;function cF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,od.createServer)(a=>{o.close(),r([new Ls(a,e),new qs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ae.createClientSocketTransport=cF;function lF(t,e="utf-8"){let r=(0,od.createConnection)(t,"127.0.0.1");return[new Ls(r,e),new qs(r,e)]}Ae.createServerSocketTransport=lF;function uF(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function dF(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function fF(t,e,r,n){r||(r=Vr.NullLogger);let i=uF(t)?new id(t):t,s=dF(e)?new sd(e):e;return Vr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Vr.createMessageConnection)(i,s,r,n)}Ae.createMessageConnection=fF});var Hg=k((l6,yN)=>{"use strict";yN.exports=$s()});var cd=k((TN,ad)=>{(function(t){if(typeof ad=="object"&&typeof ad.exports=="object"){var e=t(require,TN);e!==void 0&&(ad.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,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 r;(function(y){function E(w){return typeof w=="string"}y.is=E})(r||(e.DocumentUri=r={}));var n;(function(y){function E(w){return typeof w=="string"}y.is=E})(n||(e.URI=n={}));var i;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647;function E(w){return typeof w=="number"&&y.MIN_VALUE<=w&&w<=y.MAX_VALUE}y.is=E})(i||(e.integer=i={}));var s;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647;function E(w){return typeof w=="number"&&y.MIN_VALUE<=w&&w<=y.MAX_VALUE}y.is=E})(s||(e.uinteger=s={}));var o;(function(y){function E(b,m){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:b,character:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}y.is=w})(o||(e.Position=o={}));var a;(function(y){function E(b,m,C,q){if(A.uinteger(b)&&A.uinteger(m)&&A.uinteger(C)&&A.uinteger(q))return{start:o.create(b,m),end:o.create(C,q)};if(o.is(b)&&o.is(m))return{start:b,end:m};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(m,", ").concat(C,", ").concat(q,"]"))}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}y.is=w})(a||(e.Range=a={}));var c;(function(y){function E(b,m){return{uri:b,range:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}y.is=w})(c||(e.Location=c={}));var l;(function(y){function E(b,m,C,q){return{targetUri:b,targetRange:m,targetSelectionRange:C,originSelectionRange:q}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.targetRange)&&A.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||A.undefined(m.originSelectionRange))}y.is=w})(l||(e.LocationLink=l={}));var u;(function(y){function E(b,m,C,q){return{red:b,green:m,blue:C,alpha:q}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.numberRange(m.red,0,1)&&A.numberRange(m.green,0,1)&&A.numberRange(m.blue,0,1)&&A.numberRange(m.alpha,0,1)}y.is=w})(u||(e.Color=u={}));var d;(function(y){function E(b,m){return{range:b,color:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}y.is=w})(d||(e.ColorInformation=d={}));var f;(function(y){function E(b,m,C){return{label:b,textEdit:m,additionalTextEdits:C}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.undefined(m.textEdit)||D.is(m))&&(A.undefined(m.additionalTextEdits)||A.typedArray(m.additionalTextEdits,D.is))}y.is=w})(f||(e.ColorPresentation=f={}));var p;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(p||(e.FoldingRangeKind=p={}));var g;(function(y){function E(b,m,C,q,ye,Rt){var at={startLine:b,endLine:m};return A.defined(C)&&(at.startCharacter=C),A.defined(q)&&(at.endCharacter=q),A.defined(ye)&&(at.kind=ye),A.defined(Rt)&&(at.collapsedText=Rt),at}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.startLine)&&A.uinteger(m.startLine)&&(A.undefined(m.startCharacter)||A.uinteger(m.startCharacter))&&(A.undefined(m.endCharacter)||A.uinteger(m.endCharacter))&&(A.undefined(m.kind)||A.string(m.kind))}y.is=w})(g||(e.FoldingRange=g={}));var h;(function(y){function E(b,m){return{location:b,message:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}y.is=w})(h||(e.DiagnosticRelatedInformation=h={}));var T;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(T||(e.DiagnosticSeverity=T={}));var S;(function(y){y.Unnecessary=1,y.Deprecated=2})(S||(e.DiagnosticTag=S={}));var _;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&A.string(b.href)}y.is=E})(_||(e.CodeDescription=_={}));var v;(function(y){function E(b,m,C,q,ye,Rt){var at={range:b,message:m};return A.defined(C)&&(at.severity=C),A.defined(q)&&(at.code=q),A.defined(ye)&&(at.source=ye),A.defined(Rt)&&(at.relatedInformation=Rt),at}y.create=E;function w(b){var m,C=b;return A.defined(C)&&a.is(C.range)&&A.string(C.message)&&(A.number(C.severity)||A.undefined(C.severity))&&(A.integer(C.code)||A.string(C.code)||A.undefined(C.code))&&(A.undefined(C.codeDescription)||A.string((m=C.codeDescription)===null||m===void 0?void 0:m.href))&&(A.string(C.source)||A.undefined(C.source))&&(A.undefined(C.relatedInformation)||A.typedArray(C.relatedInformation,h.is))}y.is=w})(v||(e.Diagnostic=v={}));var R;(function(y){function E(b,m){for(var C=[],q=2;q<arguments.length;q++)C[q-2]=arguments[q];var ye={title:b,command:m};return A.defined(C)&&C.length>0&&(ye.arguments=C),ye}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}y.is=w})(R||(e.Command=R={}));var D;(function(y){function E(C,q){return{range:C,newText:q}}y.replace=E;function w(C,q){return{range:{start:C,end:C},newText:q}}y.insert=w;function b(C){return{range:C,newText:""}}y.del=b;function m(C){var q=C;return A.objectLiteral(q)&&A.string(q.newText)&&a.is(q.range)}y.is=m})(D||(e.TextEdit=D={}));var B;(function(y){function E(b,m,C){var q={label:b};return m!==void 0&&(q.needsConfirmation=m),C!==void 0&&(q.description=C),q}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(A.string(m.description)||m.description===void 0)}y.is=w})(B||(e.ChangeAnnotation=B={}));var M;(function(y){function E(w){var b=w;return A.string(b)}y.is=E})(M||(e.ChangeAnnotationIdentifier=M={}));var F;(function(y){function E(C,q,ye){return{range:C,newText:q,annotationId:ye}}y.replace=E;function w(C,q,ye){return{range:{start:C,end:C},newText:q,annotationId:ye}}y.insert=w;function b(C,q){return{range:C,newText:"",annotationId:q}}y.del=b;function m(C){var q=C;return D.is(q)&&(B.is(q.annotationId)||M.is(q.annotationId))}y.is=m})(F||(e.AnnotatedTextEdit=F={}));var ge;(function(y){function E(b,m){return{textDocument:b,edits:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&Os.is(m.textDocument)&&Array.isArray(m.edits)}y.is=w})(ge||(e.TextDocumentEdit=ge={}));var Je;(function(y){function E(b,m,C){var q={kind:"create",uri:b};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(q.options=m),C!==void 0&&(q.annotationId=C),q}y.create=E;function w(b){var m=b;return m&&m.kind==="create"&&A.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=w})(Je||(e.CreateFile=Je={}));var Ft;(function(y){function E(b,m,C,q){var ye={kind:"rename",oldUri:b,newUri:m};return C!==void 0&&(C.overwrite!==void 0||C.ignoreIfExists!==void 0)&&(ye.options=C),q!==void 0&&(ye.annotationId=q),ye}y.create=E;function w(b){var m=b;return m&&m.kind==="rename"&&A.string(m.oldUri)&&A.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=w})(Ft||(e.RenameFile=Ft={}));var Ne;(function(y){function E(b,m,C){var q={kind:"delete",uri:b};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(q.options=m),C!==void 0&&(q.annotationId=C),q}y.create=E;function w(b){var m=b;return m&&m.kind==="delete"&&A.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||A.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||A.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=w})(Ne||(e.DeleteFile=Ne={}));var Xr;(function(y){function E(w){var b=w;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(m){return A.string(m.kind)?Je.is(m)||Ft.is(m)||Ne.is(m):ge.is(m)}))}y.is=E})(Xr||(e.WorkspaceEdit=Xr={}));var qi=function(){function y(E,w){this.edits=E,this.changeAnnotations=w}return y.prototype.insert=function(E,w,b){var m,C;if(b===void 0?m=D.insert(E,w):M.is(b)?(C=b,m=F.insert(E,w,b)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(b),m=F.insert(E,w,C)),this.edits.push(m),C!==void 0)return C},y.prototype.replace=function(E,w,b){var m,C;if(b===void 0?m=D.replace(E,w):M.is(b)?(C=b,m=F.replace(E,w,b)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(b),m=F.replace(E,w,C)),this.edits.push(m),C!==void 0)return C},y.prototype.delete=function(E,w){var b,m;if(w===void 0?b=D.del(E):M.is(w)?(m=w,b=F.del(E,w)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(w),b=F.del(E,m)),this.edits.push(b),m!==void 0)return m},y.prototype.add=function(E){this.edits.push(E)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(E){if(E===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),Nu=function(){function y(E){this._annotations=E===void 0?Object.create(null):E,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(E,w){var b;if(M.is(E)?b=E:(b=this.nextId(),w=E),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(w===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=w,this._size++,b},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),Am=function(){function y(E){var w=this;this._textEditChanges=Object.create(null),E!==void 0?(this._workspaceEdit=E,E.documentChanges?(this._changeAnnotations=new Nu(E.changeAnnotations),E.changeAnnotations=this._changeAnnotations.all(),E.documentChanges.forEach(function(b){if(ge.is(b)){var m=new qi(b.edits,w._changeAnnotations);w._textEditChanges[b.textDocument.uri]=m}})):E.changes&&Object.keys(E.changes).forEach(function(b){var m=new qi(E.changes[b]);w._textEditChanges[b]=m})):this._workspaceEdit={}}return Object.defineProperty(y.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}),y.prototype.getTextEditChange=function(E){if(Os.is(E)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:E.uri,version:E.version},b=this._textEditChanges[w.uri];if(!b){var m=[],C={textDocument:w,edits:m};this._workspaceEdit.documentChanges.push(C),b=new qi(m,this._changeAnnotations),this._textEditChanges[w.uri]=b}return b}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var b=this._textEditChanges[E];if(!b){var m=[];this._workspaceEdit.changes[E]=m,b=new qi(m),this._textEditChanges[E]=b}return b}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Nu,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(E,w,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(w)||M.is(w)?m=w:b=w;var C,q;if(m===void 0?C=Je.create(E,b):(q=M.is(m)?m:this._changeAnnotations.manage(m),C=Je.create(E,b,q)),this._workspaceEdit.documentChanges.push(C),q!==void 0)return q},y.prototype.renameFile=function(E,w,b,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var C;B.is(b)||M.is(b)?C=b:m=b;var q,ye;if(C===void 0?q=Ft.create(E,w,m):(ye=M.is(C)?C:this._changeAnnotations.manage(C),q=Ft.create(E,w,m,ye)),this._workspaceEdit.documentChanges.push(q),ye!==void 0)return ye},y.prototype.deleteFile=function(E,w,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(w)||M.is(w)?m=w:b=w;var C,q;if(m===void 0?C=Ne.create(E,b):(q=M.is(m)?m:this._changeAnnotations.manage(m),C=Ne.create(E,b,q)),this._workspaceEdit.documentChanges.push(C),q!==void 0)return q},y}();e.WorkspaceChange=Am;var ku;(function(y){function E(b){return{uri:b}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)}y.is=w})(ku||(e.TextDocumentIdentifier=ku={}));var Ya;(function(y){function E(b,m){return{uri:b,version:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}y.is=w})(Ya||(e.VersionedTextDocumentIdentifier=Ya={}));var Os;(function(y){function E(b,m){return{uri:b,version:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}y.is=w})(Os||(e.OptionalVersionedTextDocumentIdentifier=Os={}));var hi;(function(y){function E(b,m,C,q){return{uri:b,languageId:m,version:C,text:q}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}y.is=w})(hi||(e.TextDocumentItem=hi={}));var go;(function(y){y.PlainText="plaintext",y.Markdown="markdown";function E(w){var b=w;return b===y.PlainText||b===y.Markdown}y.is=E})(go||(e.MarkupKind=go={}));var Is;(function(y){function E(w){var b=w;return A.objectLiteral(w)&&go.is(b.kind)&&A.string(b.value)}y.is=E})(Is||(e.MarkupContent=Is={}));var Ru;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(Ru||(e.CompletionItemKind=Ru={}));var Ka;(function(y){y.PlainText=1,y.Snippet=2})(Ka||(e.InsertTextFormat=Ka={}));var Xa;(function(y){y.Deprecated=1})(Xa||(e.CompletionItemTag=Xa={}));var Pu;(function(y){function E(b,m,C){return{newText:b,insert:m,replace:C}}y.create=E;function w(b){var m=b;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}y.is=w})(Pu||(e.InsertReplaceEdit=Pu={}));var Eu;(function(y){y.asIs=1,y.adjustIndentation=2})(Eu||(e.InsertTextMode=Eu={}));var wu;(function(y){function E(w){var b=w;return b&&(A.string(b.detail)||b.detail===void 0)&&(A.string(b.description)||b.description===void 0)}y.is=E})(wu||(e.CompletionItemLabelDetails=wu={}));var Du;(function(y){function E(w){return{label:w}}y.create=E})(Du||(e.CompletionItem=Du={}));var Cu;(function(y){function E(w,b){return{items:w||[],isIncomplete:!!b}}y.create=E})(Cu||(e.CompletionList=Cu={}));var yo;(function(y){function E(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=E;function w(b){var m=b;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}y.is=w})(yo||(e.MarkedString=yo={}));var kn;(function(y){function E(w){var b=w;return!!b&&A.objectLiteral(b)&&(Is.is(b.contents)||yo.is(b.contents)||A.typedArray(b.contents,yo.is))&&(w.range===void 0||a.is(w.range))}y.is=E})(kn||(e.Hover=kn={}));var Au;(function(y){function E(w,b){return b?{label:w,documentation:b}:{label:w}}y.create=E})(Au||(e.ParameterInformation=Au={}));var Ou;(function(y){function E(w,b){for(var m=[],C=2;C<arguments.length;C++)m[C-2]=arguments[C];var q={label:w};return A.defined(b)&&(q.documentation=b),A.defined(m)?q.parameters=m:q.parameters=[],q}y.create=E})(Ou||(e.SignatureInformation=Ou={}));var Ms;(function(y){y.Text=1,y.Read=2,y.Write=3})(Ms||(e.DocumentHighlightKind=Ms={}));var Iu;(function(y){function E(w,b){var m={range:w};return A.number(b)&&(m.kind=b),m}y.create=E})(Iu||(e.DocumentHighlight=Iu={}));var To;(function(y){y.File=1,y.Module=2,y.Namespace=3,y.Package=4,y.Class=5,y.Method=6,y.Property=7,y.Field=8,y.Constructor=9,y.Enum=10,y.Interface=11,y.Function=12,y.Variable=13,y.Constant=14,y.String=15,y.Number=16,y.Boolean=17,y.Array=18,y.Object=19,y.Key=20,y.Null=21,y.EnumMember=22,y.Struct=23,y.Event=24,y.Operator=25,y.TypeParameter=26})(To||(e.SymbolKind=To={}));var Mu;(function(y){y.Deprecated=1})(Mu||(e.SymbolTag=Mu={}));var mi;(function(y){function E(w,b,m,C,q){var ye={name:w,kind:b,location:{uri:C,range:m}};return q&&(ye.containerName=q),ye}y.create=E})(mi||(e.SymbolInformation=mi={}));var $i;(function(y){function E(w,b,m,C){return C!==void 0?{name:w,kind:b,location:{uri:m,range:C}}:{name:w,kind:b,location:{uri:m}}}y.create=E})($i||(e.WorkspaceSymbol=$i={}));var xu;(function(y){function E(b,m,C,q,ye,Rt){var at={name:b,detail:m,kind:C,range:q,selectionRange:ye};return Rt!==void 0&&(at.children=Rt),at}y.create=E;function w(b){var m=b;return m&&A.string(m.name)&&A.number(m.kind)&&a.is(m.range)&&a.is(m.selectionRange)&&(m.detail===void 0||A.string(m.detail))&&(m.deprecated===void 0||A.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}y.is=w})(xu||(e.DocumentSymbol=xu={}));var Lu;(function(y){y.Empty="",y.QuickFix="quickfix",y.Refactor="refactor",y.RefactorExtract="refactor.extract",y.RefactorInline="refactor.inline",y.RefactorRewrite="refactor.rewrite",y.Source="source",y.SourceOrganizeImports="source.organizeImports",y.SourceFixAll="source.fixAll"})(Lu||(e.CodeActionKind=Lu={}));var zn;(function(y){y.Invoked=1,y.Automatic=2})(zn||(e.CodeActionTriggerKind=zn={}));var Ja;(function(y){function E(b,m,C){var q={diagnostics:b};return m!=null&&(q.only=m),C!=null&&(q.triggerKind=C),q}y.create=E;function w(b){var m=b;return A.defined(m)&&A.typedArray(m.diagnostics,v.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===zn.Invoked||m.triggerKind===zn.Automatic)}y.is=w})(Ja||(e.CodeActionContext=Ja={}));var Qa;(function(y){function E(b,m,C){var q={title:b},ye=!0;return typeof m=="string"?(ye=!1,q.kind=m):R.is(m)?q.command=m:q.edit=m,ye&&C!==void 0&&(q.kind=C),q}y.create=E;function w(b){var m=b;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,v.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||R.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Xr.is(m.edit))}y.is=w})(Qa||(e.CodeAction=Qa={}));var vo;(function(y){function E(b,m){var C={range:b};return A.defined(m)&&(C.data=m),C}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||R.is(m.command))}y.is=w})(vo||(e.CodeLens=vo={}));var Za;(function(y){function E(b,m){return{tabSize:b,insertSpaces:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}y.is=w})(Za||(e.FormattingOptions=Za={}));var gi;(function(y){function E(b,m,C){return{range:b,target:m,data:C}}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}y.is=w})(gi||(e.DocumentLink=gi={}));var P;(function(y){function E(b,m){return{range:b,parent:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||y.is(m.parent))}y.is=w})(P||(e.SelectionRange=P={}));var L;(function(y){y.namespace="namespace",y.type="type",y.class="class",y.enum="enum",y.interface="interface",y.struct="struct",y.typeParameter="typeParameter",y.parameter="parameter",y.variable="variable",y.property="property",y.enumMember="enumMember",y.event="event",y.function="function",y.method="method",y.macro="macro",y.keyword="keyword",y.modifier="modifier",y.comment="comment",y.string="string",y.number="number",y.regexp="regexp",y.operator="operator",y.decorator="decorator"})(L||(e.SemanticTokenTypes=L={}));var G;(function(y){y.declaration="declaration",y.definition="definition",y.readonly="readonly",y.static="static",y.deprecated="deprecated",y.abstract="abstract",y.async="async",y.modification="modification",y.documentation="documentation",y.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var re;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}y.is=E})(re||(e.SemanticTokens=re={}));var Qe;(function(y){function E(b,m){return{range:b,text:m}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&A.string(m.text)}y.is=w})(Qe||(e.InlineValueText=Qe={}));var Ge;(function(y){function E(b,m,C){return{range:b,variableName:m,caseSensitiveLookup:C}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}y.is=w})(Ge||(e.InlineValueVariableLookup=Ge={}));var dt;(function(y){function E(b,m){return{range:b,expression:m}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}y.is=w})(dt||(e.InlineValueEvaluatableExpression=dt={}));var Tt;(function(y){function E(b,m){return{frameId:b,stoppedLocation:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(b.stoppedLocation)}y.is=w})(Tt||(e.InlineValueContext=Tt={}));var ke;(function(y){y.Type=1,y.Parameter=2;function E(w){return w===1||w===2}y.is=E})(ke||(e.InlayHintKind=ke={}));var rt;(function(y){function E(b){return{value:b}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||Is.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||R.is(m.command))}y.is=w})(rt||(e.InlayHintLabelPart=rt={}));var je;(function(y){function E(b,m,C){var q={position:b,label:m};return C!==void 0&&(q.kind=C),q}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,rt.is))&&(m.kind===void 0||ke.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,D.is)&&(m.tooltip===void 0||A.string(m.tooltip)||Is.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}y.is=w})(je||(e.InlayHint=je={}));var kt;(function(y){function E(w){return{kind:"snippet",value:w}}y.createSnippet=E})(kt||(e.StringValue=kt={}));var Vt;(function(y){function E(w,b,m,C){return{insertText:w,filterText:b,range:m,command:C}}y.create=E})(Vt||(e.InlineCompletionItem=Vt={}));var Ur;(function(y){function E(w){return{items:w}}y.create=E})(Ur||(e.InlineCompletionList=Ur={}));var qu;(function(y){y.Invoked=0,y.Automatic=1})(qu||(e.InlineCompletionTriggerKind=qu={}));var MS;(function(y){function E(w,b){return{range:w,text:b}}y.create=E})(MS||(e.SelectedCompletionInfo=MS={}));var xS;(function(y){function E(w,b){return{triggerKind:w,selectedCompletionInfo:b}}y.create=E})(xS||(e.InlineCompletionContext=xS={}));var LS;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&n.is(b.uri)&&A.string(b.name)}y.is=E})(LS||(e.WorkspaceFolder=LS={})),e.EOL=[`
32
+ `)),L){let re=P.error?` Request failed: ${P.error.message} (${P.error.code}).`:"";C.log(`Received response '${L.method} - (${P.id})' in ${Date.now()-L.timerStart}ms.${re}`,G)}else C.log(`Received response ${P.id} without active response promise.`,G)}else mi("receive-response",P)}function mi(P,L){if(!C||v===ze.Off)return;let G={isLSPMessage:!0,type:P,message:L,timestamp:Date.now()};C.log(G)}function $i(){if(Is())throw new wo(ic.Closed,"Connection is closed.");if(hi())throw new wo(ic.Disposed,"Connection is disposed.")}function xu(){if(Ka())throw new wo(ic.AlreadyListening,"Connection is already listening")}function Lu(){if(!Ka())throw new Error("Call listen() first.")}function zn(P){return P===void 0?null:P}function Ja(P){if(P!==null)return P}function Qa(P){return P!=null&&!Array.isArray(P)&&typeof P=="object"}function vo(P,L){switch(P){case de.ParameterStructures.auto:return Qa(L)?Ja(L):[zn(L)];case de.ParameterStructures.byName:if(!Qa(L))throw new Error("Received parameters by name but param is not an object literal.");return Ja(L);case de.ParameterStructures.byPosition:return[zn(L)];default:throw new Error(`Unknown parameter structure ${P.toString()}`)}}function Za(P,L){let G,re=P.numberOfParams;switch(re){case 0:G=void 0;break;case 1:G=vo(P.parameterStructures,L[0]);break;default:G=[];for(let Qe=0;Qe<L.length&&Qe<re;Qe++)G.push(zn(L[Qe]));if(L.length<re)for(let Qe=L.length;Qe<re;Qe++)G.push(null);break}return G}let gi={sendNotification:(P,...L)=>{$i();let G,re;if(bt.string(P)){G=P;let Ge=L[0],dt=0,Tt=de.ParameterStructures.auto;de.ParameterStructures.is(Ge)&&(dt=1,Tt=Ge);let ke=L.length,rt=ke-dt;switch(rt){case 0:re=void 0;break;case 1:re=vo(Tt,L[dt]);break;default:if(Tt===de.ParameterStructures.byName)throw new Error(`Received ${rt} parameters for 'by Name' notification parameter structure.`);re=L.slice(dt,ke).map(je=>zn(je));break}}else{let Ge=L;G=P.method,re=Za(P,Ge)}let Qe={jsonrpc:c,method:G,params:re};return Iu(Qe),e.write(Qe).catch(Ge=>{throw i.error("Sending notification failed."),Ge})},onNotification:(P,L)=>{$i();let G;return bt.func(P)?d=P:L&&(bt.string(P)?(G=P,f.set(P,{type:void 0,handler:L})):(G=P.method,f.set(P.method,{type:P,handler:L}))),{dispose:()=>{G!==void 0?f.delete(G):d=void 0}}},onProgress:(P,L,G)=>{if(p.has(L))throw new Error(`Progress handler for token ${L} already registered`);return p.set(L,G),{dispose:()=>{p.delete(L)}}},sendProgress:(P,L,G)=>gi.sendNotification(nc.type,{token:L,value:G}),onUnhandledProgress:Je.event,sendRequest:(P,...L)=>{$i(),Lu();let G,re,Qe;if(bt.string(P)){G=P;let ke=L[0],rt=L[L.length-1],je=0,kt=de.ParameterStructures.auto;de.ParameterStructures.is(ke)&&(je=1,kt=ke);let Vt=L.length;Rg.CancellationToken.is(rt)&&(Vt=Vt-1,Qe=rt);let Ur=Vt-je;switch(Ur){case 0:re=void 0;break;case 1:re=vo(kt,L[je]);break;default:if(kt===de.ParameterStructures.byName)throw new Error(`Received ${Ur} parameters for 'by Name' request parameter structure.`);re=L.slice(je,Vt).map(qu=>zn(qu));break}}else{let ke=L;G=P.method,re=Za(P,ke);let rt=P.numberOfParams;Qe=Rg.CancellationToken.is(ke[rt])?ke[rt]:void 0}let Ge=s++,dt;Qe&&(dt=Qe.onCancellationRequested(()=>{let ke=Ne.sender.sendCancellation(gi,Ge);return ke===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ge}`),Promise.resolve()):ke.catch(()=>{i.log(`Sending cancellation messages for id ${Ge} failed`)})}));let Tt={jsonrpc:c,id:Ge,method:G,params:re};return Au(Tt),typeof Ne.sender.enableCancellation=="function"&&Ne.sender.enableCancellation(Tt),new Promise(async(ke,rt)=>{let je=Ur=>{ke(Ur),Ne.sender.cleanup(Ge),dt?.dispose()},kt=Ur=>{rt(Ur),Ne.sender.cleanup(Ge),dt?.dispose()},Vt={method:G,timerStart:Date.now(),resolve:je,reject:kt};try{await e.write(Tt),T.set(Ge,Vt)}catch(Ur){throw i.error("Sending request failed."),Vt.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Ur.message?Ur.message:"Unknown reason")),Ur}})},onRequest:(P,L)=>{$i();let G=null;return Eg.is(P)?(G=void 0,l=P):bt.string(P)?(G=null,L!==void 0&&(G=P,u.set(P,{handler:L,type:void 0}))):L!==void 0&&(G=P.method,u.set(P.method,{type:P,handler:L})),{dispose:()=>{G!==null&&(G!==void 0?u.delete(G):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(P,L,G)=>{let re=!1,Qe=Hr.Text;G!==void 0&&(bt.boolean(G)?re=G:(re=G.sendNotification||!1,Qe=G.traceFormat||Hr.Text)),v=P,R=Qe,v===ze.Off?C=void 0:C=L,re&&!Is()&&!hi()&&await gi.sendNotification(Cg.type,{value:ze.toString(P)})},onError:M.event,onClose:F.event,onUnhandledNotification:ge.event,onDispose:Ft.event,end:()=>{e.end()},dispose:()=>{if(hi())return;B=wn.Disposed,Ft.fire(void 0);let P=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let L of T.values())L.reject(P);T=new Map,_=new Map,S=new Set,h=new sN.LinkedMap,bt.func(e.dispose)&&e.dispose(),bt.func(t.dispose)&&t.dispose()},listen:()=>{$i(),xu(),B=wn.Listening,t.listen(wu)},inspect:()=>{(0,iN.default)().console.log("inspect")}};return gi.onNotification(Xu.type,P=>{if(v===ze.Off||!C)return;let L=v===ze.Verbose||v===ze.Compact;C.log(P.message,L?P.verbose:void 0)}),gi.onNotification(nc.type,P=>{let L=p.get(P.token);L?L(P.value):Je.fire(P)}),gi}Te.createMessageConnection=XB});var rd=k(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 ct=ng();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return ct.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var Ig=sg();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return Ig.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return Ig.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return Ig.Touch}});var JB=GS();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return JB.Disposable}});var lN=No();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return lN.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return lN.Emitter}});var uN=zu();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return uN.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return uN.CancellationToken}});var dN=YS();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return dN.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return dN.SharedArrayReceiverStrategy}});var Og=JS();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return Og.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return Og.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Og.ReadableStreamMessageReader}});var Mg=rN();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return Mg.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return Mg.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Mg.WriteableStreamMessageWriter}});var QB=nN();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return QB.AbstractMessageBuffer}});var Qt=cN();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return Qt.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return Qt.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return Qt.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return Qt.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return Qt.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return Qt.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return Qt.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return Qt.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return Qt.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return Qt.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return Qt.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return Qt.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return Qt.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qt.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qt.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return Qt.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return Qt.MessageStrategy}});var ZB=Fi();O.RAL=ZB.default});var hN=k($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});var fN=require("util"),Ti=rd(),nd=class t extends Ti.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new fN.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};nd.emptyBuffer=Buffer.allocUnsafe(0);var xg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ti.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ti.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ti.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Ti.Disposable.create(()=>this.stream.off("data",e))}},Lg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ti.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ti.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ti.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},pN=Object.freeze({messageBuffer:Object.freeze({create:t=>new nd(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new fN.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new xg(t),asWritableStream:t=>new Lg(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function qg(){return pN}(function(t){function e(){Ti.RAL.install(pN)}t.install=e})(qg||(qg={}));$g.default=qg});var $s=k(Ae=>{"use strict";var eF=Ae&&Ae.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tF=Ae&&Ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eF(e,t,r)};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 Eo=hN();Eo.default.install();var mN=require("path"),rF=require("os"),nF=require("crypto"),od=require("net"),Vr=rd();tF(rd(),Ae);var Bg=class extends Vr.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Vr.Disposable.create(()=>this.process.off("message",e))}};Ae.IPCMessageReader=Bg;var Fg=class extends Vr.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ae.IPCMessageWriter=Fg;var jg=class extends Vr.AbstractMessageReader{constructor(e){super(),this.onData=new Vr.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ae.PortMessageReader=jg;var Ug=class extends Vr.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ae.PortMessageWriter=Ug;var Ls=class extends Vr.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,Eo.default)().stream.asReadableStream(e),r)}};Ae.SocketMessageReader=Ls;var qs=class extends Vr.WriteableStreamMessageWriter{constructor(e,r){super((0,Eo.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=qs;var id=class extends Vr.ReadableStreamMessageReader{constructor(e,r){super((0,Eo.default)().stream.asReadableStream(e),r)}};Ae.StreamMessageReader=id;var sd=class extends Vr.WriteableStreamMessageWriter{constructor(e,r){super((0,Eo.default)().stream.asWritableStream(e),r)}};Ae.StreamMessageWriter=sd;var gN=process.env.XDG_RUNTIME_DIR,iF=new Map([["linux",107],["darwin",103]]);function sF(){let t=(0,nF.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gN?e=mN.join(gN,`vscode-ipc-${t}.sock`):e=mN.join(rF.tmpdir(),`vscode-${t}.sock`);let r=iF.get(process.platform);return r!==void 0&&e.length>r&&(0,Eo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Ae.generateRandomPipeName=sF;function oF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,od.createServer)(a=>{o.close(),r([new Ls(a,e),new qs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ae.createClientPipeTransport=oF;function aF(t,e="utf-8"){let r=(0,od.createConnection)(t);return[new Ls(r,e),new qs(r,e)]}Ae.createServerPipeTransport=aF;function cF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,od.createServer)(a=>{o.close(),r([new Ls(a,e),new qs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ae.createClientSocketTransport=cF;function lF(t,e="utf-8"){let r=(0,od.createConnection)(t,"127.0.0.1");return[new Ls(r,e),new qs(r,e)]}Ae.createServerSocketTransport=lF;function uF(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function dF(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function fF(t,e,r,n){r||(r=Vr.NullLogger);let i=uF(t)?new id(t):t,s=dF(e)?new sd(e):e;return Vr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Vr.createMessageConnection)(i,s,r,n)}Ae.createMessageConnection=fF});var Hg=k((l6,yN)=>{"use strict";yN.exports=$s()});var cd=k((TN,ad)=>{(function(t){if(typeof ad=="object"&&typeof ad.exports=="object"){var e=t(require,TN);e!==void 0&&(ad.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,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 r;(function(y){function w(E){return typeof E=="string"}y.is=w})(r||(e.DocumentUri=r={}));var n;(function(y){function w(E){return typeof E=="string"}y.is=w})(n||(e.URI=n={}));var i;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647;function w(E){return typeof E=="number"&&y.MIN_VALUE<=E&&E<=y.MAX_VALUE}y.is=w})(i||(e.integer=i={}));var s;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647;function w(E){return typeof E=="number"&&y.MIN_VALUE<=E&&E<=y.MAX_VALUE}y.is=w})(s||(e.uinteger=s={}));var o;(function(y){function w(b,m){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:b,character:m}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}y.is=E})(o||(e.Position=o={}));var a;(function(y){function w(b,m,D,q){if(A.uinteger(b)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(q))return{start:o.create(b,m),end:o.create(D,q)};if(o.is(b)&&o.is(m))return{start:b,end:m};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(m,", ").concat(D,", ").concat(q,"]"))}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}y.is=E})(a||(e.Range=a={}));var c;(function(y){function w(b,m){return{uri:b,range:m}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}y.is=E})(c||(e.Location=c={}));var l;(function(y){function w(b,m,D,q){return{targetUri:b,targetRange:m,targetSelectionRange:D,originSelectionRange:q}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&a.is(m.targetRange)&&A.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||A.undefined(m.originSelectionRange))}y.is=E})(l||(e.LocationLink=l={}));var u;(function(y){function w(b,m,D,q){return{red:b,green:m,blue:D,alpha:q}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&A.numberRange(m.red,0,1)&&A.numberRange(m.green,0,1)&&A.numberRange(m.blue,0,1)&&A.numberRange(m.alpha,0,1)}y.is=E})(u||(e.Color=u={}));var d;(function(y){function w(b,m){return{range:b,color:m}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}y.is=E})(d||(e.ColorInformation=d={}));var f;(function(y){function w(b,m,D){return{label:b,textEdit:m,additionalTextEdits:D}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.undefined(m.textEdit)||C.is(m))&&(A.undefined(m.additionalTextEdits)||A.typedArray(m.additionalTextEdits,C.is))}y.is=E})(f||(e.ColorPresentation=f={}));var p;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(p||(e.FoldingRangeKind=p={}));var g;(function(y){function w(b,m,D,q,ye,Rt){var at={startLine:b,endLine:m};return A.defined(D)&&(at.startCharacter=D),A.defined(q)&&(at.endCharacter=q),A.defined(ye)&&(at.kind=ye),A.defined(Rt)&&(at.collapsedText=Rt),at}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.startLine)&&A.uinteger(m.startLine)&&(A.undefined(m.startCharacter)||A.uinteger(m.startCharacter))&&(A.undefined(m.endCharacter)||A.uinteger(m.endCharacter))&&(A.undefined(m.kind)||A.string(m.kind))}y.is=E})(g||(e.FoldingRange=g={}));var h;(function(y){function w(b,m){return{location:b,message:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}y.is=E})(h||(e.DiagnosticRelatedInformation=h={}));var T;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(T||(e.DiagnosticSeverity=T={}));var S;(function(y){y.Unnecessary=1,y.Deprecated=2})(S||(e.DiagnosticTag=S={}));var _;(function(y){function w(E){var b=E;return A.objectLiteral(b)&&A.string(b.href)}y.is=w})(_||(e.CodeDescription=_={}));var v;(function(y){function w(b,m,D,q,ye,Rt){var at={range:b,message:m};return A.defined(D)&&(at.severity=D),A.defined(q)&&(at.code=q),A.defined(ye)&&(at.source=ye),A.defined(Rt)&&(at.relatedInformation=Rt),at}y.create=w;function E(b){var m,D=b;return A.defined(D)&&a.is(D.range)&&A.string(D.message)&&(A.number(D.severity)||A.undefined(D.severity))&&(A.integer(D.code)||A.string(D.code)||A.undefined(D.code))&&(A.undefined(D.codeDescription)||A.string((m=D.codeDescription)===null||m===void 0?void 0:m.href))&&(A.string(D.source)||A.undefined(D.source))&&(A.undefined(D.relatedInformation)||A.typedArray(D.relatedInformation,h.is))}y.is=E})(v||(e.Diagnostic=v={}));var R;(function(y){function w(b,m){for(var D=[],q=2;q<arguments.length;q++)D[q-2]=arguments[q];var ye={title:b,command:m};return A.defined(D)&&D.length>0&&(ye.arguments=D),ye}y.create=w;function E(b){var m=b;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}y.is=E})(R||(e.Command=R={}));var C;(function(y){function w(D,q){return{range:D,newText:q}}y.replace=w;function E(D,q){return{range:{start:D,end:D},newText:q}}y.insert=E;function b(D){return{range:D,newText:""}}y.del=b;function m(D){var q=D;return A.objectLiteral(q)&&A.string(q.newText)&&a.is(q.range)}y.is=m})(C||(e.TextEdit=C={}));var B;(function(y){function w(b,m,D){var q={label:b};return m!==void 0&&(q.needsConfirmation=m),D!==void 0&&(q.description=D),q}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(A.string(m.description)||m.description===void 0)}y.is=E})(B||(e.ChangeAnnotation=B={}));var M;(function(y){function w(E){var b=E;return A.string(b)}y.is=w})(M||(e.ChangeAnnotationIdentifier=M={}));var F;(function(y){function w(D,q,ye){return{range:D,newText:q,annotationId:ye}}y.replace=w;function E(D,q,ye){return{range:{start:D,end:D},newText:q,annotationId:ye}}y.insert=E;function b(D,q){return{range:D,newText:"",annotationId:q}}y.del=b;function m(D){var q=D;return C.is(q)&&(B.is(q.annotationId)||M.is(q.annotationId))}y.is=m})(F||(e.AnnotatedTextEdit=F={}));var ge;(function(y){function w(b,m){return{textDocument:b,edits:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&Is.is(m.textDocument)&&Array.isArray(m.edits)}y.is=E})(ge||(e.TextDocumentEdit=ge={}));var Je;(function(y){function w(b,m,D){var q={kind:"create",uri:b};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(q.options=m),D!==void 0&&(q.annotationId=D),q}y.create=w;function E(b){var m=b;return m&&m.kind==="create"&&A.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=E})(Je||(e.CreateFile=Je={}));var Ft;(function(y){function w(b,m,D,q){var ye={kind:"rename",oldUri:b,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ye.options=D),q!==void 0&&(ye.annotationId=q),ye}y.create=w;function E(b){var m=b;return m&&m.kind==="rename"&&A.string(m.oldUri)&&A.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=E})(Ft||(e.RenameFile=Ft={}));var Ne;(function(y){function w(b,m,D){var q={kind:"delete",uri:b};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(q.options=m),D!==void 0&&(q.annotationId=D),q}y.create=w;function E(b){var m=b;return m&&m.kind==="delete"&&A.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||A.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||A.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||M.is(m.annotationId))}y.is=E})(Ne||(e.DeleteFile=Ne={}));var Xr;(function(y){function w(E){var b=E;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(m){return A.string(m.kind)?Je.is(m)||Ft.is(m)||Ne.is(m):ge.is(m)}))}y.is=w})(Xr||(e.WorkspaceEdit=Xr={}));var qi=function(){function y(w,E){this.edits=w,this.changeAnnotations=E}return y.prototype.insert=function(w,E,b){var m,D;if(b===void 0?m=C.insert(w,E):M.is(b)?(D=b,m=F.insert(w,E,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=F.insert(w,E,D)),this.edits.push(m),D!==void 0)return D},y.prototype.replace=function(w,E,b){var m,D;if(b===void 0?m=C.replace(w,E):M.is(b)?(D=b,m=F.replace(w,E,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=F.replace(w,E,D)),this.edits.push(m),D!==void 0)return D},y.prototype.delete=function(w,E){var b,m;if(E===void 0?b=C.del(w):M.is(E)?(m=E,b=F.del(w,E)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(E),b=F.del(w,m)),this.edits.push(b),m!==void 0)return m},y.prototype.add=function(w){this.edits.push(w)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(w){if(w===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),Nu=function(){function y(w){this._annotations=w===void 0?Object.create(null):w,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(w,E){var b;if(M.is(w)?b=w:(b=this.nextId(),E=w),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=E,this._size++,b},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),Am=function(){function y(w){var E=this;this._textEditChanges=Object.create(null),w!==void 0?(this._workspaceEdit=w,w.documentChanges?(this._changeAnnotations=new Nu(w.changeAnnotations),w.changeAnnotations=this._changeAnnotations.all(),w.documentChanges.forEach(function(b){if(ge.is(b)){var m=new qi(b.edits,E._changeAnnotations);E._textEditChanges[b.textDocument.uri]=m}})):w.changes&&Object.keys(w.changes).forEach(function(b){var m=new qi(w.changes[b]);E._textEditChanges[b]=m})):this._workspaceEdit={}}return Object.defineProperty(y.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}),y.prototype.getTextEditChange=function(w){if(Is.is(w)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:w.uri,version:w.version},b=this._textEditChanges[E.uri];if(!b){var m=[],D={textDocument:E,edits:m};this._workspaceEdit.documentChanges.push(D),b=new qi(m,this._changeAnnotations),this._textEditChanges[E.uri]=b}return b}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var b=this._textEditChanges[w];if(!b){var m=[];this._workspaceEdit.changes[w]=m,b=new qi(m),this._textEditChanges[w]=b}return b}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Nu,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(w,E,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(E)||M.is(E)?m=E:b=E;var D,q;if(m===void 0?D=Je.create(w,b):(q=M.is(m)?m:this._changeAnnotations.manage(m),D=Je.create(w,b,q)),this._workspaceEdit.documentChanges.push(D),q!==void 0)return q},y.prototype.renameFile=function(w,E,b,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;B.is(b)||M.is(b)?D=b:m=b;var q,ye;if(D===void 0?q=Ft.create(w,E,m):(ye=M.is(D)?D:this._changeAnnotations.manage(D),q=Ft.create(w,E,m,ye)),this._workspaceEdit.documentChanges.push(q),ye!==void 0)return ye},y.prototype.deleteFile=function(w,E,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(E)||M.is(E)?m=E:b=E;var D,q;if(m===void 0?D=Ne.create(w,b):(q=M.is(m)?m:this._changeAnnotations.manage(m),D=Ne.create(w,b,q)),this._workspaceEdit.documentChanges.push(D),q!==void 0)return q},y}();e.WorkspaceChange=Am;var ku;(function(y){function w(b){return{uri:b}}y.create=w;function E(b){var m=b;return A.defined(m)&&A.string(m.uri)}y.is=E})(ku||(e.TextDocumentIdentifier=ku={}));var Ka;(function(y){function w(b,m){return{uri:b,version:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}y.is=E})(Ka||(e.VersionedTextDocumentIdentifier=Ka={}));var Is;(function(y){function w(b,m){return{uri:b,version:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}y.is=E})(Is||(e.OptionalVersionedTextDocumentIdentifier=Is={}));var hi;(function(y){function w(b,m,D,q){return{uri:b,languageId:m,version:D,text:q}}y.create=w;function E(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}y.is=E})(hi||(e.TextDocumentItem=hi={}));var go;(function(y){y.PlainText="plaintext",y.Markdown="markdown";function w(E){var b=E;return b===y.PlainText||b===y.Markdown}y.is=w})(go||(e.MarkupKind=go={}));var Os;(function(y){function w(E){var b=E;return A.objectLiteral(E)&&go.is(b.kind)&&A.string(b.value)}y.is=w})(Os||(e.MarkupContent=Os={}));var Ru;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(Ru||(e.CompletionItemKind=Ru={}));var Ya;(function(y){y.PlainText=1,y.Snippet=2})(Ya||(e.InsertTextFormat=Ya={}));var Xa;(function(y){y.Deprecated=1})(Xa||(e.CompletionItemTag=Xa={}));var Pu;(function(y){function w(b,m,D){return{newText:b,insert:m,replace:D}}y.create=w;function E(b){var m=b;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}y.is=E})(Pu||(e.InsertReplaceEdit=Pu={}));var wu;(function(y){y.asIs=1,y.adjustIndentation=2})(wu||(e.InsertTextMode=wu={}));var Eu;(function(y){function w(E){var b=E;return b&&(A.string(b.detail)||b.detail===void 0)&&(A.string(b.description)||b.description===void 0)}y.is=w})(Eu||(e.CompletionItemLabelDetails=Eu={}));var Cu;(function(y){function w(E){return{label:E}}y.create=w})(Cu||(e.CompletionItem=Cu={}));var Du;(function(y){function w(E,b){return{items:E||[],isIncomplete:!!b}}y.create=w})(Du||(e.CompletionList=Du={}));var yo;(function(y){function w(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=w;function E(b){var m=b;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}y.is=E})(yo||(e.MarkedString=yo={}));var kn;(function(y){function w(E){var b=E;return!!b&&A.objectLiteral(b)&&(Os.is(b.contents)||yo.is(b.contents)||A.typedArray(b.contents,yo.is))&&(E.range===void 0||a.is(E.range))}y.is=w})(kn||(e.Hover=kn={}));var Au;(function(y){function w(E,b){return b?{label:E,documentation:b}:{label:E}}y.create=w})(Au||(e.ParameterInformation=Au={}));var Iu;(function(y){function w(E,b){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var q={label:E};return A.defined(b)&&(q.documentation=b),A.defined(m)?q.parameters=m:q.parameters=[],q}y.create=w})(Iu||(e.SignatureInformation=Iu={}));var Ms;(function(y){y.Text=1,y.Read=2,y.Write=3})(Ms||(e.DocumentHighlightKind=Ms={}));var Ou;(function(y){function w(E,b){var m={range:E};return A.number(b)&&(m.kind=b),m}y.create=w})(Ou||(e.DocumentHighlight=Ou={}));var To;(function(y){y.File=1,y.Module=2,y.Namespace=3,y.Package=4,y.Class=5,y.Method=6,y.Property=7,y.Field=8,y.Constructor=9,y.Enum=10,y.Interface=11,y.Function=12,y.Variable=13,y.Constant=14,y.String=15,y.Number=16,y.Boolean=17,y.Array=18,y.Object=19,y.Key=20,y.Null=21,y.EnumMember=22,y.Struct=23,y.Event=24,y.Operator=25,y.TypeParameter=26})(To||(e.SymbolKind=To={}));var Mu;(function(y){y.Deprecated=1})(Mu||(e.SymbolTag=Mu={}));var mi;(function(y){function w(E,b,m,D,q){var ye={name:E,kind:b,location:{uri:D,range:m}};return q&&(ye.containerName=q),ye}y.create=w})(mi||(e.SymbolInformation=mi={}));var $i;(function(y){function w(E,b,m,D){return D!==void 0?{name:E,kind:b,location:{uri:m,range:D}}:{name:E,kind:b,location:{uri:m}}}y.create=w})($i||(e.WorkspaceSymbol=$i={}));var xu;(function(y){function w(b,m,D,q,ye,Rt){var at={name:b,detail:m,kind:D,range:q,selectionRange:ye};return Rt!==void 0&&(at.children=Rt),at}y.create=w;function E(b){var m=b;return m&&A.string(m.name)&&A.number(m.kind)&&a.is(m.range)&&a.is(m.selectionRange)&&(m.detail===void 0||A.string(m.detail))&&(m.deprecated===void 0||A.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}y.is=E})(xu||(e.DocumentSymbol=xu={}));var Lu;(function(y){y.Empty="",y.QuickFix="quickfix",y.Refactor="refactor",y.RefactorExtract="refactor.extract",y.RefactorInline="refactor.inline",y.RefactorRewrite="refactor.rewrite",y.Source="source",y.SourceOrganizeImports="source.organizeImports",y.SourceFixAll="source.fixAll"})(Lu||(e.CodeActionKind=Lu={}));var zn;(function(y){y.Invoked=1,y.Automatic=2})(zn||(e.CodeActionTriggerKind=zn={}));var Ja;(function(y){function w(b,m,D){var q={diagnostics:b};return m!=null&&(q.only=m),D!=null&&(q.triggerKind=D),q}y.create=w;function E(b){var m=b;return A.defined(m)&&A.typedArray(m.diagnostics,v.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===zn.Invoked||m.triggerKind===zn.Automatic)}y.is=E})(Ja||(e.CodeActionContext=Ja={}));var Qa;(function(y){function w(b,m,D){var q={title:b},ye=!0;return typeof m=="string"?(ye=!1,q.kind=m):R.is(m)?q.command=m:q.edit=m,ye&&D!==void 0&&(q.kind=D),q}y.create=w;function E(b){var m=b;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,v.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||R.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Xr.is(m.edit))}y.is=E})(Qa||(e.CodeAction=Qa={}));var vo;(function(y){function w(b,m){var D={range:b};return A.defined(m)&&(D.data=m),D}y.create=w;function E(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||R.is(m.command))}y.is=E})(vo||(e.CodeLens=vo={}));var Za;(function(y){function w(b,m){return{tabSize:b,insertSpaces:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}y.is=E})(Za||(e.FormattingOptions=Za={}));var gi;(function(y){function w(b,m,D){return{range:b,target:m,data:D}}y.create=w;function E(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}y.is=E})(gi||(e.DocumentLink=gi={}));var P;(function(y){function w(b,m){return{range:b,parent:m}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||y.is(m.parent))}y.is=E})(P||(e.SelectionRange=P={}));var L;(function(y){y.namespace="namespace",y.type="type",y.class="class",y.enum="enum",y.interface="interface",y.struct="struct",y.typeParameter="typeParameter",y.parameter="parameter",y.variable="variable",y.property="property",y.enumMember="enumMember",y.event="event",y.function="function",y.method="method",y.macro="macro",y.keyword="keyword",y.modifier="modifier",y.comment="comment",y.string="string",y.number="number",y.regexp="regexp",y.operator="operator",y.decorator="decorator"})(L||(e.SemanticTokenTypes=L={}));var G;(function(y){y.declaration="declaration",y.definition="definition",y.readonly="readonly",y.static="static",y.deprecated="deprecated",y.abstract="abstract",y.async="async",y.modification="modification",y.documentation="documentation",y.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var re;(function(y){function w(E){var b=E;return A.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}y.is=w})(re||(e.SemanticTokens=re={}));var Qe;(function(y){function w(b,m){return{range:b,text:m}}y.create=w;function E(b){var m=b;return m!=null&&a.is(m.range)&&A.string(m.text)}y.is=E})(Qe||(e.InlineValueText=Qe={}));var Ge;(function(y){function w(b,m,D){return{range:b,variableName:m,caseSensitiveLookup:D}}y.create=w;function E(b){var m=b;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}y.is=E})(Ge||(e.InlineValueVariableLookup=Ge={}));var dt;(function(y){function w(b,m){return{range:b,expression:m}}y.create=w;function E(b){var m=b;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}y.is=E})(dt||(e.InlineValueEvaluatableExpression=dt={}));var Tt;(function(y){function w(b,m){return{frameId:b,stoppedLocation:m}}y.create=w;function E(b){var m=b;return A.defined(m)&&a.is(b.stoppedLocation)}y.is=E})(Tt||(e.InlineValueContext=Tt={}));var ke;(function(y){y.Type=1,y.Parameter=2;function w(E){return E===1||E===2}y.is=w})(ke||(e.InlayHintKind=ke={}));var rt;(function(y){function w(b){return{value:b}}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||Os.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||R.is(m.command))}y.is=E})(rt||(e.InlayHintLabelPart=rt={}));var je;(function(y){function w(b,m,D){var q={position:b,label:m};return D!==void 0&&(q.kind=D),q}y.create=w;function E(b){var m=b;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,rt.is))&&(m.kind===void 0||ke.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||Os.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}y.is=E})(je||(e.InlayHint=je={}));var kt;(function(y){function w(E){return{kind:"snippet",value:E}}y.createSnippet=w})(kt||(e.StringValue=kt={}));var Vt;(function(y){function w(E,b,m,D){return{insertText:E,filterText:b,range:m,command:D}}y.create=w})(Vt||(e.InlineCompletionItem=Vt={}));var Ur;(function(y){function w(E){return{items:E}}y.create=w})(Ur||(e.InlineCompletionList=Ur={}));var qu;(function(y){y.Invoked=0,y.Automatic=1})(qu||(e.InlineCompletionTriggerKind=qu={}));var MS;(function(y){function w(E,b){return{range:E,text:b}}y.create=w})(MS||(e.SelectedCompletionInfo=MS={}));var xS;(function(y){function w(E,b){return{triggerKind:E,selectedCompletionInfo:b}}y.create=w})(xS||(e.InlineCompletionContext=xS={}));var LS;(function(y){function w(E){var b=E;return A.objectLiteral(b)&&n.is(b.uri)&&A.string(b.name)}y.is=w})(LS||(e.WorkspaceFolder=LS={})),e.EOL=[`
33
33
  `,`\r
34
- `,"\r"];var qS;(function(y){function E(C,q,ye,Rt){return new vB(C,q,ye,Rt)}y.create=E;function w(C){var q=C;return!!(A.defined(q)&&A.string(q.uri)&&(A.undefined(q.languageId)||A.string(q.languageId))&&A.uinteger(q.lineCount)&&A.func(q.getText)&&A.func(q.positionAt)&&A.func(q.offsetAt))}y.is=w;function b(C,q){for(var ye=C.getText(),Rt=m(q,function(bo,$u){var $S=bo.range.start.line-$u.range.start.line;return $S===0?bo.range.start.character-$u.range.start.character:$S}),at=ye.length,Rn=Rt.length-1;Rn>=0;Rn--){var Pn=Rt[Rn],yi=C.offsetAt(Pn.range.start),Ce=C.offsetAt(Pn.range.end);if(Ce<=at)ye=ye.substring(0,yi)+Pn.newText+ye.substring(Ce,ye.length);else throw new Error("Overlapping edit");at=yi}return ye}y.applyEdits=b;function m(C,q){if(C.length<=1)return C;var ye=C.length/2|0,Rt=C.slice(0,ye),at=C.slice(ye);m(Rt,q),m(at,q);for(var Rn=0,Pn=0,yi=0;Rn<Rt.length&&Pn<at.length;){var Ce=q(Rt[Rn],at[Pn]);Ce<=0?C[yi++]=Rt[Rn++]:C[yi++]=at[Pn++]}for(;Rn<Rt.length;)C[yi++]=Rt[Rn++];for(;Pn<at.length;)C[yi++]=at[Pn++];return C}})(qS||(e.TextDocument=qS={}));var vB=function(){function y(E,w,b,m){this._uri=E,this._languageId=w,this._version=b,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(y.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),y.prototype.getText=function(E){if(E){var w=this.offsetAt(E.start),b=this.offsetAt(E.end);return this._content.substring(w,b)}return this._content},y.prototype.update=function(E,w){this._content=E.text,this._version=w,this._lineOffsets=void 0},y.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var E=[],w=this._content,b=!0,m=0;m<w.length;m++){b&&(E.push(m),b=!1);var C=w.charAt(m);b=C==="\r"||C===`
35
- `,C==="\r"&&m+1<w.length&&w.charAt(m+1)===`
36
- `&&m++}b&&w.length>0&&E.push(w.length),this._lineOffsets=E}return this._lineOffsets},y.prototype.positionAt=function(E){E=Math.max(Math.min(E,this._content.length),0);var w=this.getLineOffsets(),b=0,m=w.length;if(m===0)return o.create(0,E);for(;b<m;){var C=Math.floor((b+m)/2);w[C]>E?m=C:b=C+1}var q=b-1;return o.create(q,E-w[q])},y.prototype.offsetAt=function(E){var w=this.getLineOffsets();if(E.line>=w.length)return this._content.length;if(E.line<0)return 0;var b=w[E.line],m=E.line+1<w.length?w[E.line+1]:this._content.length;return Math.max(Math.min(b+E.character,m),b)},Object.defineProperty(y.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),y}(),A;(function(y){var E=Object.prototype.toString;function w(Ce){return typeof Ce<"u"}y.defined=w;function b(Ce){return typeof Ce>"u"}y.undefined=b;function m(Ce){return Ce===!0||Ce===!1}y.boolean=m;function C(Ce){return E.call(Ce)==="[object String]"}y.string=C;function q(Ce){return E.call(Ce)==="[object Number]"}y.number=q;function ye(Ce,bo,$u){return E.call(Ce)==="[object Number]"&&bo<=Ce&&Ce<=$u}y.numberRange=ye;function Rt(Ce){return E.call(Ce)==="[object Number]"&&-2147483648<=Ce&&Ce<=2147483647}y.integer=Rt;function at(Ce){return E.call(Ce)==="[object Number]"&&0<=Ce&&Ce<=2147483647}y.uinteger=at;function Rn(Ce){return E.call(Ce)==="[object Function]"}y.func=Rn;function Pn(Ce){return Ce!==null&&typeof Ce=="object"}y.objectLiteral=Pn;function yi(Ce,bo){return Array.isArray(Ce)&&Ce.every(bo)}y.typedArray=yi})(A||(A={}))})});var vt=k(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.ProtocolNotificationType=Rr.ProtocolNotificationType0=Rr.ProtocolRequestType=Rr.ProtocolRequestType0=Rr.RegistrationType=Rr.MessageDirection=void 0;var Do=$s(),vN;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(vN||(Rr.MessageDirection=vN={}));var Vg=class{constructor(e){this.method=e}};Rr.RegistrationType=Vg;var zg=class extends Do.RequestType0{constructor(e){super(e)}};Rr.ProtocolRequestType0=zg;var Wg=class extends Do.RequestType{constructor(e){super(e,Do.ParameterStructures.byName)}};Rr.ProtocolRequestType=Wg;var Gg=class extends Do.NotificationType0{constructor(e){super(e)}};Rr.ProtocolNotificationType0=Gg;var Yg=class extends Do.NotificationType{constructor(e){super(e,Do.ParameterStructures.byName)}};Rr.ProtocolNotificationType=Yg});var ld=k(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.objectLiteral=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function pF(t){return t===!0||t===!1}xt.boolean=pF;function bN(t){return typeof t=="string"||t instanceof String}xt.string=bN;function hF(t){return typeof t=="number"||t instanceof Number}xt.number=hF;function mF(t){return t instanceof Error}xt.error=mF;function gF(t){return typeof t=="function"}xt.func=gF;function _N(t){return Array.isArray(t)}xt.array=_N;function yF(t){return _N(t)&&t.every(e=>bN(e))}xt.stringArray=yF;function TF(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=TF;function vF(t){return t!==null&&typeof t=="object"}xt.objectLiteral=vF});var kN=k(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.ImplementationRequest=void 0;var SN=vt(),NN;(function(t){t.method="textDocument/implementation",t.messageDirection=SN.MessageDirection.clientToServer,t.type=new SN.ProtocolRequestType(t.method)})(NN||(ud.ImplementationRequest=NN={}))});var EN=k(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.TypeDefinitionRequest=void 0;var RN=vt(),PN;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=RN.MessageDirection.clientToServer,t.type=new RN.ProtocolRequestType(t.method)})(PN||(dd.TypeDefinitionRequest=PN={}))});var CN=k(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.DidChangeWorkspaceFoldersNotification=Co.WorkspaceFoldersRequest=void 0;var fd=vt(),wN;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=fd.MessageDirection.serverToClient,t.type=new fd.ProtocolRequestType0(t.method)})(wN||(Co.WorkspaceFoldersRequest=wN={}));var DN;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=fd.MessageDirection.clientToServer,t.type=new fd.ProtocolNotificationType(t.method)})(DN||(Co.DidChangeWorkspaceFoldersNotification=DN={}))});var IN=k(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ConfigurationRequest=void 0;var AN=vt(),ON;(function(t){t.method="workspace/configuration",t.messageDirection=AN.MessageDirection.serverToClient,t.type=new AN.ProtocolRequestType(t.method)})(ON||(pd.ConfigurationRequest=ON={}))});var LN=k(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.ColorPresentationRequest=Ao.DocumentColorRequest=void 0;var hd=vt(),MN;(function(t){t.method="textDocument/documentColor",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(MN||(Ao.DocumentColorRequest=MN={}));var xN;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(xN||(Ao.ColorPresentationRequest=xN={}))});var BN=k(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.FoldingRangeRefreshRequest=Oo.FoldingRangeRequest=void 0;var md=vt(),qN;(function(t){t.method="textDocument/foldingRange",t.messageDirection=md.MessageDirection.clientToServer,t.type=new md.ProtocolRequestType(t.method)})(qN||(Oo.FoldingRangeRequest=qN={}));var $N;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=md.MessageDirection.serverToClient,t.type=new md.ProtocolRequestType0(t.method)})($N||(Oo.FoldingRangeRefreshRequest=$N={}))});var UN=k(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.DeclarationRequest=void 0;var FN=vt(),jN;(function(t){t.method="textDocument/declaration",t.messageDirection=FN.MessageDirection.clientToServer,t.type=new FN.ProtocolRequestType(t.method)})(jN||(gd.DeclarationRequest=jN={}))});var zN=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.SelectionRangeRequest=void 0;var HN=vt(),VN;(function(t){t.method="textDocument/selectionRange",t.messageDirection=HN.MessageDirection.clientToServer,t.type=new HN.ProtocolRequestType(t.method)})(VN||(yd.SelectionRangeRequest=VN={}))});var KN=k(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.WorkDoneProgressCancelNotification=Hi.WorkDoneProgressCreateRequest=Hi.WorkDoneProgress=void 0;var bF=$s(),Td=vt(),WN;(function(t){t.type=new bF.ProgressType;function e(r){return r===t.type}t.is=e})(WN||(Hi.WorkDoneProgress=WN={}));var GN;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Td.MessageDirection.serverToClient,t.type=new Td.ProtocolRequestType(t.method)})(GN||(Hi.WorkDoneProgressCreateRequest=GN={}));var YN;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Td.MessageDirection.clientToServer,t.type=new Td.ProtocolNotificationType(t.method)})(YN||(Hi.WorkDoneProgressCancelNotification=YN={}))});var ZN=k(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.CallHierarchyOutgoingCallsRequest=Vi.CallHierarchyIncomingCallsRequest=Vi.CallHierarchyPrepareRequest=void 0;var Io=vt(),XN;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(XN||(Vi.CallHierarchyPrepareRequest=XN={}));var JN;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(JN||(Vi.CallHierarchyIncomingCallsRequest=JN={}));var QN;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(QN||(Vi.CallHierarchyOutgoingCallsRequest=QN={}))});var sk=k(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SemanticTokensRefreshRequest=Pr.SemanticTokensRangeRequest=Pr.SemanticTokensDeltaRequest=Pr.SemanticTokensRequest=Pr.SemanticTokensRegistrationType=Pr.TokenFormat=void 0;var vi=vt(),ek;(function(t){t.Relative="relative"})(ek||(Pr.TokenFormat=ek={}));var oc;(function(t){t.method="textDocument/semanticTokens",t.type=new vi.RegistrationType(t.method)})(oc||(Pr.SemanticTokensRegistrationType=oc={}));var tk;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(tk||(Pr.SemanticTokensRequest=tk={}));var rk;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(rk||(Pr.SemanticTokensDeltaRequest=rk={}));var nk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(nk||(Pr.SemanticTokensRangeRequest=nk={}));var ik;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vi.MessageDirection.serverToClient,t.type=new vi.ProtocolRequestType0(t.method)})(ik||(Pr.SemanticTokensRefreshRequest=ik={}))});var ck=k(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.ShowDocumentRequest=void 0;var ok=vt(),ak;(function(t){t.method="window/showDocument",t.messageDirection=ok.MessageDirection.serverToClient,t.type=new ok.ProtocolRequestType(t.method)})(ak||(vd.ShowDocumentRequest=ak={}))});var dk=k(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.LinkedEditingRangeRequest=void 0;var lk=vt(),uk;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=lk.MessageDirection.clientToServer,t.type=new lk.ProtocolRequestType(t.method)})(uk||(bd.LinkedEditingRangeRequest=uk={}))});var vk=k(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.WillDeleteFilesRequest=or.DidDeleteFilesNotification=or.DidRenameFilesNotification=or.WillRenameFilesRequest=or.DidCreateFilesNotification=or.WillCreateFilesRequest=or.FileOperationPatternKind=void 0;var Jr=vt(),fk;(function(t){t.file="file",t.folder="folder"})(fk||(or.FileOperationPatternKind=fk={}));var pk;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(pk||(or.WillCreateFilesRequest=pk={}));var hk;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(hk||(or.DidCreateFilesNotification=hk={}));var mk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(mk||(or.WillRenameFilesRequest=mk={}));var gk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(gk||(or.DidRenameFilesNotification=gk={}));var yk;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(yk||(or.DidDeleteFilesNotification=yk={}));var Tk;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(Tk||(or.WillDeleteFilesRequest=Tk={}))});var kk=k(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.MonikerRequest=zi.MonikerKind=zi.UniquenessLevel=void 0;var bk=vt(),_k;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(_k||(zi.UniquenessLevel=_k={}));var Sk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Sk||(zi.MonikerKind=Sk={}));var Nk;(function(t){t.method="textDocument/moniker",t.messageDirection=bk.MessageDirection.clientToServer,t.type=new bk.ProtocolRequestType(t.method)})(Nk||(zi.MonikerRequest=Nk={}))});var wk=k(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.TypeHierarchySubtypesRequest=Wi.TypeHierarchySupertypesRequest=Wi.TypeHierarchyPrepareRequest=void 0;var Mo=vt(),Rk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(Rk||(Wi.TypeHierarchyPrepareRequest=Rk={}));var Pk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(Pk||(Wi.TypeHierarchySupertypesRequest=Pk={}));var Ek;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(Ek||(Wi.TypeHierarchySubtypesRequest=Ek={}))});var Ak=k(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.InlineValueRefreshRequest=xo.InlineValueRequest=void 0;var _d=vt(),Dk;(function(t){t.method="textDocument/inlineValue",t.messageDirection=_d.MessageDirection.clientToServer,t.type=new _d.ProtocolRequestType(t.method)})(Dk||(xo.InlineValueRequest=Dk={}));var Ck;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=_d.MessageDirection.serverToClient,t.type=new _d.ProtocolRequestType0(t.method)})(Ck||(xo.InlineValueRefreshRequest=Ck={}))});var xk=k(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.InlayHintRefreshRequest=Gi.InlayHintResolveRequest=Gi.InlayHintRequest=void 0;var Lo=vt(),Ok;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(Ok||(Gi.InlayHintRequest=Ok={}));var Ik;(function(t){t.method="inlayHint/resolve",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(Ik||(Gi.InlayHintResolveRequest=Ik={}));var Mk;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Lo.MessageDirection.serverToClient,t.type=new Lo.ProtocolRequestType0(t.method)})(Mk||(Gi.InlayHintRefreshRequest=Mk={}))});var Uk=k(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DiagnosticRefreshRequest=Qr.WorkspaceDiagnosticRequest=Qr.DocumentDiagnosticRequest=Qr.DocumentDiagnosticReportKind=Qr.DiagnosticServerCancellationData=void 0;var jk=$s(),_F=ld(),qo=vt(),Lk;(function(t){function e(r){let n=r;return n&&_F.boolean(n.retriggerRequest)}t.is=e})(Lk||(Qr.DiagnosticServerCancellationData=Lk={}));var qk;(function(t){t.Full="full",t.Unchanged="unchanged"})(qk||(Qr.DocumentDiagnosticReportKind=qk={}));var $k;(function(t){t.method="textDocument/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new jk.ProgressType})($k||(Qr.DocumentDiagnosticRequest=$k={}));var Bk;(function(t){t.method="workspace/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new jk.ProgressType})(Bk||(Qr.WorkspaceDiagnosticRequest=Bk={}));var Fk;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=qo.MessageDirection.serverToClient,t.type=new qo.ProtocolRequestType0(t.method)})(Fk||(Qr.DiagnosticRefreshRequest=Fk={}))});var Kk=k(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.DidCloseNotebookDocumentNotification=Pt.DidSaveNotebookDocumentNotification=Pt.DidChangeNotebookDocumentNotification=Pt.NotebookCellArrayChange=Pt.DidOpenNotebookDocumentNotification=Pt.NotebookDocumentSyncRegistrationType=Pt.NotebookDocument=Pt.NotebookCell=Pt.ExecutionSummary=Pt.NotebookCellKind=void 0;var ac=cd(),wn=ld(),Wn=vt(),Kg;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Kg||(Pt.NotebookCellKind=Kg={}));var Xg;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return wn.objectLiteral(s)&&ac.uinteger.is(s.executionOrder)&&(s.success===void 0||wn.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Xg||(Pt.ExecutionSummary=Xg={}));var Sd;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function r(s){let o=s;return wn.objectLiteral(o)&&Kg.is(o.kind)&&ac.DocumentUri.is(o.document)&&(o.metadata===void 0||wn.objectLiteral(o.metadata))}t.is=r;function n(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)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Xg.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(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(!i(s[l],o[l]))return!1}if(wn.objectLiteral(s)&&wn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!i(s[f],o[f]))return!1}}return!0}})(Sd||(Pt.NotebookCell=Sd={}));var Hk;(function(t){function e(n,i,s,o){return{uri:n,notebookType:i,version:s,cells:o}}t.create=e;function r(n){let i=n;return wn.objectLiteral(i)&&wn.string(i.uri)&&ac.integer.is(i.version)&&wn.typedArray(i.cells,Sd.is)}t.is=r})(Hk||(Pt.NotebookDocument=Hk={}));var $o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.RegistrationType(t.method)})($o||(Pt.NotebookDocumentSyncRegistrationType=$o={}));var Vk;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Vk||(Pt.DidOpenNotebookDocumentNotification=Vk={}));var zk;(function(t){function e(n){let i=n;return wn.objectLiteral(i)&&ac.uinteger.is(i.start)&&ac.uinteger.is(i.deleteCount)&&(i.cells===void 0||wn.typedArray(i.cells,Sd.is))}t.is=e;function r(n,i,s){let o={start:n,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=r})(zk||(Pt.NotebookCellArrayChange=zk={}));var Wk;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Wk||(Pt.DidChangeNotebookDocumentNotification=Wk={}));var Gk;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Gk||(Pt.DidSaveNotebookDocumentNotification=Gk={}));var Yk;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Yk||(Pt.DidCloseNotebookDocumentNotification=Yk={}))});var Qk=k(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.InlineCompletionRequest=void 0;var Xk=vt(),Jk;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Xk.MessageDirection.clientToServer,t.type=new Xk.ProtocolRequestType(t.method)})(Jk||(Nd.InlineCompletionRequest=Jk={}))});var dP=k(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.WorkspaceSymbolRequest=N.CodeActionResolveRequest=N.CodeActionRequest=N.DocumentSymbolRequest=N.DocumentHighlightRequest=N.ReferencesRequest=N.DefinitionRequest=N.SignatureHelpRequest=N.SignatureHelpTriggerKind=N.HoverRequest=N.CompletionResolveRequest=N.CompletionRequest=N.CompletionTriggerKind=N.PublishDiagnosticsNotification=N.WatchKind=N.RelativePattern=N.FileChangeType=N.DidChangeWatchedFilesNotification=N.WillSaveTextDocumentWaitUntilRequest=N.WillSaveTextDocumentNotification=N.TextDocumentSaveReason=N.DidSaveTextDocumentNotification=N.DidCloseTextDocumentNotification=N.DidChangeTextDocumentNotification=N.TextDocumentContentChangeEvent=N.DidOpenTextDocumentNotification=N.TextDocumentSyncKind=N.TelemetryEventNotification=N.LogMessageNotification=N.ShowMessageRequest=N.ShowMessageNotification=N.MessageType=N.DidChangeConfigurationNotification=N.ExitNotification=N.ShutdownRequest=N.InitializedNotification=N.InitializeErrorCodes=N.InitializeRequest=N.WorkDoneProgressOptions=N.TextDocumentRegistrationOptions=N.StaticRegistrationOptions=N.PositionEncodingKind=N.FailureHandlingKind=N.ResourceOperationKind=N.UnregistrationRequest=N.RegistrationRequest=N.DocumentSelector=N.NotebookCellTextDocumentFilter=N.NotebookDocumentFilter=N.TextDocumentFilter=void 0;N.MonikerRequest=N.MonikerKind=N.UniquenessLevel=N.WillDeleteFilesRequest=N.DidDeleteFilesNotification=N.WillRenameFilesRequest=N.DidRenameFilesNotification=N.WillCreateFilesRequest=N.DidCreateFilesNotification=N.FileOperationPatternKind=N.LinkedEditingRangeRequest=N.ShowDocumentRequest=N.SemanticTokensRegistrationType=N.SemanticTokensRefreshRequest=N.SemanticTokensRangeRequest=N.SemanticTokensDeltaRequest=N.SemanticTokensRequest=N.TokenFormat=N.CallHierarchyPrepareRequest=N.CallHierarchyOutgoingCallsRequest=N.CallHierarchyIncomingCallsRequest=N.WorkDoneProgressCancelNotification=N.WorkDoneProgressCreateRequest=N.WorkDoneProgress=N.SelectionRangeRequest=N.DeclarationRequest=N.FoldingRangeRefreshRequest=N.FoldingRangeRequest=N.ColorPresentationRequest=N.DocumentColorRequest=N.ConfigurationRequest=N.DidChangeWorkspaceFoldersNotification=N.WorkspaceFoldersRequest=N.TypeDefinitionRequest=N.ImplementationRequest=N.ApplyWorkspaceEditRequest=N.ExecuteCommandRequest=N.PrepareRenameRequest=N.RenameRequest=N.PrepareSupportDefaultBehavior=N.DocumentOnTypeFormattingRequest=N.DocumentRangesFormattingRequest=N.DocumentRangeFormattingRequest=N.DocumentFormattingRequest=N.DocumentLinkResolveRequest=N.DocumentLinkRequest=N.CodeLensRefreshRequest=N.CodeLensResolveRequest=N.CodeLensRequest=N.WorkspaceSymbolResolveRequest=void 0;N.InlineCompletionRequest=N.DidCloseNotebookDocumentNotification=N.DidSaveNotebookDocumentNotification=N.DidChangeNotebookDocumentNotification=N.NotebookCellArrayChange=N.DidOpenNotebookDocumentNotification=N.NotebookDocumentSyncRegistrationType=N.NotebookDocument=N.NotebookCell=N.ExecutionSummary=N.NotebookCellKind=N.DiagnosticRefreshRequest=N.WorkspaceDiagnosticRequest=N.DocumentDiagnosticRequest=N.DocumentDiagnosticReportKind=N.DiagnosticServerCancellationData=N.InlayHintRefreshRequest=N.InlayHintResolveRequest=N.InlayHintRequest=N.InlineValueRefreshRequest=N.InlineValueRequest=N.TypeHierarchySupertypesRequest=N.TypeHierarchySubtypesRequest=N.TypeHierarchyPrepareRequest=void 0;var V=vt(),Zk=cd(),zt=ld(),SF=kN();Object.defineProperty(N,"ImplementationRequest",{enumerable:!0,get:function(){return SF.ImplementationRequest}});var NF=EN();Object.defineProperty(N,"TypeDefinitionRequest",{enumerable:!0,get:function(){return NF.TypeDefinitionRequest}});var aP=CN();Object.defineProperty(N,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return aP.WorkspaceFoldersRequest}});Object.defineProperty(N,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return aP.DidChangeWorkspaceFoldersNotification}});var kF=IN();Object.defineProperty(N,"ConfigurationRequest",{enumerable:!0,get:function(){return kF.ConfigurationRequest}});var cP=LN();Object.defineProperty(N,"DocumentColorRequest",{enumerable:!0,get:function(){return cP.DocumentColorRequest}});Object.defineProperty(N,"ColorPresentationRequest",{enumerable:!0,get:function(){return cP.ColorPresentationRequest}});var lP=BN();Object.defineProperty(N,"FoldingRangeRequest",{enumerable:!0,get:function(){return lP.FoldingRangeRequest}});Object.defineProperty(N,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return lP.FoldingRangeRefreshRequest}});var RF=UN();Object.defineProperty(N,"DeclarationRequest",{enumerable:!0,get:function(){return RF.DeclarationRequest}});var PF=zN();Object.defineProperty(N,"SelectionRangeRequest",{enumerable:!0,get:function(){return PF.SelectionRangeRequest}});var ty=KN();Object.defineProperty(N,"WorkDoneProgress",{enumerable:!0,get:function(){return ty.WorkDoneProgress}});Object.defineProperty(N,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ty.WorkDoneProgressCreateRequest}});Object.defineProperty(N,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ty.WorkDoneProgressCancelNotification}});var ry=ZN();Object.defineProperty(N,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return ry.CallHierarchyIncomingCallsRequest}});Object.defineProperty(N,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return ry.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(N,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return ry.CallHierarchyPrepareRequest}});var Bo=sk();Object.defineProperty(N,"TokenFormat",{enumerable:!0,get:function(){return Bo.TokenFormat}});Object.defineProperty(N,"SemanticTokensRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRequest}});Object.defineProperty(N,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensDeltaRequest}});Object.defineProperty(N,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRangeRequest}});Object.defineProperty(N,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRefreshRequest}});Object.defineProperty(N,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Bo.SemanticTokensRegistrationType}});var EF=ck();Object.defineProperty(N,"ShowDocumentRequest",{enumerable:!0,get:function(){return EF.ShowDocumentRequest}});var wF=dk();Object.defineProperty(N,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return wF.LinkedEditingRangeRequest}});var Bs=vk();Object.defineProperty(N,"FileOperationPatternKind",{enumerable:!0,get:function(){return Bs.FileOperationPatternKind}});Object.defineProperty(N,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Bs.DidCreateFilesNotification}});Object.defineProperty(N,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Bs.WillCreateFilesRequest}});Object.defineProperty(N,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Bs.DidRenameFilesNotification}});Object.defineProperty(N,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Bs.WillRenameFilesRequest}});Object.defineProperty(N,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Bs.DidDeleteFilesNotification}});Object.defineProperty(N,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Bs.WillDeleteFilesRequest}});var ny=kk();Object.defineProperty(N,"UniquenessLevel",{enumerable:!0,get:function(){return ny.UniquenessLevel}});Object.defineProperty(N,"MonikerKind",{enumerable:!0,get:function(){return ny.MonikerKind}});Object.defineProperty(N,"MonikerRequest",{enumerable:!0,get:function(){return ny.MonikerRequest}});var iy=wk();Object.defineProperty(N,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return iy.TypeHierarchyPrepareRequest}});Object.defineProperty(N,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return iy.TypeHierarchySubtypesRequest}});Object.defineProperty(N,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return iy.TypeHierarchySupertypesRequest}});var uP=Ak();Object.defineProperty(N,"InlineValueRequest",{enumerable:!0,get:function(){return uP.InlineValueRequest}});Object.defineProperty(N,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return uP.InlineValueRefreshRequest}});var sy=xk();Object.defineProperty(N,"InlayHintRequest",{enumerable:!0,get:function(){return sy.InlayHintRequest}});Object.defineProperty(N,"InlayHintResolveRequest",{enumerable:!0,get:function(){return sy.InlayHintResolveRequest}});Object.defineProperty(N,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return sy.InlayHintRefreshRequest}});var cc=Uk();Object.defineProperty(N,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return cc.DiagnosticServerCancellationData}});Object.defineProperty(N,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return cc.DocumentDiagnosticReportKind}});Object.defineProperty(N,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return cc.DocumentDiagnosticRequest}});Object.defineProperty(N,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return cc.WorkspaceDiagnosticRequest}});Object.defineProperty(N,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return cc.DiagnosticRefreshRequest}});var Gn=Kk();Object.defineProperty(N,"NotebookCellKind",{enumerable:!0,get:function(){return Gn.NotebookCellKind}});Object.defineProperty(N,"ExecutionSummary",{enumerable:!0,get:function(){return Gn.ExecutionSummary}});Object.defineProperty(N,"NotebookCell",{enumerable:!0,get:function(){return Gn.NotebookCell}});Object.defineProperty(N,"NotebookDocument",{enumerable:!0,get:function(){return Gn.NotebookDocument}});Object.defineProperty(N,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(N,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(N,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Gn.NotebookCellArrayChange}});Object.defineProperty(N,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(N,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(N,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidCloseNotebookDocumentNotification}});var DF=Qk();Object.defineProperty(N,"InlineCompletionRequest",{enumerable:!0,get:function(){return DF.InlineCompletionRequest}});var Jg;(function(t){function e(r){let n=r;return zt.string(n)||zt.string(n.language)||zt.string(n.scheme)||zt.string(n.pattern)}t.is=e})(Jg||(N.TextDocumentFilter=Jg={}));var Qg;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(zt.string(n.notebookType)||zt.string(n.scheme)||zt.string(n.pattern))}t.is=e})(Qg||(N.NotebookDocumentFilter=Qg={}));var Zg;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(zt.string(n.notebook)||Qg.is(n.notebook))&&(n.language===void 0||zt.string(n.language))}t.is=e})(Zg||(N.NotebookCellTextDocumentFilter=Zg={}));var ey;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!zt.string(n)&&!Jg.is(n)&&!Zg.is(n))return!1;return!0}t.is=e})(ey||(N.DocumentSelector=ey={}));var eR;(function(t){t.method="client/registerCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(eR||(N.RegistrationRequest=eR={}));var tR;(function(t){t.method="client/unregisterCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(tR||(N.UnregistrationRequest=tR={}));var rR;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rR||(N.ResourceOperationKind=rR={}));var nR;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nR||(N.FailureHandlingKind=nR={}));var iR;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(iR||(N.PositionEncodingKind=iR={}));var sR;(function(t){function e(r){let n=r;return n&&zt.string(n.id)&&n.id.length>0}t.hasId=e})(sR||(N.StaticRegistrationOptions=sR={}));var oR;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||ey.is(n.documentSelector))}t.is=e})(oR||(N.TextDocumentRegistrationOptions=oR={}));var aR;(function(t){function e(n){let i=n;return zt.objectLiteral(i)&&(i.workDoneProgress===void 0||zt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&zt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(aR||(N.WorkDoneProgressOptions=aR={}));var cR;(function(t){t.method="initialize",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(cR||(N.InitializeRequest=cR={}));var lR;(function(t){t.unknownProtocolVersion=1})(lR||(N.InitializeErrorCodes=lR={}));var uR;(function(t){t.method="initialized",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(uR||(N.InitializedNotification=uR={}));var dR;(function(t){t.method="shutdown",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType0(t.method)})(dR||(N.ShutdownRequest=dR={}));var fR;(function(t){t.method="exit",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType0(t.method)})(fR||(N.ExitNotification=fR={}));var pR;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(pR||(N.DidChangeConfigurationNotification=pR={}));var hR;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(hR||(N.MessageType=hR={}));var mR;(function(t){t.method="window/showMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(mR||(N.ShowMessageNotification=mR={}));var gR;(function(t){t.method="window/showMessageRequest",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(gR||(N.ShowMessageRequest=gR={}));var yR;(function(t){t.method="window/logMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(yR||(N.LogMessageNotification=yR={}));var TR;(function(t){t.method="telemetry/event",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(TR||(N.TelemetryEventNotification=TR={}));var vR;(function(t){t.None=0,t.Full=1,t.Incremental=2})(vR||(N.TextDocumentSyncKind=vR={}));var bR;(function(t){t.method="textDocument/didOpen",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(bR||(N.DidOpenTextDocumentNotification=bR={}));var _R;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(_R||(N.TextDocumentContentChangeEvent=_R={}));var SR;(function(t){t.method="textDocument/didChange",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(SR||(N.DidChangeTextDocumentNotification=SR={}));var NR;(function(t){t.method="textDocument/didClose",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(NR||(N.DidCloseTextDocumentNotification=NR={}));var kR;(function(t){t.method="textDocument/didSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(kR||(N.DidSaveTextDocumentNotification=kR={}));var RR;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(RR||(N.TextDocumentSaveReason=RR={}));var PR;(function(t){t.method="textDocument/willSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(PR||(N.WillSaveTextDocumentNotification=PR={}));var ER;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(ER||(N.WillSaveTextDocumentWaitUntilRequest=ER={}));var wR;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(wR||(N.DidChangeWatchedFilesNotification=wR={}));var DR;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(DR||(N.FileChangeType=DR={}));var CR;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(Zk.URI.is(n.baseUri)||Zk.WorkspaceFolder.is(n.baseUri))&&zt.string(n.pattern)}t.is=e})(CR||(N.RelativePattern=CR={}));var AR;(function(t){t.Create=1,t.Change=2,t.Delete=4})(AR||(N.WatchKind=AR={}));var OR;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(OR||(N.PublishDiagnosticsNotification=OR={}));var IR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(IR||(N.CompletionTriggerKind=IR={}));var MR;(function(t){t.method="textDocument/completion",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(MR||(N.CompletionRequest=MR={}));var xR;(function(t){t.method="completionItem/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(xR||(N.CompletionResolveRequest=xR={}));var LR;(function(t){t.method="textDocument/hover",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(LR||(N.HoverRequest=LR={}));var qR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(qR||(N.SignatureHelpTriggerKind=qR={}));var $R;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})($R||(N.SignatureHelpRequest=$R={}));var BR;(function(t){t.method="textDocument/definition",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(BR||(N.DefinitionRequest=BR={}));var FR;(function(t){t.method="textDocument/references",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(FR||(N.ReferencesRequest=FR={}));var jR;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(jR||(N.DocumentHighlightRequest=jR={}));var UR;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(UR||(N.DocumentSymbolRequest=UR={}));var HR;(function(t){t.method="textDocument/codeAction",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(HR||(N.CodeActionRequest=HR={}));var VR;(function(t){t.method="codeAction/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(VR||(N.CodeActionResolveRequest=VR={}));var zR;(function(t){t.method="workspace/symbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(zR||(N.WorkspaceSymbolRequest=zR={}));var WR;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(WR||(N.WorkspaceSymbolResolveRequest=WR={}));var GR;(function(t){t.method="textDocument/codeLens",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(GR||(N.CodeLensRequest=GR={}));var YR;(function(t){t.method="codeLens/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(YR||(N.CodeLensResolveRequest=YR={}));var KR;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType0(t.method)})(KR||(N.CodeLensRefreshRequest=KR={}));var XR;(function(t){t.method="textDocument/documentLink",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(XR||(N.DocumentLinkRequest=XR={}));var JR;(function(t){t.method="documentLink/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(JR||(N.DocumentLinkResolveRequest=JR={}));var QR;(function(t){t.method="textDocument/formatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(QR||(N.DocumentFormattingRequest=QR={}));var ZR;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(ZR||(N.DocumentRangeFormattingRequest=ZR={}));var eP;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(eP||(N.DocumentRangesFormattingRequest=eP={}));var tP;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(tP||(N.DocumentOnTypeFormattingRequest=tP={}));var rP;(function(t){t.Identifier=1})(rP||(N.PrepareSupportDefaultBehavior=rP={}));var nP;(function(t){t.method="textDocument/rename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(nP||(N.RenameRequest=nP={}));var iP;(function(t){t.method="textDocument/prepareRename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(iP||(N.PrepareRenameRequest=iP={}));var sP;(function(t){t.method="workspace/executeCommand",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(sP||(N.ExecuteCommandRequest=sP={}));var oP;(function(t){t.method="workspace/applyEdit",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType("workspace/applyEdit")})(oP||(N.ApplyWorkspaceEditRequest=oP={}))});var pP=k(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.createProtocolConnection=void 0;var fP=$s();function CF(t,e,r,n){return fP.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fP.createMessageConnection)(t,e,r,n)}kd.createProtocolConnection=CF});var mP=k(Er=>{"use strict";var AF=Er&&Er.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rd=Er&&Er.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AF(e,t,r)};Object.defineProperty(Er,"__esModule",{value:!0});Er.LSPErrorCodes=Er.createProtocolConnection=void 0;Rd($s(),Er);Rd(cd(),Er);Rd(vt(),Er);Rd(dP(),Er);var OF=pP();Object.defineProperty(Er,"createProtocolConnection",{enumerable:!0,get:function(){return OF.createProtocolConnection}});var hP;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(hP||(Er.LSPErrorCodes=hP={}))});var wt=k(Yn=>{"use strict";var IF=Yn&&Yn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gP=Yn&&Yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IF(e,t,r)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createProtocolConnection=void 0;var MF=Hg();gP(Hg(),Yn);gP(mP(),Yn);function xF(t,e,r,n){return(0,MF.createMessageConnection)(t,e,r,n)}Yn.createProtocolConnection=xF});var oy=k(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.generateUuid=Zr.parse=Zr.isUUID=Zr.v4=Zr.empty=void 0;var lc=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},uc=class t extends lc{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};uc._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];uc._timeHighBits=["8","9","a","b"];Zr.empty=new lc("00000000-0000-0000-0000-000000000000");function yP(){return new uc}Zr.v4=yP;var LF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function TP(t){return LF.test(t)}Zr.isUUID=TP;function qF(t){if(!TP(t))throw new Error("invalid uuid");return new lc(t)}Zr.parse=qF;function $F(){return yP().asHex()}Zr.generateUuid=$F});var vP=k(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attachPartialResult=Ki.ProgressFeature=Ki.attachWorkDone=void 0;var Yi=wt(),BF=oy(),Fs=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Yi.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Yi.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Yi.WorkDoneProgress.type,this._token,{kind:"end"})}};Fs.Instances=new Map;var Pd=class extends Fs{constructor(e,r){super(e,r),this._source=new Yi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},dc=class{constructor(){}begin(){}report(){}done(){}},Ed=class extends dc{constructor(){super(),this._source=new Yi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function FF(t,e){if(e===void 0||e.workDoneToken===void 0)return new dc;let r=e.workDoneToken;return delete e.workDoneToken,new Fs(t,r)}Ki.attachWorkDone=FF;var jF=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Yi.WorkDoneProgressCancelNotification.type,r=>{let n=Fs.Instances.get(r.token);(n instanceof Pd||n instanceof Ed)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new dc:new Fs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,BF.generateUuid)();return this.connection.sendRequest(Yi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Pd(this.connection,e))}else return Promise.resolve(new Ed)}};Ki.ProgressFeature=jF;var ay;(function(t){t.type=new Yi.ProgressType})(ay||(ay={}));var cy=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(ay.type,this._token,e)}};function UF(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new cy(t,r)}Ki.attachPartialResult=UF});var bP=k(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.ConfigurationFeature=void 0;var HF=wt(),VF=Bu(),zF=t=>class extends t{getConfiguration(e){return e?VF.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(HF.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};wd.ConfigurationFeature=zF});var _P=k(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.WorkspaceFoldersFeature=void 0;var Dd=wt(),WF=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Dd.Emitter,this.connection.onNotification(Dd.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Dd.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(Dd.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Cd.WorkspaceFoldersFeature=WF});var SP=k(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.CallHierarchyFeature=void 0;var ly=wt(),GF=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ly.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=ly.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=ly.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ad.CallHierarchyFeature=GF});var dy=k(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.SemanticTokensBuilder=Xi.SemanticTokensDiff=Xi.SemanticTokensFeature=void 0;var Od=wt(),YF=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Od.SemanticTokensRefreshRequest.type),on:e=>{let r=Od.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Od.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Od.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Xi.SemanticTokensFeature=YF;var Id=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let o=i-n+1,a=this.modifiedSequence.slice(n,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Xi.SemanticTokensDiff=Id;var uy=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,r,n,i,s){let o=e,a=r;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++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}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 Id(this._prevData,this._data).computeDiff()}:this.build()}};Xi.SemanticTokensBuilder=uy});var NP=k(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ShowDocumentFeature=void 0;var KF=wt(),XF=t=>class extends t{showDocument(e){return this.connection.sendRequest(KF.ShowDocumentRequest.type,e)}};Md.ShowDocumentFeature=XF});var kP=k(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.FileOperationsFeature=void 0;var Fo=wt(),JF=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Fo.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Fo.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Fo.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Fo.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Fo.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Fo.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};xd.FileOperationsFeature=JF});var RP=k(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.LinkedEditingRangeFeature=void 0;var QF=wt(),ZF=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(QF.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Ld.LinkedEditingRangeFeature=ZF});var PP=k(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.TypeHierarchyFeature=void 0;var fy=wt(),ej=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(fy.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=fy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=fy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};qd.TypeHierarchyFeature=ej});var wP=k($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.InlineValueFeature=void 0;var EP=wt(),tj=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(EP.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(EP.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};$d.InlineValueFeature=tj});var CP=k(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.FoldingRangeFeature=void 0;var DP=wt(),rj=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(DP.FoldingRangeRefreshRequest.type),on:e=>{let r=DP.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Bd.FoldingRangeFeature=rj});var AP=k(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.InlayHintFeature=void 0;var py=wt(),nj=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(py.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(py.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(py.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Fd.InlayHintFeature=nj});var OP=k(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.DiagnosticFeature=void 0;var fc=wt(),ij=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(fc.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(fc.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(fc.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.WorkspaceDiagnosticRequest.partialResult,r)))}}};jd.DiagnosticFeature=ij});var my=k(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.TextDocuments=void 0;var js=wt(),hy=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new js.Emitter,this._onDidOpen=new js.Emitter,this._onDidClose=new js.Emitter,this._onDidSave=new js.Emitter,this._onWillSave=new js.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=js.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),js.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Ud.TextDocuments=hy});var yy=k(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.NotebookDocuments=jo.NotebookSyncFeature=void 0;var en=wt(),IP=my(),sj=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(en.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(en.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(en.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(en.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};jo.NotebookSyncFeature=sj;var Hd=class t{onDidOpenTextDocument(e){return this.openHandler=e,en.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,en.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,en.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Hd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var gy=class{constructor(e){e instanceof IP.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new IP.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new en.Emitter,this._onDidChange=new en.Emitter,this._onDidSave=new en.Emitter,this._onDidClose=new en.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[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 r=new Hd,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let S=c.cells;if(S.structure!==void 0){let _=S.structure.array;if(s.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),S.structure.didOpen!==void 0)for(let v of S.structure.didOpen)r.openTextDocument({textDocument:v}),l.push(v.uri);if(S.structure.didClose)for(let v of S.structure.didClose)r.closeTextDocument({textDocument:v}),u.push(v.uri)}if(S.data!==void 0){let _=new Map(S.data.map(v=>[v.document,v]));for(let v=0;v<=s.cells.length;v++){let R=_.get(s.cells[v].document);if(R!==void 0){let D=s.cells.splice(v,1,R);if(d.push({old:D[0],new:R}),_.delete(R.document),_.size===0)break}}}if(S.textContent!==void 0)for(let _ of S.textContent)r.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),f.push(_.document.uri)}this.updateCellMap(s);let p={notebookDocument:s};a&&(p.metadata={old:o,new:s.metadata});let g=[];for(let S of l)g.push(this.getNotebookCell(S));let h=[];for(let S of u)h.push(this.getNotebookCell(S));let T=[];for(let S of f)T.push(this.getNotebookCell(S));(g.length>0||h.length>0||d.length>0||T.length>0)&&(p.cells={added:g,removed:h,changed:{data:d,textContent:T}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),en.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};jo.NotebookDocuments=gy});var MP=k(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.MonikerFeature=void 0;var oj=wt(),aj=t=>class extends t{get moniker(){return{on:e=>{let r=oj.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Vd.MonikerFeature=aj});var Ny=k(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.createConnection=Ue.combineFeatures=Ue.combineNotebooksFeatures=Ue.combineLanguagesFeatures=Ue.combineWorkspaceFeatures=Ue.combineWindowFeatures=Ue.combineClientFeatures=Ue.combineTracerFeatures=Ue.combineTelemetryFeatures=Ue.combineConsoleFeatures=Ue._NotebooksImpl=Ue._LanguagesImpl=Ue.BulkUnregistration=Ue.BulkRegistration=Ue.ErrorMessageTracker=void 0;var Y=wt(),tn=Bu(),vy=oy(),me=vP(),cj=bP(),lj=_P(),uj=SP(),dj=dy(),fj=NP(),pj=kP(),hj=RP(),mj=PP(),gj=wP(),yj=CP(),Tj=AP(),vj=OP(),bj=yy(),_j=MP();function Ty(t){if(t!==null)return t}var by=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Ue.ErrorMessageTracker=by;var zd=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(Y.MessageType.Error,e)}warn(e){this.send(Y.MessageType.Warning,e)}info(e){this.send(Y.MessageType.Info,e)}log(e){this.send(Y.MessageType.Log,e)}debug(e){this.send(Y.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Y.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Y.RAL)().console.error("Sending log message failed")})}},_y=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,...r){let n={type:Y.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(Ty)}showWarningMessage(e,...r){let n={type:Y.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(Ty)}showInformationMessage(e,...r){let n={type:Y.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Y.ShowMessageRequest.type,n).then(Ty)}},xP=(0,fj.ShowDocumentFeature)((0,me.ProgressFeature)(_y)),LP;(function(t){function e(){return new Wd}t.create=e})(LP||(Ue.BulkRegistration=LP={}));var Wd=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=tn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=vy.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},qP;(function(t){function e(){return new pc(void 0,[])}t.create=e})(qP||(Ue.BulkUnregistration=qP={}));var pc=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Y.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=tn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(Y.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Gd=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,r,n){return e instanceof Wd?this.registerMany(e):e instanceof pc?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=tn.string(r)?r:r.method,s=vy.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Y.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=tn.string(e)?e:e.method,i=vy.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Y.RegistrationRequest.type,s).then(o=>Y.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Y.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Y.RegistrationRequest.type,r).then(()=>new pc(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},Sy=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(Y.ApplyWorkspaceEditRequest.type,n)}},$P=(0,pj.FileOperationsFeature)((0,lj.WorkspaceFoldersFeature)((0,cj.ConfigurationFeature)(Sy))),Yd=class{constructor(){this._trace=Y.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,r){this._trace!==Y.Trace.Off&&this.connection.sendNotification(Y.LogTraceNotification.type,{message:e,verbose:this._trace===Y.Trace.Verbose?r:void 0}).catch(()=>{})}},Kd=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(Y.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Xd=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,me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,me.attachPartialResult)(this.connection,r)}};Ue._LanguagesImpl=Xd;var BP=(0,yj.FoldingRangeFeature)((0,_j.MonikerFeature)((0,vj.DiagnosticFeature)((0,Tj.InlayHintFeature)((0,gj.InlineValueFeature)((0,mj.TypeHierarchyFeature)((0,hj.LinkedEditingRangeFeature)((0,dj.SemanticTokensFeature)((0,uj.CallHierarchyFeature)(Xd))))))))),Jd=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,me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,me.attachPartialResult)(this.connection,r)}};Ue._NotebooksImpl=Jd;var FP=(0,bj.NotebookSyncFeature)(Jd);function jP(t,e){return function(r){return e(t(r))}}Ue.combineConsoleFeatures=jP;function UP(t,e){return function(r){return e(t(r))}}Ue.combineTelemetryFeatures=UP;function HP(t,e){return function(r){return e(t(r))}}Ue.combineTracerFeatures=HP;function VP(t,e){return function(r){return e(t(r))}}Ue.combineClientFeatures=VP;function zP(t,e){return function(r){return e(t(r))}}Ue.combineWindowFeatures=zP;function WP(t,e){return function(r){return e(t(r))}}Ue.combineWorkspaceFeatures=WP;function GP(t,e){return function(r){return e(t(r))}}Ue.combineLanguagesFeatures=GP;function YP(t,e){return function(r){return e(t(r))}}Ue.combineNotebooksFeatures=YP;function Sj(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:r(t.console,e.console,jP),tracer:r(t.tracer,e.tracer,HP),telemetry:r(t.telemetry,e.telemetry,UP),client:r(t.client,e.client,VP),window:r(t.window,e.window,zP),workspace:r(t.workspace,e.workspace,WP),languages:r(t.languages,e.languages,GP),notebooks:r(t.notebooks,e.notebooks,YP)}}Ue.combineFeatures=Sj;function Nj(t,e,r){let n=r&&r.console?new(r.console(zd)):new zd,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(Yd)):new Yd,o=r&&r.telemetry?new(r.telemetry(Kd)):new Kd,a=r&&r.client?new(r.client(Gd)):new Gd,c=r&&r.window?new(r.window(xP)):new xP,l=r&&r.workspace?new(r.workspace($P)):new $P,u=r&&r.languages?new(r.languages(BP)):new BP,d=r&&r.notebooks?new(r.notebooks(FP)):new FP,f=[n,s,o,a,c,l,u,d];function p(_){return _ instanceof Promise?_:tn.thenable(_)?new Promise((v,R)=>{_.then(D=>v(D),D=>R(D))}):Promise.resolve(_)}let g,h,T,S={listen:()=>i.listen(),sendRequest:(_,...v)=>i.sendRequest(tn.string(_)?_:_.method,...v),onRequest:(_,v)=>i.onRequest(_,v),sendNotification:(_,v)=>{let R=tn.string(_)?_:_.method;return i.sendNotification(R,v)},onNotification:(_,v)=>i.onNotification(_,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:_=>(h=_,{dispose:()=>{h=void 0}}),onInitialized:_=>i.onNotification(Y.InitializedNotification.type,_),onShutdown:_=>(g=_,{dispose:()=>{g=void 0}}),onExit:_=>(T=_,{dispose:()=>{T=void 0}}),get console(){return n},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:_=>i.onNotification(Y.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>i.onNotification(Y.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>i.onNotification(Y.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>i.onNotification(Y.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>i.onNotification(Y.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>i.onNotification(Y.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>i.onRequest(Y.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>i.onNotification(Y.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>i.sendNotification(Y.PublishDiagnosticsNotification.type,_),onHover:_=>i.onRequest(Y.HoverRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onCompletion:_=>i.onRequest(Y.CompletionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCompletionResolve:_=>i.onRequest(Y.CompletionResolveRequest.type,_),onSignatureHelp:_=>i.onRequest(Y.SignatureHelpRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDeclaration:_=>i.onRequest(Y.DeclarationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDefinition:_=>i.onRequest(Y.DefinitionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onTypeDefinition:_=>i.onRequest(Y.TypeDefinitionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onImplementation:_=>i.onRequest(Y.ImplementationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onReferences:_=>i.onRequest(Y.ReferencesRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentHighlight:_=>i.onRequest(Y.DocumentHighlightRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentSymbol:_=>i.onRequest(Y.DocumentSymbolRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onWorkspaceSymbol:_=>i.onRequest(Y.WorkspaceSymbolRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:_=>i.onRequest(Y.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>i.onRequest(Y.CodeActionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCodeActionResolve:_=>i.onRequest(Y.CodeActionResolveRequest.type,(v,R)=>_(v,R)),onCodeLens:_=>i.onRequest(Y.CodeLensRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCodeLensResolve:_=>i.onRequest(Y.CodeLensResolveRequest.type,(v,R)=>_(v,R)),onDocumentFormatting:_=>i.onRequest(Y.DocumentFormattingRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:_=>i.onRequest(Y.DocumentRangeFormattingRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:_=>i.onRequest(Y.DocumentOnTypeFormattingRequest.type,(v,R)=>_(v,R)),onRenameRequest:_=>i.onRequest(Y.RenameRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onPrepareRename:_=>i.onRequest(Y.PrepareRenameRequest.type,(v,R)=>_(v,R)),onDocumentLinks:_=>i.onRequest(Y.DocumentLinkRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentLinkResolve:_=>i.onRequest(Y.DocumentLinkResolveRequest.type,(v,R)=>_(v,R)),onDocumentColor:_=>i.onRequest(Y.DocumentColorRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onColorPresentation:_=>i.onRequest(Y.ColorPresentationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onFoldingRanges:_=>i.onRequest(Y.FoldingRangeRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onSelectionRanges:_=>i.onRequest(Y.SelectionRangeRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onExecuteCommand:_=>i.onRequest(Y.ExecuteCommandRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let _ of f)_.attach(S);return i.onRequest(Y.InitializeRequest.type,_=>{e.initialize(_),tn.string(_.trace)&&(s.trace=Y.Trace.fromString(_.trace));for(let v of f)v.initialize(_.capabilities);if(h){let v=h(_,new Y.CancellationTokenSource().token,(0,me.attachWorkDone)(i,_),void 0);return p(v).then(R=>{if(R instanceof Y.ResponseError)return R;let D=R;D||(D={capabilities:{}});let B=D.capabilities;B||(B={},D.capabilities=B),B.textDocumentSync===void 0||B.textDocumentSync===null?B.textDocumentSync=tn.number(S.__textDocumentSync)?S.__textDocumentSync:Y.TextDocumentSyncKind.None:!tn.number(B.textDocumentSync)&&!tn.number(B.textDocumentSync.change)&&(B.textDocumentSync.change=tn.number(S.__textDocumentSync)?S.__textDocumentSync:Y.TextDocumentSyncKind.None);for(let M of f)M.fillServerCapabilities(B);return D})}else{let v={capabilities:{textDocumentSync:Y.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(Y.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,g)return g(new Y.CancellationTokenSource().token)}),i.onNotification(Y.ExitNotification.type,()=>{try{T&&T()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(Y.SetTraceNotification.type,_=>{s.trace=Y.Trace.fromString(_.value)}),S}Ue.createConnection=Nj});var KP=k(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.resolveModulePath=wr.FileSystem=wr.resolveGlobalYarnPath=wr.resolveGlobalNodePath=wr.resolve=wr.uriToFilePath=void 0;var kj=require("url"),Dn=require("path"),ky=require("fs"),wy=require("child_process");function Rj(t){let e=kj.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift()}return Dn.normalize(r.join("/"))}wr.uriToFilePath=Rj;function Ry(){return process.platform==="win32"}function Qd(t,e,r,n){let i="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&&ky.existsSync(e)&&(l[i]?l[i]=e+Dn.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,wy.fork)("",[],{cwd:r,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}wr.resolve=Qd;function Py(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Ry()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,wy.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Ry()?Dn.join(o,"node_modules"):Dn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}wr.resolveGlobalNodePath=Py;function Pj(t){let e="yarn",r={encoding:"utf8"};Ry()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,wy.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.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 Dn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}wr.resolveGlobalYarnPath=Pj;var Ey;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ky.existsSync(__filename.toUpperCase())||!ky.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?Dn.normalize(s).indexOf(Dn.normalize(i))===0:Dn.normalize(s).toLowerCase().indexOf(Dn.normalize(i).toLowerCase())===0}t.isParent=n})(Ey||(wr.FileSystem=Ey={}));function Ej(t,e,r,n){return r?(Dn.isAbsolute(r)||(r=Dn.join(t,r)),Qd(e,r,r,n).then(i=>Ey.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Qd(e,Py(n),t,n))):Qd(e,Py(n),t,n)}wr.resolveModulePath=Ej});var Dy=k((yQ,XP)=>{"use strict";XP.exports=wt()});var JP=k(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.InlineCompletionFeature=void 0;var wj=wt(),Dj=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(wj.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Zd.InlineCompletionFeature=Dj});var eE=k(ar=>{"use strict";var Cj=ar&&ar.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZP=ar&&ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cj(e,t,r)};Object.defineProperty(ar,"__esModule",{value:!0});ar.ProposedFeatures=ar.NotebookDocuments=ar.TextDocuments=ar.SemanticTokensBuilder=void 0;var Aj=dy();Object.defineProperty(ar,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Aj.SemanticTokensBuilder}});var Oj=JP();ZP(wt(),ar);var Ij=my();Object.defineProperty(ar,"TextDocuments",{enumerable:!0,get:function(){return Ij.TextDocuments}});var Mj=yy();Object.defineProperty(ar,"NotebookDocuments",{enumerable:!0,get:function(){return Mj.NotebookDocuments}});ZP(Ny(),ar);var QP;(function(t){t.all={__brand:"features",languages:Oj.InlineCompletionFeature}})(QP||(ar.ProposedFeatures=QP={}))});var H=k(rn=>{"use strict";var xj=rn&&rn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iE=rn&&rn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xj(e,t,r)};Object.defineProperty(rn,"__esModule",{value:!0});rn.createConnection=rn.Files=void 0;var tE=require("node:util"),Cy=Bu(),Lj=Ny(),hc=KP(),Us=Dy();iE(Dy(),rn);iE(eE(),rn);var rE;(function(t){t.uriToFilePath=hc.uriToFilePath,t.resolveGlobalNodePath=hc.resolveGlobalNodePath,t.resolveGlobalYarnPath=hc.resolveGlobalYarnPath,t.resolve=hc.resolve,t.resolveModulePath=hc.resolveModulePath})(rE||(rn.Files=rE={}));var nE;function ef(){if(nE!==void 0)try{nE.end()}catch{}}var Uo=!1,sE;function qj(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(sE=setInterval(()=>{try{process.kill(n,0)}catch{ef(),process.exit(Uo?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}qj();var $j={initialize:t=>{let e=t.processId;Cy.number(e)&&sE===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Uo?0:1)}},3e3)},get shutdownReceived(){return Uo},set shutdownReceived(t){Uo=t},exit:t=>{ef(),process.exit(t)}};function Bj(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Us.ConnectionStrategy.is(t)||Us.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),Fj(s,o,a,i)}rn.createConnection=Bj;function Fj(t,e,r,n){let i=!1;if(!t&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){t=new Us.IPCMessageReader(process),e=new Us.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var s=f.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,Us.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,Us.createServerPipeTransport)(l);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Cy.func(t.read)&&Cy.func(t.on)){let c=t;c.on("end",()=>{ef(),process.exit(Uo?0:1)}),c.on("close",()=>{ef(),process.exit(Uo?0:1)})}let a=c=>{let l=(0,Us.createProtocolConnection)(t,e,c,r);return i&&jj(c),l};return(0,Lj.createConnection)(a,$j,n)}function jj(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,tE.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=r.get(s)??0;o+=1,r.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,tE.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
37
- ${s}`)},console.warn=function(...i){t.warn(e(i))}}});var aE=k((SQ,oE)=>{"use strict";oE.exports=H()});var KO=k((LSe,YO)=>{"use strict";YO.exports=WO;function WO(t,e,r){t instanceof RegExp&&(t=zO(t,r)),e instanceof RegExp&&(e=zO(e,r));var n=GO(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function zO(t,e){var r=e.match(t);return r?r[0]:null}WO.range=GO;function GO(t,e,r){var n,i,s,o,a,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(n=[],s=r.length;u>=0&&!a;)u==c?(n.push(u),c=r.indexOf(t,u+1)):n.length==1?a=[n.pop(),l]:(i=n.pop(),i<s&&(s=i,o=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;n.length&&(a=[s,o])}return a}});var nI=k((qSe,rI)=>{var XO=KO();rI.exports=sH;var JO="\0SLASH"+Math.random()+"\0",QO="\0OPEN"+Math.random()+"\0",hT="\0CLOSE"+Math.random()+"\0",ZO="\0COMMA"+Math.random()+"\0",eI="\0PERIOD"+Math.random()+"\0";function pT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function nH(t){return t.split("\\\\").join(JO).split("\\{").join(QO).split("\\}").join(hT).split("\\,").join(ZO).split("\\.").join(eI)}function iH(t){return t.split(JO).join("\\").split(QO).join("{").split(hT).join("}").split(ZO).join(",").split(eI).join(".")}function tI(t){if(!t)return[""];var e=[],r=XO("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var a=tI(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function sH(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),zc(nH(t),!0).map(iH)):[]}function oH(t){return"{"+t+"}"}function aH(t){return/^-?0\d/.test(t)}function cH(t,e){return t<=e}function lH(t,e){return t>=e}function zc(t,e){var r=[],n=XO("{","}",t);if(!n)return[t];var i=n.pre,s=n.post.length?zc(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var a=i+"{"+n.body+"}"+s[o];r.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=c||l,d=n.body.indexOf(",")>=0;if(!u&&!d)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+hT+n.post,zc(t)):[t];var f;if(u)f=n.body.split(/\.\./);else if(f=tI(n.body),f.length===1&&(f=zc(f[0],!1).map(oH),f.length===1))return s.map(function(Je){return n.pre+f[0]+Je});var p;if(u){var g=pT(f[0]),h=pT(f[1]),T=Math.max(f[0].length,f[1].length),S=f.length==3?Math.abs(pT(f[2])):1,_=cH,v=h<g;v&&(S*=-1,_=lH);var R=f.some(aH);p=[];for(var D=g;_(D,h);D+=S){var B;if(l)B=String.fromCharCode(D),B==="\\"&&(B="");else if(B=String(D),R){var M=T-B.length;if(M>0){var F=new Array(M+1).join("0");D<0?B="-"+F+B.slice(1):B=F+B}}p.push(B)}}else{p=[];for(var ge=0;ge<f.length;ge++)p.push.apply(p,zc(f[ge],!1))}for(var ge=0;ge<p.length;ge++)for(var o=0;o<s.length;o++){var a=i+p[ge]+s[o];(!e||u||a)&&r.push(a)}}return r}});var Le=k(tr=>{"use strict";var OT=Symbol.for("yaml.alias"),VI=Symbol.for("yaml.document"),Wp=Symbol.for("yaml.map"),zI=Symbol.for("yaml.pair"),IT=Symbol.for("yaml.scalar"),Gp=Symbol.for("yaml.seq"),Ai=Symbol.for("yaml.node.type"),yV=t=>!!t&&typeof t=="object"&&t[Ai]===OT,TV=t=>!!t&&typeof t=="object"&&t[Ai]===VI,vV=t=>!!t&&typeof t=="object"&&t[Ai]===Wp,bV=t=>!!t&&typeof t=="object"&&t[Ai]===zI,WI=t=>!!t&&typeof t=="object"&&t[Ai]===IT,_V=t=>!!t&&typeof t=="object"&&t[Ai]===Gp;function GI(t){if(t&&typeof t=="object")switch(t[Ai]){case Wp:case Gp:return!0}return!1}function SV(t){if(t&&typeof t=="object")switch(t[Ai]){case OT:case Wp:case IT:case Gp:return!0}return!1}var NV=t=>(WI(t)||GI(t))&&!!t.anchor;tr.ALIAS=OT;tr.DOC=VI;tr.MAP=Wp;tr.NODE_TYPE=Ai;tr.PAIR=zI;tr.SCALAR=IT;tr.SEQ=Gp;tr.hasAnchor=NV;tr.isAlias=yV;tr.isCollection=GI;tr.isDocument=TV;tr.isMap=vV;tr.isNode=SV;tr.isPair=bV;tr.isScalar=WI;tr.isSeq=_V});var al=k(MT=>{"use strict";var Ht=Le(),Lr=Symbol("break visit"),YI=Symbol("skip children"),ci=Symbol("remove node");function Yp(t,e){let r=KI(e);Ht.isDocument(t)?ba(null,t.contents,r,Object.freeze([t]))===ci&&(t.contents=null):ba(null,t,r,Object.freeze([]))}Yp.BREAK=Lr;Yp.SKIP=YI;Yp.REMOVE=ci;function ba(t,e,r,n){let i=XI(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return JI(t,n,i),ba(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=ba(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Lr)return Lr;o===ci&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=ba("key",e.key,r,n);if(s===Lr)return Lr;s===ci&&(e.key=null);let o=ba("value",e.value,r,n);if(o===Lr)return Lr;o===ci&&(e.value=null)}}return i}async function Kp(t,e){let r=KI(e);Ht.isDocument(t)?await _a(null,t.contents,r,Object.freeze([t]))===ci&&(t.contents=null):await _a(null,t,r,Object.freeze([]))}Kp.BREAK=Lr;Kp.SKIP=YI;Kp.REMOVE=ci;async function _a(t,e,r,n){let i=await XI(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return JI(t,n,i),_a(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await _a(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Lr)return Lr;o===ci&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await _a("key",e.key,r,n);if(s===Lr)return Lr;s===ci&&(e.key=null);let o=await _a("value",e.value,r,n);if(o===Lr)return Lr;o===ci&&(e.value=null)}}return i}function KI(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function XI(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ht.isMap(e))return r.Map?.(t,e,n);if(Ht.isSeq(e))return r.Seq?.(t,e,n);if(Ht.isPair(e))return r.Pair?.(t,e,n);if(Ht.isScalar(e))return r.Scalar?.(t,e,n);if(Ht.isAlias(e))return r.Alias?.(t,e,n)}function JI(t,e,r){let n=e[e.length-1];if(Ht.isCollection(n))n.items[t]=r;else if(Ht.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ht.isDocument(n))n.contents=r;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}MT.visit=Yp;MT.visitAsync=Kp});var xT=k(ZI=>{"use strict";var QI=Le(),kV=al(),RV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PV=t=>t.replace(/[!,[\]{}]/g,e=>RV[e]),cl=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+PV(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&QI.isNode(e.contents)){let s={};kV.visit(e.contents,(o,a)=>{QI.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
38
- `)}};cl.defaultYaml={explicit:!1,version:"1.2"};cl.defaultTags={"!!":"tag:yaml.org,2002:"};ZI.Directives=cl});var Xp=k(ll=>{"use strict";var eM=Le(),EV=al();function wV(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function tM(t){let e=new Set;return EV.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function rM(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function DV(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i||(i=tM(t));let o=rM(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(eM.isScalar(o.node)||eM.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:n}}ll.anchorIsValid=wV;ll.anchorNames=tM;ll.createNodeAnchors=DV;ll.findNewAnchor=rM});var LT=k(nM=>{"use strict";function ul(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],a=ul(t,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=ul(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=ul(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let o=ul(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}nM.applyReviver=ul});var fs=k(sM=>{"use strict";var CV=Le();function iM(t,e,r){if(Array.isArray(t))return t.map((n,i)=>iM(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!CV.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}sM.toJS=iM});var Jp=k(aM=>{"use strict";var AV=LT(),oM=Le(),OV=fs(),qT=class{constructor(e){Object.defineProperty(this,oM.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:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!oM.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=OV.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?AV.applyReviver(s,{"":a},"",a):a}};aM.NodeBase=qT});var dl=k(lM=>{"use strict";var IV=Xp(),cM=al(),Qp=Le(),MV=Jp(),xV=fs(),$T=class extends MV.NodeBase{constructor(e){super(Qp.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let r;return cM.visit(e,{Node:(n,i)=>{if(i===this)return cM.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(xV.toJS(o,null,r),a=n.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=Zp(i,o,n)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(IV.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`${i} `}return i}};function Zp(t,e,r){if(Qp.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Qp.isCollection(e)){let n=0;for(let i of e.items){let s=Zp(t,i,r);s>n&&(n=s)}return n}else if(Qp.isPair(e)){let n=Zp(t,e.key,r),i=Zp(t,e.value,r);return Math.max(n,i)}return 1}lM.Alias=$T});var $t=k(BT=>{"use strict";var LV=Le(),qV=Jp(),$V=fs(),BV=t=>!t||typeof t!="function"&&typeof t!="object",ps=class extends qV.NodeBase{constructor(e){super(LV.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:$V.toJS(this.value,e,r)}toString(){return String(this.value)}};ps.BLOCK_FOLDED="BLOCK_FOLDED";ps.BLOCK_LITERAL="BLOCK_LITERAL";ps.PLAIN="PLAIN";ps.QUOTE_DOUBLE="QUOTE_DOUBLE";ps.QUOTE_SINGLE="QUOTE_SINGLE";BT.Scalar=ps;BT.isScalarValue=BV});var fl=k(dM=>{"use strict";var FV=dl(),Ks=Le(),uM=$t(),jV="tag:yaml.org,2002:";function UV(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function HV(t,e,r){if(Ks.isDocument(t)&&(t=t.contents),Ks.isNode(t))return t;if(Ks.isPair(t)){let d=r.schema[Ks.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new FV.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=jV+e.slice(2));let l=UV(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new uM.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Ks.MAP]:Symbol.iterator in Object(t)?o[Ks.SEQ]:o[Ks.MAP]}s&&(s(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new uM.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}dM.createNode=HV});var th=k(eh=>{"use strict";var VV=fl(),li=Le(),zV=Jp();function FT(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return VV.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var fM=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,jT=class extends zV.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>li.isNode(n)||li.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(fM(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(li.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,FT(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(li.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&li.isScalar(s)?s.value:s:li.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!li.isPair(r))return!1;let n=r.value;return n==null||e&&li.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return li.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(li.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,FT(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};eh.Collection=jT;eh.collectionFromPath=FT;eh.isEmptyPath=fM});var pl=k(rh=>{"use strict";var WV=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function UT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var GV=(t,e,r)=>t.endsWith(`
34
+ `,"\r"];var qS;(function(y){function w(D,q,ye,Rt){return new vB(D,q,ye,Rt)}y.create=w;function E(D){var q=D;return!!(A.defined(q)&&A.string(q.uri)&&(A.undefined(q.languageId)||A.string(q.languageId))&&A.uinteger(q.lineCount)&&A.func(q.getText)&&A.func(q.positionAt)&&A.func(q.offsetAt))}y.is=E;function b(D,q){for(var ye=D.getText(),Rt=m(q,function(bo,$u){var $S=bo.range.start.line-$u.range.start.line;return $S===0?bo.range.start.character-$u.range.start.character:$S}),at=ye.length,Rn=Rt.length-1;Rn>=0;Rn--){var Pn=Rt[Rn],yi=D.offsetAt(Pn.range.start),De=D.offsetAt(Pn.range.end);if(De<=at)ye=ye.substring(0,yi)+Pn.newText+ye.substring(De,ye.length);else throw new Error("Overlapping edit");at=yi}return ye}y.applyEdits=b;function m(D,q){if(D.length<=1)return D;var ye=D.length/2|0,Rt=D.slice(0,ye),at=D.slice(ye);m(Rt,q),m(at,q);for(var Rn=0,Pn=0,yi=0;Rn<Rt.length&&Pn<at.length;){var De=q(Rt[Rn],at[Pn]);De<=0?D[yi++]=Rt[Rn++]:D[yi++]=at[Pn++]}for(;Rn<Rt.length;)D[yi++]=Rt[Rn++];for(;Pn<at.length;)D[yi++]=at[Pn++];return D}})(qS||(e.TextDocument=qS={}));var vB=function(){function y(w,E,b,m){this._uri=w,this._languageId=E,this._version=b,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(y.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),y.prototype.getText=function(w){if(w){var E=this.offsetAt(w.start),b=this.offsetAt(w.end);return this._content.substring(E,b)}return this._content},y.prototype.update=function(w,E){this._content=w.text,this._version=E,this._lineOffsets=void 0},y.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var w=[],E=this._content,b=!0,m=0;m<E.length;m++){b&&(w.push(m),b=!1);var D=E.charAt(m);b=D==="\r"||D===`
35
+ `,D==="\r"&&m+1<E.length&&E.charAt(m+1)===`
36
+ `&&m++}b&&E.length>0&&w.push(E.length),this._lineOffsets=w}return this._lineOffsets},y.prototype.positionAt=function(w){w=Math.max(Math.min(w,this._content.length),0);var E=this.getLineOffsets(),b=0,m=E.length;if(m===0)return o.create(0,w);for(;b<m;){var D=Math.floor((b+m)/2);E[D]>w?m=D:b=D+1}var q=b-1;return o.create(q,w-E[q])},y.prototype.offsetAt=function(w){var E=this.getLineOffsets();if(w.line>=E.length)return this._content.length;if(w.line<0)return 0;var b=E[w.line],m=w.line+1<E.length?E[w.line+1]:this._content.length;return Math.max(Math.min(b+w.character,m),b)},Object.defineProperty(y.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),y}(),A;(function(y){var w=Object.prototype.toString;function E(De){return typeof De<"u"}y.defined=E;function b(De){return typeof De>"u"}y.undefined=b;function m(De){return De===!0||De===!1}y.boolean=m;function D(De){return w.call(De)==="[object String]"}y.string=D;function q(De){return w.call(De)==="[object Number]"}y.number=q;function ye(De,bo,$u){return w.call(De)==="[object Number]"&&bo<=De&&De<=$u}y.numberRange=ye;function Rt(De){return w.call(De)==="[object Number]"&&-2147483648<=De&&De<=2147483647}y.integer=Rt;function at(De){return w.call(De)==="[object Number]"&&0<=De&&De<=2147483647}y.uinteger=at;function Rn(De){return w.call(De)==="[object Function]"}y.func=Rn;function Pn(De){return De!==null&&typeof De=="object"}y.objectLiteral=Pn;function yi(De,bo){return Array.isArray(De)&&De.every(bo)}y.typedArray=yi})(A||(A={}))})});var vt=k(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.ProtocolNotificationType=Rr.ProtocolNotificationType0=Rr.ProtocolRequestType=Rr.ProtocolRequestType0=Rr.RegistrationType=Rr.MessageDirection=void 0;var Co=$s(),vN;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(vN||(Rr.MessageDirection=vN={}));var Vg=class{constructor(e){this.method=e}};Rr.RegistrationType=Vg;var zg=class extends Co.RequestType0{constructor(e){super(e)}};Rr.ProtocolRequestType0=zg;var Wg=class extends Co.RequestType{constructor(e){super(e,Co.ParameterStructures.byName)}};Rr.ProtocolRequestType=Wg;var Gg=class extends Co.NotificationType0{constructor(e){super(e)}};Rr.ProtocolNotificationType0=Gg;var Kg=class extends Co.NotificationType{constructor(e){super(e,Co.ParameterStructures.byName)}};Rr.ProtocolNotificationType=Kg});var ld=k(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.objectLiteral=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function pF(t){return t===!0||t===!1}xt.boolean=pF;function bN(t){return typeof t=="string"||t instanceof String}xt.string=bN;function hF(t){return typeof t=="number"||t instanceof Number}xt.number=hF;function mF(t){return t instanceof Error}xt.error=mF;function gF(t){return typeof t=="function"}xt.func=gF;function _N(t){return Array.isArray(t)}xt.array=_N;function yF(t){return _N(t)&&t.every(e=>bN(e))}xt.stringArray=yF;function TF(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=TF;function vF(t){return t!==null&&typeof t=="object"}xt.objectLiteral=vF});var kN=k(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.ImplementationRequest=void 0;var SN=vt(),NN;(function(t){t.method="textDocument/implementation",t.messageDirection=SN.MessageDirection.clientToServer,t.type=new SN.ProtocolRequestType(t.method)})(NN||(ud.ImplementationRequest=NN={}))});var wN=k(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.TypeDefinitionRequest=void 0;var RN=vt(),PN;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=RN.MessageDirection.clientToServer,t.type=new RN.ProtocolRequestType(t.method)})(PN||(dd.TypeDefinitionRequest=PN={}))});var DN=k(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.DidChangeWorkspaceFoldersNotification=Do.WorkspaceFoldersRequest=void 0;var fd=vt(),EN;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=fd.MessageDirection.serverToClient,t.type=new fd.ProtocolRequestType0(t.method)})(EN||(Do.WorkspaceFoldersRequest=EN={}));var CN;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=fd.MessageDirection.clientToServer,t.type=new fd.ProtocolNotificationType(t.method)})(CN||(Do.DidChangeWorkspaceFoldersNotification=CN={}))});var ON=k(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ConfigurationRequest=void 0;var AN=vt(),IN;(function(t){t.method="workspace/configuration",t.messageDirection=AN.MessageDirection.serverToClient,t.type=new AN.ProtocolRequestType(t.method)})(IN||(pd.ConfigurationRequest=IN={}))});var LN=k(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.ColorPresentationRequest=Ao.DocumentColorRequest=void 0;var hd=vt(),MN;(function(t){t.method="textDocument/documentColor",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(MN||(Ao.DocumentColorRequest=MN={}));var xN;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(xN||(Ao.ColorPresentationRequest=xN={}))});var BN=k(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.FoldingRangeRefreshRequest=Io.FoldingRangeRequest=void 0;var md=vt(),qN;(function(t){t.method="textDocument/foldingRange",t.messageDirection=md.MessageDirection.clientToServer,t.type=new md.ProtocolRequestType(t.method)})(qN||(Io.FoldingRangeRequest=qN={}));var $N;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=md.MessageDirection.serverToClient,t.type=new md.ProtocolRequestType0(t.method)})($N||(Io.FoldingRangeRefreshRequest=$N={}))});var UN=k(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.DeclarationRequest=void 0;var FN=vt(),jN;(function(t){t.method="textDocument/declaration",t.messageDirection=FN.MessageDirection.clientToServer,t.type=new FN.ProtocolRequestType(t.method)})(jN||(gd.DeclarationRequest=jN={}))});var zN=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.SelectionRangeRequest=void 0;var HN=vt(),VN;(function(t){t.method="textDocument/selectionRange",t.messageDirection=HN.MessageDirection.clientToServer,t.type=new HN.ProtocolRequestType(t.method)})(VN||(yd.SelectionRangeRequest=VN={}))});var YN=k(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.WorkDoneProgressCancelNotification=Hi.WorkDoneProgressCreateRequest=Hi.WorkDoneProgress=void 0;var bF=$s(),Td=vt(),WN;(function(t){t.type=new bF.ProgressType;function e(r){return r===t.type}t.is=e})(WN||(Hi.WorkDoneProgress=WN={}));var GN;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Td.MessageDirection.serverToClient,t.type=new Td.ProtocolRequestType(t.method)})(GN||(Hi.WorkDoneProgressCreateRequest=GN={}));var KN;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Td.MessageDirection.clientToServer,t.type=new Td.ProtocolNotificationType(t.method)})(KN||(Hi.WorkDoneProgressCancelNotification=KN={}))});var ZN=k(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.CallHierarchyOutgoingCallsRequest=Vi.CallHierarchyIncomingCallsRequest=Vi.CallHierarchyPrepareRequest=void 0;var Oo=vt(),XN;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(XN||(Vi.CallHierarchyPrepareRequest=XN={}));var JN;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(JN||(Vi.CallHierarchyIncomingCallsRequest=JN={}));var QN;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(QN||(Vi.CallHierarchyOutgoingCallsRequest=QN={}))});var sk=k(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SemanticTokensRefreshRequest=Pr.SemanticTokensRangeRequest=Pr.SemanticTokensDeltaRequest=Pr.SemanticTokensRequest=Pr.SemanticTokensRegistrationType=Pr.TokenFormat=void 0;var vi=vt(),ek;(function(t){t.Relative="relative"})(ek||(Pr.TokenFormat=ek={}));var oc;(function(t){t.method="textDocument/semanticTokens",t.type=new vi.RegistrationType(t.method)})(oc||(Pr.SemanticTokensRegistrationType=oc={}));var tk;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(tk||(Pr.SemanticTokensRequest=tk={}));var rk;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(rk||(Pr.SemanticTokensDeltaRequest=rk={}));var nk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vi.MessageDirection.clientToServer,t.type=new vi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(nk||(Pr.SemanticTokensRangeRequest=nk={}));var ik;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vi.MessageDirection.serverToClient,t.type=new vi.ProtocolRequestType0(t.method)})(ik||(Pr.SemanticTokensRefreshRequest=ik={}))});var ck=k(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.ShowDocumentRequest=void 0;var ok=vt(),ak;(function(t){t.method="window/showDocument",t.messageDirection=ok.MessageDirection.serverToClient,t.type=new ok.ProtocolRequestType(t.method)})(ak||(vd.ShowDocumentRequest=ak={}))});var dk=k(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.LinkedEditingRangeRequest=void 0;var lk=vt(),uk;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=lk.MessageDirection.clientToServer,t.type=new lk.ProtocolRequestType(t.method)})(uk||(bd.LinkedEditingRangeRequest=uk={}))});var vk=k(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.WillDeleteFilesRequest=or.DidDeleteFilesNotification=or.DidRenameFilesNotification=or.WillRenameFilesRequest=or.DidCreateFilesNotification=or.WillCreateFilesRequest=or.FileOperationPatternKind=void 0;var Jr=vt(),fk;(function(t){t.file="file",t.folder="folder"})(fk||(or.FileOperationPatternKind=fk={}));var pk;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(pk||(or.WillCreateFilesRequest=pk={}));var hk;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(hk||(or.DidCreateFilesNotification=hk={}));var mk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(mk||(or.WillRenameFilesRequest=mk={}));var gk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(gk||(or.DidRenameFilesNotification=gk={}));var yk;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(yk||(or.DidDeleteFilesNotification=yk={}));var Tk;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(Tk||(or.WillDeleteFilesRequest=Tk={}))});var kk=k(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.MonikerRequest=zi.MonikerKind=zi.UniquenessLevel=void 0;var bk=vt(),_k;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(_k||(zi.UniquenessLevel=_k={}));var Sk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Sk||(zi.MonikerKind=Sk={}));var Nk;(function(t){t.method="textDocument/moniker",t.messageDirection=bk.MessageDirection.clientToServer,t.type=new bk.ProtocolRequestType(t.method)})(Nk||(zi.MonikerRequest=Nk={}))});var Ek=k(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.TypeHierarchySubtypesRequest=Wi.TypeHierarchySupertypesRequest=Wi.TypeHierarchyPrepareRequest=void 0;var Mo=vt(),Rk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(Rk||(Wi.TypeHierarchyPrepareRequest=Rk={}));var Pk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(Pk||(Wi.TypeHierarchySupertypesRequest=Pk={}));var wk;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(wk||(Wi.TypeHierarchySubtypesRequest=wk={}))});var Ak=k(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.InlineValueRefreshRequest=xo.InlineValueRequest=void 0;var _d=vt(),Ck;(function(t){t.method="textDocument/inlineValue",t.messageDirection=_d.MessageDirection.clientToServer,t.type=new _d.ProtocolRequestType(t.method)})(Ck||(xo.InlineValueRequest=Ck={}));var Dk;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=_d.MessageDirection.serverToClient,t.type=new _d.ProtocolRequestType0(t.method)})(Dk||(xo.InlineValueRefreshRequest=Dk={}))});var xk=k(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.InlayHintRefreshRequest=Gi.InlayHintResolveRequest=Gi.InlayHintRequest=void 0;var Lo=vt(),Ik;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(Ik||(Gi.InlayHintRequest=Ik={}));var Ok;(function(t){t.method="inlayHint/resolve",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(Ok||(Gi.InlayHintResolveRequest=Ok={}));var Mk;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Lo.MessageDirection.serverToClient,t.type=new Lo.ProtocolRequestType0(t.method)})(Mk||(Gi.InlayHintRefreshRequest=Mk={}))});var Uk=k(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DiagnosticRefreshRequest=Qr.WorkspaceDiagnosticRequest=Qr.DocumentDiagnosticRequest=Qr.DocumentDiagnosticReportKind=Qr.DiagnosticServerCancellationData=void 0;var jk=$s(),_F=ld(),qo=vt(),Lk;(function(t){function e(r){let n=r;return n&&_F.boolean(n.retriggerRequest)}t.is=e})(Lk||(Qr.DiagnosticServerCancellationData=Lk={}));var qk;(function(t){t.Full="full",t.Unchanged="unchanged"})(qk||(Qr.DocumentDiagnosticReportKind=qk={}));var $k;(function(t){t.method="textDocument/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new jk.ProgressType})($k||(Qr.DocumentDiagnosticRequest=$k={}));var Bk;(function(t){t.method="workspace/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new jk.ProgressType})(Bk||(Qr.WorkspaceDiagnosticRequest=Bk={}));var Fk;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=qo.MessageDirection.serverToClient,t.type=new qo.ProtocolRequestType0(t.method)})(Fk||(Qr.DiagnosticRefreshRequest=Fk={}))});var Yk=k(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.DidCloseNotebookDocumentNotification=Pt.DidSaveNotebookDocumentNotification=Pt.DidChangeNotebookDocumentNotification=Pt.NotebookCellArrayChange=Pt.DidOpenNotebookDocumentNotification=Pt.NotebookDocumentSyncRegistrationType=Pt.NotebookDocument=Pt.NotebookCell=Pt.ExecutionSummary=Pt.NotebookCellKind=void 0;var ac=cd(),En=ld(),Wn=vt(),Yg;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Yg||(Pt.NotebookCellKind=Yg={}));var Xg;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return En.objectLiteral(s)&&ac.uinteger.is(s.executionOrder)&&(s.success===void 0||En.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Xg||(Pt.ExecutionSummary=Xg={}));var Sd;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function r(s){let o=s;return En.objectLiteral(o)&&Yg.is(o.kind)&&ac.DocumentUri.is(o.document)&&(o.metadata===void 0||En.objectLiteral(o.metadata))}t.is=r;function n(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)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Xg.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(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(!i(s[l],o[l]))return!1}if(En.objectLiteral(s)&&En.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!i(s[f],o[f]))return!1}}return!0}})(Sd||(Pt.NotebookCell=Sd={}));var Hk;(function(t){function e(n,i,s,o){return{uri:n,notebookType:i,version:s,cells:o}}t.create=e;function r(n){let i=n;return En.objectLiteral(i)&&En.string(i.uri)&&ac.integer.is(i.version)&&En.typedArray(i.cells,Sd.is)}t.is=r})(Hk||(Pt.NotebookDocument=Hk={}));var $o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.RegistrationType(t.method)})($o||(Pt.NotebookDocumentSyncRegistrationType=$o={}));var Vk;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Vk||(Pt.DidOpenNotebookDocumentNotification=Vk={}));var zk;(function(t){function e(n){let i=n;return En.objectLiteral(i)&&ac.uinteger.is(i.start)&&ac.uinteger.is(i.deleteCount)&&(i.cells===void 0||En.typedArray(i.cells,Sd.is))}t.is=e;function r(n,i,s){let o={start:n,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=r})(zk||(Pt.NotebookCellArrayChange=zk={}));var Wk;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Wk||(Pt.DidChangeNotebookDocumentNotification=Wk={}));var Gk;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Gk||(Pt.DidSaveNotebookDocumentNotification=Gk={}));var Kk;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=$o.method})(Kk||(Pt.DidCloseNotebookDocumentNotification=Kk={}))});var Qk=k(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.InlineCompletionRequest=void 0;var Xk=vt(),Jk;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Xk.MessageDirection.clientToServer,t.type=new Xk.ProtocolRequestType(t.method)})(Jk||(Nd.InlineCompletionRequest=Jk={}))});var dP=k(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.WorkspaceSymbolRequest=N.CodeActionResolveRequest=N.CodeActionRequest=N.DocumentSymbolRequest=N.DocumentHighlightRequest=N.ReferencesRequest=N.DefinitionRequest=N.SignatureHelpRequest=N.SignatureHelpTriggerKind=N.HoverRequest=N.CompletionResolveRequest=N.CompletionRequest=N.CompletionTriggerKind=N.PublishDiagnosticsNotification=N.WatchKind=N.RelativePattern=N.FileChangeType=N.DidChangeWatchedFilesNotification=N.WillSaveTextDocumentWaitUntilRequest=N.WillSaveTextDocumentNotification=N.TextDocumentSaveReason=N.DidSaveTextDocumentNotification=N.DidCloseTextDocumentNotification=N.DidChangeTextDocumentNotification=N.TextDocumentContentChangeEvent=N.DidOpenTextDocumentNotification=N.TextDocumentSyncKind=N.TelemetryEventNotification=N.LogMessageNotification=N.ShowMessageRequest=N.ShowMessageNotification=N.MessageType=N.DidChangeConfigurationNotification=N.ExitNotification=N.ShutdownRequest=N.InitializedNotification=N.InitializeErrorCodes=N.InitializeRequest=N.WorkDoneProgressOptions=N.TextDocumentRegistrationOptions=N.StaticRegistrationOptions=N.PositionEncodingKind=N.FailureHandlingKind=N.ResourceOperationKind=N.UnregistrationRequest=N.RegistrationRequest=N.DocumentSelector=N.NotebookCellTextDocumentFilter=N.NotebookDocumentFilter=N.TextDocumentFilter=void 0;N.MonikerRequest=N.MonikerKind=N.UniquenessLevel=N.WillDeleteFilesRequest=N.DidDeleteFilesNotification=N.WillRenameFilesRequest=N.DidRenameFilesNotification=N.WillCreateFilesRequest=N.DidCreateFilesNotification=N.FileOperationPatternKind=N.LinkedEditingRangeRequest=N.ShowDocumentRequest=N.SemanticTokensRegistrationType=N.SemanticTokensRefreshRequest=N.SemanticTokensRangeRequest=N.SemanticTokensDeltaRequest=N.SemanticTokensRequest=N.TokenFormat=N.CallHierarchyPrepareRequest=N.CallHierarchyOutgoingCallsRequest=N.CallHierarchyIncomingCallsRequest=N.WorkDoneProgressCancelNotification=N.WorkDoneProgressCreateRequest=N.WorkDoneProgress=N.SelectionRangeRequest=N.DeclarationRequest=N.FoldingRangeRefreshRequest=N.FoldingRangeRequest=N.ColorPresentationRequest=N.DocumentColorRequest=N.ConfigurationRequest=N.DidChangeWorkspaceFoldersNotification=N.WorkspaceFoldersRequest=N.TypeDefinitionRequest=N.ImplementationRequest=N.ApplyWorkspaceEditRequest=N.ExecuteCommandRequest=N.PrepareRenameRequest=N.RenameRequest=N.PrepareSupportDefaultBehavior=N.DocumentOnTypeFormattingRequest=N.DocumentRangesFormattingRequest=N.DocumentRangeFormattingRequest=N.DocumentFormattingRequest=N.DocumentLinkResolveRequest=N.DocumentLinkRequest=N.CodeLensRefreshRequest=N.CodeLensResolveRequest=N.CodeLensRequest=N.WorkspaceSymbolResolveRequest=void 0;N.InlineCompletionRequest=N.DidCloseNotebookDocumentNotification=N.DidSaveNotebookDocumentNotification=N.DidChangeNotebookDocumentNotification=N.NotebookCellArrayChange=N.DidOpenNotebookDocumentNotification=N.NotebookDocumentSyncRegistrationType=N.NotebookDocument=N.NotebookCell=N.ExecutionSummary=N.NotebookCellKind=N.DiagnosticRefreshRequest=N.WorkspaceDiagnosticRequest=N.DocumentDiagnosticRequest=N.DocumentDiagnosticReportKind=N.DiagnosticServerCancellationData=N.InlayHintRefreshRequest=N.InlayHintResolveRequest=N.InlayHintRequest=N.InlineValueRefreshRequest=N.InlineValueRequest=N.TypeHierarchySupertypesRequest=N.TypeHierarchySubtypesRequest=N.TypeHierarchyPrepareRequest=void 0;var V=vt(),Zk=cd(),zt=ld(),SF=kN();Object.defineProperty(N,"ImplementationRequest",{enumerable:!0,get:function(){return SF.ImplementationRequest}});var NF=wN();Object.defineProperty(N,"TypeDefinitionRequest",{enumerable:!0,get:function(){return NF.TypeDefinitionRequest}});var aP=DN();Object.defineProperty(N,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return aP.WorkspaceFoldersRequest}});Object.defineProperty(N,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return aP.DidChangeWorkspaceFoldersNotification}});var kF=ON();Object.defineProperty(N,"ConfigurationRequest",{enumerable:!0,get:function(){return kF.ConfigurationRequest}});var cP=LN();Object.defineProperty(N,"DocumentColorRequest",{enumerable:!0,get:function(){return cP.DocumentColorRequest}});Object.defineProperty(N,"ColorPresentationRequest",{enumerable:!0,get:function(){return cP.ColorPresentationRequest}});var lP=BN();Object.defineProperty(N,"FoldingRangeRequest",{enumerable:!0,get:function(){return lP.FoldingRangeRequest}});Object.defineProperty(N,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return lP.FoldingRangeRefreshRequest}});var RF=UN();Object.defineProperty(N,"DeclarationRequest",{enumerable:!0,get:function(){return RF.DeclarationRequest}});var PF=zN();Object.defineProperty(N,"SelectionRangeRequest",{enumerable:!0,get:function(){return PF.SelectionRangeRequest}});var ty=YN();Object.defineProperty(N,"WorkDoneProgress",{enumerable:!0,get:function(){return ty.WorkDoneProgress}});Object.defineProperty(N,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ty.WorkDoneProgressCreateRequest}});Object.defineProperty(N,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ty.WorkDoneProgressCancelNotification}});var ry=ZN();Object.defineProperty(N,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return ry.CallHierarchyIncomingCallsRequest}});Object.defineProperty(N,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return ry.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(N,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return ry.CallHierarchyPrepareRequest}});var Bo=sk();Object.defineProperty(N,"TokenFormat",{enumerable:!0,get:function(){return Bo.TokenFormat}});Object.defineProperty(N,"SemanticTokensRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRequest}});Object.defineProperty(N,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensDeltaRequest}});Object.defineProperty(N,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRangeRequest}});Object.defineProperty(N,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Bo.SemanticTokensRefreshRequest}});Object.defineProperty(N,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Bo.SemanticTokensRegistrationType}});var wF=ck();Object.defineProperty(N,"ShowDocumentRequest",{enumerable:!0,get:function(){return wF.ShowDocumentRequest}});var EF=dk();Object.defineProperty(N,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return EF.LinkedEditingRangeRequest}});var Bs=vk();Object.defineProperty(N,"FileOperationPatternKind",{enumerable:!0,get:function(){return Bs.FileOperationPatternKind}});Object.defineProperty(N,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Bs.DidCreateFilesNotification}});Object.defineProperty(N,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Bs.WillCreateFilesRequest}});Object.defineProperty(N,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Bs.DidRenameFilesNotification}});Object.defineProperty(N,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Bs.WillRenameFilesRequest}});Object.defineProperty(N,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Bs.DidDeleteFilesNotification}});Object.defineProperty(N,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Bs.WillDeleteFilesRequest}});var ny=kk();Object.defineProperty(N,"UniquenessLevel",{enumerable:!0,get:function(){return ny.UniquenessLevel}});Object.defineProperty(N,"MonikerKind",{enumerable:!0,get:function(){return ny.MonikerKind}});Object.defineProperty(N,"MonikerRequest",{enumerable:!0,get:function(){return ny.MonikerRequest}});var iy=Ek();Object.defineProperty(N,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return iy.TypeHierarchyPrepareRequest}});Object.defineProperty(N,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return iy.TypeHierarchySubtypesRequest}});Object.defineProperty(N,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return iy.TypeHierarchySupertypesRequest}});var uP=Ak();Object.defineProperty(N,"InlineValueRequest",{enumerable:!0,get:function(){return uP.InlineValueRequest}});Object.defineProperty(N,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return uP.InlineValueRefreshRequest}});var sy=xk();Object.defineProperty(N,"InlayHintRequest",{enumerable:!0,get:function(){return sy.InlayHintRequest}});Object.defineProperty(N,"InlayHintResolveRequest",{enumerable:!0,get:function(){return sy.InlayHintResolveRequest}});Object.defineProperty(N,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return sy.InlayHintRefreshRequest}});var cc=Uk();Object.defineProperty(N,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return cc.DiagnosticServerCancellationData}});Object.defineProperty(N,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return cc.DocumentDiagnosticReportKind}});Object.defineProperty(N,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return cc.DocumentDiagnosticRequest}});Object.defineProperty(N,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return cc.WorkspaceDiagnosticRequest}});Object.defineProperty(N,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return cc.DiagnosticRefreshRequest}});var Gn=Yk();Object.defineProperty(N,"NotebookCellKind",{enumerable:!0,get:function(){return Gn.NotebookCellKind}});Object.defineProperty(N,"ExecutionSummary",{enumerable:!0,get:function(){return Gn.ExecutionSummary}});Object.defineProperty(N,"NotebookCell",{enumerable:!0,get:function(){return Gn.NotebookCell}});Object.defineProperty(N,"NotebookDocument",{enumerable:!0,get:function(){return Gn.NotebookDocument}});Object.defineProperty(N,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(N,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(N,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Gn.NotebookCellArrayChange}});Object.defineProperty(N,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(N,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(N,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidCloseNotebookDocumentNotification}});var CF=Qk();Object.defineProperty(N,"InlineCompletionRequest",{enumerable:!0,get:function(){return CF.InlineCompletionRequest}});var Jg;(function(t){function e(r){let n=r;return zt.string(n)||zt.string(n.language)||zt.string(n.scheme)||zt.string(n.pattern)}t.is=e})(Jg||(N.TextDocumentFilter=Jg={}));var Qg;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(zt.string(n.notebookType)||zt.string(n.scheme)||zt.string(n.pattern))}t.is=e})(Qg||(N.NotebookDocumentFilter=Qg={}));var Zg;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(zt.string(n.notebook)||Qg.is(n.notebook))&&(n.language===void 0||zt.string(n.language))}t.is=e})(Zg||(N.NotebookCellTextDocumentFilter=Zg={}));var ey;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!zt.string(n)&&!Jg.is(n)&&!Zg.is(n))return!1;return!0}t.is=e})(ey||(N.DocumentSelector=ey={}));var eR;(function(t){t.method="client/registerCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(eR||(N.RegistrationRequest=eR={}));var tR;(function(t){t.method="client/unregisterCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(tR||(N.UnregistrationRequest=tR={}));var rR;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rR||(N.ResourceOperationKind=rR={}));var nR;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nR||(N.FailureHandlingKind=nR={}));var iR;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(iR||(N.PositionEncodingKind=iR={}));var sR;(function(t){function e(r){let n=r;return n&&zt.string(n.id)&&n.id.length>0}t.hasId=e})(sR||(N.StaticRegistrationOptions=sR={}));var oR;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||ey.is(n.documentSelector))}t.is=e})(oR||(N.TextDocumentRegistrationOptions=oR={}));var aR;(function(t){function e(n){let i=n;return zt.objectLiteral(i)&&(i.workDoneProgress===void 0||zt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&zt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(aR||(N.WorkDoneProgressOptions=aR={}));var cR;(function(t){t.method="initialize",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(cR||(N.InitializeRequest=cR={}));var lR;(function(t){t.unknownProtocolVersion=1})(lR||(N.InitializeErrorCodes=lR={}));var uR;(function(t){t.method="initialized",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(uR||(N.InitializedNotification=uR={}));var dR;(function(t){t.method="shutdown",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType0(t.method)})(dR||(N.ShutdownRequest=dR={}));var fR;(function(t){t.method="exit",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType0(t.method)})(fR||(N.ExitNotification=fR={}));var pR;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(pR||(N.DidChangeConfigurationNotification=pR={}));var hR;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(hR||(N.MessageType=hR={}));var mR;(function(t){t.method="window/showMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(mR||(N.ShowMessageNotification=mR={}));var gR;(function(t){t.method="window/showMessageRequest",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(gR||(N.ShowMessageRequest=gR={}));var yR;(function(t){t.method="window/logMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(yR||(N.LogMessageNotification=yR={}));var TR;(function(t){t.method="telemetry/event",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(TR||(N.TelemetryEventNotification=TR={}));var vR;(function(t){t.None=0,t.Full=1,t.Incremental=2})(vR||(N.TextDocumentSyncKind=vR={}));var bR;(function(t){t.method="textDocument/didOpen",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(bR||(N.DidOpenTextDocumentNotification=bR={}));var _R;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(_R||(N.TextDocumentContentChangeEvent=_R={}));var SR;(function(t){t.method="textDocument/didChange",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(SR||(N.DidChangeTextDocumentNotification=SR={}));var NR;(function(t){t.method="textDocument/didClose",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(NR||(N.DidCloseTextDocumentNotification=NR={}));var kR;(function(t){t.method="textDocument/didSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(kR||(N.DidSaveTextDocumentNotification=kR={}));var RR;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(RR||(N.TextDocumentSaveReason=RR={}));var PR;(function(t){t.method="textDocument/willSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(PR||(N.WillSaveTextDocumentNotification=PR={}));var wR;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(wR||(N.WillSaveTextDocumentWaitUntilRequest=wR={}));var ER;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(ER||(N.DidChangeWatchedFilesNotification=ER={}));var CR;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(CR||(N.FileChangeType=CR={}));var DR;(function(t){function e(r){let n=r;return zt.objectLiteral(n)&&(Zk.URI.is(n.baseUri)||Zk.WorkspaceFolder.is(n.baseUri))&&zt.string(n.pattern)}t.is=e})(DR||(N.RelativePattern=DR={}));var AR;(function(t){t.Create=1,t.Change=2,t.Delete=4})(AR||(N.WatchKind=AR={}));var IR;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(IR||(N.PublishDiagnosticsNotification=IR={}));var OR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(OR||(N.CompletionTriggerKind=OR={}));var MR;(function(t){t.method="textDocument/completion",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(MR||(N.CompletionRequest=MR={}));var xR;(function(t){t.method="completionItem/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(xR||(N.CompletionResolveRequest=xR={}));var LR;(function(t){t.method="textDocument/hover",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(LR||(N.HoverRequest=LR={}));var qR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(qR||(N.SignatureHelpTriggerKind=qR={}));var $R;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})($R||(N.SignatureHelpRequest=$R={}));var BR;(function(t){t.method="textDocument/definition",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(BR||(N.DefinitionRequest=BR={}));var FR;(function(t){t.method="textDocument/references",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(FR||(N.ReferencesRequest=FR={}));var jR;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(jR||(N.DocumentHighlightRequest=jR={}));var UR;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(UR||(N.DocumentSymbolRequest=UR={}));var HR;(function(t){t.method="textDocument/codeAction",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(HR||(N.CodeActionRequest=HR={}));var VR;(function(t){t.method="codeAction/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(VR||(N.CodeActionResolveRequest=VR={}));var zR;(function(t){t.method="workspace/symbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(zR||(N.WorkspaceSymbolRequest=zR={}));var WR;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(WR||(N.WorkspaceSymbolResolveRequest=WR={}));var GR;(function(t){t.method="textDocument/codeLens",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(GR||(N.CodeLensRequest=GR={}));var KR;(function(t){t.method="codeLens/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(KR||(N.CodeLensResolveRequest=KR={}));var YR;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType0(t.method)})(YR||(N.CodeLensRefreshRequest=YR={}));var XR;(function(t){t.method="textDocument/documentLink",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(XR||(N.DocumentLinkRequest=XR={}));var JR;(function(t){t.method="documentLink/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(JR||(N.DocumentLinkResolveRequest=JR={}));var QR;(function(t){t.method="textDocument/formatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(QR||(N.DocumentFormattingRequest=QR={}));var ZR;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(ZR||(N.DocumentRangeFormattingRequest=ZR={}));var eP;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(eP||(N.DocumentRangesFormattingRequest=eP={}));var tP;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(tP||(N.DocumentOnTypeFormattingRequest=tP={}));var rP;(function(t){t.Identifier=1})(rP||(N.PrepareSupportDefaultBehavior=rP={}));var nP;(function(t){t.method="textDocument/rename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(nP||(N.RenameRequest=nP={}));var iP;(function(t){t.method="textDocument/prepareRename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(iP||(N.PrepareRenameRequest=iP={}));var sP;(function(t){t.method="workspace/executeCommand",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(sP||(N.ExecuteCommandRequest=sP={}));var oP;(function(t){t.method="workspace/applyEdit",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType("workspace/applyEdit")})(oP||(N.ApplyWorkspaceEditRequest=oP={}))});var pP=k(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.createProtocolConnection=void 0;var fP=$s();function DF(t,e,r,n){return fP.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fP.createMessageConnection)(t,e,r,n)}kd.createProtocolConnection=DF});var mP=k(wr=>{"use strict";var AF=wr&&wr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rd=wr&&wr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AF(e,t,r)};Object.defineProperty(wr,"__esModule",{value:!0});wr.LSPErrorCodes=wr.createProtocolConnection=void 0;Rd($s(),wr);Rd(cd(),wr);Rd(vt(),wr);Rd(dP(),wr);var IF=pP();Object.defineProperty(wr,"createProtocolConnection",{enumerable:!0,get:function(){return IF.createProtocolConnection}});var hP;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(hP||(wr.LSPErrorCodes=hP={}))});var Et=k(Kn=>{"use strict";var OF=Kn&&Kn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gP=Kn&&Kn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OF(e,t,r)};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.createProtocolConnection=void 0;var MF=Hg();gP(Hg(),Kn);gP(mP(),Kn);function xF(t,e,r,n){return(0,MF.createMessageConnection)(t,e,r,n)}Kn.createProtocolConnection=xF});var oy=k(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.generateUuid=Zr.parse=Zr.isUUID=Zr.v4=Zr.empty=void 0;var lc=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},uc=class t extends lc{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};uc._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];uc._timeHighBits=["8","9","a","b"];Zr.empty=new lc("00000000-0000-0000-0000-000000000000");function yP(){return new uc}Zr.v4=yP;var LF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function TP(t){return LF.test(t)}Zr.isUUID=TP;function qF(t){if(!TP(t))throw new Error("invalid uuid");return new lc(t)}Zr.parse=qF;function $F(){return yP().asHex()}Zr.generateUuid=$F});var vP=k(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.attachPartialResult=Yi.ProgressFeature=Yi.attachWorkDone=void 0;var Ki=Et(),BF=oy(),Fs=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,{kind:"end"})}};Fs.Instances=new Map;var Pd=class extends Fs{constructor(e,r){super(e,r),this._source=new Ki.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},dc=class{constructor(){}begin(){}report(){}done(){}},wd=class extends dc{constructor(){super(),this._source=new Ki.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function FF(t,e){if(e===void 0||e.workDoneToken===void 0)return new dc;let r=e.workDoneToken;return delete e.workDoneToken,new Fs(t,r)}Yi.attachWorkDone=FF;var jF=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ki.WorkDoneProgressCancelNotification.type,r=>{let n=Fs.Instances.get(r.token);(n instanceof Pd||n instanceof wd)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new dc:new Fs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,BF.generateUuid)();return this.connection.sendRequest(Ki.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Pd(this.connection,e))}else return Promise.resolve(new wd)}};Yi.ProgressFeature=jF;var ay;(function(t){t.type=new Ki.ProgressType})(ay||(ay={}));var cy=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(ay.type,this._token,e)}};function UF(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new cy(t,r)}Yi.attachPartialResult=UF});var bP=k(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.ConfigurationFeature=void 0;var HF=Et(),VF=Bu(),zF=t=>class extends t{getConfiguration(e){return e?VF.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(HF.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Ed.ConfigurationFeature=zF});var _P=k(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.WorkspaceFoldersFeature=void 0;var Cd=Et(),WF=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Cd.Emitter,this.connection.onNotification(Cd.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Cd.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(Cd.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Dd.WorkspaceFoldersFeature=WF});var SP=k(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.CallHierarchyFeature=void 0;var ly=Et(),GF=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ly.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=ly.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=ly.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ad.CallHierarchyFeature=GF});var dy=k(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.SemanticTokensBuilder=Xi.SemanticTokensDiff=Xi.SemanticTokensFeature=void 0;var Id=Et(),KF=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Id.SemanticTokensRefreshRequest.type),on:e=>{let r=Id.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Id.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Id.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Xi.SemanticTokensFeature=KF;var Od=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let o=i-n+1,a=this.modifiedSequence.slice(n,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Xi.SemanticTokensDiff=Od;var uy=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,r,n,i,s){let o=e,a=r;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++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}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 Od(this._prevData,this._data).computeDiff()}:this.build()}};Xi.SemanticTokensBuilder=uy});var NP=k(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ShowDocumentFeature=void 0;var YF=Et(),XF=t=>class extends t{showDocument(e){return this.connection.sendRequest(YF.ShowDocumentRequest.type,e)}};Md.ShowDocumentFeature=XF});var kP=k(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.FileOperationsFeature=void 0;var Fo=Et(),JF=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Fo.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Fo.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Fo.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Fo.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Fo.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Fo.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};xd.FileOperationsFeature=JF});var RP=k(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.LinkedEditingRangeFeature=void 0;var QF=Et(),ZF=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(QF.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Ld.LinkedEditingRangeFeature=ZF});var PP=k(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.TypeHierarchyFeature=void 0;var fy=Et(),ej=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(fy.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=fy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=fy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};qd.TypeHierarchyFeature=ej});var EP=k($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.InlineValueFeature=void 0;var wP=Et(),tj=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(wP.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(wP.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};$d.InlineValueFeature=tj});var DP=k(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.FoldingRangeFeature=void 0;var CP=Et(),rj=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(CP.FoldingRangeRefreshRequest.type),on:e=>{let r=CP.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Bd.FoldingRangeFeature=rj});var AP=k(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.InlayHintFeature=void 0;var py=Et(),nj=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(py.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(py.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(py.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Fd.InlayHintFeature=nj});var IP=k(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.DiagnosticFeature=void 0;var fc=Et(),ij=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(fc.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(fc.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(fc.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.WorkspaceDiagnosticRequest.partialResult,r)))}}};jd.DiagnosticFeature=ij});var my=k(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.TextDocuments=void 0;var js=Et(),hy=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new js.Emitter,this._onDidOpen=new js.Emitter,this._onDidClose=new js.Emitter,this._onDidSave=new js.Emitter,this._onWillSave=new js.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=js.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),js.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Ud.TextDocuments=hy});var yy=k(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.NotebookDocuments=jo.NotebookSyncFeature=void 0;var en=Et(),OP=my(),sj=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(en.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(en.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(en.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(en.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};jo.NotebookSyncFeature=sj;var Hd=class t{onDidOpenTextDocument(e){return this.openHandler=e,en.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,en.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,en.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Hd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var gy=class{constructor(e){e instanceof OP.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new OP.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new en.Emitter,this._onDidChange=new en.Emitter,this._onDidSave=new en.Emitter,this._onDidClose=new en.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[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 r=new Hd,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let S=c.cells;if(S.structure!==void 0){let _=S.structure.array;if(s.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),S.structure.didOpen!==void 0)for(let v of S.structure.didOpen)r.openTextDocument({textDocument:v}),l.push(v.uri);if(S.structure.didClose)for(let v of S.structure.didClose)r.closeTextDocument({textDocument:v}),u.push(v.uri)}if(S.data!==void 0){let _=new Map(S.data.map(v=>[v.document,v]));for(let v=0;v<=s.cells.length;v++){let R=_.get(s.cells[v].document);if(R!==void 0){let C=s.cells.splice(v,1,R);if(d.push({old:C[0],new:R}),_.delete(R.document),_.size===0)break}}}if(S.textContent!==void 0)for(let _ of S.textContent)r.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),f.push(_.document.uri)}this.updateCellMap(s);let p={notebookDocument:s};a&&(p.metadata={old:o,new:s.metadata});let g=[];for(let S of l)g.push(this.getNotebookCell(S));let h=[];for(let S of u)h.push(this.getNotebookCell(S));let T=[];for(let S of f)T.push(this.getNotebookCell(S));(g.length>0||h.length>0||d.length>0||T.length>0)&&(p.cells={added:g,removed:h,changed:{data:d,textContent:T}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),en.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};jo.NotebookDocuments=gy});var MP=k(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.MonikerFeature=void 0;var oj=Et(),aj=t=>class extends t{get moniker(){return{on:e=>{let r=oj.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Vd.MonikerFeature=aj});var Ny=k(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.createConnection=Ue.combineFeatures=Ue.combineNotebooksFeatures=Ue.combineLanguagesFeatures=Ue.combineWorkspaceFeatures=Ue.combineWindowFeatures=Ue.combineClientFeatures=Ue.combineTracerFeatures=Ue.combineTelemetryFeatures=Ue.combineConsoleFeatures=Ue._NotebooksImpl=Ue._LanguagesImpl=Ue.BulkUnregistration=Ue.BulkRegistration=Ue.ErrorMessageTracker=void 0;var K=Et(),tn=Bu(),vy=oy(),me=vP(),cj=bP(),lj=_P(),uj=SP(),dj=dy(),fj=NP(),pj=kP(),hj=RP(),mj=PP(),gj=EP(),yj=DP(),Tj=AP(),vj=IP(),bj=yy(),_j=MP();function Ty(t){if(t!==null)return t}var by=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Ue.ErrorMessageTracker=by;var zd=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(K.MessageType.Error,e)}warn(e){this.send(K.MessageType.Warning,e)}info(e){this.send(K.MessageType.Info,e)}log(e){this.send(K.MessageType.Log,e)}debug(e){this.send(K.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(K.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,K.RAL)().console.error("Sending log message failed")})}},_y=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,...r){let n={type:K.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Ty)}showWarningMessage(e,...r){let n={type:K.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Ty)}showInformationMessage(e,...r){let n={type:K.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(Ty)}},xP=(0,fj.ShowDocumentFeature)((0,me.ProgressFeature)(_y)),LP;(function(t){function e(){return new Wd}t.create=e})(LP||(Ue.BulkRegistration=LP={}));var Wd=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=tn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=vy.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},qP;(function(t){function e(){return new pc(void 0,[])}t.create=e})(qP||(Ue.BulkUnregistration=qP={}));var pc=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(K.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=tn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(K.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Gd=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,r,n){return e instanceof Wd?this.registerMany(e):e instanceof pc?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=tn.string(r)?r:r.method,s=vy.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(K.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=tn.string(e)?e:e.method,i=vy.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(K.RegistrationRequest.type,s).then(o=>K.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(K.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(K.RegistrationRequest.type,r).then(()=>new pc(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},Sy=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(K.ApplyWorkspaceEditRequest.type,n)}},$P=(0,pj.FileOperationsFeature)((0,lj.WorkspaceFoldersFeature)((0,cj.ConfigurationFeature)(Sy))),Kd=class{constructor(){this._trace=K.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,r){this._trace!==K.Trace.Off&&this.connection.sendNotification(K.LogTraceNotification.type,{message:e,verbose:this._trace===K.Trace.Verbose?r:void 0}).catch(()=>{})}},Yd=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(K.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Xd=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,me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,me.attachPartialResult)(this.connection,r)}};Ue._LanguagesImpl=Xd;var BP=(0,yj.FoldingRangeFeature)((0,_j.MonikerFeature)((0,vj.DiagnosticFeature)((0,Tj.InlayHintFeature)((0,gj.InlineValueFeature)((0,mj.TypeHierarchyFeature)((0,hj.LinkedEditingRangeFeature)((0,dj.SemanticTokensFeature)((0,uj.CallHierarchyFeature)(Xd))))))))),Jd=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,me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,me.attachPartialResult)(this.connection,r)}};Ue._NotebooksImpl=Jd;var FP=(0,bj.NotebookSyncFeature)(Jd);function jP(t,e){return function(r){return e(t(r))}}Ue.combineConsoleFeatures=jP;function UP(t,e){return function(r){return e(t(r))}}Ue.combineTelemetryFeatures=UP;function HP(t,e){return function(r){return e(t(r))}}Ue.combineTracerFeatures=HP;function VP(t,e){return function(r){return e(t(r))}}Ue.combineClientFeatures=VP;function zP(t,e){return function(r){return e(t(r))}}Ue.combineWindowFeatures=zP;function WP(t,e){return function(r){return e(t(r))}}Ue.combineWorkspaceFeatures=WP;function GP(t,e){return function(r){return e(t(r))}}Ue.combineLanguagesFeatures=GP;function KP(t,e){return function(r){return e(t(r))}}Ue.combineNotebooksFeatures=KP;function Sj(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:r(t.console,e.console,jP),tracer:r(t.tracer,e.tracer,HP),telemetry:r(t.telemetry,e.telemetry,UP),client:r(t.client,e.client,VP),window:r(t.window,e.window,zP),workspace:r(t.workspace,e.workspace,WP),languages:r(t.languages,e.languages,GP),notebooks:r(t.notebooks,e.notebooks,KP)}}Ue.combineFeatures=Sj;function Nj(t,e,r){let n=r&&r.console?new(r.console(zd)):new zd,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(Kd)):new Kd,o=r&&r.telemetry?new(r.telemetry(Yd)):new Yd,a=r&&r.client?new(r.client(Gd)):new Gd,c=r&&r.window?new(r.window(xP)):new xP,l=r&&r.workspace?new(r.workspace($P)):new $P,u=r&&r.languages?new(r.languages(BP)):new BP,d=r&&r.notebooks?new(r.notebooks(FP)):new FP,f=[n,s,o,a,c,l,u,d];function p(_){return _ instanceof Promise?_:tn.thenable(_)?new Promise((v,R)=>{_.then(C=>v(C),C=>R(C))}):Promise.resolve(_)}let g,h,T,S={listen:()=>i.listen(),sendRequest:(_,...v)=>i.sendRequest(tn.string(_)?_:_.method,...v),onRequest:(_,v)=>i.onRequest(_,v),sendNotification:(_,v)=>{let R=tn.string(_)?_:_.method;return i.sendNotification(R,v)},onNotification:(_,v)=>i.onNotification(_,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:_=>(h=_,{dispose:()=>{h=void 0}}),onInitialized:_=>i.onNotification(K.InitializedNotification.type,_),onShutdown:_=>(g=_,{dispose:()=>{g=void 0}}),onExit:_=>(T=_,{dispose:()=>{T=void 0}}),get console(){return n},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:_=>i.onNotification(K.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>i.onNotification(K.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>i.onNotification(K.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>i.onNotification(K.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>i.onNotification(K.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>i.onNotification(K.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>i.onRequest(K.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>i.onNotification(K.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>i.sendNotification(K.PublishDiagnosticsNotification.type,_),onHover:_=>i.onRequest(K.HoverRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onCompletion:_=>i.onRequest(K.CompletionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCompletionResolve:_=>i.onRequest(K.CompletionResolveRequest.type,_),onSignatureHelp:_=>i.onRequest(K.SignatureHelpRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDeclaration:_=>i.onRequest(K.DeclarationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDefinition:_=>i.onRequest(K.DefinitionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onTypeDefinition:_=>i.onRequest(K.TypeDefinitionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onImplementation:_=>i.onRequest(K.ImplementationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onReferences:_=>i.onRequest(K.ReferencesRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentHighlight:_=>i.onRequest(K.DocumentHighlightRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentSymbol:_=>i.onRequest(K.DocumentSymbolRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onWorkspaceSymbol:_=>i.onRequest(K.WorkspaceSymbolRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:_=>i.onRequest(K.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>i.onRequest(K.CodeActionRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCodeActionResolve:_=>i.onRequest(K.CodeActionResolveRequest.type,(v,R)=>_(v,R)),onCodeLens:_=>i.onRequest(K.CodeLensRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onCodeLensResolve:_=>i.onRequest(K.CodeLensResolveRequest.type,(v,R)=>_(v,R)),onDocumentFormatting:_=>i.onRequest(K.DocumentFormattingRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:_=>i.onRequest(K.DocumentRangeFormattingRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:_=>i.onRequest(K.DocumentOnTypeFormattingRequest.type,(v,R)=>_(v,R)),onRenameRequest:_=>i.onRequest(K.RenameRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),onPrepareRename:_=>i.onRequest(K.PrepareRenameRequest.type,(v,R)=>_(v,R)),onDocumentLinks:_=>i.onRequest(K.DocumentLinkRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onDocumentLinkResolve:_=>i.onRequest(K.DocumentLinkResolveRequest.type,(v,R)=>_(v,R)),onDocumentColor:_=>i.onRequest(K.DocumentColorRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onColorPresentation:_=>i.onRequest(K.ColorPresentationRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onFoldingRanges:_=>i.onRequest(K.FoldingRangeRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onSelectionRanges:_=>i.onRequest(K.SelectionRangeRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),(0,me.attachPartialResult)(i,v))),onExecuteCommand:_=>i.onRequest(K.ExecuteCommandRequest.type,(v,R)=>_(v,R,(0,me.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let _ of f)_.attach(S);return i.onRequest(K.InitializeRequest.type,_=>{e.initialize(_),tn.string(_.trace)&&(s.trace=K.Trace.fromString(_.trace));for(let v of f)v.initialize(_.capabilities);if(h){let v=h(_,new K.CancellationTokenSource().token,(0,me.attachWorkDone)(i,_),void 0);return p(v).then(R=>{if(R instanceof K.ResponseError)return R;let C=R;C||(C={capabilities:{}});let B=C.capabilities;B||(B={},C.capabilities=B),B.textDocumentSync===void 0||B.textDocumentSync===null?B.textDocumentSync=tn.number(S.__textDocumentSync)?S.__textDocumentSync:K.TextDocumentSyncKind.None:!tn.number(B.textDocumentSync)&&!tn.number(B.textDocumentSync.change)&&(B.textDocumentSync.change=tn.number(S.__textDocumentSync)?S.__textDocumentSync:K.TextDocumentSyncKind.None);for(let M of f)M.fillServerCapabilities(B);return C})}else{let v={capabilities:{textDocumentSync:K.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(K.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,g)return g(new K.CancellationTokenSource().token)}),i.onNotification(K.ExitNotification.type,()=>{try{T&&T()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(K.SetTraceNotification.type,_=>{s.trace=K.Trace.fromString(_.value)}),S}Ue.createConnection=Nj});var YP=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.resolveModulePath=Er.FileSystem=Er.resolveGlobalYarnPath=Er.resolveGlobalNodePath=Er.resolve=Er.uriToFilePath=void 0;var kj=require("url"),Cn=require("path"),ky=require("fs"),Ey=require("child_process");function Rj(t){let e=kj.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift()}return Cn.normalize(r.join("/"))}Er.uriToFilePath=Rj;function Ry(){return process.platform==="win32"}function Qd(t,e,r,n){let i="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&&ky.existsSync(e)&&(l[i]?l[i]=e+Cn.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Ey.fork)("",[],{cwd:r,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}Er.resolve=Qd;function Py(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Ry()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Ey.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Ry()?Cn.join(o,"node_modules"):Cn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Er.resolveGlobalNodePath=Py;function Pj(t){let e="yarn",r={encoding:"utf8"};Ry()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,Ey.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.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 Cn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}Er.resolveGlobalYarnPath=Pj;var wy;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ky.existsSync(__filename.toUpperCase())||!ky.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?Cn.normalize(s).indexOf(Cn.normalize(i))===0:Cn.normalize(s).toLowerCase().indexOf(Cn.normalize(i).toLowerCase())===0}t.isParent=n})(wy||(Er.FileSystem=wy={}));function wj(t,e,r,n){return r?(Cn.isAbsolute(r)||(r=Cn.join(t,r)),Qd(e,r,r,n).then(i=>wy.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Qd(e,Py(n),t,n))):Qd(e,Py(n),t,n)}Er.resolveModulePath=wj});var Cy=k((yQ,XP)=>{"use strict";XP.exports=Et()});var JP=k(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.InlineCompletionFeature=void 0;var Ej=Et(),Cj=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(Ej.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Zd.InlineCompletionFeature=Cj});var ew=k(ar=>{"use strict";var Dj=ar&&ar.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZP=ar&&ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dj(e,t,r)};Object.defineProperty(ar,"__esModule",{value:!0});ar.ProposedFeatures=ar.NotebookDocuments=ar.TextDocuments=ar.SemanticTokensBuilder=void 0;var Aj=dy();Object.defineProperty(ar,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Aj.SemanticTokensBuilder}});var Ij=JP();ZP(Et(),ar);var Oj=my();Object.defineProperty(ar,"TextDocuments",{enumerable:!0,get:function(){return Oj.TextDocuments}});var Mj=yy();Object.defineProperty(ar,"NotebookDocuments",{enumerable:!0,get:function(){return Mj.NotebookDocuments}});ZP(Ny(),ar);var QP;(function(t){t.all={__brand:"features",languages:Ij.InlineCompletionFeature}})(QP||(ar.ProposedFeatures=QP={}))});var H=k(rn=>{"use strict";var xj=rn&&rn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iw=rn&&rn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xj(e,t,r)};Object.defineProperty(rn,"__esModule",{value:!0});rn.createConnection=rn.Files=void 0;var tw=require("node:util"),Dy=Bu(),Lj=Ny(),hc=YP(),Us=Cy();iw(Cy(),rn);iw(ew(),rn);var rw;(function(t){t.uriToFilePath=hc.uriToFilePath,t.resolveGlobalNodePath=hc.resolveGlobalNodePath,t.resolveGlobalYarnPath=hc.resolveGlobalYarnPath,t.resolve=hc.resolve,t.resolveModulePath=hc.resolveModulePath})(rw||(rn.Files=rw={}));var nw;function ef(){if(nw!==void 0)try{nw.end()}catch{}}var Uo=!1,sw;function qj(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(sw=setInterval(()=>{try{process.kill(n,0)}catch{ef(),process.exit(Uo?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}qj();var $j={initialize:t=>{let e=t.processId;Dy.number(e)&&sw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Uo?0:1)}},3e3)},get shutdownReceived(){return Uo},set shutdownReceived(t){Uo=t},exit:t=>{ef(),process.exit(t)}};function Bj(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Us.ConnectionStrategy.is(t)||Us.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),Fj(s,o,a,i)}rn.createConnection=Bj;function Fj(t,e,r,n){let i=!1;if(!t&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){t=new Us.IPCMessageReader(process),e=new Us.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var s=f.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,Us.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,Us.createServerPipeTransport)(l);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Dy.func(t.read)&&Dy.func(t.on)){let c=t;c.on("end",()=>{ef(),process.exit(Uo?0:1)}),c.on("close",()=>{ef(),process.exit(Uo?0:1)})}let a=c=>{let l=(0,Us.createProtocolConnection)(t,e,c,r);return i&&jj(c),l};return(0,Lj.createConnection)(a,$j,n)}function jj(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,tw.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=r.get(s)??0;o+=1,r.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,tw.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
37
+ ${s}`)},console.warn=function(...i){t.warn(e(i))}}});var aw=k((SQ,ow)=>{"use strict";ow.exports=H()});var YI=k((LSe,KI)=>{"use strict";KI.exports=WI;function WI(t,e,r){t instanceof RegExp&&(t=zI(t,r)),e instanceof RegExp&&(e=zI(e,r));var n=GI(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function zI(t,e){var r=e.match(t);return r?r[0]:null}WI.range=GI;function GI(t,e,r){var n,i,s,o,a,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(n=[],s=r.length;u>=0&&!a;)u==c?(n.push(u),c=r.indexOf(t,u+1)):n.length==1?a=[n.pop(),l]:(i=n.pop(),i<s&&(s=i,o=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;n.length&&(a=[s,o])}return a}});var nO=k((qSe,rO)=>{var XI=YI();rO.exports=sH;var JI="\0SLASH"+Math.random()+"\0",QI="\0OPEN"+Math.random()+"\0",hT="\0CLOSE"+Math.random()+"\0",ZI="\0COMMA"+Math.random()+"\0",eO="\0PERIOD"+Math.random()+"\0";function pT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function nH(t){return t.split("\\\\").join(JI).split("\\{").join(QI).split("\\}").join(hT).split("\\,").join(ZI).split("\\.").join(eO)}function iH(t){return t.split(JI).join("\\").split(QI).join("{").split(hT).join("}").split(ZI).join(",").split(eO).join(".")}function tO(t){if(!t)return[""];var e=[],r=XI("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var a=tO(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function sH(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),zc(nH(t),!0).map(iH)):[]}function oH(t){return"{"+t+"}"}function aH(t){return/^-?0\d/.test(t)}function cH(t,e){return t<=e}function lH(t,e){return t>=e}function zc(t,e){var r=[],n=XI("{","}",t);if(!n)return[t];var i=n.pre,s=n.post.length?zc(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var a=i+"{"+n.body+"}"+s[o];r.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=c||l,d=n.body.indexOf(",")>=0;if(!u&&!d)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+hT+n.post,zc(t)):[t];var f;if(u)f=n.body.split(/\.\./);else if(f=tO(n.body),f.length===1&&(f=zc(f[0],!1).map(oH),f.length===1))return s.map(function(Je){return n.pre+f[0]+Je});var p;if(u){var g=pT(f[0]),h=pT(f[1]),T=Math.max(f[0].length,f[1].length),S=f.length==3?Math.abs(pT(f[2])):1,_=cH,v=h<g;v&&(S*=-1,_=lH);var R=f.some(aH);p=[];for(var C=g;_(C,h);C+=S){var B;if(l)B=String.fromCharCode(C),B==="\\"&&(B="");else if(B=String(C),R){var M=T-B.length;if(M>0){var F=new Array(M+1).join("0");C<0?B="-"+F+B.slice(1):B=F+B}}p.push(B)}}else{p=[];for(var ge=0;ge<f.length;ge++)p.push.apply(p,zc(f[ge],!1))}for(var ge=0;ge<p.length;ge++)for(var o=0;o<s.length;o++){var a=i+p[ge]+s[o];(!e||u||a)&&r.push(a)}}return r}});var Le=k(tr=>{"use strict";var IT=Symbol.for("yaml.alias"),VO=Symbol.for("yaml.document"),Wp=Symbol.for("yaml.map"),zO=Symbol.for("yaml.pair"),OT=Symbol.for("yaml.scalar"),Gp=Symbol.for("yaml.seq"),Ai=Symbol.for("yaml.node.type"),yV=t=>!!t&&typeof t=="object"&&t[Ai]===IT,TV=t=>!!t&&typeof t=="object"&&t[Ai]===VO,vV=t=>!!t&&typeof t=="object"&&t[Ai]===Wp,bV=t=>!!t&&typeof t=="object"&&t[Ai]===zO,WO=t=>!!t&&typeof t=="object"&&t[Ai]===OT,_V=t=>!!t&&typeof t=="object"&&t[Ai]===Gp;function GO(t){if(t&&typeof t=="object")switch(t[Ai]){case Wp:case Gp:return!0}return!1}function SV(t){if(t&&typeof t=="object")switch(t[Ai]){case IT:case Wp:case OT:case Gp:return!0}return!1}var NV=t=>(WO(t)||GO(t))&&!!t.anchor;tr.ALIAS=IT;tr.DOC=VO;tr.MAP=Wp;tr.NODE_TYPE=Ai;tr.PAIR=zO;tr.SCALAR=OT;tr.SEQ=Gp;tr.hasAnchor=NV;tr.isAlias=yV;tr.isCollection=GO;tr.isDocument=TV;tr.isMap=vV;tr.isNode=SV;tr.isPair=bV;tr.isScalar=WO;tr.isSeq=_V});var al=k(MT=>{"use strict";var Ht=Le(),Lr=Symbol("break visit"),KO=Symbol("skip children"),ci=Symbol("remove node");function Kp(t,e){let r=YO(e);Ht.isDocument(t)?ba(null,t.contents,r,Object.freeze([t]))===ci&&(t.contents=null):ba(null,t,r,Object.freeze([]))}Kp.BREAK=Lr;Kp.SKIP=KO;Kp.REMOVE=ci;function ba(t,e,r,n){let i=XO(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return JO(t,n,i),ba(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=ba(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Lr)return Lr;o===ci&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=ba("key",e.key,r,n);if(s===Lr)return Lr;s===ci&&(e.key=null);let o=ba("value",e.value,r,n);if(o===Lr)return Lr;o===ci&&(e.value=null)}}return i}async function Yp(t,e){let r=YO(e);Ht.isDocument(t)?await _a(null,t.contents,r,Object.freeze([t]))===ci&&(t.contents=null):await _a(null,t,r,Object.freeze([]))}Yp.BREAK=Lr;Yp.SKIP=KO;Yp.REMOVE=ci;async function _a(t,e,r,n){let i=await XO(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return JO(t,n,i),_a(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await _a(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Lr)return Lr;o===ci&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await _a("key",e.key,r,n);if(s===Lr)return Lr;s===ci&&(e.key=null);let o=await _a("value",e.value,r,n);if(o===Lr)return Lr;o===ci&&(e.value=null)}}return i}function YO(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function XO(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ht.isMap(e))return r.Map?.(t,e,n);if(Ht.isSeq(e))return r.Seq?.(t,e,n);if(Ht.isPair(e))return r.Pair?.(t,e,n);if(Ht.isScalar(e))return r.Scalar?.(t,e,n);if(Ht.isAlias(e))return r.Alias?.(t,e,n)}function JO(t,e,r){let n=e[e.length-1];if(Ht.isCollection(n))n.items[t]=r;else if(Ht.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ht.isDocument(n))n.contents=r;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}MT.visit=Kp;MT.visitAsync=Yp});var xT=k(ZO=>{"use strict";var QO=Le(),kV=al(),RV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PV=t=>t.replace(/[!,[\]{}]/g,e=>RV[e]),cl=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+PV(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&QO.isNode(e.contents)){let s={};kV.visit(e.contents,(o,a)=>{QO.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
38
+ `)}};cl.defaultYaml={explicit:!1,version:"1.2"};cl.defaultTags={"!!":"tag:yaml.org,2002:"};ZO.Directives=cl});var Xp=k(ll=>{"use strict";var eM=Le(),wV=al();function EV(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function tM(t){let e=new Set;return wV.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function rM(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function CV(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i||(i=tM(t));let o=rM(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(eM.isScalar(o.node)||eM.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:n}}ll.anchorIsValid=EV;ll.anchorNames=tM;ll.createNodeAnchors=CV;ll.findNewAnchor=rM});var LT=k(nM=>{"use strict";function ul(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],a=ul(t,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=ul(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=ul(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let o=ul(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}nM.applyReviver=ul});var fs=k(sM=>{"use strict";var DV=Le();function iM(t,e,r){if(Array.isArray(t))return t.map((n,i)=>iM(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!DV.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}sM.toJS=iM});var Jp=k(aM=>{"use strict";var AV=LT(),oM=Le(),IV=fs(),qT=class{constructor(e){Object.defineProperty(this,oM.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:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!oM.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=IV.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?AV.applyReviver(s,{"":a},"",a):a}};aM.NodeBase=qT});var dl=k(lM=>{"use strict";var OV=Xp(),cM=al(),Qp=Le(),MV=Jp(),xV=fs(),$T=class extends MV.NodeBase{constructor(e){super(Qp.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let r;return cM.visit(e,{Node:(n,i)=>{if(i===this)return cM.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(xV.toJS(o,null,r),a=n.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=Zp(i,o,n)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(OV.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`${i} `}return i}};function Zp(t,e,r){if(Qp.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Qp.isCollection(e)){let n=0;for(let i of e.items){let s=Zp(t,i,r);s>n&&(n=s)}return n}else if(Qp.isPair(e)){let n=Zp(t,e.key,r),i=Zp(t,e.value,r);return Math.max(n,i)}return 1}lM.Alias=$T});var $t=k(BT=>{"use strict";var LV=Le(),qV=Jp(),$V=fs(),BV=t=>!t||typeof t!="function"&&typeof t!="object",ps=class extends qV.NodeBase{constructor(e){super(LV.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:$V.toJS(this.value,e,r)}toString(){return String(this.value)}};ps.BLOCK_FOLDED="BLOCK_FOLDED";ps.BLOCK_LITERAL="BLOCK_LITERAL";ps.PLAIN="PLAIN";ps.QUOTE_DOUBLE="QUOTE_DOUBLE";ps.QUOTE_SINGLE="QUOTE_SINGLE";BT.Scalar=ps;BT.isScalarValue=BV});var fl=k(dM=>{"use strict";var FV=dl(),Ys=Le(),uM=$t(),jV="tag:yaml.org,2002:";function UV(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function HV(t,e,r){if(Ys.isDocument(t)&&(t=t.contents),Ys.isNode(t))return t;if(Ys.isPair(t)){let d=r.schema[Ys.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new FV.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=jV+e.slice(2));let l=UV(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new uM.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Ys.MAP]:Symbol.iterator in Object(t)?o[Ys.SEQ]:o[Ys.MAP]}s&&(s(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new uM.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}dM.createNode=HV});var th=k(eh=>{"use strict";var VV=fl(),li=Le(),zV=Jp();function FT(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return VV.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var fM=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,jT=class extends zV.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>li.isNode(n)||li.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(fM(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(li.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,FT(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(li.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&li.isScalar(s)?s.value:s:li.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!li.isPair(r))return!1;let n=r.value;return n==null||e&&li.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return li.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(li.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,FT(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};eh.Collection=jT;eh.collectionFromPath=FT;eh.isEmptyPath=fM});var pl=k(rh=>{"use strict";var WV=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function UT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var GV=(t,e,r)=>t.endsWith(`
39
39
  `)?UT(r,e):r.includes(`
40
40
  `)?`
41
- `+UT(r,e):(t.endsWith(" ")?"":" ")+r;rh.indentComment=UT;rh.lineComment=GV;rh.stringifyComment=WV});var hM=k(hl=>{"use strict";var YV="flow",HT="block",nh="quoted";function KV(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let l=[],u={},d=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?l.push(0):d=i-n);let f,p,g=!1,h=-1,T=-1,S=-1;r===HT&&(h=pM(t,h,e.length),h!==-1&&(d=h+c));for(let v;v=t[h+=1];){if(r===nh&&v==="\\"){switch(T=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}S=h}if(v===`
41
+ `+UT(r,e):(t.endsWith(" ")?"":" ")+r;rh.indentComment=UT;rh.lineComment=GV;rh.stringifyComment=WV});var hM=k(hl=>{"use strict";var KV="flow",HT="block",nh="quoted";function YV(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let l=[],u={},d=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?l.push(0):d=i-n);let f,p,g=!1,h=-1,T=-1,S=-1;r===HT&&(h=pM(t,h,e.length),h!==-1&&(d=h+c));for(let v;v=t[h+=1];){if(r===nh&&v==="\\"){switch(T=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}S=h}if(v===`
42
42
  `)r===HT&&(h=pM(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(v===" "&&p&&p!==" "&&p!==`
43
43
  `&&p!==" "){let R=t[h+1];R&&R!==" "&&R!==`
44
- `&&R!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===nh){for(;p===" "||p===" ";)p=v,v=t[h+=1],g=!0;let R=h>S+1?h-2:T-1;if(u[R])return t;l.push(R),u[R]=!0,d=R+c,f=void 0}else g=!0}p=v}if(g&&a&&a(),l.length===0)return t;o&&o();let _=t.slice(0,l[0]);for(let v=0;v<l.length;++v){let R=l[v],D=l[v+1]||t.length;R===0?_=`
45
- ${e}${t.slice(0,D)}`:(r===nh&&u[R]&&(_+=`${t[R]}\\`),_+=`
46
- ${e}${t.slice(R+1,D)}`)}return _}function pM(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
47
- `);n=e,i=e+1,s=t[i]}return n}hl.FOLD_BLOCK=HT;hl.FOLD_FLOW=YV;hl.FOLD_QUOTED=nh;hl.foldFlowLines=KV});var gl=k(mM=>{"use strict";var $n=$t(),hs=hM(),sh=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),oh=t=>/^(%|---|\.\.\.)/m.test(t);function XV(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
44
+ `&&R!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===nh){for(;p===" "||p===" ";)p=v,v=t[h+=1],g=!0;let R=h>S+1?h-2:T-1;if(u[R])return t;l.push(R),u[R]=!0,d=R+c,f=void 0}else g=!0}p=v}if(g&&a&&a(),l.length===0)return t;o&&o();let _=t.slice(0,l[0]);for(let v=0;v<l.length;++v){let R=l[v],C=l[v+1]||t.length;R===0?_=`
45
+ ${e}${t.slice(0,C)}`:(r===nh&&u[R]&&(_+=`${t[R]}\\`),_+=`
46
+ ${e}${t.slice(R+1,C)}`)}return _}function pM(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
47
+ `);n=e,i=e+1,s=t[i]}return n}hl.FOLD_BLOCK=HT;hl.FOLD_FLOW=KV;hl.FOLD_QUOTED=nh;hl.foldFlowLines=YV});var gl=k(mM=>{"use strict";var $n=$t(),hs=hM(),sh=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),oh=t=>/^(%|---|\.\.\.)/m.test(t);function XV(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
48
48
  `){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function ml(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(oh(t)?" ":""),o="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(a,c);let u=r.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+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(o+=r.slice(a,c)+`
49
49
 
50
50
  `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
@@ -55,54 +55,54 @@ ${r}`)+"'";return e.implicitKey?n:hs.foldFlowLines(n,r,hs.FOLD_FLOW,sh(e,!1))}fu
55
55
  +(?!
56
56
  |$)`,"g")}catch{zT=/\n+(?!\n|$)/g}function ih({comment:t,type:e,value:r},n,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(r)||/^\s*$/.test(r))return Sa(r,n);let l=n.indent||(n.forceBlockIndent||oh(r)?" ":""),u=o==="literal"?!0:o==="folded"||e===$n.Scalar.BLOCK_FOLDED?!1:e===$n.Scalar.BLOCK_LITERAL?!0:!XV(r,c,l.length);if(!r)return u?`|
57
57
  `:`>
58
- `;let d,f;for(f=r.length;f>0;--f){let D=r[f-1];if(D!==`
59
- `&&D!==" "&&D!==" ")break}let p=r.substring(f),g=p.indexOf(`
58
+ `;let d,f;for(f=r.length;f>0;--f){let C=r[f-1];if(C!==`
59
+ `&&C!==" "&&C!==" ")break}let p=r.substring(f),g=p.indexOf(`
60
60
  `);g===-1?d="-":r===p||g!==p.length-1?(d="+",s&&s()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===`
61
- `&&(p=p.slice(0,-1)),p=p.replace(zT,`$&${l}`));let h=!1,T,S=-1;for(T=0;T<r.length;++T){let D=r[T];if(D===" ")h=!0;else if(D===`
62
- `)S=T;else break}let _=r.substring(0,S<T?S+1:T);_&&(r=r.substring(_.length),_=_.replace(/\n+/g,`$&${l}`));let R=(h?l?"2":"1":"")+d;if(t&&(R+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let D=r.replace(/\n+/g,`
63
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),B=!1,M=sh(n,!0);o!=="folded"&&e!==$n.Scalar.BLOCK_FOLDED&&(M.onOverflow=()=>{B=!0});let F=hs.foldFlowLines(`${_}${D}${p}`,l,hs.FOLD_BLOCK,M);if(!B)return`>${R}
61
+ `&&(p=p.slice(0,-1)),p=p.replace(zT,`$&${l}`));let h=!1,T,S=-1;for(T=0;T<r.length;++T){let C=r[T];if(C===" ")h=!0;else if(C===`
62
+ `)S=T;else break}let _=r.substring(0,S<T?S+1:T);_&&(r=r.substring(_.length),_=_.replace(/\n+/g,`$&${l}`));let R=(h?l?"2":"1":"")+d;if(t&&(R+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=r.replace(/\n+/g,`
63
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),B=!1,M=sh(n,!0);o!=="folded"&&e!==$n.Scalar.BLOCK_FOLDED&&(M.onOverflow=()=>{B=!0});let F=hs.foldFlowLines(`${_}${C}${p}`,l,hs.FOLD_BLOCK,M);if(!B)return`>${R}
64
64
  ${l}${F}`}return r=r.replace(/\n+/g,`$&${l}`),`|${R}
65
65
  ${l}${_}${r}${p}`}function JV(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
66
66
  `)||u&&/[[\]{},]/.test(s))return Sa(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
67
67
  `)?Sa(s,e):ih(t,e,r,n);if(!a&&!u&&i!==$n.Scalar.PLAIN&&s.includes(`
68
68
  `))return ih(t,e,r,n);if(oh(s)){if(c==="")return e.forceBlockIndent=!0,ih(t,e,r,n);if(a&&c===l)return Sa(s,e)}let d=s.replace(/\n+/g,`$&
69
69
  ${c}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:g}=e.doc.schema;if(g.some(f)||p?.some(f))return Sa(s,e)}return a?d:hs.foldFlowLines(d,c,hs.FOLD_FLOW,sh(e,!1))}function QV(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==$n.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=$n.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case $n.Scalar.BLOCK_FOLDED:case $n.Scalar.BLOCK_LITERAL:return i||s?Sa(o.value,e):ih(o,e,r,n);case $n.Scalar.QUOTE_DOUBLE:return ml(o.value,e);case $n.Scalar.QUOTE_SINGLE:return VT(o.value,e);case $n.Scalar.PLAIN:return JV(o,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}mM.stringifyString=QV});var yl=k(WT=>{"use strict";var ZV=Xp(),ms=Le(),ez=pl(),tz=gl();function rz(t,e){let r=Object.assign({blockQuote:!0,commentString:ez.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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function nz(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(ms.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??typeof n;throw new Error(`Tag not resolved for ${i} value`)}return r}function iz(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(ms.isScalar(t)||ms.isCollection(t))&&t.anchor;s&&ZV.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function sz(t,e,r,n){if(ms.isPair(t))return t.toString(e,r,n);if(ms.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=ms.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=nz(e.doc.schema.tags,s));let o=iz(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,r,n):ms.isScalar(s)?tz.stringifyString(s,e,r,n):s.toString(e,r,n);return o?ms.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
- ${e.indent}${a}`:a}WT.createStringifyContext=rz;WT.stringify=sz});var vM=k(TM=>{"use strict";var Oi=Le(),gM=$t(),yM=yl(),Tl=pl();function oz({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Oi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Oi.isCollection(t)||!Oi.isNode(t)&&typeof t=="object"){let M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Oi.isCollection(t)||(Oi.isScalar(t)?t.type===gM.Scalar.BLOCK_FOLDED||t.type===gM.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!s),indent:a+c});let g=!1,h=!1,T=yM.stringify(t,r,()=>g=!0,()=>h=!0);if(!p&&!r.inFlow&&T.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(s||e==null)return g&&n&&n(),T===""?"?":p?`? ${T}`:T}else if(s&&!d||e==null&&p)return T=`? ${T}`,f&&!g?T+=Tl.lineComment(T,r.indent,l(f)):h&&i&&i(),T;g&&(f=null),p?(f&&(T+=Tl.lineComment(T,r.indent,l(f))),T=`? ${T}
71
- ${a}:`):(T=`${T}:`,f&&(T+=Tl.lineComment(T,r.indent,l(f))));let S,_,v;Oi.isNode(e)?(S=!!e.spaceBefore,_=e.commentBefore,v=e.comment):(S=!1,_=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!p&&!f&&Oi.isScalar(e)&&(r.indentAtStart=T.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Oi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let R=!1,D=yM.stringify(e,r,()=>R=!0,()=>h=!0),B=" ";if(f||S||_){if(B=S?`
70
+ ${e.indent}${a}`:a}WT.createStringifyContext=rz;WT.stringify=sz});var vM=k(TM=>{"use strict";var Ii=Le(),gM=$t(),yM=yl(),Tl=pl();function oz({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Ii.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Ii.isCollection(t)||!Ii.isNode(t)&&typeof t=="object"){let M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Ii.isCollection(t)||(Ii.isScalar(t)?t.type===gM.Scalar.BLOCK_FOLDED||t.type===gM.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!s),indent:a+c});let g=!1,h=!1,T=yM.stringify(t,r,()=>g=!0,()=>h=!0);if(!p&&!r.inFlow&&T.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(s||e==null)return g&&n&&n(),T===""?"?":p?`? ${T}`:T}else if(s&&!d||e==null&&p)return T=`? ${T}`,f&&!g?T+=Tl.lineComment(T,r.indent,l(f)):h&&i&&i(),T;g&&(f=null),p?(f&&(T+=Tl.lineComment(T,r.indent,l(f))),T=`? ${T}
71
+ ${a}:`):(T=`${T}:`,f&&(T+=Tl.lineComment(T,r.indent,l(f))));let S,_,v;Ii.isNode(e)?(S=!!e.spaceBefore,_=e.commentBefore,v=e.comment):(S=!1,_=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!p&&!f&&Ii.isScalar(e)&&(r.indentAtStart=T.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Ii.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let R=!1,C=yM.stringify(e,r,()=>R=!0,()=>h=!0),B=" ";if(f||S||_){if(B=S?`
72
72
  `:"",_){let M=l(_);B+=`
73
- ${Tl.indentComment(M,r.indent)}`}D===""&&!r.inFlow?B===`
73
+ ${Tl.indentComment(M,r.indent)}`}C===""&&!r.inFlow?B===`
74
74
  `&&(B=`
75
75
 
76
76
  `):B+=`
77
- ${r.indent}`}else if(!p&&Oi.isCollection(e)){let M=D[0],F=D.indexOf(`
78
- `),ge=F!==-1,Je=r.inFlow??e.flow??e.items.length===0;if(ge||!Je){let Ft=!1;if(ge&&(M==="&"||M==="!")){let Ne=D.indexOf(" ");M==="&"&&Ne!==-1&&Ne<F&&D[Ne+1]==="!"&&(Ne=D.indexOf(" ",Ne+1)),(Ne===-1||F<Ne)&&(Ft=!0)}Ft||(B=`
79
- ${r.indent}`)}}else(D===""||D[0]===`
80
- `)&&(B="");return T+=B+D,r.inFlow?R&&n&&n():v&&!R?T+=Tl.lineComment(T,r.indent,l(v)):h&&i&&i(),T}TM.stringifyPair=oz});var YT=k(GT=>{"use strict";function az(t,...e){t==="debug"&&console.log(...e)}function cz(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}GT.debug=az;GT.warn=cz});var uh=k(lh=>{"use strict";var vl=Le(),bM=$t(),ah="<<",ch={identify:t=>t===ah||typeof t=="symbol"&&t.description===ah,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new bM.Scalar(Symbol(ah)),{addToJSMap:_M}),stringify:()=>ah},lz=(t,e)=>(ch.identify(e)||vl.isScalar(e)&&(!e.type||e.type===bM.Scalar.PLAIN)&&ch.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===ch.tag&&r.default);function _M(t,e,r){if(r=t&&vl.isAlias(r)?r.resolve(t.doc):r,vl.isSeq(r))for(let n of r.items)KT(t,e,n);else if(Array.isArray(r))for(let n of r)KT(t,e,n);else KT(t,e,r)}function KT(t,e,r){let n=t&&vl.isAlias(r)?r.resolve(t.doc):r;if(!vl.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)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}lh.addMergeToJSMap=_M;lh.isMergeKey=lz;lh.merge=ch});var JT=k(kM=>{"use strict";var uz=YT(),SM=uh(),dz=yl(),NM=Le(),XT=fs();function fz(t,e,{key:r,value:n}){if(NM.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(SM.isMergeKey(t,r))SM.addMergeToJSMap(t,e,n);else{let i=XT.toJS(r,"",t);if(e instanceof Map)e.set(i,XT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=pz(r,i,t),o=XT.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function pz(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(NM.isNode(t)&&r?.doc){let n=dz.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),uz.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}kM.addPairToJSMap=fz});var gs=k(QT=>{"use strict";var RM=fl(),hz=vM(),mz=JT(),dh=Le();function gz(t,e,r){let n=RM.createNode(t,void 0,r),i=RM.createNode(e,void 0,r);return new fh(n,i)}var fh=class t{constructor(e,r=null){Object.defineProperty(this,dh.NODE_TYPE,{value:dh.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return dh.isNode(r)&&(r=r.clone(e)),dh.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return mz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?hz.stringifyPair(this,e,r,n):JSON.stringify(this)}};QT.Pair=fh;QT.createPair=gz});var ZT=k(EM=>{"use strict";var Xs=Le(),PM=yl(),ph=pl();function yz(t,e,r){return(e.inFlow??t.flow?vz:Tz)(t,e,r)}function Tz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:s,type:null}),d=!1,f=[];for(let g=0;g<e.length;++g){let h=e[g],T=null;if(Xs.isNode(h))!d&&h.spaceBefore&&f.push(""),hh(r,f,h.commentBefore,d),h.comment&&(T=h.comment);else if(Xs.isPair(h)){let _=Xs.isNode(h.key)?h.key:null;_&&(!d&&_.spaceBefore&&f.push(""),hh(r,f,_.commentBefore,d))}d=!1;let S=PM.stringify(h,u,()=>T=null,()=>d=!0);T&&(S+=ph.lineComment(S,s,l(T))),d&&T&&(d=!1),f.push(n+S)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;g<f.length;++g){let h=f[g];p+=h?`
77
+ ${r.indent}`}else if(!p&&Ii.isCollection(e)){let M=C[0],F=C.indexOf(`
78
+ `),ge=F!==-1,Je=r.inFlow??e.flow??e.items.length===0;if(ge||!Je){let Ft=!1;if(ge&&(M==="&"||M==="!")){let Ne=C.indexOf(" ");M==="&"&&Ne!==-1&&Ne<F&&C[Ne+1]==="!"&&(Ne=C.indexOf(" ",Ne+1)),(Ne===-1||F<Ne)&&(Ft=!0)}Ft||(B=`
79
+ ${r.indent}`)}}else(C===""||C[0]===`
80
+ `)&&(B="");return T+=B+C,r.inFlow?R&&n&&n():v&&!R?T+=Tl.lineComment(T,r.indent,l(v)):h&&i&&i(),T}TM.stringifyPair=oz});var KT=k(GT=>{"use strict";function az(t,...e){t==="debug"&&console.log(...e)}function cz(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}GT.debug=az;GT.warn=cz});var uh=k(lh=>{"use strict";var vl=Le(),bM=$t(),ah="<<",ch={identify:t=>t===ah||typeof t=="symbol"&&t.description===ah,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new bM.Scalar(Symbol(ah)),{addToJSMap:_M}),stringify:()=>ah},lz=(t,e)=>(ch.identify(e)||vl.isScalar(e)&&(!e.type||e.type===bM.Scalar.PLAIN)&&ch.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===ch.tag&&r.default);function _M(t,e,r){if(r=t&&vl.isAlias(r)?r.resolve(t.doc):r,vl.isSeq(r))for(let n of r.items)YT(t,e,n);else if(Array.isArray(r))for(let n of r)YT(t,e,n);else YT(t,e,r)}function YT(t,e,r){let n=t&&vl.isAlias(r)?r.resolve(t.doc):r;if(!vl.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)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}lh.addMergeToJSMap=_M;lh.isMergeKey=lz;lh.merge=ch});var JT=k(kM=>{"use strict";var uz=KT(),SM=uh(),dz=yl(),NM=Le(),XT=fs();function fz(t,e,{key:r,value:n}){if(NM.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(SM.isMergeKey(t,r))SM.addMergeToJSMap(t,e,n);else{let i=XT.toJS(r,"",t);if(e instanceof Map)e.set(i,XT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=pz(r,i,t),o=XT.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function pz(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(NM.isNode(t)&&r?.doc){let n=dz.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),uz.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}kM.addPairToJSMap=fz});var gs=k(QT=>{"use strict";var RM=fl(),hz=vM(),mz=JT(),dh=Le();function gz(t,e,r){let n=RM.createNode(t,void 0,r),i=RM.createNode(e,void 0,r);return new fh(n,i)}var fh=class t{constructor(e,r=null){Object.defineProperty(this,dh.NODE_TYPE,{value:dh.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return dh.isNode(r)&&(r=r.clone(e)),dh.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return mz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?hz.stringifyPair(this,e,r,n):JSON.stringify(this)}};QT.Pair=fh;QT.createPair=gz});var ZT=k(wM=>{"use strict";var Xs=Le(),PM=yl(),ph=pl();function yz(t,e,r){return(e.inFlow??t.flow?vz:Tz)(t,e,r)}function Tz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:s,type:null}),d=!1,f=[];for(let g=0;g<e.length;++g){let h=e[g],T=null;if(Xs.isNode(h))!d&&h.spaceBefore&&f.push(""),hh(r,f,h.commentBefore,d),h.comment&&(T=h.comment);else if(Xs.isPair(h)){let _=Xs.isNode(h.key)?h.key:null;_&&(!d&&_.spaceBefore&&f.push(""),hh(r,f,_.commentBefore,d))}d=!1;let S=PM.stringify(h,u,()=>T=null,()=>d=!0);T&&(S+=ph.lineComment(S,s,l(T))),d&&T&&(d=!1),f.push(n+S)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;g<f.length;++g){let h=f[g];p+=h?`
81
81
  ${c}${h}`:`
82
82
  `}}return t?(p+=`
83
83
  `+ph.indentComment(l(t),c),a&&a()):d&&o&&o(),p}function vz({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let g=0;g<t.length;++g){let h=t[g],T=null;if(Xs.isNode(h))h.spaceBefore&&d.push(""),hh(e,d,h.commentBefore,!1),h.comment&&(T=h.comment);else if(Xs.isPair(h)){let _=Xs.isNode(h.key)?h.key:null;_&&(_.spaceBefore&&d.push(""),hh(e,d,_.commentBefore,!1),_.comment&&(l=!0));let v=Xs.isNode(h.value)?h.value:null;v?(v.comment&&(T=v.comment),v.commentBefore&&(l=!0)):h.value==null&&_?.comment&&(T=_.comment)}T&&(l=!0);let S=PM.stringify(h,c,()=>T=null);g<t.length-1&&(S+=","),T&&(S+=ph.lineComment(S,n,a(T))),!l&&(d.length>u||S.includes(`
84
84
  `))&&(l=!0),d.push(S),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let g=d.reduce((h,T)=>h+T.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=f;for(let h of d)g+=h?`
85
85
  ${s}${i}${h}`:`
86
86
  `;return`${g}
87
- ${i}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function hh({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=ph.indentComment(e(n),t);r.push(s.trimStart())}}EM.stringifyCollection=yz});var Ts=k(tv=>{"use strict";var bz=ZT(),_z=JT(),Sz=th(),ys=Le(),mh=gs(),Nz=$t();function bl(t,e){let r=ys.isScalar(e)?e.value:e;for(let n of t)if(ys.isPair(n)&&(n.key===e||n.key===r||ys.isScalar(n.key)&&n.key.value===r))return n}var ev=class extends Sz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ys.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(r,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&o.items.push(mh.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;ys.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new mh.Pair(e,e?.value):n=new mh.Pair(e.key,e.value);let i=bl(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);ys.isScalar(i.value)&&Nz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(a=>s(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=bl(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=bl(this.items,e)?.value;return(!r&&ys.isScalar(i)?i.value:i)??void 0}has(e){return!!bl(this.items,e)}set(e,r){this.add(new mh.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)_z.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ys.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),bz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};tv.YAMLMap=ev;tv.findPair=bl});var Na=k(DM=>{"use strict";var kz=Le(),wM=Ts(),Rz={collection:"map",default:!0,nodeClass:wM.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return kz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>wM.YAMLMap.from(t,e,r)};DM.map=Rz});var vs=k(CM=>{"use strict";var Pz=fl(),Ez=ZT(),wz=th(),yh=Le(),Dz=$t(),Cz=fs(),rv=class extends wz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yh.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=gh(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=gh(e);if(typeof n!="number")return;let i=this.items[n];return!r&&yh.isScalar(i)?i.value:i}has(e){let r=gh(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=gh(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];yh.isScalar(i)&&Dz.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(Cz.toJS(s,String(i++),r));return n}toString(e,r,n){return e?Ez.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(o++);a=i.call(r,c,a)}s.items.push(Pz.createNode(a,void 0,n))}}return s}};function gh(t){let e=yh.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}CM.YAMLSeq=rv});var ka=k(OM=>{"use strict";var Az=Le(),AM=vs(),Oz={collection:"seq",default:!0,nodeClass:AM.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Az.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>AM.YAMLSeq.from(t,e,r)};OM.seq=Oz});var _l=k(IM=>{"use strict";var Iz=gl(),Mz={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Iz.stringifyString(t,e,r,n)}};IM.string=Mz});var Th=k(LM=>{"use strict";var MM=$t(),xM={identify:t=>t==null,createNode:()=>new MM.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new MM.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&xM.test.test(t)?t:e.options.nullStr};LM.nullTag=xM});var nv=k($M=>{"use strict";var xz=$t(),qM={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new xz.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&qM.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};$M.boolTag=qM});var Ra=k(BM=>{"use strict";function Lz({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(n);if(!t&&e&&(!r||r==="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}BM.stringifyNumber=Lz});var sv=k(vh=>{"use strict";var qz=$t(),iv=Ra(),$z={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:iv.stringifyNumber},Bz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():iv.stringifyNumber(t)}},Fz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new qz.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:iv.stringifyNumber};vh.float=Fz;vh.floatExp=Bz;vh.floatNaN=$z});var av=k(_h=>{"use strict";var FM=Ra(),bh=t=>typeof t=="bigint"||Number.isInteger(t),ov=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function jM(t,e,r){let{value:n}=t;return bh(n)&&n>=0?r+n.toString(e):FM.stringifyNumber(t)}var jz={identify:t=>bh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>ov(t,2,8,r),stringify:t=>jM(t,8,"0o")},Uz={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>ov(t,0,10,r),stringify:FM.stringifyNumber},Hz={identify:t=>bh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>ov(t,2,16,r),stringify:t=>jM(t,16,"0x")};_h.int=Uz;_h.intHex=Hz;_h.intOct=jz});var HM=k(UM=>{"use strict";var Vz=Na(),zz=Th(),Wz=ka(),Gz=_l(),Yz=nv(),cv=sv(),lv=av(),Kz=[Vz.map,Wz.seq,Gz.string,zz.nullTag,Yz.boolTag,lv.intOct,lv.int,lv.intHex,cv.floatNaN,cv.floatExp,cv.float];UM.schema=Kz});var WM=k(zM=>{"use strict";var Xz=$t(),Jz=Na(),Qz=ka();function VM(t){return typeof t=="bigint"||Number.isInteger(t)}var Sh=({value:t})=>JSON.stringify(t),Zz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sh},{identify:t=>t==null,createNode:()=>new Xz.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sh},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sh},{identify:VM,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>VM(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sh}],e2={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},t2=[Jz.map,Qz.seq].concat(Zz,e2);zM.schema=t2});var dv=k(GM=>{"use strict";var uv=$t(),r2=gl(),n2={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){let o=r,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=uv.Scalar.BLOCK_LITERAL),e!==uv.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===uv.Scalar.BLOCK_LITERAL?`
88
- `:" ")}return r2.stringifyString({comment:t,type:e,value:a},n,i,s)}};GM.binary=n2});var Rh=k(kh=>{"use strict";var Nh=Le(),fv=gs(),i2=$t(),s2=vs();function YM(t,e){if(Nh.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Nh.isPair(n)){if(Nh.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new fv.Pair(new i2.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
87
+ ${i}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function hh({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=ph.indentComment(e(n),t);r.push(s.trimStart())}}wM.stringifyCollection=yz});var Ts=k(tv=>{"use strict";var bz=ZT(),_z=JT(),Sz=th(),ys=Le(),mh=gs(),Nz=$t();function bl(t,e){let r=ys.isScalar(e)?e.value:e;for(let n of t)if(ys.isPair(n)&&(n.key===e||n.key===r||ys.isScalar(n.key)&&n.key.value===r))return n}var ev=class extends Sz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ys.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(r,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&o.items.push(mh.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;ys.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new mh.Pair(e,e?.value):n=new mh.Pair(e.key,e.value);let i=bl(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);ys.isScalar(i.value)&&Nz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(a=>s(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=bl(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=bl(this.items,e)?.value;return(!r&&ys.isScalar(i)?i.value:i)??void 0}has(e){return!!bl(this.items,e)}set(e,r){this.add(new mh.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)_z.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ys.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),bz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};tv.YAMLMap=ev;tv.findPair=bl});var Na=k(CM=>{"use strict";var kz=Le(),EM=Ts(),Rz={collection:"map",default:!0,nodeClass:EM.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return kz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>EM.YAMLMap.from(t,e,r)};CM.map=Rz});var vs=k(DM=>{"use strict";var Pz=fl(),wz=ZT(),Ez=th(),yh=Le(),Cz=$t(),Dz=fs(),rv=class extends Ez.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yh.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=gh(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=gh(e);if(typeof n!="number")return;let i=this.items[n];return!r&&yh.isScalar(i)?i.value:i}has(e){let r=gh(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=gh(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];yh.isScalar(i)&&Cz.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(Dz.toJS(s,String(i++),r));return n}toString(e,r,n){return e?wz.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(o++);a=i.call(r,c,a)}s.items.push(Pz.createNode(a,void 0,n))}}return s}};function gh(t){let e=yh.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}DM.YAMLSeq=rv});var ka=k(IM=>{"use strict";var Az=Le(),AM=vs(),Iz={collection:"seq",default:!0,nodeClass:AM.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Az.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>AM.YAMLSeq.from(t,e,r)};IM.seq=Iz});var _l=k(OM=>{"use strict";var Oz=gl(),Mz={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Oz.stringifyString(t,e,r,n)}};OM.string=Mz});var Th=k(LM=>{"use strict";var MM=$t(),xM={identify:t=>t==null,createNode:()=>new MM.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new MM.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&xM.test.test(t)?t:e.options.nullStr};LM.nullTag=xM});var nv=k($M=>{"use strict";var xz=$t(),qM={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new xz.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&qM.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};$M.boolTag=qM});var Ra=k(BM=>{"use strict";function Lz({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(n);if(!t&&e&&(!r||r==="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}BM.stringifyNumber=Lz});var sv=k(vh=>{"use strict";var qz=$t(),iv=Ra(),$z={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:iv.stringifyNumber},Bz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():iv.stringifyNumber(t)}},Fz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new qz.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:iv.stringifyNumber};vh.float=Fz;vh.floatExp=Bz;vh.floatNaN=$z});var av=k(_h=>{"use strict";var FM=Ra(),bh=t=>typeof t=="bigint"||Number.isInteger(t),ov=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function jM(t,e,r){let{value:n}=t;return bh(n)&&n>=0?r+n.toString(e):FM.stringifyNumber(t)}var jz={identify:t=>bh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>ov(t,2,8,r),stringify:t=>jM(t,8,"0o")},Uz={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>ov(t,0,10,r),stringify:FM.stringifyNumber},Hz={identify:t=>bh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>ov(t,2,16,r),stringify:t=>jM(t,16,"0x")};_h.int=Uz;_h.intHex=Hz;_h.intOct=jz});var HM=k(UM=>{"use strict";var Vz=Na(),zz=Th(),Wz=ka(),Gz=_l(),Kz=nv(),cv=sv(),lv=av(),Yz=[Vz.map,Wz.seq,Gz.string,zz.nullTag,Kz.boolTag,lv.intOct,lv.int,lv.intHex,cv.floatNaN,cv.floatExp,cv.float];UM.schema=Yz});var WM=k(zM=>{"use strict";var Xz=$t(),Jz=Na(),Qz=ka();function VM(t){return typeof t=="bigint"||Number.isInteger(t)}var Sh=({value:t})=>JSON.stringify(t),Zz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sh},{identify:t=>t==null,createNode:()=>new Xz.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sh},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sh},{identify:VM,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>VM(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sh}],e2={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},t2=[Jz.map,Qz.seq].concat(Zz,e2);zM.schema=t2});var dv=k(GM=>{"use strict";var uv=$t(),r2=gl(),n2={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){let o=r,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=uv.Scalar.BLOCK_LITERAL),e!==uv.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===uv.Scalar.BLOCK_LITERAL?`
88
+ `:" ")}return r2.stringifyString({comment:t,type:e,value:a},n,i,s)}};GM.binary=n2});var Rh=k(kh=>{"use strict";var Nh=Le(),fv=gs(),i2=$t(),s2=vs();function KM(t,e){if(Nh.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Nh.isPair(n)){if(Nh.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new fv.Pair(new i2.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
89
89
  ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
90
- ${s.comment}`:n.comment}n=i}t.items[r]=Nh.isPair(n)?n:new fv.Pair(n)}}else e("Expected a sequence for this tag");return t}function KM(t,e,r){let{replacer:n}=r,i=new s2.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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;i.items.push(fv.createPair(a,c,r))}return i}var o2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:YM,createNode:KM};kh.createPairs=KM;kh.pairs=o2;kh.resolvePairs=YM});var mv=k(hv=>{"use strict";var XM=Le(),pv=fs(),Sl=Ts(),a2=vs(),JM=Rh(),Js=class t extends a2.YAMLSeq{constructor(){super(),this.add=Sl.YAMLMap.prototype.add.bind(this),this.delete=Sl.YAMLMap.prototype.delete.bind(this),this.get=Sl.YAMLMap.prototype.get.bind(this),this.has=Sl.YAMLMap.prototype.has.bind(this),this.set=Sl.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(XM.isPair(i)?(s=pv.toJS(i.key,"",r),o=pv.toJS(i.value,s,r)):s=pv.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=JM.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Js.tag="tag:yaml.org,2002:omap";var c2={collection:"seq",identify:t=>t instanceof Map,nodeClass:Js,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=JM.resolvePairs(t,e),n=[];for(let{key:i}of r.items)XM.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Js,r)},createNode:(t,e,r)=>Js.from(t,e,r)};hv.YAMLOMap=Js;hv.omap=c2});var rx=k(gv=>{"use strict";var QM=$t();function ZM({value:t,source:e},r){return e&&(t?ex:tx).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var ex={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new QM.Scalar(!0),stringify:ZM},tx={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new QM.Scalar(!1),stringify:ZM};gv.falseTag=tx;gv.trueTag=ex});var nx=k(Ph=>{"use strict";var l2=$t(),yv=Ra(),u2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yv.stringifyNumber},d2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():yv.stringifyNumber(t)}},f2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new l2.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:yv.stringifyNumber};Ph.float=f2;Ph.floatExp=d2;Ph.floatNaN=u2});var sx=k(kl=>{"use strict";var ix=Ra(),Nl=t=>typeof t=="bigint"||Number.isInteger(t);function Eh(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function Tv(t,e,r){let{value:n}=t;if(Nl(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return ix.stringifyNumber(t)}var p2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Eh(t,2,2,r),stringify:t=>Tv(t,2,"0b")},h2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Eh(t,1,8,r),stringify:t=>Tv(t,8,"0")},m2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Eh(t,0,10,r),stringify:ix.stringifyNumber},g2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Eh(t,2,16,r),stringify:t=>Tv(t,16,"0x")};kl.int=m2;kl.intBin=p2;kl.intHex=g2;kl.intOct=h2});var bv=k(vv=>{"use strict";var Ch=Le(),wh=gs(),Dh=Ts(),Qs=class t extends Dh.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Ch.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new wh.Pair(e.key,null):r=new wh.Pair(e,null),Dh.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Dh.findPair(this.items,e);return!r&&Ch.isPair(n)?Ch.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Dh.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new wh.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(wh.createPair(o,null,n));return s}};Qs.tag="tag:yaml.org,2002:set";var y2={collection:"map",identify:t=>t instanceof Set,nodeClass:Qs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Qs.from(t,e,r),resolve(t,e){if(Ch.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Qs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};vv.YAMLSet=Qs;vv.set=y2});var Sv=k(Ah=>{"use strict";var T2=Ra();function _v(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function ox(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return T2.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var v2={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>_v(t,r),stringify:ox},b2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>_v(t,!1),stringify:ox},ax={identify:t=>t 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(t){let e=t.match(ax.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=_v(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Ah.floatTime=b2;Ah.intTime=v2;Ah.timestamp=ax});var ux=k(lx=>{"use strict";var _2=Na(),S2=Th(),N2=ka(),k2=_l(),R2=dv(),cx=rx(),Nv=nx(),Oh=sx(),P2=uh(),E2=mv(),w2=Rh(),D2=bv(),kv=Sv(),C2=[_2.map,N2.seq,k2.string,S2.nullTag,cx.trueTag,cx.falseTag,Oh.intBin,Oh.intOct,Oh.int,Oh.intHex,Nv.floatNaN,Nv.floatExp,Nv.float,R2.binary,P2.merge,E2.omap,w2.pairs,D2.set,kv.intTime,kv.floatTime,kv.timestamp];lx.schema=C2});var bx=k(Ev=>{"use strict";var hx=Na(),A2=Th(),mx=ka(),O2=_l(),I2=nv(),Rv=sv(),Pv=av(),M2=HM(),x2=WM(),gx=dv(),Rl=uh(),yx=mv(),Tx=Rh(),dx=ux(),vx=bv(),Ih=Sv(),fx=new Map([["core",M2.schema],["failsafe",[hx.map,mx.seq,O2.string]],["json",x2.schema],["yaml11",dx.schema],["yaml-1.1",dx.schema]]),px={binary:gx.binary,bool:I2.boolTag,float:Rv.float,floatExp:Rv.floatExp,floatNaN:Rv.floatNaN,floatTime:Ih.floatTime,int:Pv.int,intHex:Pv.intHex,intOct:Pv.intOct,intTime:Ih.intTime,map:hx.map,merge:Rl.merge,null:A2.nullTag,omap:yx.omap,pairs:Tx.pairs,seq:mx.seq,set:vx.set,timestamp:Ih.timestamp},L2={"tag:yaml.org,2002:binary":gx.binary,"tag:yaml.org,2002:merge":Rl.merge,"tag:yaml.org,2002:omap":yx.omap,"tag:yaml.org,2002:pairs":Tx.pairs,"tag:yaml.org,2002:set":vx.set,"tag:yaml.org,2002:timestamp":Ih.timestamp};function q2(t,e,r){let n=fx.get(e);if(n&&!t)return r&&!n.includes(Rl.merge)?n.concat(Rl.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(fx.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(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Rl.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?px[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(px).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},[])}Ev.coreKnownTags=L2;Ev.getTags=q2});var Cv=k(_x=>{"use strict";var wv=Le(),$2=Na(),B2=ka(),F2=_l(),Mh=bx(),j2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Dv=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Mh.getTags(e,"compat"):e?Mh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Mh.coreKnownTags:{},this.tags=Mh.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,wv.MAP,{value:$2.map}),Object.defineProperty(this,wv.SCALAR,{value:F2.string}),Object.defineProperty(this,wv.SEQ,{value:B2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?j2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};_x.Schema=Dv});var Nx=k(Sx=>{"use strict";var U2=Le(),Av=yl(),Pl=pl();function H2(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=Av.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(Pl.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(U2.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);r.push(Pl.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=Av.stringify(t.contents,i,()=>a=null,c);a&&(l+=Pl.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Av.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
90
+ ${s.comment}`:n.comment}n=i}t.items[r]=Nh.isPair(n)?n:new fv.Pair(n)}}else e("Expected a sequence for this tag");return t}function YM(t,e,r){let{replacer:n}=r,i=new s2.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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;i.items.push(fv.createPair(a,c,r))}return i}var o2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:KM,createNode:YM};kh.createPairs=YM;kh.pairs=o2;kh.resolvePairs=KM});var mv=k(hv=>{"use strict";var XM=Le(),pv=fs(),Sl=Ts(),a2=vs(),JM=Rh(),Js=class t extends a2.YAMLSeq{constructor(){super(),this.add=Sl.YAMLMap.prototype.add.bind(this),this.delete=Sl.YAMLMap.prototype.delete.bind(this),this.get=Sl.YAMLMap.prototype.get.bind(this),this.has=Sl.YAMLMap.prototype.has.bind(this),this.set=Sl.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(XM.isPair(i)?(s=pv.toJS(i.key,"",r),o=pv.toJS(i.value,s,r)):s=pv.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=JM.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Js.tag="tag:yaml.org,2002:omap";var c2={collection:"seq",identify:t=>t instanceof Map,nodeClass:Js,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=JM.resolvePairs(t,e),n=[];for(let{key:i}of r.items)XM.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Js,r)},createNode:(t,e,r)=>Js.from(t,e,r)};hv.YAMLOMap=Js;hv.omap=c2});var rx=k(gv=>{"use strict";var QM=$t();function ZM({value:t,source:e},r){return e&&(t?ex:tx).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var ex={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new QM.Scalar(!0),stringify:ZM},tx={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new QM.Scalar(!1),stringify:ZM};gv.falseTag=tx;gv.trueTag=ex});var nx=k(Ph=>{"use strict";var l2=$t(),yv=Ra(),u2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yv.stringifyNumber},d2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():yv.stringifyNumber(t)}},f2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new l2.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:yv.stringifyNumber};Ph.float=f2;Ph.floatExp=d2;Ph.floatNaN=u2});var sx=k(kl=>{"use strict";var ix=Ra(),Nl=t=>typeof t=="bigint"||Number.isInteger(t);function wh(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function Tv(t,e,r){let{value:n}=t;if(Nl(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return ix.stringifyNumber(t)}var p2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>wh(t,2,2,r),stringify:t=>Tv(t,2,"0b")},h2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>wh(t,1,8,r),stringify:t=>Tv(t,8,"0")},m2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>wh(t,0,10,r),stringify:ix.stringifyNumber},g2={identify:Nl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>wh(t,2,16,r),stringify:t=>Tv(t,16,"0x")};kl.int=m2;kl.intBin=p2;kl.intHex=g2;kl.intOct=h2});var bv=k(vv=>{"use strict";var Dh=Le(),Eh=gs(),Ch=Ts(),Qs=class t extends Ch.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Dh.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Eh.Pair(e.key,null):r=new Eh.Pair(e,null),Ch.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Ch.findPair(this.items,e);return!r&&Dh.isPair(n)?Dh.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Ch.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Eh.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Eh.createPair(o,null,n));return s}};Qs.tag="tag:yaml.org,2002:set";var y2={collection:"map",identify:t=>t instanceof Set,nodeClass:Qs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Qs.from(t,e,r),resolve(t,e){if(Dh.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Qs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};vv.YAMLSet=Qs;vv.set=y2});var Sv=k(Ah=>{"use strict";var T2=Ra();function _v(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function ox(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return T2.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var v2={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>_v(t,r),stringify:ox},b2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>_v(t,!1),stringify:ox},ax={identify:t=>t 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(t){let e=t.match(ax.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=_v(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Ah.floatTime=b2;Ah.intTime=v2;Ah.timestamp=ax});var ux=k(lx=>{"use strict";var _2=Na(),S2=Th(),N2=ka(),k2=_l(),R2=dv(),cx=rx(),Nv=nx(),Ih=sx(),P2=uh(),w2=mv(),E2=Rh(),C2=bv(),kv=Sv(),D2=[_2.map,N2.seq,k2.string,S2.nullTag,cx.trueTag,cx.falseTag,Ih.intBin,Ih.intOct,Ih.int,Ih.intHex,Nv.floatNaN,Nv.floatExp,Nv.float,R2.binary,P2.merge,w2.omap,E2.pairs,C2.set,kv.intTime,kv.floatTime,kv.timestamp];lx.schema=D2});var bx=k(wv=>{"use strict";var hx=Na(),A2=Th(),mx=ka(),I2=_l(),O2=nv(),Rv=sv(),Pv=av(),M2=HM(),x2=WM(),gx=dv(),Rl=uh(),yx=mv(),Tx=Rh(),dx=ux(),vx=bv(),Oh=Sv(),fx=new Map([["core",M2.schema],["failsafe",[hx.map,mx.seq,I2.string]],["json",x2.schema],["yaml11",dx.schema],["yaml-1.1",dx.schema]]),px={binary:gx.binary,bool:O2.boolTag,float:Rv.float,floatExp:Rv.floatExp,floatNaN:Rv.floatNaN,floatTime:Oh.floatTime,int:Pv.int,intHex:Pv.intHex,intOct:Pv.intOct,intTime:Oh.intTime,map:hx.map,merge:Rl.merge,null:A2.nullTag,omap:yx.omap,pairs:Tx.pairs,seq:mx.seq,set:vx.set,timestamp:Oh.timestamp},L2={"tag:yaml.org,2002:binary":gx.binary,"tag:yaml.org,2002:merge":Rl.merge,"tag:yaml.org,2002:omap":yx.omap,"tag:yaml.org,2002:pairs":Tx.pairs,"tag:yaml.org,2002:set":vx.set,"tag:yaml.org,2002:timestamp":Oh.timestamp};function q2(t,e,r){let n=fx.get(e);if(n&&!t)return r&&!n.includes(Rl.merge)?n.concat(Rl.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(fx.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(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Rl.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?px[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(px).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},[])}wv.coreKnownTags=L2;wv.getTags=q2});var Dv=k(_x=>{"use strict";var Ev=Le(),$2=Na(),B2=ka(),F2=_l(),Mh=bx(),j2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Cv=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Mh.getTags(e,"compat"):e?Mh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Mh.coreKnownTags:{},this.tags=Mh.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Ev.MAP,{value:$2.map}),Object.defineProperty(this,Ev.SCALAR,{value:F2.string}),Object.defineProperty(this,Ev.SEQ,{value:B2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?j2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};_x.Schema=Cv});var Nx=k(Sx=>{"use strict";var U2=Le(),Av=yl(),Pl=pl();function H2(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=Av.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(Pl.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(U2.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);r.push(Pl.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=Av.stringify(t.contents,i,()=>a=null,c);a&&(l+=Pl.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Av.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
91
91
  `)?(r.push("..."),r.push(Pl.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(Pl.indentComment(s(c),"")))}return r.join(`
92
92
  `)+`
93
- `}Sx.stringifyDocument=H2});var El=k(kx=>{"use strict";var V2=dl(),Pa=th(),mn=Le(),z2=gs(),W2=fs(),G2=Cv(),Y2=Nx(),Ov=Xp(),K2=LT(),X2=fl(),Iv=xT(),Mv=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mn.NODE_TYPE,{value:mn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Iv.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[mn.NODE_TYPE]:{value:mn.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=mn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ea(this.contents)&&this.contents.add(e)}addIn(e,r){Ea(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Ov.anchorNames(this);e.anchor=!r||n.has(r)?Ov.findNewAnchor(r||"a",n):r}return new V2.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let T=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,S=r.filter(T).map(String);S.length>0&&(r=r.concat(S)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=Ov.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=X2.createNode(e,u,g);return a&&mn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new z2.Pair(i,s)}delete(e){return Ea(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Pa.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ea(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return mn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Pa.isEmptyPath(e)?!r&&mn.isScalar(this.contents)?this.contents.value:this.contents:mn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return mn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Pa.isEmptyPath(e)?this.contents!==void 0:mn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Pa.collectionFromPath(this.schema,[e],r):Ea(this.contents)&&this.contents.set(e,r)}setIn(e,r){Pa.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Pa.collectionFromPath(this.schema,Array.from(e),r):Ea(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Iv.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Iv.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new G2.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=W2.toJS(this.contents,r??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?K2.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Y2.stringifyDocument(this,e)}};function Ea(t){if(mn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}kx.Document=Mv});var Cl=k(Dl=>{"use strict";var wl=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},xv=class extends wl{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Lv=class extends wl{constructor(e,r,n){super("YAMLWarning",e,r,n)}},J2=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).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"),n>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
93
+ `}Sx.stringifyDocument=H2});var wl=k(kx=>{"use strict";var V2=dl(),Pa=th(),mn=Le(),z2=gs(),W2=fs(),G2=Dv(),K2=Nx(),Iv=Xp(),Y2=LT(),X2=fl(),Ov=xT(),Mv=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mn.NODE_TYPE,{value:mn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ov.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[mn.NODE_TYPE]:{value:mn.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=mn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){wa(this.contents)&&this.contents.add(e)}addIn(e,r){wa(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Iv.anchorNames(this);e.anchor=!r||n.has(r)?Iv.findNewAnchor(r||"a",n):r}return new V2.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let T=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,S=r.filter(T).map(String);S.length>0&&(r=r.concat(S)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=Iv.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=X2.createNode(e,u,g);return a&&mn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new z2.Pair(i,s)}delete(e){return wa(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Pa.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):wa(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return mn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Pa.isEmptyPath(e)?!r&&mn.isScalar(this.contents)?this.contents.value:this.contents:mn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return mn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Pa.isEmptyPath(e)?this.contents!==void 0:mn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Pa.collectionFromPath(this.schema,[e],r):wa(this.contents)&&this.contents.set(e,r)}setIn(e,r){Pa.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Pa.collectionFromPath(this.schema,Array.from(e),r):wa(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ov.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ov.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new G2.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=W2.toJS(this.contents,r??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?Y2.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return K2.stringifyDocument(this,e)}};function wa(t){if(mn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}kx.Document=Mv});var Dl=k(Cl=>{"use strict";var El=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},xv=class extends El{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Lv=class extends El{constructor(e,r,n){super("YAMLWarning",e,r,n)}},J2=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).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"),n>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
94
94
  `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=r.linePos[1];c&&c.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(a);r.message+=`:
95
95
 
96
96
  ${o}
97
97
  ${l}
98
- `}};Dl.YAMLError=wl;Dl.YAMLParseError=xv;Dl.YAMLWarning=Lv;Dl.prettifyError=J2});var Al=k(Rx=>{"use strict";function Q2(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,g=!1,h=null,T=null,S=null,_=null,v=null,R=null,D=null;for(let F of t)switch(g&&(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma"&&s(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&F.type!=="comment"&&F.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),F.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&F.source.includes(" ")&&(h=F),u=!0;break;case"comment":{u||s(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ge=F.source.substring(1)||" ";d?d+=f+ge:d=ge,f="",l=!1;break}case"newline":l?d?d+=F.source:c=!0:f+=F.source,l=!0,p=!0,(T||S)&&(_=F),u=!0;break;case"anchor":T&&s(F,"MULTIPLE_ANCHORS","A node can have at most one anchor"),F.source.endsWith(":")&&s(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=F,D===null&&(D=F.offset),l=!1,u=!1,g=!0;break;case"tag":{S&&s(F,"MULTIPLE_TAGS","A node can have at most one tag"),S=F,D===null&&(D=F.offset),l=!1,u=!1,g=!0;break}case r:(T||S)&&s(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`),R&&s(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${e??"collection"}`),R=F,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(F,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=F,l=!1,u=!1;break}default:s(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),l=!1,u=!1}let B=t[t.length-1],M=B?B.offset+B.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:R,spaceBefore:c,comment:d,hasNewline:p,anchor:T,tag:S,newlineAfterProp:_,end:M,start:D??M}}Rx.resolveProps=Q2});var xh=k(Px=>{"use strict";function qv(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
99
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(qv(e.key)||qv(e.value))return!0}return!1;default:return!0}}Px.containsNewline=qv});var $v=k(Ex=>{"use strict";var Z2=xh();function eW(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Z2.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ex.flowIndentCheck=eW});var Bv=k(Dx=>{"use strict";var wx=Le();function tW(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||wx.isScalar(s)&&wx.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}Dx.mapIncludes=tW});var xx=k(Mx=>{"use strict";var Cx=gs(),rW=Ts(),Ax=Al(),nW=xh(),Ox=$v(),iW=Bv(),Ix="All mapping items must start at the same column";function sW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??rW.YAMLMap,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:g}=u,h=Ax.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),T=!h.found;if(T){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Ix)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=`
100
- `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||nW.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Ix);r.atKey=!0;let S=h.end,_=f?t(r,f,h,i):e(r,S,d,null,h,i);r.schema.compat&&Ox.flowIndentCheck(n.indent,f,i),r.atKey=!1,iW.mapIncludes(r,a.items,_)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let v=Ax.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=v.end,v.found){T&&(g?.type==="block-map"&&!v.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<v.found.offset-1024&&i(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=g?t(r,g,v,i):e(r,c,p,null,v,i);r.schema.compat&&Ox.flowIndentCheck(n.indent,g,i),c=R.range[2];let D=new Cx.Pair(_,R);r.options.keepSourceTokens&&(D.srcToken=u),a.items.push(D)}else{T&&i(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(_.comment?_.comment+=`
101
- `+v.comment:_.comment=v.comment);let R=new Cx.Pair(_);r.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Mx.resolveBlockMap=sW});var qx=k(Lx=>{"use strict";var oW=vs(),aW=Al(),cW=$v();function lW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??oW.YAMLSeq,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=aW.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&cW.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Lx.resolveBlockSeq=lW});var wa=k($x=>{"use strict";function uW(t,e,r,n){let i="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{r&&!s&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}$x.resolveEnd=uW});var Ux=k(jx=>{"use strict";var dW=Le(),fW=gs(),Bx=Ts(),pW=vs(),hW=wa(),Fx=Al(),mW=xh(),gW=Bv(),Fv="Block collections are not allowed within flow collections",jv=t=>t&&(t.type==="block-map"||t.type==="block-seq");function yW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?Bx.YAMLMap:pW.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let T=0;T<n.items.length;++T){let S=n.items[T],{start:_,key:v,sep:R,value:D}=S,B=Fx.resolveProps(_,{flow:a,indicator:"explicit-key-ind",next:v??R?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!B.found){if(!B.anchor&&!B.tag&&!R&&!D){T===0&&B.comma?i(B.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):T<n.items.length-1&&i(B.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),B.comment&&(l.comment?l.comment+=`
98
+ `}};Cl.YAMLError=El;Cl.YAMLParseError=xv;Cl.YAMLWarning=Lv;Cl.prettifyError=J2});var Al=k(Rx=>{"use strict";function Q2(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,g=!1,h=null,T=null,S=null,_=null,v=null,R=null,C=null;for(let F of t)switch(g&&(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma"&&s(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&F.type!=="comment"&&F.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),F.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&F.source.includes(" ")&&(h=F),u=!0;break;case"comment":{u||s(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ge=F.source.substring(1)||" ";d?d+=f+ge:d=ge,f="",l=!1;break}case"newline":l?d?d+=F.source:c=!0:f+=F.source,l=!0,p=!0,(T||S)&&(_=F),u=!0;break;case"anchor":T&&s(F,"MULTIPLE_ANCHORS","A node can have at most one anchor"),F.source.endsWith(":")&&s(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=F,C===null&&(C=F.offset),l=!1,u=!1,g=!0;break;case"tag":{S&&s(F,"MULTIPLE_TAGS","A node can have at most one tag"),S=F,C===null&&(C=F.offset),l=!1,u=!1,g=!0;break}case r:(T||S)&&s(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`),R&&s(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${e??"collection"}`),R=F,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(F,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=F,l=!1,u=!1;break}default:s(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),l=!1,u=!1}let B=t[t.length-1],M=B?B.offset+B.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:R,spaceBefore:c,comment:d,hasNewline:p,anchor:T,tag:S,newlineAfterProp:_,end:M,start:C??M}}Rx.resolveProps=Q2});var xh=k(Px=>{"use strict";function qv(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
99
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(qv(e.key)||qv(e.value))return!0}return!1;default:return!0}}Px.containsNewline=qv});var $v=k(wx=>{"use strict";var Z2=xh();function eW(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Z2.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}wx.flowIndentCheck=eW});var Bv=k(Cx=>{"use strict";var Ex=Le();function tW(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||Ex.isScalar(s)&&Ex.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}Cx.mapIncludes=tW});var xx=k(Mx=>{"use strict";var Dx=gs(),rW=Ts(),Ax=Al(),nW=xh(),Ix=$v(),iW=Bv(),Ox="All mapping items must start at the same column";function sW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??rW.YAMLMap,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:g}=u,h=Ax.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),T=!h.found;if(T){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Ox)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=`
100
+ `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||nW.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Ox);r.atKey=!0;let S=h.end,_=f?t(r,f,h,i):e(r,S,d,null,h,i);r.schema.compat&&Ix.flowIndentCheck(n.indent,f,i),r.atKey=!1,iW.mapIncludes(r,a.items,_)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let v=Ax.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=v.end,v.found){T&&(g?.type==="block-map"&&!v.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<v.found.offset-1024&&i(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=g?t(r,g,v,i):e(r,c,p,null,v,i);r.schema.compat&&Ix.flowIndentCheck(n.indent,g,i),c=R.range[2];let C=new Dx.Pair(_,R);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{T&&i(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(_.comment?_.comment+=`
101
+ `+v.comment:_.comment=v.comment);let R=new Dx.Pair(_);r.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Mx.resolveBlockMap=sW});var qx=k(Lx=>{"use strict";var oW=vs(),aW=Al(),cW=$v();function lW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??oW.YAMLSeq,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=aW.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&cW.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Lx.resolveBlockSeq=lW});var Ea=k($x=>{"use strict";function uW(t,e,r,n){let i="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{r&&!s&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}$x.resolveEnd=uW});var Ux=k(jx=>{"use strict";var dW=Le(),fW=gs(),Bx=Ts(),pW=vs(),hW=Ea(),Fx=Al(),mW=xh(),gW=Bv(),Fv="Block collections are not allowed within flow collections",jv=t=>t&&(t.type==="block-map"||t.type==="block-seq");function yW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?Bx.YAMLMap:pW.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let T=0;T<n.items.length;++T){let S=n.items[T],{start:_,key:v,sep:R,value:C}=S,B=Fx.resolveProps(_,{flow:a,indicator:"explicit-key-ind",next:v??R?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!B.found){if(!B.anchor&&!B.tag&&!R&&!C){T===0&&B.comma?i(B.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):T<n.items.length-1&&i(B.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),B.comment&&(l.comment?l.comment+=`
102
102
  `+B.comment:l.comment=B.comment),d=B.end;continue}!o&&r.options.strict&&mW.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)B.comma&&i(B.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(B.comma||i(B.start,"MISSING_CHAR",`Missing , between ${a} items`),B.comment){let M="";e:for(let F of _)switch(F.type){case"comma":case"space":break;case"comment":M=F.source.substring(1);break e;default:break e}if(M){let F=l.items[l.items.length-1];dW.isPair(F)&&(F=F.value??F.key),F.comment?F.comment+=`
103
- `+M:F.comment=M,B.comment=B.comment.substring(M.length+1)}}if(!o&&!R&&!B.found){let M=D?t(r,D,B,i):e(r,B.end,R,null,B,i);l.items.push(M),d=M.range[2],jv(D)&&i(M.range,"BLOCK_IN_FLOW",Fv)}else{r.atKey=!0;let M=B.end,F=v?t(r,v,B,i):e(r,M,_,null,B,i);jv(v)&&i(F.range,"BLOCK_IN_FLOW",Fv),r.atKey=!1;let ge=Fx.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:D,offset:F.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(ge.found){if(!o&&!B.found&&r.options.strict){if(R)for(let Ne of R){if(Ne===ge.found)break;if(Ne.type==="newline"){i(Ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}B.start<ge.found.offset-1024&&i(ge.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else D&&("source"in D&&D.source&&D.source[0]===":"?i(D,"MISSING_CHAR",`Missing space after : in ${a}`):i(ge.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Je=D?t(r,D,ge,i):ge.found?e(r,ge.end,R,null,ge,i):null;Je?jv(D)&&i(Je.range,"BLOCK_IN_FLOW",Fv):ge.comment&&(F.comment?F.comment+=`
103
+ `+M:F.comment=M,B.comment=B.comment.substring(M.length+1)}}if(!o&&!R&&!B.found){let M=C?t(r,C,B,i):e(r,B.end,R,null,B,i);l.items.push(M),d=M.range[2],jv(C)&&i(M.range,"BLOCK_IN_FLOW",Fv)}else{r.atKey=!0;let M=B.end,F=v?t(r,v,B,i):e(r,M,_,null,B,i);jv(v)&&i(F.range,"BLOCK_IN_FLOW",Fv),r.atKey=!1;let ge=Fx.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:C,offset:F.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(ge.found){if(!o&&!B.found&&r.options.strict){if(R)for(let Ne of R){if(Ne===ge.found)break;if(Ne.type==="newline"){i(Ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}B.start<ge.found.offset-1024&&i(ge.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source&&C.source[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(ge.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Je=C?t(r,C,ge,i):ge.found?e(r,ge.end,R,null,ge,i):null;Je?jv(C)&&i(Je.range,"BLOCK_IN_FLOW",Fv):ge.comment&&(F.comment?F.comment+=`
104
104
  `+ge.comment:F.comment=ge.comment);let Ft=new fW.Pair(F,Je);if(r.options.keepSourceTokens&&(Ft.srcToken=S),o){let Ne=l;gW.mapIncludes(r,Ne.items,F)&&i(M,"DUPLICATE_KEY","Map keys must be unique"),Ne.items.push(Ft)}else{let Ne=new Bx.YAMLMap(r.schema);Ne.flow=!0,Ne.items.push(Ft);let Xr=(Je??F).range;Ne.range=[F.range[0],Xr[1],Xr[2]],l.items.push(Ne)}d=Je?Je.range[2]:ge.end}}let f=o?"}":"]",[p,...g]=n.end,h=d;if(p&&p.source===f)h=p.offset+p.source.length;else{let T=a[0].toUpperCase()+a.substring(1),S=u?`${T} must end with a ${f}`:`${T} in block collection must be sufficiently indented and end with a ${f}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",S),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let T=hW.resolveEnd(g,h,r.options.strict,i);T.comment&&(l.comment?l.comment+=`
105
- `+T.comment:l.comment=T.comment),l.range=[n.offset,h,T.offset]}else l.range=[n.offset,h,h];return l}jx.resolveFlowCollection=yW});var Vx=k(Hx=>{"use strict";var TW=Le(),vW=$t(),bW=Ts(),_W=vs(),SW=xx(),NW=qx(),kW=Ux();function Uv(t,e,r,n,i,s){let o=r.type==="block-map"?SW.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?NW.resolveBlockSeq(t,e,r,n,s):kW.resolveFlowCollection(t,e,r,n,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function RW(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,g=f&&s?f.offset>s.offset?f:s:f??s;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===bW.YAMLMap.tagName&&a==="map"||o===_W.YAMLSeq.tagName&&a==="seq")return Uv(t,e,r,i,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Uv(t,e,r,i,o)}let l=Uv(t,e,r,i,o,c),u=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,d=TW.isNode(u)?u:new vW.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}Hx.composeCollection=RW});var Vv=k(zx=>{"use strict";var Hv=$t();function PW(t,e,r){let n=e.offset,i=EW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Hv.Scalar.BLOCK_FOLDED:Hv.Scalar.BLOCK_LITERAL,o=e.source?wW(e.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let T=o[h][1];if(T===""||T==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&o.length>0?`
105
+ `+T.comment:l.comment=T.comment),l.range=[n.offset,h,T.offset]}else l.range=[n.offset,h,h];return l}jx.resolveFlowCollection=yW});var Vx=k(Hx=>{"use strict";var TW=Le(),vW=$t(),bW=Ts(),_W=vs(),SW=xx(),NW=qx(),kW=Ux();function Uv(t,e,r,n,i,s){let o=r.type==="block-map"?SW.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?NW.resolveBlockSeq(t,e,r,n,s):kW.resolveFlowCollection(t,e,r,n,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function RW(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,g=f&&s?f.offset>s.offset?f:s:f??s;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===bW.YAMLMap.tagName&&a==="map"||o===_W.YAMLSeq.tagName&&a==="seq")return Uv(t,e,r,i,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Uv(t,e,r,i,o)}let l=Uv(t,e,r,i,o,c),u=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,d=TW.isNode(u)?u:new vW.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}Hx.composeCollection=RW});var Vv=k(zx=>{"use strict";var Hv=$t();function PW(t,e,r){let n=e.offset,i=wW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Hv.Scalar.BLOCK_FOLDED:Hv.Scalar.BLOCK_LITERAL,o=e.source?EW(e.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let T=o[h][1];if(T===""||T==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&o.length>0?`
106
106
  `.repeat(Math.max(1,o.length-1)):"",T=n+i.length;return e.source&&(T+=e.source.length),{value:h,type:s,comment:i.comment,range:[n,T,T]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;h<a;++h){let[T,S]=o[h];if(S===""||S==="\r")i.indent===0&&T.length>c&&(c=T.length);else{T.length<c&&r(l+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=T.length),u=h,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=T.length+S.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;h<u;++h)d+=o[h][0].slice(c)+`
107
107
  `;for(let h=u;h<a;++h){let[T,S]=o[h];l+=T.length+S.length+1;let _=S[S.length-1]==="\r";if(_&&(S=S.slice(0,-1)),S&&T.length<c){let R=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-S.length-(_?2:1),"BAD_INDENT",R),T=""}s===Hv.Scalar.BLOCK_LITERAL?(d+=f+T.slice(c)+S,f=`
108
108
  `):T.length>c||S[0]===" "?(f===" "?f=`
@@ -117,11 +117,11 @@ ${l}
117
117
  `+o[h][0].slice(c);d[d.length-1]!==`
118
118
  `&&(d+=`
119
119
  `);break;default:d+=`
120
- `}let g=n+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[n,g,g]}}function EW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,a="",c=-1;for(let f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!o&&g?o=g:c===-1&&(c=t+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":l=!0;case"newline":d+=p.source.length;break;case"comment":r&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",g);let h=p.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function wW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}zx.resolveBlockScalar=PW});var Wv=k(Gx=>{"use strict";var zv=$t(),DW=wa();function CW(t,e,r){let{offset:n,type:i,source:s,end:o}=t,a,c,l=(f,p,g)=>r(n+f,p,g);switch(i){case"scalar":a=zv.Scalar.PLAIN,c=AW(s,l);break;case"single-quoted-scalar":a=zv.Scalar.QUOTE_SINGLE,c=OW(s,l);break;case"double-quoted-scalar":a=zv.Scalar.QUOTE_DOUBLE,c=IW(s,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let u=n+s.length,d=DW.resolveEnd(o,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function AW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Wx(t)}function OW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Wx(t.slice(1,-1)).replace(/''/g,"'")}function Wx(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
120
+ `}let g=n+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[n,g,g]}}function wW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,a="",c=-1;for(let f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!o&&g?o=g:c===-1&&(c=t+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":l=!0;case"newline":d+=p.source.length;break;case"comment":r&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",g);let h=p.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function EW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}zx.resolveBlockScalar=PW});var Wv=k(Gx=>{"use strict";var zv=$t(),CW=Ea();function DW(t,e,r){let{offset:n,type:i,source:s,end:o}=t,a,c,l=(f,p,g)=>r(n+f,p,g);switch(i){case"scalar":a=zv.Scalar.PLAIN,c=AW(s,l);break;case"single-quoted-scalar":a=zv.Scalar.QUOTE_SINGLE,c=IW(s,l);break;case"double-quoted-scalar":a=zv.Scalar.QUOTE_DOUBLE,c=OW(s,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let u=n+s.length,d=CW.resolveEnd(o,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function AW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Wx(t)}function IW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Wx(t.slice(1,-1)).replace(/''/g,"'")}function Wx(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
121
121
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
122
122
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",o=e.lastIndex;for(r.lastIndex=o;n=r.exec(t);)n[1]===""?s===`
123
123
  `?i+=s:s=`
124
- `:(i+=s+n[1],s=" "),o=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+s+(n?.[1]??"")}function IW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
124
+ `:(i+=s+n[1],s=" "),o=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+s+(n?.[1]??"")}function OW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
125
125
  `))if(i===`
126
126
  `){let{fold:s,offset:o}=MW(t,n);r+=s,n=o}else if(i==="\\"){let s=t[++n],o=xW[s];if(o)r+=o;else if(s===`
127
127
  `)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
@@ -132,14 +132,14 @@ ${l}
132
132
  `);)n===`
133
133
  `&&(r+=`
134
134
  `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var xW={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 LW(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Gx.resolveFlowScalar=CW});var Xx=k(Kx=>{"use strict";var Zs=Le(),Yx=$t(),qW=Vv(),$W=Wv();function BW(t,e,r,n){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?qW.resolveBlockScalar(t,e,n):$W.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Zs.SCALAR]:c?l=FW(t.schema,i,c,r,n):e.type==="scalar"?l=jW(t,i,e,n):l=t.schema[Zs.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Zs.isScalar(d)?d:new Yx.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new Yx.Scalar(i)}return u.range=a,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function FW(t,e,r,n,i){if(r==="!")return t[Zs.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===r)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=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Zs.SCALAR])}function jW({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Zs.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Zs.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(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}Kx.composeScalar=BW});var Qx=k(Jx=>{"use strict";function UW(t,e,r){if(e){r===null&&(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Jx.emptyScalarPosition=UW});var tL=k(Yv=>{"use strict";var HW=dl(),VW=Le(),zW=Vx(),Zx=Xx(),WW=wa(),GW=Qx(),YW={composeNode:eL,composeEmptyNode:Gv};function eL(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=KW(t,e,n),(a||c)&&n(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=Zx.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=zW.composeCollection(YW,t,e,r,n),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=Gv(t,e.offset,void 0,null,r,n),u=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!VW.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(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),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Gv(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:GW.emptyScalarPosition(e,r,n),indent:-1,source:""},d=Zx.composeScalar(t,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function KW({options:t},{offset:e,source:r,end:n},i){let s=new HW.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,a=WW.resolveEnd(n,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Yv.composeEmptyNode=Gv;Yv.composeNode=eL});var iL=k(nL=>{"use strict";var XW=El(),rL=tL(),JW=wa(),QW=Al();function ZW(t,e,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new XW.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=QW.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?rL.composeNode(l,i,u,o):rL.composeEmptyNode(l,u.end,n,null,u,o);let d=c.contents.range[2],f=JW.resolveEnd(s,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}nL.composeDoc=ZW});var Xv=k(aL=>{"use strict";var eG=xT(),tG=El(),Ol=Cl(),sL=Le(),rG=iL(),nG=wa();function Il(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function oL(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
135
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function LW(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Gx.resolveFlowScalar=DW});var Xx=k(Yx=>{"use strict";var Zs=Le(),Kx=$t(),qW=Vv(),$W=Wv();function BW(t,e,r,n){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?qW.resolveBlockScalar(t,e,n):$W.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Zs.SCALAR]:c?l=FW(t.schema,i,c,r,n):e.type==="scalar"?l=jW(t,i,e,n):l=t.schema[Zs.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Zs.isScalar(d)?d:new Kx.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new Kx.Scalar(i)}return u.range=a,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function FW(t,e,r,n,i){if(r==="!")return t[Zs.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===r)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=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Zs.SCALAR])}function jW({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Zs.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Zs.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(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}Yx.composeScalar=BW});var Qx=k(Jx=>{"use strict";function UW(t,e,r){if(e){r===null&&(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Jx.emptyScalarPosition=UW});var tL=k(Kv=>{"use strict";var HW=dl(),VW=Le(),zW=Vx(),Zx=Xx(),WW=Ea(),GW=Qx(),KW={composeNode:eL,composeEmptyNode:Gv};function eL(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=YW(t,e,n),(a||c)&&n(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=Zx.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=zW.composeCollection(KW,t,e,r,n),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=Gv(t,e.offset,void 0,null,r,n),u=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!VW.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(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),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Gv(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:GW.emptyScalarPosition(e,r,n),indent:-1,source:""},d=Zx.composeScalar(t,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function YW({options:t},{offset:e,source:r,end:n},i){let s=new HW.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,a=WW.resolveEnd(n,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Kv.composeEmptyNode=Gv;Kv.composeNode=eL});var iL=k(nL=>{"use strict";var XW=wl(),rL=tL(),JW=Ea(),QW=Al();function ZW(t,e,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new XW.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=QW.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?rL.composeNode(l,i,u,o):rL.composeEmptyNode(l,u.end,n,null,u,o);let d=c.contents.range[2],f=JW.resolveEnd(s,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}nL.composeDoc=ZW});var Xv=k(aL=>{"use strict";var eG=xT(),tG=wl(),Il=Dl(),sL=Le(),rG=iL(),nG=Ea();function Ol(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function oL(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
136
136
 
137
137
  `:`
138
- `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var Kv=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=Il(r);s?this.warnings.push(new Ol.YAMLWarning(o,n,i)):this.errors.push(new Ol.YAMLParseError(o,n,i))},this.directives=new eG.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=oL(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
138
+ `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var Yv=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=Ol(r);s?this.warnings.push(new Il.YAMLWarning(o,n,i)):this.errors.push(new Il.YAMLParseError(o,n,i))},this.directives=new eG.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=oL(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
139
139
  ${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(sL.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];sL.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
140
140
  ${a}`:n}else{let o=s.commentBefore;s.commentBefore=o?`${n}
141
- ${o}`:n}}r?(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:oL(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=Il(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=rG.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ol.YAMLParseError(Il(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ol.YAMLParseError(Il(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=nG.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
142
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ol.YAMLParseError(Il(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new tG.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};aL.Composer=Kv});var uL=k(Lh=>{"use strict";var iG=Vv(),sG=Wv(),oG=Cl(),cL=gl();function aG(t,e=!0,r){if(t){let n=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new oG.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sG.resolveFlowScalar(t,e,n);case"block-scalar":return iG.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function cG(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=cL.stringifyString({type:o,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
141
+ ${o}`:n}}r?(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:oL(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=Ol(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=rG.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Il.YAMLParseError(Ol(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Il.YAMLParseError(Ol(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=nG.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
142
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Il.YAMLParseError(Ol(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new tG.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};aL.Composer=Yv});var uL=k(Lh=>{"use strict";var iG=Vv(),sG=Wv(),oG=Dl(),cL=gl();function aG(t,e=!0,r){if(t){let n=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new oG.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sG.resolveFlowScalar(t,e,n);case"block-scalar":return iG.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function cG(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=cL.stringifyString({type:o,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,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
  `,f=[{type:"block-scalar-header",offset:s,indent:n,source:u}];return lL(f,c)||f.push({type:"newline",offset:-1,indent:n,source:`
@@ -168,30 +168,30 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
168
168
  `,s=this.buffer[n+1]):r=n),s==="#"||e&&Fh.has(s))break;if(i===`
169
169
  `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Fh.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ml.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ib))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(Bn(r)||e&&Fh.has(r))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,r=this.buffer[e];for(;!Bn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(vG.has(r))r=this.buffer[++e];else if(r==="%"&&yL.has(this.buffer[e+1])&&yL.has(this.buffer[e+2]))r=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 r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};TL.Lexer=sb});var cb=k(vL=>{"use strict";var ab=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};vL.LineCounter=ab});var ub=k(kL=>{"use strict";var bL=Bh(),_G=ob();function to(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function _L(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function NL(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jh(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Da(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function SL(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!to(e.start,"explicit-key-ind")&&!to(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,NL(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 lb=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 _G.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",bL.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=bL.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&SL(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&_L(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{_L(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=jh(this.peek(2)),n=Da(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};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 r=this.source.indexOf(`
171
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};TL.Lexer=sb});var cb=k(vL=>{"use strict";var ab=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};vL.LineCounter=ab});var ub=k(kL=>{"use strict";var bL=Bh(),_G=ob();function to(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function _L(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function NL(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jh(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ca(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function SL(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!to(e.start,"explicit-key-ind")&&!to(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,NL(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 lb=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 _G.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",bL.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=bL.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&SL(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&_L(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{_L(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=jh(this.peek(2)),n=Ca(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};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 r=this.source.indexOf(`
172
172
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
173
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let a=0;a<r.sep.length;++a){let c=r.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=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(to(r.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(NL(r.key)&&!to(r.sep,"newline")){let o=Da(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(to(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Da(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):to(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{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);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){n&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||to(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=jh(n),s=Da(i);SL(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 r=this.source.indexOf(`
173
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let a=0;a<r.sep.length;++a){let c=r.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=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(to(r.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(NL(r.key)&&!to(r.sep,"newline")){let o=Ca(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(to(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Ca(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):to(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{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);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){n&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||to(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=jh(n),s=Ca(i);SL(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 r=this.source.indexOf(`
174
174
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
175
- `,r)+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 r=jh(e),n=Da(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=jh(e),n=Da(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};kL.Parser=lb});var DL=k(Ll=>{"use strict";var RL=Xv(),SG=El(),xl=Cl(),NG=YT(),kG=Le(),RG=cb(),PL=ub();function EL(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new RG.LineCounter||null,prettyErrors:e}}function PG(t,e={}){let{lineCounter:r,prettyErrors:n}=EL(e),i=new PL.Parser(r?.addNewLine),s=new RL.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let a of o)a.errors.forEach(xl.prettifyError(t,r)),a.warnings.forEach(xl.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function wL(t,e={}){let{lineCounter:r,prettyErrors:n}=EL(e),i=new PL.Parser(r?.addNewLine),s=new RL.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new xl.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(xl.prettifyError(t,r)),o.warnings.forEach(xl.prettifyError(t,r))),o}function EG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=wL(t,r);if(!i)return null;if(i.warnings.forEach(s=>NG.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function wG(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return kG.isDocument(t)&&!n?t.toString(r):new SG.Document(t,n,r).toString(r)}Ll.parse=EG;Ll.parseAllDocuments=PG;Ll.parseDocument=wL;Ll.stringify=wG});var fb=k(Ye=>{"use strict";var DG=Xv(),CG=El(),AG=Cv(),db=Cl(),OG=dl(),bs=Le(),IG=gs(),MG=$t(),xG=Ts(),LG=vs(),qG=Bh(),$G=ob(),BG=cb(),FG=ub(),Uh=DL(),CL=al();Ye.Composer=DG.Composer;Ye.Document=CG.Document;Ye.Schema=AG.Schema;Ye.YAMLError=db.YAMLError;Ye.YAMLParseError=db.YAMLParseError;Ye.YAMLWarning=db.YAMLWarning;Ye.Alias=OG.Alias;Ye.isAlias=bs.isAlias;Ye.isCollection=bs.isCollection;Ye.isDocument=bs.isDocument;Ye.isMap=bs.isMap;Ye.isNode=bs.isNode;Ye.isPair=bs.isPair;Ye.isScalar=bs.isScalar;Ye.isSeq=bs.isSeq;Ye.Pair=IG.Pair;Ye.Scalar=MG.Scalar;Ye.YAMLMap=xG.YAMLMap;Ye.YAMLSeq=LG.YAMLSeq;Ye.CST=qG;Ye.Lexer=$G.Lexer;Ye.LineCounter=BG.LineCounter;Ye.Parser=FG.Parser;Ye.parse=Uh.parse;Ye.parseAllDocuments=Uh.parseAllDocuments;Ye.parseDocument=Uh.parseDocument;Ye.stringify=Uh.stringify;Ye.visit=CL.visit;Ye.visitAsync=CL.visitAsync});var Bl=k(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.regexpCode=Be.getEsmExportName=Be.getProperty=Be.safeStringify=Be.stringify=Be.strConcat=Be.addCodeArg=Be.str=Be._=Be.nil=Be._Code=Be.Name=Be.IDENTIFIER=Be._CodeOrName=void 0;var ql=class{};Be._CodeOrName=ql;Be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ro=class extends ql{constructor(e){if(super(),!Be.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Be.Name=ro;var gn=class extends ql{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof ro&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Be._Code=gn;Be.nil=new gn("");function AL(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hb(r,e[n]),r.push(t[++n]);return new gn(r)}Be._=AL;var pb=new gn("+");function OL(t,...e){let r=[$l(t[0])],n=0;for(;n<e.length;)r.push(pb),hb(r,e[n]),r.push(pb,$l(t[++n]));return jG(r),new gn(r)}Be.str=OL;function hb(t,e){e instanceof gn?t.push(...e._items):e instanceof ro?t.push(e):t.push(VG(e))}Be.addCodeArg=hb;function jG(t){let e=1;for(;e<t.length-1;){if(t[e]===pb){let r=UG(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function UG(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ro||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ro))return`"${t}${e.slice(1)}`}function HG(t,e){return e.emptyStr()?t:t.emptyStr()?e:OL`${t}${e}`}Be.strConcat=HG;function VG(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:$l(Array.isArray(t)?t.join(","):t)}function zG(t){return new gn($l(t))}Be.stringify=zG;function $l(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Be.safeStringify=$l;function WG(t){return typeof t=="string"&&Be.IDENTIFIER.test(t)?new gn(`.${t}`):AL`[${t}]`}Be.getProperty=WG;function GG(t){if(typeof t=="string"&&Be.IDENTIFIER.test(t))return new gn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Be.getEsmExportName=GG;function YG(t){return new gn(t.toString())}Be.regexpCode=YG});var yb=k(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.ValueScope=Br.ValueScopeName=Br.Scope=Br.varKinds=Br.UsedValueState=void 0;var $r=Bl(),mb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Hh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Hh||(Br.UsedValueState=Hh={}));Br.varKinds={const:new $r.Name("const"),let:new $r.Name("let"),var:new $r.Name("var")};var Vh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof $r.Name?e:this.name(e)}name(e){return new $r.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Br.Scope=Vh;var zh=class extends $r.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,$r._)`.${new $r.Name(r)}[${n}]`}};Br.ValueScopeName=zh;var KG=(0,$r._)`\n`,gb=class extends Vh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?KG:$r.nil}}get(){return this._scope}name(e){return new zh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,$r._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=$r.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Hh.Started);let u=r(l);if(u){let d=this.opts.es5?Br.varKinds.var:Br.varKinds.const;s=(0,$r._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,$r._)`${s}${u}${this.opts._n}`;else throw new mb(l);c.set(l,Hh.Completed)})}return s}};Br.ValueScope=gb});var ve=k(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.or=_e.and=_e.not=_e.CodeGen=_e.operators=_e.varKinds=_e.ValueScopeName=_e.ValueScope=_e.Scope=_e.Name=_e.regexpCode=_e.stringify=_e.getProperty=_e.nil=_e.strConcat=_e.str=_e._=void 0;var Oe=Bl(),Fn=yb(),_s=Bl();Object.defineProperty(_e,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(_e,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(_e,"strConcat",{enumerable:!0,get:function(){return _s.strConcat}});Object.defineProperty(_e,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(_e,"getProperty",{enumerable:!0,get:function(){return _s.getProperty}});Object.defineProperty(_e,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(_e,"regexpCode",{enumerable:!0,get:function(){return _s.regexpCode}});Object.defineProperty(_e,"Name",{enumerable:!0,get:function(){return _s.Name}});var Kh=yb();Object.defineProperty(_e,"Scope",{enumerable:!0,get:function(){return Kh.Scope}});Object.defineProperty(_e,"ValueScope",{enumerable:!0,get:function(){return Kh.ValueScope}});Object.defineProperty(_e,"ValueScopeName",{enumerable:!0,get:function(){return Kh.ValueScopeName}});Object.defineProperty(_e,"varKinds",{enumerable:!0,get:function(){return Kh.varKinds}});_e.operators={GT:new Oe._Code(">"),GTE:new Oe._Code(">="),LT:new Oe._Code("<"),LTE:new Oe._Code("<="),EQ:new Oe._Code("==="),NEQ:new Oe._Code("!=="),NOT:new Oe._Code("!"),OR:new Oe._Code("||"),AND:new Oe._Code("&&"),ADD:new Oe._Code("+")};var Ii=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Tb=class extends Ii{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Fn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Aa(this.rhs,e,r)),this}get names(){return this.rhs instanceof Oe._CodeOrName?this.rhs.names:{}}},Wh=class extends Ii{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Aa(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Oe.Name?{}:{...this.lhs.names};return Yh(e,this.rhs)}},vb=class extends Wh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},bb=class extends Ii{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},_b=class extends Ii{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Sb=class extends Ii{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Nb=class extends Ii{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Aa(this.code,e,r),this}get names(){return this.code instanceof Oe._CodeOrName?this.code.names:{}}},Fl=class extends Ii{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(XG(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>so(e,r.names),{})}},Mi=class extends Fl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},kb=class extends Fl{},Ca=class extends Mi{};Ca.kind="else";var no=class t extends Mi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ca(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(IL(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Aa(this.condition,e,r),this}get names(){let e=super.names;return Yh(e,this.condition),this.else&&so(e,this.else.names),e}};no.kind="if";var io=class extends Mi{};io.kind="for";var Rb=class extends io{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Aa(this.iteration,e,r),this}get names(){return so(super.names,this.iteration.names)}},Pb=class extends io{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Fn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Yh(super.names,this.from);return Yh(e,this.to)}},Gh=class extends io{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Aa(this.iterable,e,r),this}get names(){return so(super.names,this.iterable.names)}},jl=class extends Mi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jl.kind="func";var Ul=class extends Fl{render(e){return"return "+super.render(e)}};Ul.kind="return";var Eb=class extends Mi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&so(e,this.catch.names),this.finally&&so(e,this.finally.names),e}},Hl=class extends Mi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Hl.kind="catch";var Vl=class extends Mi{render(e){return"finally"+super.render(e)}};Vl.kind="finally";var wb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
176
- `:""},this._extScope=e,this._scope=new Fn.Scope({parent:e}),this._nodes=[new kb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Tb(e,s,n)),s}const(e,r,n){return this._def(Fn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Fn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Fn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Wh(e,r,n))}add(e,r){return this._leafNode(new vb(e,_e.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Oe.nil&&this._leafNode(new Nb(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Oe.addCodeArg)(r,i));return r.push("}"),new Oe._Code(r)}if(e,r,n){if(this._blockNode(new no(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new no(e))}else(){return this._elseNode(new Ca)}endIf(){return this._endBlockNode(no,Ca)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Rb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Fn.varKinds.var:Fn.varKinds.let){let o=this._scope.toName(e);return this._for(new Pb(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Fn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Oe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Oe._)`${o}.length`,a=>{this.var(s,(0,Oe._)`${o}[${a}]`),n(s)})}return this._for(new Gh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Fn.varKinds.var:Fn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Oe._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Gh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(io)}label(e){return this._leafNode(new bb(e))}break(e){return this._leafNode(new _b(e))}return(e){let r=new Ul;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ul)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Eb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Hl(s),r(s)}return n&&(this._currNode=i.finally=new Vl,this.code(n)),this._endBlockNode(Hl,Vl)}throw(e){return this._leafNode(new Sb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Oe.nil,n,i){return this._blockNode(new jl(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(jl)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof no))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};_e.CodeGen=wb;function so(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Yh(t,e){return e instanceof Oe._CodeOrName?so(t,e.names):t}function Aa(t,e,r){if(t instanceof Oe.Name)return n(t);if(!i(t))return t;return new Oe._Code(t._items.reduce((s,o)=>(o instanceof Oe.Name&&(o=n(o)),o instanceof Oe._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Oe._Code&&s._items.some(o=>o instanceof Oe.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function XG(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function IL(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Oe._)`!${Db(t)}`}_e.not=IL;var JG=ML(_e.operators.AND);function QG(...t){return t.reduce(JG)}_e.and=QG;var ZG=ML(_e.operators.OR);function eY(...t){return t.reduce(ZG)}_e.or=eY;function ML(t){return(e,r)=>e===Oe.nil?r:r===Oe.nil?e:(0,Oe._)`${Db(e)} ${t} ${Db(r)}`}function Db(t){return t instanceof Oe.Name?t:(0,Oe._)`(${t})`}});var Ee=k(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.checkStrictMode=Se.getErrorPath=Se.Type=Se.useFunc=Se.setEvaluated=Se.evaluatedPropsToName=Se.mergeEvaluated=Se.eachItem=Se.unescapeJsonPointer=Se.escapeJsonPointer=Se.escapeFragment=Se.unescapeFragment=Se.schemaRefOrVal=Se.schemaHasRulesButRef=Se.schemaHasRules=Se.checkUnknownRules=Se.alwaysValidSchema=Se.toHash=void 0;var ot=ve(),tY=Bl();function rY(t){let e={};for(let r of t)e[r]=!0;return e}Se.toHash=rY;function nY(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(qL(t,e),!$L(e,t.self.RULES.all))}Se.alwaysValidSchema=nY;function qL(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||jL(t,`unknown keyword: "${s}"`)}Se.checkUnknownRules=qL;function $L(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Se.schemaHasRules=$L;function iY(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Se.schemaHasRulesButRef=iY;function sY({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ot._)`${r}`}return(0,ot._)`${t}${e}${(0,ot.getProperty)(n)}`}Se.schemaRefOrVal=sY;function oY(t){return BL(decodeURIComponent(t))}Se.unescapeFragment=oY;function aY(t){return encodeURIComponent(Ab(t))}Se.escapeFragment=aY;function Ab(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Se.escapeJsonPointer=Ab;function BL(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Se.unescapeJsonPointer=BL;function cY(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Se.eachItem=cY;function xL({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof ot.Name?(s instanceof ot.Name?t(i,s,o):e(i,s,o),o):s instanceof ot.Name?(e(i,o,s),s):r(s,o);return a===ot.Name&&!(c instanceof ot.Name)?n(i,c):c}}Se.mergeEvaluated={props:xL({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ot._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ot._)`${r} || {}`).code((0,ot._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ot._)`${r} || {}`),Ob(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:FL}),items:xL({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ot._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ot._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function FL(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ot._)`{}`);return e!==void 0&&Ob(t,r,e),r}Se.evaluatedPropsToName=FL;function Ob(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ot._)`${e}${(0,ot.getProperty)(n)}`,!0))}Se.setEvaluated=Ob;var LL={};function lY(t,e){return t.scopeValue("func",{ref:e,code:LL[e.code]||(LL[e.code]=new tY._Code(e.code))})}Se.useFunc=lY;var Cb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Cb||(Se.Type=Cb={}));function uY(t,e,r){if(t instanceof ot.Name){let n=e===Cb.Num;return r?n?(0,ot._)`"[" + ${t} + "]"`:(0,ot._)`"['" + ${t} + "']"`:n?(0,ot._)`"/" + ${t}`:(0,ot._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ot.getProperty)(t).toString():"/"+Ab(t)}Se.getErrorPath=uY;function jL(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Se.checkStrictMode=jL});var yn=k(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var pr=ve(),dY={data:new pr.Name("data"),valCxt:new pr.Name("valCxt"),instancePath:new pr.Name("instancePath"),parentData:new pr.Name("parentData"),parentDataProperty:new pr.Name("parentDataProperty"),rootData:new pr.Name("rootData"),dynamicAnchors:new pr.Name("dynamicAnchors"),vErrors:new pr.Name("vErrors"),errors:new pr.Name("errors"),this:new pr.Name("this"),self:new pr.Name("self"),scope:new pr.Name("scope"),json:new pr.Name("json"),jsonPos:new pr.Name("jsonPos"),jsonLen:new pr.Name("jsonLen"),jsonPart:new pr.Name("jsonPart")};Ib.default=dY});var zl=k(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.extendErrors=hr.resetErrorsCount=hr.reportExtraError=hr.reportError=hr.keyword$DataError=hr.keywordError=void 0;var qe=ve(),Xh=Ee(),Sr=yn();hr.keywordError={message:({keyword:t})=>(0,qe.str)`must pass "${t}" keyword validation`};hr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,qe.str)`"${t}" keyword must be ${e} ($data)`:(0,qe.str)`"${t}" keyword is invalid ($data)`};function fY(t,e=hr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=VL(t,e,r);n??(o||a)?UL(s,c):HL(i,(0,qe._)`[${c}]`)}hr.reportError=fY;function pY(t,e=hr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=VL(t,e,r);UL(i,a),s||o||HL(n,Sr.default.vErrors)}hr.reportExtraError=pY;function hY(t,e){t.assign(Sr.default.errors,e),t.if((0,qe._)`${Sr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,qe._)`${Sr.default.vErrors}.length`,e),()=>t.assign(Sr.default.vErrors,null)))}hr.resetErrorsCount=hY;function mY({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Sr.default.errors,a=>{t.const(o,(0,qe._)`${Sr.default.vErrors}[${a}]`),t.if((0,qe._)`${o}.instancePath === undefined`,()=>t.assign((0,qe._)`${o}.instancePath`,(0,qe.strConcat)(Sr.default.instancePath,s.errorPath))),t.assign((0,qe._)`${o}.schemaPath`,(0,qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,qe._)`${o}.schema`,r),t.assign((0,qe._)`${o}.data`,n))})}hr.extendErrors=mY;function UL(t,e){let r=t.const("err",e);t.if((0,qe._)`${Sr.default.vErrors} === null`,()=>t.assign(Sr.default.vErrors,(0,qe._)`[${r}]`),(0,qe._)`${Sr.default.vErrors}.push(${r})`),t.code((0,qe._)`${Sr.default.errors}++`)}function HL(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,qe._)`${n}.errors`,e),r.return(!1))}var oo={keyword:new qe.Name("keyword"),schemaPath:new qe.Name("schemaPath"),params:new qe.Name("params"),propertyName:new qe.Name("propertyName"),message:new qe.Name("message"),schema:new qe.Name("schema"),parentSchema:new qe.Name("parentSchema")};function VL(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,qe._)`{}`:gY(t,e,r)}function gY(t,e,r={}){let{gen:n,it:i}=t,s=[yY(i,r),TY(t,r)];return vY(t,e,s),n.object(...s)}function yY({errorPath:t},{instancePath:e}){let r=e?(0,qe.str)`${t}${(0,Xh.getErrorPath)(e,Xh.Type.Str)}`:t;return[Sr.default.instancePath,(0,qe.strConcat)(Sr.default.instancePath,r)]}function TY({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,qe.str)`${e}/${t}`;return r&&(i=(0,qe.str)`${i}${(0,Xh.getErrorPath)(r,Xh.Type.Str)}`),[oo.schemaPath,i]}function vY(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([oo.keyword,i],[oo.params,typeof e=="function"?e(t):e||(0,qe._)`{}`]),c.messages&&n.push([oo.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([oo.schema,o],[oo.parentSchema,(0,qe._)`${u}${d}`],[Sr.default.data,s]),l&&n.push([oo.propertyName,l])}});var WL=k(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.boolOrEmptySchema=Oa.topBoolOrEmptySchema=void 0;var bY=zl(),_Y=ve(),SY=yn(),NY={message:"boolean schema is false"};function kY(t){let{gen:e,schema:r,validateName:n}=t;r===!1?zL(t,!1):typeof r=="object"&&r.$async===!0?e.return(SY.default.data):(e.assign((0,_Y._)`${n}.errors`,null),e.return(!0))}Oa.topBoolOrEmptySchema=kY;function RY(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),zL(t)):r.var(e,!0)}Oa.boolOrEmptySchema=RY;function zL(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,bY.reportError)(i,NY,void 0,e)}});var Mb=k(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.getRules=Ia.isJSONType=void 0;var PY=["string","number","integer","boolean","null","object","array"],EY=new Set(PY);function wY(t){return typeof t=="string"&&EY.has(t)}Ia.isJSONType=wY;function DY(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ia.getRules=DY});var xb=k(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.shouldUseRule=Ss.shouldUseGroup=Ss.schemaHasRulesForType=void 0;function CY({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&GL(t,n)}Ss.schemaHasRulesForType=CY;function GL(t,e){return e.rules.some(r=>YL(t,r))}Ss.shouldUseGroup=GL;function YL(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ss.shouldUseRule=YL});var Wl=k(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.reportTypeError=mr.checkDataTypes=mr.checkDataType=mr.coerceAndCheckDataType=mr.getJSONTypes=mr.getSchemaTypes=mr.DataType=void 0;var AY=Mb(),OY=xb(),IY=zl(),be=ve(),KL=Ee(),Ma;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ma||(mr.DataType=Ma={}));function MY(t){let e=XL(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}mr.getSchemaTypes=MY;function XL(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(AY.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}mr.getJSONTypes=XL;function xY(t,e){let{gen:r,data:n,opts:i}=t,s=LY(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,OY.schemaHasRulesForType)(t,e[0]));if(o){let a=qb(e,n,i.strictNumbers,Ma.Wrong);r.if(a,()=>{s.length?qY(t,e,s):$b(t)})}return o}mr.coerceAndCheckDataType=xY;var JL=new Set(["string","number","integer","boolean","null"]);function LY(t,e){return e?t.filter(r=>JL.has(r)||e==="array"&&r==="array"):[]}function qY(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,be._)`typeof ${i}`),a=n.let("coerced",(0,be._)`undefined`);s.coerceTypes==="array"&&n.if((0,be._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,be._)`${i}[0]`).assign(o,(0,be._)`typeof ${i}`).if(qb(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,be._)`${a} !== undefined`);for(let l of r)(JL.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),$b(t),n.endIf(),n.if((0,be._)`${a} !== undefined`,()=>{n.assign(i,a),$Y(t,a)});function c(l){switch(l){case"string":n.elseIf((0,be._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,be._)`"" + ${i}`).elseIf((0,be._)`${i} === null`).assign(a,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${o} == "boolean" || ${i} === null
175
+ `,r)+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 r=jh(e),n=Ca(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=jh(e),n=Ca(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};kL.Parser=lb});var CL=k(Ll=>{"use strict";var RL=Xv(),SG=wl(),xl=Dl(),NG=KT(),kG=Le(),RG=cb(),PL=ub();function wL(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new RG.LineCounter||null,prettyErrors:e}}function PG(t,e={}){let{lineCounter:r,prettyErrors:n}=wL(e),i=new PL.Parser(r?.addNewLine),s=new RL.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let a of o)a.errors.forEach(xl.prettifyError(t,r)),a.warnings.forEach(xl.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function EL(t,e={}){let{lineCounter:r,prettyErrors:n}=wL(e),i=new PL.Parser(r?.addNewLine),s=new RL.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new xl.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(xl.prettifyError(t,r)),o.warnings.forEach(xl.prettifyError(t,r))),o}function wG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=EL(t,r);if(!i)return null;if(i.warnings.forEach(s=>NG.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function EG(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return kG.isDocument(t)&&!n?t.toString(r):new SG.Document(t,n,r).toString(r)}Ll.parse=wG;Ll.parseAllDocuments=PG;Ll.parseDocument=EL;Ll.stringify=EG});var fb=k(Ke=>{"use strict";var CG=Xv(),DG=wl(),AG=Dv(),db=Dl(),IG=dl(),bs=Le(),OG=gs(),MG=$t(),xG=Ts(),LG=vs(),qG=Bh(),$G=ob(),BG=cb(),FG=ub(),Uh=CL(),DL=al();Ke.Composer=CG.Composer;Ke.Document=DG.Document;Ke.Schema=AG.Schema;Ke.YAMLError=db.YAMLError;Ke.YAMLParseError=db.YAMLParseError;Ke.YAMLWarning=db.YAMLWarning;Ke.Alias=IG.Alias;Ke.isAlias=bs.isAlias;Ke.isCollection=bs.isCollection;Ke.isDocument=bs.isDocument;Ke.isMap=bs.isMap;Ke.isNode=bs.isNode;Ke.isPair=bs.isPair;Ke.isScalar=bs.isScalar;Ke.isSeq=bs.isSeq;Ke.Pair=OG.Pair;Ke.Scalar=MG.Scalar;Ke.YAMLMap=xG.YAMLMap;Ke.YAMLSeq=LG.YAMLSeq;Ke.CST=qG;Ke.Lexer=$G.Lexer;Ke.LineCounter=BG.LineCounter;Ke.Parser=FG.Parser;Ke.parse=Uh.parse;Ke.parseAllDocuments=Uh.parseAllDocuments;Ke.parseDocument=Uh.parseDocument;Ke.stringify=Uh.stringify;Ke.visit=DL.visit;Ke.visitAsync=DL.visitAsync});var Bl=k(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.regexpCode=Be.getEsmExportName=Be.getProperty=Be.safeStringify=Be.stringify=Be.strConcat=Be.addCodeArg=Be.str=Be._=Be.nil=Be._Code=Be.Name=Be.IDENTIFIER=Be._CodeOrName=void 0;var ql=class{};Be._CodeOrName=ql;Be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ro=class extends ql{constructor(e){if(super(),!Be.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Be.Name=ro;var gn=class extends ql{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof ro&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Be._Code=gn;Be.nil=new gn("");function AL(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hb(r,e[n]),r.push(t[++n]);return new gn(r)}Be._=AL;var pb=new gn("+");function IL(t,...e){let r=[$l(t[0])],n=0;for(;n<e.length;)r.push(pb),hb(r,e[n]),r.push(pb,$l(t[++n]));return jG(r),new gn(r)}Be.str=IL;function hb(t,e){e instanceof gn?t.push(...e._items):e instanceof ro?t.push(e):t.push(VG(e))}Be.addCodeArg=hb;function jG(t){let e=1;for(;e<t.length-1;){if(t[e]===pb){let r=UG(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function UG(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ro||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ro))return`"${t}${e.slice(1)}`}function HG(t,e){return e.emptyStr()?t:t.emptyStr()?e:IL`${t}${e}`}Be.strConcat=HG;function VG(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:$l(Array.isArray(t)?t.join(","):t)}function zG(t){return new gn($l(t))}Be.stringify=zG;function $l(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Be.safeStringify=$l;function WG(t){return typeof t=="string"&&Be.IDENTIFIER.test(t)?new gn(`.${t}`):AL`[${t}]`}Be.getProperty=WG;function GG(t){if(typeof t=="string"&&Be.IDENTIFIER.test(t))return new gn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Be.getEsmExportName=GG;function KG(t){return new gn(t.toString())}Be.regexpCode=KG});var yb=k(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.ValueScope=Br.ValueScopeName=Br.Scope=Br.varKinds=Br.UsedValueState=void 0;var $r=Bl(),mb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Hh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Hh||(Br.UsedValueState=Hh={}));Br.varKinds={const:new $r.Name("const"),let:new $r.Name("let"),var:new $r.Name("var")};var Vh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof $r.Name?e:this.name(e)}name(e){return new $r.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Br.Scope=Vh;var zh=class extends $r.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,$r._)`.${new $r.Name(r)}[${n}]`}};Br.ValueScopeName=zh;var YG=(0,$r._)`\n`,gb=class extends Vh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?YG:$r.nil}}get(){return this._scope}name(e){return new zh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,$r._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=$r.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Hh.Started);let u=r(l);if(u){let d=this.opts.es5?Br.varKinds.var:Br.varKinds.const;s=(0,$r._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,$r._)`${s}${u}${this.opts._n}`;else throw new mb(l);c.set(l,Hh.Completed)})}return s}};Br.ValueScope=gb});var ve=k(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.or=_e.and=_e.not=_e.CodeGen=_e.operators=_e.varKinds=_e.ValueScopeName=_e.ValueScope=_e.Scope=_e.Name=_e.regexpCode=_e.stringify=_e.getProperty=_e.nil=_e.strConcat=_e.str=_e._=void 0;var Ie=Bl(),Fn=yb(),_s=Bl();Object.defineProperty(_e,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(_e,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(_e,"strConcat",{enumerable:!0,get:function(){return _s.strConcat}});Object.defineProperty(_e,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(_e,"getProperty",{enumerable:!0,get:function(){return _s.getProperty}});Object.defineProperty(_e,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(_e,"regexpCode",{enumerable:!0,get:function(){return _s.regexpCode}});Object.defineProperty(_e,"Name",{enumerable:!0,get:function(){return _s.Name}});var Yh=yb();Object.defineProperty(_e,"Scope",{enumerable:!0,get:function(){return Yh.Scope}});Object.defineProperty(_e,"ValueScope",{enumerable:!0,get:function(){return Yh.ValueScope}});Object.defineProperty(_e,"ValueScopeName",{enumerable:!0,get:function(){return Yh.ValueScopeName}});Object.defineProperty(_e,"varKinds",{enumerable:!0,get:function(){return Yh.varKinds}});_e.operators={GT:new Ie._Code(">"),GTE:new Ie._Code(">="),LT:new Ie._Code("<"),LTE:new Ie._Code("<="),EQ:new Ie._Code("==="),NEQ:new Ie._Code("!=="),NOT:new Ie._Code("!"),OR:new Ie._Code("||"),AND:new Ie._Code("&&"),ADD:new Ie._Code("+")};var Oi=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Tb=class extends Oi{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Fn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Aa(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ie._CodeOrName?this.rhs.names:{}}},Wh=class extends Oi{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ie.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Aa(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ie.Name?{}:{...this.lhs.names};return Kh(e,this.rhs)}},vb=class extends Wh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},bb=class extends Oi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},_b=class extends Oi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Sb=class extends Oi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Nb=class extends Oi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Aa(this.code,e,r),this}get names(){return this.code instanceof Ie._CodeOrName?this.code.names:{}}},Fl=class extends Oi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(XG(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>so(e,r.names),{})}},Mi=class extends Fl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},kb=class extends Fl{},Da=class extends Mi{};Da.kind="else";var no=class t extends Mi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Da(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(OL(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Aa(this.condition,e,r),this}get names(){let e=super.names;return Kh(e,this.condition),this.else&&so(e,this.else.names),e}};no.kind="if";var io=class extends Mi{};io.kind="for";var Rb=class extends io{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Aa(this.iteration,e,r),this}get names(){return so(super.names,this.iteration.names)}},Pb=class extends io{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Fn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Kh(super.names,this.from);return Kh(e,this.to)}},Gh=class extends io{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Aa(this.iterable,e,r),this}get names(){return so(super.names,this.iterable.names)}},jl=class extends Mi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jl.kind="func";var Ul=class extends Fl{render(e){return"return "+super.render(e)}};Ul.kind="return";var wb=class extends Mi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&so(e,this.catch.names),this.finally&&so(e,this.finally.names),e}},Hl=class extends Mi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Hl.kind="catch";var Vl=class extends Mi{render(e){return"finally"+super.render(e)}};Vl.kind="finally";var Eb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
176
+ `:""},this._extScope=e,this._scope=new Fn.Scope({parent:e}),this._nodes=[new kb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Tb(e,s,n)),s}const(e,r,n){return this._def(Fn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Fn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Fn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Wh(e,r,n))}add(e,r){return this._leafNode(new vb(e,_e.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ie.nil&&this._leafNode(new Nb(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ie.addCodeArg)(r,i));return r.push("}"),new Ie._Code(r)}if(e,r,n){if(this._blockNode(new no(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new no(e))}else(){return this._elseNode(new Da)}endIf(){return this._endBlockNode(no,Da)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Rb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Fn.varKinds.var:Fn.varKinds.let){let o=this._scope.toName(e);return this._for(new Pb(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Fn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ie.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ie._)`${o}.length`,a=>{this.var(s,(0,Ie._)`${o}[${a}]`),n(s)})}return this._for(new Gh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Fn.varKinds.var:Fn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ie._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Gh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(io)}label(e){return this._leafNode(new bb(e))}break(e){return this._leafNode(new _b(e))}return(e){let r=new Ul;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ul)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new wb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Hl(s),r(s)}return n&&(this._currNode=i.finally=new Vl,this.code(n)),this._endBlockNode(Hl,Vl)}throw(e){return this._leafNode(new Sb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ie.nil,n,i){return this._blockNode(new jl(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(jl)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof no))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};_e.CodeGen=Eb;function so(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Kh(t,e){return e instanceof Ie._CodeOrName?so(t,e.names):t}function Aa(t,e,r){if(t instanceof Ie.Name)return n(t);if(!i(t))return t;return new Ie._Code(t._items.reduce((s,o)=>(o instanceof Ie.Name&&(o=n(o)),o instanceof Ie._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ie._Code&&s._items.some(o=>o instanceof Ie.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function XG(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function OL(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ie._)`!${Cb(t)}`}_e.not=OL;var JG=ML(_e.operators.AND);function QG(...t){return t.reduce(JG)}_e.and=QG;var ZG=ML(_e.operators.OR);function eK(...t){return t.reduce(ZG)}_e.or=eK;function ML(t){return(e,r)=>e===Ie.nil?r:r===Ie.nil?e:(0,Ie._)`${Cb(e)} ${t} ${Cb(r)}`}function Cb(t){return t instanceof Ie.Name?t:(0,Ie._)`(${t})`}});var we=k(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.checkStrictMode=Se.getErrorPath=Se.Type=Se.useFunc=Se.setEvaluated=Se.evaluatedPropsToName=Se.mergeEvaluated=Se.eachItem=Se.unescapeJsonPointer=Se.escapeJsonPointer=Se.escapeFragment=Se.unescapeFragment=Se.schemaRefOrVal=Se.schemaHasRulesButRef=Se.schemaHasRules=Se.checkUnknownRules=Se.alwaysValidSchema=Se.toHash=void 0;var ot=ve(),tK=Bl();function rK(t){let e={};for(let r of t)e[r]=!0;return e}Se.toHash=rK;function nK(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(qL(t,e),!$L(e,t.self.RULES.all))}Se.alwaysValidSchema=nK;function qL(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||jL(t,`unknown keyword: "${s}"`)}Se.checkUnknownRules=qL;function $L(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Se.schemaHasRules=$L;function iK(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Se.schemaHasRulesButRef=iK;function sK({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ot._)`${r}`}return(0,ot._)`${t}${e}${(0,ot.getProperty)(n)}`}Se.schemaRefOrVal=sK;function oK(t){return BL(decodeURIComponent(t))}Se.unescapeFragment=oK;function aK(t){return encodeURIComponent(Ab(t))}Se.escapeFragment=aK;function Ab(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Se.escapeJsonPointer=Ab;function BL(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Se.unescapeJsonPointer=BL;function cK(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Se.eachItem=cK;function xL({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof ot.Name?(s instanceof ot.Name?t(i,s,o):e(i,s,o),o):s instanceof ot.Name?(e(i,o,s),s):r(s,o);return a===ot.Name&&!(c instanceof ot.Name)?n(i,c):c}}Se.mergeEvaluated={props:xL({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ot._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ot._)`${r} || {}`).code((0,ot._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ot._)`${r} || {}`),Ib(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:FL}),items:xL({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ot._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ot._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function FL(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ot._)`{}`);return e!==void 0&&Ib(t,r,e),r}Se.evaluatedPropsToName=FL;function Ib(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ot._)`${e}${(0,ot.getProperty)(n)}`,!0))}Se.setEvaluated=Ib;var LL={};function lK(t,e){return t.scopeValue("func",{ref:e,code:LL[e.code]||(LL[e.code]=new tK._Code(e.code))})}Se.useFunc=lK;var Db;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Db||(Se.Type=Db={}));function uK(t,e,r){if(t instanceof ot.Name){let n=e===Db.Num;return r?n?(0,ot._)`"[" + ${t} + "]"`:(0,ot._)`"['" + ${t} + "']"`:n?(0,ot._)`"/" + ${t}`:(0,ot._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ot.getProperty)(t).toString():"/"+Ab(t)}Se.getErrorPath=uK;function jL(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Se.checkStrictMode=jL});var yn=k(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var pr=ve(),dK={data:new pr.Name("data"),valCxt:new pr.Name("valCxt"),instancePath:new pr.Name("instancePath"),parentData:new pr.Name("parentData"),parentDataProperty:new pr.Name("parentDataProperty"),rootData:new pr.Name("rootData"),dynamicAnchors:new pr.Name("dynamicAnchors"),vErrors:new pr.Name("vErrors"),errors:new pr.Name("errors"),this:new pr.Name("this"),self:new pr.Name("self"),scope:new pr.Name("scope"),json:new pr.Name("json"),jsonPos:new pr.Name("jsonPos"),jsonLen:new pr.Name("jsonLen"),jsonPart:new pr.Name("jsonPart")};Ob.default=dK});var zl=k(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.extendErrors=hr.resetErrorsCount=hr.reportExtraError=hr.reportError=hr.keyword$DataError=hr.keywordError=void 0;var qe=ve(),Xh=we(),Sr=yn();hr.keywordError={message:({keyword:t})=>(0,qe.str)`must pass "${t}" keyword validation`};hr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,qe.str)`"${t}" keyword must be ${e} ($data)`:(0,qe.str)`"${t}" keyword is invalid ($data)`};function fK(t,e=hr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=VL(t,e,r);n??(o||a)?UL(s,c):HL(i,(0,qe._)`[${c}]`)}hr.reportError=fK;function pK(t,e=hr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=VL(t,e,r);UL(i,a),s||o||HL(n,Sr.default.vErrors)}hr.reportExtraError=pK;function hK(t,e){t.assign(Sr.default.errors,e),t.if((0,qe._)`${Sr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,qe._)`${Sr.default.vErrors}.length`,e),()=>t.assign(Sr.default.vErrors,null)))}hr.resetErrorsCount=hK;function mK({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Sr.default.errors,a=>{t.const(o,(0,qe._)`${Sr.default.vErrors}[${a}]`),t.if((0,qe._)`${o}.instancePath === undefined`,()=>t.assign((0,qe._)`${o}.instancePath`,(0,qe.strConcat)(Sr.default.instancePath,s.errorPath))),t.assign((0,qe._)`${o}.schemaPath`,(0,qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,qe._)`${o}.schema`,r),t.assign((0,qe._)`${o}.data`,n))})}hr.extendErrors=mK;function UL(t,e){let r=t.const("err",e);t.if((0,qe._)`${Sr.default.vErrors} === null`,()=>t.assign(Sr.default.vErrors,(0,qe._)`[${r}]`),(0,qe._)`${Sr.default.vErrors}.push(${r})`),t.code((0,qe._)`${Sr.default.errors}++`)}function HL(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,qe._)`${n}.errors`,e),r.return(!1))}var oo={keyword:new qe.Name("keyword"),schemaPath:new qe.Name("schemaPath"),params:new qe.Name("params"),propertyName:new qe.Name("propertyName"),message:new qe.Name("message"),schema:new qe.Name("schema"),parentSchema:new qe.Name("parentSchema")};function VL(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,qe._)`{}`:gK(t,e,r)}function gK(t,e,r={}){let{gen:n,it:i}=t,s=[yK(i,r),TK(t,r)];return vK(t,e,s),n.object(...s)}function yK({errorPath:t},{instancePath:e}){let r=e?(0,qe.str)`${t}${(0,Xh.getErrorPath)(e,Xh.Type.Str)}`:t;return[Sr.default.instancePath,(0,qe.strConcat)(Sr.default.instancePath,r)]}function TK({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,qe.str)`${e}/${t}`;return r&&(i=(0,qe.str)`${i}${(0,Xh.getErrorPath)(r,Xh.Type.Str)}`),[oo.schemaPath,i]}function vK(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([oo.keyword,i],[oo.params,typeof e=="function"?e(t):e||(0,qe._)`{}`]),c.messages&&n.push([oo.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([oo.schema,o],[oo.parentSchema,(0,qe._)`${u}${d}`],[Sr.default.data,s]),l&&n.push([oo.propertyName,l])}});var WL=k(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.boolOrEmptySchema=Ia.topBoolOrEmptySchema=void 0;var bK=zl(),_K=ve(),SK=yn(),NK={message:"boolean schema is false"};function kK(t){let{gen:e,schema:r,validateName:n}=t;r===!1?zL(t,!1):typeof r=="object"&&r.$async===!0?e.return(SK.default.data):(e.assign((0,_K._)`${n}.errors`,null),e.return(!0))}Ia.topBoolOrEmptySchema=kK;function RK(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),zL(t)):r.var(e,!0)}Ia.boolOrEmptySchema=RK;function zL(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,bK.reportError)(i,NK,void 0,e)}});var Mb=k(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.getRules=Oa.isJSONType=void 0;var PK=["string","number","integer","boolean","null","object","array"],wK=new Set(PK);function EK(t){return typeof t=="string"&&wK.has(t)}Oa.isJSONType=EK;function CK(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Oa.getRules=CK});var xb=k(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.shouldUseRule=Ss.shouldUseGroup=Ss.schemaHasRulesForType=void 0;function DK({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&GL(t,n)}Ss.schemaHasRulesForType=DK;function GL(t,e){return e.rules.some(r=>KL(t,r))}Ss.shouldUseGroup=GL;function KL(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ss.shouldUseRule=KL});var Wl=k(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.reportTypeError=mr.checkDataTypes=mr.checkDataType=mr.coerceAndCheckDataType=mr.getJSONTypes=mr.getSchemaTypes=mr.DataType=void 0;var AK=Mb(),IK=xb(),OK=zl(),be=ve(),YL=we(),Ma;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ma||(mr.DataType=Ma={}));function MK(t){let e=XL(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}mr.getSchemaTypes=MK;function XL(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(AK.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}mr.getJSONTypes=XL;function xK(t,e){let{gen:r,data:n,opts:i}=t,s=LK(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,IK.schemaHasRulesForType)(t,e[0]));if(o){let a=qb(e,n,i.strictNumbers,Ma.Wrong);r.if(a,()=>{s.length?qK(t,e,s):$b(t)})}return o}mr.coerceAndCheckDataType=xK;var JL=new Set(["string","number","integer","boolean","null"]);function LK(t,e){return e?t.filter(r=>JL.has(r)||e==="array"&&r==="array"):[]}function qK(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,be._)`typeof ${i}`),a=n.let("coerced",(0,be._)`undefined`);s.coerceTypes==="array"&&n.if((0,be._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,be._)`${i}[0]`).assign(o,(0,be._)`typeof ${i}`).if(qb(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,be._)`${a} !== undefined`);for(let l of r)(JL.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),$b(t),n.endIf(),n.if((0,be._)`${a} !== undefined`,()=>{n.assign(i,a),$K(t,a)});function c(l){switch(l){case"string":n.elseIf((0,be._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,be._)`"" + ${i}`).elseIf((0,be._)`${i} === null`).assign(a,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${o} == "boolean" || ${i} === null
177
177
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,be._)`+${i}`);return;case"integer":n.elseIf((0,be._)`${o} === "boolean" || ${i} === null
178
178
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,be._)`+${i}`);return;case"boolean":n.elseIf((0,be._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,be._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,be._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,be._)`${o} === "string" || ${o} === "number"
179
- || ${o} === "boolean" || ${i} === null`).assign(a,(0,be._)`[${i}]`)}}}function $Y({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,be._)`${e} !== undefined`,()=>t.assign((0,be._)`${e}[${r}]`,n))}function Lb(t,e,r,n=Ma.Correct){let i=n===Ma.Correct?be.operators.EQ:be.operators.NEQ,s;switch(t){case"null":return(0,be._)`${e} ${i} null`;case"array":s=(0,be._)`Array.isArray(${e})`;break;case"object":s=(0,be._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,be._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,be._)`typeof ${e} ${i} ${t}`}return n===Ma.Correct?s:(0,be.not)(s);function o(a=be.nil){return(0,be.and)((0,be._)`typeof ${e} == "number"`,a,r?(0,be._)`isFinite(${e})`:be.nil)}}mr.checkDataType=Lb;function qb(t,e,r,n){if(t.length===1)return Lb(t[0],e,r,n);let i,s=(0,KL.toHash)(t);if(s.array&&s.object){let o=(0,be._)`typeof ${e} != "object"`;i=s.null?o:(0,be._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=be.nil;s.number&&delete s.integer;for(let o in s)i=(0,be.and)(i,Lb(o,e,r,n));return i}mr.checkDataTypes=qb;var BY={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,be._)`{type: ${t}}`:(0,be._)`{type: ${e}}`};function $b(t){let e=FY(t);(0,IY.reportError)(e,BY)}mr.reportTypeError=$b;function FY(t){let{gen:e,data:r,schema:n}=t,i=(0,KL.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var ZL=k(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.assignDefaults=void 0;var xa=ve(),jY=Ee();function UY(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)QL(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>QL(t,s,i.default))}Jh.assignDefaults=UY;function QL(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,xa._)`${s}${(0,xa.getProperty)(e)}`;if(i){(0,jY.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,xa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,xa._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,xa._)`${a} = ${(0,xa.stringify)(r)}`)}});var Tn=k(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.validateUnion=tt.validateArray=tt.usePattern=tt.callValidateCode=tt.schemaProperties=tt.allSchemaProperties=tt.noPropertyInData=tt.propertyInData=tt.isOwnProperty=tt.hasPropFunc=tt.reportMissingProp=tt.checkMissingProp=tt.checkReportMissingProp=void 0;var gt=ve(),Bb=Ee(),Ns=yn(),HY=Ee();function VY(t,e){let{gen:r,data:n,it:i}=t;r.if(jb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,gt._)`${e}`},!0),t.error()})}tt.checkReportMissingProp=VY;function zY({gen:t,data:e,it:{opts:r}},n,i){return(0,gt.or)(...n.map(s=>(0,gt.and)(jb(t,e,s,r.ownProperties),(0,gt._)`${i} = ${s}`)))}tt.checkMissingProp=zY;function WY(t,e){t.setParams({missingProperty:e},!0),t.error()}tt.reportMissingProp=WY;function eq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,gt._)`Object.prototype.hasOwnProperty`})}tt.hasPropFunc=eq;function Fb(t,e,r){return(0,gt._)`${eq(t)}.call(${e}, ${r})`}tt.isOwnProperty=Fb;function GY(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} !== undefined`;return n?(0,gt._)`${i} && ${Fb(t,e,r)}`:i}tt.propertyInData=GY;function jb(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} === undefined`;return n?(0,gt.or)(i,(0,gt.not)(Fb(t,e,r))):i}tt.noPropertyInData=jb;function tq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}tt.allSchemaProperties=tq;function YY(t,e){return tq(e).filter(r=>!(0,Bb.alwaysValidSchema)(t,e[r]))}tt.schemaProperties=YY;function KY({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,gt._)`${t}, ${e}, ${n}${i}`:e,d=[[Ns.default.instancePath,(0,gt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,o.parentData],[Ns.default.parentDataProperty,o.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];o.opts.dynamicRef&&d.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let f=(0,gt._)`${u}, ${r.object(...d)}`;return c!==gt.nil?(0,gt._)`${a}.call(${c}, ${f})`:(0,gt._)`${a}(${f})`}tt.callValidateCode=KY;var XY=(0,gt._)`new RegExp`;function JY({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,gt._)`${i.code==="new RegExp"?XY:(0,HY.useFunc)(t,i)}(${r}, ${n})`})}tt.usePattern=JY;function QY(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let c=e.const("len",(0,gt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:Bb.Type.Num},s),e.if((0,gt.not)(s),a)})}}tt.validateArray=QY;function ZY(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Bb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,gt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,gt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}tt.validateUnion=ZY});var iq=k(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.validateKeywordUsage=ui.validSchemaType=ui.funcKeywordCode=ui.macroKeywordCode=void 0;var Nr=ve(),ao=yn(),eK=Tn(),tK=zl();function rK(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=nq(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Nr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ui.macroKeywordCode=rK;function nK(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;sK(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=nq(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&rq(t),T(()=>t.error());else{let S=e.async?p():g();e.modifying&&rq(t),T(()=>iK(t,S))}}function p(){let S=n.let("ruleErrs",null);return n.try(()=>h((0,Nr._)`await `),_=>n.assign(d,!1).if((0,Nr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(S,(0,Nr._)`${_}.errors`),()=>n.throw(_))),S}function g(){let S=(0,Nr._)`${u}.errors`;return n.assign(S,null),h(Nr.nil),S}function h(S=e.async?(0,Nr._)`await `:Nr.nil){let _=c.opts.passContext?ao.default.this:ao.default.self,v=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Nr._)`${S}${(0,eK.callValidateCode)(t,u,_,v)}`,e.modifying)}function T(S){var _;n.if((0,Nr.not)((_=e.valid)!==null&&_!==void 0?_:d),S)}}ui.funcKeywordCode=nK;function rq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Nr._)`${n.parentData}[${n.parentDataProperty}]`))}function iK(t,e){let{gen:r}=t;r.if((0,Nr._)`Array.isArray(${e})`,()=>{r.assign(ao.default.vErrors,(0,Nr._)`${ao.default.vErrors} === null ? ${e} : ${ao.default.vErrors}.concat(${e})`).assign(ao.default.errors,(0,Nr._)`${ao.default.vErrors}.length`),(0,tK.extendErrors)(t)},()=>t.error())}function sK({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function nq(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Nr.stringify)(r)})}function oK(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ui.validSchemaType=oK;function aK({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ui.validateKeywordUsage=aK});var oq=k(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.extendSubschemaMode=ks.extendSubschemaData=ks.getSubschema=void 0;var di=ve(),sq=Ee();function cK(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}${(0,di.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,sq.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ks.getSubschema=cK;function lK(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,di._)`${e.data}${(0,di.getProperty)(r)}`,!0);c(f),t.errorPath=(0,di.str)`${l}${(0,sq.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,di._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof di.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ks.extendSubschemaData=lK;function uK(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ks.extendSubschemaMode=uK});var Ub=k((hRe,aq)=>{"use strict";aq.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var lq=k((mRe,cq)=>{"use strict";var Rs=cq.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Qh(e,n,i,t,"",t)};Rs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Rs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Rs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Rs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Qh(t,e,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Rs.arrayKeywords)for(var f=0;f<d.length;f++)Qh(t,e,r,d[f],i+"/"+u+"/"+f,s,i,u,n,f)}else if(u in Rs.propsKeywords){if(d&&typeof d=="object")for(var p in d)Qh(t,e,r,d[p],i+"/"+u+"/"+dK(p),s,i,u,n,p)}else(u in Rs.keywords||t.allKeys&&!(u in Rs.skipKeywords))&&Qh(t,e,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function dK(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Gl=k(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getSchemaRefs=Fr.resolveUrl=Fr.normalizeId=Fr._getFullPath=Fr.getFullPath=Fr.inlineRef=void 0;var fK=Ee(),pK=Ub(),hK=lq(),mK=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function gK(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Hb(t):e?uq(t)<=e:!1}Fr.inlineRef=gK;var yK=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Hb(t){for(let e in t){if(yK.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Hb)||typeof r=="object"&&Hb(r))return!0}return!1}function uq(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!mK.has(r)&&(typeof t[r]=="object"&&(0,fK.eachItem)(t[r],n=>e+=uq(n)),e===1/0))return 1/0}return e}function dq(t,e="",r){r!==!1&&(e=La(e));let n=t.parse(e);return fq(t,n)}Fr.getFullPath=dq;function fq(t,e){return t.serialize(e).split("#")[0]+"#"}Fr._getFullPath=fq;var TK=/#\/?$/;function La(t){return t?t.replace(TK,""):""}Fr.normalizeId=La;function vK(t,e,r){return r=La(r),t.resolve(e,r)}Fr.resolveUrl=vK;var bK=/^[a-z_][-a-z0-9._]*$/i;function _K(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=La(t[r]||e),s={"":i},o=dq(n,i,!1),a={},c=new Set;return hK(t,{allKeys:!0},(d,f,p,g)=>{if(g===void 0)return;let h=o+f,T=s[g];typeof d[r]=="string"&&(T=S.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[f]=T;function S(v){let R=this.opts.uriResolver.resolve;if(v=La(T?R(T,v):v),c.has(v))throw u(v);c.add(v);let D=this.refs[v];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?l(d,D.schema,v):v!==La(h)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=h),v}function _(v){if(typeof v=="string"){if(!bK.test(v))throw new Error(`invalid anchor "${v}"`);S.call(this,`#${v}`)}}}),a;function l(d,f,p){if(f!==void 0&&!pK(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Fr.getSchemaRefs=_K});var Xl=k(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.getData=Ps.KeywordCxt=Ps.validateFunctionCode=void 0;var yq=WL(),pq=Wl(),zb=xb(),Zh=Wl(),SK=ZL(),Kl=iq(),Vb=oq(),se=ve(),pe=yn(),NK=Gl(),xi=Ee(),Yl=zl();function kK(t){if(bq(t)&&(_q(t),vq(t))){EK(t);return}Tq(t,()=>(0,yq.topBoolOrEmptySchema)(t))}Ps.validateFunctionCode=kK;function Tq({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,se._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,se._)`"use strict"; ${hq(r,i)}`),PK(t,i),t.code(s)}):t.func(e,(0,se._)`${pe.default.data}, ${RK(i)}`,n.$async,()=>t.code(hq(r,i)).code(s))}function RK(t){return(0,se._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,se._)`, ${pe.default.dynamicAnchors}={}`:se.nil}}={}`}function PK(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,se._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,se._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,se._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,se._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,se._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,se._)`""`),t.var(pe.default.parentData,(0,se._)`undefined`),t.var(pe.default.parentDataProperty,(0,se._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,se._)`{}`)})}function EK(t){let{schema:e,opts:r,gen:n}=t;Tq(t,()=>{r.$comment&&e.$comment&&Nq(t),OK(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&wK(t),Sq(t),xK(t)})}function wK(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,se._)`${r}.evaluated`),e.if((0,se._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,se._)`${t.evaluated}.props`,(0,se._)`undefined`)),e.if((0,se._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,se._)`${t.evaluated}.items`,(0,se._)`undefined`))}function hq(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,se._)`/*# sourceURL=${r} */`:se.nil}function DK(t,e){if(bq(t)&&(_q(t),vq(t))){CK(t,e);return}(0,yq.boolOrEmptySchema)(t,e)}function vq({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function bq(t){return typeof t.schema!="boolean"}function CK(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Nq(t),IK(t),MK(t);let s=n.const("_errs",pe.default.errors);Sq(t,s),n.var(e,(0,se._)`${s} === ${pe.default.errors}`)}function _q(t){(0,xi.checkUnknownRules)(t),AK(t)}function Sq(t,e){if(t.opts.jtd)return mq(t,[],!1,e);let r=(0,pq.getSchemaTypes)(t.schema),n=(0,pq.coerceAndCheckDataType)(t,r);mq(t,r,!n,e)}function AK(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,xi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function OK(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,xi.checkStrictMode)(t,"default is ignored in the schema root")}function IK(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,NK.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function MK(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Nq({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,se._)`${pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,se.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,se._)`${pe.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function xK(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,se._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,se._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,se._)`${n}.errors`,pe.default.vErrors),s.unevaluated&&LK(t),e.return((0,se._)`${pe.default.errors} === 0`))}function LK({gen:t,evaluated:e,props:r,items:n}){r instanceof se.Name&&t.assign((0,se._)`${e}.props`,r),n instanceof se.Name&&t.assign((0,se._)`${e}.items`,n)}function mq(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,xi.schemaHasRulesButRef)(s,u))){i.block(()=>Rq(t,"$ref",u.all.$ref.definition));return}c.jtd||qK(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,zb.shouldUseGroup)(s,f)&&(f.type?(i.if((0,Zh.checkDataType)(f.type,o,c.strictNumbers)),gq(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,Zh.reportTypeError)(t)),i.endIf()):gq(t,f),a||i.if((0,se._)`${pe.default.errors} === ${n||0}`))}}function gq(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,SK.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,zb.shouldUseRule)(n,s)&&Rq(t,s.keyword,s.definition,e.type)})}function qK(t,e){t.schemaEnv.meta||!t.opts.strictTypes||($K(t,e),t.opts.allowUnionTypes||BK(t,e),FK(t,t.dataTypes))}function $K(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{kq(t.dataTypes,r)||Wb(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),UK(t,e)}}function BK(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Wb(t,"use allowUnionTypes to allow union type keyword")}function FK(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,zb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>jK(e,o))&&Wb(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function jK(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function kq(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function UK(t,e){let r=[];for(let n of t.dataTypes)kq(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Wb(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,xi.checkStrictMode)(t,e,t.opts.strictTypes)}var em=class{constructor(e,r,n){if((0,Kl.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,xi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Pq(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Kl.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,se.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,se.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,se._)`${r} !== undefined && (${(0,se.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Yl.reportExtraError:Yl.reportError)(this,this.def.error,r)}$dataError(){(0,Yl.reportError)(this,this.def.$dataError||Yl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Yl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=se.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=se.nil,r=se.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,se.or)((0,se._)`${i} === undefined`,r)),e!==se.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==se.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,se.or)(o(),a());function o(){if(n.length){if(!(r instanceof se.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,se._)`${(0,Zh.checkDataTypes)(c,r,s.opts.strictNumbers,Zh.DataType.Wrong)}`}return se.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,se._)`!${c}(${r})`}return se.nil}}subschema(e,r){let n=(0,Vb.getSubschema)(this.it,e);(0,Vb.extendSubschemaData)(n,this.it,e),(0,Vb.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return DK(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=xi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=xi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,se.Name)),!0}};Ps.KeywordCxt=em;function Rq(t,e,r,n){let i=new em(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Kl.funcKeywordCode)(i,r):"macro"in r?(0,Kl.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Kl.funcKeywordCode)(i,r)}var HK=/^\/(?:[^~]|~0|~1)*$/,VK=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Pq(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!HK.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=pe.default.rootData}else{let l=VK.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,se._)`${s}${(0,se.getProperty)((0,xi.unescapeJsonPointer)(l))}`,o=(0,se._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Ps.getData=Pq});var tm=k(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var Gb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Yb.default=Gb});var Jl=k(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var Kb=Gl(),Xb=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kb.resolveUrl)(e,r,n),this.missingSchema=(0,Kb.normalizeId)((0,Kb.getFullPath)(e,this.missingRef))}};Jb.default=Xb});var Ql=k(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.resolveSchema=vn.getCompilingSchema=vn.resolveRef=vn.compileSchema=vn.SchemaEnv=void 0;var jn=ve(),zK=tm(),co=yn(),Un=Gl(),Eq=Ee(),WK=Xl(),qa=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};vn.SchemaEnv=qa;function Zb(t){let e=wq.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:zK.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:co.default.data,parentData:co.default.parentData,parentDataProperty:co.default.parentDataProperty,dataNames:[co.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,WK.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(co.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${co.default.self}`,`${co.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:h}=l;p.evaluated={props:g instanceof jn.Name?void 0:g,items:h instanceof jn.Name?void 0:h,dynamicProps:g instanceof jn.Name,dynamicItems:h instanceof jn.Name},p.source&&(p.source.evaluated=(0,jn.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}vn.compileSchema=Zb;function GK(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=XK.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new qa({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=YK.call(this,s)}vn.resolveRef=GK;function YK(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Zb.call(this,t)}function wq(t){for(let e of this._compilations)if(KK(e,t))return e}vn.getCompilingSchema=wq;function KK(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function XK(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||rm.call(this,t,e)}function rm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Qb.call(this,r,t);let s=(0,Un.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=rm.call(this,t,o);return typeof a?.schema!="object"?void 0:Qb.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Zb.call(this,o),s===(0,Un.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,l)),new qa({schema:a,schemaId:c,root:t,baseId:i})}return Qb.call(this,r,o)}}vn.resolveSchema=rm;var JK=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qb(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Eq.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!JK.has(a)&&l&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Eq.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=rm.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new qa({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var Dq=k((_Re,QK)=>{QK.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Aq=k((SRe,Cq)=>{"use strict";var ZK={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Cq.exports={HEX:ZK}});var Bq=k((NRe,$q)=>{"use strict";var{HEX:e3}=Aq(),t3=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function xq(t){if(qq(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(t3)||[],[r]=e;return r?{host:n3(r,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function e_(t,e=!1){let r="",n=!0;for(let i of t){if(e3[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return e&&r.length===0&&(r="0"),r}function r3(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=e_(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){r.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(e_(i))),r.address=n.join(""),r}function Lq(t){if(qq(t,":")<2)return{host:t,isIPV6:!1};let e=r3(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,escapedHost:n,isIPV6:!0}}}function n3(t,e){let r="",n=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&n?(s+1<=i&&t[s+1]===e||s+1===i)&&(r+=o,n=!1):(o===e?n=!0:n=!1,r+=o)}return r}function qq(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}var Oq=/^\.\.?\//u,Iq=/^\/\.(?:\/|$)/u,Mq=/^\/\.\.(?:\/|$)/u,i3=/^\/?(?:.|\n)*?(?=\/|$)/u;function s3(t){let e=[];for(;t.length;)if(t.match(Oq))t=t.replace(Oq,"");else if(t.match(Iq))t=t.replace(Iq,"/");else if(t.match(Mq))t=t.replace(Mq,"/"),e.pop();else if(t==="."||t==="..")t="";else{let r=t.match(i3);if(r){let n=r[0];t=t.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function o3(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function a3(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host),n=xq(r);if(n.isIPV4)r=n.host;else{let i=Lq(n.host);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}$q.exports={recomposeAuthority:a3,normalizeComponentEncoding:o3,removeDotSegments:s3,normalizeIPv4:xq,normalizeIPv6:Lq,stringArrayToHexStripped:e_}});var zq=k((kRe,Vq)=>{"use strict";var c3=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,l3=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Fq(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function jq(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Uq(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function u3(t){return t.secure=Fq(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function d3(t){if((t.port===(Fq(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function f3(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(l3);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=t_[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function p3(t,e){let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=t_[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function h3(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!c3.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function m3(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Hq={scheme:"http",domainHost:!0,parse:jq,serialize:Uq},g3={scheme:"https",domainHost:Hq.domainHost,parse:jq,serialize:Uq},nm={scheme:"ws",domainHost:!0,parse:u3,serialize:d3},y3={scheme:"wss",domainHost:nm.domainHost,parse:nm.parse,serialize:nm.serialize},T3={scheme:"urn",parse:f3,serialize:p3,skipNormalize:!0},v3={scheme:"urn:uuid",parse:h3,serialize:m3,skipNormalize:!0},t_={http:Hq,https:g3,ws:nm,wss:y3,urn:T3,"urn:uuid":v3};Vq.exports=t_});var Gq=k((RRe,sm)=>{"use strict";var{normalizeIPv6:b3,normalizeIPv4:_3,removeDotSegments:Zl,recomposeAuthority:S3,normalizeComponentEncoding:im}=Bq(),r_=zq();function N3(t,e){return typeof t=="string"?t=fi(Li(t,e),e):typeof t=="object"&&(t=Li(fi(t,e),e)),t}function k3(t,e,r){let n=Object.assign({scheme:"null"},r),i=Wq(Li(t,n),Li(e,n),n,!0);return fi(i,{...n,skipEscape:!0})}function Wq(t,e,r,n){let i={};return n||(t=Li(fi(t,r),r),e=Li(fi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Zl(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Zl(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=Zl(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Zl(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function R3(t,e,r){return typeof t=="string"?(t=unescape(t),t=fi(im(Li(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=fi(im(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=fi(im(Li(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=fi(im(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function fi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=r_[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=S3(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=Zl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var P3=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function E3(t){let e=0;for(let r=0,n=t.length;r<n;++r)if(e=t.charCodeAt(r),e>126||P3[e])return!0;return!1}var w3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Li(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(t=(r.scheme?r.scheme+":":"")+"//"+t);let o=t.match(w3);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=_3(n.host);if(c.isIPV4===!1){let l=b3(c.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=r_[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&E3(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var n_={SCHEMES:r_,normalize:N3,resolve:k3,resolveComponents:Wq,equal:R3,serialize:fi,parse:Li};sm.exports=n_;sm.exports.default=n_;sm.exports.fastUri=n_});var Kq=k(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var Yq=Gq();Yq.code='require("ajv/dist/runtime/uri").default';i_.default=Yq});var n1=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.CodeGen=rr.Name=rr.nil=rr.stringify=rr.str=rr._=rr.KeywordCxt=void 0;var D3=Xl();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:function(){return D3.KeywordCxt}});var $a=ve();Object.defineProperty(rr,"_",{enumerable:!0,get:function(){return $a._}});Object.defineProperty(rr,"str",{enumerable:!0,get:function(){return $a.str}});Object.defineProperty(rr,"stringify",{enumerable:!0,get:function(){return $a.stringify}});Object.defineProperty(rr,"nil",{enumerable:!0,get:function(){return $a.nil}});Object.defineProperty(rr,"Name",{enumerable:!0,get:function(){return $a.Name}});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:function(){return $a.CodeGen}});var C3=tm(),e1=Jl(),A3=Mb(),eu=Ql(),O3=ve(),tu=Gl(),om=Wl(),o_=Ee(),Xq=Dq(),I3=Kq(),t1=(t,e)=>new RegExp(t,e);t1.code="new RegExp";var M3=["removeAdditional","useDefaults","coerceTypes"],x3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),L3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},q3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Jq=200;function $3(t){var e,r,n,i,s,o,a,c,l,u,d,f,p,g,h,T,S,_,v,R,D,B,M,F,ge;let Je=t.strict,Ft=(e=t.code)===null||e===void 0?void 0:e.optimize,Ne=Ft===!0||Ft===void 0?1:Ft||0,Xr=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:t1,qi=(i=t.uriResolver)!==null&&i!==void 0?i:I3.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:Je)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Je)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Je)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Je)!==null&&f!==void 0?f:"log",strictRequired:(g=(p=t.strictRequired)!==null&&p!==void 0?p:Je)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:Ne,regExp:Xr}:{optimize:Ne,regExp:Xr},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Jq,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:Jq,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(v=t.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(R=t.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(D=t.addUsedSchema)!==null&&D!==void 0?D:!0,validateSchema:(B=t.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(M=t.validateFormats)!==null&&M!==void 0?M:!0,unicodeRegExp:(F=t.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(ge=t.int32range)!==null&&ge!==void 0?ge:!0,uriResolver:qi}}var ru=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$3(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new O3.ValueScope({scope:{},prefixes:x3,es5:r,lines:n}),this.logger=V3(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,A3.getRules)(),Qq.call(this,L3,e,"NOT SUPPORTED"),Qq.call(this,q3,e,"DEPRECATED","warn"),this._metaOpts=U3.call(this),e.formats&&F3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&j3.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),B3.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Xq;n==="id"&&(i={...Xq},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await s.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof e1.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await s.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,tu.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Zq.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new eu.SchemaEnv({schema:{},schemaId:n});if(r=eu.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Zq.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,tu.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W3.call(this,n,r),!r)return(0,o_.eachItem)(n,s=>s_.call(this,s)),this;Y3.call(this,r);let i={...r,type:(0,om.getJSONTypes)(r.type),schemaType:(0,om.getJSONTypes)(r.schemaType)};return(0,o_.eachItem)(n,i.type.length===0?s=>s_.call(this,s,i):s=>i.type.forEach(o=>s_.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=r1(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,tu.normalizeId)(o||n);let l=tu.getSchemaRefs.call(this,e,n);return c=new eu.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):eu.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{eu.compileSchema.call(this,e)}finally{this.opts=r}}};ru.ValidationError=C3.default;ru.MissingRefError=e1.default;rr.default=ru;function Qq(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Zq(t){return t=(0,tu.normalizeId)(t),this.schemas[t]||this.refs[t]}function B3(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function F3(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function j3(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function U3(){let t={...this.opts};for(let e of M3)delete t[e];return t}var H3={log(){},warn(){},error(){}};function V3(t){if(t===!1)return H3;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var z3=/^[a-z_$][a-z0-9_$:-]*$/i;function W3(t,e){let{RULES:r}=this;if((0,o_.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!z3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function s_(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,om.getJSONTypes)(e.type),schemaType:(0,om.getJSONTypes)(e.schemaType)}};e.before?G3.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function G3(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Y3(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=r1(e)),t.validateSchema=this.compile(e,!0))}var K3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function r1(t){return{anyOf:[t,K3]}}});var i1=k(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var X3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a_.default=X3});var lm=k(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.callRef=lo.getValidate=void 0;var J3=Jl(),s1=Tn(),jr=ve(),Ba=yn(),o1=Ql(),am=Ee(),Q3={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=o1.resolveRef.call(c,l,i,r);if(u===void 0)throw new J3.default(n.opts.uriResolver,i,r);if(u instanceof o1.SchemaEnv)return f(u);return p(u);function d(){if(s===l)return cm(t,o,s,s.$async);let g=e.scopeValue("root",{ref:l});return cm(t,(0,jr._)`${g}.validate`,l,l.$async)}function f(g){let h=a1(t,g);cm(t,h,g,g.$async)}function p(g){let h=e.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,jr.stringify)(g)}:{ref:g}),T=e.name("valid"),S=t.subschema({schema:g,dataTypes:[],schemaPath:jr.nil,topSchemaRef:h,errSchemaPath:r},T);t.mergeEvaluated(S),t.ok(T)}}};function a1(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,jr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}lo.getValidate=a1;function cm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Ba.default.this:jr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,jr._)`await ${(0,s1.callValidateCode)(t,e,l)}`),p(e),o||i.assign(g,!0)},h=>{i.if((0,jr._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),f(h),o||i.assign(g,!1)}),t.ok(g)}function d(){t.result((0,s1.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(g){let h=(0,jr._)`${g}.errors`;i.assign(Ba.default.vErrors,(0,jr._)`${Ba.default.vErrors} === null ? ${h} : ${Ba.default.vErrors}.concat(${h})`),i.assign(Ba.default.errors,(0,jr._)`${Ba.default.vErrors}.length`)}function p(g){var h;if(!s.opts.unevaluated)return;let T=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=am.mergeEvaluated.props(i,T.props,s.props));else{let S=i.var("props",(0,jr._)`${g}.evaluated.props`);s.props=am.mergeEvaluated.props(i,S,s.props,jr.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=am.mergeEvaluated.items(i,T.items,s.items));else{let S=i.var("items",(0,jr._)`${g}.evaluated.items`);s.items=am.mergeEvaluated.items(i,S,s.items,jr.Name)}}}lo.callRef=cm;lo.default=Q3});var c1=k(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});var Z3=i1(),eX=lm(),tX=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Z3.default,eX.default];c_.default=tX});var l1=k(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var um=ve(),Es=um.operators,dm={maximum:{okStr:"<=",ok:Es.LTE,fail:Es.GT},minimum:{okStr:">=",ok:Es.GTE,fail:Es.LT},exclusiveMaximum:{okStr:"<",ok:Es.LT,fail:Es.GTE},exclusiveMinimum:{okStr:">",ok:Es.GT,fail:Es.LTE}},rX={message:({keyword:t,schemaCode:e})=>(0,um.str)`must be ${dm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,um._)`{comparison: ${dm[t].okStr}, limit: ${e}}`},nX={keyword:Object.keys(dm),type:"number",schemaType:"number",$data:!0,error:rX,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,um._)`${r} ${dm[e].fail} ${n} || isNaN(${r})`)}};l_.default=nX});var u1=k(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var nu=ve(),iX={message:({schemaCode:t})=>(0,nu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,nu._)`{multipleOf: ${t}}`},sX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:iX,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,nu._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,nu._)`${o} !== parseInt(${o})`;t.fail$data((0,nu._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};u_.default=sX});var f1=k(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});function d1(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}d_.default=d1;d1.code='require("ajv/dist/runtime/ucs2length").default'});var p1=k(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var uo=ve(),oX=Ee(),aX=f1(),cX={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,uo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,uo._)`{limit: ${t}}`},lX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:cX,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?uo.operators.GT:uo.operators.LT,o=i.opts.unicode===!1?(0,uo._)`${r}.length`:(0,uo._)`${(0,oX.useFunc)(t.gen,aX.default)}(${r})`;t.fail$data((0,uo._)`${o} ${s} ${n}`)}};f_.default=lX});var h1=k(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var uX=Tn(),fm=ve(),dX={message:({schemaCode:t})=>(0,fm.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,fm._)`{pattern: ${t}}`},fX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dX,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=r?(0,fm._)`(new RegExp(${i}, ${o}))`:(0,uX.usePattern)(t,n);t.fail$data((0,fm._)`!${a}.test(${e})`)}};p_.default=fX});var m1=k(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var iu=ve(),pX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,iu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,iu._)`{limit: ${t}}`},hX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:pX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?iu.operators.GT:iu.operators.LT;t.fail$data((0,iu._)`Object.keys(${r}).length ${i} ${n}`)}};h_.default=hX});var g1=k(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var su=Tn(),ou=ve(),mX=Ee(),gX={message:({params:{missingProperty:t}})=>(0,ou.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ou._)`{missingProperty: ${t}}`},yX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gX,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:g}=t.it;for(let h of r)if(p?.[h]===void 0&&!g.has(h)){let T=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${h}" is not defined at "${T}" (strictRequired)`;(0,mX.checkStrictMode)(o,S,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(ou.nil,d);else for(let p of r)(0,su.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||s){let g=e.let("valid",!0);t.block$data(g,()=>f(p,g)),t.ok(g)}else e.if((0,su.checkMissingProp)(t,r,p)),(0,su.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,su.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,g){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(g,(0,su.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ou.not)(g),()=>{t.error(),e.break()})},ou.nil)}}};m_.default=yX});var y1=k(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var au=ve(),TX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,au.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,au._)`{limit: ${t}}`},vX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:TX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?au.operators.GT:au.operators.LT;t.fail$data((0,au._)`${r}.length ${i} ${n}`)}};g_.default=vX});var pm=k(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var T1=Ub();T1.code='require("ajv/dist/runtime/equal").default';y_.default=T1});var v1=k(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});var T_=Wl(),nr=ve(),bX=Ee(),_X=pm(),SX={message:({params:{i:t,j:e}})=>(0,nr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,nr._)`{i: ${t}, j: ${e}}`},NX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SX,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=s.items?(0,T_.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,nr._)`${o} === false`),t.ok(c);function u(){let g=e.let("i",(0,nr._)`${r}.length`),h=e.let("j");t.setParams({i:g,j:h}),e.assign(c,!0),e.if((0,nr._)`${g} > 1`,()=>(d()?f:p)(g,h))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function f(g,h){let T=e.name("item"),S=(0,T_.checkDataTypes)(l,T,a.opts.strictNumbers,T_.DataType.Wrong),_=e.const("indices",(0,nr._)`{}`);e.for((0,nr._)`;${g}--;`,()=>{e.let(T,(0,nr._)`${r}[${g}]`),e.if(S,(0,nr._)`continue`),l.length>1&&e.if((0,nr._)`typeof ${T} == "string"`,(0,nr._)`${T} += "_"`),e.if((0,nr._)`typeof ${_}[${T}] == "number"`,()=>{e.assign(h,(0,nr._)`${_}[${T}]`),t.error(),e.assign(c,!1).break()}).code((0,nr._)`${_}[${T}] = ${g}`)})}function p(g,h){let T=(0,bX.useFunc)(e,_X.default),S=e.name("outer");e.label(S).for((0,nr._)`;${g}--;`,()=>e.for((0,nr._)`${h} = ${g}; ${h}--;`,()=>e.if((0,nr._)`${T}(${r}[${g}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};v_.default=NX});var b1=k(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var b_=ve(),kX=Ee(),RX=pm(),PX={message:"must be equal to constant",params:({schemaCode:t})=>(0,b_._)`{allowedValue: ${t}}`},EX={keyword:"const",$data:!0,error:PX,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,b_._)`!${(0,kX.useFunc)(e,RX.default)}(${r}, ${i})`):t.fail((0,b_._)`${s} !== ${r}`)}};__.default=EX});var _1=k(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});var cu=ve(),wX=Ee(),DX=pm(),CX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,cu._)`{allowedValues: ${t}}`},AX={keyword:"enum",schemaType:"array",$data:!0,error:CX,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,wX.useFunc)(e,DX.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",s);u=(0,cu.or)(...i.map((g,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,p=>e.if((0,cu._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,g){let h=i[g];return typeof h=="object"&&h!==null?(0,cu._)`${l()}(${r}, ${p}[${g}])`:(0,cu._)`${r} === ${h}`}}};S_.default=AX});var S1=k(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var OX=l1(),IX=u1(),MX=p1(),xX=h1(),LX=m1(),qX=g1(),$X=y1(),BX=v1(),FX=b1(),jX=_1(),UX=[OX.default,IX.default,MX.default,xX.default,LX.default,qX.default,$X.default,BX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},FX.default,jX.default];N_.default=UX});var R_=k(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.validateAdditionalItems=void 0;var fo=ve(),k_=Ee(),HX={message:({params:{len:t}})=>(0,fo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,fo._)`{limit: ${t}}`},VX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:HX,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,k_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}N1(t,n)}};function N1(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,fo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,fo._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,k_.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,fo._)`${a} <= ${e.length}`);r.if((0,fo.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:k_.Type.Num},l),o.allErrors||r.if((0,fo.not)(l),()=>r.break())})}}lu.validateAdditionalItems=N1;lu.default=VX});var P_=k(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.validateTuple=void 0;var k1=ve(),hm=Ee(),zX=Tn(),WX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return R1(t,"additionalItems",e);r.items=!0,!(0,hm.alwaysValidSchema)(r,e)&&t.ok((0,zX.validateArray)(t))}};function R1(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=hm.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,k1._)`${s}.length`);r.forEach((d,f)=>{(0,hm.alwaysValidSchema)(a,d)||(n.if((0,k1._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,g=r.length,h=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let T=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,hm.checkStrictMode)(a,T,f.strictTuples)}}}uu.validateTuple=R1;uu.default=WX});var P1=k(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});var GX=P_(),YX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,GX.validateTuple)(t,"items")};E_.default=YX});var w1=k(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});var E1=ve(),KX=Ee(),XX=Tn(),JX=R_(),QX={message:({params:{len:t}})=>(0,E1.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,E1._)`{limit: ${t}}`},ZX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:QX,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,KX.alwaysValidSchema)(n,e)&&(i?(0,JX.validateAdditionalItems)(t,i):t.ok((0,XX.validateArray)(t)))}};w_.default=ZX});var D1=k(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var bn=ve(),mm=Ee(),e4={message:({params:{min:t,max:e}})=>e===void 0?(0,bn.str)`must contain at least ${t} valid item(s)`:(0,bn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,bn._)`{minContains: ${t}}`:(0,bn._)`{minContains: ${t}, maxContains: ${e}}`},t4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:e4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,bn._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,mm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,mm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,mm.alwaysValidSchema)(s,r)){let h=(0,bn._)`${u} >= ${o}`;a!==void 0&&(h=(0,bn._)`${h} && ${u} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,bn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),T=e.let("count",0);p(h,()=>e.if(h,()=>g(T)))}function p(h,T){e.forRange("i",0,u,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:mm.Type.Num,compositeRule:!0},h),T()})}function g(h){e.code((0,bn._)`${h}++`),a===void 0?e.if((0,bn._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,bn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,bn._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};D_.default=t4});var gm=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.validateSchemaDeps=pi.validatePropertyDeps=pi.error=void 0;var C_=ve(),r4=Ee(),du=Tn();pi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,C_.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,C_._)`{property: ${t},
179
+ || ${o} === "boolean" || ${i} === null`).assign(a,(0,be._)`[${i}]`)}}}function $K({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,be._)`${e} !== undefined`,()=>t.assign((0,be._)`${e}[${r}]`,n))}function Lb(t,e,r,n=Ma.Correct){let i=n===Ma.Correct?be.operators.EQ:be.operators.NEQ,s;switch(t){case"null":return(0,be._)`${e} ${i} null`;case"array":s=(0,be._)`Array.isArray(${e})`;break;case"object":s=(0,be._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,be._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,be._)`typeof ${e} ${i} ${t}`}return n===Ma.Correct?s:(0,be.not)(s);function o(a=be.nil){return(0,be.and)((0,be._)`typeof ${e} == "number"`,a,r?(0,be._)`isFinite(${e})`:be.nil)}}mr.checkDataType=Lb;function qb(t,e,r,n){if(t.length===1)return Lb(t[0],e,r,n);let i,s=(0,YL.toHash)(t);if(s.array&&s.object){let o=(0,be._)`typeof ${e} != "object"`;i=s.null?o:(0,be._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=be.nil;s.number&&delete s.integer;for(let o in s)i=(0,be.and)(i,Lb(o,e,r,n));return i}mr.checkDataTypes=qb;var BK={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,be._)`{type: ${t}}`:(0,be._)`{type: ${e}}`};function $b(t){let e=FK(t);(0,OK.reportError)(e,BK)}mr.reportTypeError=$b;function FK(t){let{gen:e,data:r,schema:n}=t,i=(0,YL.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var ZL=k(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.assignDefaults=void 0;var xa=ve(),jK=we();function UK(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)QL(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>QL(t,s,i.default))}Jh.assignDefaults=UK;function QL(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,xa._)`${s}${(0,xa.getProperty)(e)}`;if(i){(0,jK.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,xa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,xa._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,xa._)`${a} = ${(0,xa.stringify)(r)}`)}});var Tn=k(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.validateUnion=tt.validateArray=tt.usePattern=tt.callValidateCode=tt.schemaProperties=tt.allSchemaProperties=tt.noPropertyInData=tt.propertyInData=tt.isOwnProperty=tt.hasPropFunc=tt.reportMissingProp=tt.checkMissingProp=tt.checkReportMissingProp=void 0;var gt=ve(),Bb=we(),Ns=yn(),HK=we();function VK(t,e){let{gen:r,data:n,it:i}=t;r.if(jb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,gt._)`${e}`},!0),t.error()})}tt.checkReportMissingProp=VK;function zK({gen:t,data:e,it:{opts:r}},n,i){return(0,gt.or)(...n.map(s=>(0,gt.and)(jb(t,e,s,r.ownProperties),(0,gt._)`${i} = ${s}`)))}tt.checkMissingProp=zK;function WK(t,e){t.setParams({missingProperty:e},!0),t.error()}tt.reportMissingProp=WK;function eq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,gt._)`Object.prototype.hasOwnProperty`})}tt.hasPropFunc=eq;function Fb(t,e,r){return(0,gt._)`${eq(t)}.call(${e}, ${r})`}tt.isOwnProperty=Fb;function GK(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} !== undefined`;return n?(0,gt._)`${i} && ${Fb(t,e,r)}`:i}tt.propertyInData=GK;function jb(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} === undefined`;return n?(0,gt.or)(i,(0,gt.not)(Fb(t,e,r))):i}tt.noPropertyInData=jb;function tq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}tt.allSchemaProperties=tq;function KK(t,e){return tq(e).filter(r=>!(0,Bb.alwaysValidSchema)(t,e[r]))}tt.schemaProperties=KK;function YK({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,gt._)`${t}, ${e}, ${n}${i}`:e,d=[[Ns.default.instancePath,(0,gt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,o.parentData],[Ns.default.parentDataProperty,o.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];o.opts.dynamicRef&&d.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let f=(0,gt._)`${u}, ${r.object(...d)}`;return c!==gt.nil?(0,gt._)`${a}.call(${c}, ${f})`:(0,gt._)`${a}(${f})`}tt.callValidateCode=YK;var XK=(0,gt._)`new RegExp`;function JK({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,gt._)`${i.code==="new RegExp"?XK:(0,HK.useFunc)(t,i)}(${r}, ${n})`})}tt.usePattern=JK;function QK(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let c=e.const("len",(0,gt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:Bb.Type.Num},s),e.if((0,gt.not)(s),a)})}}tt.validateArray=QK;function ZK(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Bb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,gt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,gt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}tt.validateUnion=ZK});var iq=k(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.validateKeywordUsage=ui.validSchemaType=ui.funcKeywordCode=ui.macroKeywordCode=void 0;var Nr=ve(),ao=yn(),eY=Tn(),tY=zl();function rY(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=nq(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Nr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ui.macroKeywordCode=rY;function nY(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;sY(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=nq(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&rq(t),T(()=>t.error());else{let S=e.async?p():g();e.modifying&&rq(t),T(()=>iY(t,S))}}function p(){let S=n.let("ruleErrs",null);return n.try(()=>h((0,Nr._)`await `),_=>n.assign(d,!1).if((0,Nr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(S,(0,Nr._)`${_}.errors`),()=>n.throw(_))),S}function g(){let S=(0,Nr._)`${u}.errors`;return n.assign(S,null),h(Nr.nil),S}function h(S=e.async?(0,Nr._)`await `:Nr.nil){let _=c.opts.passContext?ao.default.this:ao.default.self,v=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Nr._)`${S}${(0,eY.callValidateCode)(t,u,_,v)}`,e.modifying)}function T(S){var _;n.if((0,Nr.not)((_=e.valid)!==null&&_!==void 0?_:d),S)}}ui.funcKeywordCode=nY;function rq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Nr._)`${n.parentData}[${n.parentDataProperty}]`))}function iY(t,e){let{gen:r}=t;r.if((0,Nr._)`Array.isArray(${e})`,()=>{r.assign(ao.default.vErrors,(0,Nr._)`${ao.default.vErrors} === null ? ${e} : ${ao.default.vErrors}.concat(${e})`).assign(ao.default.errors,(0,Nr._)`${ao.default.vErrors}.length`),(0,tY.extendErrors)(t)},()=>t.error())}function sY({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function nq(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Nr.stringify)(r)})}function oY(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ui.validSchemaType=oY;function aY({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ui.validateKeywordUsage=aY});var oq=k(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.extendSubschemaMode=ks.extendSubschemaData=ks.getSubschema=void 0;var di=ve(),sq=we();function cY(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}${(0,di.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,sq.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ks.getSubschema=cY;function lY(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,di._)`${e.data}${(0,di.getProperty)(r)}`,!0);c(f),t.errorPath=(0,di.str)`${l}${(0,sq.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,di._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof di.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ks.extendSubschemaData=lY;function uY(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ks.extendSubschemaMode=uY});var Ub=k((hRe,aq)=>{"use strict";aq.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var lq=k((mRe,cq)=>{"use strict";var Rs=cq.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Qh(e,n,i,t,"",t)};Rs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Rs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Rs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Rs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Qh(t,e,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Rs.arrayKeywords)for(var f=0;f<d.length;f++)Qh(t,e,r,d[f],i+"/"+u+"/"+f,s,i,u,n,f)}else if(u in Rs.propsKeywords){if(d&&typeof d=="object")for(var p in d)Qh(t,e,r,d[p],i+"/"+u+"/"+dY(p),s,i,u,n,p)}else(u in Rs.keywords||t.allKeys&&!(u in Rs.skipKeywords))&&Qh(t,e,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function dY(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Gl=k(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getSchemaRefs=Fr.resolveUrl=Fr.normalizeId=Fr._getFullPath=Fr.getFullPath=Fr.inlineRef=void 0;var fY=we(),pY=Ub(),hY=lq(),mY=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function gY(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Hb(t):e?uq(t)<=e:!1}Fr.inlineRef=gY;var yY=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Hb(t){for(let e in t){if(yY.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Hb)||typeof r=="object"&&Hb(r))return!0}return!1}function uq(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!mY.has(r)&&(typeof t[r]=="object"&&(0,fY.eachItem)(t[r],n=>e+=uq(n)),e===1/0))return 1/0}return e}function dq(t,e="",r){r!==!1&&(e=La(e));let n=t.parse(e);return fq(t,n)}Fr.getFullPath=dq;function fq(t,e){return t.serialize(e).split("#")[0]+"#"}Fr._getFullPath=fq;var TY=/#\/?$/;function La(t){return t?t.replace(TY,""):""}Fr.normalizeId=La;function vY(t,e,r){return r=La(r),t.resolve(e,r)}Fr.resolveUrl=vY;var bY=/^[a-z_][-a-z0-9._]*$/i;function _Y(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=La(t[r]||e),s={"":i},o=dq(n,i,!1),a={},c=new Set;return hY(t,{allKeys:!0},(d,f,p,g)=>{if(g===void 0)return;let h=o+f,T=s[g];typeof d[r]=="string"&&(T=S.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[f]=T;function S(v){let R=this.opts.uriResolver.resolve;if(v=La(T?R(T,v):v),c.has(v))throw u(v);c.add(v);let C=this.refs[v];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,v):v!==La(h)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=h),v}function _(v){if(typeof v=="string"){if(!bY.test(v))throw new Error(`invalid anchor "${v}"`);S.call(this,`#${v}`)}}}),a;function l(d,f,p){if(f!==void 0&&!pY(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Fr.getSchemaRefs=_Y});var Xl=k(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.getData=Ps.KeywordCxt=Ps.validateFunctionCode=void 0;var yq=WL(),pq=Wl(),zb=xb(),Zh=Wl(),SY=ZL(),Yl=iq(),Vb=oq(),se=ve(),pe=yn(),NY=Gl(),xi=we(),Kl=zl();function kY(t){if(bq(t)&&(_q(t),vq(t))){wY(t);return}Tq(t,()=>(0,yq.topBoolOrEmptySchema)(t))}Ps.validateFunctionCode=kY;function Tq({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,se._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,se._)`"use strict"; ${hq(r,i)}`),PY(t,i),t.code(s)}):t.func(e,(0,se._)`${pe.default.data}, ${RY(i)}`,n.$async,()=>t.code(hq(r,i)).code(s))}function RY(t){return(0,se._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,se._)`, ${pe.default.dynamicAnchors}={}`:se.nil}}={}`}function PY(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,se._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,se._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,se._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,se._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,se._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,se._)`""`),t.var(pe.default.parentData,(0,se._)`undefined`),t.var(pe.default.parentDataProperty,(0,se._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,se._)`{}`)})}function wY(t){let{schema:e,opts:r,gen:n}=t;Tq(t,()=>{r.$comment&&e.$comment&&Nq(t),IY(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&EY(t),Sq(t),xY(t)})}function EY(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,se._)`${r}.evaluated`),e.if((0,se._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,se._)`${t.evaluated}.props`,(0,se._)`undefined`)),e.if((0,se._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,se._)`${t.evaluated}.items`,(0,se._)`undefined`))}function hq(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,se._)`/*# sourceURL=${r} */`:se.nil}function CY(t,e){if(bq(t)&&(_q(t),vq(t))){DY(t,e);return}(0,yq.boolOrEmptySchema)(t,e)}function vq({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function bq(t){return typeof t.schema!="boolean"}function DY(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Nq(t),OY(t),MY(t);let s=n.const("_errs",pe.default.errors);Sq(t,s),n.var(e,(0,se._)`${s} === ${pe.default.errors}`)}function _q(t){(0,xi.checkUnknownRules)(t),AY(t)}function Sq(t,e){if(t.opts.jtd)return mq(t,[],!1,e);let r=(0,pq.getSchemaTypes)(t.schema),n=(0,pq.coerceAndCheckDataType)(t,r);mq(t,r,!n,e)}function AY(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,xi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function IY(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,xi.checkStrictMode)(t,"default is ignored in the schema root")}function OY(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,NY.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function MY(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Nq({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,se._)`${pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,se.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,se._)`${pe.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function xY(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,se._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,se._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,se._)`${n}.errors`,pe.default.vErrors),s.unevaluated&&LY(t),e.return((0,se._)`${pe.default.errors} === 0`))}function LY({gen:t,evaluated:e,props:r,items:n}){r instanceof se.Name&&t.assign((0,se._)`${e}.props`,r),n instanceof se.Name&&t.assign((0,se._)`${e}.items`,n)}function mq(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,xi.schemaHasRulesButRef)(s,u))){i.block(()=>Rq(t,"$ref",u.all.$ref.definition));return}c.jtd||qY(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,zb.shouldUseGroup)(s,f)&&(f.type?(i.if((0,Zh.checkDataType)(f.type,o,c.strictNumbers)),gq(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,Zh.reportTypeError)(t)),i.endIf()):gq(t,f),a||i.if((0,se._)`${pe.default.errors} === ${n||0}`))}}function gq(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,SY.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,zb.shouldUseRule)(n,s)&&Rq(t,s.keyword,s.definition,e.type)})}function qY(t,e){t.schemaEnv.meta||!t.opts.strictTypes||($Y(t,e),t.opts.allowUnionTypes||BY(t,e),FY(t,t.dataTypes))}function $Y(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{kq(t.dataTypes,r)||Wb(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),UY(t,e)}}function BY(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Wb(t,"use allowUnionTypes to allow union type keyword")}function FY(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,zb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>jY(e,o))&&Wb(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function jY(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function kq(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function UY(t,e){let r=[];for(let n of t.dataTypes)kq(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Wb(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,xi.checkStrictMode)(t,e,t.opts.strictTypes)}var em=class{constructor(e,r,n){if((0,Yl.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,xi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Pq(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Yl.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,se.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,se.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,se._)`${r} !== undefined && (${(0,se.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Kl.reportExtraError:Kl.reportError)(this,this.def.error,r)}$dataError(){(0,Kl.reportError)(this,this.def.$dataError||Kl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Kl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=se.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=se.nil,r=se.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,se.or)((0,se._)`${i} === undefined`,r)),e!==se.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==se.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,se.or)(o(),a());function o(){if(n.length){if(!(r instanceof se.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,se._)`${(0,Zh.checkDataTypes)(c,r,s.opts.strictNumbers,Zh.DataType.Wrong)}`}return se.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,se._)`!${c}(${r})`}return se.nil}}subschema(e,r){let n=(0,Vb.getSubschema)(this.it,e);(0,Vb.extendSubschemaData)(n,this.it,e),(0,Vb.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return CY(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=xi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=xi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,se.Name)),!0}};Ps.KeywordCxt=em;function Rq(t,e,r,n){let i=new em(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Yl.funcKeywordCode)(i,r):"macro"in r?(0,Yl.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Yl.funcKeywordCode)(i,r)}var HY=/^\/(?:[^~]|~0|~1)*$/,VY=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Pq(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!HY.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=pe.default.rootData}else{let l=VY.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,se._)`${s}${(0,se.getProperty)((0,xi.unescapeJsonPointer)(l))}`,o=(0,se._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Ps.getData=Pq});var tm=k(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var Gb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Kb.default=Gb});var Jl=k(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var Yb=Gl(),Xb=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Yb.resolveUrl)(e,r,n),this.missingSchema=(0,Yb.normalizeId)((0,Yb.getFullPath)(e,this.missingRef))}};Jb.default=Xb});var Ql=k(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.resolveSchema=vn.getCompilingSchema=vn.resolveRef=vn.compileSchema=vn.SchemaEnv=void 0;var jn=ve(),zY=tm(),co=yn(),Un=Gl(),wq=we(),WY=Xl(),qa=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};vn.SchemaEnv=qa;function Zb(t){let e=Eq.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:zY.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:co.default.data,parentData:co.default.parentData,parentDataProperty:co.default.parentDataProperty,dataNames:[co.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,WY.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(co.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${co.default.self}`,`${co.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:h}=l;p.evaluated={props:g instanceof jn.Name?void 0:g,items:h instanceof jn.Name?void 0:h,dynamicProps:g instanceof jn.Name,dynamicItems:h instanceof jn.Name},p.source&&(p.source.evaluated=(0,jn.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}vn.compileSchema=Zb;function GY(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=XY.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new qa({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=KY.call(this,s)}vn.resolveRef=GY;function KY(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Zb.call(this,t)}function Eq(t){for(let e of this._compilations)if(YY(e,t))return e}vn.getCompilingSchema=Eq;function YY(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function XY(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||rm.call(this,t,e)}function rm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Qb.call(this,r,t);let s=(0,Un.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=rm.call(this,t,o);return typeof a?.schema!="object"?void 0:Qb.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Zb.call(this,o),s===(0,Un.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,l)),new qa({schema:a,schemaId:c,root:t,baseId:i})}return Qb.call(this,r,o)}}vn.resolveSchema=rm;var JY=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qb(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,wq.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!JY.has(a)&&l&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,wq.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=rm.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new qa({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var Cq=k((_Re,QY)=>{QY.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Aq=k((SRe,Dq)=>{"use strict";var ZY={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Dq.exports={HEX:ZY}});var Bq=k((NRe,$q)=>{"use strict";var{HEX:e3}=Aq(),t3=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function xq(t){if(qq(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(t3)||[],[r]=e;return r?{host:n3(r,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function e_(t,e=!1){let r="",n=!0;for(let i of t){if(e3[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return e&&r.length===0&&(r="0"),r}function r3(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=e_(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){r.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(e_(i))),r.address=n.join(""),r}function Lq(t){if(qq(t,":")<2)return{host:t,isIPV6:!1};let e=r3(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,escapedHost:n,isIPV6:!0}}}function n3(t,e){let r="",n=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&n?(s+1<=i&&t[s+1]===e||s+1===i)&&(r+=o,n=!1):(o===e?n=!0:n=!1,r+=o)}return r}function qq(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}var Iq=/^\.\.?\//u,Oq=/^\/\.(?:\/|$)/u,Mq=/^\/\.\.(?:\/|$)/u,i3=/^\/?(?:.|\n)*?(?=\/|$)/u;function s3(t){let e=[];for(;t.length;)if(t.match(Iq))t=t.replace(Iq,"");else if(t.match(Oq))t=t.replace(Oq,"/");else if(t.match(Mq))t=t.replace(Mq,"/"),e.pop();else if(t==="."||t==="..")t="";else{let r=t.match(i3);if(r){let n=r[0];t=t.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function o3(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function a3(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host),n=xq(r);if(n.isIPV4)r=n.host;else{let i=Lq(n.host);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}$q.exports={recomposeAuthority:a3,normalizeComponentEncoding:o3,removeDotSegments:s3,normalizeIPv4:xq,normalizeIPv6:Lq,stringArrayToHexStripped:e_}});var zq=k((kRe,Vq)=>{"use strict";var c3=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,l3=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Fq(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function jq(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Uq(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function u3(t){return t.secure=Fq(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function d3(t){if((t.port===(Fq(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function f3(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(l3);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=t_[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function p3(t,e){let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=t_[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function h3(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!c3.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function m3(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Hq={scheme:"http",domainHost:!0,parse:jq,serialize:Uq},g3={scheme:"https",domainHost:Hq.domainHost,parse:jq,serialize:Uq},nm={scheme:"ws",domainHost:!0,parse:u3,serialize:d3},y3={scheme:"wss",domainHost:nm.domainHost,parse:nm.parse,serialize:nm.serialize},T3={scheme:"urn",parse:f3,serialize:p3,skipNormalize:!0},v3={scheme:"urn:uuid",parse:h3,serialize:m3,skipNormalize:!0},t_={http:Hq,https:g3,ws:nm,wss:y3,urn:T3,"urn:uuid":v3};Vq.exports=t_});var Gq=k((RRe,sm)=>{"use strict";var{normalizeIPv6:b3,normalizeIPv4:_3,removeDotSegments:Zl,recomposeAuthority:S3,normalizeComponentEncoding:im}=Bq(),r_=zq();function N3(t,e){return typeof t=="string"?t=fi(Li(t,e),e):typeof t=="object"&&(t=Li(fi(t,e),e)),t}function k3(t,e,r){let n=Object.assign({scheme:"null"},r),i=Wq(Li(t,n),Li(e,n),n,!0);return fi(i,{...n,skipEscape:!0})}function Wq(t,e,r,n){let i={};return n||(t=Li(fi(t,r),r),e=Li(fi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Zl(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Zl(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=Zl(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Zl(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function R3(t,e,r){return typeof t=="string"?(t=unescape(t),t=fi(im(Li(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=fi(im(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=fi(im(Li(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=fi(im(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function fi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=r_[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=S3(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=Zl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var P3=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function w3(t){let e=0;for(let r=0,n=t.length;r<n;++r)if(e=t.charCodeAt(r),e>126||P3[e])return!0;return!1}var E3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Li(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(t=(r.scheme?r.scheme+":":"")+"//"+t);let o=t.match(E3);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=_3(n.host);if(c.isIPV4===!1){let l=b3(c.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=r_[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&w3(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var n_={SCHEMES:r_,normalize:N3,resolve:k3,resolveComponents:Wq,equal:R3,serialize:fi,parse:Li};sm.exports=n_;sm.exports.default=n_;sm.exports.fastUri=n_});var Yq=k(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var Kq=Gq();Kq.code='require("ajv/dist/runtime/uri").default';i_.default=Kq});var n1=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.CodeGen=rr.Name=rr.nil=rr.stringify=rr.str=rr._=rr.KeywordCxt=void 0;var C3=Xl();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:function(){return C3.KeywordCxt}});var $a=ve();Object.defineProperty(rr,"_",{enumerable:!0,get:function(){return $a._}});Object.defineProperty(rr,"str",{enumerable:!0,get:function(){return $a.str}});Object.defineProperty(rr,"stringify",{enumerable:!0,get:function(){return $a.stringify}});Object.defineProperty(rr,"nil",{enumerable:!0,get:function(){return $a.nil}});Object.defineProperty(rr,"Name",{enumerable:!0,get:function(){return $a.Name}});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:function(){return $a.CodeGen}});var D3=tm(),e1=Jl(),A3=Mb(),eu=Ql(),I3=ve(),tu=Gl(),om=Wl(),o_=we(),Xq=Cq(),O3=Yq(),t1=(t,e)=>new RegExp(t,e);t1.code="new RegExp";var M3=["removeAdditional","useDefaults","coerceTypes"],x3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),L3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},q3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Jq=200;function $3(t){var e,r,n,i,s,o,a,c,l,u,d,f,p,g,h,T,S,_,v,R,C,B,M,F,ge;let Je=t.strict,Ft=(e=t.code)===null||e===void 0?void 0:e.optimize,Ne=Ft===!0||Ft===void 0?1:Ft||0,Xr=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:t1,qi=(i=t.uriResolver)!==null&&i!==void 0?i:O3.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:Je)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Je)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Je)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Je)!==null&&f!==void 0?f:"log",strictRequired:(g=(p=t.strictRequired)!==null&&p!==void 0?p:Je)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:Ne,regExp:Xr}:{optimize:Ne,regExp:Xr},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Jq,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:Jq,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(v=t.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(R=t.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(B=t.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(M=t.validateFormats)!==null&&M!==void 0?M:!0,unicodeRegExp:(F=t.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(ge=t.int32range)!==null&&ge!==void 0?ge:!0,uriResolver:qi}}var ru=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$3(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new I3.ValueScope({scope:{},prefixes:x3,es5:r,lines:n}),this.logger=V3(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,A3.getRules)(),Qq.call(this,L3,e,"NOT SUPPORTED"),Qq.call(this,q3,e,"DEPRECATED","warn"),this._metaOpts=U3.call(this),e.formats&&F3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&j3.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),B3.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Xq;n==="id"&&(i={...Xq},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await s.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof e1.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await s.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,tu.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Zq.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new eu.SchemaEnv({schema:{},schemaId:n});if(r=eu.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Zq.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,tu.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W3.call(this,n,r),!r)return(0,o_.eachItem)(n,s=>s_.call(this,s)),this;K3.call(this,r);let i={...r,type:(0,om.getJSONTypes)(r.type),schemaType:(0,om.getJSONTypes)(r.schemaType)};return(0,o_.eachItem)(n,i.type.length===0?s=>s_.call(this,s,i):s=>i.type.forEach(o=>s_.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=r1(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,tu.normalizeId)(o||n);let l=tu.getSchemaRefs.call(this,e,n);return c=new eu.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):eu.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{eu.compileSchema.call(this,e)}finally{this.opts=r}}};ru.ValidationError=D3.default;ru.MissingRefError=e1.default;rr.default=ru;function Qq(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Zq(t){return t=(0,tu.normalizeId)(t),this.schemas[t]||this.refs[t]}function B3(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function F3(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function j3(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function U3(){let t={...this.opts};for(let e of M3)delete t[e];return t}var H3={log(){},warn(){},error(){}};function V3(t){if(t===!1)return H3;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var z3=/^[a-z_$][a-z0-9_$:-]*$/i;function W3(t,e){let{RULES:r}=this;if((0,o_.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!z3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function s_(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,om.getJSONTypes)(e.type),schemaType:(0,om.getJSONTypes)(e.schemaType)}};e.before?G3.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function G3(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function K3(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=r1(e)),t.validateSchema=this.compile(e,!0))}var Y3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function r1(t){return{anyOf:[t,Y3]}}});var i1=k(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var X3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a_.default=X3});var lm=k(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.callRef=lo.getValidate=void 0;var J3=Jl(),s1=Tn(),jr=ve(),Ba=yn(),o1=Ql(),am=we(),Q3={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=o1.resolveRef.call(c,l,i,r);if(u===void 0)throw new J3.default(n.opts.uriResolver,i,r);if(u instanceof o1.SchemaEnv)return f(u);return p(u);function d(){if(s===l)return cm(t,o,s,s.$async);let g=e.scopeValue("root",{ref:l});return cm(t,(0,jr._)`${g}.validate`,l,l.$async)}function f(g){let h=a1(t,g);cm(t,h,g,g.$async)}function p(g){let h=e.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,jr.stringify)(g)}:{ref:g}),T=e.name("valid"),S=t.subschema({schema:g,dataTypes:[],schemaPath:jr.nil,topSchemaRef:h,errSchemaPath:r},T);t.mergeEvaluated(S),t.ok(T)}}};function a1(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,jr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}lo.getValidate=a1;function cm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Ba.default.this:jr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,jr._)`await ${(0,s1.callValidateCode)(t,e,l)}`),p(e),o||i.assign(g,!0)},h=>{i.if((0,jr._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),f(h),o||i.assign(g,!1)}),t.ok(g)}function d(){t.result((0,s1.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(g){let h=(0,jr._)`${g}.errors`;i.assign(Ba.default.vErrors,(0,jr._)`${Ba.default.vErrors} === null ? ${h} : ${Ba.default.vErrors}.concat(${h})`),i.assign(Ba.default.errors,(0,jr._)`${Ba.default.vErrors}.length`)}function p(g){var h;if(!s.opts.unevaluated)return;let T=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=am.mergeEvaluated.props(i,T.props,s.props));else{let S=i.var("props",(0,jr._)`${g}.evaluated.props`);s.props=am.mergeEvaluated.props(i,S,s.props,jr.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=am.mergeEvaluated.items(i,T.items,s.items));else{let S=i.var("items",(0,jr._)`${g}.evaluated.items`);s.items=am.mergeEvaluated.items(i,S,s.items,jr.Name)}}}lo.callRef=cm;lo.default=Q3});var c1=k(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});var Z3=i1(),eX=lm(),tX=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Z3.default,eX.default];c_.default=tX});var l1=k(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var um=ve(),ws=um.operators,dm={maximum:{okStr:"<=",ok:ws.LTE,fail:ws.GT},minimum:{okStr:">=",ok:ws.GTE,fail:ws.LT},exclusiveMaximum:{okStr:"<",ok:ws.LT,fail:ws.GTE},exclusiveMinimum:{okStr:">",ok:ws.GT,fail:ws.LTE}},rX={message:({keyword:t,schemaCode:e})=>(0,um.str)`must be ${dm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,um._)`{comparison: ${dm[t].okStr}, limit: ${e}}`},nX={keyword:Object.keys(dm),type:"number",schemaType:"number",$data:!0,error:rX,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,um._)`${r} ${dm[e].fail} ${n} || isNaN(${r})`)}};l_.default=nX});var u1=k(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var nu=ve(),iX={message:({schemaCode:t})=>(0,nu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,nu._)`{multipleOf: ${t}}`},sX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:iX,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,nu._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,nu._)`${o} !== parseInt(${o})`;t.fail$data((0,nu._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};u_.default=sX});var f1=k(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});function d1(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}d_.default=d1;d1.code='require("ajv/dist/runtime/ucs2length").default'});var p1=k(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var uo=ve(),oX=we(),aX=f1(),cX={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,uo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,uo._)`{limit: ${t}}`},lX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:cX,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?uo.operators.GT:uo.operators.LT,o=i.opts.unicode===!1?(0,uo._)`${r}.length`:(0,uo._)`${(0,oX.useFunc)(t.gen,aX.default)}(${r})`;t.fail$data((0,uo._)`${o} ${s} ${n}`)}};f_.default=lX});var h1=k(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var uX=Tn(),fm=ve(),dX={message:({schemaCode:t})=>(0,fm.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,fm._)`{pattern: ${t}}`},fX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dX,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=r?(0,fm._)`(new RegExp(${i}, ${o}))`:(0,uX.usePattern)(t,n);t.fail$data((0,fm._)`!${a}.test(${e})`)}};p_.default=fX});var m1=k(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var iu=ve(),pX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,iu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,iu._)`{limit: ${t}}`},hX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:pX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?iu.operators.GT:iu.operators.LT;t.fail$data((0,iu._)`Object.keys(${r}).length ${i} ${n}`)}};h_.default=hX});var g1=k(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var su=Tn(),ou=ve(),mX=we(),gX={message:({params:{missingProperty:t}})=>(0,ou.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ou._)`{missingProperty: ${t}}`},yX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gX,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:g}=t.it;for(let h of r)if(p?.[h]===void 0&&!g.has(h)){let T=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${h}" is not defined at "${T}" (strictRequired)`;(0,mX.checkStrictMode)(o,S,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(ou.nil,d);else for(let p of r)(0,su.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||s){let g=e.let("valid",!0);t.block$data(g,()=>f(p,g)),t.ok(g)}else e.if((0,su.checkMissingProp)(t,r,p)),(0,su.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,su.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,g){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(g,(0,su.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ou.not)(g),()=>{t.error(),e.break()})},ou.nil)}}};m_.default=yX});var y1=k(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var au=ve(),TX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,au.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,au._)`{limit: ${t}}`},vX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:TX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?au.operators.GT:au.operators.LT;t.fail$data((0,au._)`${r}.length ${i} ${n}`)}};g_.default=vX});var pm=k(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var T1=Ub();T1.code='require("ajv/dist/runtime/equal").default';y_.default=T1});var v1=k(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});var T_=Wl(),nr=ve(),bX=we(),_X=pm(),SX={message:({params:{i:t,j:e}})=>(0,nr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,nr._)`{i: ${t}, j: ${e}}`},NX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SX,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=s.items?(0,T_.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,nr._)`${o} === false`),t.ok(c);function u(){let g=e.let("i",(0,nr._)`${r}.length`),h=e.let("j");t.setParams({i:g,j:h}),e.assign(c,!0),e.if((0,nr._)`${g} > 1`,()=>(d()?f:p)(g,h))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function f(g,h){let T=e.name("item"),S=(0,T_.checkDataTypes)(l,T,a.opts.strictNumbers,T_.DataType.Wrong),_=e.const("indices",(0,nr._)`{}`);e.for((0,nr._)`;${g}--;`,()=>{e.let(T,(0,nr._)`${r}[${g}]`),e.if(S,(0,nr._)`continue`),l.length>1&&e.if((0,nr._)`typeof ${T} == "string"`,(0,nr._)`${T} += "_"`),e.if((0,nr._)`typeof ${_}[${T}] == "number"`,()=>{e.assign(h,(0,nr._)`${_}[${T}]`),t.error(),e.assign(c,!1).break()}).code((0,nr._)`${_}[${T}] = ${g}`)})}function p(g,h){let T=(0,bX.useFunc)(e,_X.default),S=e.name("outer");e.label(S).for((0,nr._)`;${g}--;`,()=>e.for((0,nr._)`${h} = ${g}; ${h}--;`,()=>e.if((0,nr._)`${T}(${r}[${g}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};v_.default=NX});var b1=k(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var b_=ve(),kX=we(),RX=pm(),PX={message:"must be equal to constant",params:({schemaCode:t})=>(0,b_._)`{allowedValue: ${t}}`},wX={keyword:"const",$data:!0,error:PX,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,b_._)`!${(0,kX.useFunc)(e,RX.default)}(${r}, ${i})`):t.fail((0,b_._)`${s} !== ${r}`)}};__.default=wX});var _1=k(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});var cu=ve(),EX=we(),CX=pm(),DX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,cu._)`{allowedValues: ${t}}`},AX={keyword:"enum",schemaType:"array",$data:!0,error:DX,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,EX.useFunc)(e,CX.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",s);u=(0,cu.or)(...i.map((g,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,p=>e.if((0,cu._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,g){let h=i[g];return typeof h=="object"&&h!==null?(0,cu._)`${l()}(${r}, ${p}[${g}])`:(0,cu._)`${r} === ${h}`}}};S_.default=AX});var S1=k(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var IX=l1(),OX=u1(),MX=p1(),xX=h1(),LX=m1(),qX=g1(),$X=y1(),BX=v1(),FX=b1(),jX=_1(),UX=[IX.default,OX.default,MX.default,xX.default,LX.default,qX.default,$X.default,BX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},FX.default,jX.default];N_.default=UX});var R_=k(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.validateAdditionalItems=void 0;var fo=ve(),k_=we(),HX={message:({params:{len:t}})=>(0,fo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,fo._)`{limit: ${t}}`},VX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:HX,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,k_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}N1(t,n)}};function N1(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,fo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,fo._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,k_.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,fo._)`${a} <= ${e.length}`);r.if((0,fo.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:k_.Type.Num},l),o.allErrors||r.if((0,fo.not)(l),()=>r.break())})}}lu.validateAdditionalItems=N1;lu.default=VX});var P_=k(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.validateTuple=void 0;var k1=ve(),hm=we(),zX=Tn(),WX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return R1(t,"additionalItems",e);r.items=!0,!(0,hm.alwaysValidSchema)(r,e)&&t.ok((0,zX.validateArray)(t))}};function R1(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=hm.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,k1._)`${s}.length`);r.forEach((d,f)=>{(0,hm.alwaysValidSchema)(a,d)||(n.if((0,k1._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,g=r.length,h=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let T=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,hm.checkStrictMode)(a,T,f.strictTuples)}}}uu.validateTuple=R1;uu.default=WX});var P1=k(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});var GX=P_(),KX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,GX.validateTuple)(t,"items")};w_.default=KX});var E1=k(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});var w1=ve(),YX=we(),XX=Tn(),JX=R_(),QX={message:({params:{len:t}})=>(0,w1.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,w1._)`{limit: ${t}}`},ZX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:QX,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,YX.alwaysValidSchema)(n,e)&&(i?(0,JX.validateAdditionalItems)(t,i):t.ok((0,XX.validateArray)(t)))}};E_.default=ZX});var C1=k(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});var bn=ve(),mm=we(),e4={message:({params:{min:t,max:e}})=>e===void 0?(0,bn.str)`must contain at least ${t} valid item(s)`:(0,bn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,bn._)`{minContains: ${t}}`:(0,bn._)`{minContains: ${t}, maxContains: ${e}}`},t4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:e4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,bn._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,mm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,mm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,mm.alwaysValidSchema)(s,r)){let h=(0,bn._)`${u} >= ${o}`;a!==void 0&&(h=(0,bn._)`${h} && ${u} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,bn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),T=e.let("count",0);p(h,()=>e.if(h,()=>g(T)))}function p(h,T){e.forRange("i",0,u,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:mm.Type.Num,compositeRule:!0},h),T()})}function g(h){e.code((0,bn._)`${h}++`),a===void 0?e.if((0,bn._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,bn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,bn._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};C_.default=t4});var gm=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.validateSchemaDeps=pi.validatePropertyDeps=pi.error=void 0;var D_=ve(),r4=we(),du=Tn();pi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,D_.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,D_._)`{property: ${t},
180
180
  missingProperty: ${n},
181
181
  depsCount: ${e},
182
- deps: ${r}}`};var n4={keyword:"dependencies",type:"object",schemaType:"object",error:pi.error,code(t){let[e,r]=i4(t);C1(t,e),A1(t,r)}};function i4({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function C1(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,du.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,du.checkReportMissingProp)(t,l)}):(r.if((0,C_._)`${c} && (${(0,du.checkMissingProp)(t,a,s)})`),(0,du.reportMissingProp)(t,s),r.else())}}pi.validatePropertyDeps=C1;function A1(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,r4.alwaysValidSchema)(s,e[a])||(r.if((0,du.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}pi.validateSchemaDeps=A1;pi.default=n4});var I1=k(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});var O1=ve(),s4=Ee(),o4={message:"property name must be valid",params:({params:t})=>(0,O1._)`{propertyName: ${t.propertyName}}`},a4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:o4,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,s4.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,O1.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};A_.default=a4});var I_=k(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});var ym=Tn(),Hn=ve(),c4=yn(),Tm=Ee(),l4={message:"must NOT have additional properties",params:({params:t})=>(0,Hn._)`{additionalProperty: ${t.additionalProperty}}`},u4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:l4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Tm.alwaysValidSchema)(o,r))return;let l=(0,ym.allSchemaProperties)(n.properties),u=(0,ym.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Hn._)`${s} === ${c4.default.errors}`);function d(){e.forIn("key",i,T=>{!l.length&&!u.length?g(T):e.if(f(T),()=>g(T))})}function f(T){let S;if(l.length>8){let _=(0,Tm.schemaRefOrVal)(o,n.properties,"properties");S=(0,ym.isOwnProperty)(e,_,T)}else l.length?S=(0,Hn.or)(...l.map(_=>(0,Hn._)`${T} === ${_}`)):S=Hn.nil;return u.length&&(S=(0,Hn.or)(S,...u.map(_=>(0,Hn._)`${(0,ym.usePattern)(t,_)}.test(${T})`))),(0,Hn.not)(S)}function p(T){e.code((0,Hn._)`delete ${i}[${T}]`)}function g(T){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(T);return}if(r===!1){t.setParams({additionalProperty:T}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Tm.alwaysValidSchema)(o,r)){let S=e.name("valid");c.removeAdditional==="failing"?(h(T,S,!1),e.if((0,Hn.not)(S),()=>{t.reset(),p(T)})):(h(T,S),a||e.if((0,Hn.not)(S),()=>e.break()))}}function h(T,S,_){let v={keyword:"additionalProperties",dataProp:T,dataPropType:Tm.Type.Str};_===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(v,S)}}};O_.default=u4});var L1=k(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var d4=Xl(),M1=Tn(),M_=Ee(),x1=I_(),f4={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&x1.default.code(new d4.KeywordCxt(s,x1.default,"additionalProperties"));let o=(0,M1.allSchemaProperties)(r);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=M_.mergeEvaluated.props(e,(0,M_.toHash)(o),s.props));let a=o.filter(d=>!(0,M_.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,M1.propertyInData)(e,i,d,s.opts.ownProperties)),u(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};x_.default=f4});var F1=k(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var q1=Tn(),vm=ve(),$1=Ee(),B1=Ee(),p4={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,q1.allSchemaProperties)(r),c=a.filter(h=>(0,$1.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof vm.Name)&&(s.props=(0,B1.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let h of a)l&&p(h),s.allErrors?g(h):(e.var(u,!0),g(h),e.if(u))}function p(h){for(let T in l)new RegExp(h).test(T)&&(0,$1.checkStrictMode)(s,`property ${T} matches pattern ${h} (use allowMatchingProperties)`)}function g(h){e.forIn("key",n,T=>{e.if((0,vm._)`${(0,q1.usePattern)(t,h)}.test(${T})`,()=>{let S=c.includes(h);S||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:T,dataPropType:B1.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,vm._)`${d}[${T}]`,!0):!S&&!s.allErrors&&e.if((0,vm.not)(u),()=>e.break())})})}}};L_.default=p4});var j1=k(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var h4=Ee(),m4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,h4.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};q_.default=m4});var U1=k($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var g4=Tn(),y4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:g4.validateUnion,error:{message:"must match a schema in anyOf"}};$_.default=y4});var H1=k(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var bm=ve(),T4=Ee(),v4={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,bm._)`{passingSchemas: ${t.passing}}`},b4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:v4,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){s.forEach((u,d)=>{let f;(0,T4.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,bm._)`${c} && ${o}`).assign(o,!1).assign(a,(0,bm._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,bm.Name)})})}}};B_.default=b4});var V1=k(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var _4=Ee(),S4={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,_4.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};F_.default=S4});var G1=k(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var _m=ve(),W1=Ee(),N4={message:({params:t})=>(0,_m.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,_m._)`{failingKeyword: ${t.ifClause}}`},k4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:N4,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,W1.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=z1(n,"then"),s=z1(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,_m.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,_m._)`${u}`):t.setParams({ifClause:u})}}}};function z1(t,e){let r=t.schema[e];return r!==void 0&&!(0,W1.alwaysValidSchema)(t,r)}j_.default=k4});var Y1=k(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var R4=Ee(),P4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,R4.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};U_.default=P4});var K1=k(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var E4=R_(),w4=P1(),D4=P_(),C4=w1(),A4=D1(),O4=gm(),I4=I1(),M4=I_(),x4=L1(),L4=F1(),q4=j1(),$4=U1(),B4=H1(),F4=V1(),j4=G1(),U4=Y1();function H4(t=!1){let e=[q4.default,$4.default,B4.default,F4.default,j4.default,U4.default,I4.default,M4.default,O4.default,x4.default,L4.default];return t?e.push(w4.default,C4.default):e.push(E4.default,D4.default),e.push(A4.default),e}H_.default=H4});var X1=k(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var It=ve(),V4={message:({schemaCode:t})=>(0,It.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,It._)`{format: ${t}}`},z4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:V4,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,It._)`${g}[${o}]`),T=r.let("fType"),S=r.let("format");r.if((0,It._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(T,(0,It._)`${h}.type || "string"`).assign(S,(0,It._)`${h}.validate`),()=>r.assign(T,(0,It._)`"string"`).assign(S,h)),t.fail$data((0,It.or)(_(),v()));function _(){return c.strictSchema===!1?It.nil:(0,It._)`${o} && !${S}`}function v(){let R=u.$async?(0,It._)`(${h}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,It._)`${S}(${n})`,D=(0,It._)`(typeof ${S} == "function" ? ${R} : ${S}.test(${n}))`;return(0,It._)`${S} && ${S} !== true && ${T} === ${e} && !${D}`}}function p(){let g=d.formats[s];if(!g){_();return}if(g===!0)return;let[h,T,S]=v(g);h===e&&t.pass(R());function _(){if(c.strictSchema===!1){d.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function v(D){let B=D instanceof RegExp?(0,It.regexpCode)(D):c.code.formats?(0,It._)`${c.code.formats}${(0,It.getProperty)(s)}`:void 0,M=r.scopeValue("formats",{key:s,ref:D,code:B});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,It._)`${M}.validate`]:["string",D,M]}function R(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!u.$async)throw new Error("async format in sync schema");return(0,It._)`await ${S}(${n})`}return typeof T=="function"?(0,It._)`${S}(${n})`:(0,It._)`${S}.test(${n})`}}}};V_.default=z4});var J1=k(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var W4=X1(),G4=[W4.default];z_.default=G4});var Q1=k(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.contentVocabulary=Fa.metadataVocabulary=void 0;Fa.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fa.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var e$=k(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var Y4=c1(),K4=S1(),X4=K1(),J4=J1(),Z1=Q1(),Q4=[Y4.default,K4.default,(0,X4.default)(),J4.default,Z1.metadataVocabulary,Z1.contentVocabulary];W_.default=Q4});var Y_=k(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.dynamicAnchor=void 0;var G_=ve(),Z4=yn(),t$=Ql(),e9=lm(),t9={keyword:"$dynamicAnchor",schemaType:"string",code:t=>r$(t,t.schema)};function r$(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,G_._)`${Z4.default.dynamicAnchors}${(0,G_.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:r9(t);r.if((0,G_._)`!${i}`,()=>r.assign(i,s))}fu.dynamicAnchor=r$;function r9(t){let{schemaEnv:e,schema:r,self:n}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new t$.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return t$.compileSchema.call(n,l),(0,e9.getValidate)(t,l)}fu.default=t9});var K_=k(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.dynamicRef=void 0;var n$=ve(),n9=yn(),i$=lm(),i9={keyword:"$dynamicRef",schemaType:"string",code:t=>s$(t,t.schema)};function s$(t,e){let{gen:r,keyword:n,it:i}=t;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,n$._)`${n9.default.dynamicAnchors}${(0,n$.getProperty)(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{(0,i$.callRef)(t,c),r.let(l,!0)}):()=>(0,i$.callRef)(t,c)}}pu.dynamicRef=s$;pu.default=i9});var o$=k(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var s9=Y_(),o9=Ee(),a9={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,s9.dynamicAnchor)(t,""):(0,o9.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};X_.default=a9});var a$=k(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});var c9=K_(),l9={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,c9.dynamicRef)(t,t.schema)};J_.default=l9});var c$=k(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});var u9=Y_(),d9=K_(),f9=o$(),p9=a$(),h9=[u9.default,d9.default,f9.default,p9.default];Q_.default=h9});var u$=k(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var l$=gm(),m9={keyword:"dependentRequired",type:"object",schemaType:"object",error:l$.error,code:t=>(0,l$.validatePropertyDeps)(t)};Z_.default=m9});var d$=k(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var g9=gm(),y9={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,g9.validateSchemaDeps)(t)};eS.default=y9});var f$=k(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var T9=Ee(),v9={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,T9.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};tS.default=v9});var p$=k(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var b9=u$(),_9=d$(),S9=f$(),N9=[b9.default,_9.default,S9.default];rS.default=N9});var m$=k(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var ws=ve(),h$=Ee(),k9=yn(),R9={message:"must NOT have unevaluated properties",params:({params:t})=>(0,ws._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},P9={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:R9,code(t){let{gen:e,schema:r,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof ws.Name?e.if((0,ws._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,ws._)`${i} === ${k9.default.errors}`);function c(d){if(r===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,h$.alwaysValidSchema)(s,r)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:h$.Type.Str},f),o||e.if((0,ws.not)(f),()=>e.break())}}function l(d,f){return(0,ws._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let g in d)d[g]===!0&&p.push((0,ws._)`${f} !== ${g}`);return(0,ws.and)(...p)}}};nS.default=P9});var y$=k(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var po=ve(),g$=Ee(),E9={message:({params:{len:t}})=>(0,po.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,po._)`{limit: ${t}}`},w9={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:E9,code(t){let{gen:e,schema:r,data:n,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,po._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,po._)`${o} > ${s}`);else if(typeof r=="object"&&!(0,g$.alwaysValidSchema)(i,r)){let c=e.var("valid",(0,po._)`${o} <= ${s}`);e.if((0,po.not)(c),()=>a(c,s)),t.ok(c)}i.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:g$.Type.Num},c),i.allErrors||e.if((0,po.not)(c),()=>e.break())})}}};iS.default=w9});var T$=k(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});var D9=m$(),C9=y$(),A9=[D9.default,C9.default];sS.default=A9});var b$=k(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.DiscrError=void 0;var v$;(function(t){t.Tag="tag",t.Mapping="mapping"})(v$||(Sm.DiscrError=v$={}))});var S$=k(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var ja=ve(),oS=b$(),_$=Ql(),O9=Jl(),I9=Ee(),M9={message:({params:{discrError:t,tagName:e}})=>t===oS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ja._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:M9,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,ja._)`${r}${(0,ja.getProperty)(a)}`);e.if((0,ja._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:oS.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let g in p)e.elseIf((0,ja._)`${l} === ${g}`),e.assign(c,d(p[g]));e.else(),t.error(!1,{discrError:oS.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let g=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},g);return t.mergeEvaluated(h,ja.Name),g}function f(){var p;let g={},h=S(i),T=!0;for(let R=0;R<o.length;R++){let D=o[R];if(D?.$ref&&!(0,I9.schemaHasRulesButRef)(D,s.self.RULES)){let M=D.$ref;if(D=_$.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,M),D instanceof _$.SchemaEnv&&(D=D.schema),D===void 0)throw new O9.default(s.opts.uriResolver,s.baseId,M)}let B=(p=D?.properties)===null||p===void 0?void 0:p[a];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);T=T&&(h||S(D)),_(B,R)}if(!T)throw new Error(`discriminator: "${a}" must be required`);return g;function S({required:R}){return Array.isArray(R)&&R.includes(a)}function _(R,D){if(R.const)v(R.const,D);else if(R.enum)for(let B of R.enum)v(B,D);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(R,D){if(typeof R!="string"||R in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[R]=D}}}};aS.default=x9});var N$=k((RPe,L9)=>{L9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var k$=k((PPe,q9)=>{q9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var R$=k((EPe,$9)=>{$9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var P$=k((wPe,B9)=>{B9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var E$=k((DPe,F9)=>{F9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var w$=k((CPe,j9)=>{j9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var D$=k((APe,U9)=>{U9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var C$=k(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var H9=N$(),V9=k$(),z9=R$(),W9=P$(),G9=E$(),Y9=w$(),K9=D$(),X9=["/properties"];function J9(t){return[H9,V9,z9,W9,e(this,G9),Y9,e(this,K9)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,X9):n}}cS.default=J9});var A$=k((yt,uS)=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.MissingRefError=yt.ValidationError=yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=yt.Ajv2019=void 0;var Q9=n1(),Z9=e$(),eJ=c$(),tJ=p$(),rJ=T$(),nJ=S$(),iJ=C$(),lS="https://json-schema.org/draft/2019-09/schema",Ua=class extends Q9.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(eJ.default),Z9.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(tJ.default),this.addVocabulary(rJ.default),this.opts.discriminator&&this.addKeyword(nJ.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(iJ.default.call(this,e),this.refs["http://json-schema.org/schema"]=lS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lS)?lS:void 0)}};yt.Ajv2019=Ua;uS.exports=yt=Ua;uS.exports.Ajv2019=Ua;Object.defineProperty(yt,"__esModule",{value:!0});yt.default=Ua;var sJ=Xl();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:function(){return sJ.KeywordCxt}});var Ha=ve();Object.defineProperty(yt,"_",{enumerable:!0,get:function(){return Ha._}});Object.defineProperty(yt,"str",{enumerable:!0,get:function(){return Ha.str}});Object.defineProperty(yt,"stringify",{enumerable:!0,get:function(){return Ha.stringify}});Object.defineProperty(yt,"nil",{enumerable:!0,get:function(){return Ha.nil}});Object.defineProperty(yt,"Name",{enumerable:!0,get:function(){return Ha.Name}});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:function(){return Ha.CodeGen}});var oJ=tm();Object.defineProperty(yt,"ValidationError",{enumerable:!0,get:function(){return oJ.default}});var aJ=Jl();Object.defineProperty(yt,"MissingRefError",{enumerable:!0,get:function(){return aJ.default}})});var Ga=require("path"),We=$(aE());var tf=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=lE(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=cE(n.text,!1,s);if(c-a===u.length)for(let f=0,p=u.length;f<p;f++)l[f+a+1]=u[f];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=n.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=cE(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},Kn;(function(t){function e(i,s,o,a){return new tf(i,s,o,a)}t.create=e;function r(i,s,o){if(i instanceof tf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let o=i.getText(),a=Ay(s.map(Uj),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=i.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=i.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=n})(Kn||(Kn={}));function Ay(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Ay(n,e),Ay(i,e);let s=0,o=0,a=0;for(;s<n.length&&o<i.length;)e(n[s],i[o])<=0?t[a++]=n[s++]:t[a++]=i[o++];for(;s<n.length;)t[a++]=n[s++];for(;o<i.length;)t[a++]=i[o++];return t}function cE(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function lE(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Uj(t){let e=lE(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var rf=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],nf=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Iy=$(require("url")),dE=require("crypto"),fE=require("path"),nn=$(H());var Oy=$(H());var Dr=$(H());var Q=class{constructor(e){this._children=[];this.syntaxIssues=[];this.resetableIssues=[];this._firstToken=e?.start,this._lastToken=e?.end}get issues(){return[...this.syntaxIssues,...this.resetableIssues]}resetIssues(){this.resetableIssues=[],this.children.forEach(e=>e.resetIssues())}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._firstToken??this._children[0].firstToken}set firstToken(e){this._firstToken=e}get lastToken(){return this._lastToken??this._children[this._children.length-1]?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return le(e,this.uri)?[this]:this.children.flatMap(r=>r.getTopMostAstNodeForFile(e))}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getDocumentSymbols(e)??[]);if(!le(this.uri,e))return[];let r=fe(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:r,selectionRange:r,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Dr.SymbolKind.File,Dr.SymbolKind.Class,Dr.SymbolKind.Constant].some(n=>n===e))return[];let r=fe(this);return[{location:Dr.Location.create(he(this.uri),r),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(n=>n.getWorkspaceSymbols()??[]).filter(n=>n.kind===Dr.SymbolKind.File||n.kind===Dr.SymbolKind.Class||n.kind===Dr.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(r=>r.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(bi(this.semanticTokenType),_i(this.semanticTokenModifiers),this.firstToken,this.lastToken)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this._children.push(e)),this.allDescendantsCache=void 0}isAncestorOf(e){return this.children.some(r=>r===e||r.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Dr.Range.create(Dr.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Dr.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}get serializeUri(){return he(this.uri)}serialize(e){return{uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var we=class extends Q{toJson(){return-1}#e;resolve(e){return this.#e??=sf(this.toString(),e),this.#e}#t;evaluate(e){return this.#t??=De(`${this.operator?this.operator.toString():""}${this.resolve(e)}`),this.#t}#n;isTrue(e){return this.#n??=De(`!!(${this.operator?this.operator.toString():""}${this.resolve(e)})`),this.#n}toPrettyString(e){let r=this.evaluate(e);return`${r.toString()} /* ${this.toString()}${typeof r=="number"?` = 0x${r.toString(16)}`:""} */`}serialize(e){return{type:"EXPRESSION",value:this.toString(),evaluated:this.evaluate(e),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Xn=class extends we{constructor(r,n,i){super();this.expression=r;this.wrapped=n;this.addChild(r),i&&(this.addChild(i.operator),this.addChild(i.expression),this.join=[],this.join?.push(i))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(r,n){this.addChild(r),this.addChild(n),this.join??=[],this.join?.push({operator:r,expression:n})}toString(){let r=this.children.map(n=>n.toString()).join(" ");return this.wrapped?`(${r})`:`${r}`}isTrue(r){let n=`(${this.children.map(i=>i instanceof we?i.resolve(r):i.toString()).join(" ")})`;return De(`!!(${this.operator?this.operator.toString():""}${n})`)}};var Jn=class extends we{constructor(r,n,i){super(n);this.value=r;this.docSymbolsMeta={name:`param${i+1}`,kind:Oy.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Si=class extends we{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return le(this.uri,r)?[{name:this.functionName.name,kind:Oy.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(r)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(r=>r?.toString()??"<NULL>").join(",")})`}isTrue(r){if(this.functionName.name==="defined"){let n=!!(this.params.length===1&&this.params[0]&&r.has(this.params[0].value));return this.operator?De(`!!(${this.operator}${n})`):n}return super.isTrue(r)}};var zr=(t,e,r=!0,n=!0)=>({start:{line:t?.pos.line??0,character:r?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var fe=t=>zr(t.firstToken,t.lastToken),bi=t=>rf.findIndex(e=>e===t),_i=t=>nf.findIndex(e=>e===t),My=(t,e,r)=>!le(t.uri,e)||r.line<t.pos.line?!1:r.line>t.pos.line?!0:r.character>=t.pos.colEnd,Vj=(t,e,r)=>le(t.uri,e)?r.line<t.pos.line?!0:r.line>t.pos.line?!1:r.character<t.pos.col:!1,on=(t,e,r)=>{let n=t.firstToken,i=t.lastToken;return!!((n.pos.line<r.line||n.pos.line===r.line&&n.pos.col<=r.character)&&(i.pos.line>r.line||i.pos.line===r.line&&i.pos.colEnd>=r.character)&&le(t.uri,e))},pE=(t,e)=>{let r=(i,s)=>i.line<s.line||i.line===s.line&&i.character<=s.character,n=(i,s)=>i.line>s.line||i.line===s.line&&i.character>=s.character;return r(t.start,e.start)&&n(t.end,e.end)},hE=(t,e,r)=>{let n=t.firstToken,i=t.lastToken;return!!(t.lastToken.value!==";"&&(n.pos.line===r.line||i.pos.line===r.line)&&r.character>=i.pos.colEnd&&le(t.uri,e))},mE=(t,e,r)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===r.line).at(-1);return i&&i.pos.col>=r.character?!1:e.lastToken===i};var Qn=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>on(s,e,r));return n},mc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].find(s=>Vj(s.lastToken,e,r));return n===t?void 0:n},gc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>My(s.firstToken,e,r));return n===t?void 0:n},W=(t,e,r=e,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l,inclusiveStart:u,inclusiveEnd:d}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let f=zr(e,r,u,d),p={issues:Array.isArray(t)?t:[t],range:f,uri:e.uri,severity:i,linkedTo:s.map(({range:T,uri:S})=>({range:T,uri:S,templateStrings:[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},g,h=()=>(g??={severity:p.severity,range:f,message:p.issues?p.issues.map(Gj).join(" or "):"",source:"devicetree",tags:p.tags,data:{firstToken:{pos:e.pos,tokens:e.tokens,value:e.value},lastToken:{pos:r.pos,tokens:r.tokens,value:r.value},type:"SyntaxIssue",items:p.issues,edit:p.edit,codeActionTitle:p.codeActionTitle}},g);return n?.syntaxIssues.push(h),{raw:p,diagnostic:h}},Lt=(t,e,r,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l,linkedToTemplateStrings:u=[]}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[],linkedToTemplateStrings:[]})=>{let d=zr(e,r),f={issues:Array.isArray(t)?t:[t],range:d,uri:e.uri,severity:i,linkedTo:s.map(({range:h,uri:T},S)=>({range:h,uri:T,templateStrings:u.at(S)??[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},p,g=()=>(p??={severity:f.severity,range:d,message:Yj(f),source:"devicetree",tags:f.tags,relatedInformation:[...f.linkedTo.map(h=>({message:f.issues.map(T=>Kj(T,h.templateStrings)).join(" or "),location:{uri:he(h.uri),range:h.range}}))]},p);return n?.resetableIssues.push(g),{raw:f,diagnostic:g}},j=(t,e,r,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let u=zr(e,r),d={issues:Array.isArray(t)?t:[t],range:u,severity:i,uri:e.uri,linkedTo:s.map(({range:g,uri:h})=>({range:g,uri:h,templateStrings:[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},f,p=()=>(f??={severity:d.severity,range:u,message:Xj(d),relatedInformation:[...d.linkedTo.map(g=>({message:d.issues.map(Jj).join(" or "),location:{uri:he(g.uri),range:g.range}}))],source:"devicetree",tags:d.tags,data:{type:"StandardTypeIssue",firstToken:{pos:e.pos,tokens:e.tokens,value:e.value},lastToken:{pos:r.pos,tokens:r.tokens,value:r.value},edit:d.edit,codeActionTitle:d.codeActionTitle,items:d.issues}},f);return n?.resetableIssues.push(p),{raw:d,diagnostic:p}};function Cr(t,e,r,{severity:n=nn.DiagnosticSeverity.Warning,linkedTo:i=[],tags:s,templateStrings:o=[],edit:a,codeActionTitle:c}={severity:nn.DiagnosticSeverity.Warning,linkedTo:[],templateStrings:[],edit:[],codeActionTitle:void 0},l=r){let u=nn.Range.create(r,l),d={issues:Array.isArray(t)?t:[t],range:u,severity:n,uri:e,linkedTo:i.map(({range:g,uri:h})=>({range:g,uri:h,templateStrings:[]})),tags:s,templateStrings:o,edit:a,codeActionTitle:c},f;return{raw:d,diagnostic:()=>(f??={severity:d.severity,range:u,message:Qj(d),relatedInformation:[...d.linkedTo.map(g=>({message:d.issues.map(Zj).join(" or "),location:{uri:he(g.uri),range:g.range}}))],source:"devicetree",tags:d.tags,data:{type:"FormattingIssues",items:d.issues,edit:d.edit,codeActionTitle:d.codeActionTitle}},f)}}var gE=(t,e)=>[...t].sort((n,i)=>{let s=e.getSortKey(n),o=e.getSortKey(i);if(s===void 0||o===void 0)throw new Error("Sort keys must be set");if(s!==o)return s-o;let a=n.lastToken,c=i.lastToken;return a.pos.line!==c.pos.line?a.pos.line-c.pos.line:a.pos.col-c.pos.col});async function _t(t,e,r){let n=Re(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(n,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),r(o,l=>{let u=t.position;if(le(l.uri,n)){let d=l.lastToken;return d.pos.line<u.line||d.pos.line===u.line&&d.pos.colEnd<=u.character}return a!==void 0&&(e.getSortKey(l)??-1)<=a})}function oe(t,e){return{start:t,end:e??t}}var U=(t,e)=>t?.tokens.some(r=>r===e),Ze=(t,e)=>r=>r?.value&&(e?.caseInsensitive?t.toLowerCase()===r.value.toLowerCase():t===r.value)?"yes":e?.allowPartial?zj(t)(r):"no",Ie=t=>e=>e?.tokens.some(r=>r===t)?"yes":"no",zj=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",Cn=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&le(t.uri,e.uri),qt=(t,e)=>t?.tokens[0]===21&&e?.tokens[0]===21&&(t?.prevToken&&t.prevToken.value===e?.value||e?.prevToken&&e.prevToken.value===t?.value)?!0:!!t&&!!e&&t.pos.colEnd===e.pos.col&&Cn(t,e),cf=t=>t.map((e,r)=>({index:r,context:e,files:e.getContextFiles()})),an=(t,e,r,n)=>{if("id"in e){let s=t?.find(o=>o.id===e.id);return s||void 0}if("name"in e){let s=t?.find(o=>o.ctxNames.includes(e.name));return s||void 0}return r?.getContextFiles().find(s=>le(s,e.uri))?r:cf(t).sort(s=>s.context.id===n?-1:0).find(s=>s.files.some(o=>le(o,e.uri)))?.context},xy=(t,e)=>cf(t).filter(n=>n.files.some(i=>le(i,e))).map(n=>n.context),yE=t=>{let e=/^(\w+)\s+(.+)$/,r=/^(\w+)\(([^)]*)\)\s+(.+)$/,n=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;if(i=n.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(i=r.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},sf=(t,e)=>{let r=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),n=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=r(s),i=n(i),i=i.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(i!==s);return i};function Wj(t){return t.replace(/'(.)'/g,(e,r)=>r.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function De(t){try{return(0,eval)(Wj(t))}catch(e){console.log(e instanceof Error?e.message:e)}return t}var he=t=>Iy.default.pathToFileURL(t).toString(),Re=t=>nt(Iy.default.fileURLToPath(t)),le=(t,e)=>!t||!e?!1:t===e,nt=t=>(0,fE.normalize)(process.platform==="win32"?t.toLowerCase():t),Ni=t=>(0,dE.createHash)("sha256").update([nt(t.dtsFile),...t.includePaths.map(nt),...t.overlays.map(nt),t.bindingType,...t.zephyrBindings.map(nt),...t.deviceOrgBindingsMetaSchema.map(nt),...t.deviceOrgTreeBindings.map(nt),`showFormattingErrorAsDiagnostics-${t.showFormattingErrorAsDiagnostics}`].join(":")).digest("hex"),Gj=t=>{switch(t){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 49:return"Node name shall start with a lower or upper case character";case 50:return"Node unit address should not start with 0x";case 51:return"Node unit address should not end with with ULL";case 8:return"Expected node address";case 9:return"Expected node path";case 48:return"Expected node path reference";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";case 36:return"Unable to resolve include";case 52:return"Unknown Node Address syntax";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},Yj=t=>t.issues.map(e=>{switch(e){case 0:return`Property "${t.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 "${t.templateStrings[0]}" has been defined`;case 8:return`No node with name "${t.templateStrings[0]}" could be found in "/${t.templateStrings[1]}".`;case 4:return`Label name "${t.templateStrings[0]}" already defined`;case 6:return`Property "${t.templateStrings[0]}" was deleted`;case 7:return`Node "${t.templateStrings[0]}" was deleted`;case 9:return`The following node "${t.templateStrings[1]}" shall be present in "${t.templateStrings[0]}" node.`;case 10:return`The following node "${t.templateStrings[0]}" address range collides with another node. Address start: "${t.templateStrings[1]}", end: "${t.templateStrings[2]}".`}}).join(" or "),Kj=(t,e)=>{switch(t){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";case 10:return`Node "${e[0]}". Address start: "${e[1]}", end: "${e[2]}".`;default:return"TODO"}},Xj=t=>t.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${t.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 ${t.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 27:return"INTRO name is not permitted under this node";case 34:return"INTRO name is not defined in the type binding for this node";case 10:return"INTRO address 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 ${t.templateStrings[1]}'`;case 18:return"INTRO value must be unique in the entire Devicetree";case 19:return`INTRO should have format ${t.templateStrings[1]}`;case 16:return`INTRO requires property "${t.templateStrings[1]}" in node path "${t.templateStrings[2]}"`;case 17:return"Unable to resolve interrupt parent node";case 20:return`INTRO should have format ${t.templateStrings[1]}`;case 21:return"Node is disabled";case 22:return"Unable to resolve handle";case 23:return`Unable to find "${t.templateStrings[0]}" in ${t.templateStrings[1]}`;case 24:return t.templateStrings[0];case 25:return t.templateStrings[0];case 26:return t.templateStrings[0];case 28:return t.templateStrings[0];case 35:return"Unable to find mapping range for address";case 29:return`INTRO exceeds address space available for this mapping. The range ends at ${t.templateStrings[2]}, the node ends at ${t.templateStrings[1]}`;case 30:return"Map entry overlaps with others entries";case 31:return"Unable to match to a nexus map entry";case 32:return`Unknown node type "${t.templateStrings[0]}"`;case 33:return`Missing name for "${t.templateStrings[0]}" index ${t.templateStrings[1]}"`;case 36:return"Node address is missing";case 37:return`Binding should be used on bus type${t.templateStrings.length?"s":""}: ${t.templateStrings.join(" or ")}`}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),Jj=t=>{switch(t){case 16:case 0:return"Node";case 15:return"Ignored reason";case 18:return"Conflicting properties";case 8:return"Additional value";case 21:return"Disabled by";case 29:return"Mapping range";case 30:return"Map entry";case 31:return"Nexus map entries";case 33:return"Names property";case 35:return"Range property";default:return"TODO"}},Qj=t=>t.issues.map(e=>{switch(e){case 4:return"Add end of line to end of file";case 1:return`Expecting ${t.templateStrings[0]} space(s).`;case 0:return"Move to a new line";case 3:return"Remove trailing whitespace at the end of file.";case 2:return"Remove trailing whitespace at the end of the line.";case 5:return`Expecting ${t.templateStrings[0]} new line(s)`;case 6:return`Fix indentation. Expecting ${t.templateStrings[0]}`;case 7:return`Expecting ${t.templateStrings[0]} space(s).`;case 8:return`Move token "${t.templateStrings[0]}" next to expression`;case 9:return"Remove (...) enclosure. This expression should only be enclosed in the #define of the macro"}}).join(" or "),Zj=t=>"TODO",sn=(t,e)=>{let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[t.length-r+n]??0,s=e[e.length-r+n]??0;if(i<s)return-1;if(i>s)return 1}return 0},Ji=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;n[r-1-s]=c>>>0,i=c>4294967295?1:0}return i&&n.unshift(1),n},eU=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0;o-=i,o<a?(o+=4294967296,i=1):i=0,n[r-1-s]=o-a>>>0}for(;n.length>1&&n[0]===0;)n.shift();return n},tU=(t,e)=>Ji(t,e),TE=(t,e)=>{let r=[];for(let n of t){let i=n.childAddress,s=n.length,o=Ji(i,s);if(sn(e,i)>=0&&sn(e,o)<0){let a=eU(e,i),c=n.parentAddress,l=tU(c,a),u=Ji(c,s);r.push({start:l,end:u,range:zr(n.rangeTokens.start,n.rangeTokens.end),uri:n.rangeTokens.start.uri})}}return r};function vE(t){return Array.isArray(t)&&Array.isArray(t[0])}function yc(t){return!t||t instanceof Si?t:yc(t.parentNode)}function bE(t,e){let r=t.getText(),n=e.slice().sort((s,o)=>{let a=t.offsetAt(s.range.start),c=t.offsetAt(o.range.start);if(a!==c)return c-a;let l=t.offsetAt(s.range.end),u=t.offsetAt(o.range.end);if(l!==u)return u-l;let d=a===l&&s.newText.length>0,f=c===u&&o.newText.length>0;return d!==f?d?1:-1:0}),i=r;for(let s of n){let o=t.offsetAt(s.range.start),a=t.offsetAt(s.range.end);i=i.slice(0,o)+s.newText+i.slice(a)}return i}function uE(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}function _E(t,e){return uE(t.end,e.start)>0&&uE(t.start,e.end)<0}var SE=(t,e)=>{let r=NE(t,e),n=kE(t,e);r&&(t.topComment=r.comment),n&&(t.endComment=n.comment)},NE=(t,e)=>{let r=e.find(i=>i.lastToken===t.firstToken.prevToken&&(i.lastToken.pos.line===t.firstToken.pos.line||i.lastToken.pos.line+1===t.firstToken.pos.line));if(!r||r.astBeforeComment)return;r.astAfterComment=t;let n=NE(r,e);return n&&(n.comment.astAfterComment=t,r.astAfterComment=void 0),{comment:n?.comment??r,commentIsBefore:!0}},kE=(t,e)=>{let r=e.find(i=>i.firstToken.prevToken===t.lastToken&&i.firstToken.pos.line===t.lastToken.pos.line);if(!r)return;r.astBeforeComment=t;let n=kE(r,e);return n&&(n.comment.astBeforeComment=t,r.astBeforeComment=void 0),{comment:n?.comment??r,commentIsBefore:!1}},Vo=(t,e,r)=>{let n=[42,44,45,36];return r||n.push(52,32,8,49),t.severity===nn.DiagnosticSeverity.Error&&le(t.uri,e)&&!n.some(i=>t.issues.includes(i))};function lf(t){let e=t?.charAt(0);return!!e&&(e>="A"&&e<="Z"||e>="a"&&e<="z")}var Oc=require("fs"),BD=require("path");var An=$(H());var DE=$(H());var RE=$(H());var ne=class extends Q{constructor(r,n){super(n);this.value=r;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:RE.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return{type:"STRING",value:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var EE=$(H());var PE=$(H());var cr=class extends we{constructor(r,n,i=10){super(n);this.value=r;this.radix=i;this.docSymbolsMeta={name:this.value.toString(),kind:PE.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}resolve(r){return this.value.toString()}evaluate(r){return this.value}isTrue(r){return!!this.value}toString(r){return this.value.toString(r??this.radix)}toJson(){return this.value}toPrettyString(r){let n=this.value;return this.radix==16?`0x${n.toString(16)} /* ${typeof n=="number"?`${n.toString(10)}`:""} */`:`${n.toString(10)} /* ${typeof n=="number"?`0x${n.toString(16)}`:""} */`}serialize(){return{type:"NUMBER_VALUE",value:`${this.radix===16?"0x":""}${this.toString()}`,evaluated:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var jt=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Cell Array",kind:EE.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`<${this.values.map(r=>r.toString()).join(" ")}>`}toPrettyString(r){return`<${this.values.map(n=>n.toPrettyString(r)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(r=>r.value instanceof cr)){let r=new ArrayBuffer(8),n=new DataView(r);return this.values.map(i=>i.value.value).forEach((i,s)=>{n.setUint32(s*4,i)}),n.getBigUint64(0)}return this.values.map(r=>r.value?.toJson()??NaN)}serialize(r){return{type:"ARRAY_VALUE",value:this.values.map(n=>n.value?.serialize(r)??null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var wE=$(H());var ki=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Byte String Value",kind:wE.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(r=>r.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(r=>r.value?.toJson()??NaN)}serialize(){return{type:"BYTESTRING",values:this.values.map(r=>r.value?{value:r.value.toString(16),range:r.value.range,evaluated:r.value.value}:null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var et=class extends Q{constructor(r,n){super(n);this.name=r;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return{value:this.name,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ke=class extends Q{constructor(r,n=[]){super();this.propertyName=r;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:DE.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(r)}set values(r){if(this._values)throw new Error("Only one property name is allowed");this._values=r,this.addChild(r)}get values(){return this._values}get quickValues(){return this.values?.values.map(r=>r?r.value instanceof ne?r.value.value:r.value instanceof jt?r.value.values.map(n=>n.value instanceof cr?n.value.value:NaN):r.value instanceof ki?r.value.values.map(n=>n.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(r=>r?r.value instanceof ne?r.value:r.value instanceof jt?r.value.values.map(n=>n.value):r.value instanceof ki?r.value.values.map(n=>n.value):r.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(r){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toPrettyString(r)??"NULL").join(", ")??"NULL"}`:""};`}serialize(r){return{name:this.propertyName?.serialize()??null,values:this.values?.values.map(n=>n?.value?.serialize(r)??null)??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var CE=$(H());var Tr=class extends Q{constructor(r,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:r,kind:CE.SymbolKind.Function}}};var Ar=class extends Tr{constructor(r){super("Delete Node",r);this._nodeNameOrRef=null}set nodeNameOrRef(r){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=r,this.addChild(r)}get nodeNameOrRef(){return this._nodeNameOrRef}};var ht=class extends Tr{constructor(r){super("Delete Property",r);this._propertyName=null}set propertyName(r){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=r,this.addChild(r)}get propertyName(){return this._propertyName}};var AE=$(H());var ie=class extends Q{constructor(r){super();this.label=r;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:AE.SymbolKind.Key},this.addChild(r)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return{type:"LABEL_REF",label:this.label?.toString()??null,nodePath:this.linksTo?.pathString??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var lt=class t extends Q{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof St)return[this.pathName];if(!(this.parentNode instanceof t))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof t)}get deleteNodes(){return this.children.filter(e=>e instanceof Ar)}addNodeChild(e){this.addChild(e)}},St=class extends lt{constructor(){super(),this.docSymbolsMeta={name:"/",kind:An.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ke)}get name(){return new Me("/",oe(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof ht)}get nodes(){return this.children.filter(e=>e instanceof He)}get pathName(){return"/"}serialize(e){return{type:"ROOT",properties:this.properties.map(r=>r.serialize(e)),nodes:this.nodes.map(r=>r.serialize(e)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Wt=class extends lt{constructor(r=[]){super();this.labels=r;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:An.SymbolKind.Class},r.forEach(n=>{super.addChild(n)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(r=>r())}set reference(r){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=r;let n;r instanceof ie?n=r.value:n=r?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:n??"DTC Name",kind:An.SymbolKind.Class},this.addChild(r)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(r=>r instanceof He)}get pathName(){if(this.reference instanceof ie&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(r=>r instanceof Ke)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"REF",name:this.reference?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},He=class t extends lt{constructor(r=[],n){super();this.labels=r;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:An.SymbolKind.Class},n&&this.addChild(n),r.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(r=>r())}set name(r){if(this._name)throw new Error("Only on label reference is allowed");this._name=r,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:An.SymbolKind.Class},this.addChild(r)}get name(){return this._name}get nodes(){return this.children.filter(r=>r instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(r=>r instanceof Ke)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"CHILD",name:this.name?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Tc=class extends Q{constructor(r,n){super(n);this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((r,n)=>r.toString(16).padStart(n?8:0,"0")).join("")??"NaN"}serialize(){return{address:this.address,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Me=class extends Q{constructor(r,n,i){super(n);this.name=r;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(r){if(this._address)throw new Error("Address can only be set once");r&&(this.lastToken=void 0,this._address=r,r.forEach(n=>this.addChild(n)))}get fullAddress(){return this._address?[...this._address.flatMap(r=>r.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(r=>r.toString()).join(",")}`:this.name}buildSemanticTokens(r){let n=this.firstToken;if(!n.value)return;let i={...n,pos:{...n.pos,len:this.name.length}};r(bi("type"),_i("declaration"),i,i),this.address!==void 0&&this.address.forEach(s=>{r(bi("decorator"),_i("declaration"),s.firstToken,s.lastToken),s.buildSemanticTokens(r)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(r=>r.issues)??[]].map(r=>r())}serialize(){let r=this.firstToken;return{fullName:this.toString(),name:{name:this.name,uri:this.serializeUri,range:An.Range.create(An.Position.create(r.pos.line,r.pos.col),An.Position.create(r.pos.line,r.pos.colEnd)),issues:this.serializeIssues},address:this.address?.map(n=>n.serialize())??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var $D=require("path"),dn=$(H());var vr=class extends Q{constructor(r,n,i,s){super();this.startLabels=r;this.value=n;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(n),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toPrettyString(r){return`${[this.value?.toPrettyString(r)??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Ut=t=>t instanceof Tr?!0:t instanceof lt?!1:t.parentNode?Ut(t.parentNode):!1;var Ly=t=>{if(t instanceof Ke)return t;if(!(t instanceof lt))return t.parentNode?Ly(t.parentNode):void 0},Hs=t=>!t||t instanceof Ke?!1:t instanceof vr||Hs(t.parentNode),zo=t=>[...t.map(e=>{if(e instanceof He||e instanceof St)return e.name;if(e instanceof Wt)return e.reference})].filter(e=>!!e),qy=(t,e)=>e?e.parentNode===t||qy(t,e.parentNode):!1;var Et=$(H());var OE=$(H());var On=class extends Q{constructor(){super();this._pathParts=[]}addPath(r,n){this._pathParts.push(r),n&&this.addChild(n),this.addChild(r)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(r=>r?.toString()??"<NULL>").join("/")}buildSemanticTokens(r){this._children.forEach(n=>{n instanceof Me?n.buildSemanticTokens(r):r(bi("operator"),_i("declaration"),n.firstToken,n.lastToken)})}},it=class extends Q{constructor(r){super();this.path=r;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:OE.SymbolKind.Namespace},this.addChild(r)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return{type:"NODE_PATH",nodePath:this.path?.toString()??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Z=$(H());var IE=require("path"),uf=$(H());var Ri=class extends Q{constructor(r,n){super();this.keyword=r;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:uf.SymbolKind.File},this.addChild(r),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(r){this.docSymbolsMeta={name:`Include ${r}`,kind:uf.SymbolKind.File},this._resolvedPath=r}},Wo=class extends Q{constructor(r,n,i){super(i);this._path=r;this.relative=n;this.docSymbolsMeta={name:(0,IE.basename)(this.path),kind:uf.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var cn=class extends Q{constructor(r){super();this.comments=r;r.forEach(this.addChild.bind(this))}toString(){return this.comments.map(r=>r.toString()).join(`
183
- `)}},ln=class extends Q{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}toString(){let e,r=this.firstToken,n="";for(;r!==this.lastToken;)n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "),e=r,r=r?.nextToken;r&&(n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "));let i=n.match(/^\s*(?:(?:\/\/|\/\*+)\s*)?(.*?)\s*(?:\*\/)?\s*$/s);return i?i[1]:""}};var ME=$(H());var Dt=class extends we{constructor(r,n){super(n);this.name=r;this.docSymbolsMeta={name:this.name.toString(),kind:ME.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Nf=$(H());var $y=$(H());var Qi=class extends Q{constructor(r,n){super(n);this.label=r;this.docSymbolsMeta={name:this.label.value,kind:$y.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(r)}toString(){return`${this.label.toString()}:`}},Zt=class extends Q{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value,kind:$y.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(r){let n=this.parentNode;if(!(n instanceof ie&&n.linksTo)){super.buildSemanticTokens(r);return}r(bi("type"),_i("declaration"),this.firstToken,this.lastToken)}toString(){return`${this.value}`}};var ut=class extends Q{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var xE=$(H());var df=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Values",kind:xE.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}toString(){return this.values.map(r=>r?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(r=>r?.toJson())}};var LE=$(H());var ff=class extends Q{constructor(r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:"DTS Document version",kind:LE.SymbolKind.Function}}};var Zn=class extends Q{constructor(r,n){super();this.value=r;this.labels=n;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toString(r)??"NULL"}`}toPrettyString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toPrettyString(r)??"NULL"}`}};var pf=class extends Q{constructor(r,n){super(n);this.operator=r;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var qE=$(H());var hf=class extends ut{toString(){return"..."}},ei=class extends Q{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return le(this.uri,r)?[{name:this.functionName.name,kind:qE.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n.getDocumentSymbols(r))}]:[]}toString(){return`${this.functionName}(${this.params.map(r=>r.toString()).join(",")})`}};var Zi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,r=!0,n=!1)=>{let i=e.pos.line;if(this.currentToken?.pos.line!==i||!le(this.currentToken?.uri,e.uri))return;let s=this.currentToken,o=s;for(;this.currentToken?.pos.line===i&&le(this.currentToken?.uri,e.uri);)o=this.moveToNextToken;return r&&this._issues.push(W(22,s,o,null)),n&&o?.value==="\\"&&o.nextToken?this.moveEndOfLine(o.nextToken,r):o};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;if(e)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(),r=this.positionStack.pop();if(r===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=r}peekIndex(e=1){let r=this.positionStack.at(-1*e);if(r===void 0)throw new Error("Index out of bounds");return r}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let r=[];return e.every(n=>{let i=this.currentToken,s=n(i),o=!1;return s!=="no"&&i&&(r.push(i),this.moveToNextToken,o=qt(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),r}consumeAnyConcurrentTokens(e){this.enqueueToStack();let r=[],n,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)r.push(this.currentToken),n=this.moveToNextToken,i=qt(n,this.currentToken);return this.mergeStack(),r}getDocumentSymbols(e){return this.allAstItems.flatMap(r=>r.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,r){let n=[],i=(s,o,a,c)=>{if(!a||!c||!le(a.uri,r)||!le(c.uri,r))return;let l=c.pos.colEnd-a.pos.col;n.push({line:a.pos.line,char:a.pos.col,length:c===a?c.pos.len:l,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(i)}),n.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(e,r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!n.length){this.popStack();return}if(!n?.[0]?.value.match(/^[_A-Za-z]/)){this.popStack();return}let i=n.map(o=>o.value).join(""),s=new Dt(i,oe(n[0],n.at(-1)));return!r&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(W(42,s.firstToken,s.lastToken,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let r=e,n;if(U(e,40)?(n="&",U(this.currentToken,40)&&(n="&&",r=this.moveToNextToken)):U(e,6)?(n="!",U(this.currentToken,0)&&(n="!=",r=this.moveToNextToken)):U(e,10)?n="~":U(e,8)?(n="|",U(this.currentToken,8)&&(n="||",r=this.moveToNextToken)):U(e,9)?n="^":U(e,4)?(n=">",U(this.currentToken,4)?(n="<<",r=this.moveToNextToken):U(this.currentToken,0)&&(n=">=",r=this.moveToNextToken)):U(e,5)?(n="<",U(this.currentToken,5)?(n=">>",r=this.moveToNextToken):U(this.currentToken,0)&&(n="<=",r=this.moveToNextToken)):U(e,15)?n="+":U(e,16)?n="-":U(e,17)?n="*":U(e,13)?n="/":U(e,18)?n="%":U(e,46)?U(this.currentToken,46)&&(n="##",r=this.moveToNextToken):U(e,0)&&U(this.currentToken,0)&&(n="==",r=this.moveToNextToken),n){let i=new pf(n,oe(e,r));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,r,n){this.enqueueToStack();let i=this.moveToNextToken;if(!i||!e(i)){this.popStack();return}let s=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=s},a=g=>g.flatMap(h=>"items"in h?a(h.items):h),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!r(d);){if(n?.(d)){let g=this.peekIndex()+1,h=()=>{this.positionStack[this.positionStack.length-1]=g};c.push(d),l.push(d),u[u.length]={rewind:h,tokens:[]}}else if(e(d)){let g=this.parseScopedBlock(e,r,n);g&&(c.push(g),u[u.length-1].tokens.push(...a(g.items))),d=this.currentToken;continue}else c.push(d),u[u.length-1].tokens.push(d);this.moveToNextToken,d=this.currentToken}let f=d;f&&r(f)&&(this.moveToNextToken,c.push(f));let p={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),p}isFunctionCall(e){this.enqueueToStack();let r=this.processCIdentifier(e,!1);if(!r){this.popStack();return}if(!qt(r.lastToken,this.currentToken)){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}if(r.name==="defined")n.length>1?this._issues.push(W(44,r.firstToken,r.lastToken,r)):n.length<1&&this._issues.push(W(45,r.firstToken,r.lastToken,r));else{let s=e.get(r.name)?.macro;s&&(s?.identifier instanceof ei?n.length>s.identifier.params.length?this._issues.push(W(44,r.firstToken,r.lastToken,r,{linkedTo:[s]})):n.length<s.identifier.params.length&&this._issues.push(W(45,r.firstToken,r.lastToken,r,{linkedTo:[s]})):this._issues.push(W(43,r.firstToken,r.lastToken,r)))}let i=new Si(r,n);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([Ze("0"),Ze("x",{caseInsensitive:!0})]);if(e.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(Ie));if(!r.length){this.popStack();return}let n=Number.parseInt(r.map(s=>s.value).join(""),16),i=new cr(n,oe(e[0],r.at(-1)),16);return this.mergeStack(),i}processDec(e=!1){this.enqueueToStack();let r;e&&(U(this.currentToken,16)||U(this.currentToken,15))&&qt(this.currentToken,this.currentToken?.nextToken)&&(r=this.moveToNextToken);let n=this.consumeAnyConcurrentTokens([19].map(Ie));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(o=>o.value).join(""),10);r&&U(r,16)&&(i=4294967295-i);let s=new cr(i,oe(r??n[0],n.at(-1)),10);return this.mergeStack(),s}processEnclosedExpression(e,r){this.enqueueToStack();let n,i;if(U(this.currentToken,42)){let s;n=this.moveToNextToken,i=n;let o=this.processExpression(e,r,!0);return o&&(s=new Xn(o,!0),o=new Xn(s,!1),s.openBracket=n),U(this.currentToken,43)?(i=this.moveToNextToken,s&&(s.closeBracket=i)):n&&this._issues.push(W(26,n,n,r)),this.mergeStack(),o}this.popStack()}processExpression(e,r,n=!1){this.enqueueToStack();let i,s;if(n&&(s=this.isOperator()),i=this.processEnclosedExpression(e,r)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(!0),!i){this.popStack();return}if(s&&(i.operator=s),n){let o=this.isOperator();for(;o;){let a=this.processExpression(e,r,!0);a?i instanceof Xn?i.addExpression(o,a):i=new Xn(i,!1,{operator:o,expression:a}):this._issues.push(W(27,o.firstToken,o.lastToken,r)),o=this.isOperator()}}return this.mergeStack(),i}processMacroCallParams(){if(!U(this.currentToken,42))return;let e=this.parseScopedBlock(n=>!!U(n,42),n=>!!U(n,43),n=>!!U(n,24));return e?.items.length===2&&U(e.endToken,43)?[]:e?.splitTokens.map((n,i)=>{if(n.tokens.length===0)return null;let s=new Jn(n.tokens.map((o,a)=>{let c=o.value;return o.pos.line===n.tokens.at(a+1)?.pos.line?c=c.padEnd(n.tokens[a+1].pos.col-o.pos.col," "):o.value==="\\"&&(c=c.slice(0,-1)),c}).join(""),oe(n.tokens[0],n.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var jy=require("fs"),Ko=require("path"),Rc=$(H());var bc=require("fs");var Go=class t{constructor(e,r){this.text=e;this.uri=r;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this._tokens=[];let n=this.text.replace(/\r\n/g,`
182
+ deps: ${r}}`};var n4={keyword:"dependencies",type:"object",schemaType:"object",error:pi.error,code(t){let[e,r]=i4(t);D1(t,e),A1(t,r)}};function i4({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function D1(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,du.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,du.checkReportMissingProp)(t,l)}):(r.if((0,D_._)`${c} && (${(0,du.checkMissingProp)(t,a,s)})`),(0,du.reportMissingProp)(t,s),r.else())}}pi.validatePropertyDeps=D1;function A1(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,r4.alwaysValidSchema)(s,e[a])||(r.if((0,du.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}pi.validateSchemaDeps=A1;pi.default=n4});var O1=k(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});var I1=ve(),s4=we(),o4={message:"property name must be valid",params:({params:t})=>(0,I1._)`{propertyName: ${t.propertyName}}`},a4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:o4,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,s4.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,I1.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};A_.default=a4});var O_=k(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var ym=Tn(),Hn=ve(),c4=yn(),Tm=we(),l4={message:"must NOT have additional properties",params:({params:t})=>(0,Hn._)`{additionalProperty: ${t.additionalProperty}}`},u4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:l4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Tm.alwaysValidSchema)(o,r))return;let l=(0,ym.allSchemaProperties)(n.properties),u=(0,ym.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Hn._)`${s} === ${c4.default.errors}`);function d(){e.forIn("key",i,T=>{!l.length&&!u.length?g(T):e.if(f(T),()=>g(T))})}function f(T){let S;if(l.length>8){let _=(0,Tm.schemaRefOrVal)(o,n.properties,"properties");S=(0,ym.isOwnProperty)(e,_,T)}else l.length?S=(0,Hn.or)(...l.map(_=>(0,Hn._)`${T} === ${_}`)):S=Hn.nil;return u.length&&(S=(0,Hn.or)(S,...u.map(_=>(0,Hn._)`${(0,ym.usePattern)(t,_)}.test(${T})`))),(0,Hn.not)(S)}function p(T){e.code((0,Hn._)`delete ${i}[${T}]`)}function g(T){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(T);return}if(r===!1){t.setParams({additionalProperty:T}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Tm.alwaysValidSchema)(o,r)){let S=e.name("valid");c.removeAdditional==="failing"?(h(T,S,!1),e.if((0,Hn.not)(S),()=>{t.reset(),p(T)})):(h(T,S),a||e.if((0,Hn.not)(S),()=>e.break()))}}function h(T,S,_){let v={keyword:"additionalProperties",dataProp:T,dataPropType:Tm.Type.Str};_===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(v,S)}}};I_.default=u4});var L1=k(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var d4=Xl(),M1=Tn(),M_=we(),x1=O_(),f4={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&x1.default.code(new d4.KeywordCxt(s,x1.default,"additionalProperties"));let o=(0,M1.allSchemaProperties)(r);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=M_.mergeEvaluated.props(e,(0,M_.toHash)(o),s.props));let a=o.filter(d=>!(0,M_.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,M1.propertyInData)(e,i,d,s.opts.ownProperties)),u(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};x_.default=f4});var F1=k(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var q1=Tn(),vm=ve(),$1=we(),B1=we(),p4={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,q1.allSchemaProperties)(r),c=a.filter(h=>(0,$1.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof vm.Name)&&(s.props=(0,B1.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let h of a)l&&p(h),s.allErrors?g(h):(e.var(u,!0),g(h),e.if(u))}function p(h){for(let T in l)new RegExp(h).test(T)&&(0,$1.checkStrictMode)(s,`property ${T} matches pattern ${h} (use allowMatchingProperties)`)}function g(h){e.forIn("key",n,T=>{e.if((0,vm._)`${(0,q1.usePattern)(t,h)}.test(${T})`,()=>{let S=c.includes(h);S||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:T,dataPropType:B1.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,vm._)`${d}[${T}]`,!0):!S&&!s.allErrors&&e.if((0,vm.not)(u),()=>e.break())})})}}};L_.default=p4});var j1=k(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var h4=we(),m4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,h4.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};q_.default=m4});var U1=k($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var g4=Tn(),y4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:g4.validateUnion,error:{message:"must match a schema in anyOf"}};$_.default=y4});var H1=k(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var bm=ve(),T4=we(),v4={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,bm._)`{passingSchemas: ${t.passing}}`},b4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:v4,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){s.forEach((u,d)=>{let f;(0,T4.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,bm._)`${c} && ${o}`).assign(o,!1).assign(a,(0,bm._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,bm.Name)})})}}};B_.default=b4});var V1=k(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var _4=we(),S4={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,_4.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};F_.default=S4});var G1=k(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var _m=ve(),W1=we(),N4={message:({params:t})=>(0,_m.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,_m._)`{failingKeyword: ${t.ifClause}}`},k4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:N4,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,W1.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=z1(n,"then"),s=z1(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,_m.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,_m._)`${u}`):t.setParams({ifClause:u})}}}};function z1(t,e){let r=t.schema[e];return r!==void 0&&!(0,W1.alwaysValidSchema)(t,r)}j_.default=k4});var K1=k(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var R4=we(),P4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,R4.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};U_.default=P4});var Y1=k(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var w4=R_(),E4=P1(),C4=P_(),D4=E1(),A4=C1(),I4=gm(),O4=O1(),M4=O_(),x4=L1(),L4=F1(),q4=j1(),$4=U1(),B4=H1(),F4=V1(),j4=G1(),U4=K1();function H4(t=!1){let e=[q4.default,$4.default,B4.default,F4.default,j4.default,U4.default,O4.default,M4.default,I4.default,x4.default,L4.default];return t?e.push(E4.default,D4.default):e.push(w4.default,C4.default),e.push(A4.default),e}H_.default=H4});var X1=k(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var Ot=ve(),V4={message:({schemaCode:t})=>(0,Ot.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ot._)`{format: ${t}}`},z4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:V4,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Ot._)`${g}[${o}]`),T=r.let("fType"),S=r.let("format");r.if((0,Ot._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(T,(0,Ot._)`${h}.type || "string"`).assign(S,(0,Ot._)`${h}.validate`),()=>r.assign(T,(0,Ot._)`"string"`).assign(S,h)),t.fail$data((0,Ot.or)(_(),v()));function _(){return c.strictSchema===!1?Ot.nil:(0,Ot._)`${o} && !${S}`}function v(){let R=u.$async?(0,Ot._)`(${h}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Ot._)`${S}(${n})`,C=(0,Ot._)`(typeof ${S} == "function" ? ${R} : ${S}.test(${n}))`;return(0,Ot._)`${S} && ${S} !== true && ${T} === ${e} && !${C}`}}function p(){let g=d.formats[s];if(!g){_();return}if(g===!0)return;let[h,T,S]=v(g);h===e&&t.pass(R());function _(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function v(C){let B=C instanceof RegExp?(0,Ot.regexpCode)(C):c.code.formats?(0,Ot._)`${c.code.formats}${(0,Ot.getProperty)(s)}`:void 0,M=r.scopeValue("formats",{key:s,ref:C,code:B});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,Ot._)`${M}.validate`]:["string",C,M]}function R(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ot._)`await ${S}(${n})`}return typeof T=="function"?(0,Ot._)`${S}(${n})`:(0,Ot._)`${S}.test(${n})`}}}};V_.default=z4});var J1=k(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var W4=X1(),G4=[W4.default];z_.default=G4});var Q1=k(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.contentVocabulary=Fa.metadataVocabulary=void 0;Fa.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fa.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var e$=k(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var K4=c1(),Y4=S1(),X4=Y1(),J4=J1(),Z1=Q1(),Q4=[K4.default,Y4.default,(0,X4.default)(),J4.default,Z1.metadataVocabulary,Z1.contentVocabulary];W_.default=Q4});var K_=k(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.dynamicAnchor=void 0;var G_=ve(),Z4=yn(),t$=Ql(),e9=lm(),t9={keyword:"$dynamicAnchor",schemaType:"string",code:t=>r$(t,t.schema)};function r$(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,G_._)`${Z4.default.dynamicAnchors}${(0,G_.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:r9(t);r.if((0,G_._)`!${i}`,()=>r.assign(i,s))}fu.dynamicAnchor=r$;function r9(t){let{schemaEnv:e,schema:r,self:n}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new t$.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return t$.compileSchema.call(n,l),(0,e9.getValidate)(t,l)}fu.default=t9});var Y_=k(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.dynamicRef=void 0;var n$=ve(),n9=yn(),i$=lm(),i9={keyword:"$dynamicRef",schemaType:"string",code:t=>s$(t,t.schema)};function s$(t,e){let{gen:r,keyword:n,it:i}=t;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,n$._)`${n9.default.dynamicAnchors}${(0,n$.getProperty)(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{(0,i$.callRef)(t,c),r.let(l,!0)}):()=>(0,i$.callRef)(t,c)}}pu.dynamicRef=s$;pu.default=i9});var o$=k(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var s9=K_(),o9=we(),a9={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,s9.dynamicAnchor)(t,""):(0,o9.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};X_.default=a9});var a$=k(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});var c9=Y_(),l9={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,c9.dynamicRef)(t,t.schema)};J_.default=l9});var c$=k(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});var u9=K_(),d9=Y_(),f9=o$(),p9=a$(),h9=[u9.default,d9.default,f9.default,p9.default];Q_.default=h9});var u$=k(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var l$=gm(),m9={keyword:"dependentRequired",type:"object",schemaType:"object",error:l$.error,code:t=>(0,l$.validatePropertyDeps)(t)};Z_.default=m9});var d$=k(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var g9=gm(),y9={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,g9.validateSchemaDeps)(t)};eS.default=y9});var f$=k(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var T9=we(),v9={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,T9.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};tS.default=v9});var p$=k(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var b9=u$(),_9=d$(),S9=f$(),N9=[b9.default,_9.default,S9.default];rS.default=N9});var m$=k(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var Es=ve(),h$=we(),k9=yn(),R9={message:"must NOT have unevaluated properties",params:({params:t})=>(0,Es._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},P9={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:R9,code(t){let{gen:e,schema:r,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof Es.Name?e.if((0,Es._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,Es._)`${i} === ${k9.default.errors}`);function c(d){if(r===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,h$.alwaysValidSchema)(s,r)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:h$.Type.Str},f),o||e.if((0,Es.not)(f),()=>e.break())}}function l(d,f){return(0,Es._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let g in d)d[g]===!0&&p.push((0,Es._)`${f} !== ${g}`);return(0,Es.and)(...p)}}};nS.default=P9});var y$=k(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var po=ve(),g$=we(),w9={message:({params:{len:t}})=>(0,po.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,po._)`{limit: ${t}}`},E9={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:w9,code(t){let{gen:e,schema:r,data:n,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,po._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,po._)`${o} > ${s}`);else if(typeof r=="object"&&!(0,g$.alwaysValidSchema)(i,r)){let c=e.var("valid",(0,po._)`${o} <= ${s}`);e.if((0,po.not)(c),()=>a(c,s)),t.ok(c)}i.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:g$.Type.Num},c),i.allErrors||e.if((0,po.not)(c),()=>e.break())})}}};iS.default=E9});var T$=k(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});var C9=m$(),D9=y$(),A9=[C9.default,D9.default];sS.default=A9});var b$=k(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.DiscrError=void 0;var v$;(function(t){t.Tag="tag",t.Mapping="mapping"})(v$||(Sm.DiscrError=v$={}))});var S$=k(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var ja=ve(),oS=b$(),_$=Ql(),I9=Jl(),O9=we(),M9={message:({params:{discrError:t,tagName:e}})=>t===oS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ja._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:M9,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,ja._)`${r}${(0,ja.getProperty)(a)}`);e.if((0,ja._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:oS.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let g in p)e.elseIf((0,ja._)`${l} === ${g}`),e.assign(c,d(p[g]));e.else(),t.error(!1,{discrError:oS.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let g=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},g);return t.mergeEvaluated(h,ja.Name),g}function f(){var p;let g={},h=S(i),T=!0;for(let R=0;R<o.length;R++){let C=o[R];if(C?.$ref&&!(0,O9.schemaHasRulesButRef)(C,s.self.RULES)){let M=C.$ref;if(C=_$.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,M),C instanceof _$.SchemaEnv&&(C=C.schema),C===void 0)throw new I9.default(s.opts.uriResolver,s.baseId,M)}let B=(p=C?.properties)===null||p===void 0?void 0:p[a];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);T=T&&(h||S(C)),_(B,R)}if(!T)throw new Error(`discriminator: "${a}" must be required`);return g;function S({required:R}){return Array.isArray(R)&&R.includes(a)}function _(R,C){if(R.const)v(R.const,C);else if(R.enum)for(let B of R.enum)v(B,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(R,C){if(typeof R!="string"||R in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[R]=C}}}};aS.default=x9});var N$=k((RPe,L9)=>{L9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var k$=k((PPe,q9)=>{q9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var R$=k((wPe,$9)=>{$9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var P$=k((EPe,B9)=>{B9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var w$=k((CPe,F9)=>{F9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var E$=k((DPe,j9)=>{j9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var C$=k((APe,U9)=>{U9.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var D$=k(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var H9=N$(),V9=k$(),z9=R$(),W9=P$(),G9=w$(),K9=E$(),Y9=C$(),X9=["/properties"];function J9(t){return[H9,V9,z9,W9,e(this,G9),K9,e(this,Y9)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,X9):n}}cS.default=J9});var A$=k((yt,uS)=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.MissingRefError=yt.ValidationError=yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=yt.Ajv2019=void 0;var Q9=n1(),Z9=e$(),eJ=c$(),tJ=p$(),rJ=T$(),nJ=S$(),iJ=D$(),lS="https://json-schema.org/draft/2019-09/schema",Ua=class extends Q9.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(eJ.default),Z9.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(tJ.default),this.addVocabulary(rJ.default),this.opts.discriminator&&this.addKeyword(nJ.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(iJ.default.call(this,e),this.refs["http://json-schema.org/schema"]=lS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lS)?lS:void 0)}};yt.Ajv2019=Ua;uS.exports=yt=Ua;uS.exports.Ajv2019=Ua;Object.defineProperty(yt,"__esModule",{value:!0});yt.default=Ua;var sJ=Xl();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:function(){return sJ.KeywordCxt}});var Ha=ve();Object.defineProperty(yt,"_",{enumerable:!0,get:function(){return Ha._}});Object.defineProperty(yt,"str",{enumerable:!0,get:function(){return Ha.str}});Object.defineProperty(yt,"stringify",{enumerable:!0,get:function(){return Ha.stringify}});Object.defineProperty(yt,"nil",{enumerable:!0,get:function(){return Ha.nil}});Object.defineProperty(yt,"Name",{enumerable:!0,get:function(){return Ha.Name}});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:function(){return Ha.CodeGen}});var oJ=tm();Object.defineProperty(yt,"ValidationError",{enumerable:!0,get:function(){return oJ.default}});var aJ=Jl();Object.defineProperty(yt,"MissingRefError",{enumerable:!0,get:function(){return aJ.default}})});var Ga=require("path"),We=$(aw());var tf=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=lw(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=cw(n.text,!1,s);if(c-a===u.length)for(let f=0,p=u.length;f<p;f++)l[f+a+1]=u[f];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=n.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=cw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},Yn;(function(t){function e(i,s,o,a){return new tf(i,s,o,a)}t.create=e;function r(i,s,o){if(i instanceof tf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let o=i.getText(),a=Ay(s.map(Uj),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=i.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=i.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=n})(Yn||(Yn={}));function Ay(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Ay(n,e),Ay(i,e);let s=0,o=0,a=0;for(;s<n.length&&o<i.length;)e(n[s],i[o])<=0?t[a++]=n[s++]:t[a++]=i[o++];for(;s<n.length;)t[a++]=n[s++];for(;o<i.length;)t[a++]=i[o++];return t}function cw(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function lw(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Uj(t){let e=lw(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var rf=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],nf=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Oy=$(require("url")),dw=require("crypto"),fw=require("path"),nn=$(H());var Iy=$(H());var Cr=$(H());var Q=class{constructor(e){this._children=[];this.syntaxIssues=[];this.resetableIssues=[];this._firstToken=e?.start,this._lastToken=e?.end}get issues(){return[...this.syntaxIssues,...this.resetableIssues]}resetIssues(){this.resetableIssues=[],this.children.forEach(e=>e.resetIssues())}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._firstToken??this._children[0].firstToken}set firstToken(e){this._firstToken=e}get lastToken(){return this._lastToken??this._children[this._children.length-1]?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return le(e,this.uri)?[this]:this.children.flatMap(r=>r.getTopMostAstNodeForFile(e))}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getDocumentSymbols(e)??[]);if(!le(this.uri,e))return[];let r=fe(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:r,selectionRange:r,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Cr.SymbolKind.File,Cr.SymbolKind.Class,Cr.SymbolKind.Constant].some(n=>n===e))return[];let r=fe(this);return[{location:Cr.Location.create(he(this.uri),r),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(n=>n.getWorkspaceSymbols()??[]).filter(n=>n.kind===Cr.SymbolKind.File||n.kind===Cr.SymbolKind.Class||n.kind===Cr.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(r=>r.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(bi(this.semanticTokenType),_i(this.semanticTokenModifiers),this.firstToken,this.lastToken)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this._children.push(e)),this.allDescendantsCache=void 0}isAncestorOf(e){return this.children.some(r=>r===e||r.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Cr.Range.create(Cr.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Cr.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}get serializeUri(){return he(this.uri)}serialize(e){return{uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Ee=class extends Q{toJson(){return-1}#e;resolve(e){return this.#e??=sf(this.toString(),e),this.#e}#t;evaluate(e){return this.#t??=Ce(`${this.operator?this.operator.toString():""}${this.resolve(e)}`),this.#t}#n;isTrue(e){return this.#n??=Ce(`!!(${this.operator?this.operator.toString():""}${this.resolve(e)})`),this.#n}toPrettyString(e){let r=this.evaluate(e);return`${r.toString()} /* ${this.toString()}${typeof r=="number"?` = 0x${r.toString(16)}`:""} */`}serialize(e){return{type:"EXPRESSION",value:this.toString(),evaluated:this.evaluate(e),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Xn=class extends Ee{constructor(r,n,i){super();this.expression=r;this.wrapped=n;this.addChild(r),i&&(this.addChild(i.operator),this.addChild(i.expression),this.join=[],this.join?.push(i))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(r,n){this.addChild(r),this.addChild(n),this.join??=[],this.join?.push({operator:r,expression:n})}toString(){let r=this.children.map(n=>n.toString()).join(" ");return this.wrapped?`(${r})`:`${r}`}isTrue(r){let n=`(${this.children.map(i=>i instanceof Ee?i.resolve(r):i.toString()).join(" ")})`;return Ce(`!!(${this.operator?this.operator.toString():""}${n})`)}};var Jn=class extends Ee{constructor(r,n,i){super(n);this.value=r;this.docSymbolsMeta={name:`param${i+1}`,kind:Iy.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Si=class extends Ee{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return le(this.uri,r)?[{name:this.functionName.name,kind:Iy.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(r)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(r=>r?.toString()??"<NULL>").join(",")})`}isTrue(r){if(this.functionName.name==="defined"){let n=!!(this.params.length===1&&this.params[0]&&r.has(this.params[0].value));return this.operator?Ce(`!!(${this.operator}${n})`):n}return super.isTrue(r)}};var zr=(t,e,r=!0,n=!0)=>({start:{line:t?.pos.line??0,character:r?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var fe=t=>zr(t.firstToken,t.lastToken),bi=t=>rf.findIndex(e=>e===t),_i=t=>nf.findIndex(e=>e===t),My=(t,e,r)=>!le(t.uri,e)||r.line<t.pos.line?!1:r.line>t.pos.line?!0:r.character>=t.pos.colEnd,Vj=(t,e,r)=>le(t.uri,e)?r.line<t.pos.line?!0:r.line>t.pos.line?!1:r.character<t.pos.col:!1,on=(t,e,r)=>{let n=t.firstToken,i=t.lastToken;return!!((n.pos.line<r.line||n.pos.line===r.line&&n.pos.col<=r.character)&&(i.pos.line>r.line||i.pos.line===r.line&&i.pos.colEnd>=r.character)&&le(t.uri,e))},pw=(t,e)=>{let r=(i,s)=>i.line<s.line||i.line===s.line&&i.character<=s.character,n=(i,s)=>i.line>s.line||i.line===s.line&&i.character>=s.character;return r(t.start,e.start)&&n(t.end,e.end)},hw=(t,e,r)=>{let n=t.firstToken,i=t.lastToken;return!!(t.lastToken.value!==";"&&(n.pos.line===r.line||i.pos.line===r.line)&&r.character>=i.pos.colEnd&&le(t.uri,e))},mw=(t,e,r)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===r.line).at(-1);return i&&i.pos.col>=r.character?!1:e.lastToken===i};var Qn=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>on(s,e,r));return n},mc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].find(s=>Vj(s.lastToken,e,r));return n===t?void 0:n},gc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>My(s.firstToken,e,r));return n===t?void 0:n},W=(t,e,r=e,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l,inclusiveStart:u,inclusiveEnd:d}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let f=zr(e,r,u,d),p={issues:Array.isArray(t)?t:[t],range:f,uri:e.uri,severity:i,linkedTo:s.map(({range:T,uri:S})=>({range:T,uri:S,templateStrings:[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},g,h=()=>(g??={severity:p.severity,range:f,message:p.issues?p.issues.map(Gj).join(" or "):"",source:"devicetree",tags:p.tags,data:{firstToken:{pos:e.pos,tokens:e.tokens,value:e.value},lastToken:{pos:r.pos,tokens:r.tokens,value:r.value},type:"SyntaxIssue",items:p.issues,edit:p.edit,codeActionTitle:p.codeActionTitle}},g);return n?.syntaxIssues.push(h),{raw:p,diagnostic:h}},Lt=(t,e,r,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l,linkedToTemplateStrings:u=[]}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[],linkedToTemplateStrings:[]})=>{let d=zr(e,r),f={issues:Array.isArray(t)?t:[t],range:d,uri:e.uri,severity:i,linkedTo:s.map(({range:h,uri:T},S)=>({range:h,uri:T,templateStrings:u.at(S)??[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},p,g=()=>(p??={severity:f.severity,range:d,message:Kj(f),source:"devicetree",tags:f.tags,relatedInformation:[...f.linkedTo.map(h=>({message:f.issues.map(T=>Yj(T,h.templateStrings)).join(" or "),location:{uri:he(h.uri),range:h.range}}))]},p);return n?.resetableIssues.push(g),{raw:f,diagnostic:g}},j=(t,e,r,n,{severity:i=nn.DiagnosticSeverity.Error,linkedTo:s=[],tags:o,templateStrings:a=[],edit:c,codeActionTitle:l}={severity:nn.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let u=zr(e,r),d={issues:Array.isArray(t)?t:[t],range:u,severity:i,uri:e.uri,linkedTo:s.map(({range:g,uri:h})=>({range:g,uri:h,templateStrings:[]})),tags:o,templateStrings:a,edit:c,codeActionTitle:l},f,p=()=>(f??={severity:d.severity,range:u,message:Xj(d),relatedInformation:[...d.linkedTo.map(g=>({message:d.issues.map(Jj).join(" or "),location:{uri:he(g.uri),range:g.range}}))],source:"devicetree",tags:d.tags,data:{type:"StandardTypeIssue",firstToken:{pos:e.pos,tokens:e.tokens,value:e.value},lastToken:{pos:r.pos,tokens:r.tokens,value:r.value},edit:d.edit,codeActionTitle:d.codeActionTitle,items:d.issues}},f);return n?.resetableIssues.push(p),{raw:d,diagnostic:p}};function Dr(t,e,r,{severity:n=nn.DiagnosticSeverity.Warning,linkedTo:i=[],tags:s,templateStrings:o=[],edit:a,codeActionTitle:c}={severity:nn.DiagnosticSeverity.Warning,linkedTo:[],templateStrings:[],edit:[],codeActionTitle:void 0},l=r){let u=nn.Range.create(r,l),d={issues:Array.isArray(t)?t:[t],range:u,severity:n,uri:e,linkedTo:i.map(({range:g,uri:h})=>({range:g,uri:h,templateStrings:[]})),tags:s,templateStrings:o,edit:a,codeActionTitle:c},f;return{raw:d,diagnostic:()=>(f??={severity:d.severity,range:u,message:Qj(d),relatedInformation:[...d.linkedTo.map(g=>({message:d.issues.map(Zj).join(" or "),location:{uri:he(g.uri),range:g.range}}))],source:"devicetree",tags:d.tags,data:{type:"FormattingIssues",items:d.issues,edit:d.edit,codeActionTitle:d.codeActionTitle}},f)}}var gw=(t,e)=>[...t].sort((n,i)=>{let s=e.getSortKey(n),o=e.getSortKey(i);if(s===void 0||o===void 0)throw new Error("Sort keys must be set");if(s!==o)return s-o;let a=n.lastToken,c=i.lastToken;return a.pos.line!==c.pos.line?a.pos.line-c.pos.line:a.pos.col-c.pos.col});async function _t(t,e,r){let n=Re(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(n,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),r(o,l=>{let u=t.position;if(le(l.uri,n)){let d=l.lastToken;return d.pos.line<u.line||d.pos.line===u.line&&d.pos.colEnd<=u.character}return a!==void 0&&(e.getSortKey(l)??-1)<=a})}function oe(t,e){return{start:t,end:e??t}}var U=(t,e)=>t?.tokens.some(r=>r===e),Ze=(t,e)=>r=>r?.value&&(e?.caseInsensitive?t.toLowerCase()===r.value.toLowerCase():t===r.value)?"yes":e?.allowPartial?zj(t)(r):"no",Oe=t=>e=>e?.tokens.some(r=>r===t)?"yes":"no",zj=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",Dn=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&le(t.uri,e.uri),qt=(t,e)=>t?.tokens[0]===21&&e?.tokens[0]===21&&(t?.prevToken&&t.prevToken.value===e?.value||e?.prevToken&&e.prevToken.value===t?.value)?!0:!!t&&!!e&&t.pos.colEnd===e.pos.col&&Dn(t,e),cf=t=>t.map((e,r)=>({index:r,context:e,files:e.getContextFiles()})),an=(t,e,r,n)=>{if("id"in e){let s=t?.find(o=>o.id===e.id);return s||void 0}if("name"in e){let s=t?.find(o=>o.ctxNames.includes(e.name));return s||void 0}return r?.getContextFiles().find(s=>le(s,e.uri))?r:cf(t).sort(s=>s.context.id===n?-1:0).find(s=>s.files.some(o=>le(o,e.uri)))?.context},xy=(t,e)=>cf(t).filter(n=>n.files.some(i=>le(i,e))).map(n=>n.context),yw=t=>{let e=/^(\w+)\s+(.+)$/,r=/^(\w+)\(([^)]*)\)\s+(.+)$/,n=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;if(i=n.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(i=r.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},sf=(t,e)=>{let r=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),n=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=r(s),i=n(i),i=i.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(i!==s);return i};function Wj(t){return t.replace(/'(.)'/g,(e,r)=>r.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Ce(t){try{return(0,eval)(Wj(t))}catch(e){console.log(e instanceof Error?e.message:e)}return t}var he=t=>Oy.default.pathToFileURL(t).toString(),Re=t=>nt(Oy.default.fileURLToPath(t)),le=(t,e)=>!t||!e?!1:t===e,nt=t=>(0,fw.normalize)(process.platform==="win32"?t.toLowerCase():t),Ni=t=>(0,dw.createHash)("sha256").update([nt(t.dtsFile),...t.includePaths.map(nt),...t.overlays.map(nt),t.bindingType,...t.zephyrBindings.map(nt),...t.deviceOrgBindingsMetaSchema.map(nt),...t.deviceOrgTreeBindings.map(nt),`showFormattingErrorAsDiagnostics-${t.showFormattingErrorAsDiagnostics}`].join(":")).digest("hex"),Gj=t=>{switch(t){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 49:return"Node name shall start with a lower or upper case character";case 50:return"Node unit address should not start with 0x";case 51:return"Node unit address should not end with with ULL";case 8:return"Expected node address";case 9:return"Expected node path";case 48:return"Expected node path reference";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";case 36:return"Unable to resolve include";case 52:return"Unknown Node Address syntax";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},Kj=t=>t.issues.map(e=>{switch(e){case 0:return`Property "${t.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 "${t.templateStrings[0]}" has been defined`;case 8:return`No node with name "${t.templateStrings[0]}" could be found in "/${t.templateStrings[1]}".`;case 4:return`Label name "${t.templateStrings[0]}" already defined`;case 6:return`Property "${t.templateStrings[0]}" was deleted`;case 7:return`Node "${t.templateStrings[0]}" was deleted`;case 9:return`The following node "${t.templateStrings[1]}" shall be present in "${t.templateStrings[0]}" node.`;case 10:return`The following node "${t.templateStrings[0]}" address range collides with another node. Address start: "${t.templateStrings[1]}", end: "${t.templateStrings[2]}".`}}).join(" or "),Yj=(t,e)=>{switch(t){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";case 10:return`Node "${e[0]}". Address start: "${e[1]}", end: "${e[2]}".`;default:return"TODO"}},Xj=t=>t.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${t.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 ${t.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 27:return"INTRO name is not permitted under this node";case 34:return"INTRO name is not defined in the type binding for this node";case 10:return"INTRO address 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 ${t.templateStrings[1]}'`;case 18:return"INTRO value must be unique in the entire Devicetree";case 19:return`INTRO should have format ${t.templateStrings[1]}`;case 16:return`INTRO requires property "${t.templateStrings[1]}" in node path "${t.templateStrings[2]}"`;case 17:return"Unable to resolve interrupt parent node";case 20:return`INTRO should have format ${t.templateStrings[1]}`;case 21:return"Node is disabled";case 22:return"Unable to resolve handle";case 23:return`Unable to find "${t.templateStrings[0]}" in ${t.templateStrings[1]}`;case 24:return t.templateStrings[0];case 25:return t.templateStrings[0];case 26:return t.templateStrings[0];case 28:return t.templateStrings[0];case 35:return"Unable to find mapping range for address";case 29:return`INTRO exceeds address space available for this mapping. The range ends at ${t.templateStrings[2]}, the node ends at ${t.templateStrings[1]}`;case 30:return"Map entry overlaps with others entries";case 31:return"Unable to match to a nexus map entry";case 32:return`Unknown node type "${t.templateStrings[0]}"`;case 33:return`Missing name for "${t.templateStrings[0]}" index ${t.templateStrings[1]}"`;case 36:return"Node address is missing";case 37:return`Binding should be used on bus type${t.templateStrings.length?"s":""}: ${t.templateStrings.join(" or ")}`}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),Jj=t=>{switch(t){case 16:case 0:return"Node";case 15:return"Ignored reason";case 18:return"Conflicting properties";case 8:return"Additional value";case 21:return"Disabled by";case 29:return"Mapping range";case 30:return"Map entry";case 31:return"Nexus map entries";case 33:return"Names property";case 35:return"Range property";default:return"TODO"}},Qj=t=>t.issues.map(e=>{switch(e){case 4:return"Add end of line to end of file";case 1:return`${t.codeActionTitle}. Expecting ${t.templateStrings[0]}.`;case 0:return"Move to a new line";case 3:return"Remove trailing whitespace at the end of file.";case 2:return"Remove trailing whitespace at the end of the line.";case 5:return`Fix indentation. Expecting ${t.templateStrings[0]}`;case 6:return`Move token "${t.templateStrings[0]}" next to expression`;case 7:return"Remove (...) enclosure. This expression should only be enclosed in the #define of the macro"}}).join(" or "),Zj=t=>"TODO",sn=(t,e)=>{let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[t.length-r+n]??0,s=e[e.length-r+n]??0;if(i<s)return-1;if(i>s)return 1}return 0},Ji=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;n[r-1-s]=c>>>0,i=c>4294967295?1:0}return i&&n.unshift(1),n},eU=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0;o-=i,o<a?(o+=4294967296,i=1):i=0,n[r-1-s]=o-a>>>0}for(;n.length>1&&n[0]===0;)n.shift();return n},tU=(t,e)=>Ji(t,e),Tw=(t,e)=>{let r=[];for(let n of t){let i=n.childAddress,s=n.length,o=Ji(i,s);if(sn(e,i)>=0&&sn(e,o)<0){let a=eU(e,i),c=n.parentAddress,l=tU(c,a),u=Ji(c,s);r.push({start:l,end:u,range:zr(n.rangeTokens.start,n.rangeTokens.end),uri:n.rangeTokens.start.uri})}}return r};function vw(t){return Array.isArray(t)&&Array.isArray(t[0])}function yc(t){return!t||t instanceof Si?t:yc(t.parentNode)}function bw(t,e){let r=t.getText(),n=e.slice().sort((s,o)=>{let a=t.offsetAt(s.range.start),c=t.offsetAt(o.range.start);if(a!==c)return c-a;let l=t.offsetAt(s.range.end),u=t.offsetAt(o.range.end);if(l!==u)return u-l;let d=a===l&&s.newText.length>0,f=c===u&&o.newText.length>0;return d!==f?d?1:-1:0}),i=r;for(let s of n){let o=t.offsetAt(s.range.start),a=t.offsetAt(s.range.end);i=i.slice(0,o)+s.newText+i.slice(a)}return i}function uw(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}function _w(t,e){return uw(t.end,e.start)>0&&uw(t.start,e.end)<0}var Sw=(t,e)=>{let r=Nw(t,e),n=kw(t,e);r&&(t.topComment=r.comment),n&&(t.endComment=n.comment)},Nw=(t,e)=>{let r=e.find(i=>i.lastToken===t.firstToken.prevToken&&(i.lastToken.pos.line===t.firstToken.pos.line||i.lastToken.pos.line+1===t.firstToken.pos.line));if(!r||r.astBeforeComment)return;r.astAfterComment=t;let n=Nw(r,e);return n&&(n.comment.astAfterComment=t,r.astAfterComment=void 0),{comment:n?.comment??r,commentIsBefore:!0}},kw=(t,e)=>{let r=e.find(i=>i.firstToken.prevToken===t.lastToken&&i.firstToken.pos.line===t.lastToken.pos.line);if(!r)return;r.astBeforeComment=t;let n=kw(r,e);return n&&(n.comment.astBeforeComment=t,r.astBeforeComment=void 0),{comment:n?.comment??r,commentIsBefore:!1}},Vo=(t,e,r)=>{let n=[42,44,45,36];return r||n.push(52,32,8,49),t.severity===nn.DiagnosticSeverity.Error&&le(t.uri,e)&&!n.some(i=>t.issues.includes(i))};function lf(t){let e=t?.charAt(0);return!!e&&(e>="A"&&e<="Z"||e>="a"&&e<="z")}var Ic=require("fs"),BC=require("path");var An=$(H());var Cw=$(H());var Rw=$(H());var ne=class extends Q{constructor(r,n){super(n);this.value=r;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Rw.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return{type:"STRING",value:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var ww=$(H());var Pw=$(H());var cr=class extends Ee{constructor(r,n,i=10){super(n);this.value=r;this.radix=i;this.docSymbolsMeta={name:this.value.toString(),kind:Pw.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}resolve(r){return this.value.toString()}evaluate(r){return this.value}isTrue(r){return!!this.value}toString(r){return this.value.toString(r??this.radix)}toJson(){return this.value}toPrettyString(r){let n=this.value;return this.radix==16?`0x${n.toString(16)} /* ${typeof n=="number"?`${n.toString(10)}`:""} */`:`${n.toString(10)} /* ${typeof n=="number"?`0x${n.toString(16)}`:""} */`}serialize(){return{type:"NUMBER_VALUE",value:`${this.radix===16?"0x":""}${this.toString()}`,evaluated:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var jt=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Cell Array",kind:ww.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`<${this.values.map(r=>r.toString()).join(" ")}>`}toPrettyString(r){return`<${this.values.map(n=>n.toPrettyString(r)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(r=>r.value instanceof cr)){let r=new ArrayBuffer(8),n=new DataView(r);return this.values.map(i=>i.value.value).forEach((i,s)=>{n.setUint32(s*4,i)}),n.getBigUint64(0)}return this.values.map(r=>r.value?.toJson()??NaN)}serialize(r){return{type:"ARRAY_VALUE",value:this.values.map(n=>n.value?.serialize(r)??null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Ew=$(H());var ki=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Byte String Value",kind:Ew.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(r=>r.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(r=>r.value?.toJson()??NaN)}serialize(){return{type:"BYTESTRING",values:this.values.map(r=>r.value?{value:r.value.toString(16),range:r.value.range,evaluated:r.value.value}:null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var et=class extends Q{constructor(r,n){super(n);this.name=r;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return{value:this.name,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ye=class extends Q{constructor(r,n=[]){super();this.propertyName=r;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:Cw.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(r)}set values(r){if(this._values)throw new Error("Only one property name is allowed");this._values=r,this.addChild(r)}get values(){return this._values}get quickValues(){return this.values?.values.map(r=>r?r.value instanceof ne?r.value.value:r.value instanceof jt?r.value.values.map(n=>n.value instanceof cr?n.value.value:NaN):r.value instanceof ki?r.value.values.map(n=>n.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(r=>r?r.value instanceof ne?r.value:r.value instanceof jt?r.value.values.map(n=>n.value):r.value instanceof ki?r.value.values.map(n=>n.value):r.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(r){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toPrettyString(r)??"NULL").join(", ")??"NULL"}`:""};`}serialize(r){return{name:this.propertyName?.serialize()??null,values:this.values?.values.map(n=>n?.value?.serialize(r)??null)??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Dw=$(H());var Tr=class extends Q{constructor(r,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:r,kind:Dw.SymbolKind.Function}}};var Ar=class extends Tr{constructor(r){super("Delete Node",r);this._nodeNameOrRef=null}set nodeNameOrRef(r){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=r,this.addChild(r)}get nodeNameOrRef(){return this._nodeNameOrRef}};var ht=class extends Tr{constructor(r){super("Delete Property",r);this._propertyName=null}set propertyName(r){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=r,this.addChild(r)}get propertyName(){return this._propertyName}};var Aw=$(H());var ie=class extends Q{constructor(r){super();this.label=r;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:Aw.SymbolKind.Key},this.addChild(r)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return{type:"LABEL_REF",label:this.label?.toString()??null,nodePath:this.linksTo?.pathString??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var lt=class t extends Q{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof St)return[this.pathName];if(!(this.parentNode instanceof t))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof t)}get deleteNodes(){return this.children.filter(e=>e instanceof Ar)}addNodeChild(e){this.addChild(e)}},St=class extends lt{constructor(){super(),this.docSymbolsMeta={name:"/",kind:An.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ye)}get name(){return new Me("/",oe(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof ht)}get nodes(){return this.children.filter(e=>e instanceof He)}get pathName(){return"/"}serialize(e){return{type:"ROOT",properties:this.properties.map(r=>r.serialize(e)),nodes:this.nodes.map(r=>r.serialize(e)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Wt=class extends lt{constructor(r=[]){super();this.labels=r;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:An.SymbolKind.Class},r.forEach(n=>{super.addChild(n)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(r=>r())}set reference(r){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=r;let n;r instanceof ie?n=r.value:n=r?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:n??"DTC Name",kind:An.SymbolKind.Class},this.addChild(r)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(r=>r instanceof He)}get pathName(){if(this.reference instanceof ie&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"REF",name:this.reference?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},He=class t extends lt{constructor(r=[],n){super();this.labels=r;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:An.SymbolKind.Class},n&&this.addChild(n),r.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(r=>r())}set name(r){if(this._name)throw new Error("Only on label reference is allowed");this._name=r,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:An.SymbolKind.Class},this.addChild(r)}get name(){return this._name}get nodes(){return this.children.filter(r=>r instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"CHILD",name:this.name?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Tc=class extends Q{constructor(r,n){super(n);this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((r,n)=>r.toString(16).padStart(n?8:0,"0")).join("")??"NaN"}serialize(){return{address:this.address,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Me=class extends Q{constructor(r,n,i){super(n);this.name=r;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(r){if(this._address)throw new Error("Address can only be set once");r&&(this.lastToken=void 0,this._address=r,r.forEach(n=>this.addChild(n)))}get fullAddress(){return this._address?[...this._address.flatMap(r=>r.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(r=>r.toString()).join(",")}`:this.name}buildSemanticTokens(r){let n=this.firstToken;if(!n.value)return;let i={...n,pos:{...n.pos,len:this.name.length}};r(bi("type"),_i("declaration"),i,i),this.address!==void 0&&this.address.forEach(s=>{r(bi("decorator"),_i("declaration"),s.firstToken,s.lastToken),s.buildSemanticTokens(r)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(r=>r.issues)??[]].map(r=>r())}serialize(){let r=this.firstToken;return{fullName:this.toString(),name:{name:this.name,uri:this.serializeUri,range:An.Range.create(An.Position.create(r.pos.line,r.pos.col),An.Position.create(r.pos.line,r.pos.colEnd)),issues:this.serializeIssues},address:this.address?.map(n=>n.serialize())??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var $C=require("path"),dn=$(H());var vr=class extends Q{constructor(r,n,i,s){super();this.startLabels=r;this.value=n;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(n),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toPrettyString(r){return`${[this.value?.toPrettyString(r)??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Ut=t=>t instanceof Tr?!0:t instanceof lt?!1:t.parentNode?Ut(t.parentNode):!1;var Ly=t=>{if(t instanceof Ye)return t;if(!(t instanceof lt))return t.parentNode?Ly(t.parentNode):void 0},Hs=t=>!t||t instanceof Ye?!1:t instanceof vr||Hs(t.parentNode),zo=t=>[...t.map(e=>{if(e instanceof He||e instanceof St)return e.name;if(e instanceof Wt)return e.reference})].filter(e=>!!e),qy=(t,e)=>e?e.parentNode===t||qy(t,e.parentNode):!1;var wt=$(H());var Iw=$(H());var In=class extends Q{constructor(){super();this._pathParts=[]}addPath(r,n){this._pathParts.push(r),n&&this.addChild(n),this.addChild(r)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(r=>r?.toString()??"<NULL>").join("/")}buildSemanticTokens(r){this._children.forEach(n=>{n instanceof Me?n.buildSemanticTokens(r):r(bi("operator"),_i("declaration"),n.firstToken,n.lastToken)})}},it=class extends Q{constructor(r){super();this.path=r;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:Iw.SymbolKind.Namespace},this.addChild(r)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return{type:"NODE_PATH",nodePath:this.path?.toString()??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Z=$(H());var Ow=require("path"),uf=$(H());var Ri=class extends Q{constructor(r,n){super();this.keyword=r;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:uf.SymbolKind.File},this.addChild(r),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(r){this.docSymbolsMeta={name:`Include ${r}`,kind:uf.SymbolKind.File},this._resolvedPath=r}},Wo=class extends Q{constructor(r,n,i){super(i);this._path=r;this.relative=n;this.docSymbolsMeta={name:(0,Ow.basename)(this.path),kind:uf.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var cn=class extends Q{constructor(r){super();this.comments=r;r.forEach(this.addChild.bind(this))}toString(){return this.comments.map(r=>r.toString()).join(`
183
+ `)}},ln=class extends Q{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}toString(){let e,r=this.firstToken,n="";for(;r!==this.lastToken;)n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "),e=r,r=r?.nextToken;r&&(n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "));let i=n.match(/^\s*(?:(?:\/\/|\/\*+)\s*)?(.*?)\s*(?:\*\/)?\s*$/s);return i?i[1]:""}};var Mw=$(H());var Ct=class extends Ee{constructor(r,n){super(n);this.name=r;this.docSymbolsMeta={name:this.name.toString(),kind:Mw.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Nf=$(H());var $y=$(H());var Qi=class extends Q{constructor(r,n){super(n);this.label=r;this.docSymbolsMeta={name:this.label.value,kind:$y.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(r)}toString(){return`${this.label.toString()}:`}},Zt=class extends Q{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value,kind:$y.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(r){let n=this.parentNode;if(!(n instanceof ie&&n.linksTo)){super.buildSemanticTokens(r);return}r(bi("type"),_i("declaration"),this.firstToken,this.lastToken)}toString(){return`${this.value}`}};var ut=class extends Q{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var xw=$(H());var df=class extends Q{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Values",kind:xw.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}toString(){return this.values.map(r=>r?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(r=>r?.toJson())}};var Lw=$(H());var ff=class extends Q{constructor(r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:"DTS Document version",kind:Lw.SymbolKind.Function}}};var Zn=class extends Q{constructor(r,n){super();this.value=r;this.labels=n;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toString(r)??"NULL"}`}toPrettyString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toPrettyString(r)??"NULL"}`}};var pf=class extends Q{constructor(r,n){super(n);this.operator=r;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var qw=$(H());var hf=class extends ut{toString(){return"..."}},ei=class extends Q{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return le(this.uri,r)?[{name:this.functionName.name,kind:qw.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n.getDocumentSymbols(r))}]:[]}toString(){return`${this.functionName}(${this.params.map(r=>r.toString()).join(",")})`}};var Zi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,r=!0,n=!1)=>{let i=e.pos.line;if(this.currentToken?.pos.line!==i||!le(this.currentToken?.uri,e.uri))return;let s=this.currentToken,o=s;for(;this.currentToken?.pos.line===i&&le(this.currentToken?.uri,e.uri);)o=this.moveToNextToken;return r&&this._issues.push(W(22,s,o,null)),n&&o?.value==="\\"&&o.nextToken?this.moveEndOfLine(o.nextToken,r):o};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;if(e)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(),r=this.positionStack.pop();if(r===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=r}peekIndex(e=1){let r=this.positionStack.at(-1*e);if(r===void 0)throw new Error("Index out of bounds");return r}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let r=[];return e.every(n=>{let i=this.currentToken,s=n(i),o=!1;return s!=="no"&&i&&(r.push(i),this.moveToNextToken,o=qt(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),r}consumeAnyConcurrentTokens(e){this.enqueueToStack();let r=[],n,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)r.push(this.currentToken),n=this.moveToNextToken,i=qt(n,this.currentToken);return this.mergeStack(),r}getDocumentSymbols(e){return this.allAstItems.flatMap(r=>r.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,r){let n=[],i=(s,o,a,c)=>{if(!a||!c||!le(a.uri,r)||!le(c.uri,r))return;let l=c.pos.colEnd-a.pos.col;n.push({line:a.pos.line,char:a.pos.col,length:c===a?c.pos.len:l,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(i)}),n.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(e,r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!n.length){this.popStack();return}if(!n?.[0]?.value.match(/^[_A-Za-z]/)){this.popStack();return}let i=n.map(o=>o.value).join(""),s=new Ct(i,oe(n[0],n.at(-1)));return!r&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(W(42,s.firstToken,s.lastToken,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let r=e,n;if(U(e,40)?(n="&",U(this.currentToken,40)&&(n="&&",r=this.moveToNextToken)):U(e,6)?(n="!",U(this.currentToken,0)&&(n="!=",r=this.moveToNextToken)):U(e,10)?n="~":U(e,8)?(n="|",U(this.currentToken,8)&&(n="||",r=this.moveToNextToken)):U(e,9)?n="^":U(e,4)?(n=">",U(this.currentToken,4)?(n="<<",r=this.moveToNextToken):U(this.currentToken,0)&&(n=">=",r=this.moveToNextToken)):U(e,5)?(n="<",U(this.currentToken,5)?(n=">>",r=this.moveToNextToken):U(this.currentToken,0)&&(n="<=",r=this.moveToNextToken)):U(e,15)?n="+":U(e,16)?n="-":U(e,17)?n="*":U(e,13)?n="/":U(e,18)?n="%":U(e,46)?U(this.currentToken,46)&&(n="##",r=this.moveToNextToken):U(e,0)&&U(this.currentToken,0)&&(n="==",r=this.moveToNextToken),n){let i=new pf(n,oe(e,r));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,r,n){this.enqueueToStack();let i=this.moveToNextToken;if(!i||!e(i)){this.popStack();return}let s=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=s},a=g=>g.flatMap(h=>"items"in h?a(h.items):h),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!r(d);){if(n?.(d)){let g=this.peekIndex()+1,h=()=>{this.positionStack[this.positionStack.length-1]=g};c.push(d),l.push(d),u[u.length]={rewind:h,tokens:[]}}else if(e(d)){let g=this.parseScopedBlock(e,r,n);g&&(c.push(g),u[u.length-1].tokens.push(...a(g.items))),d=this.currentToken;continue}else c.push(d),u[u.length-1].tokens.push(d);this.moveToNextToken,d=this.currentToken}let f=d;f&&r(f)&&(this.moveToNextToken,c.push(f));let p={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),p}isFunctionCall(e){this.enqueueToStack();let r=this.processCIdentifier(e,!1);if(!r){this.popStack();return}if(!qt(r.lastToken,this.currentToken)){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}if(r.name==="defined")n.length>1?this._issues.push(W(44,r.firstToken,r.lastToken,r)):n.length<1&&this._issues.push(W(45,r.firstToken,r.lastToken,r));else{let s=e.get(r.name)?.macro;s&&(s?.identifier instanceof ei?n.length>s.identifier.params.length?this._issues.push(W(44,r.firstToken,r.lastToken,r,{linkedTo:[s]})):n.length<s.identifier.params.length&&this._issues.push(W(45,r.firstToken,r.lastToken,r,{linkedTo:[s]})):this._issues.push(W(43,r.firstToken,r.lastToken,r)))}let i=new Si(r,n);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([Ze("0"),Ze("x",{caseInsensitive:!0})]);if(e.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(Oe));if(!r.length){this.popStack();return}let n=Number.parseInt(r.map(s=>s.value).join(""),16),i=new cr(n,oe(e[0],r.at(-1)),16);return this.mergeStack(),i}processDec(e=!1){this.enqueueToStack();let r;e&&(U(this.currentToken,16)||U(this.currentToken,15))&&qt(this.currentToken,this.currentToken?.nextToken)&&(r=this.moveToNextToken);let n=this.consumeAnyConcurrentTokens([19].map(Oe));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(o=>o.value).join(""),10);r&&U(r,16)&&(i=4294967295-i);let s=new cr(i,oe(r??n[0],n.at(-1)),10);return this.mergeStack(),s}processEnclosedExpression(e,r){this.enqueueToStack();let n,i;if(U(this.currentToken,42)){let s;n=this.moveToNextToken,i=n;let o=this.processExpression(e,r,!0);return o&&(s=new Xn(o,!0),o=new Xn(s,!1),s.openBracket=n),U(this.currentToken,43)?(i=this.moveToNextToken,s&&(s.closeBracket=i)):n&&this._issues.push(W(26,n,n,r)),this.mergeStack(),o}this.popStack()}processExpression(e,r,n=!1){this.enqueueToStack();let i,s;if(n&&(s=this.isOperator()),i=this.processEnclosedExpression(e,r)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(!0),!i){this.popStack();return}if(s&&(i.operator=s),n){let o=this.isOperator();for(;o;){let a=this.processExpression(e,r,!0);a?i instanceof Xn?i.addExpression(o,a):i=new Xn(i,!1,{operator:o,expression:a}):this._issues.push(W(27,o.firstToken,o.lastToken,r)),o=this.isOperator()}}return this.mergeStack(),i}processMacroCallParams(){if(!U(this.currentToken,42))return;let e=this.parseScopedBlock(n=>!!U(n,42),n=>!!U(n,43),n=>!!U(n,24));return e?.items.length===2&&U(e.endToken,43)?[]:e?.splitTokens.map((n,i)=>{if(n.tokens.length===0)return null;let s=new Jn(n.tokens.map((o,a)=>{let c=o.value;return o.pos.line===n.tokens.at(a+1)?.pos.line?c=c.padEnd(n.tokens[a+1].pos.col-o.pos.col," "):o.value==="\\"&&(c=c.slice(0,-1)),c}).join(""),oe(n.tokens[0],n.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var jy=require("fs"),Yo=require("path"),Rc=$(H());var bc=require("fs");var Go=class t{constructor(e,r){this.text=e;this.uri=r;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this._tokens=[];let n=this.text.replace(/\r\n/g,`
184
184
  `).trimEnd();this.lines=n.split(`
185
185
  `);for(let i=0;i<this.lines.length;i++)this.lines[i]+=`
186
186
  `;this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){let e=this.currentChar;if(!e)return!1;let r=e.charCodeAt(0);return r===32||r===9||r===10||r===13||r===12||r===11}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(){for(;!this.isOnLastLine;)if(this.columnNumber=0,this.lineNumber++,this.lines[this.lineNumber].length>0)return!0;return!1}moveOnLine(){let r=this.lines[this.lineNumber].length;return this.columnNumber>=r?this.moveToNextLine():(this.columnNumber++,this.columnNumber>=r&&this.moveToNextLine(),!0)}move(){return this.lineNumber>=this.lines.length?!1:this.moveOnLine()}get currentChar(){if(this.lineNumber>=this.lines.length)return null;let e=this.lines[this.lineNumber];return this.columnNumber>=e.length?null:e[this.columnNumber]}static{this.SYNTAX_CHARS=new Set(["^","~","|","!","\\","<",">",";","=","/","{","}","[","]","(",")","*","%","&",".",":","+","@","-","_",",","x","X","?"])}static isSyntaxChar(e){return e?t.SYNTAX_CHARS.has(e):!1}static isLetterCode(e){return e>=65&&e<=90||e>=97&&e<=122}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!t.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&t.isSyntaxChar(this.currentChar)){this.move();break}let r=this.lineNumber;if(!this.move()||this.lineNumber!==r)return e}return this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),this.inCommentLineStart!==void 0&&this.lineNumber!==this.inCommentLineStart&&(this.inCommentLineStart=void 0,this.inComment=!1),!this.inComment&&e==="/"&&this.currentChar==="*"&&(this.inCommentLineStart=void 0,this.inComment=!0),!this.inComment&&e==="/"&&this.currentChar==="/"&&(this.inCommentLineStart=this.lineNumber,this.inComment=!0),e}getString(e){let r=e;for(;this.currentChar!==e;){if(this.currentChar===`
187
- `){let o=this.lineNumber,a=this.columnNumber,c=r.length;this.pushToken({tokens:[21],value:r,pos:{col:a-c,line:o,len:c,colEnd:a}}),r=""}else if(this.currentChar==="\\"){let o=this.lineNumber;if(r+=this.currentChar??"",this.move())o===this.lineNumber&&(r+=this.currentChar??"");else break}else r+=this.currentChar??"";if(!this.move())break}r+=e;let n=this.lineNumber,i=this.columnNumber+1,s=r.length;this.pushToken({tokens:[21],value:r,pos:{col:i-s,line:n,len:s,colEnd:i}}),this.move()}lexIt(){for(;!this.endOfFile;){for(;this.isWhiteSpace();)this.move();let e=this.getWord();e&&this.process(e)}}static{this.SINGLE_CHAR_TOKENS=new Map([["{",[2]],["}",[3]],["(",[42]],[")",[43]],["[",[11]],["]",[12]],[";",[1]],[":",[50]],["=",[0]],[">",[4]],["<",[5]],["!",[6]],["|",[8]],["^",[9]],["&",[40,7]],["~",[10]],["/",[13]],["\\",[14]],["+",[15]],["-",[16]],["*",[17]],["%",[18]],["?",[44]],[".",[45]],["_",[48]],["@",[49]],[",",[24]]])}static{this.KEYWORD_TOKENS=new Map([["true",38],["false",39],["#define",25],["#include",26],["#line",27],["#undef",28],["#error",29],["#pragma",30],["#defined",31],["#if",32],["#ifdef",33],["#ifndef",34],["#elif",35],["#else",36],["#endif",37]])}process(e){let r=this.isString(e);if(!r){let i=t.KEYWORD_TOKENS.get(e.toLowerCase());if(i&&(r=!0,this.pushToken({tokens:[i],value:e.toLowerCase(),pos:this.generatePos(e,e.toLowerCase())}),i===39||i===38)){let s=this.tokens.length-1;if(qt(this.tokens[s-1],this.tokens[s]))r=!1,this.tokens.pop();else return!0}}if(r||(r=this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)),!r&&e.length===1){let i=t.SINGLE_CHAR_TOKENS.get(e);if(i)return r=!0,this.pushToken({tokens:i,value:e,pos:this.generatePos(e,e)}),!0}if(r||(r=this.isHash(e)||this.unknownToken(e)),!r)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let n=this._tokens[this._tokens.length-1];return r&&!n?.tokens.some(i=>i===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}pushToken(e){let r={tokens:e.tokens,pos:e.pos,value:e.value,uri:this.uri},n=this._tokens[this._tokens.length-1];r.prevToken=n,n&&(n.nextToken=r),this._tokens.push(r)}isLetters(e){let r=e[0]?.charCodeAt(0);if(t.isLetterCode(r)){let n="";for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(t.isLetterCode(s))n+=e[i];else break}return this.pushToken({tokens:[47],value:n,pos:this.generatePos(e,n)}),!0}return!1}isDigit(e){let r=e[0],n=r?.charCodeAt(0);return n>=48&&n<=57?(this.pushToken({tokens:[20,19],value:r,pos:this.generatePos(e,r)}),!0):!1}isHexDigit(e){let r=e[0],n=r?.charCodeAt(0);return n>=65&&n<=70||n>=97&&n<=102?(this.pushToken({tokens:[20,47],value:r,pos:this.generatePos(e,r)}),!0):!1}isHash(e){let r="#";return e.startsWith(r)?(this.pushToken({tokens:[46],pos:this.generatePos(e,r),value:r}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isString(e){if(this.inComment)return!1;let r=e[0];if(r==='"'||r==="'"){let n=e.length-1;if(this.columnNumber+1<n)throw new Error("Error while rewinding");return this.columnNumber-=n,this.getString(r),!0}return!1}generatePos(e,r){let n=this.columnNumber-e.length,i=r.length;return{line:this.lineNumber,col:n,len:i,colEnd:n+i}}};var By,mf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,r,n,i){e=nt(e);let s=`${Array.from(n).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(n),o;console.log("No cpreprocess cache",e);let a=new Yo(e,r,n),c=this.includeOwners.get(a)??new Set;return c.add(i),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(s,a),a}reset(e){e=nt(e);let r=this.headerFiles.get(e);r&&Array.from(r).forEach(n=>{n[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(n[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function vc(){return By??=new mf,By}function $E(){By=new mf}var Fy,gf=class t{constructor(){this.fileMap=new Map}static clone(e){let r=e.length;if(r===0)return[];let n=new Array(r),i;for(let s=0;s<r;s++){let o=e[s],a={tokens:o.tokens,pos:o.pos,value:o.value,uri:o.uri,prevToken:i,nextToken:void 0};i&&(i.nextToken=a),n[s]=a,i=a}return n}needsRenew(e,r){return e=nt(e),this.fileMap.get(e)?.text!==r}getDocument(e,r){return Kn.create(e,"devicetree",0,r??this.fileMap.get(e)?.text??(0,bc.readFileSync)(e).toString())}renewLexer(e,r){if(e=nt(e),vc().reset(e),!r&&!(0,bc.existsSync)(e))return[];try{r??=(0,bc.readFileSync)(e).toString();let n=new Go(r,e);return this.fileMap.set(e,n),t.clone(n.tokens)}catch{}return[]}requestTokens(e,r){e=nt(e);let n=this.fileMap.get(e)?.tokens;return!n&&r?[...this.renewLexer(e)]:t.clone(n??[])}reset(e){e=nt(e),vc().reset(e),this.fileMap.delete(e)}};function Or(){return Fy??=new gf,Fy}function BE(){Fy=new gf}var yf=class t extends Zi{constructor(r,n=()=>Or().requestTokens(this.uri,!0)){super();this.uri=r;this.getTokens=n;this.comments=[];this.tokens=[]}cleanUpComments(){let r=[];for(let n=0;n<this.tokens.length;n++){let i=t.processBlockComment(this.tokens,n)||t.processLineComment(this.tokens,n);i&&(n=i.index,r.push(...i.tokenUsed),this.comments.push(i.comment))}if(r.length>0){let n=new Set(r),i=[];for(let s=0;s<this.tokens.length;s++)n.has(s)||i.push(this.tokens[s]);this.tokens=i}}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=this.getTokens(),this.cleanUpComments()}static processBlockComment(r,n){let i=[],s=()=>(i.push(n++),r[n]),o=()=>r[n],a=()=>r[n-1],c=o(),l=c;if(!c||!U(c,13)||(l=s(),!U(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!U(a(),17)||!U(o(),13)||!qt(a(),o())),d=l.pos.line,f=c,p=[];l=s();do{if(o()?.pos.line!==d){let T=new ln(oe(f,a()));p.push(T),d=o().pos.line??0,f=o()}l=s()}while(n<r.length&&!u());let g=new ln(oe(f,o()));p.push(g);let h=new cn(p);return s(),{comment:h,tokenUsed:i,index:n-1}}static processLineComment(r,n){let i=[];if(!U(r[n],13)||r.length===n+1||!U(r[n+1],13)||!qt(r[n],r[n+1]))return;for(;r[n].pos.line===r.at(n+1)?.pos.line;)i.push(n++);return i.push(n++),{comment:new ln(oe(r[i[0]],r[i.at(-1)])),tokenUsed:i,index:n-1}}};var FE=$(H());var Tf=class extends Q{constructor(r,n){super(r);this.content=n}toString(){let r=this.content.filter(n=>!U(n,14));return r.map((n,i)=>{let s=n.value;return n.pos.line===r.at(i+1)?.pos.line?s=s.padEnd(r[i+1].pos.col-n.pos.col," "):r.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},_c=class extends Q{constructor(r,n,i){super();this.keyword=r;this.identifier=n;this.content=i;this.addChild(r),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Dt?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:FE.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
188
- `)}}};var Vs=class extends Q{constructor(e){super(e)}},Sc=class extends Q{constructor(r,n){super();this.keyword=r;this.content=n;this.active=!1;this.addChild(r)}},Nc=class extends Sc{constructor(r,n,i){super(r,i);this.identifier=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.identifier&&r.has(this.identifier.name)}},vf=class extends Sc{constructor(r,n,i){super(r,i);this.expression=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.expression?.isTrue(r)}},bf=class extends Nc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},kc=class extends Sc{};var es=class extends Q{constructor(r,n,i){super();this.ifDef=r;this.endIf=n;this.elseOption=i;this.addChild(r),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:s(this.firstToken),end:s(this.lastToken)}];i.push({start:s(this.ifDef.firstToken),end:s(this.ifDef.identifier.lastToken)});let o=this.ifDef.useBlock(r);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&i.push({start:s(this.ifDef.content.firstToken),end:s(this.ifDef.content.lastToken)}),this.elseOption&&(i.push({start:s(this.elseOption.firstToken),end:s(this.elseOption.keyword.lastToken)}),o&&this.elseOption.content&&i.push({start:s(this.elseOption.content.firstToken),end:s(this.elseOption.content.lastToken)})),this.endIf&&i.push({start:s(this.endIf.firstToken),end:s(this.endIf.lastToken)}),i}},ts=class extends Q{constructor(r,n,i){super();this.ifBlocks=r;this.endIf=n;this.elseOption=i;r.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach(a=>{i.push({start:s(a.firstToken),end:s(a.expression?.lastToken??a.keyword.lastToken)}),!o&&a.useBlock(r)?(a.active=!0,o=!0):a.content&&i.push({start:s(a.content.firstToken),end:s(a.content.lastToken)})}),this.elseOption&&(i.push({start:s(this.elseOption.keyword.firstToken),end:s(this.elseOption.keyword.lastToken)}),o&&this.elseOption.content?i.push({start:s(this.elseOption.content.firstToken),end:s(this.elseOption.content.lastToken)}):this.elseOption.active=!0),this.endIf&&i.push({start:s(this.endIf.firstToken),end:s(this.endIf.lastToken)}),i}};var Yo=class extends Zi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.getTokens=s;this.skipIncludes=o;this.tokens=[];this.nodes=[];this._comments=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([a,c])=>this.macroSnapShot.set(a,c)),Array.from(i).forEach(([a,c])=>this.macros.set(a,c)))}get comments(){return this._comments}get currentToken(){let r=this.prevToken,n=Cn(r,this.tokens.at(this.peekIndex()))||!r||U(r,14)&&r.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!n))return this.macroStart&&U(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(r){super.reset(),this.macros.clear(),r?(this.macroSnapShot.clear(),Array.from(r).forEach(([n,i])=>this.macroSnapShot.set(n,i)),Array.from(r).forEach(([n,i])=>this.macros.set(n,i))):Array.from(this.macroSnapShot).forEach(([n,i])=>this.macros.set(n,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(r){let n=this.stable;return this.parsing=new Promise(i=>{n.then(()=>{if(r&&r.size===this.macroSnapShot.size){let s=Array.from(r);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=s[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),i();return}}this.reset(r),this.parse().then(i)})}),this.parsing}async parse(){let r=new yf(this.uri,this.getTokens);if(await r.stable,this.tokens=r.tokens,this._comments=r.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||!le(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let n=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processError();this.processIfDefBlocks(),n&&this.moveEndOfLine(n,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,25))return this.popStack(),!1;this.macroStart=!0;let i=new ut(oe(n)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(W(30,i.firstToken,i.lastToken,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Tf(oe(o[0],o.at(-1)),o));let c=new _c(i,s,a);this.macros.set(c.name,{macro:c,resolver:yE(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(r,l-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,28))return this.popStack(),!1;this.macroStart=!0;let i=new ut(oe(n)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(W(30,i.firstToken,i.lastToken,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new _c(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(r,a-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processError(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,29))return this.popStack(),!1;this.moveEndOfLine(n,!1,!0);let i=this.peekIndex();return this.tokens.splice(r,i-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),!0}consumeDefinitionContent(){let r=[];for(;this.currentToken;){let n=this.moveToNextToken;n&&r.push(n)}return r}isFunctionDefinition(){this.enqueueToStack();let r=this.processCIdentifier(this.macros,!0);if(!r){this.popStack();return}let n=this.moveToNextToken;if(!U(n,42)||!qt(r.lastToken,n)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!U(this.currentToken,24)&&!U(this.currentToken,43)?this._issues.push(W(28,s.firstToken,s.lastToken,s)):U(this.currentToken,43)||(n=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new ei(r,i);if(U(this.currentToken,43))n=this.moveToNextToken,o.lastToken=n;else{o.lastToken=this.prevToken;let a=i.at(-1)??o;this._issues.push(W(26,a.firstToken,a.lastToken,a))}return this.mergeStack(),o}processVariadic(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(45),Ie(45),Ie(45)]);if(r.length!==3){this.popStack();return}let n=new hf(oe(r[0],r.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let r=this.peekIndex(),n=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>U(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[37].some(a=>U(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[36,35].some(a=>U(o,a))&&!Cn(o.prevToken,o));if(!n)return;let i;U(n.startToken,32)?i=this.processIfBlock(n,(o,a,c)=>new vf(o,a??null,c)):i=this.processIfDefBlock(n,(o,a,c)=>U(n.startToken,33)?new Nc(o,a??null,c):new bf(o,a??null,c)),this.nodes.push(i),i.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...i instanceof ts?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(W(47,o.content.firstToken,o.content.lastToken,o.content,{severity:Rc.DiagnosticSeverity.Hint,tags:[Rc.DiagnosticTag.Unnecessary]}))}),this.positionStack[this.positionStack.length-1]=r}processIfDefBlock(r,n){this.enqueueToStack(),this.macroStart=!0;let i=new ut(oe(r.startToken));r.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(W(31,i.firstToken,i.lastToken,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&r.splitTokens[0].tokens.find(f=>f===a)&&(o=new Vs(oe(a,r.splitTokens[0].tokens.at(-1))));let c=n(i,s??null,o??null),l;if(r.splitTokens.length>1){let f=r.splitTokens[1].tokens[0].prevToken,p=new ut(oe(f)),g;r.splitTokens[1].tokens.length&&(g=new Vs(oe(r.splitTokens[1].tokens[0],r.splitTokens[1].tokens.at(-1)))),l=new kc(p,g??null)}let u;r.endToken?u=new ut(oe(r.endToken)):this._issues.push(W(46,i.firstToken,i.lastToken,i));let d=new es(c,u??null,l);return this.mergeStack(),d}processIfBlock(r,n){this.enqueueToStack();let i=new ut(oe(r.startToken)),s=[],o;r.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ut(oe(d));this.macroStart=!0;let p=this.processExpression(this.macros,f,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===r.splitTokens.length-1&&U(d,36)){let h=d,T=new ut(oe(h)),S;l.tokens.length&&(S=new Vs(oe(l.tokens[0],l.tokens.at(-1)))),o=new kc(T,S??null)}else{p||this._issues.push(W(31,i.firstToken,i.lastToken,i));let h,T=p?.lastToken.nextToken??i.lastToken.nextToken;T&&l.tokens.find(_=>_===T)&&(h=new Vs(oe(T,r.splitTokens[u].tokens.at(-1))));let S=n(f,p??null,h??null);s.push(S)}});let a;r.endToken?a=new ut(oe(r.endToken)):this._issues.push(W(46,i.firstToken,i.lastToken,i));let c=new ts(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes,...this.comments]}resolveInclude(r){if(r.path.path)return r.path.relative?[(0,Ko.resolve)((0,Ko.dirname)(r.uri),r.path.path),...this.incudes.map(n=>(0,Ko.resolve)(n,r.path.path))].find(n=>(0,jy.existsSync)(n)):this.incudes.map(n=>(0,Ko.resolve)(n,r.path.path)).find(n=>(0,jy.existsSync)(n))}async processInclude(){this.enqueueToStack();let r=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let i=n,s=n;if(U(n,26))this.moveToNextToken;else{let h=this.checkConcurrentTokens([Ie(13),Ze("include"),Ie(13)]);if(h.length!==3)return this.popStack(),!1;i=h[0],s=h.at(-1)}let o=i,a=new ut(oe(i,s));n=this.moveToNextToken;let c=n,l=!!U(n,21);if(!c||!l&&!U(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!U(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new Wo(u,l,oe(c,n)),f=new Ri(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!U(this.currentToken,4)?this._issues.push(W(12,f.firstToken,f.lastToken,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(f);if(f.resolvedPath=g,g||this._issues.push(W(36,f.path.firstToken,f.path.lastToken,f.path,{severity:Rc.DiagnosticSeverity.Warning})),g&&!this.skipIncludes){Or().requestTokens(g,!0);let h=vc().getCPreprocessorParser(g,this.incudes,this.macros,this.uri);await h.stable,this._issues.push(...h.issues),this.macros.clear(),Array.from(h.macros).forEach(([T,S])=>this.macros.set(T,S)),g.endsWith(".h")?this.tokens.splice(r,p-r):this.tokens.splice(r,p-r,...h.tokens),this.nodes.push(...h.nodes),this.dtsIncludes.push(...h.dtsIncludes)}else this.tokens.splice(r,p-r);return this.positionStack[this.positionStack.length-1]=r,!0}};var jE=$(H());var _f=class extends Q{constructor(r,n,i){super();this.keyword=r;this.startAddress=n;this.endAddress=i;this.addChild(r),this.docSymbolsMeta={name:"Memreserve",kind:jE.SymbolKind.Function},this.addChild(n),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var UE=$(H());var Sf=class extends Q{constructor(r,n){super();this.keyword=r;this.bitsSize=n;this.addChild(r),this.docSymbolsMeta={name:"bits",kind:UE.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var zs=class extends Zi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new lt;this.unhandledStatements=new St;this.cPreprocessorParser=new Yo(this.uri,this.incudes,i,s,o)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(r=>r.resolvedPath).filter(r=>!!r)]}reset(){super.reset(),this.others=[],this.rootDocument=new lt,this._issues=[],this.unhandledStatements=new St}async reparse(){let r=performance.now(),n=this.stable;return this.parsing=new Promise(i=>{n.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-r),i()})}),this.parsing}async parse(){if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,nt(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isPlugin()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements)||this.isChildNode(this.unhandledStatements,"Name"))){let s=this.moveToNextToken;s&&(this._issues.push(W(22,s,s,null)),this.reportExtraEndStatements())}};for(;!this.done;)await r();this.unhandledStatements.properties.forEach(s=>{this._issues.push(W(32,s.firstToken,s.lastToken,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(W(33,s.firstToken,s.lastToken,s))});let n=this.allAstItems.flatMap(s=>[s,...s.allDescendants]),i=this.cPreprocessorParser.comments;if(i.length&&n.forEach(s=>{(s instanceof lt||s instanceof Ke)&&SE(s,i)}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(r){this.enqueueToStack();let n=this.moveToNextToken,i=n,s=13;if(!n||!U(n,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!U(i,s))return this.popStack(),!1;let o=new St;o.openScope=i,r.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(r){let n=this.currentToken;if(U(n,3))this.moveToNextToken;else{let i=this.prevToken;return i&&this._issues.push(W(3,i,i,r)),this.endStatement(r,!1)}return this.prevToken?.value==="}"&&(r.closeScope=this.prevToken),this.endStatement(r)}isNodeEnd(){return U(this.currentToken,3)||U(this.currentToken,1)}endStatement(r,n=!0){let i=this.currentToken;if(!U(i,1)){let s=this.prevToken;if(s&&n)return this._issues.push(W(1,s,s,r)),s}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;U(this.currentToken,1);){let r=this.moveToNextToken;r&&this._issues.push(W(23,r,r,null))}}processNode(r,n){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(r,n)||this.isProperty(r)||this.isDeleteNode(r,n)||this.isDeleteProperty(r),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;o&&(this._issues.push(W(22,o,o,null)),this.reportExtraEndStatements())}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(r=!1){let n=[],i=this.isLabelAssign(r);for(;i;)n.push(i),i=this.isLabelAssign(r);return n}isChildNode(r,n){this.enqueueToStack();let i;n==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new Wt(s):new He(s,i);if(n==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(c),!a||!U(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef(c)):n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!U(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(W(n==="Name"?[7]:[10,48,11],c.firstToken,this.currentToken?.nextToken,c))}let l=!1;if(a&&c instanceof Wt?(c.reference=a,l=!0):o&&c instanceof He&&(l=o.address!==void 0,c.name=o),U(this.currentToken,2)){c.openScope=this.moveToNextToken;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(W(2,u.firstToken,u.lastToken,u))}else return this.popStack(),!1;return r.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(r){let n=this.prevToken;this.enqueueToStack();let i=this.checkConcurrentTokens([Ze("0"),Ze("x",{caseInsensitive:!0})]);i.length!==2?(i=[],this.popStack()):(this._issues.push(W(50,i[0],i[1],r,{severity:Nf.DiagnosticSeverity.Warning})),n=i.at(-1),this.mergeStack());let s=this.consumeAnyConcurrentTokens([19,20,48].map(Ie)),o=l=>{l.length%8!==0&&(l=l.padStart(Math.ceil(l.length/8)*8,"0"));let u=[];for(let d=0;d<l.length;d+=8){let f=l.slice(d,d+8);u.push(parseInt(f,16)>>>0)}return u},a=s.length?o(s.filter(l=>l.value!=="_").map(l=>l.value).join("")):[NaN];return n&&(a.some(l=>Number.isNaN(l))?this._issues.push(W(8,n,n,r)):!Number.isNaN(a)&&!qt(n,s[0])&&this._issues.push(W(29,n,s[0],r,{inclusiveStart:!1,inclusiveEnd:!1}))),this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(W(51,this.currentToken,this.currentToken,r,{severity:Nf.DiagnosticSeverity.Warning})),this.moveToNextToken),new Tc(a,oe(i.at(0)??s[0]??this.prevToken,this.prevToken))}processNodeAddresses(r){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(49)]);if(n.length){qt(r.lastToken,n[0])||this._issues.push(W(29,r.lastToken,n[0],r,{inclusiveStart:!1,inclusiveEnd:!1}));let i=[],s=()=>{i.push(this.processNodeAddress(r)),U(this.currentToken,24)&&(this.prevToken&&!qt(this.prevToken,this.currentToken)&&this._issues.push(W(29,this.prevToken,this.currentToken,r,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken,s())};s();let o=this.currentToken;for(;!U(this.currentToken,2)&&!U(this.currentToken,1)&&!U(this.currentToken,3)&&Cn(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(W(52,o,this.currentToken,r));let a=new Tc([],oe(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Ie));if(!r.length){this.popStack();return}let n=r.map(o=>o.value).join(""),i=new Me(n,oe(r[0],r.at(-1))),s=this.processNodeAddresses(i);return i.address=s,lf(n)||this._issues.push(W(49,i.firstToken,i.lastToken,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Ie));if(!r.length){this.popStack();return}let n=new et(r.map(i=>i.value).join(""),oe(r[0],r.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}if(!lf(r?.[0].value)){this.popStack();return}let n=r.map(s=>s.value).join(""),i=new Zt(n,oe(r[0],r[r.length-1]));return this.mergeStack(),i}isLabelAssign(r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!n.length){this.popStack();return}if(!lf(n?.[0].value)){this.popStack();return}let i=n.map(c=>c.value).join(""),s=this.currentToken,o=s&&U(s,50),a=new Qi(new Zt(i,oe(n[0],n.at(-1))),oe(n[0],o?s:n.at(-1)));if(o){let c=n.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(W(29,c,s,a,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken}else if(r)this._issues.push(W(24,a.firstToken,a.lastToken,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(U(this.currentToken,2)||U(this.currentToken,49))return this.popStack(),!1;let s=new Ke(i,n),o;U(this.currentToken,0)?(s.assignOperatorToken=this.moveToNextToken,o=this.processValue(r),o?.values.filter(c=>!!c).length||this._issues.push(W(0,s.firstToken,s.lastToken,s)),s.values=o??null):s.values=void 0;let a=this.endStatement(s);return s.lastToken=a,r.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Ze("d"),Ze("ts"),Ie(16),Ze("v"),Ze("1")]);if(r.length!==6)return this.popStack(),!1;let n=r[0],i=n,s=new ut;s.firstToken=n;let o=new ff(s);if(this.others.push(o),U(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=r.at(-1),this._issues.push(W(21,o.firstToken,o.lastToken,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(o),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Ze("memreserve")]);if(r.length!==2)return this.popStack(),!1;let n=new ut;n.firstToken=r[0];let s=r[0];U(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(W(21,n.firstToken,n.lastToken,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new _f(n,o,a);if(this.others.push(c),o||this._issues.push(W(37,n.firstToken,n.lastToken,n)),!a){let l=o??n;this._issues.push(W(38,l.firstToken,l.lastToken,c))}return c.lastToken=this.endStatement(c),this.mergeStack(),!0}isPlugin(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Ze("plugin"),Ie(13)]);if(r.length!==3)return this.popStack(),!1;let n=new ut(oe(r[0],r.at(-1)));return n.lastToken=this.endStatement(n),this.mergeStack(),this.others.push(n),!0}processBits(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Ze("b"),Ze("its")]);if(r.length!==3){this.popStack();return}let n=new ut;n.firstToken=r[0];let s=r[0];U(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(W(21,n.firstToken,n.lastToken,n)));let o=this.processDec(),a=new Sf(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(W(40,o.firstToken,o.lastToken,o)):this._issues.push(W(39,n.firstToken,n.lastToken,n)),this._issues.push(W(41,a.firstToken,a.lastToken,a,{severity:Nf.DiagnosticSeverity.Warning})),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),Ze("omit"),Ie(16),Ze("if"),Ie(16),Ze("no"),Ie(16),Ze("ref"),Ie(13)]);if(r.length!==9){this.popStack();return}let n=new ut(oe(r[0],r.at(-1)));return this.mergeStack(),n}isDeleteNode(r,n){this.enqueueToStack();let i=this.checkConcurrentTokens([Ie(13),Ze("d"),Ze("e"),Ze("lete",{allowPartial:!0}),Ie(16),Ze("node",{allowPartial:!0})]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new ut;if(a.firstToken=s,i.length===1&&!U(this.currentToken,2)){this._issues.push(W(25,a.firstToken,a.lastToken,a)),a.lastToken=i.at(-1);let d=new Ar(a);return r.addNodeChild(d),this.mergeStack(),!0}let c=i.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=i.at(-1),c!=="/delete-node"?this._issues.push(W(c.startsWith("/delete-n")?34:25,a.firstToken,a.lastToken,a)):U(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(W(21,a.firstToken,a.lastToken,a));let l=new Ar(a);if(Cn(a.lastToken,s)){let d=this.processNodePathRef(r);d&&n==="Name"&&this._issues.push(W(7,d.firstToken,d.lastToken,d));let f=d?void 0:this.isLabelRef(r);f&&n==="Name"&&this._issues.push(W(7,f.firstToken,f.lastToken,f));let p=d||f?void 0:this.isNodeName();p&&n==="Ref"&&this._issues.push(W(10,p.firstToken,p.lastToken,p)),!d&&!p&&!f&&this._issues.push(W([7,10],l.firstToken,l.lastToken,l)),l.nodeNameOrRef=d??f??p??null}else n==="Name"?this._issues.push(W(7,a.firstToken,a.lastToken,a)):n==="Ref"&&this._issues.push(W(10,a.firstToken,a.lastToken,a));let u=this.endStatement(l);return l.lastToken=u,r.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(r){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),Ze("d"),Ze("e"),Ze("lete",{allowPartial:!0}),Ie(16),Ze("property",{allowPartial:!0})]);if(!n.length)return this.popStack(),!1;let i=n[0],s=i,o=new ut;if(o.firstToken=i,n.length===1&&!U(this.currentToken,2)){this._issues.push(W(25,o.firstToken,o.lastToken,o)),o.lastToken=n.at(-1);let u=new ht(o);return r.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(W(a.startsWith("/delete-p")?35:25,o.firstToken,o.lastToken,o)):U(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(W(21,o.firstToken,o.lastToken,o));let c=new ht(o);if(Cn(o.lastToken,i)){let u=this.isPropertyName();u||this._issues.push(W(6,c.firstToken,c.lastToken,c)),c.propertyName=u??null}else this._issues.push(W(6,o.firstToken,o.lastToken,o));let l=this.endStatement(c);return c.lastToken=l,r.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processNodePathRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let o=new vr(n,i,s);return this.mergeStack(),o}processValue(r){this.enqueueToStack();let i=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef(r)||this.isLabelRefValue(r)||this.arrayValues(r)||this.processByteStringValue()||this.isExpressionValue(r))??null,a=o();if(!a)return[];let c=[a];for(;!U(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d,f=U(this.currentToken,24);if(f)d=this.currentToken,this.moveToNextToken;else if(!Cn(this.prevToken,this.currentToken))break;let p=o();if(u&&p===null&&f){let h=new Q(oe(u,this.currentToken));this._issues.push(W(0,h.firstToken,h.lastToken,h))}if(!f&&p===null)break;if(l&&!f&&p){let h=new Q(oe(l));this._issues.push(W(28,h.firstToken,h.lastToken,h))}let g=c.at(-1);g&&(g.nextValueSeparator??=d),c.push(p)}return c})();if(i.length===0){this.popStack();return}return this.mergeStack(),new df(i)}processStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.consumeAnyConcurrentTokens([Ie(21)]);if(!n.length){this.popStack();return}if(n.some(u=>u.value===void 0))throw new Error("Token must have value");let i=n.map(u=>u.value).join(`
189
- `),s=i,o=['"',"'"].some(u=>s.endsWith(u));o&&(s=s.slice(1,-1));let a=new ne(s,oe(n[0],n.at(-1)));o||this._issues.push(W(i.startsWith('"')?16:17,a.firstToken,a.lastToken,a));let c=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0));let l=new vr(r,a,c);return this.mergeStack(),l}arrayValues(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processBits(),s=this.currentToken;if(U(s,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(r)??null;o.openBracket=s;let a=this.processOptionalLabelAssign(!0)??[],c=new vr(n,o,a,i);if(!U(this.currentToken,4))this._issues.push(W(12,c.firstToken,c.lastToken,c));else{let u=this.moveToNextToken;o&&(o.closeBracket=u)}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=s,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.moveToNextToken,i=n;if(!U(i,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value&&u.value.firstToken===u.value.lastToken&&(d=u.value.firstToken.pos.len),d%2!==0&&this._issues.push(W(15,u.firstToken,u.lastToken,u))});let a=new ki(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=n,this._issues.push(W(14,a.firstToken,a.lastToken,a)));let c=new vr(r,a,o);U(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(W(5,c.firstToken,c.lastToken,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=n,a.lastToken=this.prevToken,c}processLabeledValue(r){this.enqueueToStack();let n=r(),i=[];if(!n)return this.popStack(),[];for(;n;)i.push(n),n=r();if(i.length){let s=r();s&&i.push(s)}return this.mergeStack(),i}processArrayValues(r){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(r,!1)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1,r)),i=new jt(n);return n.length===0&&(i.firstToken=this.currentToken),this.mergeStack(),i}processLabeledHex(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processHex();if(!i){this.popStack();return}let s=new Zn(i,n);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!1),n=this.checkConcurrentTokens([20,20].map(Ie));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(a=>a.value).join(""),16),s=new cr(i,oe(n[0],n.at(-1)),16),o=new Zn(s,r);return this.mergeStack(),o}processLabeledDec(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processDec();if(!i){this.popStack();return}let s=new Zn(i,n);return this.mergeStack(),s}processLabeledExpression(r=!0,n=r,i){this.enqueueToStack();let s=[];r&&(s=this.processOptionalLabelAssign(n));let o=this.processExpression(this.cPreprocessorParser.macros,i);if(!o){this.popStack();return}let a=new Zn(o,s);return this.mergeStack(),a}isExpressionValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),i=this.processExpression(this.cPreprocessorParser.macros,r);if(!i){this.popStack();return}let s=this.processOptionalLabelAssign(!0),o=new vr(n,i,s);return this.mergeStack(),o}isLabelRef(r){this.enqueueToStack();let n=this.currentToken;if(!n||!U(n,40)){this.popStack();return}else this.moveToNextToken;let i=this.isLabelName();if(!i){let o=new ie(null);return this._issues.push(W(18,n,n,r)),o.firstToken=n,this.mergeStack(),o}n&&(i.firstToken.pos.line!==n.pos.line||i.firstToken.pos.col!==n.pos.colEnd)&&this._issues.push(W(29,n,i.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}));let s=new ie(i);return s.firstToken=n,this.mergeStack(),s}isLabelRefValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.isLabelRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new vr(n,i,s);return this.mergeStack(),o}processRefValue(r,n){this.enqueueToStack();let i=this.processOptionalLabelAssign(n),s=this.currentToken;if(!s||!U(s,40)){this.popStack();return}let o=this.processNodePathRef(r);if(o!==void 0){let l=new Zn(o,i);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(W([18,9],s,s,r));let l=new Zn(null,i);return l.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),l}let c=new Zn(a,i);return c.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(r=!0,n=new On){this.enqueueToStack();let i;if(U(this.currentToken,13))i=this.moveToNextToken;else{if(!r){this.popStack();return}this.prevToken&&this._issues.push(W(19,this.prevToken,this.prevToken,n))}let s=this.isNodeName(),o=i??this.prevToken;if(!s&&o&&!r&&this._issues.push(W(7,o,o,n)),!r||s?n.addPath(s??null,i?new Q(oe(i)):void 0):r&&!s&&i&&(n.addPath(new Me("/",oe(i))),n.firstToken=i),r&&!i&&n.children.length===0){this.mergeStack();return}return this.processNodePath(!1,n),this.mergeStack(),n}processNodePathRef(r){this.enqueueToStack();let n=this.moveToNextToken,i=n;if(!U(i,40)){this.popStack();return}let s=this.moveToNextToken;if(i=s,!U(i,2)){this.popStack();return}n&&!qt(n,s)&&this._issues.push(W(29,n,s,r,{inclusiveStart:!1,inclusiveEnd:!1}));let o=this.processNodePath(),a=new it(o??null),c=this.currentToken??this.prevToken,l=c;return o?.children.forEach((u,d)=>{if(d===o?.children.length-1&&u&&l&&!qt(u.lastToken,l)){this._issues.push(W(29,u.lastToken,l,r,{inclusiveStart:!1,inclusiveEnd:!1}));return}if(d===0&&s&&!qt(s,u?.firstToken)){this._issues.push(W(29,s,u?.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}));return}let f=o?.children[d+1];u&&f&&!qt(u.lastToken,f.firstToken)&&this._issues.push(W(29,u.lastToken,f?.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}))}),U(c,3)?this.moveToNextToken:this.prevToken&&this._issues.push(W(3,this.prevToken,this.prevToken,r)),a.firstToken=n,a.lastToken=c??this.prevToken,this.mergeStack(),a}get includes(){return this.allAstItems.filter(r=>r instanceof Ri)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties,...this.unhandledStatements.nodes]}};var rU=async(t,e,r)=>{let n=Z.Position.create(t.pos.line,t.pos.col),i=r.find(s=>on(s,e,n));if(i)return Qn(i,e,n)},Uy=t=>{if(t)return t instanceof lt?t:Uy(t?.parentNode)},Jo=(t,e,r=0)=>{if(!e||!le(e.uri,t)||!e.parentNode?.uri)return r;let n=Uy(e.parentNode);return Jo(t,n,r+1)},nU=(t,e)=>async r=>{let n=t.filter(a=>!(a instanceof Ri)&&!(a instanceof ln)&&!(a instanceof cn)&&!(a instanceof es)),i=await rU(r.firstToken,e,n);if(!i||i===r||r.allDescendants.some(a=>a===i))return{level:0};let s=Uy(i);return{level:Jo(e,s),inAst:i}};async function Hy(t,e,r){let n=Re(t.textDocument.uri),i=new zs(n,[],void 0,()=>new Go(e,n).tokens,!0);await i.stable;let s=i.issues.filter(o=>Vo(o.raw,n,!1));if(s?.length)throw new Z.ResponseError(Z.ErrorCodes.InternalError,"Unable to format. File has syntax issues.",s.map(o=>o.diagnostic()));return zE(t,i.allAstItems,n,e,r)}async function zE(t,e,r,n,i){let s=n.split(`
190
- `),o=iU(e,s),a=nU(e,r),c=(await Promise.all(e.flatMap(async f=>await YE(t,f,r,a,s)))).flat();if(t.options.insertFinalNewline&&s.at(-1)?.trim()!==""){let f=Z.TextEdit.insert(Z.Position.create(s.length,s[s.length-1].length),`
191
- `);c.push(Cr(4,r,Z.Position.create(s.length,0),{edit:f,codeActionTitle:"Insert new line"}))}if(t.options.trimFinalNewlines){let f=0;for(;s.at(-(1+f))?.trim()==="";)f++;if(f>1){let p=Z.TextEdit.del(Z.Range.create(Z.Position.create(s.length-f,0),Z.Position.create(s.length-1,0)));c.push(Cr(3,r,Z.Position.create(s.length,0),{edit:p,codeActionTitle:"Remove trailing EOF lines"}))}}let l=c.flatMap(f=>f.raw.edit).filter(f=>!!f);if(t.options.trimTrailingWhitespace){let f=sU(s,l,r);c.push(...f)}let u=o.length?c.filter(f=>(Array.isArray(f.raw.edit)?f.raw.edit:f.raw.edit?[f.raw.edit]:void 0)?.every(g=>!VE(g.range.start,o)&&!VE(g.range.end,o))):c;"range"in t&&(u=u.filter(f=>pE(t.range,f.raw.range)));let d=()=>{let f=u.flatMap(p=>p.raw.edit).filter(p=>!!p);return bE(Kn.create(r,"devicetree",0,n),f)};return i==="New Text"?d():i==="File Diagnostics"?u:{text:d(),diagnostic:u}}async function Rf(t,e,r,n){let i=Re(t.textDocument.uri);e.formattingOptions=t.options;let s=await e.getRuntime(),o=s.fileTopMostAsts(i);if(s.includes.filter(c=>le(c.resolvedPath,i)).length>1){let c=[];o.forEach(l=>{c.some(u=>u.firstToken.pos.line===l.firstToken.pos.line&&u.firstToken.pos.col===l.firstToken.pos.col)||c.push(l)}),o=c}return zE(t,o,i,r,n)}var iU=(t,e)=>{let r=Z.Position.create(e.length-1,e.at(-1)?.length??0),n=[],i;return t.filter(o=>(o instanceof cn||o instanceof ln)&&/^dts-format (on|off)$/.test(o.toString().trim())).sort((o,a)=>o.firstToken.pos.line-a.firstToken.pos.line).forEach(o=>{let a=o.toString().trim();if(a==="dts-format off")i={start:Z.Position.create(o.firstToken.pos.line,o instanceof cn?o.firstToken.pos.colEnd:0)};else if(a==="dts-format on"&&i){let c=Z.Position.create(o.lastToken.pos.line,o instanceof cn?o.lastToken.pos.colEnd-1:e[o.lastToken.pos.line-1].length);n.push(Z.Range.create(i.start,c)),i=void 0}}),i&&n.push(Z.Range.create(i.start,r)),n};function HE(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}var VE=(t,e)=>e.some(r=>HE(t,r.start)>=0&&HE(t,r.end)<=0),sU=(t,e,r)=>{let n=[];return t.forEach((i,s)=>{let o=i.trimEnd();if(o.length!==i.length){let a=Z.Range.create(Z.Position.create(s,o.length),Z.Position.create(s,i.length));e.some(c=>_E(a,c.range))||n.push(Cr(2,r,a.start,{edit:Z.TextEdit.del(a),codeActionTitle:"Remove whitespace"},a.end))}}),n},Pf=(t,e,r=1,n=!1,i=t.prevToken)=>{if(i){let s=t.pos.line-i.pos.line,o=s-r;if(o&&(s!==2&&r!==0||r===0||n)){let a=Z.Position.create(i.pos.line,i.pos.colEnd),c=Z.Position.create(t.pos.line-(r?1:0),r?e[t.pos.line-(r?1:0)].length:t.pos.col),l=Z.TextEdit.replace(Z.Range.create(a,c),`
192
- `.repeat(r-(n?1:0)));return Cr(5,t.uri,a,{edit:l,codeActionTitle:o<0?"Insert required new lines":"Remove unnecessary new lines",templateStrings:[r.toString()]},c)}}else if(t.pos.line){let s=Z.Position.create(0,0),o=Z.Position.create(t.pos.line,0),a=Z.TextEdit.del(Z.Range.create(s,o));return Cr(1,t.uri,s,{edit:a,codeActionTitle:"Remove unnecessary new lines",templateStrings:["0"]},o)}},WE=(t,e,r,n="",i=1)=>{let s=t.pos.line===t.prevToken?.pos.line;if(t.prevToken&&s){let o=Z.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),a=Z.Position.create(t.pos.line,t.pos.col),c=Z.TextEdit.replace(Z.Range.create(o,a),`${`
193
- `.repeat(i)}${"".padStart(e*r.length,r)}${n}`);return Cr(0,t.uri,o,{edit:c,codeActionTitle:"Move to new line"},a)}},Vy=(t,e,r,n,i="")=>{let s=`${"".padStart(e*r.length,r)}${i}`,o=Z.Position.create(t.pos.line,0),a=Z.Position.create(t.pos.line,t.pos.col),c=Z.Range.create(o,a),l=vU(n,c);if(s===l)return[];let u=Z.TextEdit.replace(c,s);return[Cr(6,t.uri,o,{edit:u,codeActionTitle:"Fix indentation",templateStrings:[s.replaceAll(" ","\xB7").replaceAll(" ","\u2192")]},a)]},mt=(t,e,r=1,n=!1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){if(n)return[];let c=Pf(t.nextToken,e,0);if(!c)throw new Error("remove new LinesEdit must be defined");return r&&(c.raw.edit.newText=`${" ".repeat(r)}${c.raw.edit.newText}`),[c]}if(r===0){if(t.nextToken.pos.col===t.pos.colEnd)return[];let c=Z.Position.create(t.pos.line,t.pos.colEnd),l=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),u=Z.TextEdit.del(Z.Range.create(c,l));return[Cr(1,t.uri,c,{edit:u,codeActionTitle:"Remove space(s)"},l)]}if(t.pos.colEnd===t.nextToken.pos.col){let c=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),l=Z.TextEdit.insert(c," ".repeat(r));return[Cr(7,t.uri,c,{edit:l,codeActionTitle:"Insert Space(s)",templateStrings:[r.toString()]})]}if(t.nextToken.pos.col-t.pos.colEnd===r&&e[t.pos.line].slice(t.pos.colEnd,t.nextToken.pos.col)===" ".repeat(r))return[];let s=Z.Position.create(t.pos.line,t.pos.colEnd),o=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),a=Z.TextEdit.replace(Z.Range.create(s,o)," ".repeat(r));return[Cr(1,t.uri,s,{edit:a,codeActionTitle:"Insert space(s)"},o)]},Pc=(t,e)=>t.slice(1).flatMap(r=>r.firstToken.prevToken?mt(r.firstToken.prevToken,e):[]),oU=async(t,e,r,n,i,s,o)=>{if(!le(e.uri,r))return[];let a=[];if(a.push(...Ir(e.firstToken,n,i,s,void 0,e.firstToken.prevToken?.value==="{"&&!e.topComment||e.topComment?1:2,!0)),e instanceof He||e instanceof Wt)if(a.push(...Pc(e.labels,s)),e instanceof He){e.labels.length&&e.name&&e.name.firstToken.prevToken&&a.push(...mt(e.name.firstToken.prevToken,s));let c=e.name&&e.openScope?mt(e.name.lastToken,s):[];a.push(...c)}else{e.labels.length&&e.reference?.firstToken.prevToken&&a.push(...mt(e.reference.firstToken.prevToken,s));let c=e.reference&&e.openScope?mt(e.reference.lastToken,s):[];a.push(...c)}else e instanceof St&&e.firstToken.value==="/"&&e.openScope&&a.push(...mt(e.firstToken,s,1));return a.push(...(await Promise.all(e.children.flatMap(c=>YE(t,c,r,o,s,n+1)))).flat()),e.closeScope&&(e.openScope&&e.closeScope.prevToken===e.openScope?a.push(...mt(e.openScope,s,0)):a.push(...Ir(e.closeScope,n,i,s,void 0,1,!0))),e.lastToken.value===";"&&e.closeScope&&a.push(...Ec(e.closeScope,e.lastToken)),a},aU=(t,e,r,n,i,s)=>{let o=[];if(o.push(...Pc(e.labels,s)),e.labels.length&&e.value?.firstToken.prevToken&&o.push(...mt(e.value.firstToken.prevToken,s)),e.firstToken.prevToken)if(e.firstToken.pos.line!==e.firstToken.prevToken?.pos.line&&e.firstToken.prevToken!==i){let a=Pf(e.firstToken,s,1,!0);a&&o.push(a),o.push(...Vy(e.firstToken,r,n.singleIndent,s,Xo(n,t+4)))}else o.push(...mt(e.firstToken.prevToken,s,i&&e.firstToken.prevToken===i?0:1));return e.value instanceof we&&o.push(...kf(e.value,s,r,n,t+4)),o},cU=(t,e,r,n,i)=>{let s=[];return e instanceof jt||e instanceof ki?e.openBracket&&e.openBracket?.nextToken===e.closeBracket?s.push(...mt(e.openBracket,i,0)):(s.push(...e.values.flatMap(o=>aU(t,o,r,n,e.openBracket,i))),e.closeBracket?.prevToken&&(e.values.at(-1)?.lastToken===e.closeBracket?.prevToken||e.closeBracket?.prevToken.value==="/"&&e.closeBracket?.prevToken?.prevToken?.value==="*"?s.push(...mt(e.closeBracket.prevToken,i,e.closeBracket.prevToken===e.values.at(-1)?.lastToken?0:1)):s.push(...Ir(e.closeBracket,r,n.singleIndent,i)))):e instanceof we&&s.push(...kf(e,i,r,n,t)),s},kf=(t,e,r,n,i)=>t instanceof Si?lU(t,e):t instanceof Xn?uU(t,e,r,n,i):[],lU=(t,e)=>{let r=[];return r.push(...mt(t.functionName.lastToken,e,0)),t.params.forEach((n,i)=>{n?.firstToken.prevToken&&r.push(...mt(n?.firstToken.prevToken,e,i?1:0)),n?.splitToken&&r.push(...Ec(n.lastToken,n.splitToken))}),t.lastToken.value===")"&&t.lastToken.prevToken&&r.push(...mt(t.lastToken.prevToken,e,0)),r},uU=(t,e,r,n,i)=>{let s=[];if(t.openBracket&&t.openBracket.nextToken&&(t.openBracket.pos.line===t.openBracket.nextToken.pos.line?s.push(...mt(t.openBracket,e,0)):s.push(...Ir(t.openBracket,r,n.singleIndent,e,Xo(n,i)))),s.push(...kf(t.expression,e,r,n,i)),t.join?.forEach(o=>{o.operator.firstToken.prevToken&&s.push(...mt(o.operator.firstToken.prevToken,e)),o.expression.firstToken.prevToken?.pos.line===o.expression.firstToken.pos.line?s.push(...mt(o.expression.firstToken.prevToken,e)):s.push(...Ir(o.expression.firstToken,r,n.singleIndent,e,Xo(n,i))),s.push(...kf(o.expression,e,r,n,i))}),!t.join?.length&&!(t.expression instanceof Xn)&&(t.expression instanceof Si||t.expression instanceof Dt)){let o=[];if(t.openBracket){let a=Z.Position.create(t.openBracket.pos.line,t.openBracket.pos.col),c=Z.Position.create(t.openBracket.pos.line,t.openBracket.pos.colEnd);o.push(Z.TextEdit.del(Z.Range.create(a,c)))}if(t.closeBracket){let a=Z.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.col),c=Z.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.colEnd);o.push(Z.TextEdit.del(Z.Range.create(a,c)))}s.push(Cr(9,t.uri,o[0].range.start,{edit:o,codeActionTitle:"Remove (...)"},o[o.length-1].range.end))}return t.closeBracket&&t.closeBracket.prevToken&&s.push(...mt(t.closeBracket.prevToken,e,0)),s},dU=(t,e,r,n,i)=>{let s=[];return s.push(...Pc(e.startLabels,i)),s.push(...cU(t,e.value,r,n,i)),s.push(...Pc(e.endLabels,i)),s},Xo=(t,e)=>{if(t.insertSpaces)return"".padStart(e," ");let r=Math.floor(e/t.tabSize),n=e%t.tabSize;return`${"".padStart(r," ")}${"".padStart(n," ")}`},fU=(t,e,r,n,i,s)=>{let o=[];return e.values.forEach((a,c)=>{if(!a)return[];let l=a.firstToken.prevToken,u=c?e.values.at(c-1):void 0;if(l)if(l.pos.line===a.firstToken.pos.line)if(l.value===","&&u?.lastToken.pos.line!==a.firstToken.pos.line&&l.prevToken?.pos.line!==a.firstToken.pos.line){let d=WE(a.firstToken,r,n.singleIndent,Xo(n,t+3));d&&o.push(d)}else o.push(...mt(l,i,1));else if(s&&a.firstToken.prevToken===s)o.push(...mt(s,i));else{let d=Pf(a.firstToken,i,1,!0);d&&o.push(d),o.push(...Vy(a.firstToken,r,n.singleIndent,i,Xo(n,t+3)))}o.push(...dU(t,a,r,n,i)),a.nextValueSeparator&&o.push(...Ec(a.lastToken,a.nextValueSeparator))}),o},pU=(t,e,r,n,i)=>{if(!le(t.uri,i))return[];let s=[];return s.push(...Ir(t.firstToken,e,r.singleIndent,n,void 0,void 0,t.firstToken.prevToken?.value==="{")),s.push(...Pc(t.labels,n)),t.labels.length&&t.propertyName?.firstToken.prevToken&&s.push(...mt(t.propertyName.firstToken.prevToken,n)),t.values&&(t.propertyName&&s.push(...mt(t.propertyName?.lastToken,n)),s.push(...fU(t.propertyName?.name.length??0,t.values,e,r,n,t.assignOperatorToken))),t.lastToken.value===";"&&s.push(...Ec(t.children[t.children.length-1].lastToken,t.lastToken)),s},Ir=(t,e,r,n,i,s,o)=>{let a=[],c=WE(t,e,r,i,s);if(c)a.push(c);else{let l=Pf(t,n,s,o);l&&a.push(l),a.push(...Vy(t,e,r,n,i))}return a},Ec=(t,e)=>{if(t.pos.line===e.pos.line&&t.pos.colEnd+1===e.pos.colEnd)return[];if(t.nextToken===e){let s=Z.Position.create(t.pos.line,t.pos.colEnd),o=Z.Position.create(e.pos.line,e.pos.col),a=Z.TextEdit.del(Z.Range.create(s,o));return[Cr(1,t.uri,s,{edit:a,codeActionTitle:"Remove Whitesapce",templateStrings:["0"]},o)]}let r=Z.Position.create(t.pos.line,t.pos.colEnd),n=Z.Position.create(e.pos.line,e.pos.colEnd),i=[Z.TextEdit.insert(r,e.value),Z.TextEdit.del(Z.Range.create(Z.Position.create(e.prevToken?.pos.line??e.pos.line,e.prevToken?.pos.colEnd??e.pos.col),n))];return[Cr(8,t.uri,r,{edit:i,codeActionTitle:"Move token",templateStrings:[e.value]},n)]},hU=(t,e,r,n)=>{let i=[];i.push(...Ir(t.firstToken,e,r,n));let s=mt(t.keyword.lastToken,n);return i.push(...s),t.lastToken.value===";"&&i.push(...Ec(t.children[t.children.length-1].lastToken,t.lastToken)),i},mU=(t,e,r,n,i)=>{if(r===void 0)return[];if(!le(t.uri,e))return[];let s=[];s.push(...Ir(t.firstToken,r.level,n,i));let o=mt(t.keyword.lastToken,i);return s.push(...o),s},gU=(t,e,r,n,i)=>t.comments.length===1&&t.firstToken.pos.line===t.firstToken.prevToken?.pos.line?[]:t.comments.flatMap((s,o)=>yU(s,t,e,r,n,o?o===t.comments.length-1?"last":"comment":"first",i)),GE=(t,e,r="")=>{let n=e?Ly(e):void 0;if(!n)return r;let i=Hs(e),s=n.propertyName?.name.length??0;return`${`${Xo(t,s+(i?4:3)+(r.length-r.trimStart().length))}`}${r.trimStart()}`},yU=(t,e,r,n,i,s,o)=>{if(!t.firstToken.prevToken)return Ir(t.firstToken,r?.level??0,n,i);if(t.firstToken.pos.line===t.firstToken.prevToken?.pos.line)return mt(t.firstToken.prevToken,i,1);if(r===void 0)return[];let a,c;s==="first"&&!e.astBeforeComment&&e.astAfterComment instanceof lt&&(a=!0,c=e.firstToken.prevToken?.value==="{"?1:2);let l=[],u="",d=t.toString();switch(s==="last"&&d.trim()!==""&&t.lastToken.prevToken&&(s="comment",l.push(...Ir(t.lastToken.prevToken,r?.level??0,n,i," "))),s){case"comment":u=t.firstToken.value==="*"?" ":" * ";break;case"first":break;case"last":u=" ";break}return r?.inAst instanceof lt?l.push(...Ir(t.firstToken,r?.level??0,n,i,u,c,a)):l.push(...Ir(t.firstToken,r?.level??0,n,i,GE(o,r?.inAst,u),c,a)),l},TU=(t,e,r,n,i)=>{if(!t.firstToken.prevToken)return Ir(t.firstToken,e?.level??0,r,n);if(t.firstToken.pos.line===t.firstToken.prevToken.pos.line)return[];let o,a;return!t.astBeforeComment&&t.astAfterComment instanceof lt&&(o=!0,a=t.firstToken.prevToken?.value==="{"?1:2),Ir(t.firstToken,e?.level??0,r,n,GE(i,e?.inAst),a,o)},YE=async(t,e,r,n,i,s=0)=>{let o=t.options.tabSize,a=t.options.insertSpaces,c=a?" ".repeat(o):" ",l={tabSize:o,insertSpaces:a,singleIndent:c};return e instanceof lt?oU(t,e,r,s,c,i,n):e instanceof Ke?pU(e,s,l,i,r):e instanceof Tr?hU(e,s,c,i):e instanceof Ri?mU(e,r,await n(e),c,i):e instanceof ln?TU(e,await n(e),c,i,l):e instanceof cn?gU(e,await n(e),c,i,l):[]};function vU(t,e){let r=t[e.start.line],n=t[e.end.line];if(e.start.line===e.end.line)return r.substring(e.start.character,e.end.character);let i=t.slice(e.start.line+1,e.end.line);return[r.substring(e.start.character),...i,n.substring(0,e.end.character)].join(`
194
- `)}function bU(t){switch(t){case"EMPTY":return"EMPTY";case"U32":return"U32";case"U64":return"U64";case"STRING":return"STRING";case"PROP_ENCODED_ARRAY":return"PROP_ENCODED_ARRAY";case"STRINGLIST":return"STRINGLIST";case"BYTESTRING":return"BYTESTRING";case"ANY":return"ANY";case"UNKNOWN":return"UNKNOWN"}}var K=class{constructor(e,r,n="optional",i=void 0,s,o){this.name=e;this.type=r;this.def=i;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:Et.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(bU).join(" or ")).join(",")}
187
+ `){let o=this.lineNumber,a=this.columnNumber,c=r.length;this.pushToken({tokens:[21],value:r,pos:{col:a-c,line:o,len:c,colEnd:a}}),r=""}else if(this.currentChar==="\\"){let o=this.lineNumber;if(r+=this.currentChar??"",this.move())o===this.lineNumber&&(r+=this.currentChar??"");else break}else r+=this.currentChar??"";if(!this.move())break}r+=e;let n=this.lineNumber,i=this.columnNumber+1,s=r.length;this.pushToken({tokens:[21],value:r,pos:{col:i-s,line:n,len:s,colEnd:i}}),this.move()}lexIt(){for(;!this.endOfFile;){for(;this.isWhiteSpace();)this.move();let e=this.getWord();e&&this.process(e)}}static{this.SINGLE_CHAR_TOKENS=new Map([["{",[2]],["}",[3]],["(",[42]],[")",[43]],["[",[11]],["]",[12]],[";",[1]],[":",[50]],["=",[0]],[">",[4]],["<",[5]],["!",[6]],["|",[8]],["^",[9]],["&",[40,7]],["~",[10]],["/",[13]],["\\",[14]],["+",[15]],["-",[16]],["*",[17]],["%",[18]],["?",[44]],[".",[45]],["_",[48]],["@",[49]],[",",[24]]])}static{this.KEYWORD_TOKENS=new Map([["true",38],["false",39],["#define",25],["#include",26],["#line",27],["#undef",28],["#error",29],["#pragma",30],["#defined",31],["#if",32],["#ifdef",33],["#ifndef",34],["#elif",35],["#else",36],["#endif",37]])}process(e){let r=this.isString(e);if(!r){let i=t.KEYWORD_TOKENS.get(e.toLowerCase());if(i&&(r=!0,this.pushToken({tokens:[i],value:e.toLowerCase(),pos:this.generatePos(e,e.toLowerCase())}),i===39||i===38)){let s=this.tokens.length-1;if(qt(this.tokens[s-1],this.tokens[s]))r=!1,this.tokens.pop();else return!0}}if(r||(r=this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)),!r&&e.length===1){let i=t.SINGLE_CHAR_TOKENS.get(e);if(i)return r=!0,this.pushToken({tokens:i,value:e,pos:this.generatePos(e,e)}),!0}if(r||(r=this.isHash(e)||this.unknownToken(e)),!r)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let n=this._tokens[this._tokens.length-1];return r&&!n?.tokens.some(i=>i===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}pushToken(e){let r={tokens:e.tokens,pos:e.pos,value:e.value,uri:this.uri},n=this._tokens[this._tokens.length-1];r.prevToken=n,n&&(n.nextToken=r),this._tokens.push(r)}isLetters(e){let r=e[0]?.charCodeAt(0);if(t.isLetterCode(r)){let n="";for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(t.isLetterCode(s))n+=e[i];else break}return this.pushToken({tokens:[47],value:n,pos:this.generatePos(e,n)}),!0}return!1}isDigit(e){let r=e[0],n=r?.charCodeAt(0);return n>=48&&n<=57?(this.pushToken({tokens:[20,19],value:r,pos:this.generatePos(e,r)}),!0):!1}isHexDigit(e){let r=e[0],n=r?.charCodeAt(0);return n>=65&&n<=70||n>=97&&n<=102?(this.pushToken({tokens:[20,47],value:r,pos:this.generatePos(e,r)}),!0):!1}isHash(e){let r="#";return e.startsWith(r)?(this.pushToken({tokens:[46],pos:this.generatePos(e,r),value:r}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isString(e){if(this.inComment)return!1;let r=e[0];if(r==='"'||r==="'"){let n=e.length-1;if(this.columnNumber+1<n)throw new Error("Error while rewinding");return this.columnNumber-=n,this.getString(r),!0}return!1}generatePos(e,r){let n=this.columnNumber-e.length,i=r.length;return{line:this.lineNumber,col:n,len:i,colEnd:n+i}}};var By,mf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,r,n,i){e=nt(e);let s=`${Array.from(n).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(n),o;console.log("No cpreprocess cache",e);let a=new Ko(e,r,n),c=this.includeOwners.get(a)??new Set;return c.add(i),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(s,a),a}reset(e){e=nt(e);let r=this.headerFiles.get(e);r&&Array.from(r).forEach(n=>{n[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(n[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function vc(){return By??=new mf,By}function $w(){By=new mf}var Fy,gf=class t{constructor(){this.fileMap=new Map}static clone(e){let r=e.length;if(r===0)return[];let n=new Array(r),i;for(let s=0;s<r;s++){let o=e[s],a={tokens:o.tokens,pos:o.pos,value:o.value,uri:o.uri,prevToken:i,nextToken:void 0};i&&(i.nextToken=a),n[s]=a,i=a}return n}needsRenew(e,r){return e=nt(e),this.fileMap.get(e)?.text!==r}getDocument(e,r){return Yn.create(e,"devicetree",0,r??this.fileMap.get(e)?.text??(0,bc.readFileSync)(e).toString())}renewLexer(e,r){if(e=nt(e),vc().reset(e),!r&&!(0,bc.existsSync)(e))return[];try{r??=(0,bc.readFileSync)(e).toString();let n=new Go(r,e);return this.fileMap.set(e,n),t.clone(n.tokens)}catch{}return[]}requestTokens(e,r){e=nt(e);let n=this.fileMap.get(e)?.tokens;return!n&&r?[...this.renewLexer(e)]:t.clone(n??[])}reset(e){e=nt(e),vc().reset(e),this.fileMap.delete(e)}};function Ir(){return Fy??=new gf,Fy}function Bw(){Fy=new gf}var yf=class t extends Zi{constructor(r,n=()=>Ir().requestTokens(this.uri,!0)){super();this.uri=r;this.getTokens=n;this.comments=[];this.tokens=[]}cleanUpComments(){let r=[];for(let n=0;n<this.tokens.length;n++){let i=t.processBlockComment(this.tokens,n)||t.processLineComment(this.tokens,n);i&&(n=i.index,r.push(...i.tokenUsed),this.comments.push(i.comment))}if(r.length>0){let n=new Set(r),i=[];for(let s=0;s<this.tokens.length;s++)n.has(s)||i.push(this.tokens[s]);this.tokens=i}}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=this.getTokens(),this.cleanUpComments()}static processBlockComment(r,n){let i=[],s=()=>(i.push(n++),r[n]),o=()=>r[n],a=()=>r[n-1],c=o(),l=c;if(!c||!U(c,13)||(l=s(),!U(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!U(a(),17)||!U(o(),13)||!qt(a(),o())),d=l.pos.line,f=c,p=[];l=s();do{if(o()?.pos.line!==d){let T=new ln(oe(f,a()));p.push(T),d=o().pos.line??0,f=o()}l=s()}while(n<r.length&&!u());let g=new ln(oe(f,o()));p.push(g);let h=new cn(p);return s(),{comment:h,tokenUsed:i,index:n-1}}static processLineComment(r,n){let i=[];if(!U(r[n],13)||r.length===n+1||!U(r[n+1],13)||!qt(r[n],r[n+1]))return;for(;r[n].pos.line===r.at(n+1)?.pos.line;)i.push(n++);return i.push(n++),{comment:new ln(oe(r[i[0]],r[i.at(-1)])),tokenUsed:i,index:n-1}}};var Fw=$(H());var Tf=class extends Q{constructor(r,n){super(r);this.content=n}toString(){let r=this.content.filter(n=>!U(n,14));return r.map((n,i)=>{let s=n.value;return n.pos.line===r.at(i+1)?.pos.line?s=s.padEnd(r[i+1].pos.col-n.pos.col," "):r.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},_c=class extends Q{constructor(r,n,i){super();this.keyword=r;this.identifier=n;this.content=i;this.addChild(r),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ct?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:Fw.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
188
+ `)}}};var Vs=class extends Q{constructor(e){super(e)}},Sc=class extends Q{constructor(r,n){super();this.keyword=r;this.content=n;this.active=!1;this.addChild(r)}},Nc=class extends Sc{constructor(r,n,i){super(r,i);this.identifier=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.identifier&&r.has(this.identifier.name)}},vf=class extends Sc{constructor(r,n,i){super(r,i);this.expression=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.expression?.isTrue(r)}},bf=class extends Nc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},kc=class extends Sc{};var es=class extends Q{constructor(r,n,i){super();this.ifDef=r;this.endIf=n;this.elseOption=i;this.addChild(r),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:s(this.firstToken),end:s(this.lastToken)}];i.push({start:s(this.ifDef.firstToken),end:s(this.ifDef.identifier.lastToken)});let o=this.ifDef.useBlock(r);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&i.push({start:s(this.ifDef.content.firstToken),end:s(this.ifDef.content.lastToken)}),this.elseOption&&(i.push({start:s(this.elseOption.firstToken),end:s(this.elseOption.keyword.lastToken)}),o&&this.elseOption.content&&i.push({start:s(this.elseOption.content.firstToken),end:s(this.elseOption.content.lastToken)})),this.endIf&&i.push({start:s(this.endIf.firstToken),end:s(this.endIf.lastToken)}),i}},ts=class extends Q{constructor(r,n,i){super();this.ifBlocks=r;this.endIf=n;this.elseOption=i;r.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach(a=>{i.push({start:s(a.firstToken),end:s(a.expression?.lastToken??a.keyword.lastToken)}),!o&&a.useBlock(r)?(a.active=!0,o=!0):a.content&&i.push({start:s(a.content.firstToken),end:s(a.content.lastToken)})}),this.elseOption&&(i.push({start:s(this.elseOption.keyword.firstToken),end:s(this.elseOption.keyword.lastToken)}),o&&this.elseOption.content?i.push({start:s(this.elseOption.content.firstToken),end:s(this.elseOption.content.lastToken)}):this.elseOption.active=!0),this.endIf&&i.push({start:s(this.endIf.firstToken),end:s(this.endIf.lastToken)}),i}};var Ko=class extends Zi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.getTokens=s;this.skipIncludes=o;this.tokens=[];this.nodes=[];this._comments=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([a,c])=>this.macroSnapShot.set(a,c)),Array.from(i).forEach(([a,c])=>this.macros.set(a,c)))}get comments(){return this._comments}get currentToken(){let r=this.prevToken,n=Dn(r,this.tokens.at(this.peekIndex()))||!r||U(r,14)&&r.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!n))return this.macroStart&&U(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(r){super.reset(),this.macros.clear(),r?(this.macroSnapShot.clear(),Array.from(r).forEach(([n,i])=>this.macroSnapShot.set(n,i)),Array.from(r).forEach(([n,i])=>this.macros.set(n,i))):Array.from(this.macroSnapShot).forEach(([n,i])=>this.macros.set(n,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(r){let n=this.stable;return this.parsing=new Promise(i=>{n.then(()=>{if(r&&r.size===this.macroSnapShot.size){let s=Array.from(r);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=s[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),i();return}}this.reset(r),this.parse().then(i)})}),this.parsing}async parse(){let r=new yf(this.uri,this.getTokens);if(await r.stable,this.tokens=r.tokens,this._comments=r.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||!le(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let n=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processError();this.processIfDefBlocks(),n&&this.moveEndOfLine(n,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,25))return this.popStack(),!1;this.macroStart=!0;let i=new ut(oe(n)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(W(30,i.firstToken,i.lastToken,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Tf(oe(o[0],o.at(-1)),o));let c=new _c(i,s,a);this.macros.set(c.name,{macro:c,resolver:yw(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(r,l-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,28))return this.popStack(),!1;this.macroStart=!0;let i=new ut(oe(n)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(W(30,i.firstToken,i.lastToken,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new _c(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(r,a-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processError(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!U(n,29))return this.popStack(),!1;this.moveEndOfLine(n,!1,!0);let i=this.peekIndex();return this.tokens.splice(r,i-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),!0}consumeDefinitionContent(){let r=[];for(;this.currentToken;){let n=this.moveToNextToken;n&&r.push(n)}return r}isFunctionDefinition(){this.enqueueToStack();let r=this.processCIdentifier(this.macros,!0);if(!r){this.popStack();return}let n=this.moveToNextToken;if(!U(n,42)||!qt(r.lastToken,n)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!U(this.currentToken,24)&&!U(this.currentToken,43)?this._issues.push(W(28,s.firstToken,s.lastToken,s)):U(this.currentToken,43)||(n=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new ei(r,i);if(U(this.currentToken,43))n=this.moveToNextToken,o.lastToken=n;else{o.lastToken=this.prevToken;let a=i.at(-1)??o;this._issues.push(W(26,a.firstToken,a.lastToken,a))}return this.mergeStack(),o}processVariadic(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(45),Oe(45),Oe(45)]);if(r.length!==3){this.popStack();return}let n=new hf(oe(r[0],r.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let r=this.peekIndex(),n=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>U(o,a))&&!Dn(o.prevToken,o),o=>!!o&&[37].some(a=>U(o,a))&&!Dn(o.prevToken,o),o=>!!o&&[36,35].some(a=>U(o,a))&&!Dn(o.prevToken,o));if(!n)return;let i;U(n.startToken,32)?i=this.processIfBlock(n,(o,a,c)=>new vf(o,a??null,c)):i=this.processIfDefBlock(n,(o,a,c)=>U(n.startToken,33)?new Nc(o,a??null,c):new bf(o,a??null,c)),this.nodes.push(i),i.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...i instanceof ts?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(W(47,o.content.firstToken,o.content.lastToken,o.content,{severity:Rc.DiagnosticSeverity.Hint,tags:[Rc.DiagnosticTag.Unnecessary]}))}),this.positionStack[this.positionStack.length-1]=r}processIfDefBlock(r,n){this.enqueueToStack(),this.macroStart=!0;let i=new ut(oe(r.startToken));r.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(W(31,i.firstToken,i.lastToken,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&r.splitTokens[0].tokens.find(f=>f===a)&&(o=new Vs(oe(a,r.splitTokens[0].tokens.at(-1))));let c=n(i,s??null,o??null),l;if(r.splitTokens.length>1){let f=r.splitTokens[1].tokens[0].prevToken,p=new ut(oe(f)),g;r.splitTokens[1].tokens.length&&(g=new Vs(oe(r.splitTokens[1].tokens[0],r.splitTokens[1].tokens.at(-1)))),l=new kc(p,g??null)}let u;r.endToken?u=new ut(oe(r.endToken)):this._issues.push(W(46,i.firstToken,i.lastToken,i));let d=new es(c,u??null,l);return this.mergeStack(),d}processIfBlock(r,n){this.enqueueToStack();let i=new ut(oe(r.startToken)),s=[],o;r.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ut(oe(d));this.macroStart=!0;let p=this.processExpression(this.macros,f,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===r.splitTokens.length-1&&U(d,36)){let h=d,T=new ut(oe(h)),S;l.tokens.length&&(S=new Vs(oe(l.tokens[0],l.tokens.at(-1)))),o=new kc(T,S??null)}else{p||this._issues.push(W(31,i.firstToken,i.lastToken,i));let h,T=p?.lastToken.nextToken??i.lastToken.nextToken;T&&l.tokens.find(_=>_===T)&&(h=new Vs(oe(T,r.splitTokens[u].tokens.at(-1))));let S=n(f,p??null,h??null);s.push(S)}});let a;r.endToken?a=new ut(oe(r.endToken)):this._issues.push(W(46,i.firstToken,i.lastToken,i));let c=new ts(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes,...this.comments]}resolveInclude(r){if(r.path.path)return r.path.relative?[(0,Yo.resolve)((0,Yo.dirname)(r.uri),r.path.path),...this.incudes.map(n=>(0,Yo.resolve)(n,r.path.path))].find(n=>(0,jy.existsSync)(n)):this.incudes.map(n=>(0,Yo.resolve)(n,r.path.path)).find(n=>(0,jy.existsSync)(n))}async processInclude(){this.enqueueToStack();let r=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let i=n,s=n;if(U(n,26))this.moveToNextToken;else{let h=this.checkConcurrentTokens([Oe(13),Ze("include"),Oe(13)]);if(h.length!==3)return this.popStack(),!1;i=h[0],s=h.at(-1)}let o=i,a=new ut(oe(i,s));n=this.moveToNextToken;let c=n,l=!!U(n,21);if(!c||!l&&!U(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!U(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new Wo(u,l,oe(c,n)),f=new Ri(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!U(this.currentToken,4)?this._issues.push(W(12,f.firstToken,f.lastToken,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(f);if(f.resolvedPath=g,g||this._issues.push(W(36,f.path.firstToken,f.path.lastToken,f.path,{severity:Rc.DiagnosticSeverity.Warning})),g&&!this.skipIncludes){Ir().requestTokens(g,!0);let h=vc().getCPreprocessorParser(g,this.incudes,this.macros,this.uri);await h.stable,this._issues.push(...h.issues),this.macros.clear(),Array.from(h.macros).forEach(([T,S])=>this.macros.set(T,S)),g.endsWith(".h")?this.tokens.splice(r,p-r):this.tokens.splice(r,p-r,...h.tokens),this.nodes.push(...h.nodes),this.dtsIncludes.push(...h.dtsIncludes)}else this.tokens.splice(r,p-r);return this.positionStack[this.positionStack.length-1]=r,!0}};var jw=$(H());var _f=class extends Q{constructor(r,n,i){super();this.keyword=r;this.startAddress=n;this.endAddress=i;this.addChild(r),this.docSymbolsMeta={name:"Memreserve",kind:jw.SymbolKind.Function},this.addChild(n),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var Uw=$(H());var Sf=class extends Q{constructor(r,n){super();this.keyword=r;this.bitsSize=n;this.addChild(r),this.docSymbolsMeta={name:"bits",kind:Uw.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var zs=class extends Zi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new lt;this.unhandledStatements=new St;this.cPreprocessorParser=new Ko(this.uri,this.incudes,i,s,o)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(r=>r.resolvedPath).filter(r=>!!r)]}reset(){super.reset(),this.others=[],this.rootDocument=new lt,this._issues=[],this.unhandledStatements=new St}async reparse(){let r=performance.now(),n=this.stable;return this.parsing=new Promise(i=>{n.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-r),i()})}),this.parsing}async parse(){if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,nt(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isPlugin()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements)||this.isChildNode(this.unhandledStatements,"Name"))){let s=this.moveToNextToken;s&&(this._issues.push(W(22,s,s,null)),this.reportExtraEndStatements())}};for(;!this.done;)await r();this.unhandledStatements.properties.forEach(s=>{this._issues.push(W(32,s.firstToken,s.lastToken,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(W(33,s.firstToken,s.lastToken,s))});let n=this.allAstItems.flatMap(s=>[s,...s.allDescendants]),i=this.cPreprocessorParser.comments;if(i.length&&n.forEach(s=>{(s instanceof lt||s instanceof Ye)&&Sw(s,i)}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(r){this.enqueueToStack();let n=this.moveToNextToken,i=n,s=13;if(!n||!U(n,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!U(i,s))return this.popStack(),!1;let o=new St;o.openScope=i,r.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(r){let n=this.currentToken;if(U(n,3))this.moveToNextToken;else{let i=this.prevToken;return i&&this._issues.push(W(3,i,i,r)),this.endStatement(r,!1)}return this.prevToken?.value==="}"&&(r.closeScope=this.prevToken),this.endStatement(r)}isNodeEnd(){return U(this.currentToken,3)||U(this.currentToken,1)}endStatement(r,n=!0){let i=this.currentToken;if(!U(i,1)){let s=this.prevToken;if(s&&n)return this._issues.push(W(1,s,s,r)),s}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;U(this.currentToken,1);){let r=this.moveToNextToken;r&&this._issues.push(W(23,r,r,null))}}processNode(r,n){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(r,n)||this.isProperty(r)||this.isDeleteNode(r,n)||this.isDeleteProperty(r),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;o&&(this._issues.push(W(22,o,o,null)),this.reportExtraEndStatements())}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(r=!1){let n=[],i=this.isLabelAssign(r);for(;i;)n.push(i),i=this.isLabelAssign(r);return n}isChildNode(r,n){this.enqueueToStack();let i;n==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new Wt(s):new He(s,i);if(n==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(c),!a||!U(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef(c)):n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!U(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(W(n==="Name"?[7]:[10,48,11],c.firstToken,this.currentToken?.nextToken,c))}let l=!1;if(a&&c instanceof Wt?(c.reference=a,l=!0):o&&c instanceof He&&(l=o.address!==void 0,c.name=o),U(this.currentToken,2)){c.openScope=this.moveToNextToken;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(W(2,u.firstToken,u.lastToken,u))}else return this.popStack(),!1;return r.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(r){let n=this.prevToken;this.enqueueToStack();let i=this.checkConcurrentTokens([Ze("0"),Ze("x",{caseInsensitive:!0})]);i.length!==2?(i=[],this.popStack()):(this._issues.push(W(50,i[0],i[1],r,{severity:Nf.DiagnosticSeverity.Warning})),n=i.at(-1),this.mergeStack());let s=this.consumeAnyConcurrentTokens([19,20,48].map(Oe)),o=l=>{l.length%8!==0&&(l=l.padStart(Math.ceil(l.length/8)*8,"0"));let u=[];for(let d=0;d<l.length;d+=8){let f=l.slice(d,d+8);u.push(parseInt(f,16)>>>0)}return u},a=s.length?o(s.filter(l=>l.value!=="_").map(l=>l.value).join("")):[NaN];return n&&(a.some(l=>Number.isNaN(l))?this._issues.push(W(8,n,n,r)):!Number.isNaN(a)&&!qt(n,s[0])&&this._issues.push(W(29,n,s[0],r,{inclusiveStart:!1,inclusiveEnd:!1}))),this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(W(51,this.currentToken,this.currentToken,r,{severity:Nf.DiagnosticSeverity.Warning})),this.moveToNextToken),new Tc(a,oe(i.at(0)??s[0]??this.prevToken,this.prevToken))}processNodeAddresses(r){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(49)]);if(n.length){qt(r.lastToken,n[0])||this._issues.push(W(29,r.lastToken,n[0],r,{inclusiveStart:!1,inclusiveEnd:!1}));let i=[],s=()=>{i.push(this.processNodeAddress(r)),U(this.currentToken,24)&&(this.prevToken&&!qt(this.prevToken,this.currentToken)&&this._issues.push(W(29,this.prevToken,this.currentToken,r,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken,s())};s();let o=this.currentToken;for(;!U(this.currentToken,2)&&!U(this.currentToken,1)&&!U(this.currentToken,3)&&Dn(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(W(52,o,this.currentToken,r));let a=new Tc([],oe(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Oe));if(!r.length){this.popStack();return}let n=r.map(o=>o.value).join(""),i=new Me(n,oe(r[0],r.at(-1))),s=this.processNodeAddresses(i);return i.address=s,lf(n)||this._issues.push(W(49,i.firstToken,i.lastToken,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Oe));if(!r.length){this.popStack();return}let n=new et(r.map(i=>i.value).join(""),oe(r[0],r.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!r.length){this.popStack();return}if(!lf(r?.[0].value)){this.popStack();return}let n=r.map(s=>s.value).join(""),i=new Zt(n,oe(r[0],r[r.length-1]));return this.mergeStack(),i}isLabelAssign(r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Oe));if(!n.length){this.popStack();return}if(!lf(n?.[0].value)){this.popStack();return}let i=n.map(c=>c.value).join(""),s=this.currentToken,o=s&&U(s,50),a=new Qi(new Zt(i,oe(n[0],n.at(-1))),oe(n[0],o?s:n.at(-1)));if(o){let c=n.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(W(29,c,s,a,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken}else if(r)this._issues.push(W(24,a.firstToken,a.lastToken,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(U(this.currentToken,2)||U(this.currentToken,49))return this.popStack(),!1;let s=new Ye(i,n),o;U(this.currentToken,0)?(s.assignOperatorToken=this.moveToNextToken,o=this.processValue(r),o?.values.filter(c=>!!c).length||this._issues.push(W(0,s.firstToken,s.lastToken,s)),s.values=o??null):s.values=void 0;let a=this.endStatement(s);return s.lastToken=a,r.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ze("d"),Ze("ts"),Oe(16),Ze("v"),Ze("1")]);if(r.length!==6)return this.popStack(),!1;let n=r[0],i=n,s=new ut;s.firstToken=n;let o=new ff(s);if(this.others.push(o),U(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=r.at(-1),this._issues.push(W(21,o.firstToken,o.lastToken,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(o),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ze("memreserve")]);if(r.length!==2)return this.popStack(),!1;let n=new ut;n.firstToken=r[0];let s=r[0];U(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(W(21,n.firstToken,n.lastToken,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new _f(n,o,a);if(this.others.push(c),o||this._issues.push(W(37,n.firstToken,n.lastToken,n)),!a){let l=o??n;this._issues.push(W(38,l.firstToken,l.lastToken,c))}return c.lastToken=this.endStatement(c),this.mergeStack(),!0}isPlugin(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ze("plugin"),Oe(13)]);if(r.length!==3)return this.popStack(),!1;let n=new ut(oe(r[0],r.at(-1)));return n.lastToken=this.endStatement(n),this.mergeStack(),this.others.push(n),!0}processBits(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ze("b"),Ze("its")]);if(r.length!==3){this.popStack();return}let n=new ut;n.firstToken=r[0];let s=r[0];U(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(W(21,n.firstToken,n.lastToken,n)));let o=this.processDec(),a=new Sf(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(W(40,o.firstToken,o.lastToken,o)):this._issues.push(W(39,n.firstToken,n.lastToken,n)),this._issues.push(W(41,a.firstToken,a.lastToken,a,{severity:Nf.DiagnosticSeverity.Warning})),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let r=this.checkConcurrentTokens([Oe(13),Ze("omit"),Oe(16),Ze("if"),Oe(16),Ze("no"),Oe(16),Ze("ref"),Oe(13)]);if(r.length!==9){this.popStack();return}let n=new ut(oe(r[0],r.at(-1)));return this.mergeStack(),n}isDeleteNode(r,n){this.enqueueToStack();let i=this.checkConcurrentTokens([Oe(13),Ze("d"),Ze("e"),Ze("lete",{allowPartial:!0}),Oe(16),Ze("node",{allowPartial:!0})]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new ut;if(a.firstToken=s,i.length===1&&!U(this.currentToken,2)){this._issues.push(W(25,a.firstToken,a.lastToken,a)),a.lastToken=i.at(-1);let d=new Ar(a);return r.addNodeChild(d),this.mergeStack(),!0}let c=i.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=i.at(-1),c!=="/delete-node"?this._issues.push(W(c.startsWith("/delete-n")?34:25,a.firstToken,a.lastToken,a)):U(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(W(21,a.firstToken,a.lastToken,a));let l=new Ar(a);if(Dn(a.lastToken,s)){let d=this.processNodePathRef(r);d&&n==="Name"&&this._issues.push(W(7,d.firstToken,d.lastToken,d));let f=d?void 0:this.isLabelRef(r);f&&n==="Name"&&this._issues.push(W(7,f.firstToken,f.lastToken,f));let p=d||f?void 0:this.isNodeName();p&&n==="Ref"&&this._issues.push(W(10,p.firstToken,p.lastToken,p)),!d&&!p&&!f&&this._issues.push(W([7,10],l.firstToken,l.lastToken,l)),l.nodeNameOrRef=d??f??p??null}else n==="Name"?this._issues.push(W(7,a.firstToken,a.lastToken,a)):n==="Ref"&&this._issues.push(W(10,a.firstToken,a.lastToken,a));let u=this.endStatement(l);return l.lastToken=u,r.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(r){this.enqueueToStack();let n=this.checkConcurrentTokens([Oe(13),Ze("d"),Ze("e"),Ze("lete",{allowPartial:!0}),Oe(16),Ze("property",{allowPartial:!0})]);if(!n.length)return this.popStack(),!1;let i=n[0],s=i,o=new ut;if(o.firstToken=i,n.length===1&&!U(this.currentToken,2)){this._issues.push(W(25,o.firstToken,o.lastToken,o)),o.lastToken=n.at(-1);let u=new ht(o);return r.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(W(a.startsWith("/delete-p")?35:25,o.firstToken,o.lastToken,o)):U(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(W(21,o.firstToken,o.lastToken,o));let c=new ht(o);if(Dn(o.lastToken,i)){let u=this.isPropertyName();u||this._issues.push(W(6,c.firstToken,c.lastToken,c)),c.propertyName=u??null}else this._issues.push(W(6,o.firstToken,o.lastToken,o));let l=this.endStatement(c);return c.lastToken=l,r.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processNodePathRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let o=new vr(n,i,s);return this.mergeStack(),o}processValue(r){this.enqueueToStack();let i=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef(r)||this.isLabelRefValue(r)||this.arrayValues(r)||this.processByteStringValue()||this.isExpressionValue(r))??null,a=o();if(!a)return[];let c=[a];for(;!U(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d,f=U(this.currentToken,24);if(f)d=this.currentToken,this.moveToNextToken;else if(!Dn(this.prevToken,this.currentToken))break;let p=o();if(u&&p===null&&f){let h=new Q(oe(u,this.currentToken));this._issues.push(W(0,h.firstToken,h.lastToken,h))}if(!f&&p===null)break;if(l&&!f&&p){let h=new Q(oe(l));this._issues.push(W(28,h.firstToken,h.lastToken,h))}let g=c.at(-1);g&&(g.nextValueSeparator??=d),c.push(p)}return c})();if(i.length===0){this.popStack();return}return this.mergeStack(),new df(i)}processStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.consumeAnyConcurrentTokens([Oe(21)]);if(!n.length){this.popStack();return}if(n.some(u=>u.value===void 0))throw new Error("Token must have value");let i=n.map(u=>u.value).join(`
189
+ `),s=i,o=['"',"'"].some(u=>s.endsWith(u));o&&(s=s.slice(1,-1));let a=new ne(s,oe(n[0],n.at(-1)));o||this._issues.push(W(i.startsWith('"')?16:17,a.firstToken,a.lastToken,a));let c=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0));let l=new vr(r,a,c);return this.mergeStack(),l}arrayValues(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processBits(),s=this.currentToken;if(U(s,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(r)??null;o.openBracket=s;let a=this.processOptionalLabelAssign(!0)??[],c=new vr(n,o,a,i);if(!U(this.currentToken,4))this._issues.push(W(12,c.firstToken,c.lastToken,c));else{let u=this.moveToNextToken;o&&(o.closeBracket=u)}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=s,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.moveToNextToken,i=n;if(!U(i,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value&&u.value.firstToken===u.value.lastToken&&(d=u.value.firstToken.pos.len),d%2!==0&&this._issues.push(W(15,u.firstToken,u.lastToken,u))});let a=new ki(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=n,this._issues.push(W(14,a.firstToken,a.lastToken,a)));let c=new vr(r,a,o);U(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(W(5,c.firstToken,c.lastToken,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=n,a.lastToken=this.prevToken,c}processLabeledValue(r){this.enqueueToStack();let n=r(),i=[];if(!n)return this.popStack(),[];for(;n;)i.push(n),n=r();if(i.length){let s=r();s&&i.push(s)}return this.mergeStack(),i}processArrayValues(r){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(r,!1)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1,r)),i=new jt(n);return n.length===0&&(i.firstToken=this.currentToken),this.mergeStack(),i}processLabeledHex(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processHex();if(!i){this.popStack();return}let s=new Zn(i,n);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!1),n=this.checkConcurrentTokens([20,20].map(Oe));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(a=>a.value).join(""),16),s=new cr(i,oe(n[0],n.at(-1)),16),o=new Zn(s,r);return this.mergeStack(),o}processLabeledDec(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processDec();if(!i){this.popStack();return}let s=new Zn(i,n);return this.mergeStack(),s}processLabeledExpression(r=!0,n=r,i){this.enqueueToStack();let s=[];r&&(s=this.processOptionalLabelAssign(n));let o=this.processExpression(this.cPreprocessorParser.macros,i);if(!o){this.popStack();return}let a=new Zn(o,s);return this.mergeStack(),a}isExpressionValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),i=this.processExpression(this.cPreprocessorParser.macros,r);if(!i){this.popStack();return}let s=this.processOptionalLabelAssign(!0),o=new vr(n,i,s);return this.mergeStack(),o}isLabelRef(r){this.enqueueToStack();let n=this.currentToken;if(!n||!U(n,40)){this.popStack();return}else this.moveToNextToken;let i=this.isLabelName();if(!i){let o=new ie(null);return this._issues.push(W(18,n,n,r)),o.firstToken=n,this.mergeStack(),o}n&&(i.firstToken.pos.line!==n.pos.line||i.firstToken.pos.col!==n.pos.colEnd)&&this._issues.push(W(29,n,i.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}));let s=new ie(i);return s.firstToken=n,this.mergeStack(),s}isLabelRefValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.isLabelRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new vr(n,i,s);return this.mergeStack(),o}processRefValue(r,n){this.enqueueToStack();let i=this.processOptionalLabelAssign(n),s=this.currentToken;if(!s||!U(s,40)){this.popStack();return}let o=this.processNodePathRef(r);if(o!==void 0){let l=new Zn(o,i);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(W([18,9],s,s,r));let l=new Zn(null,i);return l.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),l}let c=new Zn(a,i);return c.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(r=!0,n=new In){this.enqueueToStack();let i;if(U(this.currentToken,13))i=this.moveToNextToken;else{if(!r){this.popStack();return}this.prevToken&&this._issues.push(W(19,this.prevToken,this.prevToken,n))}let s=this.isNodeName(),o=i??this.prevToken;if(!s&&o&&!r&&this._issues.push(W(7,o,o,n)),!r||s?n.addPath(s??null,i?new Q(oe(i)):void 0):r&&!s&&i&&(n.addPath(new Me("/",oe(i))),n.firstToken=i),r&&!i&&n.children.length===0){this.mergeStack();return}return this.processNodePath(!1,n),this.mergeStack(),n}processNodePathRef(r){this.enqueueToStack();let n=this.moveToNextToken,i=n;if(!U(i,40)){this.popStack();return}let s=this.moveToNextToken;if(i=s,!U(i,2)){this.popStack();return}n&&!qt(n,s)&&this._issues.push(W(29,n,s,r,{inclusiveStart:!1,inclusiveEnd:!1}));let o=this.processNodePath(),a=new it(o??null),c=this.currentToken??this.prevToken,l=c;return o?.children.forEach((u,d)=>{if(d===o?.children.length-1&&u&&l&&!qt(u.lastToken,l)){this._issues.push(W(29,u.lastToken,l,r,{inclusiveStart:!1,inclusiveEnd:!1}));return}if(d===0&&s&&!qt(s,u?.firstToken)){this._issues.push(W(29,s,u?.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}));return}let f=o?.children[d+1];u&&f&&!qt(u.lastToken,f.firstToken)&&this._issues.push(W(29,u.lastToken,f?.firstToken,r,{inclusiveStart:!1,inclusiveEnd:!1}))}),U(c,3)?this.moveToNextToken:this.prevToken&&this._issues.push(W(3,this.prevToken,this.prevToken,r)),a.firstToken=n,a.lastToken=c??this.prevToken,this.mergeStack(),a}get includes(){return this.allAstItems.filter(r=>r instanceof Ri)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties,...this.unhandledStatements.nodes]}};var rU=async(t,e,r)=>{let n=Z.Position.create(t.pos.line,t.pos.col),i=r.find(s=>on(s,e,n));if(i)return Qn(i,e,n)},Uy=t=>{if(t)return t instanceof lt?t:Uy(t?.parentNode)},Jo=(t,e,r=0)=>{if(!e||!le(e.uri,t)||!e.parentNode?.uri)return r;let n=Uy(e.parentNode);return Jo(t,n,r+1)},nU=(t,e)=>async r=>{let n=t.filter(a=>!(a instanceof Ri)&&!(a instanceof ln)&&!(a instanceof cn)&&!(a instanceof es)),i=await rU(r.firstToken,e,n);if(!i||i===r||r.allDescendants.some(a=>a===i))return{level:0};let s=Uy(i);return{level:Jo(e,s),inAst:i}};async function Hy(t,e,r){let n=Re(t.textDocument.uri),i=new zs(n,[],void 0,()=>new Go(e,n).tokens,!0);await i.stable;let s=i.issues.filter(o=>Vo(o.raw,n,!1));if(s?.length)throw new Z.ResponseError(Z.ErrorCodes.InternalError,"Unable to format. File has syntax issues.",s.map(o=>o.diagnostic()));return zw(t,i.allAstItems,n,e,r)}async function zw(t,e,r,n,i){let s=n.split(`
190
+ `),o=iU(e,s),a=nU(e,r),c=(await Promise.all(e.flatMap(async f=>await Kw(t,f,r,a,s)))).flat();if(t.options.insertFinalNewline&&s.at(-1)?.trim()!==""){let f=Z.TextEdit.insert(Z.Position.create(s.length,s[s.length-1].length),`
191
+ `);c.push(Dr(4,r,Z.Position.create(s.length,0),{edit:f,codeActionTitle:"Insert new line"}))}if(t.options.trimFinalNewlines){let f=0;for(;s.at(-(1+f))?.trim()==="";)f++;if(f>1){let p=Z.TextEdit.del(Z.Range.create(Z.Position.create(s.length-f,0),Z.Position.create(s.length-1,0)));c.push(Dr(3,r,Z.Position.create(s.length,0),{edit:p,codeActionTitle:"Remove trailing EOF lines"}))}}let l=c.flatMap(f=>f.raw.edit).filter(f=>!!f);if(t.options.trimTrailingWhitespace){let f=sU(s,l,r);c.push(...f)}let u=o.length?c.filter(f=>(Array.isArray(f.raw.edit)?f.raw.edit:f.raw.edit?[f.raw.edit]:void 0)?.every(g=>!Vw(g.range.start,o)&&!Vw(g.range.end,o))):c;"range"in t&&(u=u.filter(f=>pw(t.range,f.raw.range)));let d=()=>{let f=u.flatMap(p=>p.raw.edit).filter(p=>!!p);return bw(Yn.create(r,"devicetree",0,n),f)};return i==="New Text"?d():i==="File Diagnostics"?u:{text:d(),diagnostic:u}}async function Rf(t,e,r,n){let i=Re(t.textDocument.uri);e.formattingOptions=t.options;let s=await e.getRuntime(),o=s.fileTopMostAsts(i);if(s.includes.filter(c=>le(c.resolvedPath,i)).length>1){let c=[];o.forEach(l=>{c.some(u=>u.firstToken.pos.line===l.firstToken.pos.line&&u.firstToken.pos.col===l.firstToken.pos.col)||c.push(l)}),o=c}return zw(t,o,i,r,n)}var iU=(t,e)=>{let r=Z.Position.create(e.length-1,e.at(-1)?.length??0),n=[],i;return t.filter(o=>(o instanceof cn||o instanceof ln)&&/^dts-format (on|off)$/.test(o.toString().trim())).sort((o,a)=>o.firstToken.pos.line-a.firstToken.pos.line).forEach(o=>{let a=o.toString().trim();if(a==="dts-format off")i={start:Z.Position.create(o.firstToken.pos.line,o instanceof cn?o.firstToken.pos.colEnd:0)};else if(a==="dts-format on"&&i){let c=Z.Position.create(o.lastToken.pos.line,o instanceof cn?o.lastToken.pos.colEnd-1:e[o.lastToken.pos.line-1].length);n.push(Z.Range.create(i.start,c)),i=void 0}}),i&&n.push(Z.Range.create(i.start,r)),n};function Hw(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}var Vw=(t,e)=>e.some(r=>Hw(t,r.start)>=0&&Hw(t,r.end)<=0),sU=(t,e,r)=>{let n=[];return t.forEach((i,s)=>{let o=i.trimEnd();if(o.length!==i.length){let a=Z.Range.create(Z.Position.create(s,o.length),Z.Position.create(s,i.length));e.some(c=>_w(a,c.range))||n.push(Dr(2,r,a.start,{edit:Z.TextEdit.del(a),codeActionTitle:"Remove whitespace"},a.end))}}),n},Pf=(t,e,r=1,n=!1,i=t.prevToken)=>{if(i){let s=t.pos.line-i.pos.line,o=s-r;if(o&&(s!==2&&r!==0||r===0||n)){let a=Z.Position.create(i.pos.line,i.pos.colEnd),c=Z.Position.create(t.pos.line-(r?1:0),r?e[t.pos.line-(r?1:0)].length:t.pos.col),l=Z.TextEdit.replace(Z.Range.create(a,c),`
192
+ `.repeat(r-(n?1:0)));return Dr(1,t.uri,a,{edit:l,codeActionTitle:o<0?"Insert new lines":"Remove unnecessary new lines",templateStrings:[r.toString()]},c)}}else if(t.pos.line){let s=Z.Position.create(0,0),o=Z.Position.create(t.pos.line,0),a=Z.TextEdit.del(Z.Range.create(s,o));return Dr(1,t.uri,s,{edit:a,codeActionTitle:"Remove unnecessary new lines",templateStrings:["0"]},o)}},Ww=(t,e,r,n="",i=1)=>{let s=t.pos.line===t.prevToken?.pos.line;if(t.prevToken&&s){let o=Z.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),a=Z.Position.create(t.pos.line,t.pos.col),c=Z.TextEdit.replace(Z.Range.create(o,a),`${`
193
+ `.repeat(i)}${"".padStart(e*r.length,r)}${n}`);return Dr(0,t.uri,o,{edit:c,codeActionTitle:"Move to new line"},a)}},Vy=(t,e,r,n,i="")=>{let s=`${"".padStart(e*r.length,r)}${i}`,o=Z.Position.create(t.pos.line,0),a=Z.Position.create(t.pos.line,t.pos.col),c=Z.Range.create(o,a),l=vU(n,c);if(s===l)return[];let u=Z.TextEdit.replace(c,s);return[Dr(5,t.uri,o,{edit:u,codeActionTitle:"Fix indentation",templateStrings:[s.replaceAll(" ","\xB7").replaceAll(" ","\u2192")]},a)]},mt=(t,e,r=1,n=!1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){if(n)return[];let c=Pf(t.nextToken,e,0);if(!c)throw new Error("remove new LinesEdit must be defined");return r&&(c.raw.edit.newText=`${" ".repeat(r)}${c.raw.edit.newText}`),[c]}if(r===0){if(t.nextToken.pos.col===t.pos.colEnd)return[];let c=Z.Position.create(t.pos.line,t.pos.colEnd),l=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),u=Z.TextEdit.del(Z.Range.create(c,l));return[Dr(1,t.uri,c,{edit:u,codeActionTitle:"Remove space(s)",templateStrings:["0"]},l)]}if(t.pos.colEnd===t.nextToken.pos.col){let c=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),l=Z.TextEdit.insert(c," ".repeat(r));return[Dr(1,t.uri,c,{edit:l,codeActionTitle:"Insert Space(s)",templateStrings:[r.toString()]})]}if(t.nextToken.pos.col-t.pos.colEnd===r&&e[t.pos.line].slice(t.pos.colEnd,t.nextToken.pos.col)===" ".repeat(r))return[];let s=Z.Position.create(t.pos.line,t.pos.colEnd),o=Z.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),a=Z.TextEdit.replace(Z.Range.create(s,o)," ".repeat(r));return[Dr(1,t.uri,s,{edit:a,codeActionTitle:"Insert space(s)",templateStrings:[r.toString()]},o)]},Pc=(t,e)=>t.slice(1).flatMap(r=>r.firstToken.prevToken?mt(r.firstToken.prevToken,e):[]),oU=async(t,e,r,n,i,s,o)=>{if(!le(e.uri,r))return[];let a=[];if(a.push(...Or(e.firstToken,n,i,s,void 0,e.firstToken.prevToken?.value==="{"&&!e.topComment||e.topComment?1:2,!0)),e instanceof He||e instanceof Wt)if(a.push(...Pc(e.labels,s)),e instanceof He){e.labels.length&&e.name&&e.name.firstToken.prevToken&&a.push(...mt(e.name.firstToken.prevToken,s));let c=e.name&&e.openScope?mt(e.name.lastToken,s):[];a.push(...c)}else{e.labels.length&&e.reference?.firstToken.prevToken&&a.push(...mt(e.reference.firstToken.prevToken,s));let c=e.reference&&e.openScope?mt(e.reference.lastToken,s):[];a.push(...c)}else e instanceof St&&e.firstToken.value==="/"&&e.openScope&&a.push(...mt(e.firstToken,s,1));return a.push(...(await Promise.all(e.children.flatMap(c=>Kw(t,c,r,o,s,n+1)))).flat()),e.closeScope&&(e.openScope&&e.closeScope.prevToken===e.openScope?a.push(...mt(e.openScope,s,0)):a.push(...Or(e.closeScope,n,i,s,void 0,1,!0))),e.lastToken.value===";"&&e.closeScope&&a.push(...wc(e.closeScope,e.lastToken)),a},aU=(t,e,r,n,i,s)=>{let o=[];if(o.push(...Pc(e.labels,s)),e.labels.length&&e.value?.firstToken.prevToken&&o.push(...mt(e.value.firstToken.prevToken,s)),e.firstToken.prevToken)if(e.firstToken.pos.line!==e.firstToken.prevToken?.pos.line&&e.firstToken.prevToken!==i){let a=Pf(e.firstToken,s,1,!0);a&&o.push(a),o.push(...Vy(e.firstToken,r,n.singleIndent,s,Xo(n,t+4)))}else o.push(...mt(e.firstToken.prevToken,s,i&&e.firstToken.prevToken===i?0:1));return e.value instanceof Ee&&o.push(...kf(e.value,s,r,n,t+4)),o},cU=(t,e,r,n,i)=>{let s=[];return e instanceof jt||e instanceof ki?e.openBracket&&e.openBracket?.nextToken===e.closeBracket?s.push(...mt(e.openBracket,i,0)):(s.push(...e.values.flatMap(o=>aU(t,o,r,n,e.openBracket,i))),e.closeBracket?.prevToken&&(e.values.at(-1)?.lastToken===e.closeBracket?.prevToken||e.closeBracket?.prevToken.value==="/"&&e.closeBracket?.prevToken?.prevToken?.value==="*"?s.push(...mt(e.closeBracket.prevToken,i,e.closeBracket.prevToken===e.values.at(-1)?.lastToken?0:1)):s.push(...Or(e.closeBracket,r,n.singleIndent,i)))):e instanceof Ee&&s.push(...kf(e,i,r,n,t)),s},kf=(t,e,r,n,i)=>t instanceof Si?lU(t,e):t instanceof Xn?uU(t,e,r,n,i):[],lU=(t,e)=>{let r=[];return r.push(...mt(t.functionName.lastToken,e,0)),t.params.forEach((n,i)=>{n?.firstToken.prevToken&&r.push(...mt(n?.firstToken.prevToken,e,i?1:0)),n?.splitToken&&r.push(...wc(n.lastToken,n.splitToken))}),t.lastToken.value===")"&&t.lastToken.prevToken&&r.push(...mt(t.lastToken.prevToken,e,0)),r},uU=(t,e,r,n,i)=>{let s=[];if(t.openBracket&&t.openBracket.nextToken&&(t.openBracket.pos.line===t.openBracket.nextToken.pos.line?s.push(...mt(t.openBracket,e,0)):s.push(...Or(t.openBracket,r,n.singleIndent,e,Xo(n,i)))),s.push(...kf(t.expression,e,r,n,i)),t.join?.forEach(o=>{o.operator.firstToken.prevToken&&s.push(...mt(o.operator.firstToken.prevToken,e)),o.expression.firstToken.prevToken?.pos.line===o.expression.firstToken.pos.line?s.push(...mt(o.expression.firstToken.prevToken,e)):s.push(...Or(o.expression.firstToken,r,n.singleIndent,e,Xo(n,i))),s.push(...kf(o.expression,e,r,n,i))}),!t.join?.length&&!(t.expression instanceof Xn)&&(t.expression instanceof Si||t.expression instanceof Ct)){let o=[];if(t.openBracket){let a=Z.Position.create(t.openBracket.pos.line,t.openBracket.pos.col),c=Z.Position.create(t.openBracket.pos.line,t.openBracket.pos.colEnd);o.push(Z.TextEdit.del(Z.Range.create(a,c)))}if(t.closeBracket){let a=Z.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.col),c=Z.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.colEnd);o.push(Z.TextEdit.del(Z.Range.create(a,c)))}s.push(Dr(7,t.uri,o[0].range.start,{edit:o,codeActionTitle:"Remove (...)"},o[o.length-1].range.end))}return t.closeBracket&&t.closeBracket.prevToken&&s.push(...mt(t.closeBracket.prevToken,e,0)),s},dU=(t,e,r,n,i)=>{let s=[];return s.push(...Pc(e.startLabels,i)),s.push(...cU(t,e.value,r,n,i)),s.push(...Pc(e.endLabels,i)),s},Xo=(t,e)=>{if(t.insertSpaces)return"".padStart(e," ");let r=Math.floor(e/t.tabSize),n=e%t.tabSize;return`${"".padStart(r," ")}${"".padStart(n," ")}`},fU=(t,e,r,n,i,s)=>{let o=[];return e.values.forEach((a,c)=>{if(!a)return[];let l=a.firstToken.prevToken,u=c?e.values.at(c-1):void 0;if(l)if(l.pos.line===a.firstToken.pos.line)if(l.value===","&&u?.lastToken.pos.line!==a.firstToken.pos.line&&l.prevToken?.pos.line!==a.firstToken.pos.line){let d=Ww(a.firstToken,r,n.singleIndent,Xo(n,t+3));d&&o.push(d)}else o.push(...mt(l,i,1));else if(s&&a.firstToken.prevToken===s)o.push(...mt(s,i));else{let d=Pf(a.firstToken,i,1,!0);d&&o.push(d),o.push(...Vy(a.firstToken,r,n.singleIndent,i,Xo(n,t+3)))}o.push(...dU(t,a,r,n,i)),a.nextValueSeparator&&o.push(...wc(a.lastToken,a.nextValueSeparator))}),o},pU=(t,e,r,n,i)=>{if(!le(t.uri,i))return[];let s=[];return s.push(...Or(t.firstToken,e,r.singleIndent,n,void 0,void 0,t.firstToken.prevToken?.value==="{")),s.push(...Pc(t.labels,n)),t.labels.length&&t.propertyName?.firstToken.prevToken&&s.push(...mt(t.propertyName.firstToken.prevToken,n)),t.values&&(t.propertyName&&s.push(...mt(t.propertyName?.lastToken,n)),s.push(...fU(t.propertyName?.name.length??0,t.values,e,r,n,t.assignOperatorToken))),t.lastToken.value===";"&&s.push(...wc(t.children[t.children.length-1].lastToken,t.lastToken)),s},Or=(t,e,r,n,i,s,o)=>{let a=[],c=Ww(t,e,r,i,s);if(c)a.push(c);else{let l=Pf(t,n,s,o);l&&a.push(l),a.push(...Vy(t,e,r,n,i))}return a},wc=(t,e)=>{if(t.pos.line===e.pos.line&&t.pos.colEnd+1===e.pos.colEnd)return[];if(t.nextToken===e){let s=Z.Position.create(t.pos.line,t.pos.colEnd),o=Z.Position.create(e.pos.line,e.pos.col),a=Z.TextEdit.del(Z.Range.create(s,o));return[Dr(1,t.uri,s,{edit:a,codeActionTitle:"Remove white space",templateStrings:["0"]},o)]}let r=Z.Position.create(t.pos.line,t.pos.colEnd),n=Z.Position.create(e.pos.line,e.pos.colEnd),i=[Z.TextEdit.insert(r,e.value),Z.TextEdit.del(Z.Range.create(Z.Position.create(e.prevToken?.pos.line??e.pos.line,e.prevToken?.pos.colEnd??e.pos.col),n))];return[Dr(6,t.uri,r,{edit:i,codeActionTitle:"Move token",templateStrings:[e.value]},n)]},hU=(t,e,r,n)=>{let i=[];i.push(...Or(t.firstToken,e,r,n));let s=mt(t.keyword.lastToken,n);return i.push(...s),t.lastToken.value===";"&&i.push(...wc(t.children[t.children.length-1].lastToken,t.lastToken)),i},mU=(t,e,r,n,i)=>{if(r===void 0)return[];if(!le(t.uri,e))return[];let s=[];s.push(...Or(t.firstToken,r.level,n,i));let o=mt(t.keyword.lastToken,i);return s.push(...o),s},gU=(t,e,r,n,i)=>t.comments.length===1&&t.firstToken.pos.line===t.firstToken.prevToken?.pos.line?[]:t.comments.flatMap((s,o)=>yU(s,t,e,r,n,o?o===t.comments.length-1?"last":"comment":"first",i)),Gw=(t,e,r="")=>{let n=e?Ly(e):void 0;if(!n)return r;let i=Hs(e),s=n.propertyName?.name.length??0;return`${`${Xo(t,s+(i?4:3)+(r.length-r.trimStart().length))}`}${r.trimStart()}`},yU=(t,e,r,n,i,s,o)=>{if(!t.firstToken.prevToken)return Or(t.firstToken,r?.level??0,n,i);if(t.firstToken.pos.line===t.firstToken.prevToken?.pos.line)return mt(t.firstToken.prevToken,i,1);if(r===void 0)return[];let a,c;s==="first"&&!e.astBeforeComment&&e.astAfterComment instanceof lt&&(a=!0,c=e.firstToken.prevToken?.value==="{"?1:2);let l=[],u="",d=t.toString();switch(s==="last"&&d.trim()!==""&&t.lastToken.prevToken&&(s="comment",l.push(...Or(t.lastToken.prevToken,r?.level??0,n,i," "))),s){case"comment":u=t.firstToken.value==="*"?" ":" * ";break;case"first":break;case"last":u=" ";break}return r?.inAst instanceof lt?l.push(...Or(t.firstToken,r?.level??0,n,i,u,c,a)):l.push(...Or(t.firstToken,r?.level??0,n,i,Gw(o,r?.inAst,u),c,a)),l},TU=(t,e,r,n,i)=>{if(!t.firstToken.prevToken)return Or(t.firstToken,e?.level??0,r,n);if(t.firstToken.pos.line===t.firstToken.prevToken.pos.line)return[];let o,a;return!t.astBeforeComment&&t.astAfterComment instanceof lt&&(o=!0,a=t.firstToken.prevToken?.value==="{"?1:2),Or(t.firstToken,e?.level??0,r,n,Gw(i,e?.inAst),a,o)},Kw=async(t,e,r,n,i,s=0)=>{let o=t.options.tabSize,a=t.options.insertSpaces,c=a?" ".repeat(o):" ",l={tabSize:o,insertSpaces:a,singleIndent:c};return e instanceof lt?oU(t,e,r,s,c,i,n):e instanceof Ye?pU(e,s,l,i,r):e instanceof Tr?hU(e,s,c,i):e instanceof Ri?mU(e,r,await n(e),c,i):e instanceof ln?TU(e,await n(e),c,i,l):e instanceof cn?gU(e,await n(e),c,i,l):[]};function vU(t,e){let r=t[e.start.line],n=t[e.end.line];if(e.start.line===e.end.line)return r.substring(e.start.character,e.end.character);let i=t.slice(e.start.line+1,e.end.line);return[r.substring(e.start.character),...i,n.substring(0,e.end.character)].join(`
194
+ `)}function bU(t){switch(t){case"EMPTY":return"EMPTY";case"U32":return"U32";case"U64":return"U64";case"STRING":return"STRING";case"PROP_ENCODED_ARRAY":return"PROP_ENCODED_ARRAY";case"STRINGLIST":return"STRINGLIST";case"BYTESTRING":return"BYTESTRING";case"ANY":return"ANY";case"UNKNOWN":return"UNKNOWN"}}var Y=class{constructor(e,r,n="optional",i=void 0,s,o){this.name=e;this.type=r;this.def=i;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:wt.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(bU).join(" or ")).join(",")}
195
195
 
196
196
  `,...this.bindingType?["**Binding type** ",`${this.bindingType}
197
197
 
@@ -200,9 +200,9 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
200
200
  `)]:[],...this.examples?["### Example",this.examples.join(`
201
201
 
202
202
  `)]:[]].join(`
203
- `)});this.signatureArgsCyclic=!1;typeof n!="function"?this.required=()=>n:this.required=n,typeof s!="function"?(this.allowedValues=s,this.values=()=>s===void 0?i?[i]:[]:i&&s.indexOf(i)===-1?[i,...s]:s):this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,r,n,i){let s=this.required(r);if(i){if(s==="omitted")return[j(11,i.ast.firstToken,i.ast.lastToken,i.ast,{templateStrings:[n]})]}else{if(s==="required"){let l=e.getOrderedNodeAst(r),u=zo(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case"U32":case"U64":case"PROP_ENCODED_ARRAY":d=` = <${n==="reg"&&r.address?r.address.map(f=>`0x${f.toString(16)}`).join(" "):""}>`;break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,p)=>{let g=f.openScope??u[p].lastToken,h=u[p];return j(0,h.firstToken,h.lastToken,h,{templateStrings:[n],edit:Et.TextEdit.insert(Et.Position.create(g.pos.line,g.pos.col+1),`
204
- ${"".padEnd(Jo(u[p].uri,f),e.context.formattingOptions.insertSpaces?" ".repeat(e.context.formattingOptions.tabSize):" ")}${n}${d};`)})})]}return[]}let o=_U(i),a=[],c=(l,u,d)=>{if(d??=i.ast,!(l.some(p=>p==u)||l.some(p=>p=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(p=>p=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let p=[];l.forEach(g=>{switch(g){case"EMPTY":p.push(1);break;case"STRING":p.push(2);break;case"STRINGLIST":p.push(3);break;case"U32":p.push(5);break;case"U64":p.push(6);break;case"PROP_ENCODED_ARRAY":p.push(7);break}}),p.length&&a.push(j(p,d.firstToken,d.lastToken,d,{templateStrings:[i.name]}))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;if(!this.list&&this.type.length!==o.length){let u=i.ast.values??i.ast;a.push(j(4,u.firstToken,u.lastToken,u,{templateStrings:[n,this.type.length.toString()]}))}else o.forEach((u,d)=>{if(l[0].types.every(f=>f!==u)){let f=i.ast.values?.values[d]??i.ast;a.push(j(3,f.firstToken,f.lastToken,f))}})}else{if(this.type[0].types.some(u=>u==="STRINGLIST"))o.some(u=>c(["STRINGLIST"],u,i.ast.values?.values[0]?.value));else if(this.list||this.type.length===1&&this.type[0].types.filter(u=>u!=="EMPTY").every(u=>u==="PROP_ENCODED_ARRAY"))o.some(u=>c(this.type[0].types,u,i.ast.values?.values[0]?.value));else if(o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")){let u=i.ast.propertyName??i.ast;a.push(j(8,u.firstToken,u.lastToken,u,{linkedTo:(i.ast.values?.values.slice(1)??[]).filter(d=>!!d),templateStrings:[i.name]}))}else o.length===1&&c(this.type[0].types,o[0],i.ast.values?.values[0]?.value);let l=this.values(i);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(i,e.context.macros)??[]),l.length&&this.type[0].types.some(u=>u==="STRING"))){let u=i.ast.values?.values[0]?.value;if(!l.some(d=>u.value===d)){let d=i.ast.values?.values[0]?.value??i.ast;a.push(j(9,d.firstToken,d.lastToken,d,{templateStrings:[this.values(i).map(f=>`'${f}'`).join(" or ")]}))}}}return a}getPropertyCompletionItems(e,r,n){let i=this.type.at(r);return i?.types.some(s=>s==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(s=>({label:`"${s}"`,kind:Et.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`"${s}"`})):i?.types.some(s=>s==="U32"||s==="U64")?this.values(e).map(s=>({label:`<${s}>`,kind:Et.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`<${s}>`})):[]}},_U=t=>t.ast.values?t.ast.values.values.map(e=>SU(e)):["EMPTY"],SU=t=>t?t.value instanceof ne?"STRING":t.value instanceof jt?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof ie||t.value instanceof it?"U32":"BYTESTRING":"UNKNOWN",wc=class{constructor(){this.extends=new Set}},Nt=class extends wc{constructor(r=()=>[]){super();this.additionalValidations=r;this.#e=[];this.noMismatchPropertiesAllowed=!1;this.warnMismatchProperties=!1}#e;#t;getIssue(r,n){let i=[];if(n.disabled){let a=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(c=>i.push(j(21,c.firstToken,c.lastToken,c,{severity:Et.DiagnosticSeverity.Hint,linkedTo:[...a?.ast?[a?.ast]:[]],tags:[Et.DiagnosticTag.Unnecessary]}))),i}let s=new Set,o=this.properties.flatMap(a=>{if(a.name==="reg"&&a.required(n)==="required"&&!n.address&&n.properties.find(u=>u.name==="reg")){let u=n.regArray(r.context.macros)?.at(0)?.startAddress.map(f=>f.toString(16)).join(","),d=n.definitions.at(-1).name??n.definitions.at(-1);i.push(j(36,d.firstToken,d.lastToken,d,{linkedTo:n.definitions.slice(0,-1).map(f=>f.name??f),edit:u?n.definitions.filter(f=>!!f.name).map(f=>Et.TextEdit.insert(Et.Position.create(f.name.lastToken.pos.line,f.name.lastToken.pos.colEnd),`@${u}`)):void 0,codeActionTitle:"Add Node Address"}))}if(typeof a.name=="string"){let u=n.getProperty(a.name);return u&&s.add(u),a.validateProperty(r,n,a.name,u)}let c=n.properties.filter(u=>a.getNameMatch(u.name));c.forEach(u=>s.add(u));let l=this.properties.filter(u=>u!==a)??[];return l.length&&c.some(u=>l.some(d=>d.getNameMatch(u.name)))?[]:c.flatMap(u=>a.validateProperty(r,n,u.name,u))});return s.size!==n.properties.length&&(this.noMismatchPropertiesAllowed||this.warnMismatchProperties)&&n.properties.filter(c=>!s.has(c)).forEach(c=>{i.push(j(this.warnMismatchProperties?34:27,c.ast.firstToken,c.ast.lastToken,c.ast,{severity:this.warnMismatchProperties?Et.DiagnosticSeverity.Warning:Et.DiagnosticSeverity.Error,templateStrings:[c.name],edit:Et.TextEdit.del(zr(c.ast.firstToken.prevToken,c.ast.lastToken,!1))}))}),[...i,...o,...this.additionalValidations(r,n)]}get properties(){return this.#e}addProperty(r){Array.isArray(r)?r.forEach(n=>this.#e.push(n)):this.#e.push(r),this.#e.sort((n,i)=>typeof n.name=="string"&&typeof i.name=="string"||typeof n.name!="string"&&typeof i.name!="string"?0:typeof n.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(r){r&&(this.#t=n=>{let i=r(n);return i.bindingsPath=this.bindingsPath,i})}getOnPropertyHover(r){let n=this.properties.find(i=>i.getNameMatch(r));return n?.onHover.bind(n)()}getSignatureHelp(r,n,i,s){let o=this.properties.find(f=>f.getNameMatch(r.name)),a=o?.signatureArgs;if(!o||!a)return;let c=r.getArgumentIndex(i),l=r.getArgumentIndex(s),d=r.getArgumentIndex(n)??l??(c!==void 0?c+1:void 0);if(vE(a)){let f=0;if(d!==void 0){let p=d,g=d?a.findIndex(h=>f<=p&&h.length+f>p?!0:(f+=h.length,!1)):void 0;g!==void 0&&(g>1&&(d=d-a.slice(0,g-1).reduce((h,T)=>h+T.length,0)),a=a.slice(g?g-1:0,g+2))}return{signatures:[Et.SignatureInformation.create(`${r.name} = ${a.map(p=>`<${p.map(g=>g.label).join(" ")}>`).join(`,
205
- `)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[Et.SignatureInformation.create(`${r.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(r){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(r)!=="omitted"&&typeof n.name=="string").map(n=>{let i=r&&n.required(r),s=!!r.properties.some(a=>n.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${n.name}`,kind:Et.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var xe=t=>{if(!t?.values.some(e=>!(e?.value instanceof jt)))return t?.values.flatMap(e=>e.value.values.map(r=>r.value))??[]};var $e=(t,e,r,n)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof jt){let s=i.values.at(r);if(s?.value instanceof we){let o=s.value.evaluate(n);if(typeof o=="number")return o}}},un=(t,e,r=0)=>{if(t instanceof vr){if(t?.value instanceof jt){let n=t.value.values.at(r);if(n?.value instanceof cr)return e.getPhandle(n.value.value);if(n?.value instanceof ie)return n.value.linksTo;if(n?.value instanceof it)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof cr)return e.getPhandle(t.value);if(t instanceof ie)return t.linksTo;if(t instanceof it)return t.path?.pathParts.at(-1)?.linksTo}},z=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var KE=()=>{let t=new K("compatible",z("STRINGLIST"));return t.description=["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."],t.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."],t};var Ef=$(H());var XE=()=>{let t=new K("device_type",z("STRING"),"optional",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 r=e.ast.values?.values.at(0)?.value;if(r instanceof ne&&r.value!==e.parent.name)return[j(e.parent.name==="cpu"?12:13,e.ast.firstToken,e.ast.lastToken,e.ast,{templateStrings:[e.name]})]}return t.required(e.parent)!=="required"?[j(14,e.ast.firstToken,e.ast.lastToken,e.ast,{severity:Ef.DiagnosticSeverity.Hint,tags:[Ef.DiagnosticTag.Deprecated],templateStrings:[e.name]})]:[]});return t.description=["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."],t};var JE=()=>{let t=new K("#interrupt-cells",z("U32"));return t.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],t};var QE=()=>{let t=new K("interrupt-controller",z("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var ZE=()=>{let t=new K("interrupt-parent",z("U32"));return t.description=["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."],t};var zy=$(H());var ew=()=>{let t=new K("interrupts",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=xe(e.ast.values);if(!i)return n;let s=e.parent;if(s.getProperty("interrupts-extended"))return n;let o=s.interruptsParent;if(!o?.parentInterruptNode){if(!o?.interruptParent)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"interrupt-parent",e.parent.pathString]})),n;let h=o.interruptParent.ast.values?.values.at(0)?.value??o.interruptParent.ast;return n.push(j(17,h.firstToken,h.lastToken,h)),n}let{parentInterruptNode:a}=o,c=a.getProperty("#interrupt-cells");if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let l=$e(c,0,0,r);if(!l)return n;let u=[...Array.from({length:l},()=>"Interrupt")],d=a.bindingLoader?.type?a.nodeType?.cellsValues?.find(h=>h.specifier==="interrupt"):void 0;d?(u=d.values,t.signatureArgs=d.values.map(h=>zy.ParameterInformation.create(h))):t.signatureArgs=u.map(h=>zy.ParameterInformation.create(h));let f=a.getProperty("interrupt-map"),p=s.parent?.getProperty("#address-cells");if(f&&!p){let h=e.ast.propertyName??e.ast;n.push(j(16,h.firstToken,h.lastToken,h,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",s.parent?.pathString??"/"]}))}if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let g=0;for(;g<i.length;){let h=i.length-g;if(l>h){let v=i[i.length-1];return n.push(j(19,v.firstToken,v.lastToken,v,{templateStrings:[e.name,`<${u.join(" ")}> `]})),n}let T=i.slice(g,g+l),S=s.mappedReg(r)?.at(0)?.startAddress,_={mappingValuesAst:T,target:a};if(e.nexusMapsTo.push(_),f&&S){let v=a.getNexusMapEntryMatch("interrupt",r,T,S);v?.match?_.mapItem=v.match:n.push(j(31,v.entry.firstToken,v.entry.lastToken,v.entry,{linkedTo:[f.ast]}))}T.every(v=>v instanceof we)&&a.interrupControlerMapping.push({expressions:T,node:s,property:e}),g+=l}return n});return t.description=["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."],t.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```"],t};var Dc=$(H());var tw=()=>{let t=new K("interrupts-extended",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=i.getProperty("interrupts");s&&n.push(j(15,s.ast.firstToken,s.ast.lastToken,s.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[s.name,"is ignored when 'interrupts-extended' is used"]}));let o=i.getProperty("interrupt-parent");o&&n.push(j(15,o.ast.firstToken,o.ast.lastToken,o.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[o.name,"is ignored when 'interrupts-extended' is used"]}));let a=i.root,c=xe(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=un(c[l],a);if(!f){let D=c[l];return n.push(j(17,D.firstToken,D.lastToken,D)),n}let p=f.getProperty("#interrupt-cells");if(!p){n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...f.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",f.pathString]}));break}let g=$e(p,0,0,r);if(g==null)return n;let h=c.length-l-1,T=f.bindingLoader?.type?f.nodeType?.cellsValues?.find(D=>D.specifier==="interrupt"):void 0;if(T?d.push(["phandle",...T.values]):d.push(["phandle",...Array.from({length:g},()=>"interrupt")]),g>h){let D=c[c.length-1];return n.push(j(19,D.firstToken,D.lastToken,D,{templateStrings:[e.name,`<${d.at(-1).join(" ")}>`]})),n}let S=c.slice(l+1,l+1+g),_=f.getProperty("interrupt-map"),v={mappingValuesAst:S,target:f};e.nexusMapsTo.push(v);let R=i.mappedReg(r)?.at(0)?.startAddress;if(_&&R){let D=f.getNexusMapEntryMatch("interrupt",r,S,R);D?.match?v.mapItem=D.match:n.push(j(31,D.entry.firstToken,D.entry.lastToken,D.entry,{linkedTo:[_.ast]}))}S.every(D=>D instanceof we)&&f.interrupControlerMapping.push({expressions:S,node:i,property:e}),l+=g+1,u++}return d.push([`${u}_phandle`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(p=>Dc.ParameterInformation.create(p))),n});return t.description=["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."],t.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```"],t};var rw=()=>{let t=new K("dma-noncoherent",z("EMPTY"));return t.description=["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."],t};var nw=()=>{let t=new K("dma-coherent",z("EMPTY"));return t.description=["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."],t};var iw=$(H());var sw=()=>{let t=new K("dma-ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>iw.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=xe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:i},()=>"length")].join(" ")}>`]}))}return n});return t.description=["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)."],t};var Cc=$(H());var wf=()=>{let t=new K("ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>Cc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=xe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:o},()=>"length")].join(" ")}>`]}))}return n.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(r)?.forEach(d=>{if(d.missingMapping){let f=l.parent?.getProperty("ranges");n.push(j(35,d.regRangeTokens.start,d.regRangeTokens.end,e.ast,{severity:Cc.DiagnosticSeverity.Warning,linkedTo:f?[f.ast]:[]}));return}!d?.mappingEnd||!d.mappedAst||d.inMappingRange||n.push(j(29,d.regRangeTokens.start,d.regRangeTokens.end,e.ast,{severity:Cc.DiagnosticSeverity.Warning,linkedTo:[d.mappedAst],templateStrings:[u.name,`0x${d.endAddress.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`]}))})}),n});return t.description=["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."],t.examples=["Address Translation Example:",["```devicetree",`soc {
203
+ `)});this.signatureArgsCyclic=!1;typeof n!="function"?this.required=()=>n:this.required=n,typeof s!="function"?(this.allowedValues=s,this.values=()=>s===void 0?i?[i]:[]:i&&s.indexOf(i)===-1?[i,...s]:s):this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,r,n,i){let s=this.required(r);if(i){if(s==="omitted")return[j(11,i.ast.firstToken,i.ast.lastToken,i.ast,{templateStrings:[n]})]}else{if(s==="required"){let l=e.getOrderedNodeAst(r),u=zo(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case"U32":case"U64":case"PROP_ENCODED_ARRAY":d=` = <${n==="reg"&&r.address?r.address.map(f=>`0x${f.toString(16)}`).join(" "):""}>`;break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,p)=>{let g=f.openScope??u[p].lastToken,h=u[p];return j(0,h.firstToken,h.lastToken,h,{templateStrings:[n],edit:wt.TextEdit.insert(wt.Position.create(g.pos.line,g.pos.col+1),`
204
+ ${"".padEnd(Jo(u[p].uri,f),e.context.formattingOptions.insertSpaces?" ".repeat(e.context.formattingOptions.tabSize):" ")}${n}${d};`)})})]}return[]}let o=_U(i),a=[],c=(l,u,d)=>{if(d??=i.ast,!(l.some(p=>p==u)||l.some(p=>p=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(p=>p=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let p=[];l.forEach(g=>{switch(g){case"EMPTY":p.push(1);break;case"STRING":p.push(2);break;case"STRINGLIST":p.push(3);break;case"U32":p.push(5);break;case"U64":p.push(6);break;case"PROP_ENCODED_ARRAY":p.push(7);break}}),p.length&&a.push(j(p,d.firstToken,d.lastToken,d,{templateStrings:[i.name]}))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;if(!this.list&&this.type.length!==o.length){let u=i.ast.values??i.ast;a.push(j(4,u.firstToken,u.lastToken,u,{templateStrings:[n,this.type.length.toString()]}))}else o.forEach((u,d)=>{if(l[0].types.every(f=>f!==u)){let f=i.ast.values?.values[d]??i.ast;a.push(j(3,f.firstToken,f.lastToken,f))}})}else{if(this.type[0].types.some(u=>u==="STRINGLIST"))o.some(u=>c(["STRINGLIST"],u,i.ast.values?.values[0]?.value));else if(this.list||this.type.length===1&&this.type[0].types.filter(u=>u!=="EMPTY").every(u=>u==="PROP_ENCODED_ARRAY"))o.some(u=>c(this.type[0].types,u,i.ast.values?.values[0]?.value));else if(o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")){let u=i.ast.propertyName??i.ast;a.push(j(8,u.firstToken,u.lastToken,u,{linkedTo:(i.ast.values?.values.slice(1)??[]).filter(d=>!!d),templateStrings:[i.name]}))}else o.length===1&&c(this.type[0].types,o[0],i.ast.values?.values[0]?.value);let l=this.values(i);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(i,e.context.macros)??[]),l.length&&this.type[0].types.some(u=>u==="STRING"))){let u=i.ast.values?.values[0]?.value;if(!l.some(d=>u.value===d)){let d=i.ast.values?.values[0]?.value??i.ast;a.push(j(9,d.firstToken,d.lastToken,d,{templateStrings:[this.values(i).map(f=>`'${f}'`).join(" or ")]}))}}}return a}getPropertyCompletionItems(e,r,n){let i=this.type.at(r);return i?.types.some(s=>s==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(s=>({label:`"${s}"`,kind:wt.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`"${s}"`})):i?.types.some(s=>s==="U32"||s==="U64")?this.values(e).map(s=>({label:`<${s}>`,kind:wt.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`<${s}>`})):[]}},_U=t=>t.ast.values?t.ast.values.values.map(e=>SU(e)):["EMPTY"],SU=t=>t?t.value instanceof ne?"STRING":t.value instanceof jt?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof ie||t.value instanceof it?"U32":"BYTESTRING":"UNKNOWN",Ec=class{constructor(){this.extends=new Set}},Nt=class extends Ec{constructor(r=()=>[]){super();this.additionalValidations=r;this.#e=[];this.noMismatchPropertiesAllowed=!1;this.warnMismatchProperties=!1}#e;#t;getIssue(r,n){let i=[];if(n.disabled){let a=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(c=>i.push(j(21,c.firstToken,c.lastToken,c,{severity:wt.DiagnosticSeverity.Hint,linkedTo:[...a?.ast?[a?.ast]:[]],tags:[wt.DiagnosticTag.Unnecessary]}))),i}let s=new Set,o=this.properties.flatMap(a=>{if(a.name==="reg"&&a.required(n)==="required"&&!n.address&&n.properties.find(u=>u.name==="reg")){let u=n.regArray(r.context.macros)?.at(0)?.startAddress.map(f=>f.toString(16)).join(","),d=n.definitions.at(-1).name??n.definitions.at(-1);i.push(j(36,d.firstToken,d.lastToken,d,{linkedTo:n.definitions.slice(0,-1).map(f=>f.name??f),edit:u?n.definitions.filter(f=>!!f.name).map(f=>wt.TextEdit.insert(wt.Position.create(f.name.lastToken.pos.line,f.name.lastToken.pos.colEnd),`@${u}`)):void 0,codeActionTitle:"Add Node Address"}))}if(typeof a.name=="string"){let u=n.getProperty(a.name);return u&&s.add(u),a.validateProperty(r,n,a.name,u)}let c=n.properties.filter(u=>a.getNameMatch(u.name));c.forEach(u=>s.add(u));let l=this.properties.filter(u=>u!==a)??[];return l.length&&c.some(u=>l.some(d=>d.getNameMatch(u.name)))?[]:c.flatMap(u=>a.validateProperty(r,n,u.name,u))});return s.size!==n.properties.length&&(this.noMismatchPropertiesAllowed||this.warnMismatchProperties)&&n.properties.filter(c=>!s.has(c)).forEach(c=>{i.push(j(this.warnMismatchProperties?34:27,c.ast.firstToken,c.ast.lastToken,c.ast,{severity:this.warnMismatchProperties?wt.DiagnosticSeverity.Warning:wt.DiagnosticSeverity.Error,templateStrings:[c.name],edit:wt.TextEdit.del(zr(c.ast.firstToken.prevToken,c.ast.lastToken,!1))}))}),[...i,...o,...this.additionalValidations(r,n)]}get properties(){return this.#e}addProperty(r){Array.isArray(r)?r.forEach(n=>this.#e.push(n)):this.#e.push(r),this.#e.sort((n,i)=>typeof n.name=="string"&&typeof i.name=="string"||typeof n.name!="string"&&typeof i.name!="string"?0:typeof n.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(r){r&&(this.#t=n=>{let i=r(n);return i.bindingsPath=this.bindingsPath,i})}getOnPropertyHover(r){let n=this.properties.find(i=>i.getNameMatch(r));return n?.onHover.bind(n)()}getSignatureHelp(r,n,i,s){let o=this.properties.find(f=>f.getNameMatch(r.name)),a=o?.signatureArgs;if(!o||!a)return;let c=r.getArgumentIndex(i),l=r.getArgumentIndex(s),d=r.getArgumentIndex(n)??l??(c!==void 0?c+1:void 0);if(vw(a)){let f=0;if(d!==void 0){let p=d,g=d?a.findIndex(h=>f<=p&&h.length+f>p?!0:(f+=h.length,!1)):void 0;g!==void 0&&(g>1&&(d=d-a.slice(0,g-1).reduce((h,T)=>h+T.length,0)),a=a.slice(g?g-1:0,g+2))}return{signatures:[wt.SignatureInformation.create(`${r.name} = ${a.map(p=>`<${p.map(g=>g.label).join(" ")}>`).join(`,
205
+ `)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[wt.SignatureInformation.create(`${r.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(r){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(r)!=="omitted"&&typeof n.name=="string").map(n=>{let i=r&&n.required(r),s=!!r.properties.some(a=>n.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${n.name}`,kind:wt.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var xe=t=>{if(!t?.values.some(e=>!(e?.value instanceof jt)))return t?.values.flatMap(e=>e.value.values.map(r=>r.value))??[]};var $e=(t,e,r,n)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof jt){let s=i.values.at(r);if(s?.value instanceof Ee){let o=s.value.evaluate(n);if(typeof o=="number")return o}}},un=(t,e,r=0)=>{if(t instanceof vr){if(t?.value instanceof jt){let n=t.value.values.at(r);if(n?.value instanceof cr)return e.getPhandle(n.value.value);if(n?.value instanceof ie)return n.value.linksTo;if(n?.value instanceof it)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof cr)return e.getPhandle(t.value);if(t instanceof ie)return t.linksTo;if(t instanceof it)return t.path?.pathParts.at(-1)?.linksTo}},z=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var Yw=()=>{let t=new Y("compatible",z("STRINGLIST"));return t.description=["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."],t.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."],t};var wf=$(H());var Xw=()=>{let t=new Y("device_type",z("STRING"),"optional",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 r=e.ast.values?.values.at(0)?.value;if(r instanceof ne&&r.value!==e.parent.name)return[j(e.parent.name==="cpu"?12:13,e.ast.firstToken,e.ast.lastToken,e.ast,{templateStrings:[e.name]})]}return t.required(e.parent)!=="required"?[j(14,e.ast.firstToken,e.ast.lastToken,e.ast,{severity:wf.DiagnosticSeverity.Hint,tags:[wf.DiagnosticTag.Deprecated],templateStrings:[e.name]})]:[]});return t.description=["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."],t};var Jw=()=>{let t=new Y("#interrupt-cells",z("U32"));return t.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],t};var Qw=()=>{let t=new Y("interrupt-controller",z("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var Zw=()=>{let t=new Y("interrupt-parent",z("U32"));return t.description=["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."],t};var zy=$(H());var eE=()=>{let t=new Y("interrupts",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=xe(e.ast.values);if(!i)return n;let s=e.parent;if(s.getProperty("interrupts-extended"))return n;let o=s.interruptsParent;if(!o?.parentInterruptNode){if(!o?.interruptParent)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"interrupt-parent",e.parent.pathString]})),n;let h=o.interruptParent.ast.values?.values.at(0)?.value??o.interruptParent.ast;return n.push(j(17,h.firstToken,h.lastToken,h)),n}let{parentInterruptNode:a}=o,c=a.getProperty("#interrupt-cells");if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let l=$e(c,0,0,r);if(!l)return n;let u=[...Array.from({length:l},()=>"Interrupt")],d=a.bindingLoader?.type?a.nodeType?.cellsValues?.find(h=>h.specifier==="interrupt"):void 0;d?(u=d.values,t.signatureArgs=d.values.map(h=>zy.ParameterInformation.create(h))):t.signatureArgs=u.map(h=>zy.ParameterInformation.create(h));let f=a.getProperty("interrupt-map"),p=s.parent?.getProperty("#address-cells");if(f&&!p){let h=e.ast.propertyName??e.ast;n.push(j(16,h.firstToken,h.lastToken,h,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",s.parent?.pathString??"/"]}))}if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let g=0;for(;g<i.length;){let h=i.length-g;if(l>h){let v=i[i.length-1];return n.push(j(19,v.firstToken,v.lastToken,v,{templateStrings:[e.name,`<${u.join(" ")}> `]})),n}let T=i.slice(g,g+l),S=s.mappedReg(r)?.at(0)?.startAddress,_={mappingValuesAst:T,target:a};if(e.nexusMapsTo.push(_),f&&S){let v=a.getNexusMapEntryMatch("interrupt",r,T,S);v?.match?_.mapItem=v.match:n.push(j(31,v.entry.firstToken,v.entry.lastToken,v.entry,{linkedTo:[f.ast]}))}T.every(v=>v instanceof Ee)&&a.interrupControlerMapping.push({expressions:T,node:s,property:e}),g+=l}return n});return t.description=["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."],t.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```"],t};var Cc=$(H());var tE=()=>{let t=new Y("interrupts-extended",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=i.getProperty("interrupts");s&&n.push(j(15,s.ast.firstToken,s.ast.lastToken,s.ast,{severity:Cc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[s.name,"is ignored when 'interrupts-extended' is used"]}));let o=i.getProperty("interrupt-parent");o&&n.push(j(15,o.ast.firstToken,o.ast.lastToken,o.ast,{severity:Cc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[o.name,"is ignored when 'interrupts-extended' is used"]}));let a=i.root,c=xe(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=un(c[l],a);if(!f){let C=c[l];return n.push(j(17,C.firstToken,C.lastToken,C)),n}let p=f.getProperty("#interrupt-cells");if(!p){n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...f.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",f.pathString]}));break}let g=$e(p,0,0,r);if(g==null)return n;let h=c.length-l-1,T=f.bindingLoader?.type?f.nodeType?.cellsValues?.find(C=>C.specifier==="interrupt"):void 0;if(T?d.push(["phandle",...T.values]):d.push(["phandle",...Array.from({length:g},()=>"interrupt")]),g>h){let C=c[c.length-1];return n.push(j(19,C.firstToken,C.lastToken,C,{templateStrings:[e.name,`<${d.at(-1).join(" ")}>`]})),n}let S=c.slice(l+1,l+1+g),_=f.getProperty("interrupt-map"),v={mappingValuesAst:S,target:f};e.nexusMapsTo.push(v);let R=i.mappedReg(r)?.at(0)?.startAddress;if(_&&R){let C=f.getNexusMapEntryMatch("interrupt",r,S,R);C?.match?v.mapItem=C.match:n.push(j(31,C.entry.firstToken,C.entry.lastToken,C.entry,{linkedTo:[_.ast]}))}S.every(C=>C instanceof Ee)&&f.interrupControlerMapping.push({expressions:S,node:i,property:e}),l+=g+1,u++}return d.push([`${u}_phandle`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(p=>Cc.ParameterInformation.create(p))),n});return t.description=["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."],t.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```"],t};var rE=()=>{let t=new Y("dma-noncoherent",z("EMPTY"));return t.description=["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."],t};var nE=()=>{let t=new Y("dma-coherent",z("EMPTY"));return t.description=["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."],t};var iE=$(H());var sE=()=>{let t=new Y("dma-ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>iE.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=xe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:i},()=>"length")].join(" ")}>`]}))}return n});return t.description=["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)."],t};var Dc=$(H());var Ef=()=>{let t=new Y("ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>Dc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=xe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:o},()=>"length")].join(" ")}>`]}))}return n.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(r)?.forEach(d=>{if(d.missingMapping){let f=l.parent?.getProperty("ranges");n.push(j(35,d.regRangeTokens.start,d.regRangeTokens.end,e.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:f?[f.ast]:[]}));return}!d?.mappingEnd||!d.mappedAst||d.inMappingRange||n.push(j(29,d.regRangeTokens.start,d.regRangeTokens.end,e.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:[d.mappedAst],templateStrings:[u.name,`0x${d.endAddress.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`]}))})}),n});return t.description=["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."],t.examples=["Address Translation Example:",["```devicetree",`soc {
206
206
  compatible = "simple-bus";
207
207
  #address-cells = <1>;
208
208
  #size-cells = <1>;
@@ -217,7 +217,7 @@ ${"".padEnd(Jo(u[p].uri,f),e.context.formattingOptions.insertSpaces?" ".repeat(e
217
217
  };
218
218
  };`,"```"].join(`
219
219
  `),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
220
- `),"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."],t};var ow=()=>{let t=new K("virtual-reg",z("U32"));return t.description=["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."],t};var aw=$(H());var cw=()=>{let t=new K("reg",z("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,r)=>{let n=[],i=e.parent.parentSizeCells(r),s=e.parent.parentAddressCells(r),o=[...Array.from({length:s},(l,u)=>`address${s>1?u:""}`),...Array.from({length:i},(l,u)=>`size${i>1?u:""}`)];t.signatureArgs=o.map(l=>aw.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let a=xe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let l=a.at(a.length-a.length%(i+s))??e.ast;return n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"address"),...Array.from({length:i},()=>"size")].join(" ")}>`]})),n}let c=a.slice(0,s).map((l,u)=>$e(e,0,u,r)??0);if(e.parent.address&&sn(e.parent.address,c)!==0){let l=e.ast.values?.values.at(0)?.value?.values?.at(0),u=e.ast.values?.values.at(0)?.value?.values?.at(s-1),f=(l&&u?new Q(oe(l.firstToken,u.lastToken)):void 0)??e.ast.values??e.ast;n.push(j(10,f.firstToken,f.lastToken,f,{templateStrings:[e.name]}))}return n});return t.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```"],t};var Df=()=>new K("#size-cells",z("U32"),"optional",1);var Cf=()=>{let t=new K("#address-cells",z("U32"),"optional",2);return t.description=["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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
220
+ `),"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."],t};var oE=()=>{let t=new Y("virtual-reg",z("U32"));return t.description=["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."],t};var aE=$(H());var cE=()=>{let t=new Y("reg",z("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,r)=>{let n=[],i=e.parent.parentSizeCells(r),s=e.parent.parentAddressCells(r),o=[...Array.from({length:s},(l,u)=>`address${s>1?u:""}`),...Array.from({length:i},(l,u)=>`size${i>1?u:""}`)];t.signatureArgs=o.map(l=>aE.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let a=xe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let l=a.at(a.length-a.length%(i+s))??e.ast;return n.push(j(19,l.firstToken,l.lastToken,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"address"),...Array.from({length:i},()=>"size")].join(" ")}>`]})),n}let c=a.slice(0,s).map((l,u)=>$e(e,0,u,r)??0);if(e.parent.address&&sn(e.parent.address,c)!==0){let l=e.ast.values?.values.at(0)?.value?.values?.at(0),u=e.ast.values?.values.at(0)?.value?.values?.at(s-1),f=(l&&u?new Q(oe(l.firstToken,u.lastToken)):void 0)??e.ast.values??e.ast;n.push(j(10,f.firstToken,f.lastToken,f,{templateStrings:[e.name]}))}return n});return t.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```"],t};var Cf=()=>new Y("#size-cells",z("U32"),"optional",1);var Df=()=>{let t=new Y("#address-cells",z("U32"),"optional",2);return t.description=["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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
221
221
  #address-cells = <1>;
222
222
  #size-cells = <1>;
223
223
  serial@4600 {
@@ -228,8 +228,8 @@ ${"".padEnd(Jo(u[p].uri,f),e.context.formattingOptions.insertSpaces?" ".repeat(e
228
228
  interrupt-parent = <&ipic>;
229
229
  };
230
230
  };`,"```"].join(`
231
- `),"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)."],t};var lw=()=>{let t=new K("status",z("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
232
- The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var uw=()=>{let t=new K("phandle",z("U32"),"optional",void 0,void 0,(e,r)=>{let n=$e(e,0,0,r);if(n){let i=e.parent.root.getAllPhandle(n);if(i.length>1&&i.at(-1)===e.parent){let s=e.ast.values?.values.at(0)??e.ast;return[j(18,s.firstToken,s.lastToken,s,{linkedTo:i.slice(0,-1).flatMap(o=>o.getProperty("phandle")?.ast).filter(o=>!!o),templateStrings:[e.name]})]}}return[]});return t.description=["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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
231
+ `),"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)."],t};var lE=()=>{let t=new Y("status",z("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
232
+ The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var uE=()=>{let t=new Y("phandle",z("U32"),"optional",void 0,void 0,(e,r)=>{let n=$e(e,0,0,r);if(n){let i=e.parent.root.getAllPhandle(n);if(i.length>1&&i.at(-1)===e.parent){let s=e.ast.values?.values.at(0)??e.ast;return[j(18,s.firstToken,s.lastToken,s,{linkedTo:i.slice(0,-1).flatMap(o=>o.getProperty("phandle")?.ast).filter(o=>!!o),templateStrings:[e.name]})]}}return[]});return t.description=["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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
233
233
  phandle = <1>;
234
234
  interrupt-controller;
235
235
  reg = <0x10000000 0x100>;
@@ -237,30 +237,30 @@ ${"".padEnd(Jo(u[p].uri,f),e.context.formattingOptions.insertSpaces?" ".repeat(e
237
237
  `),"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 {
238
238
  interrupt-parent = <1>;
239
239
  };`,"```"].join(`
240
- `)],t};var dw=()=>{let t=new K("model",z("STRING"));return t.description=["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.'],t.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],t};var Af=$(H());var fw=()=>{let t=new K("name",z("STRING"),"optional",void 0,void 0,e=>[j(14,e.ast.firstToken,e.ast.lastToken,e.ast,{severity:Af.DiagnosticSeverity.Warning,tags:[Af.DiagnosticTag.Deprecated],templateStrings:[e.name]})]);return t.hideAutoComplete=!0,t};var pw=$(H());var hw=()=>{let t=new K("interrupt-map",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=e.parent.root,o=xe(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",i.pathString]}));let c=i.getProperty("#interrupt-cells");if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...i.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]})),n;let l=i.addressCells(r),u=$e(c,0,0,r),d={};if(u==null)return n;let f=0,p=[],g=0,h=0;for(;f<o.length;){if(p.push([...Array.from({length:l},(M,F)=>`${g}_ChildAddr${l>1?F:""}`),...Array.from({length:u},(M,F)=>`${g}_ChildIntrpt${u>1?F:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),f+l+u>=o.length){let M=f+l+u,F=o[o.length-1];n.push(j(20,F.firstToken,F.lastToken,F,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%M===0?M:(o.length-h)%M).join(" ")}`]}));break}let T=new Q(oe(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),S="";for(let M=f;M<l+u+f;M++){let F=o[M];S+=`${F instanceof we?F.evaluate(r).toString():F.toString()}:`}d[S]??=[],d[S].push(T),f+=l+u;let _=l+u+1;if(o.length<f+1){let M=o[o.length-1];n.push(j(20,M.firstToken,M.lastToken,M,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%_===0?_:(o.length-h)%_).join(" ")}`]}));break}let v=un(o[f],s);if(!v){let M=o[f];n.push(j(17,M.firstToken,M.lastToken,M));break}let R=v.addressCells(r),D=v.getProperty("#interrupt-cells");if(!D){let M=o[f];n.push(j(16,M.firstToken,M.lastToken,M,{linkedTo:[...v.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]}));break}f++;let B=$e(D,0,0,r);if(B==null)break;if(p.splice(-1,1,[...Array.from({length:l},(M,F)=>`${g}_ChildAddr${l>1?F:""}`),...Array.from({length:u},(M,F)=>`${g}_ChildIntrpt${u>1?F:""}`),`${g}_IntrptParent`,...Array.from({length:R},(M,F)=>`${g}_ParentAddr${R>1?F:""}`),...Array.from({length:B},(M,F)=>`${g}_ParentIntrpt${B>1?F:""}`)]),f+=R+B,o.length<f){let M=l+u+1+R+B,F=o[o.length-1];n.push(j(20,F.firstToken,F.lastToken,F,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%M===0?M:(o.length-h)%M).join(" ")}`]}));break}h=f,g++}if(p.push([...Array.from({length:l},(T,S)=>`${g}_ChildAddr${l>1?S:""}`),...Array.from({length:u},(T,S)=>`${g}_ChildIntrpt${u>1?S:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),t.signatureArgs=p.map(T=>T.map(S=>pw.ParameterInformation.create(S))),!e.ast.values)return[];for(let T=0;T<e.ast.values.values.length;T++){let S=e.ast.values.values.at(T);if(S&&(n.length||u==null||!(S.value instanceof jt)))return n}return Object.values(d).forEach(T=>{if(T.length>1){let S=T[T.length-1];n.push(j(30,S.firstToken,S.lastToken,S,{linkedTo:T.slice(0,-1)}))}}),n});return t.description=["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."],t};var mw;(function(t){function e(r){return typeof r=="string"}t.is=e})(mw||(mw={}));var Wy;(function(t){function e(r){return typeof r=="string"}t.is=e})(Wy||(Wy={}));var gw;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(gw||(gw={}));var Of;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Of||(Of={}));var Wr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Of.MAX_VALUE),i===Number.MAX_VALUE&&(i=Of.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&O.uinteger(i.line)&&O.uinteger(i.character)}t.is=r})(Wr||(Wr={}));var Ct;(function(t){function e(n,i,s,o){if(O.uinteger(n)&&O.uinteger(i)&&O.uinteger(s)&&O.uinteger(o))return{start:Wr.create(n,i),end:Wr.create(s,o)};if(Wr.is(n)&&Wr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${o}]`)}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Wr.is(i.start)&&Wr.is(i.end)}t.is=r})(Ct||(Ct={}));var If;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Ct.is(i.range)&&(O.string(i.uri)||O.undefined(i.uri))}t.is=r})(If||(If={}));var yw;(function(t){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Ct.is(i.targetRange)&&O.string(i.targetUri)&&Ct.is(i.targetSelectionRange)&&(Ct.is(i.originSelectionRange)||O.undefined(i.originSelectionRange))}t.is=r})(yw||(yw={}));var Gy;(function(t){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&O.numberRange(i.red,0,1)&&O.numberRange(i.green,0,1)&&O.numberRange(i.blue,0,1)&&O.numberRange(i.alpha,0,1)}t.is=r})(Gy||(Gy={}));var Tw;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Ct.is(i.range)&&Gy.is(i.color)}t.is=r})(Tw||(Tw={}));var vw;(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&O.string(i.label)&&(O.undefined(i.textEdit)||Zo.is(i))&&(O.undefined(i.additionalTextEdits)||O.typedArray(i.additionalTextEdits,Zo.is))}t.is=r})(vw||(vw={}));var bw;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(bw||(bw={}));var _w;(function(t){function e(n,i,s,o,a,c){let l={startLine:n,endLine:i};return O.defined(s)&&(l.startCharacter=s),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&O.uinteger(i.startLine)&&O.uinteger(i.startLine)&&(O.undefined(i.startCharacter)||O.uinteger(i.startCharacter))&&(O.undefined(i.endCharacter)||O.uinteger(i.endCharacter))&&(O.undefined(i.kind)||O.string(i.kind))}t.is=r})(_w||(_w={}));var Yy;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&If.is(i.location)&&O.string(i.message)}t.is=r})(Yy||(Yy={}));var Sw;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Sw||(Sw={}));var Nw;(function(t){t.Unnecessary=1,t.Deprecated=2})(Nw||(Nw={}));var kw;(function(t){function e(r){let n=r;return O.objectLiteral(n)&&O.string(n.href)}t.is=e})(kw||(kw={}));var Mf;(function(t){function e(n,i,s,o,a,c){let l={range:n,message:i};return O.defined(s)&&(l.severity=s),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let s=n;return O.defined(s)&&Ct.is(s.range)&&O.string(s.message)&&(O.number(s.severity)||O.undefined(s.severity))&&(O.integer(s.code)||O.string(s.code)||O.undefined(s.code))&&(O.undefined(s.codeDescription)||O.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(O.string(s.source)||O.undefined(s.source))&&(O.undefined(s.relatedInformation)||O.typedArray(s.relatedInformation,Yy.is))}t.is=r})(Mf||(Mf={}));var Qo;(function(t){function e(n,i,...s){let o={title:n,command:i};return O.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function r(n){let i=n;return O.defined(i)&&O.string(i.title)&&O.string(i.command)}t.is=r})(Qo||(Qo={}));var Zo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function r(s,o){return{range:{start:s,end:s},newText:o}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let o=s;return O.objectLiteral(o)&&O.string(o.newText)&&Ct.is(o.range)}t.is=i})(Zo||(Zo={}));var Ky;(function(t){function e(n,i,s){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&O.string(i.label)&&(O.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(O.string(i.description)||i.description===void 0)}t.is=r})(Ky||(Ky={}));var ea;(function(t){function e(r){let n=r;return O.string(n)}t.is=e})(ea||(ea={}));var Rw;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function r(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}t.del=n;function i(s){let o=s;return Zo.is(o)&&(Ky.is(o.annotationId)||ea.is(o.annotationId))}t.is=i})(Rw||(Rw={}));var Xy;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&tT.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Xy||(Xy={}));var Jy;(function(t){function e(n,i,s){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&O.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Jy||(Jy={}));var Qy;(function(t){function e(n,i,s,o){let a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&O.string(i.oldUri)&&O.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||O.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||O.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Qy||(Qy={}));var Zy;(function(t){function e(n,i,s){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&O.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||O.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||O.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Zy||(Zy={}));var eT;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>O.string(i.kind)?Jy.is(i)||Qy.is(i)||Zy.is(i):Xy.is(i)))}t.is=e})(eT||(eT={}));var Pw;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return O.defined(i)&&O.string(i.uri)}t.is=r})(Pw||(Pw={}));var Ew;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&O.string(i.uri)&&O.integer(i.version)}t.is=r})(Ew||(Ew={}));var tT;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&O.string(i.uri)&&(i.version===null||O.integer(i.version))}t.is=r})(tT||(tT={}));var ww;(function(t){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}t.create=e;function r(n){let i=n;return O.defined(i)&&O.string(i.uri)&&O.string(i.languageId)&&O.integer(i.version)&&O.string(i.text)}t.is=r})(ww||(ww={}));var rs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(rs||(rs={}));var Ac;(function(t){function e(r){let n=r;return O.objectLiteral(r)&&rs.is(n.kind)&&O.string(n.value)}t.is=e})(Ac||(Ac={}));var Dw;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Dw||(Dw={}));var Cw;(function(t){t.PlainText=1,t.Snippet=2})(Cw||(Cw={}));var Aw;(function(t){t.Deprecated=1})(Aw||(Aw={}));var Ow;(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&O.string(i.newText)&&Ct.is(i.insert)&&Ct.is(i.replace)}t.is=r})(Ow||(Ow={}));var Iw;(function(t){t.asIs=1,t.adjustIndentation=2})(Iw||(Iw={}));var Mw;(function(t){function e(r){let n=r;return n&&(O.string(n.detail)||n.detail===void 0)&&(O.string(n.description)||n.description===void 0)}t.is=e})(Mw||(Mw={}));var xw;(function(t){function e(r){return{label:r}}t.create=e})(xw||(xw={}));var Lw;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Lw||(Lw={}));var xf;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return O.string(i)||O.objectLiteral(i)&&O.string(i.language)&&O.string(i.value)}t.is=r})(xf||(xf={}));var qw;(function(t){function e(r){let n=r;return!!n&&O.objectLiteral(n)&&(Ac.is(n.contents)||xf.is(n.contents)||O.typedArray(n.contents,xf.is))&&(r.range===void 0||Ct.is(r.range))}t.is=e})(qw||(qw={}));var Mr;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Mr||(Mr={}));var $w;(function(t){function e(r,n,...i){let s={label:r};return O.defined(n)&&(s.documentation=n),O.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})($w||($w={}));var Bw;(function(t){t.Text=1,t.Read=2,t.Write=3})(Bw||(Bw={}));var Fw;(function(t){function e(r,n){let i={range:r};return O.number(n)&&(i.kind=n),i}t.create=e})(Fw||(Fw={}));var jw;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(jw||(jw={}));var Uw;(function(t){t.Deprecated=1})(Uw||(Uw={}));var Hw;(function(t){function e(r,n,i,s,o){let a={name:r,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(Hw||(Hw={}));var Vw;(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Vw||(Vw={}));var zw;(function(t){function e(n,i,s,o,a,c){let l={name:n,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&O.string(i.name)&&O.number(i.kind)&&Ct.is(i.range)&&Ct.is(i.selectionRange)&&(i.detail===void 0||O.string(i.detail))&&(i.deprecated===void 0||O.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(zw||(zw={}));var Ww;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Ww||(Ww={}));var Lf;(function(t){t.Invoked=1,t.Automatic=2})(Lf||(Lf={}));var Gw;(function(t){function e(n,i,s){let o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function r(n){let i=n;return O.defined(i)&&O.typedArray(i.diagnostics,Mf.is)&&(i.only===void 0||O.typedArray(i.only,O.string))&&(i.triggerKind===void 0||i.triggerKind===Lf.Invoked||i.triggerKind===Lf.Automatic)}t.is=r})(Gw||(Gw={}));var Yw;(function(t){function e(n,i,s){let o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Qo.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return i&&O.string(i.title)&&(i.diagnostics===void 0||O.typedArray(i.diagnostics,Mf.is))&&(i.kind===void 0||O.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Qo.is(i.command))&&(i.isPreferred===void 0||O.boolean(i.isPreferred))&&(i.edit===void 0||eT.is(i.edit))}t.is=r})(Yw||(Yw={}));var Kw;(function(t){function e(n,i){let s={range:n};return O.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return O.defined(i)&&Ct.is(i.range)&&(O.undefined(i.command)||Qo.is(i.command))}t.is=r})(Kw||(Kw={}));var Xw;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&O.uinteger(i.tabSize)&&O.boolean(i.insertSpaces)}t.is=r})(Xw||(Xw={}));var Jw;(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return O.defined(i)&&Ct.is(i.range)&&(O.undefined(i.target)||O.string(i.target))}t.is=r})(Jw||(Jw={}));var Qw;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Ct.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Qw||(Qw={}));var Zw;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Zw||(Zw={}));var eD;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(eD||(eD={}));var tD;(function(t){function e(r){let n=r;return O.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(tD||(tD={}));var rD;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Ct.is(i.range)&&O.string(i.text)}t.is=r})(rD||(rD={}));var nD;(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&Ct.is(i.range)&&O.boolean(i.caseSensitiveLookup)&&(O.string(i.variableName)||i.variableName===void 0)}t.is=r})(nD||(nD={}));var iD;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Ct.is(i.range)&&(O.string(i.expression)||i.expression===void 0)}t.is=r})(iD||(iD={}));var sD;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return O.defined(i)&&Ct.is(n.stoppedLocation)}t.is=r})(sD||(sD={}));var rT;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(rT||(rT={}));var nT;(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&(i.tooltip===void 0||O.string(i.tooltip)||Ac.is(i.tooltip))&&(i.location===void 0||If.is(i.location))&&(i.command===void 0||Qo.is(i.command))}t.is=r})(nT||(nT={}));var oD;(function(t){function e(n,i,s){let o={position:n,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return O.objectLiteral(i)&&Wr.is(i.position)&&(O.string(i.label)||O.typedArray(i.label,nT.is))&&(i.kind===void 0||rT.is(i.kind))&&i.textEdits===void 0||O.typedArray(i.textEdits,Zo.is)&&(i.tooltip===void 0||O.string(i.tooltip)||Ac.is(i.tooltip))&&(i.paddingLeft===void 0||O.boolean(i.paddingLeft))&&(i.paddingRight===void 0||O.boolean(i.paddingRight))}t.is=r})(oD||(oD={}));var aD;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(aD||(aD={}));var cD;(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(cD||(cD={}));var lD;(function(t){function e(r){return{items:r}}t.create=e})(lD||(lD={}));var uD;(function(t){t.Invoked=0,t.Automatic=1})(uD||(uD={}));var dD;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(dD||(dD={}));var fD;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(fD||(fD={}));var pD;(function(t){function e(r){let n=r;return O.objectLiteral(n)&&Wy.is(n.uri)&&O.string(n.name)}t.is=e})(pD||(pD={}));var hD;(function(t){function e(s,o,a,c){return new iT(s,o,a,c)}t.create=e;function r(s){let o=s;return!!(O.defined(o)&&O.string(o.uri)&&(O.undefined(o.languageId)||O.string(o.languageId))&&O.uinteger(o.lineCount)&&O.func(o.getText)&&O.func(o.positionAt)&&O.func(o.offsetAt))}t.is=r;function n(s,o){let a=s.getText(),c=i(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=l)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=n;function i(s,o){if(s.length<=1)return s;let a=s.length/2|0,c=s.slice(0,a),l=s.slice(a);i(c,o),i(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?s[f++]=c[u++]:s[f++]=l[d++];for(;u<c.length;)s[f++]=c[u++];for(;d<l.length;)s[f++]=l[d++];return s}})(hD||(hD={}));var iT=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
240
+ `)],t};var dE=()=>{let t=new Y("model",z("STRING"));return t.description=["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.'],t.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],t};var Af=$(H());var fE=()=>{let t=new Y("name",z("STRING"),"optional",void 0,void 0,e=>[j(14,e.ast.firstToken,e.ast.lastToken,e.ast,{severity:Af.DiagnosticSeverity.Warning,tags:[Af.DiagnosticTag.Deprecated],templateStrings:[e.name]})]);return t.hideAutoComplete=!0,t};var pE=$(H());var hE=()=>{let t=new Y("interrupt-map",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=e.parent.root,o=xe(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",i.pathString]}));let c=i.getProperty("#interrupt-cells");if(!c)return n.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...i.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]})),n;let l=i.addressCells(r),u=$e(c,0,0,r),d={};if(u==null)return n;let f=0,p=[],g=0,h=0;for(;f<o.length;){if(p.push([...Array.from({length:l},(M,F)=>`${g}_ChildAddr${l>1?F:""}`),...Array.from({length:u},(M,F)=>`${g}_ChildIntrpt${u>1?F:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),f+l+u>=o.length){let M=f+l+u,F=o[o.length-1];n.push(j(20,F.firstToken,F.lastToken,F,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%M===0?M:(o.length-h)%M).join(" ")}`]}));break}let T=new Q(oe(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),S="";for(let M=f;M<l+u+f;M++){let F=o[M];S+=`${F instanceof Ee?F.evaluate(r).toString():F.toString()}:`}d[S]??=[],d[S].push(T),f+=l+u;let _=l+u+1;if(o.length<f+1){let M=o[o.length-1];n.push(j(20,M.firstToken,M.lastToken,M,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%_===0?_:(o.length-h)%_).join(" ")}`]}));break}let v=un(o[f],s);if(!v){let M=o[f];n.push(j(17,M.firstToken,M.lastToken,M));break}let R=v.addressCells(r),C=v.getProperty("#interrupt-cells");if(!C){let M=o[f];n.push(j(16,M.firstToken,M.lastToken,M,{linkedTo:[...v.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]}));break}f++;let B=$e(C,0,0,r);if(B==null)break;if(p.splice(-1,1,[...Array.from({length:l},(M,F)=>`${g}_ChildAddr${l>1?F:""}`),...Array.from({length:u},(M,F)=>`${g}_ChildIntrpt${u>1?F:""}`),`${g}_IntrptParent`,...Array.from({length:R},(M,F)=>`${g}_ParentAddr${R>1?F:""}`),...Array.from({length:B},(M,F)=>`${g}_ParentIntrpt${B>1?F:""}`)]),f+=R+B,o.length<f){let M=l+u+1+R+B,F=o[o.length-1];n.push(j(20,F.firstToken,F.lastToken,F,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%M===0?M:(o.length-h)%M).join(" ")}`]}));break}h=f,g++}if(p.push([...Array.from({length:l},(T,S)=>`${g}_ChildAddr${l>1?S:""}`),...Array.from({length:u},(T,S)=>`${g}_ChildIntrpt${u>1?S:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),t.signatureArgs=p.map(T=>T.map(S=>pE.ParameterInformation.create(S))),!e.ast.values)return[];for(let T=0;T<e.ast.values.values.length;T++){let S=e.ast.values.values.at(T);if(S&&(n.length||u==null||!(S.value instanceof jt)))return n}return Object.values(d).forEach(T=>{if(T.length>1){let S=T[T.length-1];n.push(j(30,S.firstToken,S.lastToken,S,{linkedTo:T.slice(0,-1)}))}}),n});return t.description=["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."],t};var mE;(function(t){function e(r){return typeof r=="string"}t.is=e})(mE||(mE={}));var Wy;(function(t){function e(r){return typeof r=="string"}t.is=e})(Wy||(Wy={}));var gE;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(gE||(gE={}));var If;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(If||(If={}));var Wr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=If.MAX_VALUE),i===Number.MAX_VALUE&&(i=If.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.line)&&I.uinteger(i.character)}t.is=r})(Wr||(Wr={}));var Dt;(function(t){function e(n,i,s,o){if(I.uinteger(n)&&I.uinteger(i)&&I.uinteger(s)&&I.uinteger(o))return{start:Wr.create(n,i),end:Wr.create(s,o)};if(Wr.is(n)&&Wr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${o}]`)}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Wr.is(i.start)&&Wr.is(i.end)}t.is=r})(Dt||(Dt={}));var Of;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(I.string(i.uri)||I.undefined(i.uri))}t.is=r})(Of||(Of={}));var yE;(function(t){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.targetRange)&&I.string(i.targetUri)&&Dt.is(i.targetSelectionRange)&&(Dt.is(i.originSelectionRange)||I.undefined(i.originSelectionRange))}t.is=r})(yE||(yE={}));var Gy;(function(t){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.numberRange(i.red,0,1)&&I.numberRange(i.green,0,1)&&I.numberRange(i.blue,0,1)&&I.numberRange(i.alpha,0,1)}t.is=r})(Gy||(Gy={}));var TE;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&Gy.is(i.color)}t.is=r})(TE||(TE={}));var vE;(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.undefined(i.textEdit)||Zo.is(i))&&(I.undefined(i.additionalTextEdits)||I.typedArray(i.additionalTextEdits,Zo.is))}t.is=r})(vE||(vE={}));var bE;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(bE||(bE={}));var _E;(function(t){function e(n,i,s,o,a,c){let l={startLine:n,endLine:i};return I.defined(s)&&(l.startCharacter=s),I.defined(o)&&(l.endCharacter=o),I.defined(a)&&(l.kind=a),I.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.startLine)&&I.uinteger(i.startLine)&&(I.undefined(i.startCharacter)||I.uinteger(i.startCharacter))&&(I.undefined(i.endCharacter)||I.uinteger(i.endCharacter))&&(I.undefined(i.kind)||I.string(i.kind))}t.is=r})(_E||(_E={}));var Ky;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Of.is(i.location)&&I.string(i.message)}t.is=r})(Ky||(Ky={}));var SE;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(SE||(SE={}));var NE;(function(t){t.Unnecessary=1,t.Deprecated=2})(NE||(NE={}));var kE;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&I.string(n.href)}t.is=e})(kE||(kE={}));var Mf;(function(t){function e(n,i,s,o,a,c){let l={range:n,message:i};return I.defined(s)&&(l.severity=s),I.defined(o)&&(l.code=o),I.defined(a)&&(l.source=a),I.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let s=n;return I.defined(s)&&Dt.is(s.range)&&I.string(s.message)&&(I.number(s.severity)||I.undefined(s.severity))&&(I.integer(s.code)||I.string(s.code)||I.undefined(s.code))&&(I.undefined(s.codeDescription)||I.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(I.string(s.source)||I.undefined(s.source))&&(I.undefined(s.relatedInformation)||I.typedArray(s.relatedInformation,Ky.is))}t.is=r})(Mf||(Mf={}));var Qo;(function(t){function e(n,i,...s){let o={title:n,command:i};return I.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.title)&&I.string(i.command)}t.is=r})(Qo||(Qo={}));var Zo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function r(s,o){return{range:{start:s,end:s},newText:o}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let o=s;return I.objectLiteral(o)&&I.string(o.newText)&&Dt.is(o.range)}t.is=i})(Zo||(Zo={}));var Yy;(function(t){function e(n,i,s){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(I.string(i.description)||i.description===void 0)}t.is=r})(Yy||(Yy={}));var ea;(function(t){function e(r){let n=r;return I.string(n)}t.is=e})(ea||(ea={}));var RE;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function r(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}t.del=n;function i(s){let o=s;return Zo.is(o)&&(Yy.is(o.annotationId)||ea.is(o.annotationId))}t.is=i})(RE||(RE={}));var Xy;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&tT.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Xy||(Xy={}));var Jy;(function(t){function e(n,i,s){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&I.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Jy||(Jy={}));var Qy;(function(t){function e(n,i,s,o){let a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&I.string(i.oldUri)&&I.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Qy||(Qy={}));var Zy;(function(t){function e(n,i,s){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&I.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||I.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||I.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ea.is(i.annotationId))}t.is=r})(Zy||(Zy={}));var eT;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>I.string(i.kind)?Jy.is(i)||Qy.is(i)||Zy.is(i):Xy.is(i)))}t.is=e})(eT||(eT={}));var PE;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)}t.is=r})(PE||(PE={}));var wE;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.integer(i.version)}t.is=r})(wE||(wE={}));var tT;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&(i.version===null||I.integer(i.version))}t.is=r})(tT||(tT={}));var EE;(function(t){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.string(i.languageId)&&I.integer(i.version)&&I.string(i.text)}t.is=r})(EE||(EE={}));var rs;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(rs||(rs={}));var Ac;(function(t){function e(r){let n=r;return I.objectLiteral(r)&&rs.is(n.kind)&&I.string(n.value)}t.is=e})(Ac||(Ac={}));var CE;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(CE||(CE={}));var DE;(function(t){t.PlainText=1,t.Snippet=2})(DE||(DE={}));var AE;(function(t){t.Deprecated=1})(AE||(AE={}));var IE;(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&I.string(i.newText)&&Dt.is(i.insert)&&Dt.is(i.replace)}t.is=r})(IE||(IE={}));var OE;(function(t){t.asIs=1,t.adjustIndentation=2})(OE||(OE={}));var ME;(function(t){function e(r){let n=r;return n&&(I.string(n.detail)||n.detail===void 0)&&(I.string(n.description)||n.description===void 0)}t.is=e})(ME||(ME={}));var xE;(function(t){function e(r){return{label:r}}t.create=e})(xE||(xE={}));var LE;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(LE||(LE={}));var xf;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return I.string(i)||I.objectLiteral(i)&&I.string(i.language)&&I.string(i.value)}t.is=r})(xf||(xf={}));var qE;(function(t){function e(r){let n=r;return!!n&&I.objectLiteral(n)&&(Ac.is(n.contents)||xf.is(n.contents)||I.typedArray(n.contents,xf.is))&&(r.range===void 0||Dt.is(r.range))}t.is=e})(qE||(qE={}));var Mr;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Mr||(Mr={}));var $E;(function(t){function e(r,n,...i){let s={label:r};return I.defined(n)&&(s.documentation=n),I.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})($E||($E={}));var BE;(function(t){t.Text=1,t.Read=2,t.Write=3})(BE||(BE={}));var FE;(function(t){function e(r,n){let i={range:r};return I.number(n)&&(i.kind=n),i}t.create=e})(FE||(FE={}));var jE;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(jE||(jE={}));var UE;(function(t){t.Deprecated=1})(UE||(UE={}));var HE;(function(t){function e(r,n,i,s,o){let a={name:r,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(HE||(HE={}));var VE;(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(VE||(VE={}));var zE;(function(t){function e(n,i,s,o,a,c){let l={name:n,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&I.string(i.name)&&I.number(i.kind)&&Dt.is(i.range)&&Dt.is(i.selectionRange)&&(i.detail===void 0||I.string(i.detail))&&(i.deprecated===void 0||I.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(zE||(zE={}));var WE;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(WE||(WE={}));var Lf;(function(t){t.Invoked=1,t.Automatic=2})(Lf||(Lf={}));var GE;(function(t){function e(n,i,s){let o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.typedArray(i.diagnostics,Mf.is)&&(i.only===void 0||I.typedArray(i.only,I.string))&&(i.triggerKind===void 0||i.triggerKind===Lf.Invoked||i.triggerKind===Lf.Automatic)}t.is=r})(GE||(GE={}));var KE;(function(t){function e(n,i,s){let o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Qo.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return i&&I.string(i.title)&&(i.diagnostics===void 0||I.typedArray(i.diagnostics,Mf.is))&&(i.kind===void 0||I.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Qo.is(i.command))&&(i.isPreferred===void 0||I.boolean(i.isPreferred))&&(i.edit===void 0||eT.is(i.edit))}t.is=r})(KE||(KE={}));var YE;(function(t){function e(n,i){let s={range:n};return I.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.command)||Qo.is(i.command))}t.is=r})(YE||(YE={}));var XE;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.uinteger(i.tabSize)&&I.boolean(i.insertSpaces)}t.is=r})(XE||(XE={}));var JE;(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.target)||I.string(i.target))}t.is=r})(JE||(JE={}));var QE;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(QE||(QE={}));var ZE;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(ZE||(ZE={}));var eC;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(eC||(eC={}));var tC;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(tC||(tC={}));var rC;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.string(i.text)}t.is=r})(rC||(rC={}));var nC;(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.boolean(i.caseSensitiveLookup)&&(I.string(i.variableName)||i.variableName===void 0)}t.is=r})(nC||(nC={}));var iC;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&(I.string(i.expression)||i.expression===void 0)}t.is=r})(iC||(iC={}));var sC;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(n.stoppedLocation)}t.is=r})(sC||(sC={}));var rT;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(rT||(rT={}));var nT;(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&(i.tooltip===void 0||I.string(i.tooltip)||Ac.is(i.tooltip))&&(i.location===void 0||Of.is(i.location))&&(i.command===void 0||Qo.is(i.command))}t.is=r})(nT||(nT={}));var oC;(function(t){function e(n,i,s){let o={position:n,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Wr.is(i.position)&&(I.string(i.label)||I.typedArray(i.label,nT.is))&&(i.kind===void 0||rT.is(i.kind))&&i.textEdits===void 0||I.typedArray(i.textEdits,Zo.is)&&(i.tooltip===void 0||I.string(i.tooltip)||Ac.is(i.tooltip))&&(i.paddingLeft===void 0||I.boolean(i.paddingLeft))&&(i.paddingRight===void 0||I.boolean(i.paddingRight))}t.is=r})(oC||(oC={}));var aC;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(aC||(aC={}));var cC;(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(cC||(cC={}));var lC;(function(t){function e(r){return{items:r}}t.create=e})(lC||(lC={}));var uC;(function(t){t.Invoked=0,t.Automatic=1})(uC||(uC={}));var dC;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(dC||(dC={}));var fC;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(fC||(fC={}));var pC;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&Wy.is(n.uri)&&I.string(n.name)}t.is=e})(pC||(pC={}));var hC;(function(t){function e(s,o,a,c){return new iT(s,o,a,c)}t.create=e;function r(s){let o=s;return!!(I.defined(o)&&I.string(o.uri)&&(I.undefined(o.languageId)||I.string(o.languageId))&&I.uinteger(o.lineCount)&&I.func(o.getText)&&I.func(o.positionAt)&&I.func(o.offsetAt))}t.is=r;function n(s,o){let a=s.getText(),c=i(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=l)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=n;function i(s,o){if(s.length<=1)return s;let a=s.length/2|0,c=s.slice(0,a),l=s.slice(a);i(c,o),i(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?s[f++]=c[u++]:s[f++]=l[d++];for(;u<c.length;)s[f++]=c[u++];for(;d<l.length;)s[f++]=l[d++];return s}})(hC||(hC={}));var iT=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
241
241
  `,s==="\r"&&i+1<r.length&&r.charAt(i+1)===`
242
- `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Wr.create(0,e);for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return Wr.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},O;(function(t){let e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,g,h){return e.call(p)==="[object Number]"&&g<=p&&p<=h}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)==="[object Function]"}t.func=u;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,g){return Array.isArray(p)&&p.every(g)}t.typedArray=f})(O||(O={}));var mD=()=>{let t=new K("interrupt-map-mask",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#interrupt-cells");if(!o)return n;let a=i.addressCells(r),c=$e(o,0,0,r);if(c==null)return n;let l=[...Array.from({length:a},(u,d)=>`AddressMask${a>1?d:""}`),...Array.from({length:c},(u,d)=>`InterruptMask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==a+c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var gD=$(H());var yD=()=>{let t=new K(/^(?!interrupt-|no-).*?-map$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=e.name.split("-map",1)[0],i=[],s=e.parent,o=e.parent.root,a=s.getProperty(`#${n}-cells`);if(!a)return i.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...s.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i;let c=$e(a,0,0,r);if(c==null)return i;let l=xe(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,p=[],g=0;for(;d<l.length;){if(p.push([...Array.from({length:c},(R,D)=>`${g}_Interrupt${c>1?D:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),d+c>=l.length){let R=d+c,D=l[l.length-1];i.push(j(20,D.firstToken,D.lastToken,D,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}let h=new Q(oe(l.at(d).firstToken,l.at(c+d-1)?.lastToken)),T="";for(let R=d;R<c+d;R++){let D=l[R];T+=`${D instanceof we?D.evaluate(r).toString():D.toString()}:`}if(u[T]??=[],u[T].push(h),d+=c,l.length<d+1){let R=c+1,D=l[l.length-1];i.push(j(20,D.firstToken,D.lastToken,D,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}let S=un(l[d],o);if(!S){let R=l[d];i.push(j(17,R.firstToken,R.lastToken,R));break}let _=S.getProperty(`#${n}-cells`);if(!_){let R=l[d];return i.push(j(16,R.firstToken,R.lastToken,R,{linkedTo:[...S.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i}d++;let v=$e(_,0,0,r);if(v==null)break;if(p.splice(-1,1,[...Array.from({length:c},(R,D)=>`${g}_ChildSpecifier${c>1?D:""}`),`${g}_SpecifierParent`,...Array.from({length:v},(R,D)=>`${g}_ParentSpecifier${v>1?D:""}`)]),d+=v,l.length<d){let R=c+1+v,D=l[l.length-1];i.push(j(20,D.firstToken,D.lastToken,D,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}f=d,g++}return p.push([...Array.from({length:c},(h,T)=>`${g}_Interrupt${c>1?T:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),t.signatureArgs=p.map(h=>h.map(T=>gD.ParameterInformation.create(T))),Object.values(u).forEach(h=>{if(h.length>1){let T=h[h.length-1];i.push(j(30,T.firstToken,T.lastToken,T,{linkedTo:h.slice(0,-1)}))}}),i});return t.description=["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."],t.list=!0,t};var TD=()=>{let t=new K(/^(?!interrupt-).*?-map-mask$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=$e(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var vD=()=>{let t=new K(/^(?!interrupt-).*?-map-pass-thru$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=$e(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var bD=()=>{let t=new K(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,z("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function lr(){let t=new Nt;return t.addProperty([KE(),dw(),uw(),lw(),Cf(),Df(),cw(),ow(),wf(),sw(),nw(),rw(),fw(),XE(),ew(),ZE(),tw(),JE(),QE(),hw(),mD(),yD(),TD(),vD(),bD()]),t}var _D=()=>{let t=new K("chassis-type",z("STRING"),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return t.description=["Specifies a string that identifies the form-factor of the system."],t};var SD=()=>{let t=new K("serial-number",z("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
243
- rialnumber.`],t};function ND(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(s=>s.name==="#size-cells");r.required=()=>"required";let n=t.properties.find(s=>s.name==="model");n.required=()=>"required";let i=t.properties.find(s=>s.name==="compatible");return i.required=()=>"required",t.addProperty([_D(),SD()]),t}var kD=$(H());function RD(){let t=new Nt((r,n)=>{let i=[];if(n.parent?.name!=="/"){let s=n.definitions[0];i.push(j(26,s.firstToken,s.lastToken,s,{linkedTo:n.definitions.slice(1),templateStrings:["Aliases node can only be added to a root node"]}))}return n.nodes.forEach(s=>{s.definitions.forEach(o=>{i.push(j(26,o.firstToken,o.lastToken,o,{templateStrings:["Aliases node can not have child nodes"],edit:kD.TextEdit.del(zr(o.firstToken.prevToken,o.lastToken,!1)),codeActionTitle:"Delete Node"}))})}),i});t.noMismatchPropertiesAllowed=!0;let e=new K(/^[-A-Za-z0-9]+$/,z(["STRING","U32"]),void 0,void 0,void 0,r=>{let n=[],i=r.ast.quickValues;if(i?.length===1&&typeof i[0]=="string"){let s=r.ast.values??r.ast;if(!i[0].startsWith("/"))return n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:[i[0],r.name]})),n;if(i[0].trim().endsWith("/"))return n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:["",i[0]]})),n;let o=r.parent.root,a=i[0].split("/").slice(1);for(;a[0];){let c=o,l=a.splice(0,1)[0],[u,d]=l.split("@"),f=d?.split(",").map(p=>Number.parseInt(p,16));if(o=u?c.getNode(u,f,!1):void 0,!o){n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:[u,c.fullName]}));break}}}return n});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function PD(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(r=>r.name==="reg");return e.required=()=>"required",t}var ED=(t,e,r)=>{let n=t?.(e,r)??[],i=e.parent.root.getProperty(e.name),s=i?$e(i,0,0,r):void 0,o=e.parent.getProperty(e.name);return(o?$e(o,0,0,r):void 0)!==s&&n.push(j(28,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...i?.ast?[i.ast]:[]],templateStrings:[`${e.name} value in this node must match value of root node`]})),n};function wD(){let t=new Nt;t.noMismatchPropertiesAllowed=!0;let e=Cf(),r=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>ED(r,o,a),e.required=()=>"required";let n=Df(),i=n?.additionalTypeCheck;n.additionalTypeCheck=(o,a)=>ED(i,o,a),n.required=()=>"required";let s=wf();return s.required=()=>"required",s.type=z("EMPTY"),s.additionalTypeCheck=void 0,t.addProperty([e,n,s]),t}function DD(){let t=lr();t.additionalValidations=(i,s)=>{let o=[];if(s.parent?.name!=="/"){let a=s.definitions[0];o.push(j(26,a.firstToken,a.lastToken,a,{linkedTo:s.definitions.slice(1),templateStrings:["Chosen node can only be added to a root node"]}))}return o};let e=new K("bootargs",z("STRING"));e.description=[`A string that specifies the boot arguments for
242
+ `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Wr.create(0,e);for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return Wr.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},I;(function(t){let e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,g,h){return e.call(p)==="[object Number]"&&g<=p&&p<=h}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)==="[object Function]"}t.func=u;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,g){return Array.isArray(p)&&p.every(g)}t.typedArray=f})(I||(I={}));var mC=()=>{let t=new Y("interrupt-map-mask",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#interrupt-cells");if(!o)return n;let a=i.addressCells(r),c=$e(o,0,0,r);if(c==null)return n;let l=[...Array.from({length:a},(u,d)=>`AddressMask${a>1?d:""}`),...Array.from({length:c},(u,d)=>`InterruptMask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==a+c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var gC=$(H());var yC=()=>{let t=new Y(/^(?!interrupt-|no-).*?-map$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=e.name.split("-map",1)[0],i=[],s=e.parent,o=e.parent.root,a=s.getProperty(`#${n}-cells`);if(!a)return i.push(j(16,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...s.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i;let c=$e(a,0,0,r);if(c==null)return i;let l=xe(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,p=[],g=0;for(;d<l.length;){if(p.push([...Array.from({length:c},(R,C)=>`${g}_Interrupt${c>1?C:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),d+c>=l.length){let R=d+c,C=l[l.length-1];i.push(j(20,C.firstToken,C.lastToken,C,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}let h=new Q(oe(l.at(d).firstToken,l.at(c+d-1)?.lastToken)),T="";for(let R=d;R<c+d;R++){let C=l[R];T+=`${C instanceof Ee?C.evaluate(r).toString():C.toString()}:`}if(u[T]??=[],u[T].push(h),d+=c,l.length<d+1){let R=c+1,C=l[l.length-1];i.push(j(20,C.firstToken,C.lastToken,C,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}let S=un(l[d],o);if(!S){let R=l[d];i.push(j(17,R.firstToken,R.lastToken,R));break}let _=S.getProperty(`#${n}-cells`);if(!_){let R=l[d];return i.push(j(16,R.firstToken,R.lastToken,R,{linkedTo:[...S.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i}d++;let v=$e(_,0,0,r);if(v==null)break;if(p.splice(-1,1,[...Array.from({length:c},(R,C)=>`${g}_ChildSpecifier${c>1?C:""}`),`${g}_SpecifierParent`,...Array.from({length:v},(R,C)=>`${g}_ParentSpecifier${v>1?C:""}`)]),d+=v,l.length<d){let R=c+1+v,C=l[l.length-1];i.push(j(20,C.firstToken,C.lastToken,C,{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%R===0?R:(l.length-f)%R).join(" ")}`]}));break}f=d,g++}return p.push([...Array.from({length:c},(h,T)=>`${g}_Interrupt${c>1?T:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),t.signatureArgs=p.map(h=>h.map(T=>gC.ParameterInformation.create(T))),Object.values(u).forEach(h=>{if(h.length>1){let T=h[h.length-1];i.push(j(30,T.firstToken,T.lastToken,T,{linkedTo:h.slice(0,-1)}))}}),i});return t.description=["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."],t.list=!0,t};var TC=()=>{let t=new Y(/^(?!interrupt-).*?-map-mask$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=$e(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var vC=()=>{let t=new Y(/^(?!interrupt-).*?-map-pass-thru$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=xe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=$e(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Mr.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(j(19,u.firstToken,u.lastToken,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.description=["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."],t};var bC=()=>{let t=new Y(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,z("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function lr(){let t=new Nt;return t.addProperty([Yw(),dE(),uE(),lE(),Df(),Cf(),cE(),oE(),Ef(),sE(),nE(),rE(),fE(),Xw(),eE(),Zw(),tE(),Jw(),Qw(),hE(),mC(),yC(),TC(),vC(),bC()]),t}var _C=()=>{let t=new Y("chassis-type",z("STRING"),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return t.description=["Specifies a string that identifies the form-factor of the system."],t};var SC=()=>{let t=new Y("serial-number",z("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
243
+ rialnumber.`],t};function NC(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(s=>s.name==="#size-cells");r.required=()=>"required";let n=t.properties.find(s=>s.name==="model");n.required=()=>"required";let i=t.properties.find(s=>s.name==="compatible");return i.required=()=>"required",t.addProperty([_C(),SC()]),t}var kC=$(H());function RC(){let t=new Nt((r,n)=>{let i=[];if(n.parent?.name!=="/"){let s=n.definitions[0];i.push(j(26,s.firstToken,s.lastToken,s,{linkedTo:n.definitions.slice(1),templateStrings:["Aliases node can only be added to a root node"]}))}return n.nodes.forEach(s=>{s.definitions.forEach(o=>{i.push(j(26,o.firstToken,o.lastToken,o,{templateStrings:["Aliases node can not have child nodes"],edit:kC.TextEdit.del(zr(o.firstToken.prevToken,o.lastToken,!1)),codeActionTitle:"Delete Node"}))})}),i});t.noMismatchPropertiesAllowed=!0;let e=new Y(/^[-A-Za-z0-9]+$/,z(["STRING","U32"]),void 0,void 0,void 0,r=>{let n=[],i=r.ast.quickValues;if(i?.length===1&&typeof i[0]=="string"){let s=r.ast.values??r.ast;if(!i[0].startsWith("/"))return n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:[i[0],r.name]})),n;if(i[0].trim().endsWith("/"))return n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:["",i[0]]})),n;let o=r.parent.root,a=i[0].split("/").slice(1);for(;a[0];){let c=o,l=a.splice(0,1)[0],[u,d]=l.split("@"),f=d?.split(",").map(p=>Number.parseInt(p,16));if(o=u?c.getNode(u,f,!1):void 0,!o){n.push(j(23,s.firstToken,s.lastToken,s,{templateStrings:[u,c.fullName]}));break}}}return n});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function PC(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(r=>r.name==="reg");return e.required=()=>"required",t}var wC=(t,e,r)=>{let n=t?.(e,r)??[],i=e.parent.root.getProperty(e.name),s=i?$e(i,0,0,r):void 0,o=e.parent.getProperty(e.name);return(o?$e(o,0,0,r):void 0)!==s&&n.push(j(28,e.ast.firstToken,e.ast.lastToken,e.ast,{linkedTo:[...i?.ast?[i.ast]:[]],templateStrings:[`${e.name} value in this node must match value of root node`]})),n};function EC(){let t=new Nt;t.noMismatchPropertiesAllowed=!0;let e=Df(),r=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>wC(r,o,a),e.required=()=>"required";let n=Cf(),i=n?.additionalTypeCheck;n.additionalTypeCheck=(o,a)=>wC(i,o,a),n.required=()=>"required";let s=Ef();return s.required=()=>"required",s.type=z("EMPTY"),s.additionalTypeCheck=void 0,t.addProperty([e,n,s]),t}function CC(){let t=lr();t.additionalValidations=(i,s)=>{let o=[];if(s.parent?.name!=="/"){let a=s.definitions[0];o.push(j(26,a.firstToken,a.lastToken,a,{linkedTo:s.definitions.slice(1),templateStrings:["Chosen node can only be added to a root node"]}))}return o};let e=new Y("bootargs",z("STRING"));e.description=[`A string that specifies the boot arguments for
244
244
  theclientprogram. Thevaluecouldpotentially
245
245
  be a null string if no boot arguments are re-
246
- quired.`];let r=new K("stdout-path ",z("STRING"));r.description=[`A string that specifies the full path to the node
246
+ quired.`];let r=new Y("stdout-path ",z("STRING"));r.description=[`A string that specifies the full path to the node
247
247
  representingthedevicetobeusedforbootcon-
248
248
  soleoutput. Ifthecharacter\u201C:\u201Dispresentinthe
249
249
  valueit terminates thepath. Thevalue maybe
250
250
  an alias. If the stdin-path property is not spec-
251
251
  ified, stdout-path should be assumed to define
252
- theinput device.`];let n=new K("stdin-path ",z("STRING"));return n.description=[`A string that specifies the boot arguments for
252
+ theinput device.`];let n=new Y("stdin-path ",z("STRING"));return n.description=[`A string that specifies the boot arguments for
253
253
  theclientprogram. Thevaluecouldpotentially
254
254
  be a null string if no boot arguments are re-
255
- quired.`],t.addProperty([e,r,n]),t}function CD(){let t=lr();t.additionalValidations=(i,s)=>{if(s.parent?.name!=="/"){let o=s.definitions[0];return[j(26,o.firstToken,o.lastToken,o,{linkedTo:s.definitions.slice(1),templateStrings:["Cpus node can only be added to a root node"]})]}return[]};let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(i=>i.name==="#size-cells");r.required=()=>"required";let n=r?.additionalTypeCheck;return r.additionalTypeCheck=(i,s)=>{let o=n?.(i,s)??[],a=i.parent.getProperty(i.name);return(a?$e(a,0,0,s):void 0)!==0&&o.push(j(28,i.ast.firstToken,i.ast.lastToken,i.ast,{templateStrings:[`${i.name} value in cpus node must be '0'`]})),o},t}function AD(){let t=lr();t.additionalValidations=(n,i)=>{if(i.parent?.name!=="cpus"){let s=i.definitions[0];return[j(26,s.firstToken,s.lastToken,s,{linkedTo:i.definitions.slice(1),templateStrings:["`cpu` node can only be a child of `cpus` node"]})]}return[]};let e=t.properties.find(n=>n.name==="device_type");e.required=()=>"required";let r=t.properties.find(n=>n.name==="reg");return r.required=()=>"required",r.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
255
+ quired.`],t.addProperty([e,r,n]),t}function DC(){let t=lr();t.additionalValidations=(i,s)=>{if(s.parent?.name!=="/"){let o=s.definitions[0];return[j(26,o.firstToken,o.lastToken,o,{linkedTo:s.definitions.slice(1),templateStrings:["Cpus node can only be added to a root node"]})]}return[]};let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(i=>i.name==="#size-cells");r.required=()=>"required";let n=r?.additionalTypeCheck;return r.additionalTypeCheck=(i,s)=>{let o=n?.(i,s)??[],a=i.parent.getProperty(i.name);return(a?$e(a,0,0,s):void 0)!==0&&o.push(j(28,i.ast.firstToken,i.ast.lastToken,i.ast,{templateStrings:[`${i.name} value in cpus node must be '0'`]})),o},t}function AC(){let t=lr();t.additionalValidations=(n,i)=>{if(i.parent?.name!=="cpus"){let s=i.definitions[0];return[j(26,s.firstToken,s.lastToken,s,{linkedTo:i.definitions.slice(1),templateStrings:["`cpu` node can only be a child of `cpus` node"]})]}return[]};let e=t.properties.find(n=>n.name==="device_type");e.required=()=>"required";let r=t.properties.find(n=>n.name==="reg");return r.required=()=>"required",r.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
256
256
  CP U/threads represented by the CPU node.
257
257
  If a CPU supports more than one thread (i.e. multiple streams of execution) the reg property is an array with 1 element per thread.
258
258
  The #address-cells on the /cpus node specifies how many cells each element of the array takes. Software can determine the number of threads by dividing the size of reg by the parent node's #address-cells.
259
259
  If a CPU/thread can be the target of an external interrupt the reg property value must be a unique CPU/thread id that is addressable by the interrupt controller.
260
260
  If a CPU/thread cannot be the target of an external interrupt, then reg must be unique and out of bounds of the range addressed by the interrupt controller
261
261
  If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
262
- If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],t}var OD=()=>{let t=new K("alignment",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=xe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Mr.create(a)),i?.length!==s){let a=e.ast.values??e.ast;n.push(j(19,a.firstToken,a.lastToken,a,{templateStrings:[e.name,`<${Array.from({length:e.parent.sizeCells(r)},()=>"size")}>`]}))}return n});return t.description=["Address boundary for alignment of allocation."],t};var ID=()=>{let t=new K("alloc-ranges",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=e.parent.addressCells(r),s=e.parent.sizeCells(r),o=[...Array.from({length:i},(c,l)=>`address${i>1?l:""}`),...Array.from({length:s},(c,l)=>`size${s>1?l:""}`)];t.signatureArgs=o.map(c=>Mr.create(c)),t.signatureArgsCyclic=!0;let a=xe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let c=a.at(a.length-a.length%(s+i))??e.ast;return n.push(j(19,c.firstToken,c.lastToken,c,{templateStrings:[e.name,`<${[...Array.from({length:i},()=>"address"),...Array.from({length:s},()=>"size")].join(" ")}>`]})),n}return n});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var MD=()=>{let t=new K("no-map",z("EMPTY"),"optional");return t.description=[`Indicates the operating system must not create a virtual mapping of the region as part of its standard mapping of system memory, nor permit speculative access to it under
263
- any circumstances other than under the control of the device driver using the region.`],t};var xD=()=>{let t=new K("reusable",z("EMPTY"),"optional");return t.description=["The operating system can use the memory in this region with the limitation that the device driver(s) owning the region need to be able to reclaim it back. Typically that means that the operating system can use that region to store volatile or cached data that can be otherwise regenerated or migrated elsewhere."],t};var LD=()=>{let t=new K("size",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=xe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Mr.create(a)),i?.length!==e.parent.sizeCells(r)){let a=e.ast.values??e.ast;n.push(j(19,a.firstToken,a.lastToken,a,{templateStrings:[e.name,`<${Array.from({length:s},()=>"size")}>`]}))}return n});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function qD(){let t=lr(),e=t.properties.find(r=>r.name==="reg");return e.required=()=>"optional",t.addProperty([LD(),OD(),ID(),MD(),xD()]),t}function ns(t){switch(t?.name){case"/":return ND();case"aliases":return RD();case"memory":return PD();case"reserved-memory":return wD();case"chosen":return DD();case"cpus":return CD();case"cpu":return AD()}return t?.parent?.name==="reserved-memory"?qD():lr()}var X=class t{constructor(e,r,n,i=null){this.bindingLoader=e;this.name=r;this.address=n;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this.interrupControlerMapping=[];this.spesifierNexusMapping=[];this.missingBinding=[];i?.addNode(this)}static toJson(e){let r={};return e.properties.forEach(n=>r[n.name]=n.ast.values?.toJson()??!0),e.nodes.forEach(n=>r[n.fullName]=t.toJson(n)),r}get disabled(){return this.getProperty("status")?.ast.quickValues?.at(0)==="disabled"}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=this.bindingLoader?.getNodeTypes(this).type??[ns(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(r=>r===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(r=>r===e)?this:[...this._nodes,...this._deletedNodes.map(r=>r.node)].map(r=>r.getReferenceBy(e)).find(r=>r)}get nodeNameOrLabelRef(){return zo([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,r){let n=[...this.definitions,...this.referencedBy].find(i=>on(i,e,r));if(n){let i=this.deletes.map(c=>({item:this,ast:Qn(c,e,r),beforeAst:gc(c,e,r),afterAst:mc(c,e,r)})).find(c=>on(c.ast,e,r));if(i)return i;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=>on(c.ast,e,r)||c.ast.lastToken.value!==";"&&hE(c.ast,e,r));if(s)return s.item.getDeepestAstNode(e,r);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,r)).find(c=>c);if(o)return o;let a=Qn(n,e,r);return{item:this,ast:a,beforeAst:gc(a,e,r),afterAst:mc(a,e,r)}}}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)]}getOverlappingNodeAddressesIssues(e){return this._nodes.filter(r=>!r.disabled).flatMap(r=>{let n=r.regArray(e),i=this._nodes.filter(s=>s!==r&&!s.disabled);return n?.flatMap(s=>{let o=i.flatMap(a=>a.regArray(e)?.filter(c=>sn(c.startAddress,s.endAddress)<0&&sn(s.startAddress,c.endAddress)<0).flatMap(c=>({reg:c,node:a}))).filter(a=>!!a);return o.length?Lt(10,s.rangeTokens.start,s.rangeTokens.end,r.definitions[0],{severity:dn.DiagnosticSeverity.Information,linkedTo:o.map(a=>({range:zr(a.reg.rangeTokens.start,a.reg.rangeTokens.end),uri:a.reg.rangeTokens.start.uri})),templateStrings:[r.fullName,`0x${s.startAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`,`0x${s.endAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`],linkedToTemplateStrings:o.map(a=>[a.node.fullName,`0x${a.reg.startAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`,`0x${a.reg.endAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`])}):[]})??[]})}getIssues(e){let r=[...this.properties.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.getIssues(e)),...this._deletedNodes.flatMap(n=>n.node.getIssues(e)),...this.deletedPropertiesIssues,...this.deletedNodesIssues,...this.missingBinding,...this.getOverlappingNodeAddressesIssues(e)];if(this.name==="/"&&this.definitions.length&&!this._nodes.some(n=>n.name==="cpus")){let n=this.definitions[this.definitions.length-1],i=n.name??n;r.push(Lt(9,i.firstToken,i.lastToken,i,{severity:dn.DiagnosticSeverity.Error,linkedTo:this.definitions.slice(0,-1),templateStrings:["/","cpus"]}))}return r}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[Lt(6,e.property.ast.firstToken,e.property.ast.lastToken,e.property.ast,{severity:dn.DiagnosticSeverity.Hint,tags:[dn.DiagnosticTag.Deprecated],linkedTo:[e.by],templateStrings:[e.property.name]}),...e.property.allReplaced.map(r=>Lt(6,r.ast.firstToken,r.ast.lastToken,r.ast,{severity:dn.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[dn.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(r=>r instanceof He),...e.node.referencedBy].flatMap(r=>{let n;return r instanceof He?n=r.name.toString():r.reference instanceof ie?n=r.reference.label.value:n=r.reference.path.pathParts.at(-1).name,Lt(7,r.firstToken,r.lastToken,r,{severity:dn.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[dn.DiagnosticTag.Deprecated],templateStrings:[n]})})])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}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,r){return this._nodes.some(n=>n.name===e&&(n.address===r||n.address?.every((i,s)=>r?.at(s)===i)))}hasProperty(e){return this._properties.some(r=>r.name===e)}getProperty(e){return this._properties.find(r=>r.name===e)}deleteNode(e,r,n){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===n||n?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:r}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}#e;get phandle(){if(this.#e!==void 0)return this.#e;let e=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(e instanceof jt){let r=e.values[0].value;if(r instanceof cr)return this.#e=r.value,this.#e}}getAllPhandle(e){return e===this.phandle?[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]:this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){return this.phandle===e?this:this._nodes.find(r=>!!r.getPhandle(e))}getNode(e,r,n=!0){let i=n||!!r||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===r||o.address?.every((a,c)=>r?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,r){let n=this._properties.findIndex(i=>i.name===e);n!==-1&&(this._deletedProperties.push({property:this._properties[n],by:r}),this._properties.splice(n,1))}addNode(e){this._nodes.push(e)}addProperty(e){let r=this._properties.findIndex(n=>n.name===e.name);if(r===-1)this._properties.push(e);else{let n=this._properties.splice(r,1)[0];this._properties.push(e),e.replaces=n,n.replacedBy=e}if(e.name==="compatible")if(this.bindingLoader){let n=this.bindingLoader.getNodeTypes(this);this._nodeTypes=n.type,this.missingBinding.push(...n.issues)}else this._nodeTypes=[ns(this)]}getChild(e,r=!0){if(e.length===1&&e[0]==="/"&&this.name==="/")return this;let n=[...e];n.splice(0,1);let i=n[0].split("@"),s=i[0],o=i[1]!==void 0?i[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(s,o,r);return n.length===1||!a?a:a.getChild(n)}getChildFromScope(e,r){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let n=[...e];return n.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!r(s.by)).map(s=>s.node)].find(s=>s.fullName===n[0])?.getChildFromScope(n,r)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#t;regArray(e){if(this.#t!==void 0)return this.#t;let r=this.getProperty("reg");if(!r){this.#t=null;return}let n=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=xe(r.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:n}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(f=>f instanceof we))continue;let l=a.map(f=>f.evaluate(e)),u=c.map(f=>f.evaluate(e)),d=a.at(0)?.firstToken;!d||![...l,...u].every(f=>typeof f=="number")||s.push({startAddress:l,endAddress:Ji(l,u),size:u,rangeTokens:oe(d,c.at(-1)?.lastToken??a.at(-1)?.lastToken)})}return this.#t=s,this.#t}#n;rangeMap(e){if(this.#n!==void 0)return this.#n;let r=this.getProperty("ranges");if(!r){this.#n=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=xe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof we))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:oe(g,u.at(-1).lastToken)})}return this.#n=o,this.#n}#r;dmaRangeMap(e){if(this.#r!==void 0)return this.#r;let r=this.getProperty("dma-ranges");if(!r){this.#r=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=xe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof we))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:oe(g,u.at(-1).lastToken)})}return this.#r=o,this.#r}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#o;addressCells(e){if(this.#o!==void 0)return this.#o;let r=this?.getProperty("#address-cells");return this.#o=r?$e(r,0,0,e)??2:2,this.#o}#f;sizeCells(e){if(this.#f!==void 0)return this.#f;let r=this.getProperty("#size-cells");return this.#f=r?$e(r,0,0,e)??1:1,this.#f}#a;mappedReg(e){if(this.#a!==void 0)return this.#a;let r=this.parent?.rangeMap(e),n=this.regArray(e);return this.#a=n?.flatMap(i=>{let s=i.startAddress,o=i.size,a=Ji(s,o),c={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regRangeTokens:{start:i.rangeTokens.start,end:i.rangeTokens.end},missingMapping:!1};if(!r)return[c];let l=TE(r,s);return l.length?l.map(u=>(c.mappedAst={range:u.range,uri:u.uri},c.startAddress=u.start,c.endAddress=Ji(u.start,o),c.inMappingRange=sn(c.endAddress,u.end)<=0,c.mappingEnd=u.end,{...c,mappedAst:{range:u.range,uri:u.uri},startAddress:u.start,endAddress:Ji(u.start,o),inMappingRange:sn(c.endAddress,u.end)<=0,mappingEnd:u.end})):(c.missingMapping=!0,[c])}).sort((i,s)=>sn(i.endAddress,s.endAddress))??[],this.#a}get interruptsParent(){if(this.getProperty("interrupts-extended"))return null;let e=this.bindingLoader?.type==="Zephyr",r=this.getProperty("interrupt-parent"),n=r?un(r?.ast.values?.values.at(0),this.root):e?void 0:this.parent;return!e||r?{interruptParent:r,parentInterruptNode:n??null}:n?{interruptParent:r,parentInterruptNode:n??null}:this.parent?this.parent.interruptsParent:{parentInterruptNode:this}}getNexusMapEntryMatch(e,r,n,i=[]){let s=new Q(oe(n[0].firstToken,n.at(-1).lastToken)),o=this.getNexusMap(e,r);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...n.map((l,u)=>{let d=l instanceof we?l.evaluate(r):l;return(typeof d=="number"?d&(o.mapMask.at(u+i.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof we?u.evaluate(r):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,r){let n=this.getProperty(`${e}-map`),i=xe(n?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=$e(o,0,0,r);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(r));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let p=un(i[l],s);if(!p)break;let g=p.getProperty(`#${e}-cells`);if(!g)return;l++;let h=$e(g,0,0,r);if(h==null||(e==="interrupt"&&(h+=p.addressCells(r)),l+=h,i.length<l))break;let T=i.slice(l-h,l);c.push({mappingValues:f,node:p,parentValues:T})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,p)=>(u?$e(u,0,p,r):void 0)??4294967295),map:c}}uniqueLabels(){return Array.from(new Set(this.labels.map(e=>e.toString())))}toTooltipString(e){return`${this.uniqueLabels().join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
262
+ If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],t}var IC=()=>{let t=new Y("alignment",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=xe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Mr.create(a)),i?.length!==s){let a=e.ast.values??e.ast;n.push(j(19,a.firstToken,a.lastToken,a,{templateStrings:[e.name,`<${Array.from({length:e.parent.sizeCells(r)},()=>"size")}>`]}))}return n});return t.description=["Address boundary for alignment of allocation."],t};var OC=()=>{let t=new Y("alloc-ranges",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=e.parent.addressCells(r),s=e.parent.sizeCells(r),o=[...Array.from({length:i},(c,l)=>`address${i>1?l:""}`),...Array.from({length:s},(c,l)=>`size${s>1?l:""}`)];t.signatureArgs=o.map(c=>Mr.create(c)),t.signatureArgsCyclic=!0;let a=xe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let c=a.at(a.length-a.length%(s+i))??e.ast;return n.push(j(19,c.firstToken,c.lastToken,c,{templateStrings:[e.name,`<${[...Array.from({length:i},()=>"address"),...Array.from({length:s},()=>"size")].join(" ")}>`]})),n}return n});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var MC=()=>{let t=new Y("no-map",z("EMPTY"),"optional");return t.description=[`Indicates the operating system must not create a virtual mapping of the region as part of its standard mapping of system memory, nor permit speculative access to it under
263
+ any circumstances other than under the control of the device driver using the region.`],t};var xC=()=>{let t=new Y("reusable",z("EMPTY"),"optional");return t.description=["The operating system can use the memory in this region with the limitation that the device driver(s) owning the region need to be able to reclaim it back. Typically that means that the operating system can use that region to store volatile or cached data that can be otherwise regenerated or migrated elsewhere."],t};var LC=()=>{let t=new Y("size",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=xe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Mr.create(a)),i?.length!==e.parent.sizeCells(r)){let a=e.ast.values??e.ast;n.push(j(19,a.firstToken,a.lastToken,a,{templateStrings:[e.name,`<${Array.from({length:s},()=>"size")}>`]}))}return n});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function qC(){let t=lr(),e=t.properties.find(r=>r.name==="reg");return e.required=()=>"optional",t.addProperty([LC(),IC(),OC(),MC(),xC()]),t}function ns(t){switch(t?.name){case"/":return NC();case"aliases":return RC();case"memory":return PC();case"reserved-memory":return EC();case"chosen":return CC();case"cpus":return DC();case"cpu":return AC()}return t?.parent?.name==="reserved-memory"?qC():lr()}var X=class t{constructor(e,r,n,i=null){this.bindingLoader=e;this.name=r;this.address=n;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this.interrupControlerMapping=[];this.spesifierNexusMapping=[];this.missingBinding=[];i?.addNode(this)}static toJson(e){let r={};return e.properties.forEach(n=>r[n.name]=n.ast.values?.toJson()??!0),e.nodes.forEach(n=>r[n.fullName]=t.toJson(n)),r}get disabled(){return this.getProperty("status")?.ast.quickValues?.at(0)==="disabled"}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=this.bindingLoader?.getNodeTypes(this).type??[ns(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(r=>r===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(r=>r===e)?this:[...this._nodes,...this._deletedNodes.map(r=>r.node)].map(r=>r.getReferenceBy(e)).find(r=>r)}get nodeNameOrLabelRef(){return zo([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,r){let n=[...this.definitions,...this.referencedBy].find(i=>on(i,e,r));if(n){let i=this.deletes.map(c=>({item:this,ast:Qn(c,e,r),beforeAst:gc(c,e,r),afterAst:mc(c,e,r)})).find(c=>on(c.ast,e,r));if(i)return i;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=>on(c.ast,e,r)||c.ast.lastToken.value!==";"&&hw(c.ast,e,r));if(s)return s.item.getDeepestAstNode(e,r);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,r)).find(c=>c);if(o)return o;let a=Qn(n,e,r);return{item:this,ast:a,beforeAst:gc(a,e,r),afterAst:mc(a,e,r)}}}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)]}getOverlappingNodeAddressesIssues(e){return this._nodes.filter(r=>!r.disabled).flatMap(r=>{let n=r.regArray(e),i=this._nodes.filter(s=>s!==r&&!s.disabled);return n?.flatMap(s=>{let o=i.flatMap(a=>a.regArray(e)?.filter(c=>sn(c.startAddress,s.endAddress)<0&&sn(s.startAddress,c.endAddress)<0).flatMap(c=>({reg:c,node:a}))).filter(a=>!!a);return o.length?Lt(10,s.rangeTokens.start,s.rangeTokens.end,r.definitions[0],{severity:dn.DiagnosticSeverity.Information,linkedTo:o.map(a=>({range:zr(a.reg.rangeTokens.start,a.reg.rangeTokens.end),uri:a.reg.rangeTokens.start.uri})),templateStrings:[r.fullName,`0x${s.startAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`,`0x${s.endAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`],linkedToTemplateStrings:o.map(a=>[a.node.fullName,`0x${a.reg.startAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`,`0x${a.reg.endAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`])}):[]})??[]})}getIssues(e){let r=[...this.properties.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.getIssues(e)),...this._deletedNodes.flatMap(n=>n.node.getIssues(e)),...this.deletedPropertiesIssues,...this.deletedNodesIssues,...this.missingBinding,...this.getOverlappingNodeAddressesIssues(e)];if(this.name==="/"&&this.definitions.length&&!this._nodes.some(n=>n.name==="cpus")){let n=this.definitions[this.definitions.length-1],i=n.name??n;r.push(Lt(9,i.firstToken,i.lastToken,i,{severity:dn.DiagnosticSeverity.Error,linkedTo:this.definitions.slice(0,-1),templateStrings:["/","cpus"]}))}return r}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[Lt(6,e.property.ast.firstToken,e.property.ast.lastToken,e.property.ast,{severity:dn.DiagnosticSeverity.Hint,tags:[dn.DiagnosticTag.Deprecated],linkedTo:[e.by],templateStrings:[e.property.name]}),...e.property.allReplaced.map(r=>Lt(6,r.ast.firstToken,r.ast.lastToken,r.ast,{severity:dn.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[dn.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(r=>r instanceof He),...e.node.referencedBy].flatMap(r=>{let n;return r instanceof He?n=r.name.toString():r.reference instanceof ie?n=r.reference.label.value:n=r.reference.path.pathParts.at(-1).name,Lt(7,r.firstToken,r.lastToken,r,{severity:dn.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[dn.DiagnosticTag.Deprecated],templateStrings:[n]})})])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}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,r){return this._nodes.some(n=>n.name===e&&(n.address===r||n.address?.every((i,s)=>r?.at(s)===i)))}hasProperty(e){return this._properties.some(r=>r.name===e)}getProperty(e){return this._properties.find(r=>r.name===e)}deleteNode(e,r,n){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===n||n?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:r}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}#e;get phandle(){if(this.#e!==void 0)return this.#e;let e=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(e instanceof jt){let r=e.values.at(0)?.value;if(r instanceof cr)return this.#e=r.value,this.#e}}getAllPhandle(e){return e===this.phandle?[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]:this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){if(this.phandle===e)return this;for(let r of this._nodes){let n=r.getPhandle(e);if(n)return n}}getNode(e,r,n=!0){let i=n||!!r||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===r||o.address?.every((a,c)=>r?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,r){let n=this._properties.findIndex(i=>i.name===e);n!==-1&&(this._deletedProperties.push({property:this._properties[n],by:r}),this._properties.splice(n,1))}addNode(e){this._nodes.push(e)}addProperty(e){let r=this._properties.findIndex(n=>n.name===e.name);if(r===-1)this._properties.push(e);else{let n=this._properties.splice(r,1)[0];this._properties.push(e),e.replaces=n,n.replacedBy=e}if(e.name==="compatible")if(this.bindingLoader){let n=this.bindingLoader.getNodeTypes(this);this._nodeTypes=n.type,this.missingBinding.push(...n.issues)}else this._nodeTypes=[ns(this)]}getChild(e,r=!0){if(e.length===1&&e[0]==="/"&&this.name==="/")return this;let n=[...e];n.splice(0,1);let i=n[0].split("@"),s=i[0],o=i[1]!==void 0?i[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(s,o,r);return n.length===1||!a?a:a.getChild(n)}getChildFromScope(e,r){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let n=[...e];return n.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!r(s.by)).map(s=>s.node)].find(s=>s.fullName===n[0])?.getChildFromScope(n,r)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#t;regArray(e){if(this.#t!==void 0)return this.#t;let r=this.getProperty("reg");if(!r){this.#t=null;return}let n=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=xe(r.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:n}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(f=>f instanceof Ee))continue;let l=a.map(f=>f.evaluate(e)),u=c.map(f=>f.evaluate(e)),d=a.at(0)?.firstToken;!d||![...l,...u].every(f=>typeof f=="number")||s.push({startAddress:l,endAddress:Ji(l,u),size:u,rangeTokens:oe(d,c.at(-1)?.lastToken??a.at(-1)?.lastToken)})}return this.#t=s,this.#t}#n;rangeMap(e){if(this.#n!==void 0)return this.#n;let r=this.getProperty("ranges");if(!r){this.#n=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=xe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof Ee))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:oe(g,u.at(-1).lastToken)})}return this.#n=o,this.#n}#r;dmaRangeMap(e){if(this.#r!==void 0)return this.#r;let r=this.getProperty("dma-ranges");if(!r){this.#r=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=xe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof Ee))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:oe(g,u.at(-1).lastToken)})}return this.#r=o,this.#r}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#o;addressCells(e){if(this.#o!==void 0)return this.#o;let r=this?.getProperty("#address-cells");return this.#o=r?$e(r,0,0,e)??2:2,this.#o}#f;sizeCells(e){if(this.#f!==void 0)return this.#f;let r=this.getProperty("#size-cells");return this.#f=r?$e(r,0,0,e)??1:1,this.#f}#a;mappedReg(e){if(this.#a!==void 0)return this.#a;let r=this.parent?.rangeMap(e),n=this.regArray(e);return this.#a=n?.flatMap(i=>{let s=i.startAddress,o=i.size,a=Ji(s,o),c={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regRangeTokens:{start:i.rangeTokens.start,end:i.rangeTokens.end},missingMapping:!1};if(!r)return[c];let l=Tw(r,s);return l.length?l.map(u=>(c.mappedAst={range:u.range,uri:u.uri},c.startAddress=u.start,c.endAddress=Ji(u.start,o),c.inMappingRange=sn(c.endAddress,u.end)<=0,c.mappingEnd=u.end,{...c,mappedAst:{range:u.range,uri:u.uri},startAddress:u.start,endAddress:Ji(u.start,o),inMappingRange:sn(c.endAddress,u.end)<=0,mappingEnd:u.end})):(c.missingMapping=!0,[c])}).sort((i,s)=>sn(i.endAddress,s.endAddress))??[],this.#a}get interruptsParent(){if(this.getProperty("interrupts-extended"))return null;let e=this.bindingLoader?.type==="Zephyr",r=this.getProperty("interrupt-parent"),n=r?un(r?.ast.values?.values.at(0),this.root):e?void 0:this.parent;return!e||r?{interruptParent:r,parentInterruptNode:n??null}:n?{interruptParent:r,parentInterruptNode:n??null}:this.parent?this.parent.interruptsParent:{parentInterruptNode:this}}getNexusMapEntryMatch(e,r,n,i=[]){let s=new Q(oe(n[0].firstToken,n.at(-1).lastToken)),o=this.getNexusMap(e,r);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...n.map((l,u)=>{let d=l instanceof Ee?l.evaluate(r):l;return(typeof d=="number"?d&(o.mapMask.at(u+i.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof Ee?u.evaluate(r):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,r){let n=this.getProperty(`${e}-map`),i=xe(n?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=$e(o,0,0,r);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(r));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let p=un(i[l],s);if(!p)break;let g=p.getProperty(`#${e}-cells`);if(!g)return;l++;let h=$e(g,0,0,r);if(h==null||(e==="interrupt"&&(h+=p.addressCells(r)),l+=h,i.length<l))break;let T=i.slice(l-h,l);c.push({mappingValues:f,node:p,parentValues:T})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,p)=>(u?$e(u,0,p,r):void 0)??4294967295),map:c}}uniqueLabels(){return Array.from(new Set(this.labels.map(e=>e.toString())))}toTooltipString(e){return`${this.uniqueLabels().join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
264
264
  `:""}${this.properties.map(r=>r.toPrettyString(e)).join(`
265
265
  `)}${this.nodes.length?`
266
266
  ${this.nodes.map(r=>`${r.fullName}{ /* ... */ };`).join(`
@@ -273,29 +273,29 @@ ${" ".repeat(n)}${this.nodes.map(o=>`${o.fullName}{ ... };`).join(`
273
273
  ${" ".repeat(n)}`)}`:""}
274
274
  ${" ".repeat(n-1)}}; */`:`${i?`/* /omit-if-no-ref/ */
275
275
  ${" ".repeat(n-1)}`:""}${this.uniqueLabels().join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
276
- ${" ".repeat(n)}`:""}${this.properties.map(o=>`${o.toPrettyString(e)} /* ${r?`./${(0,$D.relative)(r,o.ast.uri)}`:o.ast.uri} */`).join(`
276
+ ${" ".repeat(n)}`:""}${this.properties.map(o=>`${o.toPrettyString(e)} /* ${r?`./${(0,$C.relative)(r,o.ast.uri)}`:o.ast.uri} */`).join(`
277
277
  ${" ".repeat(n)}`)}${this.nodes.length?`
278
278
  ${" ".repeat(n)}${this.nodes.map(o=>o.toFullString(e,r,n+1)).join(`
279
279
  ${" ".repeat(n)}`)}`:""}
280
280
  ${" ".repeat(n-1)}};`}serialize(e){let r=this.mappedReg(e),n=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof Nt?{...this.nodeType,extends:Array.from(this.nodeType?.extends??[]),properties:i.properties.map(s=>({name:typeof s.name=="string"?s.name:s.name.toString(),nameIsRegex:typeof s.name!="string",allowedValues:s.allowedValues,type:s.type,description:s.description?.join(`
281
281
  `),required:s.required(this)==="required"}))}:void 0,issues:n.flatMap(s=>s.serializeIssues),path:this.pathString,disabled:this.disabled,name:this.fullName,labels:this.labels.map(s=>s.label.value),nodes:n.map(s=>s.serialize(e)),properties:this.properties.map(s=>({...s.ast.serialize(e),nexusMapEnty:s.nexusMapsTo.map(o=>({mappingValuesAst:o.mappingValuesAst.map(a=>a.serialize(e)),specifierSpace:o.specifierSpace,target:o.target.pathString,mapItem:o.mapItem?{parentValues:o.mapItem?.parentValues.map(a=>a.serialize(e)),target:o.mapItem.node.pathString,mappingValues:o.mapItem.mappingValues.map(a=>a.serialize(e))}:void 0}))})),childNodes:this.nodes.map(s=>s.serialize(e)),reg:r?.map(s=>({mappedStartAddress:s?.startAddress,mappedEndAddress:s?.endAddress,startAddress:s?.startAddressRaw,endAddress:s?.endAddressRaw,size:s?.size,inMappingRange:s?.inMappingRange})),interruptControllerMappings:this.interrupControlerMapping.map(s=>({cells:s.expressions.map(o=>o.serialize(e)),path:s.node.pathString,property:s.property.ast.serialize(e)})),specifierNexusMappings:this.spesifierNexusMapping.map(s=>({cells:s.expressions.map(o=>o.serialize(e)),path:s.node.pathString,property:s.property.ast.serialize(e)}))}}};var ta=$(H());var Xe=class{constructor(e,r){this.ast=e;this.parent=r;this.nexusMapsTo=[]}getDeepestAstNode(e,r){let n=Qn(this.ast,e,r);return this.ast.assignOperatorToken&&My(this.ast.assignOperatorToken,e,r)?{item:this,ast:n,beforeAst:gc(this.ast,e,r),afterAst:mc(this.ast,e,r)}:{item:this,ast:n}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof Qi)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(r=>r===e)?this:null}))}getArgumentIndex(e){if(!e)return;let r=this.ast.getFlatAstValues()?.findIndex(n=>n===e||n?.isAncestorOf(e));return r===-1?void 0:r}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[Lt(0,this.replaces.ast.firstToken,this.replaces.ast.lastToken,this.replaces.ast,{severity:ta.DiagnosticSeverity.Hint,linkedTo:[this.ast],tags:[ta.DiagnosticTag.Unnecessary],templateStrings:[this.name]})]:[]]}onHover(){if(this.nexusMapsTo.length)return{kind:ta.MarkupKind.Markdown,value:["### Nexus mappings",...this.nexusMapsTo.filter(e=>!!e.mapItem).flatMap(e=>["```",`${this.name} = <... ${e.mappingValuesAst.map(r=>r.toString()).join(" ")} ...> maps to <... ${e.mapItem.mappingValues.map(r=>r.toString()).join(" ")} ...>;`,"```",`[Mapping (${e.mappingValuesAst.map(r=>r.toString()).join(" ")})](${`${e.mapItem.mappingValues[0].uri}#L${e.mapItem.mappingValues[0].firstToken.pos.line+1}`})`])].join(`
282
- `)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var ti=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new X(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let r=this.fileTopMostAstCache.get(e);if(r)return r;let n=[...this.context.parser.cPreprocessorParser.allAstItems,...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.overlayParsers.flatMap(i=>[...i.cPreprocessorParser.allAstItems,...i.unhandledStatements.children]),...this.context.parser.unhandledStatements.children].flatMap(i=>i.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,n),n}getDeepestAstNode(e,r){let i=this.fileTopMostAsts(e).find(s=>on(s,e,r)||mE(Or().requestTokens(e,!1),s,r));if(i instanceof Wt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,r);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Qn(i,e,r)}}else if(i instanceof St&&i.path){let s=this.rootNode.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i instanceof He&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:Qn(i,e,r)}}static getNodeFromPath(e,r,n=!0){if(e.length===0)return r;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=r.getNode(s,a,n);return l?t.getNodeFromPath(c,l,n):void 0}resolvePath(e,r){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(r??=this.rootNode.allDescendantsLabels,r.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof lt)?.lastLinkedTo?.path)}get issues(){return this.issuesCache??=[...this.labelIssues(),...this.rootNode.getIssues(this.context.macros)],this.issuesCache}labelIssues(){let e=[],r=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{r.has(n.label.label.value)?r.get(n.label.label.value)?.push(n):r.set(n.label.label.value,[n])}),Array.from(r).forEach(n=>{let i=n[1];if(i.length>1){let s=i.find(a=>a.owner instanceof X);if(!i.every(a=>a&&a.owner===s?.owner)||!s){let a=i[0].label;e.push(Lt(4,a.firstToken,a.lastToken,a,{linkedTo:i.slice(1).map(c=>c.label),templateStrings:[i.at(0).label.label.value]}))}}}),e}get typesIssues(){let e=r=>[...r.nodeType?.getIssue(this,r)??[],...r.nodes.flatMap(n=>e(n))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return gE([...e.definitions,...e.referencedBy],this.context)}};var qf=class t{constructor(e,r,n){this.settings=e;this.formattingOptions=r;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let i={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,BD.basename)(e.dtsFile),lockRenameEdits:[],showFormattingErrorAsDiagnostics:e.showFormattingErrorAsDiagnostics??!0};this.overlays=i.overlays,this.overlays.filter(Oc.existsSync),this.parser=new zs(i.dtsFile,i.includePaths),this.ctxNames_.add(i.ctxName),this.id=Ni(i),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new zs(s,i.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,r=i=>({file:i,includes:(e.get(i)??[]).map(s=>r(s.resolvedPath??s.path))});return(await this.getRuntime()).includes.forEach(i=>{let s=e.get(i.uri);s||(s=[],e.set(i.uri,s)),s.push({path:i.path.path,resolvedPath:i.resolvedPath})}),{mainDtsPath:r(this.parser.uri),overlays:this.overlays.map(r)}}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.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(r=>le(r,e))}getUriParser(e){let r=this.overlayParsers.find(n=>n.getFiles().some(i=>le(i,e)));return r??=this.parser.getFiles().some(n=>le(n,e))?this.parser:void 0,r}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,r){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>le(s.ast.uri,e)&&(!r||on(s.ast,e,r))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof ne&&l.compatible===o.value.value);return c?{range:fe(o.value),target:he(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>le(s.uri,e)&&(!r||on(s,e,r))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:fe(s.path),target:he(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let r=s=>[...s.properties,...s.nodes.flatMap(r)],n=r(e.rootNode),i=e.rootNode.allDescendantsLabels;n.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof ie){let a=e.resolvePath([`&${o.label?.value}`],i);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(Lt(3,o.firstToken,o.lastToken,o,{templateStrings:[o.value]}))}else o instanceof On&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,r){let n=r,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=s===0&&a.name==="/"?r:n?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(Lt(8,a.firstToken,a.lastToken,a,{templateStrings:[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]}))),c?.linkedNodeNamePaths.push(a),n=c}else break}}async reevaluate(e){let r=this.getUriParser(e);return r?(this.sortKeys=new WeakMap,await r.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let r=new ti(this);this._issues=[],this.parser.rootDocument.resetIssues(),this.processRoot(this.parser.rootDocument,r);for(let n=0;n<this.overlayParsers.length;n++)this.overlayParsers[n].rootDocument.resetIssues(),this.processRoot(this.overlayParsers[n].rootDocument,r);return r.includes=this.parser.includes,r.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof ln),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,i)=>this.sortKeys.set(n,i)),this.linkPropertiesLabelsAndNodePaths(r),this.reportNodeNameAndPropertyClashes(r),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),r}reportNodeNameAndPropertyClashes(e){let r=n=>{n.properties.forEach(i=>{n.nodes.filter(o=>o.address===void 0&&o.name===i.ast.propertyName?.name&&o.definitions.at(-1)?.name).forEach(o=>{let a=o.definitions[o.definitions.length-1].name;this._issues.push(Lt(2,a.firstToken,a.lastToken,a,{linkedTo:[i.ast,...i.allReplaced.map(c=>c.ast)]}))})}),n.nodes.forEach(r)};r(e.rootNode)}processRoot(e,r){for(let n=0;n<e.children.length;n++){let i=e.children[n];this.processChild(i,r.rootNode,r)}}processChild(e,r,n){e instanceof lt?this.processDtcBaseNode(e,r,n):e instanceof Ke?this.processDtcProperty(e,r,n):e instanceof Ar?this.processDeleteNode(e,r,n):e instanceof ht&&this.processDeleteProperty(e,r,n)}checkNodeUniqueNames(e,r){let n=(o,a)=>o.filter(c=>c.name===a.name&&(c.address===a.fullAddress&&c.address===void 0||sn(c.address??[],a.fullAddress??[])===0)).map(c=>c.issueAst),i=r.nodes.map(o=>({name:o.name,address:o.address,issueAst:o.definitions[0].name??o.definitions[0]})),s=[];e.children.forEach(o=>{if(o instanceof He&&o.name){let a=n(s.map(c=>({name:c.name,address:c.fullAddress,issueAst:c})),o.name);a.length&&this._issues.push(Lt(2,o.name.firstToken,o.name.lastToken,o.name,{linkedTo:a})),s.push(o.name)}else if(o instanceof Ar&&o.nodeNameOrRef instanceof Me){let a=o.nodeNameOrRef;n(i,a)&&(s=s.filter(c=>n(s.map(l=>({name:l.name,address:l.fullAddress,issueAst:l})),c).length))}})}getCompileCommands(){if(!(!this.settings.compileCommands||!(0,Oc.existsSync)(this.settings.compileCommands)))return JSON.parse((0,Oc.readFileSync)(this.settings.compileCommands).toString())}processDtcBaseNode(e,r,n){e instanceof St?this.processDtcRootNode(e,n):e instanceof He?this.processDtcChildNode(e,r,n):e instanceof Wt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,r){r.roots.push(e),r.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,r.rootNode),e.children.forEach(n=>this.processChild(n,r.rootNode,r))}processDtcChildNode(e,r,n){if(e.name?.name){let i=e.path?n.resolvePath(e.path):void 0,o=(i?n.rootNode.getChild(i):void 0)??new X(this.bindingLoader,e.name.name,e.name.fullAddress,r);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),r=o,this.checkNodeUniqueNames(e,o)}e.children.forEach(i=>this.processChild(i,r,n))}processDtcRefNodeLabelRef(e,r,n){let i,s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=n.rootNode.getChild(s),r.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(r),i?.referencedBy.push(e),e.labels.forEach(o=>{n.labelsUsedCache.set(o.label.value,s)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):(this._issues.push(Lt(3,r.firstToken,r.lastToken,r,{templateStrings:[r.label?.value??""]})),n.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,r,n){let i;r.path&&this.linkNodePath(r.path,n.rootNode);let o=r.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=n.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{n.labelsUsedCache.set(a.label.value,o)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):n.unlinkedRefNodes.push(e),i}processDtcRefNode(e,r){let n;e.reference?e.reference instanceof ie?n=this.processDtcRefNodeLabelRef(e,e.reference,r):n=this.processDtcRefNodeNodePathRef(e,e.reference,r):r.unlinkedRefNodes.push(e),e.children.forEach(i=>this.processChild(i,n??new X(this.bindingLoader,""),r))}processDtcProperty(e,r,n){e.propertyName?.name&&r.addProperty(new Xe(e,r)),e.children.forEach(i=>this.processChild(i,r,n))}processDeleteNode(e,r,n){if(e.nodeNameOrRef instanceof Me&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!r.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(Lt(5,e.nodeNameOrRef.firstToken,e.nodeNameOrRef.lastToken,e.nodeNameOrRef));else{r.deletes.push(e);let i=r.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,r.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{n.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof ie&&e.nodeNameOrRef.value){let i=n.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=n.rootNode.getChild(i),r.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(Lt(3,e.nodeNameOrRef.firstToken,e.nodeNameOrRef.lastToken,e.nodeNameOrRef,{templateStrings:[e.nodeNameOrRef.value]})))}else if(e.nodeNameOrRef instanceof it&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=n.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let c=0;c<s.length&&s[c];c++){let l=s[c];if(l){let u=i?.getNode(l.name,l.fullAddress,!1);l.linksTo=u,u?.linkedNodeNamePaths.push(l),i=u}}let o=e.nodeNameOrRef.path.pathParts.find(c=>c&&!c.linksTo),a=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;a||(n.unlinkedDeletes.push(e),o&&this._issues.push(Lt(8,o.firstToken,o.lastToken,o,{templateStrings:[o.toString(),`${e.nodeNameOrRef.path.pathParts.filter(c=>c?.linksTo).map(c=>c?.toString()).join("/")}`]}))),r.deletes.push(e),a?.labels.forEach(c=>{n.labelsUsedCache.delete(c.label.value)}),a?.parent?.deleteNode(a.name,e,a.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,r,n))}processDeleteProperty(e,r,n){e.propertyName?.name&&!r.hasProperty(e.propertyName.name)?this._issues.push(Lt(1,e.propertyName.firstToken,e.propertyName.lastToken,e.propertyName)):e.propertyName?.name&&(r.deletes.push(e),r.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,r,n))}static#e(e,r,n){let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}async getSyntaxIssues(e=new Map,r){return(await this.getAllParsers()).forEach(n=>{r?n.issues.filter(i=>r(i.raw)).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)):n.issues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e))}),e}async getDiagnostics(){let e=new Map;try{return await this.getSyntaxIssues(e),(await this.getContextIssues()??[]).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),(await this.getRuntime())?.typesIssues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
283
- ${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros,this.settings.cwd)}`}async serialize(){return await this.stable,await this.getDiagnostics(),(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var FD=require("fs"),ra=require("path"),At=$(H());function NU(t){if(!t||!(t.ast instanceof Wo))return[];let e=n=>n.flatMap(i=>{try{return(0,FD.readdirSync)(i,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,ra.join)((0,ra.relative)(i,s.parentPath),s.name)}`,kind:At.CompletionItemKind.File}))}catch{return[]}});if(t.ast.relative)return e([(0,ra.dirname)(t.ast.uri)]);let r=t.runtime.context.settings.includePaths??[];return e(r)}var $f=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>$f(r.node,e)),...t.nodes.flatMap(r=>$f(r,e))],sT=(t,e)=>[...t.labels,...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>sT(r.node,e)),...t.nodes.flatMap(r=>sT(r,e))];function kU(t,e){if(!t||!(t.item instanceof Xe)||!(t.ast instanceof ie))return[];let r=i=>sT(i,e),n=new Map;return r(t.runtime.rootNode).forEach(i=>n.set(i.label.value,i)),Array.from(n).map(([,i])=>({label:`${i.label.value}`,kind:At.CompletionItemKind.Method,documentation:i.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function RU(t,e){if(!t||t.item!==null||!(t.ast instanceof ie)||!(t.ast.parentNode instanceof Wt))return[];let r=n=>$f(n,e).filter(i=>e(i));return[...Array.from(new Set(r(t.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:n,insertText:t.ast.lastToken.nextToken?.value==="{"?n:`${n} {
282
+ `)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var ti=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new X(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let r=this.fileTopMostAstCache.get(e);if(r)return r;let n=[...this.context.parser.cPreprocessorParser.allAstItems,...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.overlayParsers.flatMap(i=>[...i.cPreprocessorParser.allAstItems,...i.unhandledStatements.children]),...this.context.parser.unhandledStatements.children].flatMap(i=>i.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,n),n}getDeepestAstNode(e,r){let i=this.fileTopMostAsts(e).find(s=>on(s,e,r)||mw(Ir().requestTokens(e,!1),s,r));if(i instanceof Wt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,r);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Qn(i,e,r)}}else if(i instanceof St&&i.path){let s=this.rootNode.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i instanceof He&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:Qn(i,e,r)}}static getNodeFromPath(e,r,n=!0){if(e.length===0)return r;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=r.getNode(s,a,n);return l?t.getNodeFromPath(c,l,n):void 0}resolvePath(e,r){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(r??=this.rootNode.allDescendantsLabels,r.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof lt)?.lastLinkedTo?.path)}get issues(){return this.issuesCache??=[...this.labelIssues(),...this.rootNode.getIssues(this.context.macros)],this.issuesCache}labelIssues(){let e=[],r=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{r.has(n.label.label.value)?r.get(n.label.label.value)?.push(n):r.set(n.label.label.value,[n])}),Array.from(r).forEach(n=>{let i=n[1];if(i.length>1){let s=i.find(a=>a.owner instanceof X);if(!i.every(a=>a&&a.owner===s?.owner)||!s){let a=i[0].label;e.push(Lt(4,a.firstToken,a.lastToken,a,{linkedTo:i.slice(1).map(c=>c.label),templateStrings:[i.at(0).label.label.value]}))}}}),e}get typesIssues(){let e=r=>[...r.nodeType?.getIssue(this,r)??[],...r.nodes.flatMap(n=>e(n))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return gw([...e.definitions,...e.referencedBy],this.context)}};var qf=class t{constructor(e,r,n){this.settings=e;this.formattingOptions=r;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let i={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,BC.basename)(e.dtsFile),lockRenameEdits:[],showFormattingErrorAsDiagnostics:e.showFormattingErrorAsDiagnostics??!0};this.overlays=i.overlays,this.overlays.filter(Ic.existsSync),this.parser=new zs(i.dtsFile,i.includePaths),this.ctxNames_.add(i.ctxName),this.id=Ni(i),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new zs(s,i.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,r=i=>({file:i,includes:(e.get(i)??[]).map(s=>r(s.resolvedPath??s.path))});return(await this.getRuntime()).includes.forEach(i=>{let s=e.get(i.uri);s||(s=[],e.set(i.uri,s)),s.push({path:i.path.path,resolvedPath:i.resolvedPath})}),{mainDtsPath:r(this.parser.uri),overlays:this.overlays.map(r)}}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.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(r=>le(r,e))}getUriParser(e){let r=this.overlayParsers.find(n=>n.getFiles().some(i=>le(i,e)));return r??=this.parser.getFiles().some(n=>le(n,e))?this.parser:void 0,r}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,r){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>le(s.ast.uri,e)&&(!r||on(s.ast,e,r))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof ne&&l.compatible===o.value.value);return c?{range:fe(o.value),target:he(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>le(s.uri,e)&&(!r||on(s,e,r))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:fe(s.path),target:he(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let r=s=>[...s.properties,...s.nodes.flatMap(r)],n=r(e.rootNode),i=e.rootNode.allDescendantsLabels;n.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof ie){let a=e.resolvePath([`&${o.label?.value}`],i);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(Lt(3,o.firstToken,o.lastToken,o,{templateStrings:[o.value]}))}else o instanceof In&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,r){let n=r,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=s===0&&a.name==="/"?r:n?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(Lt(8,a.firstToken,a.lastToken,a,{templateStrings:[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]}))),c?.linkedNodeNamePaths.push(a),n=c}else break}}async reevaluate(e){let r=this.getUriParser(e);return r?(this.sortKeys=new WeakMap,await r.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let r=new ti(this);this._issues=[],this.parser.rootDocument.resetIssues(),this.processRoot(this.parser.rootDocument,r);for(let n=0;n<this.overlayParsers.length;n++)this.overlayParsers[n].rootDocument.resetIssues(),this.processRoot(this.overlayParsers[n].rootDocument,r);return r.includes=this.parser.includes,r.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof ln),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,i)=>this.sortKeys.set(n,i)),this.linkPropertiesLabelsAndNodePaths(r),this.reportNodeNameAndPropertyClashes(r),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),r}reportNodeNameAndPropertyClashes(e){let r=n=>{n.properties.forEach(i=>{n.nodes.filter(o=>o.address===void 0&&o.name===i.ast.propertyName?.name&&o.definitions.at(-1)?.name).forEach(o=>{let a=o.definitions[o.definitions.length-1].name;this._issues.push(Lt(2,a.firstToken,a.lastToken,a,{linkedTo:[i.ast,...i.allReplaced.map(c=>c.ast)]}))})}),n.nodes.forEach(r)};r(e.rootNode)}processRoot(e,r){for(let n=0;n<e.children.length;n++){let i=e.children[n];this.processChild(i,r.rootNode,r)}}processChild(e,r,n){e instanceof lt?this.processDtcBaseNode(e,r,n):e instanceof Ye?this.processDtcProperty(e,r,n):e instanceof Ar?this.processDeleteNode(e,r,n):e instanceof ht&&this.processDeleteProperty(e,r,n)}checkNodeUniqueNames(e,r){let n=(o,a)=>o.filter(c=>c.name===a.name&&(c.address===a.fullAddress&&c.address===void 0||sn(c.address??[],a.fullAddress??[])===0)).map(c=>c.issueAst),i=r.nodes.map(o=>({name:o.name,address:o.address,issueAst:o.definitions[0].name??o.definitions[0]})),s=[];e.children.forEach(o=>{if(o instanceof He&&o.name){let a=n(s.map(c=>({name:c.name,address:c.fullAddress,issueAst:c})),o.name);a.length&&this._issues.push(Lt(2,o.name.firstToken,o.name.lastToken,o.name,{linkedTo:a})),s.push(o.name)}else if(o instanceof Ar&&o.nodeNameOrRef instanceof Me){let a=o.nodeNameOrRef;n(i,a)&&(s=s.filter(c=>n(s.map(l=>({name:l.name,address:l.fullAddress,issueAst:l})),c).length))}})}getCompileCommands(){if(!(!this.settings.compileCommands||!(0,Ic.existsSync)(this.settings.compileCommands)))return JSON.parse((0,Ic.readFileSync)(this.settings.compileCommands).toString())}processDtcBaseNode(e,r,n){e instanceof St?this.processDtcRootNode(e,n):e instanceof He?this.processDtcChildNode(e,r,n):e instanceof Wt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,r){r.roots.push(e),r.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,r.rootNode),e.children.forEach(n=>this.processChild(n,r.rootNode,r))}processDtcChildNode(e,r,n){if(e.name?.name){let i=e.path?n.resolvePath(e.path):void 0,o=(i?n.rootNode.getChild(i):void 0)??new X(this.bindingLoader,e.name.name,e.name.fullAddress,r);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),r=o,this.checkNodeUniqueNames(e,o)}e.children.forEach(i=>this.processChild(i,r,n))}processDtcRefNodeLabelRef(e,r,n){let i,s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=n.rootNode.getChild(s),r.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(r),i?.referencedBy.push(e),e.labels.forEach(o=>{n.labelsUsedCache.set(o.label.value,s)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):(this._issues.push(Lt(3,r.firstToken,r.lastToken,r,{templateStrings:[r.label?.value??""]})),n.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,r,n){let i;r.path&&this.linkNodePath(r.path,n.rootNode);let o=r.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=n.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{n.labelsUsedCache.set(a.label.value,o)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):n.unlinkedRefNodes.push(e),i}processDtcRefNode(e,r){let n;e.reference?e.reference instanceof ie?n=this.processDtcRefNodeLabelRef(e,e.reference,r):n=this.processDtcRefNodeNodePathRef(e,e.reference,r):r.unlinkedRefNodes.push(e),e.children.forEach(i=>this.processChild(i,n??new X(this.bindingLoader,""),r))}processDtcProperty(e,r,n){e.propertyName?.name&&r.addProperty(new Xe(e,r)),e.children.forEach(i=>this.processChild(i,r,n))}processDeleteNode(e,r,n){if(e.nodeNameOrRef instanceof Me&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!r.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(Lt(5,e.nodeNameOrRef.firstToken,e.nodeNameOrRef.lastToken,e.nodeNameOrRef));else{r.deletes.push(e);let i=r.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,r.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{n.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof ie&&e.nodeNameOrRef.value){let i=n.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=n.rootNode.getChild(i),r.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(Lt(3,e.nodeNameOrRef.firstToken,e.nodeNameOrRef.lastToken,e.nodeNameOrRef,{templateStrings:[e.nodeNameOrRef.value]})))}else if(e.nodeNameOrRef instanceof it&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=n.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let c=0;c<s.length&&s[c];c++){let l=s[c];if(l){let u=i?.getNode(l.name,l.fullAddress,!1);l.linksTo=u,u?.linkedNodeNamePaths.push(l),i=u}}let o=e.nodeNameOrRef.path.pathParts.find(c=>c&&!c.linksTo),a=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;a||(n.unlinkedDeletes.push(e),o&&this._issues.push(Lt(8,o.firstToken,o.lastToken,o,{templateStrings:[o.toString(),`${e.nodeNameOrRef.path.pathParts.filter(c=>c?.linksTo).map(c=>c?.toString()).join("/")}`]}))),r.deletes.push(e),a?.labels.forEach(c=>{n.labelsUsedCache.delete(c.label.value)}),a?.parent?.deleteNode(a.name,e,a.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,r,n))}processDeleteProperty(e,r,n){e.propertyName?.name&&!r.hasProperty(e.propertyName.name)?this._issues.push(Lt(1,e.propertyName.firstToken,e.propertyName.lastToken,e.propertyName)):e.propertyName?.name&&(r.deletes.push(e),r.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,r,n))}static#e(e,r,n){let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}async getSyntaxIssues(e=new Map,r){return(await this.getAllParsers()).forEach(n=>{r?n.issues.filter(i=>r(i.raw)).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)):n.issues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e))}),e}async getDiagnostics(){let e=new Map;try{return await this.getSyntaxIssues(e),(await this.getContextIssues()??[]).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),(await this.getRuntime())?.typesIssues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
283
+ ${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros,this.settings.cwd)}`}async serialize(){return await this.stable,await this.getDiagnostics(),(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var FC=require("fs"),ra=require("path"),At=$(H());function NU(t){if(!t||!(t.ast instanceof Wo))return[];let e=n=>n.flatMap(i=>{try{return(0,FC.readdirSync)(i,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,ra.join)((0,ra.relative)(i,s.parentPath),s.name)}`,kind:At.CompletionItemKind.File}))}catch{return[]}});if(t.ast.relative)return e([(0,ra.dirname)(t.ast.uri)]);let r=t.runtime.context.settings.includePaths??[];return e(r)}var $f=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>$f(r.node,e)),...t.nodes.flatMap(r=>$f(r,e))],sT=(t,e)=>[...t.labels,...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>sT(r.node,e)),...t.nodes.flatMap(r=>sT(r,e))];function kU(t,e){if(!t||!(t.item instanceof Xe)||!(t.ast instanceof ie))return[];let r=i=>sT(i,e),n=new Map;return r(t.runtime.rootNode).forEach(i=>n.set(i.label.value,i)),Array.from(n).map(([,i])=>({label:`${i.label.value}`,kind:At.CompletionItemKind.Method,documentation:i.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function RU(t,e){if(!t||t.item!==null||!(t.ast instanceof ie)||!(t.ast.parentNode instanceof Wt))return[];let r=n=>$f(n,e).filter(i=>e(i));return[...Array.from(new Set(r(t.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:n,insertText:t.ast.lastToken.nextToken?.value==="{"?n:`${n} {
284
284
  $1
285
- };`,kind:At.CompletionItemKind.Value,insertTextFormat:At.InsertTextFormat.Snippet}))]}function PU(t,e){let r=s=>s?s.parentNode instanceof Wt||s.parentNode instanceof St||s.parentNode instanceof He?!1:r(s.parentNode):!0;if(!t||t.item!==null||!Ut(t.ast)||!r(t.ast))return[];let n=s=>$f(s,e).filter(o=>e(o));if(t.ast instanceof ut)return n(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[];let i=new Map;return n(t.runtime.rootNode).forEach(s=>i.set(s.label.value,s)),Array.from(i).map(([,s])=>({label:t.ast instanceof ie?`${s.label.value}`:`&${s.label.value}`,kind:At.CompletionItemKind.Variable,documentation:s.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function EU(t,e){if(!t||!(t.item instanceof X)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof Tr)||t.beforeAst?.parentNode instanceof ht))return[];let r=n=>[...n.nodes,...n.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>({node:i,astNodes:i.definitions.filter(s=>s instanceof He)})).filter(i=>i.astNodes.some(e));return t.ast instanceof Me||t.ast instanceof Ar||t.beforeAst?.parentNode instanceof Ar?r(t.item).map(n=>({label:`${n.astNodes.at(0)?.name?.toString()}`,kind:At.CompletionItemKind.Variable,documentation:n.node.toMarkupContent(t.runtime.context.macros)})):r(t.item).length?[{label:"/delete-node/",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[]}function wU(t,e){if(!t||!(t.item instanceof X)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof Tr)||t.beforeAst?.parentNode instanceof Ar))return[];let r=n=>[...n.properties,...n.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));if(t.ast instanceof et||t.ast instanceof ht||t.beforeAst?.parentNode instanceof ht){let n=new Map;return r(t.item).forEach(i=>n.set(i.name,i)),Array.from(n).map(([,i])=>({label:`${i.name}`,kind:At.CompletionItemKind.Variable,documentation:i.ast.toPrettyString(t.runtime.context.macros)}))}return r(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:At.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:At.InsertTextFormat.Snippet}]:[]}function DU(t,e){let r=t?.ast instanceof On?t.ast:t?.ast.parentNode;if(!t||!r||!(r instanceof On))return[];let n=r.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let i=n.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!Ut(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]]})().map(o=>({label:`/${[...i,o.fullName].join("/")}`,kind:At.CompletionItemKind.Variable,documentation:o.toMarkupContent(t.runtime.context.macros)}))}function CU(t){return!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken)||t.ast instanceof ne?[]:!Hs(t?.ast)&&!(t.ast instanceof Ke&&t.item.ast.values===null)&&!Hs(t.beforeAst)&&!Hs(t.afterAst)?[]:t.item.parent.nodeType instanceof Nt?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([,n])=>n.macro.identifier instanceof ei?{label:`${n.macro.identifier.toString()}`,insertText:`${n.macro.name}(${n.macro.identifier.params.map((i,s)=>i instanceof Dt?`$${s+1}`:"").join(", ")})`,kind:At.CompletionItemKind.Function,sortText:`~${n.macro.name}`,insertTextFormat:At.InsertTextFormat.Snippet}:{label:n.macro.identifier.name,kind:At.CompletionItemKind.Variable,sortText:`~${n.macro.name}`}):[]}async function jD(t,e){return _t(t,e,(r,n)=>[...wU(r,n),...EU(r,n),...PU(r,n),...DU(r,n),...RU(r,n),...kU(r,n),...NU(r),...CU(r)])}var Tp=$(H());var HD=require("child_process");var oT=t=>/[A-Za-z0-9_]/.test(t);function AU(t,e){let r=[];for(let n=0;n<e;n++){let i=t[n];i==="("?r.push(n):i===")"&&r.pop()}return r.length?r[r.length-1]:void 0}function UD(t,e){let r=1;for(let n=e+1;n<t.length;n++){let i=t[n];if(i==="(")r++;else if(i===")"&&(r--,r===0))return n}}function VD(t,e,r){let n=[],i=0,s=!1,o=!1,a=e;for(let f=e;f<r;f++){let p=t[f];if(p==="'"&&!o)s=!s;else if(p==='"'&&!s)o=!o;else if(!s&&!o){if(p==="(")i++;else if(p===")")i--;else if(p===","&&i===0){let g=a,h=f,T=g,S=h;for(;T<S&&/\s/.test(t[T]);)T++;for(;S>T&&/\s/.test(t[S-1]);)S--;n.push({start:g,end:h,text:t.slice(T,S)}),a=f+1}}}let c=a,l=r,u=c,d=l;for(;u<d&&/\s/.test(t[u]);)u++;for(;d>u&&/\s/.test(t[d-1]);)d--;return n.push({start:c,end:l,text:t.slice(u,d)}),n}function aT(t){let e=t.trim(),r=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(e);if(!r)return{macro:e};let n=r[1],i=r[2],s=VD(i,0,i.length),o={macro:n,args:[]};return o.args=s.map(a=>{let c=aT(a.text);return c.parent=o,c}),o}function Pi(t,e){let r=t.getText(),n=t.offsetAt(e),i=n,s=n;for(;i>0&&oT(r[i-1]);)i--;for(;s<r.length&&oT(r[s]);)s++;if(r[s]==="("){let T=UD(r,s);T!==void 0&&(s=T+1)}let o=r.slice(i,s),a=o.trim().length?aT(o):void 0,c=AU(r,n);if(c===void 0)return a;let l=UD(r,c);if(l===void 0||!(c<n&&n<=l))return a;let u=c,d=u;for(;d>0&&oT(r[d-1]);)d--;let f=r.slice(d,u);if(!f)return a;let p=VD(r,c+1,l),g={macro:f,args:[]};g.args=p.map(T=>{let S=aT(T.text);return S.parent=g,S});let h=-1;for(let T=0;T<p.length;T++){let S=p[T];if(n>=S.start&&n<=S.end){h=T;break}}if(h>=0){let T=g.args[h];return T.argIndexInParent=h,T}return g}function OU(t,e,r){let i=t.getText().split(/\r?\n/),s=new RegExp(`^\\s*#\\s*define\\s+(${e})\\b(\\s*\\([^)]*\\))?\\s*(.*)$`);for(let o=Math.min(r.line,i.length-1);o>=0;o--){let a=i[o],c=s.exec(a);if(c){let l=a.indexOf(c[0]),u=a.indexOf(c[3],l);return Wr.create(o,u>=0?u:a.length)}}}async function is(t,e,r,n){let i=zD(t,e,r);if(i)return i;let s=await MU(e,n,Re(t.uri));if(s)return[s,r]}function zD(t,e,r){if(e.startsWith("DT_"))return;let n=OU(t,e,r);if(!n)return;let i=Pi(t,n);if(i)return[i,n]}var IU=(t,e)=>new Promise(r=>{let n=(0,HD.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),i="";n.stdout.on("data",s=>{i+=s.toString()}),n.on("close",s=>{r(s?"":i)})});async function MU(t,e,r){let n=e.getCompileCommands()?.find(s=>le(s.file,r));if(!n)return;let i=`${n.command.replace(/-(o|c)\s+\S+/g,"")} -E -dM ${n.file}`;try{let[s,...o]=i.split(" "),a=await IU(s,o.filter(u=>!!u)),c=Kn.create(`macros://${n.file}`,"devicetree",0,a),l=zD(c,t,c.positionAt(a.length-1));if(l)return l[0]}catch(s){console.error(s)}}function ee(t){return t.toLowerCase().replace(/[@,-\.]/g,"_")}var Ic=$(H());async function WD({macro:t,context:e}){if(t.macro&&"DT_ALIAS".startsWith(t.macro))return[{label:"DT_ALIAS(...)",insertText:"DT_ALIAS($1)",kind:Ic.CompletionItemKind.Function,insertTextFormat:Ic.InsertTextFormat.Snippet}];if(t.parent?.macro!=="DT_ALIAS"||t.argIndexInParent!==0)return[];let r=await e.getRuntime();return r.rootNode.getNode("aliases")?.properties.map(n=>{let i=n.ast.getFlatAstValues()?.at(0),s;return i instanceof ie?s=i.linksTo:i instanceof On&&(s=i.pathParts.at(-1)?.linksTo),{label:ee(n.name),kind:Ic.CompletionItemKind.Property,documentation:s?.toMarkupContent(r.context.macros)}})??[]}var Mc=$(H());async function ur(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();return i?.length===0?!0:i?.map(s=>{if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo;if(s instanceof ie)return s.linksTo;if(s instanceof ne)return s.value;if(s instanceof we){let o=s.evaluate(r.macros);return typeof o=="number"?o:s.toString()}})}async function Bf({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?ur(o,s[1].macro,r):void 0}async function GD(t,e){let r=await Bf(t,e);if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof X)return n}async function YD(t,e,r,n){if(r=typeof r=="number"?r:De(r),typeof r!="number")return;let i=await ur(t,e,n);if(i===!0)return!0;if(!i)return;let s=i.at(r);if(s)return i.length===1&&i[0]instanceof X?i[0]:s}async function Ff({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_BY_IDX"||e.args?.length!==3))return YD(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro,r)}async function KD(t,e){let r=await Ff(t,e);if(typeof r!="boolean"&&r instanceof X)return r}async function xr(t,{document:e,context:r,macro:n,position:i},s){return t||(await s({document:e,macro:n,context:r,position:i})??n.macro)}async function jf(t,e,r,n){return xr(await ur(t,e,r.context),r,n)}async function na({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_OR"||e.args?.length!==3)return;let[s,o,a]=e.args,c=await i({document:t,macro:s,context:r,position:n});return await jf(c,o.macro,{macro:a,document:t,context:r,position:n},i)}async function XD(t,e){let r=await na(t,e);if(r instanceof X)return r;if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof X)return n}async function JD(t){let e=t?.nodeType?.onBus,r=t?.parent?.nodeType?.bus;return t&&r?.length&&r?.some(n=>n===e)?t.parent??void 0:void 0}async function Uf(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_BUS"||r?.length!==1)return;let n=await e({...t,macro:r[0]});return await JD(n)}async function Hf(t,e){let r=(await t.getRuntime()).rootNode.getChild(["/","chosen"]);if(!r)return;let s=r?.properties.find(o=>ee(o.name)===e)?.ast.getFlatAstValues()?.at(0);if(s instanceof ie)return s.linksTo;if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo}async function Vf(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_CHOSEN"||e?.length!==1))return await Hf(t.context,e[0].macro)}async function zf(t,e){let r=await e?.getRuntime();if(r){let n=ti.getNodeFromPath(["aliases"],r.rootNode,!0),i=n?.properties.find(o=>ee(o.name)===t);if(!i)return;let s=i.ast.getFlatAstValues();return s?.[0]instanceof ne?n=r.rootNode.getChild(s[0].value.split("/")):s?.[0]instanceof ie?n=s[0].linksTo:s?.[0]instanceof it&&(n=s[0].path?.pathParts.at(-1)?.linksTo),n}}async function Wf({macro:t,context:e}){if(!(t.macro!=="DT_ALIAS"||t.args?.length!==1))return zf(t.args[0].macro,e)}async function QD(t,e){return t?.nodes.find(r=>ee(r.name)===e)}async function Gf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD"||e.args?.length!==2)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return QD(s,e.args[1].macro)}var cT=(t,e)=>t.nodes.filter(r=>!r.disabled&&r.nodeType).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...cT(r,e)]:cT(r,e));async function ZD(t,e){let r=await e?.getRuntime();if(r)return cT(r.rootNode,t)}async function lT({macro:t,context:e}){if(!(t.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.args?.length!==1))return ZD(t.args[0].macro,e)}async function eC(t){return(await lT(t))?.at(0)}async function tC(t){return t?.parent?.parent??void 0}async function Yf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_GPARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return tC(s)}var uT=(t,e)=>t.nodes.filter(r=>r.nodeType).sort((r,n)=>r.disabled===n.disabled?0:r.disabled?1:-1).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...uT(r,e)]:uT(r,e));async function rC(t,e,r){let n=await r?.getRuntime();if(n)return uT(n.rootNode,e).at(t)}async function Kf({macro:t,context:e}){if(t.macro!=="DT_INST"||t.args?.length!==2)return;let r=De(t.args[0].macro);if(typeof r=="number")return rC(r,t.args[1].macro,e)}async function nC(t,e){let r=await e?.getRuntime(),n=r?.resolvePath([`&${t.trim()}`]);if(r&&n)return ti.getNodeFromPath(n.slice(1),r.rootNode,!0)}async function Xf({macro:t,context:e}){if(!(t.macro!=="DT_NODELABEL"||t.args?.length!==1))return nC(t.args[0].macro,e)}async function iC(t){return t?.parent??void 0}async function Jf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return iC(s)}var sC=(t,e)=>{if(!e.length)return t;let r=e.splice(0,1)[0],n=t.nodes.find(i=>ee(i.fullName)===r);return n?sC(n,e):void 0};async function Qf(t,e){let r=await e?.getRuntime();if(r)return sC(r.rootNode,t)}async function Zf({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_PATH"||!r?.length))return Qf(r.map(n=>n.macro),e)}async function ep({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_ROOT"||r?.length))return(await e.getRuntime()).rootNode}async function ia(t,e,r){let n=t?.properties.find(c=>ee(c.name)===e);if(!n)return;let i=n?.ast.quickValues?.at(r),s=n.parent.nodeType;if(Array.isArray(i)||!s||!(s instanceof Nt))return;let a=s.properties.find(c=>c.getNameMatch(n.name))?.values(n).findIndex(c=>c===i)??-1;return a===-1?void 0:a}async function tp(t,e,r,n,i){return xr(await ia(t,e,r),n,i)}async function rp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return await tp(o,s[1].macro,a,{macro:s[3],document:t,context:r,position:n},i)}async function np({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await tp(o,s[1].macro,0,{macro:s[2],document:t,context:r,position:n},i)}async function ss(t,e,r,n,i){let s=t?.properties.find(d=>ee(d.name)===e),o=s?.parent.nodeType;if(!o||!(o instanceof Nt))return;if(typeof r=="string"){let d=s.nexusMapsTo.at(0)?.specifierSpace;if(r=(d?s.parent.getProperty(`${d}-names`)?.ast.quickValues:void 0)?.findIndex(p=>typeof p=="string"&&p.toLowerCase()===r)??-1,r===-1)return}let a=s.nexusMapsTo.at(r),l=a?.target.nodeType?.cellsValues?.find(d=>a.specifierSpace&&d.specifier===a.specifierSpace)?.values?.indexOf(n);if(l===void 0||l===-1)return;let u=a?.mappingValuesAst.at(l);if(u instanceof we){let d=u.evaluate(i.macros);return typeof d!="number"?u.toString():d}}async function sa(t,e,r,n,i,s){return xr(await ss(t,e,r,n,i.context),i,s)}async function ip({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return sa(o,s[1].macro,a,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function sp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n});return sa(o,s[1].macro,s[2].macro,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function ri(t,e,r=0){let n=t?.properties.find(s=>ee(s.name)===e);if(r=typeof r=="number"?r:De(r??"0"),typeof r!="number")return;let i=n?.ast.getFlatAstValues()?.at(r);if(i instanceof ie)return i.linksTo;if(i instanceof it)return i.path?.pathParts.at(-1)?.linksTo}async function os({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,0)}async function ni({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,s.at(2)?.macro)}async function oC(t,e,r){let n=t?.properties.find(l=>ee(l.name)===e);if(!n)return;let i=n.parent.nodeType;if(!i||!(i instanceof Nt))return;let s=n.nexusMapsTo.at(0)?.specifierSpace,a=(s?n.parent.getProperty(`${s}-names`)?.ast.quickValues:void 0)?.findIndex(l=>typeof l=="string"&&l.toLowerCase()===r)??-1;return a===-1?void 0:n.nexusMapsTo.at(a)?.target}async function op({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_NAME"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await oC(o,s[1].macro,s[2].macro)}async function ap({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return sa(o,s[1].macro,0,s[2].macro,{macro:s[3],document:t,context:r,position:n},i)}async function cp({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX_OR"||e.args?.length!==5)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return jf(s,e.args[3].macro,{macro:e.args[4],document:t,context:r,position:n},i)}async function lp(t,e){if(!t)return;let r=t?.properties.find(n=>ee(n.name)===e);return r?.nexusMapsTo.length?r.nexusMapsTo.length:r?.ast.getFlatAstValues()?.length}async function aC(t,e,r,n){if(t)return xr(await lp(t,e),r,n)}async function up({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?aC(o,s[1].macro,{macro:s[2],document:t,context:r,position:n},i):void 0}async function oa(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ne)return ee(n[0].value)}async function cC(t,e,r,n){if(t)return xr(await oa(t,e),r,n)}async function dp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return cC(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function fp(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ne)return n[0].value}async function lC(t,e,r,n){if(t)return xr(await fp(t,e),r,n)}async function pp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return lC(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function hp(t,e){return(await oa(t,e))?.toUpperCase()}async function uC(t,e,r,n){if(t)return xr(await hp(t,e),r,n)}async function mp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return uC(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}function In(t){return async(e,r)=>{let n=await t(e,r);if(n instanceof X)return n}}async function x({macro:t,document:e,context:r,position:n}){["DT_ALIAS","DT_NODELABEL"].some(a=>a===t.parent?.macro)||t.parent?.macro==="DT_CHILD"&&t.argIndexInParent===1?t=t.parent:t.parent?.macro==="DT_HAS_ALIAS"?(t=t.parent,t.macro="DT_ALIAS"):t.parent?.macro==="DT_PATH"&&(t.parent.args=t.parent.args?.slice(0,(t.argIndexInParent??0)+1)??[],t=t.parent);let s=await[Uf,Vf,Wf,Gf,eC,Yf,Kf,Xf,Jf,Zf,os,ni,op,KD,GD,XD,ep,In(rp),In(np),In(ip),In(sp),In(ap),In(cp),In(up),In(na),In(dp),In(pp),In(mp)].reduce((a,c)=>a.then(l=>l||c({macro:t,document:e,context:r,position:n},x)),Promise.resolve(void 0));if(s)return Array.isArray(s)?s.at(0):s;let o=await is(e,t.macro,n,r);if(o)return x({document:e,macro:o[0],context:r,position:n})}async function dC({macro:t,document:e,context:r,position:n}){return t.macro&&t.macro&&"DT_CHILD".startsWith(t.macro)?[{label:"DT_CHILD(...)",insertText:"DT_CHILD($1, $2)",kind:Mc.CompletionItemKind.Function,insertTextFormat:Mc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_CHILD"||t.argIndexInParent!==1||!t.parent.args?.length?[]:(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.nodes.map(s=>({label:ee(s.fullName),kind:Mc.CompletionItemKind.Class,documentation:s.toMarkupContent(r.macros)}))??[]}var xc=$(H());function fC({macro:t,context:e}){return t.macro&&"DT_COMPAT_GET_ANY_STATUS_OKAY".startsWith(t.macro)?[{label:"DT_COMPAT_GET_ANY_STATUS_OKAY(...)",insertText:"DT_COMPAT_GET_ANY_STATUS_OKAY($1)",kind:xc.CompletionItemKind.Function,insertTextFormat:xc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.argIndexInParent!==0?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:xc.CompletionItemKind.Property}))??[]}var Lc=$(H());function pC({macro:t,context:e}){return t.macro&&"DT_INST".startsWith(t.macro)?[{label:"DT_INST(...)",insertText:"DT_INST($1, $2)",kind:Lc.CompletionItemKind.Function,insertTextFormat:Lc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_INST"||t.argIndexInParent!==1?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:Lc.CompletionItemKind.Property}))??[]}var qc=$(H());async function hC({macro:t,context:e}){if(t.macro&&"DT_NODELABEL".startsWith(t.macro))return[{label:"DT_NODELABEL(...)",insertText:"DT_NODELABEL($1)",kind:qc.CompletionItemKind.Function,insertTextFormat:qc.InsertTextFormat.Snippet}];let r=await e.getRuntime();return t.parent?.macro!=="DT_NODELABEL"||t.argIndexInParent!==0?[]:await Promise.all(r.rootNode.allDescendantsLabels.map(async n=>({label:n.label.value,kind:qc.CompletionItemKind.Property,documentation:n.lastLinkedTo?.toMarkupContent(r.context.macros)}))??[])}var $c=$(H());async function mC({macro:t,context:e}){return t.macro&&t.macro&&"DT_PATH".startsWith(t.macro)?[{label:"DT_PATH(...)",insertText:"DT_PATH($1)",kind:$c.CompletionItemKind.Function,insertTextFormat:$c.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_PATH"||!t.parent.args?.length?[]:(await Qf(t.parent.args.slice(0,-1).map(n=>n.macro),e))?.nodes.map(n=>({label:ee(n.fullName),kind:$c.CompletionItemKind.Class,documentation:n.toMarkupContent(e.macros)}))??[]}var gC=$(H());async function yC({macro:t,context:e}){if(t.macro&&t.macro&&"DT_ROOT".startsWith(t.macro)){let r=await e.getRuntime();return[{label:"DT_ROOT",kind:gC.CompletionItemKind.Class,documentation:r.rootNode.toMarkupContent(r.context.macros)}]}return[]}var gp=$(H());function TC({macro:t}){return t.macro&&t.macro&&"DT_SAME_NODE".startsWith(t.macro)?[{label:"DT_SAME_NODE(...)",insertText:"DT_SAME_NODE($1, $2)",kind:gp.CompletionItemKind.Snippet,insertTextFormat:gp.InsertTextFormat.Snippet}]:[]}var Bc=$(H());async function J({macro:t,document:e,position:r,context:n},i,s,o,a,c=l=>x({document:e,macro:l,context:n,position:r})){if(t.macro&&t.macro&&i.startsWith(t.macro))return[{label:`${i}(...)`,insertText:`${i}(${Array(o).map((d,f)=>`${f+1}`).join(", ")})`,kind:Bc.CompletionItemKind.Function,insertTextFormat:Bc.InsertTextFormat.Snippet}];if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let l=await c(t.parent.args[0]);return(a?l?.properties.filter(a):l?.properties)?.map(d=>({label:ee(d.name),kind:Bc.CompletionItemKind.Property,documentation:d.toPrettyString(n.macros)}))??[]}async function vC(t){return J(t,"DT_ENUM_HAS_VALUE",1,3)}async function bC(t){return J(t,"DT_ENUM_HAS_VALUE_BY_IDX",1,4)}async function _C(t){return J(t,"DT_ENUM_IDX",1,2)}async function SC(t){return J(t,"DT_ENUM_IDX_BY_IDX",1,3)}async function NC(t){return J(t,"DT_ENUM_IDX_BY_IDX_OR",1,4)}async function kC(t){return J(t,"DT_ENUM_IDX_OR",1,3)}var RC=$(H());async function Ei({macro:t,document:e,context:r,position:n},i,s,o){if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let c=(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.properties.find(f=>ee(f.name)===t.parent?.args?.at(1)?.macro),l=0;if(typeof o=="string"){let f=c?.nexusMapsTo.at(0)?.specifierSpace;if(l=(f?c.parent.getProperty(`${f}-names`)?.ast.quickValues:void 0)?.findIndex(g=>typeof g=="string"&&g.toLowerCase()===o)??-1,l===-1)return[]}let u=c?.nexusMapsTo.at(l);return u?.target.nodeType?.cellsValues?.find(f=>u.specifierSpace&&f.specifier===u.specifierSpace)?.values.map(f=>({label:ee(f),kind:RC.CompletionItemKind.Property}))??[]}async function PC(t){return t.macro.argIndexInParent===2?Ei(t,"DT_PHA",2,0):J(t,"DT_PHA",1,3,e=>!!e.nexusMapsTo.length)}var EC=$(H());async function xU({document:t,macro:e,position:r,context:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:n,position:r}))?.properties.find(a=>ee(a.name)===e.parent?.args?.at(1)?.macro);return Array(o?.nexusMapsTo.length??0)?.map((a,c)=>({label:c.toString(),kind:EC.CompletionItemKind.Property}))??[]}async function wC(t){if(t.macro.argIndexInParent===2)return xU(t,"DT_PHA_BY_IDX");if(t.macro.argIndexInParent===3){let e=t.macro.parent?.args?De(t.macro.parent.args[2].macro):void 0;return typeof e!="number"?[]:Ei(t,"DT_PHA_BY_IDX",3,e)}return J(t,"DT_PHA_BY_IDX",1,3,e=>!!e.nexusMapsTo.length)}var DC=$(H());async function Fc({document:t,macro:e,context:r,position:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:r,position:n}))?.properties.find(l=>ee(l.name)===e.parent?.args?.at(1)?.macro),a=o?.nexusMapsTo.at(0)?.specifierSpace;return(a?o.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.filter(l=>typeof l=="string")?.map(l=>({label:l,kind:DC.CompletionItemKind.Property}))??[]}async function CC(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHA_BY_NAME"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?Ei(t,"DT_PHA_BY_NAME",3,e.parent.args[2].macro):[]:J(t,"DT_PHA_BY_NAME",1,3,r=>!!r.nexusMapsTo.length)}async function AC(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHA_BY_NAME_OR"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?Ei(t,"DT_PHA_BY_NAME_OR",3,e.parent.args[2].macro):[]:J(t,"DT_PHA_BY_NAME_OR",1,3,r=>!!r.nexusMapsTo.length)}async function OC(t){let{macro:e}=t;return e.argIndexInParent===2?Ei(t,"DT_PHA_OR",2,0):J(t,"DT_PHA_OR",1,3,r=>!!r.nexusMapsTo.length)}async function yp(t){return J(t,"DT_PHANDLE",1,2,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof ie||r instanceof it))}async function aa(t){return J(t,"DT_PHANDLE_BY_IDX",1,3,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof ie||r instanceof it))}async function IC(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHANDLE_BY_NAME"):J(t,"DT_PHANDLE_BY_NAME",1,3,r=>!!r.ast.getFlatAstValues()?.some(n=>n instanceof ie||n instanceof it))}async function MC(t){return J(t,"DT_PROP",1,2,e=>!e.nexusMapsTo.length)}async function xC(t){return J(t,"DT_PROP_BY_IDX",1,3,e=>!e.nexusMapsTo.length)}async function LC(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX"?aa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE_IDX",3,4,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function qC(t){let{macro:e}=t;return e.argIndexInParent===1&&e.parent?.macro==="DT_PROP_BY_PHANDLE"?yp({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE",2,3,r=>!r.nexusMapsTo.length,()=>os({...t,macro:{macro:"DT_PHANDLE",args:e.parent?.args?.slice(0,2)}},x))}async function $C(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX_OR"?aa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE_IDX_OR",3,5,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function BC(t){return J(t,"DT_PROP_HAS_IDX",1,3,e=>!e.nexusMapsTo.length)}async function FC(t){return J(t,"DT_PROP_HAS_NAME",1,3,e=>!e.nexusMapsTo.length)}async function jC(t){return J(t,"DT_PROP_LAST",1,2,e=>!e.nexusMapsTo.length)}async function UC(t){return J(t,"DT_PROP_LEN",1,2,e=>!e.nexusMapsTo.length)}async function HC(t){return J(t,"DT_PROP_LEN_OR",1,2,e=>!e.nexusMapsTo.length)}async function VC(t){return J(t,"DT_PROP_OR",1,2,e=>!e.nexusMapsTo.length)}async function zC(t){return J(t,"DT_STRING_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function WC(t){return J(t,"DT_STRING_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function GC(t){return J(t,"DT_STRING_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function YC(t){return J(t,"DT_STRING_UNQUOTED",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function KC(t){return J(t,"DT_STRING_UNQUOTED_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function XC(t){return J(t,"DT_STRING_UNQUOTED_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function JC(t){return J(t,"DT_STRING_UPPER_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function QC(t){return J(t,"DT_STRING_UPPER_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function ZC(t){return J(t,"DT_STRING_UPPER_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}var jc=$(H());async function eA({macro:t,context:e}){return t.parent?.macro==="DT_ON_BUS"&&t.argIndexInParent===1?e.bindingLoader?.getBusTypes().map(r=>({label:ee(r),kind:jc.CompletionItemKind.Enum}))??[]:t.macro&&"DT_ON_BUS".startsWith(t.macro)?[{label:"DT_ON_BUS(...)",insertText:"DT_ON_BUS($1, $2)",kind:jc.CompletionItemKind.Function,insertTextFormat:jc.InsertTextFormat.Snippet}]:[]}async function tA(t){return J(t,"DT_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}async function rA(t){return J(t,"DT_HAS_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}var LU=["DT_BUS","DT_CHILD_NUM","DT_CHILD_NUM_STATUS_OKAY","DT_GPARENT","DT_HAS_ALIAS","DT_NODE_CHILD_IDX","DT_NODE_FULL_NAME","DT_NODE_FULL_NAME_TOKEN","DT_NODE_FULL_NAME_UNQUOTED","DT_NODE_FULL_NAME_UPPER_TOKEN","DT_NODE_HASH","DT_NODE_PATH","DT_NODELABEL_STRING_ARRAY","DT_PARENT"];async function nA(t,e,r){if(!r)return[];let n=Pi(r,t.position);return n?(await Promise.all([eA,tA,rA,WD,dC,fC,pC,qU,hC,mC,yC,TC,bC,vC,SC,NC,_C,kC,wC,CC,AC,PC,aa,IC,yp,OC,xC,qC,LC,$C,MC,BC,FC,jC,UC,HC,VC,zC,WC,GC,YC,KC,XC,JC,QC,ZC].flatMap(async i=>await i({document:r,context:e,macro:n,position:t.position})))).flat():[]}function qU({macro:t}){return t.macro?LU.filter(e=>e.startsWith(t.macro)).map(e=>({label:`${e}(...)`,insertText:`${e}($1)`,kind:Tp.CompletionItemKind.Function,insertTextFormat:Tp.InsertTextFormat.Snippet})):[]}var ii=$(H());function $U(t){if(!t||t.item===null||!(t.ast instanceof et))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if(i instanceof Ke)return ii.Location.create(he(i.uri),fe(i.propertyName??i));if(i instanceof ht)return ii.Location.create(he(i.uri),fe(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof et)return r(e(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function BU(t){if(!t)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===r)return!0}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&(o.by.nodeNameOrRef instanceof Me?o.by.nodeNameOrRef!==t.ast:!r.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedRefLabels,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof St)return ii.Location.create(he(o.uri),fe(o.name??o));if(o instanceof He)return ii.Location.create(he(o.uri),fe(o.name??o));if(o instanceof Me)return ii.Location.create(he(o.uri),fe(o));if(o instanceof Me)return ii.Location.create(he(o.uri),fe(o));if(o instanceof ie)return ii.Location.create(he(o.uri),fe(o.label??o));if(o instanceof Ke)return ii.Location.create(he((o.values??o)?.uri),fe(o.values??o))}).filter(o=>o)};if(t.item instanceof X&&!Ut(t.ast))return e(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return Ut(t.ast)?[...e(t.ast.linksTo),ii.Location.create(he(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return e(r)}return[]}async function iA(t,e){return _t(t,e,r=>[...BU(r),...$U(r)])}var wi=$(H());function sA(t){if(!t||t.item===null||!(t.ast instanceof et))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if((i instanceof Ke||i instanceof ht)&&i.propertyName)return wi.Location.create(he(i.uri),fe(i.propertyName))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof et)return r(e(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function oA(t,e){if(!e||!(e.ast instanceof Zt))return[];"newName"in t&&(e.ast.parentNode instanceof ie&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof Qi&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let r=e.ast.value,n=i=>[...i.definitions.filter(s=>s instanceof He).flatMap(s=>s.labels.map(o=>o.label)),...i.referencedBy.flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===r).map(s=>{if(s)return wi.Location.create(he(s.uri),fe(s))}).filter(s=>s);return e.item instanceof X&&!Ut(e.ast)?n(e.item):e.ast instanceof Zt&&e.ast.parentNode instanceof ie&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function aA(t){if(!t||!(t.ast instanceof Me)||t.ast instanceof Me&&t.ast.linksTo===t.runtime.rootNode)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=t.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(r)||c===r)return!0}}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof He&&o.name)return wi.Location.create(he(o.uri),fe(o.name));if(o instanceof Me)return wi.Location.create(he(o.uri),fe(o));if(o instanceof Ke&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof ne){let a=o.values.values[0].value,c=fe(a),l=a.value.split("/"),u=r.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,wi.Location.create(he(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof X&&!Ut(t.ast)?e(t.item):t.ast instanceof Me&&t.ast.linksTo?Ut(t.ast)?[...e(t.ast.linksTo),wi.Location.create(he(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo):[]}async function cA(t,e){let r={};return(await _t(t,e,i=>[...aA(i),...oA(t,i),...sA(i)])).forEach(i=>{r[i.uri]??=[],r[i.uri].push(wi.TextEdit.replace(i.range,t.newName))}),{changes:r}}async function lA(t,e){let r=await _t(t,e,n=>[...aA(n),...oA(t,n),...sA(n)]);if(r.some(n=>e?.settings.lockRenameEdits?.some(i=>Re(n.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var ca=$(H());var vp=t=>[...t.definitions,...t.referencedBy].map(e=>{if(e instanceof St)return ca.Location.create(he(e.uri),fe(e));if(e instanceof He)return ca.Location.create(he(e.uri),fe(e));if(e instanceof Wt)return ca.Location.create(he(e.uri),fe(e))}).filter(e=>e),dA=t=>t.replacedBy?dA(t.replacedBy):t,uA=t=>[t.ast,...t.allReplaced.map(e=>e.ast)].map(e=>{if(e instanceof Ke)return ca.Location.create(he(e.uri),fe(e.propertyName??e))}).filter(e=>e);function FU(t){if(!t||t.item===null||!(t.ast instanceof et))return[];if(t.item instanceof Xe&&t.ast instanceof et)return uA(dA(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let e=t.item.deletedProperties.find(r=>r.by===t.ast.parentNode)?.property;if(e)return uA(e)}return[]}function jU(t){if(!t)return[];if(t.item instanceof X&&!Ut(t.ast))return vp(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return vp(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return vp(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return vp(e)}return[]}function UU(t){if(t?.ast instanceof Dt||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Dt?t.ast.name:t.ast.value);if(e)return[ca.Location.create(he(e.macro.uri),fe(e.macro.identifier))]}return[]}async function fA(t,e){return _t(t,e,r=>[...jU(r),...FU(r),...UU(r)])}var Uc=$(H());var as=t=>{let e=t.definitions.at(0);return e?Uc.Location.create(he(e.uri),fe(e)):void 0},bp=t=>t.replaces?bp(t.replaces):t,_p=t=>{let e=bp(t);return e?Uc.Location.create(he(e.ast.uri),fe(e.ast)):void 0};function HU(t){if(!t||t.item===null||!(t.ast instanceof et))return;let e=r=>Uc.Location.create(he(r.ast.uri),fe(r.ast.propertyName??r.ast));if(t.item instanceof Xe&&t.ast instanceof et)return e(bp(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let r=t.item.deletedProperties.find(n=>n.by===t.ast.parentNode)?.property;if(r)return e(bp(r))}}function VU(t){if(t){if(t.item instanceof X&&!Ut(t.ast))return as(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return as(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return as(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return as(e)}}}function zU(t){if(t?.ast instanceof Dt||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Dt?t.ast.name:t.ast.value);if(e)return Uc.Location.create(he(e.macro.uri),fe(e.macro.identifier))}}async function pA(t,e){return(await _t(t,e,r=>[VU(r)||HU(r)||zU(r)])).at(0)}var WU=["DT_PROP","DT_PROP_LEN","DT_PROP_LEN_OR","DT_PROP_HAS_IDX","DT_PROP_HAS_NAME","DT_PROP_BY_IDX","DT_PROP_LAST","DT_PROP_OR","DT_ENUM_IDX_BY_IDX","DT_ENUM_IDX","DT_ENUM_IDX_BY_IDX_OR","DT_ENUM_IDX_OR","DT_ENUM_HAS_VALUE_BY_IDX","DT_ENUM_HAS_VALUE","DT_STRING_TOKEN","DT_STRING_TOKEN_OR","DT_STRING_UPPER_TOKEN","DT_STRING_UPPER_TOKEN_OR","DT_STRING_UNQUOTED","DT_STRING_UNQUOTED_OR","DT_STRING_TOKEN_BY_IDX","DT_STRING_UPPER_TOKEN_BY_IDX","DT_STRING_UNQUOTED_BY_IDX","DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR","DT_PROP_BY_PHANDLE","DT_PHA_BY_IDX","DT_PHA_BY_IDX_OR","DT_PHA","DT_PHA_OR","DT_PHA_BY_NAME","DT_PHA_BY_NAME_OR","DT_PHANDLE_BY_NAME","DT_PHANDLE_BY_IDX","DT_PHANDLE"];async function Sp({macro:t,document:e,context:r,position:n}){if(WU.some(i=>i===t.parent?.macro)&&t.argIndexInParent===1&&t.parent?.args?.[0])return(await x({document:e,context:r,position:n,macro:t.parent.args[0]}))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===2&&t.parent?.args?.[0]&&t.parent?.args?.[1])return(await os({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE",args:t.parent.args.slice(0,2)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===3&&t.parent?.args?.[0]&&t.parent?.args?.[1]&&t.parent?.args?.[3])return(await ni({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE_BY_IDX",args:t.parent.args.slice(0,3)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_CHOSEN","DT_HAS_CHOSEN"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===0&&t.parent?.args?.[0])return(await r.getRuntime()).rootNode.getChild(["/","chosen"])?.properties.find(i=>ee(i.name)===t.macro)}async function hA(t,e,r){if(!r)return;let n=Pi(r,t.position);return mA(n,t.position,e,r)}async function mA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return as(i);let s=await Sp({document:n,macro:t,context:r,position:e});if(s)return _p(s);let o=await is(n,t.macro,e,r);if(o)return mA(o[0],o[1],r,n)}async function gA(t,e,r){if(!r)return;let n=Pi(r,t.position);return yA(n,t.position,e,r)}async function yA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return as(i);let s=await Sp({document:n,macro:t,context:r,position:e});if(s)return _p(s);let o=await is(n,t.macro,e,r);if(o)return yA(o[0],o[1],r,n)}var ue=$(H());var GU=(t,e,r,n,i)=>{switch(r){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(ue.Range.create(ue.Position.create(n.range.start.line,t.pos.colEnd),ue.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},YU=(t,e,r,n,i)=>{if(!n?.length)return[];switch(t){case 0:return[{title:i??`Add Property "${n[0].newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 36:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 25:return n?[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}]:[];default:return}},KU=(t,e,r,n)=>r?.length?[{title:n??"TODO",diagnostics:[t],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[e]:r}}}]:[];function TA(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.type){case"FormattingIssues":return KU(a,t.textDocument.uri,c.edit?Array.isArray(c.edit)?c.edit:[c.edit]:void 0,c.codeActionTitle);case"SyntaxIssue":return c?.items.flatMap(l=>GU(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.items.flatMap(l=>YU(l,a,t.textDocument.uri,c.edit?Array.isArray(c.edit)?c.edit:[c.edit]:void 0,c.codeActionTitle))}}).filter(a=>!!a),r=e.filter(a=>a.kind===ue.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==ue.CodeActionKind.SourceFixAll),s=r.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[t.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)}),[...i,...r.map(a=>({...a,kind:ue.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var vA=$(H());var Np=t=>!t||t instanceof Ke?!1:t instanceof vr||Np(t.parentNode);function XU(t){if(!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken))return[];let e=Np(t?.ast);if(!e&&!(t.ast instanceof Ke&&t.item.ast.values===null)&&!Np(t.beforeAst)&&!Np(t.afterAst))return[];let r=-1;if(t.item.ast.values===null?r=0:r=(t.item.ast.values?.values.findIndex(i=>i&&qy(i,t.beforeAst))??-1)+1,r===-1&&(r=0),t.item.name==="compatible"){let s=t.item.parent.nodeTypes.filter(c=>c).at(-1),o=t.item.ast.quickValues,a;return s instanceof Nt&&s.extends.size&&(a=Array.from(s.extends).filter(c=>!o||!o.includes(c))),o?.filter(c=>c)?.length&&!a?[]:(a??=t.runtime.context.bindingLoader?.getBindings()??[],a.filter(c=>!o||!o.includes(c)).map(c=>({label:`"${c}"`,kind:vA.CompletionItemKind.Variable,insertText:e?c:`"${c}"`})))}let n=t.item.parent.nodeType;return n instanceof Nt?n.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,r,e)??[]:[]}function JU(t){if(!t||!(t.item instanceof Xe&&t.ast instanceof et&&t.item.ast.values==null||t.item instanceof X)||Ut(t.ast)||t.beforeAst?.parentNode instanceof Tr)return[];let e=r=>r.nodeType?.getPropertyListCompletionItems(r)??[];return t.item instanceof Xe?e(t.item.parent):e(t.item)}async function bA(t,e){return _t(t,e,r=>[...XU(r),...JU(r)])}var kp=$(H());async function QU(t){if(t?.ast instanceof Dt||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Dt?t.ast.name:t.ast.value);if(e){let r=yc(t.ast),n=(await t.runtime.context.getAllParsers()).at(-1);if(r){let i=r?.evaluate(n.cPreprocessorParser.macros);return{contents:{kind:kp.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
285
+ };`,kind:At.CompletionItemKind.Value,insertTextFormat:At.InsertTextFormat.Snippet}))]}function PU(t,e){let r=s=>s?s.parentNode instanceof Wt||s.parentNode instanceof St||s.parentNode instanceof He?!1:r(s.parentNode):!0;if(!t||t.item!==null||!Ut(t.ast)||!r(t.ast))return[];let n=s=>$f(s,e).filter(o=>e(o));if(t.ast instanceof ut)return n(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[];let i=new Map;return n(t.runtime.rootNode).forEach(s=>i.set(s.label.value,s)),Array.from(i).map(([,s])=>({label:t.ast instanceof ie?`${s.label.value}`:`&${s.label.value}`,kind:At.CompletionItemKind.Variable,documentation:s.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function wU(t,e){if(!t||!(t.item instanceof X)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof Tr)||t.beforeAst?.parentNode instanceof ht))return[];let r=n=>[...n.nodes,...n.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>({node:i,astNodes:i.definitions.filter(s=>s instanceof He)})).filter(i=>i.astNodes.some(e));return t.ast instanceof Me||t.ast instanceof Ar||t.beforeAst?.parentNode instanceof Ar?r(t.item).map(n=>({label:`${n.astNodes.at(0)?.name?.toString()}`,kind:At.CompletionItemKind.Variable,documentation:n.node.toMarkupContent(t.runtime.context.macros)})):r(t.item).length?[{label:"/delete-node/",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[]}function EU(t,e){if(!t||!(t.item instanceof X)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof Tr)||t.beforeAst?.parentNode instanceof Ar))return[];let r=n=>[...n.properties,...n.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));if(t.ast instanceof et||t.ast instanceof ht||t.beforeAst?.parentNode instanceof ht){let n=new Map;return r(t.item).forEach(i=>n.set(i.name,i)),Array.from(n).map(([,i])=>({label:`${i.name}`,kind:At.CompletionItemKind.Variable,documentation:i.ast.toPrettyString(t.runtime.context.macros)}))}return r(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:At.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:At.InsertTextFormat.Snippet}]:[]}function CU(t,e){let r=t?.ast instanceof In?t.ast:t?.ast.parentNode;if(!t||!r||!(r instanceof In))return[];let n=r.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let i=n.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!Ut(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]]})().map(o=>({label:`/${[...i,o.fullName].join("/")}`,kind:At.CompletionItemKind.Variable,documentation:o.toMarkupContent(t.runtime.context.macros)}))}function DU(t){return!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken)||t.ast instanceof ne?[]:!Hs(t?.ast)&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!Hs(t.beforeAst)&&!Hs(t.afterAst)?[]:t.item.parent.nodeType instanceof Nt?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([,n])=>n.macro.identifier instanceof ei?{label:`${n.macro.identifier.toString()}`,insertText:`${n.macro.name}(${n.macro.identifier.params.map((i,s)=>i instanceof Ct?`$${s+1}`:"").join(", ")})`,kind:At.CompletionItemKind.Function,sortText:`~${n.macro.name}`,insertTextFormat:At.InsertTextFormat.Snippet}:{label:n.macro.identifier.name,kind:At.CompletionItemKind.Variable,sortText:`~${n.macro.name}`}):[]}async function jC(t,e){return _t(t,e,(r,n)=>[...EU(r,n),...wU(r,n),...PU(r,n),...CU(r,n),...RU(r,n),...kU(r,n),...NU(r),...DU(r)])}var Tp=$(H());var HC=require("child_process");var oT=t=>/[A-Za-z0-9_]/.test(t);function AU(t,e){let r=[];for(let n=0;n<e;n++){let i=t[n];i==="("?r.push(n):i===")"&&r.pop()}return r.length?r[r.length-1]:void 0}function UC(t,e){let r=1;for(let n=e+1;n<t.length;n++){let i=t[n];if(i==="(")r++;else if(i===")"&&(r--,r===0))return n}}function VC(t,e,r){let n=[],i=0,s=!1,o=!1,a=e;for(let f=e;f<r;f++){let p=t[f];if(p==="'"&&!o)s=!s;else if(p==='"'&&!s)o=!o;else if(!s&&!o){if(p==="(")i++;else if(p===")")i--;else if(p===","&&i===0){let g=a,h=f,T=g,S=h;for(;T<S&&/\s/.test(t[T]);)T++;for(;S>T&&/\s/.test(t[S-1]);)S--;n.push({start:g,end:h,text:t.slice(T,S)}),a=f+1}}}let c=a,l=r,u=c,d=l;for(;u<d&&/\s/.test(t[u]);)u++;for(;d>u&&/\s/.test(t[d-1]);)d--;return n.push({start:c,end:l,text:t.slice(u,d)}),n}function aT(t){let e=t.trim(),r=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(e);if(!r)return{macro:e};let n=r[1],i=r[2],s=VC(i,0,i.length),o={macro:n,args:[]};return o.args=s.map(a=>{let c=aT(a.text);return c.parent=o,c}),o}function Pi(t,e){let r=t.getText(),n=t.offsetAt(e),i=n,s=n;for(;i>0&&oT(r[i-1]);)i--;for(;s<r.length&&oT(r[s]);)s++;if(r[s]==="("){let T=UC(r,s);T!==void 0&&(s=T+1)}let o=r.slice(i,s),a=o.trim().length?aT(o):void 0,c=AU(r,n);if(c===void 0)return a;let l=UC(r,c);if(l===void 0||!(c<n&&n<=l))return a;let u=c,d=u;for(;d>0&&oT(r[d-1]);)d--;let f=r.slice(d,u);if(!f)return a;let p=VC(r,c+1,l),g={macro:f,args:[]};g.args=p.map(T=>{let S=aT(T.text);return S.parent=g,S});let h=-1;for(let T=0;T<p.length;T++){let S=p[T];if(n>=S.start&&n<=S.end){h=T;break}}if(h>=0){let T=g.args[h];return T.argIndexInParent=h,T}return g}function IU(t,e,r){let i=t.getText().split(/\r?\n/),s=new RegExp(`^\\s*#\\s*define\\s+(${e})\\b(\\s*\\([^)]*\\))?\\s*(.*)$`);for(let o=Math.min(r.line,i.length-1);o>=0;o--){let a=i[o],c=s.exec(a);if(c){let l=a.indexOf(c[0]),u=a.indexOf(c[3],l);return Wr.create(o,u>=0?u:a.length)}}}async function is(t,e,r,n){let i=zC(t,e,r);if(i)return i;let s=await MU(e,n,Re(t.uri));if(s)return[s,r]}function zC(t,e,r){if(e.startsWith("DT_"))return;let n=IU(t,e,r);if(!n)return;let i=Pi(t,n);if(i)return[i,n]}var OU=(t,e)=>new Promise(r=>{let n=(0,HC.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),i="";n.stdout.on("data",s=>{i+=s.toString()}),n.on("close",s=>{r(s?"":i)})});async function MU(t,e,r){let n=e.getCompileCommands()?.find(s=>le(s.file,r));if(!n)return;let i=`${n.command.replace(/-(o|c)\s+\S+/g,"")} -E -dM ${n.file}`;try{let[s,...o]=i.split(" "),a=await OU(s,o.filter(u=>!!u)),c=Yn.create(`macros://${n.file}`,"devicetree",0,a),l=zC(c,t,c.positionAt(a.length-1));if(l)return l[0]}catch(s){console.error(s)}}function ee(t){return t.toLowerCase().replace(/[@,-\.]/g,"_")}var Oc=$(H());async function WC({macro:t,context:e}){if(t.macro&&"DT_ALIAS".startsWith(t.macro))return[{label:"DT_ALIAS(...)",insertText:"DT_ALIAS($1)",kind:Oc.CompletionItemKind.Function,insertTextFormat:Oc.InsertTextFormat.Snippet}];if(t.parent?.macro!=="DT_ALIAS"||t.argIndexInParent!==0)return[];let r=await e.getRuntime();return r.rootNode.getNode("aliases")?.properties.map(n=>{let i=n.ast.getFlatAstValues()?.at(0),s;return i instanceof ie?s=i.linksTo:i instanceof In&&(s=i.pathParts.at(-1)?.linksTo),{label:ee(n.name),kind:Oc.CompletionItemKind.Property,documentation:s?.toMarkupContent(r.context.macros)}})??[]}var Mc=$(H());async function ur(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();return i?.length===0?!0:i?.map(s=>{if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo;if(s instanceof ie)return s.linksTo;if(s instanceof ne)return s.value;if(s instanceof Ee){let o=s.evaluate(r.macros);return typeof o=="number"?o:s.toString()}})}async function Bf({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?ur(o,s[1].macro,r):void 0}async function GC(t,e){let r=await Bf(t,e);if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof X)return n}async function KC(t,e,r,n){if(r=typeof r=="number"?r:Ce(r),typeof r!="number")return;let i=await ur(t,e,n);if(i===!0)return!0;if(!i)return;let s=i.at(r);if(s)return i.length===1&&i[0]instanceof X?i[0]:s}async function Ff({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_BY_IDX"||e.args?.length!==3))return KC(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro,r)}async function YC(t,e){let r=await Ff(t,e);if(typeof r!="boolean"&&r instanceof X)return r}async function xr(t,{document:e,context:r,macro:n,position:i},s){return t||(await s({document:e,macro:n,context:r,position:i})??n.macro)}async function jf(t,e,r,n){return xr(await ur(t,e,r.context),r,n)}async function na({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_OR"||e.args?.length!==3)return;let[s,o,a]=e.args,c=await i({document:t,macro:s,context:r,position:n});return await jf(c,o.macro,{macro:a,document:t,context:r,position:n},i)}async function XC(t,e){let r=await na(t,e);if(r instanceof X)return r;if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof X)return n}async function JC(t){let e=t?.nodeType?.onBus,r=t?.parent?.nodeType?.bus;return t&&r?.length&&r?.some(n=>n===e)?t.parent??void 0:void 0}async function Uf(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_BUS"||r?.length!==1)return;let n=await e({...t,macro:r[0]});return await JC(n)}async function Hf(t,e){let r=(await t.getRuntime()).rootNode.getChild(["/","chosen"]);if(!r)return;let s=r?.properties.find(o=>ee(o.name)===e)?.ast.getFlatAstValues()?.at(0);if(s instanceof ie)return s.linksTo;if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo}async function Vf(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_CHOSEN"||e?.length!==1))return await Hf(t.context,e[0].macro)}async function zf(t,e){let r=await e?.getRuntime();if(r){let n=ti.getNodeFromPath(["aliases"],r.rootNode,!0),i=n?.properties.find(o=>ee(o.name)===t);if(!i)return;let s=i.ast.getFlatAstValues();return s?.[0]instanceof ne?n=r.rootNode.getChild(s[0].value.split("/")):s?.[0]instanceof ie?n=s[0].linksTo:s?.[0]instanceof it&&(n=s[0].path?.pathParts.at(-1)?.linksTo),n}}async function Wf({macro:t,context:e}){if(!(t.macro!=="DT_ALIAS"||t.args?.length!==1))return zf(t.args[0].macro,e)}async function QC(t,e){return t?.nodes.find(r=>ee(r.name)===e)}async function Gf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD"||e.args?.length!==2)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return QC(s,e.args[1].macro)}var cT=(t,e)=>t.nodes.filter(r=>!r.disabled&&r.nodeType).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...cT(r,e)]:cT(r,e));async function ZC(t,e){let r=await e?.getRuntime();if(r)return cT(r.rootNode,t)}async function lT({macro:t,context:e}){if(!(t.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.args?.length!==1))return ZC(t.args[0].macro,e)}async function eD(t){return(await lT(t))?.at(0)}async function tD(t){return t?.parent?.parent??void 0}async function Kf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_GPARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return tD(s)}var uT=(t,e)=>t.nodes.filter(r=>r.nodeType).sort((r,n)=>r.disabled===n.disabled?0:r.disabled?1:-1).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...uT(r,e)]:uT(r,e));async function rD(t,e,r){let n=await r?.getRuntime();if(n)return uT(n.rootNode,e).at(t)}async function Yf({macro:t,context:e}){if(t.macro!=="DT_INST"||t.args?.length!==2)return;let r=Ce(t.args[0].macro);if(typeof r=="number")return rD(r,t.args[1].macro,e)}async function nD(t,e){let r=await e?.getRuntime(),n=r?.resolvePath([`&${t.trim()}`]);if(r&&n)return ti.getNodeFromPath(n.slice(1),r.rootNode,!0)}async function Xf({macro:t,context:e}){if(!(t.macro!=="DT_NODELABEL"||t.args?.length!==1))return nD(t.args[0].macro,e)}async function iD(t){return t?.parent??void 0}async function Jf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return iD(s)}var sD=(t,e)=>{if(!e.length)return t;let r=e.splice(0,1)[0],n=t.nodes.find(i=>ee(i.fullName)===r);return n?sD(n,e):void 0};async function Qf(t,e){let r=await e?.getRuntime();if(r)return sD(r.rootNode,t)}async function Zf({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_PATH"||!r?.length))return Qf(r.map(n=>n.macro),e)}async function ep({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_ROOT"||r?.length))return(await e.getRuntime()).rootNode}async function ia(t,e,r){let n=t?.properties.find(c=>ee(c.name)===e);if(!n)return;let i=n?.ast.quickValues?.at(r),s=n.parent.nodeType;if(Array.isArray(i)||!s||!(s instanceof Nt))return;let a=s.properties.find(c=>c.getNameMatch(n.name))?.values(n).findIndex(c=>c===i)??-1;return a===-1?void 0:a}async function tp(t,e,r,n,i){return xr(await ia(t,e,r),n,i)}async function rp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return await tp(o,s[1].macro,a,{macro:s[3],document:t,context:r,position:n},i)}async function np({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await tp(o,s[1].macro,0,{macro:s[2],document:t,context:r,position:n},i)}async function ss(t,e,r,n,i){let s=t?.properties.find(d=>ee(d.name)===e),o=s?.parent.nodeType;if(!o||!(o instanceof Nt))return;if(typeof r=="string"){let d=s.nexusMapsTo.at(0)?.specifierSpace;if(r=(d?s.parent.getProperty(`${d}-names`)?.ast.quickValues:void 0)?.findIndex(p=>typeof p=="string"&&p.toLowerCase()===r)??-1,r===-1)return}let a=s.nexusMapsTo.at(r),l=a?.target.nodeType?.cellsValues?.find(d=>a.specifierSpace&&d.specifier===a.specifierSpace)?.values?.indexOf(n);if(l===void 0||l===-1)return;let u=a?.mappingValuesAst.at(l);if(u instanceof Ee){let d=u.evaluate(i.macros);return typeof d!="number"?u.toString():d}}async function sa(t,e,r,n,i,s){return xr(await ss(t,e,r,n,i.context),i,s)}async function ip({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return sa(o,s[1].macro,a,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function sp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n});return sa(o,s[1].macro,s[2].macro,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function ri(t,e,r=0){let n=t?.properties.find(s=>ee(s.name)===e);if(r=typeof r=="number"?r:Ce(r??"0"),typeof r!="number")return;let i=n?.ast.getFlatAstValues()?.at(r);if(i instanceof ie)return i.linksTo;if(i instanceof it)return i.path?.pathParts.at(-1)?.linksTo}async function os({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,0)}async function ni({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,s.at(2)?.macro)}async function oD(t,e,r){let n=t?.properties.find(l=>ee(l.name)===e);if(!n)return;let i=n.parent.nodeType;if(!i||!(i instanceof Nt))return;let s=n.nexusMapsTo.at(0)?.specifierSpace,a=(s?n.parent.getProperty(`${s}-names`)?.ast.quickValues:void 0)?.findIndex(l=>typeof l=="string"&&l.toLowerCase()===r)??-1;return a===-1?void 0:n.nexusMapsTo.at(a)?.target}async function op({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_NAME"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await oD(o,s[1].macro,s[2].macro)}async function ap({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return sa(o,s[1].macro,0,s[2].macro,{macro:s[3],document:t,context:r,position:n},i)}async function cp({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX_OR"||e.args?.length!==5)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return jf(s,e.args[3].macro,{macro:e.args[4],document:t,context:r,position:n},i)}async function lp(t,e){if(!t)return;let r=t?.properties.find(n=>ee(n.name)===e);return r?.nexusMapsTo.length?r.nexusMapsTo.length:r?.ast.getFlatAstValues()?.length}async function aD(t,e,r,n){if(t)return xr(await lp(t,e),r,n)}async function up({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?aD(o,s[1].macro,{macro:s[2],document:t,context:r,position:n},i):void 0}async function oa(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ne)return ee(n[0].value)}async function cD(t,e,r,n){if(t)return xr(await oa(t,e),r,n)}async function dp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return cD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function fp(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ne)return n[0].value}async function lD(t,e,r,n){if(t)return xr(await fp(t,e),r,n)}async function pp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return lD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function hp(t,e){return(await oa(t,e))?.toUpperCase()}async function uD(t,e,r,n){if(t)return xr(await hp(t,e),r,n)}async function mp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return uD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}function On(t){return async(e,r)=>{let n=await t(e,r);if(n instanceof X)return n}}async function x({macro:t,document:e,context:r,position:n}){["DT_ALIAS","DT_NODELABEL"].some(a=>a===t.parent?.macro)||t.parent?.macro==="DT_CHILD"&&t.argIndexInParent===1?t=t.parent:t.parent?.macro==="DT_HAS_ALIAS"?(t=t.parent,t.macro="DT_ALIAS"):t.parent?.macro==="DT_PATH"&&(t.parent.args=t.parent.args?.slice(0,(t.argIndexInParent??0)+1)??[],t=t.parent);let s=await[Uf,Vf,Wf,Gf,eD,Kf,Yf,Xf,Jf,Zf,os,ni,op,YC,GC,XC,ep,On(rp),On(np),On(ip),On(sp),On(ap),On(cp),On(up),On(na),On(dp),On(pp),On(mp)].reduce((a,c)=>a.then(l=>l||c({macro:t,document:e,context:r,position:n},x)),Promise.resolve(void 0));if(s)return Array.isArray(s)?s.at(0):s;let o=await is(e,t.macro,n,r);if(o)return x({document:e,macro:o[0],context:r,position:n})}async function dD({macro:t,document:e,context:r,position:n}){return t.macro&&t.macro&&"DT_CHILD".startsWith(t.macro)?[{label:"DT_CHILD(...)",insertText:"DT_CHILD($1, $2)",kind:Mc.CompletionItemKind.Function,insertTextFormat:Mc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_CHILD"||t.argIndexInParent!==1||!t.parent.args?.length?[]:(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.nodes.map(s=>({label:ee(s.fullName),kind:Mc.CompletionItemKind.Class,documentation:s.toMarkupContent(r.macros)}))??[]}var xc=$(H());function fD({macro:t,context:e}){return t.macro&&"DT_COMPAT_GET_ANY_STATUS_OKAY".startsWith(t.macro)?[{label:"DT_COMPAT_GET_ANY_STATUS_OKAY(...)",insertText:"DT_COMPAT_GET_ANY_STATUS_OKAY($1)",kind:xc.CompletionItemKind.Function,insertTextFormat:xc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.argIndexInParent!==0?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:xc.CompletionItemKind.Property}))??[]}var Lc=$(H());function pD({macro:t,context:e}){return t.macro&&"DT_INST".startsWith(t.macro)?[{label:"DT_INST(...)",insertText:"DT_INST($1, $2)",kind:Lc.CompletionItemKind.Function,insertTextFormat:Lc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_INST"||t.argIndexInParent!==1?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:Lc.CompletionItemKind.Property}))??[]}var qc=$(H());async function hD({macro:t,context:e}){if(t.macro&&"DT_NODELABEL".startsWith(t.macro))return[{label:"DT_NODELABEL(...)",insertText:"DT_NODELABEL($1)",kind:qc.CompletionItemKind.Function,insertTextFormat:qc.InsertTextFormat.Snippet}];let r=await e.getRuntime();return t.parent?.macro!=="DT_NODELABEL"||t.argIndexInParent!==0?[]:await Promise.all(r.rootNode.allDescendantsLabels.map(async n=>({label:n.label.value,kind:qc.CompletionItemKind.Property,documentation:n.lastLinkedTo?.toMarkupContent(r.context.macros)}))??[])}var $c=$(H());async function mD({macro:t,context:e}){return t.macro&&t.macro&&"DT_PATH".startsWith(t.macro)?[{label:"DT_PATH(...)",insertText:"DT_PATH($1)",kind:$c.CompletionItemKind.Function,insertTextFormat:$c.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_PATH"||!t.parent.args?.length?[]:(await Qf(t.parent.args.slice(0,-1).map(n=>n.macro),e))?.nodes.map(n=>({label:ee(n.fullName),kind:$c.CompletionItemKind.Class,documentation:n.toMarkupContent(e.macros)}))??[]}var gD=$(H());async function yD({macro:t,context:e}){if(t.macro&&t.macro&&"DT_ROOT".startsWith(t.macro)){let r=await e.getRuntime();return[{label:"DT_ROOT",kind:gD.CompletionItemKind.Class,documentation:r.rootNode.toMarkupContent(r.context.macros)}]}return[]}var gp=$(H());function TD({macro:t}){return t.macro&&t.macro&&"DT_SAME_NODE".startsWith(t.macro)?[{label:"DT_SAME_NODE(...)",insertText:"DT_SAME_NODE($1, $2)",kind:gp.CompletionItemKind.Snippet,insertTextFormat:gp.InsertTextFormat.Snippet}]:[]}var Bc=$(H());async function J({macro:t,document:e,position:r,context:n},i,s,o,a,c=l=>x({document:e,macro:l,context:n,position:r})){if(t.macro&&t.macro&&i.startsWith(t.macro))return[{label:`${i}(...)`,insertText:`${i}(${Array(o).map((d,f)=>`${f+1}`).join(", ")})`,kind:Bc.CompletionItemKind.Function,insertTextFormat:Bc.InsertTextFormat.Snippet}];if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let l=await c(t.parent.args[0]);return(a?l?.properties.filter(a):l?.properties)?.map(d=>({label:ee(d.name),kind:Bc.CompletionItemKind.Property,documentation:d.toPrettyString(n.macros)}))??[]}async function vD(t){return J(t,"DT_ENUM_HAS_VALUE",1,3)}async function bD(t){return J(t,"DT_ENUM_HAS_VALUE_BY_IDX",1,4)}async function _D(t){return J(t,"DT_ENUM_IDX",1,2)}async function SD(t){return J(t,"DT_ENUM_IDX_BY_IDX",1,3)}async function ND(t){return J(t,"DT_ENUM_IDX_BY_IDX_OR",1,4)}async function kD(t){return J(t,"DT_ENUM_IDX_OR",1,3)}var RD=$(H());async function wi({macro:t,document:e,context:r,position:n},i,s,o){if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let c=(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.properties.find(f=>ee(f.name)===t.parent?.args?.at(1)?.macro),l=0;if(typeof o=="string"){let f=c?.nexusMapsTo.at(0)?.specifierSpace;if(l=(f?c.parent.getProperty(`${f}-names`)?.ast.quickValues:void 0)?.findIndex(g=>typeof g=="string"&&g.toLowerCase()===o)??-1,l===-1)return[]}let u=c?.nexusMapsTo.at(l);return u?.target.nodeType?.cellsValues?.find(f=>u.specifierSpace&&f.specifier===u.specifierSpace)?.values.map(f=>({label:ee(f),kind:RD.CompletionItemKind.Property}))??[]}async function PD(t){return t.macro.argIndexInParent===2?wi(t,"DT_PHA",2,0):J(t,"DT_PHA",1,3,e=>!!e.nexusMapsTo.length)}var wD=$(H());async function xU({document:t,macro:e,position:r,context:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:n,position:r}))?.properties.find(a=>ee(a.name)===e.parent?.args?.at(1)?.macro);return Array(o?.nexusMapsTo.length??0)?.map((a,c)=>({label:c.toString(),kind:wD.CompletionItemKind.Property}))??[]}async function ED(t){if(t.macro.argIndexInParent===2)return xU(t,"DT_PHA_BY_IDX");if(t.macro.argIndexInParent===3){let e=t.macro.parent?.args?Ce(t.macro.parent.args[2].macro):void 0;return typeof e!="number"?[]:wi(t,"DT_PHA_BY_IDX",3,e)}return J(t,"DT_PHA_BY_IDX",1,3,e=>!!e.nexusMapsTo.length)}var CD=$(H());async function Fc({document:t,macro:e,context:r,position:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:r,position:n}))?.properties.find(l=>ee(l.name)===e.parent?.args?.at(1)?.macro),a=o?.nexusMapsTo.at(0)?.specifierSpace;return(a?o.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.filter(l=>typeof l=="string")?.map(l=>({label:l,kind:CD.CompletionItemKind.Property}))??[]}async function DD(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHA_BY_NAME"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?wi(t,"DT_PHA_BY_NAME",3,e.parent.args[2].macro):[]:J(t,"DT_PHA_BY_NAME",1,3,r=>!!r.nexusMapsTo.length)}async function AD(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHA_BY_NAME_OR"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?wi(t,"DT_PHA_BY_NAME_OR",3,e.parent.args[2].macro):[]:J(t,"DT_PHA_BY_NAME_OR",1,3,r=>!!r.nexusMapsTo.length)}async function ID(t){let{macro:e}=t;return e.argIndexInParent===2?wi(t,"DT_PHA_OR",2,0):J(t,"DT_PHA_OR",1,3,r=>!!r.nexusMapsTo.length)}async function yp(t){return J(t,"DT_PHANDLE",1,2,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof ie||r instanceof it))}async function aa(t){return J(t,"DT_PHANDLE_BY_IDX",1,3,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof ie||r instanceof it))}async function OD(t){let{macro:e}=t;return e.argIndexInParent===2?Fc(t,"DT_PHANDLE_BY_NAME"):J(t,"DT_PHANDLE_BY_NAME",1,3,r=>!!r.ast.getFlatAstValues()?.some(n=>n instanceof ie||n instanceof it))}async function MD(t){return J(t,"DT_PROP",1,2,e=>!e.nexusMapsTo.length)}async function xD(t){return J(t,"DT_PROP_BY_IDX",1,3,e=>!e.nexusMapsTo.length)}async function LD(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX"?aa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE_IDX",3,4,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function qD(t){let{macro:e}=t;return e.argIndexInParent===1&&e.parent?.macro==="DT_PROP_BY_PHANDLE"?yp({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE",2,3,r=>!r.nexusMapsTo.length,()=>os({...t,macro:{macro:"DT_PHANDLE",args:e.parent?.args?.slice(0,2)}},x))}async function $D(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX_OR"?aa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):J(t,"DT_PROP_BY_PHANDLE_IDX_OR",3,5,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function BD(t){return J(t,"DT_PROP_HAS_IDX",1,3,e=>!e.nexusMapsTo.length)}async function FD(t){return J(t,"DT_PROP_HAS_NAME",1,3,e=>!e.nexusMapsTo.length)}async function jD(t){return J(t,"DT_PROP_LAST",1,2,e=>!e.nexusMapsTo.length)}async function UD(t){return J(t,"DT_PROP_LEN",1,2,e=>!e.nexusMapsTo.length)}async function HD(t){return J(t,"DT_PROP_LEN_OR",1,2,e=>!e.nexusMapsTo.length)}async function VD(t){return J(t,"DT_PROP_OR",1,2,e=>!e.nexusMapsTo.length)}async function zD(t){return J(t,"DT_STRING_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function WD(t){return J(t,"DT_STRING_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function GD(t){return J(t,"DT_STRING_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function KD(t){return J(t,"DT_STRING_UNQUOTED",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function YD(t){return J(t,"DT_STRING_UNQUOTED_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function XD(t){return J(t,"DT_STRING_UNQUOTED_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function JD(t){return J(t,"DT_STRING_UPPER_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}async function QD(t){return J(t,"DT_STRING_UPPER_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ne)})}async function ZD(t){return J(t,"DT_STRING_UPPER_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ne})}var jc=$(H());async function eA({macro:t,context:e}){return t.parent?.macro==="DT_ON_BUS"&&t.argIndexInParent===1?e.bindingLoader?.getBusTypes().map(r=>({label:ee(r),kind:jc.CompletionItemKind.Enum}))??[]:t.macro&&"DT_ON_BUS".startsWith(t.macro)?[{label:"DT_ON_BUS(...)",insertText:"DT_ON_BUS($1, $2)",kind:jc.CompletionItemKind.Function,insertTextFormat:jc.InsertTextFormat.Snippet}]:[]}async function tA(t){return J(t,"DT_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}async function rA(t){return J(t,"DT_HAS_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}var LU=["DT_BUS","DT_CHILD_NUM","DT_CHILD_NUM_STATUS_OKAY","DT_GPARENT","DT_HAS_ALIAS","DT_NODE_CHILD_IDX","DT_NODE_FULL_NAME","DT_NODE_FULL_NAME_TOKEN","DT_NODE_FULL_NAME_UNQUOTED","DT_NODE_FULL_NAME_UPPER_TOKEN","DT_NODE_HASH","DT_NODE_PATH","DT_NODELABEL_STRING_ARRAY","DT_PARENT"];async function nA(t,e,r){if(!r)return[];let n=Pi(r,t.position);return n?(await Promise.all([eA,tA,rA,WC,dD,fD,pD,qU,hD,mD,yD,TD,bD,vD,SD,ND,_D,kD,ED,DD,AD,PD,aa,OD,yp,ID,xD,qD,LD,$D,MD,BD,FD,jD,UD,HD,VD,zD,WD,GD,KD,YD,XD,JD,QD,ZD].flatMap(async i=>await i({document:r,context:e,macro:n,position:t.position})))).flat():[]}function qU({macro:t}){return t.macro?LU.filter(e=>e.startsWith(t.macro)).map(e=>({label:`${e}(...)`,insertText:`${e}($1)`,kind:Tp.CompletionItemKind.Function,insertTextFormat:Tp.InsertTextFormat.Snippet})):[]}var ii=$(H());function $U(t){if(!t||t.item===null||!(t.ast instanceof et))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if(i instanceof Ye)return ii.Location.create(he(i.uri),fe(i.propertyName??i));if(i instanceof ht)return ii.Location.create(he(i.uri),fe(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof et)return r(e(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function BU(t){if(!t)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===r)return!0}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&(o.by.nodeNameOrRef instanceof Me?o.by.nodeNameOrRef!==t.ast:!r.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedRefLabels,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof St)return ii.Location.create(he(o.uri),fe(o.name??o));if(o instanceof He)return ii.Location.create(he(o.uri),fe(o.name??o));if(o instanceof Me)return ii.Location.create(he(o.uri),fe(o));if(o instanceof Me)return ii.Location.create(he(o.uri),fe(o));if(o instanceof ie)return ii.Location.create(he(o.uri),fe(o.label??o));if(o instanceof Ye)return ii.Location.create(he((o.values??o)?.uri),fe(o.values??o))}).filter(o=>o)};if(t.item instanceof X&&!Ut(t.ast))return e(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return Ut(t.ast)?[...e(t.ast.linksTo),ii.Location.create(he(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return e(r)}return[]}async function iA(t,e){return _t(t,e,r=>[...BU(r),...$U(r)])}var Ei=$(H());function sA(t){if(!t||t.item===null||!(t.ast instanceof et))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if((i instanceof Ye||i instanceof ht)&&i.propertyName)return Ei.Location.create(he(i.uri),fe(i.propertyName))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof et)return r(e(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function oA(t,e){if(!e||!(e.ast instanceof Zt))return[];"newName"in t&&(e.ast.parentNode instanceof ie&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof Qi&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let r=e.ast.value,n=i=>[...i.definitions.filter(s=>s instanceof He).flatMap(s=>s.labels.map(o=>o.label)),...i.referencedBy.flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===r).map(s=>{if(s)return Ei.Location.create(he(s.uri),fe(s))}).filter(s=>s);return e.item instanceof X&&!Ut(e.ast)?n(e.item):e.ast instanceof Zt&&e.ast.parentNode instanceof ie&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function aA(t){if(!t||!(t.ast instanceof Me)||t.ast instanceof Me&&t.ast.linksTo===t.runtime.rootNode)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=t.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(r)||c===r)return!0}}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof He&&o.name)return Ei.Location.create(he(o.uri),fe(o.name));if(o instanceof Me)return Ei.Location.create(he(o.uri),fe(o));if(o instanceof Ye&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof ne){let a=o.values.values[0].value,c=fe(a),l=a.value.split("/"),u=r.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,Ei.Location.create(he(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof X&&!Ut(t.ast)?e(t.item):t.ast instanceof Me&&t.ast.linksTo?Ut(t.ast)?[...e(t.ast.linksTo),Ei.Location.create(he(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo):[]}async function cA(t,e){let r={};return(await _t(t,e,i=>[...aA(i),...oA(t,i),...sA(i)])).forEach(i=>{r[i.uri]??=[],r[i.uri].push(Ei.TextEdit.replace(i.range,t.newName))}),{changes:r}}async function lA(t,e){let r=await _t(t,e,n=>[...aA(n),...oA(t,n),...sA(n)]);if(r.some(n=>e?.settings.lockRenameEdits?.some(i=>Re(n.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var ca=$(H());var vp=t=>[...t.definitions,...t.referencedBy].map(e=>{if(e instanceof St)return ca.Location.create(he(e.uri),fe(e));if(e instanceof He)return ca.Location.create(he(e.uri),fe(e));if(e instanceof Wt)return ca.Location.create(he(e.uri),fe(e))}).filter(e=>e),dA=t=>t.replacedBy?dA(t.replacedBy):t,uA=t=>[t.ast,...t.allReplaced.map(e=>e.ast)].map(e=>{if(e instanceof Ye)return ca.Location.create(he(e.uri),fe(e.propertyName??e))}).filter(e=>e);function FU(t){if(!t||t.item===null||!(t.ast instanceof et))return[];if(t.item instanceof Xe&&t.ast instanceof et)return uA(dA(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let e=t.item.deletedProperties.find(r=>r.by===t.ast.parentNode)?.property;if(e)return uA(e)}return[]}function jU(t){if(!t)return[];if(t.item instanceof X&&!Ut(t.ast))return vp(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return vp(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return vp(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return vp(e)}return[]}function UU(t){if(t?.ast instanceof Ct||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return[ca.Location.create(he(e.macro.uri),fe(e.macro.identifier))]}return[]}async function fA(t,e){return _t(t,e,r=>[...jU(r),...FU(r),...UU(r)])}var Uc=$(H());var as=t=>{let e=t.definitions.at(0);return e?Uc.Location.create(he(e.uri),fe(e)):void 0},bp=t=>t.replaces?bp(t.replaces):t,_p=t=>{let e=bp(t);return e?Uc.Location.create(he(e.ast.uri),fe(e.ast)):void 0};function HU(t){if(!t||t.item===null||!(t.ast instanceof et))return;let e=r=>Uc.Location.create(he(r.ast.uri),fe(r.ast.propertyName??r.ast));if(t.item instanceof Xe&&t.ast instanceof et)return e(bp(t.item));if(t.item instanceof X&&t.ast instanceof et&&t.ast.parentNode instanceof ht){let r=t.item.deletedProperties.find(n=>n.by===t.ast.parentNode)?.property;if(r)return e(bp(r))}}function VU(t){if(t){if(t.item instanceof X&&!Ut(t.ast))return as(t.item);if(t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo)return as(t.ast.parentNode.linksTo);if(t.ast instanceof Me&&t.ast.linksTo)return as(t.ast.linksTo);if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return as(e)}}}function zU(t){if(t?.ast instanceof Ct||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return Uc.Location.create(he(e.macro.uri),fe(e.macro.identifier))}}async function pA(t,e){return(await _t(t,e,r=>[VU(r)||HU(r)||zU(r)])).at(0)}var WU=["DT_PROP","DT_PROP_LEN","DT_PROP_LEN_OR","DT_PROP_HAS_IDX","DT_PROP_HAS_NAME","DT_PROP_BY_IDX","DT_PROP_LAST","DT_PROP_OR","DT_ENUM_IDX_BY_IDX","DT_ENUM_IDX","DT_ENUM_IDX_BY_IDX_OR","DT_ENUM_IDX_OR","DT_ENUM_HAS_VALUE_BY_IDX","DT_ENUM_HAS_VALUE","DT_STRING_TOKEN","DT_STRING_TOKEN_OR","DT_STRING_UPPER_TOKEN","DT_STRING_UPPER_TOKEN_OR","DT_STRING_UNQUOTED","DT_STRING_UNQUOTED_OR","DT_STRING_TOKEN_BY_IDX","DT_STRING_UPPER_TOKEN_BY_IDX","DT_STRING_UNQUOTED_BY_IDX","DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR","DT_PROP_BY_PHANDLE","DT_PHA_BY_IDX","DT_PHA_BY_IDX_OR","DT_PHA","DT_PHA_OR","DT_PHA_BY_NAME","DT_PHA_BY_NAME_OR","DT_PHANDLE_BY_NAME","DT_PHANDLE_BY_IDX","DT_PHANDLE"];async function Sp({macro:t,document:e,context:r,position:n}){if(WU.some(i=>i===t.parent?.macro)&&t.argIndexInParent===1&&t.parent?.args?.[0])return(await x({document:e,context:r,position:n,macro:t.parent.args[0]}))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===2&&t.parent?.args?.[0]&&t.parent?.args?.[1])return(await os({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE",args:t.parent.args.slice(0,2)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===3&&t.parent?.args?.[0]&&t.parent?.args?.[1]&&t.parent?.args?.[3])return(await ni({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE_BY_IDX",args:t.parent.args.slice(0,3)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_CHOSEN","DT_HAS_CHOSEN"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===0&&t.parent?.args?.[0])return(await r.getRuntime()).rootNode.getChild(["/","chosen"])?.properties.find(i=>ee(i.name)===t.macro)}async function hA(t,e,r){if(!r)return;let n=Pi(r,t.position);return mA(n,t.position,e,r)}async function mA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return as(i);let s=await Sp({document:n,macro:t,context:r,position:e});if(s)return _p(s);let o=await is(n,t.macro,e,r);if(o)return mA(o[0],o[1],r,n)}async function gA(t,e,r){if(!r)return;let n=Pi(r,t.position);return yA(n,t.position,e,r)}async function yA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return as(i);let s=await Sp({document:n,macro:t,context:r,position:e});if(s)return _p(s);let o=await is(n,t.macro,e,r);if(o)return yA(o[0],o[1],r,n)}var ue=$(H());var GU=(t,e,r,n,i)=>{switch(r){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(ue.Range.create(ue.Position.create(n.range.start.line,t.pos.colEnd),ue.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},KU=(t,e,r,n,i)=>{if(!n?.length)return[];switch(t){case 0:return[{title:i??`Add Property "${n[0].newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 36:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 25:return n?[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}]:[];default:return}},YU=(t,e,r,n)=>r?.length?[{title:n??"TODO",diagnostics:[t],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[e]:r}}}]:[];function TA(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.type){case"FormattingIssues":return YU(a,t.textDocument.uri,c.edit?Array.isArray(c.edit)?c.edit:[c.edit]:void 0,c.codeActionTitle);case"SyntaxIssue":return c?.items.flatMap(l=>GU(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.items.flatMap(l=>KU(l,a,t.textDocument.uri,c.edit?Array.isArray(c.edit)?c.edit:[c.edit]:void 0,c.codeActionTitle))}}).filter(a=>!!a),r=e.filter(a=>a.kind===ue.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==ue.CodeActionKind.SourceFixAll),s=r.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[t.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)}),[...i,...r.map(a=>({...a,kind:ue.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var vA=$(H());var Np=t=>!t||t instanceof Ye?!1:t instanceof vr||Np(t.parentNode);function XU(t){if(!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken))return[];let e=Np(t?.ast);if(!e&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!Np(t.beforeAst)&&!Np(t.afterAst))return[];let r=-1;if(t.item.ast.values===null?r=0:r=(t.item.ast.values?.values.findIndex(i=>i&&qy(i,t.beforeAst))??-1)+1,r===-1&&(r=0),t.item.name==="compatible"){let s=t.item.parent.nodeTypes.filter(c=>c).at(-1),o=t.item.ast.quickValues,a;return s instanceof Nt&&s.extends.size&&(a=Array.from(s.extends).filter(c=>!o||!o.includes(c))),o?.filter(c=>c)?.length&&!a?[]:(a??=t.runtime.context.bindingLoader?.getBindings()??[],a.filter(c=>!o||!o.includes(c)).map(c=>({label:`"${c}"`,kind:vA.CompletionItemKind.Variable,insertText:e?c:`"${c}"`})))}let n=t.item.parent.nodeType;return n instanceof Nt?n.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,r,e)??[]:[]}function JU(t){if(!t||!(t.item instanceof Xe&&t.ast instanceof et&&t.item.ast.values==null||t.item instanceof X)||Ut(t.ast)||t.beforeAst?.parentNode instanceof Tr)return[];let e=r=>r.nodeType?.getPropertyListCompletionItems(r)??[];return t.item instanceof Xe?e(t.item.parent):e(t.item)}async function bA(t,e){return _t(t,e,r=>[...XU(r),...JU(r)])}var kp=$(H());async function QU(t){if(t?.ast instanceof Ct||t?.ast instanceof Jn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ct?t.ast.name:t.ast.value);if(e){let r=yc(t.ast),n=(await t.runtime.context.getAllParsers()).at(-1);if(r){let i=r?.evaluate(n.cPreprocessorParser.macros);return{contents:{kind:kp.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
286
286
  `)},range:fe(t.ast)}}return{contents:{kind:kp.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t.ast?.evaluate(n.cPreprocessorParser.macros)}`,"```"].join(`
287
287
  `)},range:fe(t.ast)}}}}async function ZU(t){if(!t)return;let e=(await t.runtime.context.getAllParsers()).at(-1);if(t?.ast instanceof Me){let r=t.ast.linksTo;if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.ast.parentNode instanceof ie){let r=t.ast.parentNode.linksTo;if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.ast instanceof ne&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.item instanceof X)return{contents:t.item.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}function eH(t){if(t?.item instanceof Xe&&t.ast instanceof et){let e=t.item.onHover(),r=t.item.parent.nodeType?.getOnPropertyHover(t.item.name);if(e||r)return{contents:{kind:kp.MarkupKind.Markdown,value:`${e?.value??""}
288
- ${r?.value??""}`},range:fe(t.ast)}}}function _A(t,e){return _t(t,e,async r=>[await ZU(r)||eH(r)||await QU(r)])}async function SA(t){let e=await Wf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function NA(t){let e=await Gf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var PA=$(H());async function kA(t){return t?.nodes.length??0}async function RA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return kA(s)}async function EA(t){let e=await RA(t,x);return e!==void 0?{contents:{kind:PA.MarkupKind.Markdown,value:e.toString()}}:void 0}async function wA(t){let e=await lT(t);if(e)return e?.length?{contents:{kind:rs.Markdown,value:e.map((r,n)=>{let i=r.toMarkupContent(t.context.macros);return`## Node ${n+1}
288
+ ${r?.value??""}`},range:fe(t.ast)}}}function _A(t,e){return _t(t,e,async r=>[await ZU(r)||eH(r)||await QU(r)])}async function SA(t){let e=await Wf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function NA(t){let e=await Gf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var PA=$(H());async function kA(t){return t?.nodes.length??0}async function RA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return kA(s)}async function wA(t){let e=await RA(t,x);return e!==void 0?{contents:{kind:PA.MarkupKind.Markdown,value:e.toString()}}:void 0}async function EA(t){let e=await lT(t);if(e)return e?.length?{contents:{kind:rs.Markdown,value:e.map((r,n)=>{let i=r.toMarkupContent(t.context.macros);return`## Node ${n+1}
289
289
 
290
290
  ${i.value}
291
291
  `}).join(`
292
292
 
293
- `)}}:{contents:{kind:rs.Markdown,value:`No node matched compat ${t.macro.args[0].macro}`}}}async function DA(t){let e=await Yf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function CA(t,e){return!!await zf(t,e)}async function AA({macro:t,context:e}){if(!(t.macro!=="DT_HAS_ALIAS"||t.args?.length!==1))return CA(t.args[0].macro,e)}async function OA(t){let e=await AA(t);if(e!==void 0)return{contents:{kind:rs.Markdown,value:e?"1":"0"}}}var MA=$(H());async function Hc(t,e){if(t)switch(e){case"Unquoted":return t.fullName;case"Quoted":return`"${t.fullName}"`;case"Token":return ee(t.fullName);case"Upper Token":return ee(t.fullName).toUpperCase()}}async function IA({document:t,macro:e,context:r,position:n},i){if(e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});switch(e.macro){case"DT_NODE_FULL_NAME":return Hc(s,"Quoted");case"DT_NODE_FULL_NAME_TOKEN":return Hc(s,"Token");case"DT_NODE_FULL_NAME_UNQUOTED":return Hc(s,"Unquoted");case"DT_NODE_FULL_NAME_UPPER_TOKEN":return Hc(s,"Upper Token")}}async function xA(t){let e=await IA(t,x);if(e)return{contents:{kind:MA.MarkupKind.Markdown,value:e}}}var $A=$(H());async function LA(t){return t?.pathString}async function qA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODE_PATH"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return LA(s)}async function BA(t){let e=await qA(t,x);if(e)return{contents:{kind:$A.MarkupKind.Markdown,value:`"${e}"`}}}async function FA(t){let e=await Xf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var HA=$(H());async function jA(t){return t?.labels.map(e=>e.label)}async function UA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODELABEL_STRING_ARRAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return jA(s)}async function VA(t){let e=await UA(t,x);if(e)return{contents:{kind:HA.MarkupKind.Markdown,value:`{ ${e.map(r=>`"${r}"`).join(", ")} }`}}}async function zA(t){let e=await Jf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function WA(t){let e=await Zf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var YA=$(H());async function GA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_SAME_NODE"||e.args?.length!==2)return;if(await r?.getRuntime()){let o=await i({document:t,macro:e.args[0],context:r,position:n}),a=await i({document:t,macro:e.args[1],context:r,position:n});return!!a&&!!o&&a===o}}async function KA(t){let e=await GA(t,x);if(e!==void 0)return{contents:{kind:YA.MarkupKind.Markdown,value:e?"1":"0"}}}var JA=$(H());async function XA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return await ia(o,s[1].macro,a)}async function QA(t){let e=await XA(t,x);return e?{contents:{kind:JA.MarkupKind.Markdown,value:e.toString()}}:void 0}var e0=$(H());async function ZA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return ss(o,s[1].macro,a,s[3].macro,r)}async function t0(t){let e=await ZA(t,x);return e?{contents:{kind:e0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function r0(t){let e=await ni(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function n0(t){let e=await op(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var Vc=$(H());async function st(t,e){if(e){if(typeof e=="boolean")return{contents:{kind:Vc.MarkupKind.Markdown,value:e?"1":"0"}};if(typeof e=="string")return{contents:{kind:Vc.MarkupKind.Markdown,value:e}};if(e instanceof X)return{contents:e.toMarkupContent(t.macros)};if(e.length===1&&e[0]instanceof X)return{contents:e[0].toMarkupContent(t.macros)};if(e.every(r=>typeof r=="number"))return{contents:{kind:Vc.MarkupKind.Markdown,value:e.length===1?e[0].toString():`{${e.join(", ")}}`}};if(e.every(r=>typeof r=="string"))return{contents:{kind:Vc.MarkupKind.Markdown,value:e.length===1?`"${e[0]}"`:`{${e.map(r=>`"${r}"`).join(", ")}}`}}}}async function i0(t){let e=await Bf(t,x);return st(t.context,e)}var dT=$(H());async function s0(t){let e=await Ff(t,x);if(e===!0)return{contents:{kind:dT.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof X?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:dT.MarkupKind.Markdown,value:e.toString()}}}async function o0(t){let e=await na(t,x);return st(t.context,e)}async function a0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX"||e.args?.length!==4)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return await ur(s,e.args[3].macro,r)}async function c0(t){return st(t.context,await a0(t,x))}async function l0(t){let e=await ep(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var f0=$(H());async function u0(t){return t?.nodes.filter(e=>!e.disabled).length??0}async function d0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM_STATUS_OKAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return u0(s)}async function p0(t){let e=await d0(t,x);return e!==void 0?{contents:{kind:f0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function h0(t){let e=await os(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var g0=$(H());async function m0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ss(o,s[1].macro,0,s[2].macro,r)}async function y0(t){let e=await m0(t,x);return e?{contents:{kind:g0.MarkupKind.Markdown,value:e.toString()}}:void 0}var T0=$(H());async function v0(t){let e=await ip(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:T0.MarkupKind.Markdown,value:e.toString()}}:void 0}var _0=$(H());async function b0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ss(o,s[1].macro,s[2].macro,s[3].macro,r)}async function S0(t){let e=await b0(t,x);return e?{contents:{kind:_0.MarkupKind.Markdown,value:e.toString()}}:void 0}var N0=$(H());async function k0(t){let e=await sp(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:N0.MarkupKind.Markdown,value:e.toString()}}:void 0}var R0=$(H());async function P0(t){let e=await ap(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:R0.MarkupKind.Markdown,value:e.toString()}}:void 0}var E0=$(H());async function w0(t){let e=await rp(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:E0.MarkupKind.Markdown,value:e.toString()}}:void 0}var C0=$(H());async function D0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await ia(o,s[1].macro,0)}async function A0(t){let e=await D0(t,x);return e?{contents:{kind:C0.MarkupKind.Markdown,value:e.toString()}}:void 0}var O0=$(H());async function I0(t){let e=await np(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:O0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function M0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE"||e.args?.length!==3)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro);return ur(s,e.args[2].macro,r)}async function x0(t){return st(t.context,await M0(t,x))}async function L0(t){return st(t.context,await cp(t,x))}var B0=$(H());var q0=$(require("util"));async function Rp(t,e,r,n){let i=t?.properties.find(o=>ee(o.name)===e);if(!i)return;let s=i?.ast.quickValues?.at(r);if(s!==void 0)return q0.default.isDeepStrictEqual(De(n),s)}async function $0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await Rp(o,s[1].macro,0,s[2].macro)}async function F0(t){let e=await $0(t,x);return e!==void 0?{contents:{kind:B0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var U0=$(H());async function j0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return await Rp(o,s[1].macro,a,s[3].macro)}async function H0(t){let e=await j0(t,x);return e!==void 0?{contents:{kind:U0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var W0=$(H());async function V0(t,e,r,n){let i=await ur(t,e,n);if(i===void 0)return!1;if(r=typeof r=="number"?r:De(r??"0"),typeof r=="number")return Array.isArray(i)?i.length<r:r===0}async function z0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_IDX"||s?.length!==3?void 0:!!await V0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function G0(t){let e=await z0(t,x);return e===void 0?void 0:{contents:{kind:W0.MarkupKind.Markdown,value:e?"1":"0"}}}var X0=$(H());async function Y0(t,e,r,n){let i=t?.properties.find(u=>ee(u.name)===e),s=i?.parent.nodeType;if(!s||!(s instanceof Nt)||await ur(t,e,n)===void 0)return;let a=i.nexusMapsTo.at(0)?.specifierSpace,l=(a?i.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.findIndex(u=>typeof u=="string"&&u.toLowerCase()===r)??-1;return l===-1?void 0:l}async function K0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_NAME"||s?.length!==3?void 0:!!await Y0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function J0(t){let e=await K0(t,x);return e===void 0?void 0:{contents:{kind:X0.MarkupKind.Markdown,value:e?"1":"0"}}}async function Q0(t){let e=await Kf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var eO=$(H());async function Z0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?lp(o,s[1].macro):void 0}async function tO(t){let e=await Z0(t,x);return e?{contents:{kind:eO.MarkupKind.Markdown,value:e.toString()}}:void 0}var rO=$(H());async function nO(t){let e=await up(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:rO.MarkupKind.Markdown,value:e.toString()}}:void 0}var fT=$(H());async function iO(t,e,r){let n=await ur(t,e,r);if(n===!0)return!0;if(!n)return;let i=n.at(-1);if(i)return n.length===1&&n[0]instanceof X?n[0]:i}async function sO({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_LAST"||e.args?.length!==2))return iO(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,r)}async function oO(t){let e=await sO(t,x);if(e===!0)return{contents:{kind:fT.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof X?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:fT.MarkupKind.Markdown,value:e.toString()}}}var cO=$(H());async function aO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?oa(o,s[1].macro):void 0}async function lO(t){let e=await aO(t,x);if(e)return{contents:{kind:cO.MarkupKind.Markdown,value:e.toString()}}}var dO=$(H());async function Pp(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ne)return ee(i[r].value)}async function uO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return o?Pp(o,s[1].macro,a):void 0}async function fO(t){let e=await uO(t,x);if(e)return{contents:{kind:dO.MarkupKind.Markdown,value:e.toString()}}}var pO=$(H());async function hO(t){let e=await dp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:pO.MarkupKind.Markdown,value:e.toString()}}}var yO=$(H());async function mO(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ne)return i[r].value}async function gO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return o?mO(o,s[1].macro,a):void 0}async function TO(t){let e=await gO(t,x);if(e)return{contents:{kind:yO.MarkupKind.Markdown,value:e.toString()}}}var bO=$(H());async function vO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?fp(o,s[1].macro):void 0}async function _O(t){let e=await vO(t,x);if(e)return{contents:{kind:bO.MarkupKind.Markdown,value:e.toString()}}}var SO=$(H());async function NO(t){let e=await pp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:SO.MarkupKind.Markdown,value:e.toString()}}}var PO=$(H());async function kO(t,e,r){return(await Pp(t,e,r))?.toUpperCase()}async function RO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=De(s[2].macro);if(typeof a=="number")return o?kO(o,s[1].macro,a):void 0}async function EO(t){let e=await RO(t,x);if(e)return{contents:{kind:PO.MarkupKind.Markdown,value:e.toString()}}}var DO=$(H());async function wO({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?hp(o,s[1].macro):void 0}async function CO(t){let e=await wO(t,x);if(e)return{contents:{kind:DO.MarkupKind.Markdown,value:e.toString()}}}var AO=$(H());async function OO(t){let e=await mp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:AO.MarkupKind.Markdown,value:e.toString()}}}async function IO(t){let e=await Uf(t,x);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var LO=$(H());async function MO(t,e){if(!t)return;let r=t.nodeType?.onBus;return r?ee(r)===e:!1}async function xO(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_ON_BUS"||r?.length!==2)return;let n=await e({...t,macro:r[0]});return await MO(n,r[1].macro)}async function qO(t){let e=await xO(t,x);return e!==void 0?{contents:{kind:LO.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function $O(t){let e=await Vf(t);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var jO=$(H());async function BO(t,e){return!!await Hf(t,e)}async function FO(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_HAS_CHOSEN"||e?.length!==1))return await BO(t.context,e[0].macro)}async function UO(t){let e=await FO(t);return e!==void 0?{contents:{kind:jO.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function tH(t){return[IO,qO,$O,UO,SA,NA,EA,p0,wA,DA,OA,Q0,l0,WA,BA,xA,FA,VA,zA,KA].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function rH(t){return[H0,F0,QA,w0,A0,I0,t0,v0,S0,k0,y0,r0,n0,h0,P0,s0,x0,c0,L0,G0,J0,i0,oO,tO,nO,o0,fO,lO,hO,TO,_O,NO,EO,CO,OO].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function HO(t,e,r){if(!r)return;let n=Pi(r,t.position);return VO(n,t.position,e,r)}async function VO(t,e,r,n){if(!t?.macro)return;let i=await tH({position:e,context:r,document:n,macro:t})||await rH({position:e,context:r,document:n,macro:t});if(i)return i;let s=await x({document:n,macro:t,context:r,position:e});if(s)return{contents:s.toMarkupContent(r.macros)};let o=await is(n,t.macro,e,r);if(o)return VO(o[0],o[1],r,n)}var fS=require("path"),pS=require("fs");var dI=$(nI(),1);var Wc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var uH={"[: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]},Gc=t=>t.replace(/[[\]\\-]/g,"\\$&"),dH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iI=t=>t.join(""),sI=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,d="";e:for(;s<t.length;){let h=t.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[T,[S,_,v]]of Object.entries(uH))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-r,!0];s+=T.length,v?i.push(S):n.push(S),a=a||_;continue e}}if(c=!1,d){h>d?n.push(Gc(d)+"-"+Gc(h)):h===d&&n.push(Gc(h)),d="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Gc(h+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=h,s+=2;continue}n.push(Gc(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[dH(h),!1,u-r,!1]}let f="["+(l?"^":"")+iI(n)+"]",p="["+(l?"":"^")+iI(i)+"]";return[n.length&&i.length?"("+f+"|"+p+")":n.length?f:p,a,u-r,!0]};var Mn=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var fH=new Set(["!","?","+","*","@"]),oI=t=>fH.has(t),pH="(?!(?:^|/)\\.\\.?(?:$|/))",Ep="(?!\\.)",hH=new Set(["[","."]),mH=new Set(["..","."]),gH=new Set("().*{}+?[]^$\\!"),yH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mT="[^/]",aI=mT+"*?",cI=mT+"+?",la=class t{type;#e;#t;#n=!1;#r=[];#o;#f;#a;#d=!1;#c;#l;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,e==="!"&&!this.#e.#d&&this.#a.push(this),this.#f=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#l=this.#r.map(e=>String(e)).join("")}#y(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,n=r.#o;for(;n;){for(let i=r.#f+1;!n.type&&i<n.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#r[i])}r=n,n=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#r.push(r)}}toJSON(){let e=this.type===null?this.#r.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#r.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#f===0)return!0;let e=this.#o;for(let r=0;r<this.#f;r++){let n=e.#r[r];if(!(n instanceof t&&n.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.#r.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#r)r.copyIn(n);return r}static#T(e,r,n,i){let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let p=n,g="";for(;p<e.length;){let h=e.charAt(p++);if(s||h==="\\"){s=!s,g+=h;continue}if(o){p===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(p===a+2&&c)&&(o=!1),g+=h;continue}else if(h==="["){o=!0,a=p,c=!1,g+=h;continue}if(!i.noext&&oI(h)&&e.charAt(p)==="("){r.push(g),g="";let T=new t(h,r);p=t.#T(e,T,p,i),r.push(T);continue}g+=h}return r.push(g),p}let l=n+1,u=new t(null,r),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(s||p==="\\"){s=!s,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(oI(p)&&e.charAt(l)==="("){u.push(f),f="";let g=new t(p,u);u.push(g),l=t.#T(e,g,l,i);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new t(null,r);continue}if(p===")")return f===""&&r.#r.length===0&&(r.#s=!0),u.push(f),f="",r.push(...d,u),l;f+=p}return r.type=null,r.#t=void 0,r.#r=[e.substring(n-1)],l}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#T(e,n,0,r),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#c}toRegExpSource(e){let r=e??!!this.#c.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(p=>{let[g,h,T,S]=typeof p=="string"?t.#p(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||T,this.#n=this.#n||S,g}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&mH.has(this.#r[0]))){let g=hH,h=r&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),T=!r&&!e&&g.has(l.charAt(0));u=h?pH:T?Ep:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Mn(l),this.#t=!!this.#t,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,Mn(this.toString()),!1,!1]}let o=!n||e||r||!Ep?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?Ep:"")+cI;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Ep:"")+aI+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Mn(s),this.#t=!!this.#t,this.#n]}#h(e){return this.#r.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,s+=(gH.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=sI(e,a);if(d){s+=l,o=o||u,a+=d-1,r=r||f;continue}}if(c==="*"){n&&e==="*"?s+=cI:s+=aI,r=!0;continue}if(c==="?"){s+=mT,r=!0;continue}s+=yH(c)}return[s,Mn(e),!!r,o]}};var ua=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var br=(t,e,r={})=>(Wc(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Gr(e,r).match(t)),TH=/^\*+([^+@!?\*\[\(]*)$/,vH=t=>e=>!e.startsWith(".")&&e.endsWith(t),bH=t=>e=>e.endsWith(t),_H=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),SH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),NH=/^\*+\.\*+$/,kH=t=>!t.startsWith(".")&&t.includes("."),RH=t=>t!=="."&&t!==".."&&t.includes("."),PH=/^\.\*+$/,EH=t=>t!=="."&&t!==".."&&t.startsWith("."),wH=/^\*+$/,DH=t=>t.length!==0&&!t.startsWith("."),CH=t=>t.length!==0&&t!=="."&&t!=="..",AH=/^\?+([^+@!?\*\[\(]*)?$/,OH=([t,e=""])=>{let r=fI([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},IH=([t,e=""])=>{let r=pI([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},MH=([t,e=""])=>{let r=pI([t]);return e?n=>r(n)&&n.endsWith(e):r},xH=([t,e=""])=>{let r=fI([t]);return e?n=>r(n)&&n.endsWith(e):r},fI=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},pI=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},hI=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",lI={win32:{sep:"\\"},posix:{sep:"/"}},LH=hI==="win32"?lI.win32.sep:lI.posix.sep;br.sep=LH;var er=Symbol("globstar **");br.GLOBSTAR=er;var qH="[^/]",$H=qH+"*?",BH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",FH="(?:(?!(?:\\/|^)\\.).)*?",jH=(t,e={})=>r=>br(r,t,e);br.filter=jH;var fn=(t,e={})=>Object.assign({},t,e),UH=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return br;let e=br;return Object.assign((n,i,s={})=>e(n,i,fn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,fn(t,s))}static defaults(i){return e.defaults(fn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,fn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fn(t,s))}},unescape:(n,i={})=>e.unescape(n,fn(t,i)),escape:(n,i={})=>e.escape(n,fn(t,i)),filter:(n,i={})=>e.filter(n,fn(t,i)),defaults:n=>e.defaults(fn(t,n)),makeRe:(n,i={})=>e.makeRe(n,fn(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,fn(t,i)),match:(n,i,s={})=>e.match(n,i,fn(t,s)),sep:e.sep,GLOBSTAR:er})};br.defaults=UH;var mI=(t,e={})=>(Wc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,dI.default)(t));br.braceExpand=mI;var HH=(t,e={})=>new Gr(t,e).makeRe();br.makeRe=HH;var VH=(t,e,r={})=>{let n=new Gr(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};br.match=VH;var uI=/[?*]|[+@!]\(.*?\)|\[|\]/,zH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Gr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){Wc(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||hI,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!uI.test(s[2]))&&!uI.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,i),this.set=i.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 n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!h&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),_=!S&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),v=T?3:h?0:void 0,R=_?3:S?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[D,B]=[e[v],r[R]];D.toLowerCase()===B.toLowerCase()&&(r[R]=D,R>v?r=r.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,c=e.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],d=e[o];if(this.debug(r,u,d),u===!1)return!1;if(u===er){this.debug("GLOBSTAR",[r,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var g=e[f];if(this.debug(`
293
+ `)}}:{contents:{kind:rs.Markdown,value:`No node matched compat ${t.macro.args[0].macro}`}}}async function CA(t){let e=await Kf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function DA(t,e){return!!await zf(t,e)}async function AA({macro:t,context:e}){if(!(t.macro!=="DT_HAS_ALIAS"||t.args?.length!==1))return DA(t.args[0].macro,e)}async function IA(t){let e=await AA(t);if(e!==void 0)return{contents:{kind:rs.Markdown,value:e?"1":"0"}}}var MA=$(H());async function Hc(t,e){if(t)switch(e){case"Unquoted":return t.fullName;case"Quoted":return`"${t.fullName}"`;case"Token":return ee(t.fullName);case"Upper Token":return ee(t.fullName).toUpperCase()}}async function OA({document:t,macro:e,context:r,position:n},i){if(e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});switch(e.macro){case"DT_NODE_FULL_NAME":return Hc(s,"Quoted");case"DT_NODE_FULL_NAME_TOKEN":return Hc(s,"Token");case"DT_NODE_FULL_NAME_UNQUOTED":return Hc(s,"Unquoted");case"DT_NODE_FULL_NAME_UPPER_TOKEN":return Hc(s,"Upper Token")}}async function xA(t){let e=await OA(t,x);if(e)return{contents:{kind:MA.MarkupKind.Markdown,value:e}}}var $A=$(H());async function LA(t){return t?.pathString}async function qA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODE_PATH"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return LA(s)}async function BA(t){let e=await qA(t,x);if(e)return{contents:{kind:$A.MarkupKind.Markdown,value:`"${e}"`}}}async function FA(t){let e=await Xf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var HA=$(H());async function jA(t){return t?.labels.map(e=>e.label)}async function UA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODELABEL_STRING_ARRAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return jA(s)}async function VA(t){let e=await UA(t,x);if(e)return{contents:{kind:HA.MarkupKind.Markdown,value:`{ ${e.map(r=>`"${r}"`).join(", ")} }`}}}async function zA(t){let e=await Jf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function WA(t){let e=await Zf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var KA=$(H());async function GA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_SAME_NODE"||e.args?.length!==2)return;if(await r?.getRuntime()){let o=await i({document:t,macro:e.args[0],context:r,position:n}),a=await i({document:t,macro:e.args[1],context:r,position:n});return!!a&&!!o&&a===o}}async function YA(t){let e=await GA(t,x);if(e!==void 0)return{contents:{kind:KA.MarkupKind.Markdown,value:e?"1":"0"}}}var JA=$(H());async function XA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return await ia(o,s[1].macro,a)}async function QA(t){let e=await XA(t,x);return e?{contents:{kind:JA.MarkupKind.Markdown,value:e.toString()}}:void 0}var e0=$(H());async function ZA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return ss(o,s[1].macro,a,s[3].macro,r)}async function t0(t){let e=await ZA(t,x);return e?{contents:{kind:e0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function r0(t){let e=await ni(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function n0(t){let e=await op(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var Vc=$(H());async function st(t,e){if(e){if(typeof e=="boolean")return{contents:{kind:Vc.MarkupKind.Markdown,value:e?"1":"0"}};if(typeof e=="string")return{contents:{kind:Vc.MarkupKind.Markdown,value:e}};if(e instanceof X)return{contents:e.toMarkupContent(t.macros)};if(e.length===1&&e[0]instanceof X)return{contents:e[0].toMarkupContent(t.macros)};if(e.every(r=>typeof r=="number"))return{contents:{kind:Vc.MarkupKind.Markdown,value:e.length===1?e[0].toString():`{${e.join(", ")}}`}};if(e.every(r=>typeof r=="string"))return{contents:{kind:Vc.MarkupKind.Markdown,value:e.length===1?`"${e[0]}"`:`{${e.map(r=>`"${r}"`).join(", ")}}`}}}}async function i0(t){let e=await Bf(t,x);return st(t.context,e)}var dT=$(H());async function s0(t){let e=await Ff(t,x);if(e===!0)return{contents:{kind:dT.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof X?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:dT.MarkupKind.Markdown,value:e.toString()}}}async function o0(t){let e=await na(t,x);return st(t.context,e)}async function a0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX"||e.args?.length!==4)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return await ur(s,e.args[3].macro,r)}async function c0(t){return st(t.context,await a0(t,x))}async function l0(t){let e=await ep(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var f0=$(H());async function u0(t){return t?.nodes.filter(e=>!e.disabled).length??0}async function d0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM_STATUS_OKAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return u0(s)}async function p0(t){let e=await d0(t,x);return e!==void 0?{contents:{kind:f0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function h0(t){let e=await os(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var g0=$(H());async function m0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ss(o,s[1].macro,0,s[2].macro,r)}async function y0(t){let e=await m0(t,x);return e?{contents:{kind:g0.MarkupKind.Markdown,value:e.toString()}}:void 0}var T0=$(H());async function v0(t){let e=await ip(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:T0.MarkupKind.Markdown,value:e.toString()}}:void 0}var _0=$(H());async function b0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ss(o,s[1].macro,s[2].macro,s[3].macro,r)}async function S0(t){let e=await b0(t,x);return e?{contents:{kind:_0.MarkupKind.Markdown,value:e.toString()}}:void 0}var N0=$(H());async function k0(t){let e=await sp(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:N0.MarkupKind.Markdown,value:e.toString()}}:void 0}var R0=$(H());async function P0(t){let e=await ap(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:R0.MarkupKind.Markdown,value:e.toString()}}:void 0}var w0=$(H());async function E0(t){let e=await rp(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:w0.MarkupKind.Markdown,value:e.toString()}}:void 0}var D0=$(H());async function C0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await ia(o,s[1].macro,0)}async function A0(t){let e=await C0(t,x);return e?{contents:{kind:D0.MarkupKind.Markdown,value:e.toString()}}:void 0}var I0=$(H());async function O0(t){let e=await np(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:I0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function M0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE"||e.args?.length!==3)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro);return ur(s,e.args[2].macro,r)}async function x0(t){return st(t.context,await M0(t,x))}async function L0(t){return st(t.context,await cp(t,x))}var B0=$(H());var q0=$(require("util"));async function Rp(t,e,r,n){let i=t?.properties.find(o=>ee(o.name)===e);if(!i)return;let s=i?.ast.quickValues?.at(r);if(s!==void 0)return q0.default.isDeepStrictEqual(Ce(n),s)}async function $0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await Rp(o,s[1].macro,0,s[2].macro)}async function F0(t){let e=await $0(t,x);return e!==void 0?{contents:{kind:B0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var U0=$(H());async function j0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return await Rp(o,s[1].macro,a,s[3].macro)}async function H0(t){let e=await j0(t,x);return e!==void 0?{contents:{kind:U0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var W0=$(H());async function V0(t,e,r,n){let i=await ur(t,e,n);if(i===void 0)return!1;if(r=typeof r=="number"?r:Ce(r??"0"),typeof r=="number")return Array.isArray(i)?i.length<r:r===0}async function z0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_IDX"||s?.length!==3?void 0:!!await V0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function G0(t){let e=await z0(t,x);return e===void 0?void 0:{contents:{kind:W0.MarkupKind.Markdown,value:e?"1":"0"}}}var X0=$(H());async function K0(t,e,r,n){let i=t?.properties.find(u=>ee(u.name)===e),s=i?.parent.nodeType;if(!s||!(s instanceof Nt)||await ur(t,e,n)===void 0)return;let a=i.nexusMapsTo.at(0)?.specifierSpace,l=(a?i.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.findIndex(u=>typeof u=="string"&&u.toLowerCase()===r)??-1;return l===-1?void 0:l}async function Y0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_NAME"||s?.length!==3?void 0:!!await K0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function J0(t){let e=await Y0(t,x);return e===void 0?void 0:{contents:{kind:X0.MarkupKind.Markdown,value:e?"1":"0"}}}async function Q0(t){let e=await Yf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var eI=$(H());async function Z0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?lp(o,s[1].macro):void 0}async function tI(t){let e=await Z0(t,x);return e?{contents:{kind:eI.MarkupKind.Markdown,value:e.toString()}}:void 0}var rI=$(H());async function nI(t){let e=await up(t,x);return e instanceof X?st(t.context,e):e?{contents:{kind:rI.MarkupKind.Markdown,value:e.toString()}}:void 0}var fT=$(H());async function iI(t,e,r){let n=await ur(t,e,r);if(n===!0)return!0;if(!n)return;let i=n.at(-1);if(i)return n.length===1&&n[0]instanceof X?n[0]:i}async function sI({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_LAST"||e.args?.length!==2))return iI(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,r)}async function oI(t){let e=await sI(t,x);if(e===!0)return{contents:{kind:fT.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof X?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:fT.MarkupKind.Markdown,value:e.toString()}}}var cI=$(H());async function aI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?oa(o,s[1].macro):void 0}async function lI(t){let e=await aI(t,x);if(e)return{contents:{kind:cI.MarkupKind.Markdown,value:e.toString()}}}var dI=$(H());async function Pp(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ne)return ee(i[r].value)}async function uI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return o?Pp(o,s[1].macro,a):void 0}async function fI(t){let e=await uI(t,x);if(e)return{contents:{kind:dI.MarkupKind.Markdown,value:e.toString()}}}var pI=$(H());async function hI(t){let e=await dp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:pI.MarkupKind.Markdown,value:e.toString()}}}var yI=$(H());async function mI(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ne)return i[r].value}async function gI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return o?mI(o,s[1].macro,a):void 0}async function TI(t){let e=await gI(t,x);if(e)return{contents:{kind:yI.MarkupKind.Markdown,value:e.toString()}}}var bI=$(H());async function vI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?fp(o,s[1].macro):void 0}async function _I(t){let e=await vI(t,x);if(e)return{contents:{kind:bI.MarkupKind.Markdown,value:e.toString()}}}var SI=$(H());async function NI(t){let e=await pp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:SI.MarkupKind.Markdown,value:e.toString()}}}var PI=$(H());async function kI(t,e,r){return(await Pp(t,e,r))?.toUpperCase()}async function RI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ce(s[2].macro);if(typeof a=="number")return o?kI(o,s[1].macro,a):void 0}async function wI(t){let e=await RI(t,x);if(e)return{contents:{kind:PI.MarkupKind.Markdown,value:e.toString()}}}var CI=$(H());async function EI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?hp(o,s[1].macro):void 0}async function DI(t){let e=await EI(t,x);if(e)return{contents:{kind:CI.MarkupKind.Markdown,value:e.toString()}}}var AI=$(H());async function II(t){let e=await mp(t,x);if(e)return e instanceof X?st(t.context,e):{contents:{kind:AI.MarkupKind.Markdown,value:e.toString()}}}async function OI(t){let e=await Uf(t,x);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var LI=$(H());async function MI(t,e){if(!t)return;let r=t.nodeType?.onBus;return r?ee(r)===e:!1}async function xI(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_ON_BUS"||r?.length!==2)return;let n=await e({...t,macro:r[0]});return await MI(n,r[1].macro)}async function qI(t){let e=await xI(t,x);return e!==void 0?{contents:{kind:LI.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function $I(t){let e=await Vf(t);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var jI=$(H());async function BI(t,e){return!!await Hf(t,e)}async function FI(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_HAS_CHOSEN"||e?.length!==1))return await BI(t.context,e[0].macro)}async function UI(t){let e=await FI(t);return e!==void 0?{contents:{kind:jI.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function tH(t){return[OI,qI,$I,UI,SA,NA,wA,p0,EA,CA,IA,Q0,l0,WA,BA,xA,FA,VA,zA,YA].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function rH(t){return[H0,F0,QA,E0,A0,O0,t0,v0,S0,k0,y0,r0,n0,h0,P0,s0,x0,c0,L0,G0,J0,i0,oI,tI,nI,o0,fI,lI,hI,TI,_I,NI,wI,DI,II].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function HI(t,e,r){if(!r)return;let n=Pi(r,t.position);return VI(n,t.position,e,r)}async function VI(t,e,r,n){if(!t?.macro)return;let i=await tH({position:e,context:r,document:n,macro:t})||await rH({position:e,context:r,document:n,macro:t});if(i)return i;let s=await x({document:n,macro:t,context:r,position:e});if(s)return{contents:s.toMarkupContent(r.macros)};let o=await is(n,t.macro,e,r);if(o)return VI(o[0],o[1],r,n)}var fS=require("path"),pS=require("fs");var dO=$(nO(),1);var Wc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var uH={"[: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]},Gc=t=>t.replace(/[[\]\\-]/g,"\\$&"),dH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iO=t=>t.join(""),sO=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,d="";e:for(;s<t.length;){let h=t.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[T,[S,_,v]]of Object.entries(uH))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-r,!0];s+=T.length,v?i.push(S):n.push(S),a=a||_;continue e}}if(c=!1,d){h>d?n.push(Gc(d)+"-"+Gc(h)):h===d&&n.push(Gc(h)),d="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Gc(h+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=h,s+=2;continue}n.push(Gc(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[dH(h),!1,u-r,!1]}let f="["+(l?"^":"")+iO(n)+"]",p="["+(l?"":"^")+iO(i)+"]";return[n.length&&i.length?"("+f+"|"+p+")":n.length?f:p,a,u-r,!0]};var Mn=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var fH=new Set(["!","?","+","*","@"]),oO=t=>fH.has(t),pH="(?!(?:^|/)\\.\\.?(?:$|/))",wp="(?!\\.)",hH=new Set(["[","."]),mH=new Set(["..","."]),gH=new Set("().*{}+?[]^$\\!"),yH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mT="[^/]",aO=mT+"*?",cO=mT+"+?",la=class t{type;#e;#t;#n=!1;#r=[];#o;#f;#a;#d=!1;#c;#l;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,e==="!"&&!this.#e.#d&&this.#a.push(this),this.#f=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#l=this.#r.map(e=>String(e)).join("")}#y(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,n=r.#o;for(;n;){for(let i=r.#f+1;!n.type&&i<n.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#r[i])}r=n,n=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#r.push(r)}}toJSON(){let e=this.type===null?this.#r.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#r.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#f===0)return!0;let e=this.#o;for(let r=0;r<this.#f;r++){let n=e.#r[r];if(!(n instanceof t&&n.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.#r.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#r)r.copyIn(n);return r}static#T(e,r,n,i){let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let p=n,g="";for(;p<e.length;){let h=e.charAt(p++);if(s||h==="\\"){s=!s,g+=h;continue}if(o){p===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(p===a+2&&c)&&(o=!1),g+=h;continue}else if(h==="["){o=!0,a=p,c=!1,g+=h;continue}if(!i.noext&&oO(h)&&e.charAt(p)==="("){r.push(g),g="";let T=new t(h,r);p=t.#T(e,T,p,i),r.push(T);continue}g+=h}return r.push(g),p}let l=n+1,u=new t(null,r),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(s||p==="\\"){s=!s,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(oO(p)&&e.charAt(l)==="("){u.push(f),f="";let g=new t(p,u);u.push(g),l=t.#T(e,g,l,i);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new t(null,r);continue}if(p===")")return f===""&&r.#r.length===0&&(r.#s=!0),u.push(f),f="",r.push(...d,u),l;f+=p}return r.type=null,r.#t=void 0,r.#r=[e.substring(n-1)],l}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#T(e,n,0,r),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#c}toRegExpSource(e){let r=e??!!this.#c.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(p=>{let[g,h,T,S]=typeof p=="string"?t.#p(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||T,this.#n=this.#n||S,g}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&mH.has(this.#r[0]))){let g=hH,h=r&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),T=!r&&!e&&g.has(l.charAt(0));u=h?pH:T?wp:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Mn(l),this.#t=!!this.#t,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,Mn(this.toString()),!1,!1]}let o=!n||e||r||!wp?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?wp:"")+cO;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?wp:"")+aO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Mn(s),this.#t=!!this.#t,this.#n]}#h(e){return this.#r.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,s+=(gH.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=sO(e,a);if(d){s+=l,o=o||u,a+=d-1,r=r||f;continue}}if(c==="*"){n&&e==="*"?s+=cO:s+=aO,r=!0;continue}if(c==="?"){s+=mT,r=!0;continue}s+=yH(c)}return[s,Mn(e),!!r,o]}};var ua=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var br=(t,e,r={})=>(Wc(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Gr(e,r).match(t)),TH=/^\*+([^+@!?\*\[\(]*)$/,vH=t=>e=>!e.startsWith(".")&&e.endsWith(t),bH=t=>e=>e.endsWith(t),_H=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),SH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),NH=/^\*+\.\*+$/,kH=t=>!t.startsWith(".")&&t.includes("."),RH=t=>t!=="."&&t!==".."&&t.includes("."),PH=/^\.\*+$/,wH=t=>t!=="."&&t!==".."&&t.startsWith("."),EH=/^\*+$/,CH=t=>t.length!==0&&!t.startsWith("."),DH=t=>t.length!==0&&t!=="."&&t!=="..",AH=/^\?+([^+@!?\*\[\(]*)?$/,IH=([t,e=""])=>{let r=fO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},OH=([t,e=""])=>{let r=pO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},MH=([t,e=""])=>{let r=pO([t]);return e?n=>r(n)&&n.endsWith(e):r},xH=([t,e=""])=>{let r=fO([t]);return e?n=>r(n)&&n.endsWith(e):r},fO=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},pO=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},hO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",lO={win32:{sep:"\\"},posix:{sep:"/"}},LH=hO==="win32"?lO.win32.sep:lO.posix.sep;br.sep=LH;var er=Symbol("globstar **");br.GLOBSTAR=er;var qH="[^/]",$H=qH+"*?",BH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",FH="(?:(?!(?:\\/|^)\\.).)*?",jH=(t,e={})=>r=>br(r,t,e);br.filter=jH;var fn=(t,e={})=>Object.assign({},t,e),UH=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return br;let e=br;return Object.assign((n,i,s={})=>e(n,i,fn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,fn(t,s))}static defaults(i){return e.defaults(fn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,fn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fn(t,s))}},unescape:(n,i={})=>e.unescape(n,fn(t,i)),escape:(n,i={})=>e.escape(n,fn(t,i)),filter:(n,i={})=>e.filter(n,fn(t,i)),defaults:n=>e.defaults(fn(t,n)),makeRe:(n,i={})=>e.makeRe(n,fn(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,fn(t,i)),match:(n,i,s={})=>e.match(n,i,fn(t,s)),sep:e.sep,GLOBSTAR:er})};br.defaults=UH;var mO=(t,e={})=>(Wc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,dO.default)(t));br.braceExpand=mO;var HH=(t,e={})=>new Gr(t,e).makeRe();br.makeRe=HH;var VH=(t,e,r={})=>{let n=new Gr(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};br.match=VH;var uO=/[?*]|[+@!]\(.*?\)|\[|\]/,zH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Gr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){Wc(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||hO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!uO.test(s[2]))&&!uO.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,i),this.set=i.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 n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!h&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),_=!S&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),v=T?3:h?0:void 0,R=_?3:S?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[C,B]=[e[v],r[R]];C.toLowerCase()===B.toLowerCase()&&(r[R]=C,R>v?r=r.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,c=e.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],d=e[o];if(this.debug(r,u,d),u===!1)return!1;if(u===er){this.debug("GLOBSTAR",[r,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var g=e[f];if(this.debug(`
294
294
  globstar while`,e,f,r,p,g),this.matchOne(e.slice(f),r.slice(p),n))return this.debug("globstar found match!",f,c,g),!0;if(g==="."||g===".."||!i.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,f,r,p);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(n&&(this.debug(`
295
- >>> no match, partial?`,e,f,r,p),f===c))}let h;if(typeof u=="string"?(h=d===u,this.debug("string match",u,d,h)):(h=u.test(d),this.debug("pattern match",u,d,h)),!h)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return mI(this.pattern,this.options)}parse(e){Wc(e);let r=this.options;if(e==="**")return er;if(e==="")return"";let n,i=null;(n=e.match(wH))?i=r.dot?CH:DH:(n=e.match(TH))?i=(r.nocase?r.dot?SH:_H:r.dot?bH:vH)(n[1]):(n=e.match(AH))?i=(r.nocase?r.dot?IH:OH:r.dot?MH:xH)(n):(n=e.match(NH))?i=r.dot?RH:kH:(n=e.match(PH))&&(i=EH);let s=la.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),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 r=this.options,n=r.noglobstar?$H:r.dot?BH:FH,i=new Set(r.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))i.add(d);return typeof u=="string"?zH(u):u===er?er:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==er||p===er||(p===void 0?f!==void 0&&f!==er?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=p+"(?:\\/|"+n+")?":f!==er&&(l[d-1]=p+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=er))}),l.filter(u=>u!==er).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].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,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let c=s[a],l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return br.defaults(e).Minimatch}};br.AST=la;br.Minimatch=Gr;br.escape=ua;br.unescape=Mn;var BI=require("node:url");var da=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,yI=new Set,gT=typeof process=="object"&&process?process:{},TI=(t,e,r,n)=>{typeof gT.emitWarning=="function"?gT.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},wp=globalThis.AbortController,gI=globalThis.AbortSignal;if(typeof wp>"u"){gI=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},wp=class{constructor(){e()}signal=new gI;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=gT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,TI("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 WH=t=>!yI.has(t),nNe=Symbol("type"),cs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),vI=t=>cs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?fa:null:null,fa=class extends Array{constructor(e){super(e),this.fill(0)}},yT=class t{heap;length;static#e=!1;static create(e){let r=vI(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Yc=class t{#e;#t;#n;#r;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#c;#l;#s;#y;#T;#h;#p;#N;#g;#k;#R;#b;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#R,ttls:e.#b,sizes:e.#k,keyMap:e.#c,keyList:e.#l,valList:e.#s,next:e.#y,prev:e.#T,get head(){return e.#h},get tail(){return e.#p},free:e.#N,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,n,i,s)=>e.#$(r,n,i,s),moveToTail:r=>e.#F(r),indexes:r=>e.#E(r),rindexes:r=>e.#w(r),isStale:r=>e.#v(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:h,fetchMethod:T,memoMethod:S,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:D,ignoreFetchAbort:B}=e;if(r!==0&&!cs(r))throw new TypeError("max option must be a nonnegative integer");let M=r?vI(r):Array;if(!M)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=p,this.maxEntrySize=g||this.#t,this.sizeCalculation=h,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=S,T!==void 0&&typeof T!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=T,this.#S=!!T,this.#c=new Map,this.#l=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new M(r),this.#T=new M(r),this.#h=0,this.#p=0,this.#N=yT.create(r),this.#a=0,this.#d=0,typeof l=="function"&&(this.#n=l),typeof u=="function"?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#_=!!this.#n,this.#m=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!cs(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!cs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=cs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!cs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}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 F="LRU_CACHE_UNBOUNDED";WH(F)&&(yI.add(F),TI("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#D(){let e=new fa(this.#e),r=new fa(this.#e);this.#b=e,this.#R=r,this.#O=(s,o,a=da.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(s)&&this.#A(this.#l[s],"expire")},o+1);c.unref&&c.unref()}},this.#P=s=>{r[s]=e[s]!==0?da.now():0},this.#i=(s,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=a-l}};let n=0,i=()=>{let s=da.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#c.get(s);if(o===void 0)return 0;let a=e[o],c=r[o];if(!a||!c)return 1/0;let l=(n||i())-c;return a-l},this.#v=s=>{let o=r[s],a=e[s];return!!a&&!!o&&(n||i())-o>a}}#P=()=>{};#i=()=>{};#O=()=>{};#v=()=>!1;#C(){let e=new fa(this.#e);this.#d=0,this.#k=e,this.#I=r=>{this.#d-=e[r],e[r]=0},this.#x=(r,n,i,s)=>{if(this.#u(n))return 0;if(!cs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!cs(i))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 i},this.#M=(r,n,i)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#d>s;)this.#q(!0)}this.#d+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,r,n)=>{};#x=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!this.#L(r)||((e||!this.#v(r))&&(yield r),r===this.#h));)r=this.#T[r]}*#w({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#h;!(!this.#L(r)||((e||!this.#v(r))&&(yield r),r===this.#p));)r=this.#y[r]}#L(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#E())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#l[e],this.#s[e]])}*rentries(){for(let e of this.#w())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#l[e],this.#s[e]])}*keys(){for(let e of this.#E()){let r=this.#l[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#w()){let r=this.#l[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*values(){for(let e of this.#E())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#w())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#E()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],r)}}forEach(e,r=this){for(let n of this.#E()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}rforEach(e,r=this){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let r of this.#w({allowStale:!0}))this.#v(r)&&(this.#A(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#s[r],i=this.#u(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#R){let o=this.#b[r],a=this.#R[r];if(o&&a){let c=o-(da.now()-a);s.ttl=c,s.start=Date.now()}}return this.#k&&(s.size=this.#k[r]),s}dump(){let e=[];for(let r of this.#E({allowStale:!0})){let n=this.#l[r],i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#R){o.ttl=this.#b[r];let a=da.now()-this.#R[r];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=da.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#x(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#a===0?void 0:this.#c.get(e);if(d===void 0)d=this.#a===0?this.#p:this.#N.length!==0?this.#N.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#l[d]=e,this.#s[d]=r,this.#c.set(e,d),this.#y[this.#p]=d,this.#T[d]=this.#p,this.#p=d,this.#a++,this.#M(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(r!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#_&&this.#n?.(p,e,"set"),this.#m&&this.#g?.push([p,e,"set"]))}else o||(this.#_&&this.#n?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#M(d,u,c),this.#s[d]=r,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(i!==0&&!this.#b&&this.#D(),this.#b&&(l||this.#O(d,i,s),c&&this.#i(c,d)),!o&&this.#m&&this.#g){let f=this.#g,p;for(;p=f?.shift();)this.#r?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#s[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.#m&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#r?.(...r)}}}#q(e){let r=this.#h,n=this.#l[r],i=this.#s[r];return this.#S&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#n?.(i,n,"evict"),this.#m&&this.#g?.push([i,n,"evict"])),this.#I(r),e&&(this.#l[r]=void 0,this.#s[r]=void 0,this.#N.push(r)),this.#a===1?(this.#h=this.#p=0,this.#N.length=0):this.#h=this.#y[r],this.#c.delete(n),this.#a--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#c.get(e);if(s!==void 0){let o=this.#s[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(s))i&&(i.has="stale",this.#i(i,s));else return n&&this.#P(s),i&&(i.has="hit",this.#i(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#c.get(e);if(i===void 0||!n&&this.#v(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#$(e,r,n,i){let s=r===void 0?void 0:this.#s[r];if(this.#u(s))return s;let o=new wp,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},l=(h,T=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&h!==void 0;if(n.status&&(S&&!T?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!T)return d(o.signal.reason);let v=p;return this.#s[r]===p&&(h===void 0?v.__staleWhileFetching?this.#s[r]=v.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,h,c.options))),h},u=h=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=h),d(h)),d=h=>{let{aborted:T}=o.signal,S=T&&n.allowStaleOnFetchAbort,_=S||n.allowStaleOnFetchRejection,v=_||n.noDeleteOnFetchRejection,R=p;if(this.#s[r]===p&&(!v||R.__staleWhileFetching===void 0?this.#A(e,"fetch"):S||(this.#s[r]=R.__staleWhileFetching)),_)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw h},f=(h,T)=>{let S=this.#o?.(e,s,c);S&&S instanceof Promise&&S.then(_=>h(_===void 0?void 0:_),T),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(h(void 0),n.allowStaleOnFetchAbort&&(h=_=>l(_,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),g=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,g,{...c.options,status:void 0}),r=this.#c.get(e)):this.#s[r]=g,g}#u(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof wp}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=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:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:h,forceRefresh:T=!1,status:S,signal:_}=r;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let v={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:_},R=this.#c.get(e);if(R===void 0){S&&(S.fetch="miss");let D=this.#$(e,R,v,h);return D.__returned=D}else{let D=this.#s[R];if(this.#u(D)){let Je=n&&D.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",Je&&(S.returnedStale=!0)),Je?D.__staleWhileFetching:D.__returned=D}let B=this.#v(R);if(!T&&!B)return S&&(S.fetch="hit"),this.#F(R),i&&this.#P(R),S&&this.#i(S,R),D;let M=this.#$(e,R,v,h),ge=M.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=B?"stale":"refresh",ge&&B&&(S.returnedStale=!0)),ge?M.__staleWhileFetching:M.__returned=M}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#c.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#i(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#P(a),c))}else o&&(o.get="miss")}#B(e,r){this.#T[r]=e,this.#y[e]=r}#F(e){e!==this.#p&&(e===this.#h?this.#h=this.#y[e]:this.#B(this.#T[e],this.#y[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#a!==0){let i=this.#c.get(e);if(i!==void 0)if(n=!0,this.#a===1)this.#j(r);else{this.#I(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#n?.(s,e,r),this.#m&&this.#g?.push([s,e,r])),this.#c.delete(e),this.#l[i]=void 0,this.#s[i]=void 0,i===this.#p)this.#p=this.#T[i];else if(i===this.#h)this.#h=this.#y[i];else{let o=this.#T[i];this.#y[o]=this.#y[i];let a=this.#y[i];this.#T[a]=this.#T[i]}this.#a--,this.#N.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return n}clear(){return this.#j("delete")}#j(e){for(let r of this.#w({allowStale:!0})){let n=this.#s[r];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[r];this.#_&&this.#n?.(n,i,e),this.#m&&this.#g?.push([n,i,e])}}if(this.#c.clear(),this.#s.fill(void 0),this.#l.fill(void 0),this.#b&&this.#R&&(this.#b.fill(0),this.#R.fill(0)),this.#k&&this.#k.fill(0),this.#h=0,this.#p=0,this.#N.length=0,this.#d=0,this.#a=0,this.#m&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#r?.(...n)}}};var ma=require("node:path"),DI=require("node:url"),ai=require("fs"),rV=$(require("node:fs"),1),ds=require("node:fs/promises");var xp=require("node:events"),kT=$(require("node:stream"),1),kI=require("node:string_decoder"),bI=typeof process=="object"&&process?process:{stdout:null,stderr:null},GH=t=>!!t&&typeof t=="object"&&(t instanceof us||t instanceof kT.default||YH(t)||KH(t)),YH=t=>!!t&&typeof t=="object"&&t instanceof xp.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==kT.default.Writable.prototype.pipe,KH=t=>!!t&&typeof t=="object"&&t instanceof xp.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Di=Symbol("EOF"),Ci=Symbol("maybeEmitEnd"),ls=Symbol("emittedEnd"),Dp=Symbol("emittingEnd"),Kc=Symbol("emittedError"),Cp=Symbol("closed"),_I=Symbol("read"),Ap=Symbol("flush"),SI=Symbol("flushChunk"),xn=Symbol("encoding"),pa=Symbol("decoder"),Gt=Symbol("flowing"),Xc=Symbol("paused"),ha=Symbol("resume"),Yt=Symbol("buffer"),_r=Symbol("pipes"),Kt=Symbol("bufferLength"),TT=Symbol("bufferPush"),Op=Symbol("bufferShift"),dr=Symbol("objectMode"),Ot=Symbol("destroyed"),vT=Symbol("error"),bT=Symbol("emitData"),NI=Symbol("emitEnd"),_T=Symbol("emitEnd2"),si=Symbol("async"),ST=Symbol("abort"),Ip=Symbol("aborted"),Jc=Symbol("signal"),Ws=Symbol("dataListeners"),Yr=Symbol("discarded"),Qc=t=>Promise.resolve().then(t),XH=t=>t(),JH=t=>t==="end"||t==="finish"||t==="prefinish",QH=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,ZH=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Mp=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[ha](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},NT=class extends Mp{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},eV=t=>!!t.objectMode,tV=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",us=class extends xp.EventEmitter{[Gt]=!1;[Xc]=!1;[_r]=[];[Yt]=[];[dr];[xn];[si];[pa];[Di]=!1;[ls]=!1;[Dp]=!1;[Cp]=!1;[Kc]=null;[Kt]=0;[Ot]=!1;[Jc];[Ip]=!1;[Ws]=0;[Yr]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");eV(r)?(this[dr]=!0,this[xn]=null):tV(r)?(this[xn]=r.encoding,this[dr]=!1):(this[dr]=!1,this[xn]=null),this[si]=!!r.async,this[pa]=this[xn]?new kI.StringDecoder(this[xn]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Yt]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_r]});let{signal:n}=r;n&&(this[Jc]=n,n.aborted?this[ST]():n.addEventListener("abort",()=>this[ST]()))}get bufferLength(){return this[Kt]}get encoding(){return this[xn]}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[dr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[si]}set async(e){this[si]=this[si]||!!e}[ST](){this[Ip]=!0,this.emit("abort",this[Jc]?.reason),this.destroy(this[Jc]?.reason)}get aborted(){return this[Ip]}set aborted(e){}write(e,r,n){if(this[Ip])return!1;if(this[Di])throw new Error("write after end");if(this[Ot])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[si]?Qc:XH;if(!this[dr]&&!Buffer.isBuffer(e)){if(ZH(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(QH(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[dr]?(this[Gt]&&this[Kt]!==0&&this[Ap](!0),this[Gt]?this.emit("data",e):this[TT](e),this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):e.length?(typeof e=="string"&&!(r===this[xn]&&!this[pa]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[xn]&&(e=this[pa].write(e)),this[Gt]&&this[Kt]!==0&&this[Ap](!0),this[Gt]?this.emit("data",e):this[TT](e),this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):(this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt])}read(e){if(this[Ot])return null;if(this[Yr]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[Ci](),null;this[dr]&&(e=null),this[Yt].length>1&&!this[dr]&&(this[Yt]=[this[xn]?this[Yt].join(""):Buffer.concat(this[Yt],this[Kt])]);let r=this[_I](e||null,this[Yt][0]);return this[Ci](),r}[_I](e,r){if(this[dr])this[Op]();else{let n=r;e===n.length||e===null?this[Op]():typeof n=="string"?(this[Yt][0]=n.slice(e),r=n.slice(0,e),this[Kt]-=e):(this[Yt][0]=n.subarray(e),r=n.subarray(0,e),this[Kt]-=e)}return this.emit("data",r),!this[Yt].length&&!this[Di]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[Di]=!0,this.writable=!1,(this[Gt]||!this[Xc])&&this[Ci](),this}[ha](){this[Ot]||(!this[Ws]&&!this[_r].length&&(this[Yr]=!0),this[Xc]=!1,this[Gt]=!0,this.emit("resume"),this[Yt].length?this[Ap]():this[Di]?this[Ci]():this.emit("drain"))}resume(){return this[ha]()}pause(){this[Gt]=!1,this[Xc]=!0,this[Yr]=!1}get destroyed(){return this[Ot]}get flowing(){return this[Gt]}get paused(){return this[Xc]}[TT](e){this[dr]?this[Kt]+=1:this[Kt]+=e.length,this[Yt].push(e)}[Op](){return this[dr]?this[Kt]-=1:this[Kt]-=this[Yt][0].length,this[Yt].shift()}[Ap](e=!1){do;while(this[SI](this[Op]())&&this[Yt].length);!e&&!this[Yt].length&&!this[Di]&&this.emit("drain")}[SI](e){return this.emit("data",e),this[Gt]}pipe(e,r){if(this[Ot])return e;this[Yr]=!1;let n=this[ls];return r=r||{},e===bI.stdout||e===bI.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[_r].push(r.proxyErrors?new NT(this,e,r):new Mp(this,e,r)),this[si]?Qc(()=>this[ha]()):this[ha]()),e}unpipe(e){let r=this[_r].find(n=>n.dest===e);r&&(this[_r].length===1?(this[Gt]&&this[Ws]===0&&(this[Gt]=!1),this[_r]=[]):this[_r].splice(this[_r].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Yr]=!1,this[Ws]++,!this[_r].length&&!this[Gt]&&this[ha]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(JH(e)&&this[ls])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Kc]){let i=r;this[si]?Qc(()=>i.call(this,this[Kc])):i.call(this,this[Kc])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Ws]=this.listeners("data").length,this[Ws]===0&&!this[Yr]&&!this[_r].length&&(this[Gt]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ws]=0,!this[Yr]&&!this[_r].length&&(this[Gt]=!1)),r}get emittedEnd(){return this[ls]}[Ci](){!this[Dp]&&!this[ls]&&!this[Ot]&&this[Yt].length===0&&this[Di]&&(this[Dp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Cp]&&this.emit("close"),this[Dp]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Ot&&this[Ot])return!1;if(e==="data")return!this[dr]&&!n?!1:this[si]?(Qc(()=>this[bT](n)),!0):this[bT](n);if(e==="end")return this[NI]();if(e==="close"){if(this[Cp]=!0,!this[ls]&&!this[Ot])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Kc]=n,super.emit(vT,n);let s=!this[Jc]||this.listeners("error").length?super.emit("error",n):!1;return this[Ci](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ci](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Ci](),i}[bT](e){for(let n of this[_r])n.dest.write(e)===!1&&this.pause();let r=this[Yr]?!1:super.emit("data",e);return this[Ci](),r}[NI](){return this[ls]?!1:(this[ls]=!0,this.readable=!1,this[si]?(Qc(()=>this[_T]()),!0):this[_T]())}[_T](){if(this[pa]){let r=this[pa].end();if(r){for(let n of this[_r])n.dest.write(r);this[Yr]||super.emit("data",r)}}for(let r of this[_r])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[dr]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[dr]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[dr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[xn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ot,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Yr]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Di])return r();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Ot,u),r(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Ot,u),this.pause(),s({value:d,done:!!this[Di]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Ot,u),r(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(Ot,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Yr]=!1;let e=!1,r=()=>(this.pause(),this.off(vT,r),this.off(Ot,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(vT,r),this.once(Ot,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ot])return e?this.emit("error",e):this.emit(Ot),this;this[Ot]=!0,this[Yr]=!0,this[Yt].length=0,this[Kt]=0;let r=this;return typeof r.close=="function"&&!this[Cp]&&r.close(),e?this.emit("error",e):this.emit(Ot),this}static get isStream(){return GH}};var nV=ai.realpathSync.native,el={lstatSync:ai.lstatSync,readdir:ai.readdir,readdirSync:ai.readdirSync,readlinkSync:ai.readlinkSync,realpathSync:nV,promises:{lstat:ds.lstat,readdir:ds.readdir,readlink:ds.readlink,realpath:ds.realpath}},CI=t=>!t||t===el||t===rV?el:{...el,...t,promises:{...el.promises,...t.promises||{}}},AI=/^\\\\\?\\([a-z]:)\\?$/i,iV=t=>t.replace(/\//g,"\\").replace(AI,"$1\\"),sV=/[\\\/]/,hn=0,OI=1,II=2,oi=4,MI=6,xI=8,Gs=10,LI=12,pn=15,Zc=~pn,RT=16,RI=32,tl=64,Ln=128,Lp=256,$p=512,PI=tl|Ln|$p,oV=1023,PT=t=>t.isFile()?xI:t.isDirectory()?oi:t.isSymbolicLink()?Gs:t.isCharacterDevice()?II:t.isBlockDevice()?MI:t.isSocket()?LI:t.isFIFO()?OI:hn,EI=new Map,rl=t=>{let e=EI.get(t);if(e)return e;let r=t.normalize("NFKD");return EI.set(t,r),r},wI=new Map,qp=t=>{let e=wI.get(t);if(e)return e;let r=rl(t.toLowerCase());return wI.set(t,r),r},Bp=class extends Yc{constructor(){super({max:256})}},ET=class extends Yc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},qI=Symbol("PathScurry setAsCwd"),fr=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#a;get rdev(){return this.#a}#d;get blksize(){return this.#d}#c;get ino(){return this.#c}#l;get size(){return this.#l}#s;get blocks(){return this.#s}#y;get atimeMs(){return this.#y}#T;get mtimeMs(){return this.#T}#h;get ctimeMs(){return this.#h}#p;get birthtimeMs(){return this.#p}#N;get atime(){return this.#N}#g;get mtime(){return this.#g}#k;get ctime(){return this.#k}#R;get birthtime(){return this.#R}#b;#_;#S;#m;#D;#P;#i;#O;#v;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=hn,n,i,s,o,a){this.name=e,this.#b=s?qp(e):rl(e),this.#i=r&oV,this.nocase=s,this.roots=i,this.root=n||this,this.#O=o,this.#S=a.fullpath,this.#D=a.relative,this.#P=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=CI(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#I(i):this.#I(i)}#I(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#O.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#O.set(this,r),this.#i&=~RT,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?qp(e):rl(e);for(let c of n)if(c.#b===i)return c;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,hn,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#i|=Ln),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,r=this.parent;if(!r)return this.#D=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#m=`//?/${i}`:this.#m=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#m=n}isUnknown(){return(this.#i&pn)===hn}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.#i&pn)===xI}isDirectory(){return(this.#i&pn)===oi}isCharacterDevice(){return(this.#i&pn)===II}isBlockDevice(){return(this.#i&pn)===MI}isFIFO(){return(this.#i&pn)===OI}isSocket(){return(this.#i&pn)===LI}isSymbolicLink(){return(this.#i&Gs)===Gs}lstatCached(){return this.#i&RI?this:void 0}readlinkCached(){return this.#v}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#v)return!0;if(!this.parent)return!1;let e=this.#i&pn;return!(e!==hn&&e!==Gs||this.#i&Lp||this.#i&Ln)}calledReaddir(){return!!(this.#i&RT)}isENOENT(){return!!(this.#i&Ln)}isNamed(e){return this.nocase?this.#b===qp(e):this.#b===rl(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#v=n}catch(r){this.#u(r.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#v=n}catch(r){this.#u(r.code);return}}#M(e){this.#i|=RT;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#x()}}#x(){this.#i&Ln||(this.#i=(this.#i|Ln)&Zc,this.#E())}#E(){let e=this.children();e.provisional=0;for(let r of e)r.#x()}#w(){this.#i|=$p,this.#L()}#L(){if(this.#i&tl)return;let e=this.#i;(e&pn)===oi&&(e&=Zc),this.#i=e|tl,this.#E()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#x():this.children().provisional=0}#$(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#x()}#u(e=""){let r=this.#i;r|=Lp,e==="ENOENT"&&(r|=Ln),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Zc),this.#i=r,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#B(e,r){return this.#A(e,r)||this.#F(e,r)}#F(e,r){let n=PT(e),i=this.newChild(e.name,n,{parent:this}),s=i.#i&pn;return s!==oi&&s!==Gs&&s!==hn&&(i.#i|=tl),r.unshift(i),r.provisional++,i}#A(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?qp(e.name):rl(e.name))===i.#b)return this.#j(e,i,n,r)}}#j(e,r,n,i){let s=r.name;return r.#i=r.#i&Zc|PT(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#i&Ln)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#i&Ln)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#z(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:g,mtimeMs:h,nlink:T,rdev:S,size:_,uid:v}=e;this.#N=r,this.#y=n,this.#R=i,this.#p=s,this.#d=o,this.#s=a,this.#k=c,this.#h=l,this.#t=u,this.#f=d,this.#c=f,this.#n=p,this.#g=g,this.#T=h,this.#r=T,this.#a=S,this.#l=_,this.#o=v;let R=PT(e);this.#i=this.#i&Zc|R|RI,R!==hn&&R!==oi&&R!==Gs&&(this.#i|=tl)}#H=[];#V=!1;#W(e){this.#V=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#V)return;this.#V=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),n.provisional=0;else{for(let a of o)this.#B(a,n);this.#M(n)}this.#W(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#B(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#U=void 0,n()}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 r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#B(n,e);this.#M(e)}catch(n){this.#q(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#i&PI)return!1;let e=pn&this.#i;return e===hn||e===oi||e===Gs}shouldWalk(e,r){return(this.#i&oi)===oi&&!(this.#i&PI)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#C)return this.#C;if(!(($p|Lp|Ln)&this.#i))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#w()}}realpathSync(){if(this.#C)return this.#C;if(!(($p|Lp|Ln)&this.#i))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#w()}}[qI](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#D=n.join(this.sep),i.#P=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#D=void 0,i.#P=void 0,i=i.parent}},Fp=class t extends fr{sep="\\";splitSep=sV;constructor(e,r=hn,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=hn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ma.win32.parse(e).root}getRoot(e){if(e=iV(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new ga(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(AI,"$1\\"),e===r}},jp=class t extends fr{splitSep="/";sep="/";constructor(e,r=hn,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=hn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Up=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=el}={}){this.#r=CI(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,DI.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Bp,this.#t=new Bp,this.#n=new ET(s);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,f=this.rootPath,p=!1;for(let g of c){let h=u--;l=l.child(g,{relative:new Array(h).fill("..").join(d),relativePosix:new Array(h).fill("..").join("/"),fullpath:f+=(p?"":d)+g}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#t.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,i),i}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,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.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:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,g)=>{if(p)return f(p);let h=g.length;if(!h)return f();let T=()=>{--h===0&&f()};for(let S of g)(!s||s(S))&&a.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,o)?l(_,T):T()):S.shouldWalk(c,o)?l(S,T):T()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?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(n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(i&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?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 n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(i&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new us({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=(T,S,_=!1)=>{if(T)return a.emit("error",T);if(i&&!_){let v=[];for(let R of S)R.isSymbolicLink()&&v.push(R.realpath().then(D=>D?.isUnknown()?D.lstat():D));if(v.length){Promise.all(v).then(()=>g(null,S,!0));return}}for(let v of S)v&&(!s||s(v))&&(a.write(n?v:v.fullpath())||(f=!0));u--;for(let v of S){let R=v.realpathCached()||v;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):h||d()},h=!0;p.readdirCB(g,!0),h=!1}};return d(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new us({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=p.readdirSync();for(let h of g)(!s||s(h))&&(a.write(n?h:h.fullpath())||(f=!0));u--;for(let h of g){let T=h;if(h.isSymbolicLink()){if(!(i&&(T=h.realpathSync())))continue;T.isUnknown()&&T.lstatSync()}T.shouldWalk(c,o)&&l.push(T)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[qI](r)}},ga=class extends Up{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,ma.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ma.win32.parse(e).root.toUpperCase()}newRoot(e){return new Fp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ya=class extends Up{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,ma.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new jp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},nl=class extends ya{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},cNe=process.platform==="win32"?Fp:jp,$I=process.platform==="win32"?ga:process.platform==="darwin"?nl:ya;var aV=t=>t.length>=1,cV=t=>t.length>=1,Ta=class t{#e;#t;#n;length;#r;#o;#f;#a;#d;#c;#l=!0;constructor(e,r,n,i){if(!aV(e))throw new TypeError("empty pattern list");if(!cV(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#n=n,this.#r=i,this.#n===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,p,...g]=this.#t;l[0]===""&&(l.shift(),g.shift());let h=[s,o,a,c,""].join("/"),T=[u,d,f,p,""].join("/");this.#e=[h,...l],this.#t=[T,...g],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.#n]}isString(){return typeof this.#e[this.#n]=="string"}isGlobstar(){return this.#e[this.#n]===er}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#f=this.#f||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#n+1,this.#r),this.#o.#c=this.#c,this.#o.#d=this.#d,this.#o.#a=this.#a,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#r==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var lV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",va=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=lV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new Gr(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Ta(i,s,0,this.platform),a=new Gr(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 r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var wT=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},DT=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},CT=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},il=class t{hasWalkedCache;matches=new DT;subwalks=new CT;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new wT}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,d);continue}else if(c===er){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(i,a,d===""||d===".");else if(d===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===er?i.testGlobstar(s,o,l,a):c instanceof RegExp?i.testRegExp(s,c,l,a):i.testString(s,c,l,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var uV=(t,e)=>typeof t=="string"?new va([t],e):Array.isArray(t)?new va(t,e):t,Hp=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=uV(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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,r)}matchFinish(e,r){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new il(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())s++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new il(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())s++,this.walkCB2Sync(a,c,n.child(),o);o()}},sl=class extends Hp{matches=new Set;constructor(e,r,n){super(e,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},ol=class extends Hp{results;constructor(e,r,n){super(e,r,n),this.results=new us({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 dV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qn=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,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,BI.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||dV,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?ga:r.platform==="darwin"?nl:r.platform?ya:$I;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Gr(c,i)),[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 Ta(c,u,0,this.platform)})}async walk(){return[...await new sl(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 sl(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 ol(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 ol(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 AT=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Gr(r,e).hasMagic())return!0;return!1};function Vp(t,e={}){return new qn(t,e).streamSync()}function jI(t,e={}){return new qn(t,e).stream()}function UI(t,e={}){return new qn(t,e).walkSync()}async function FI(t,e={}){return new qn(t,e).walk()}function zp(t,e={}){return new qn(t,e).iterateSync()}function HI(t,e={}){return new qn(t,e).iterate()}var fV=Vp,pV=Object.assign(jI,{sync:Vp}),hV=zp,mV=Object.assign(HI,{sync:zp}),gV=Object.assign(UI,{stream:Vp,iterate:zp}),Ys=Object.assign(FI,{glob:FI,globSync:UI,sync:gV,globStream:jI,stream:pV,globStreamSync:Vp,streamSync:fV,globIterate:HI,iterate:mV,globIterateSync:zp,iterateSync:hV,Glob:qn,hasMagic:AT,escape:ua,unescape:Mn});Ys.glob=Ys;var hS=$(fb()),M$=$(A$());var dS={};RB(dS,{$id:()=>lJ,$schema:()=>cJ,default:()=>hJ,definitions:()=>dJ,properties:()=>pJ,title:()=>uJ,type:()=>fJ});var cJ="http://json-schema.org/draft-07/schema#",lJ="http://json-schema.org/draft-07/schema#",uJ="Core schema meta-schema",dJ={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},fJ=["object","boolean"],pJ={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},hJ={$schema:cJ,$id:lJ,title:uJ,definitions:dJ,type:fJ,properties:pJ,default:!0};var Kr=$(H());var Nm=class extends wc{constructor(r,n){super();this.ajv=r;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(r,n){let i=[];if(n.disabled){let o=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(a=>i.push(j(21,a.firstToken,a.lastToken,a,{severity:Kr.DiagnosticSeverity.Hint,linkedTo:[...o?.ast?[o?.ast]:[]],tags:[Kr.DiagnosticTag.Unnecessary]}))),i}let s=X.toJson(n);try{this.validate?(this.validate(s),this.validate.errors&&(this.validate.errors.forEach(o=>i.push(...mJ(r,o,n,this.schemaKey))),console.log(this.schemaKey,`${n.pathString}`,this.validate.errors,s))):console.log("no validate")}catch(o){console.log(this.schemaKey,`${n.pathString}`,this.schemaKey,o)}return i}getOnPropertyHover(r){let n=(this.validate?.schema).properties?.[r];if(n&&typeof n=="object"&&"description"in n)return{kind:Kr.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
295
+ >>> no match, partial?`,e,f,r,p),f===c))}let h;if(typeof u=="string"?(h=d===u,this.debug("string match",u,d,h)):(h=u.test(d),this.debug("pattern match",u,d,h)),!h)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return mO(this.pattern,this.options)}parse(e){Wc(e);let r=this.options;if(e==="**")return er;if(e==="")return"";let n,i=null;(n=e.match(EH))?i=r.dot?DH:CH:(n=e.match(TH))?i=(r.nocase?r.dot?SH:_H:r.dot?bH:vH)(n[1]):(n=e.match(AH))?i=(r.nocase?r.dot?OH:IH:r.dot?MH:xH)(n):(n=e.match(NH))?i=r.dot?RH:kH:(n=e.match(PH))&&(i=wH);let s=la.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),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 r=this.options,n=r.noglobstar?$H:r.dot?BH:FH,i=new Set(r.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))i.add(d);return typeof u=="string"?zH(u):u===er?er:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==er||p===er||(p===void 0?f!==void 0&&f!==er?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=p+"(?:\\/|"+n+")?":f!==er&&(l[d-1]=p+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=er))}),l.filter(u=>u!==er).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].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,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let c=s[a],l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return br.defaults(e).Minimatch}};br.AST=la;br.Minimatch=Gr;br.escape=ua;br.unescape=Mn;var BO=require("node:url");var da=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,yO=new Set,gT=typeof process=="object"&&process?process:{},TO=(t,e,r,n)=>{typeof gT.emitWarning=="function"?gT.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},Ep=globalThis.AbortController,gO=globalThis.AbortSignal;if(typeof Ep>"u"){gO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Ep=class{constructor(){e()}signal=new gO;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=gT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,TO("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 WH=t=>!yO.has(t),nNe=Symbol("type"),cs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),vO=t=>cs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?fa:null:null,fa=class extends Array{constructor(e){super(e),this.fill(0)}},yT=class t{heap;length;static#e=!1;static create(e){let r=vO(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Kc=class t{#e;#t;#n;#r;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#c;#l;#s;#y;#T;#h;#p;#N;#g;#k;#R;#b;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#R,ttls:e.#b,sizes:e.#k,keyMap:e.#c,keyList:e.#l,valList:e.#s,next:e.#y,prev:e.#T,get head(){return e.#h},get tail(){return e.#p},free:e.#N,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,n,i,s)=>e.#$(r,n,i,s),moveToTail:r=>e.#F(r),indexes:r=>e.#w(r),rindexes:r=>e.#E(r),isStale:r=>e.#v(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:h,fetchMethod:T,memoMethod:S,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:C,ignoreFetchAbort:B}=e;if(r!==0&&!cs(r))throw new TypeError("max option must be a nonnegative integer");let M=r?vO(r):Array;if(!M)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=p,this.maxEntrySize=g||this.#t,this.sizeCalculation=h,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=S,T!==void 0&&typeof T!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=T,this.#S=!!T,this.#c=new Map,this.#l=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new M(r),this.#T=new M(r),this.#h=0,this.#p=0,this.#N=yT.create(r),this.#a=0,this.#d=0,typeof l=="function"&&(this.#n=l),typeof u=="function"?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#_=!!this.#n,this.#m=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!cs(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!cs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=cs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!cs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}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 F="LRU_CACHE_UNBOUNDED";WH(F)&&(yO.add(F),TO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new fa(this.#e),r=new fa(this.#e);this.#b=e,this.#R=r,this.#I=(s,o,a=da.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(s)&&this.#A(this.#l[s],"expire")},o+1);c.unref&&c.unref()}},this.#P=s=>{r[s]=e[s]!==0?da.now():0},this.#i=(s,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=a-l}};let n=0,i=()=>{let s=da.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#c.get(s);if(o===void 0)return 0;let a=e[o],c=r[o];if(!a||!c)return 1/0;let l=(n||i())-c;return a-l},this.#v=s=>{let o=r[s],a=e[s];return!!a&&!!o&&(n||i())-o>a}}#P=()=>{};#i=()=>{};#I=()=>{};#v=()=>!1;#D(){let e=new fa(this.#e);this.#d=0,this.#k=e,this.#O=r=>{this.#d-=e[r],e[r]=0},this.#x=(r,n,i,s)=>{if(this.#u(n))return 0;if(!cs(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!cs(i))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 i},this.#M=(r,n,i)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#d>s;)this.#q(!0)}this.#d+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#O=e=>{};#M=(e,r,n)=>{};#x=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!this.#L(r)||((e||!this.#v(r))&&(yield r),r===this.#h));)r=this.#T[r]}*#E({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#h;!(!this.#L(r)||((e||!this.#v(r))&&(yield r),r===this.#p));)r=this.#y[r]}#L(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#w())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#l[e],this.#s[e]])}*rentries(){for(let e of this.#E())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#l[e],this.#s[e]])}*keys(){for(let e of this.#w()){let r=this.#l[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#E()){let r=this.#l[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*values(){for(let e of this.#w())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#E())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],r)}}forEach(e,r=this){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}rforEach(e,r=this){for(let n of this.#E()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let r of this.#E({allowStale:!0}))this.#v(r)&&(this.#A(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#s[r],i=this.#u(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#R){let o=this.#b[r],a=this.#R[r];if(o&&a){let c=o-(da.now()-a);s.ttl=c,s.start=Date.now()}}return this.#k&&(s.size=this.#k[r]),s}dump(){let e=[];for(let r of this.#w({allowStale:!0})){let n=this.#l[r],i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#R){o.ttl=this.#b[r];let a=da.now()-this.#R[r];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=da.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#x(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#a===0?void 0:this.#c.get(e);if(d===void 0)d=this.#a===0?this.#p:this.#N.length!==0?this.#N.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#l[d]=e,this.#s[d]=r,this.#c.set(e,d),this.#y[this.#p]=d,this.#T[d]=this.#p,this.#p=d,this.#a++,this.#M(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(r!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#_&&this.#n?.(p,e,"set"),this.#m&&this.#g?.push([p,e,"set"]))}else o||(this.#_&&this.#n?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#O(d),this.#M(d,u,c),this.#s[d]=r,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(i!==0&&!this.#b&&this.#C(),this.#b&&(l||this.#I(d,i,s),c&&this.#i(c,d)),!o&&this.#m&&this.#g){let f=this.#g,p;for(;p=f?.shift();)this.#r?.(...p)}return this}pop(){try{for(;this.#a;){let e=this.#s[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.#m&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#r?.(...r)}}}#q(e){let r=this.#h,n=this.#l[r],i=this.#s[r];return this.#S&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#n?.(i,n,"evict"),this.#m&&this.#g?.push([i,n,"evict"])),this.#O(r),e&&(this.#l[r]=void 0,this.#s[r]=void 0,this.#N.push(r)),this.#a===1?(this.#h=this.#p=0,this.#N.length=0):this.#h=this.#y[r],this.#c.delete(n),this.#a--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#c.get(e);if(s!==void 0){let o=this.#s[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(s))i&&(i.has="stale",this.#i(i,s));else return n&&this.#P(s),i&&(i.has="hit",this.#i(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#c.get(e);if(i===void 0||!n&&this.#v(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#$(e,r,n,i){let s=r===void 0?void 0:this.#s[r];if(this.#u(s))return s;let o=new Ep,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},l=(h,T=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&h!==void 0;if(n.status&&(S&&!T?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!T)return d(o.signal.reason);let v=p;return this.#s[r]===p&&(h===void 0?v.__staleWhileFetching?this.#s[r]=v.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,h,c.options))),h},u=h=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=h),d(h)),d=h=>{let{aborted:T}=o.signal,S=T&&n.allowStaleOnFetchAbort,_=S||n.allowStaleOnFetchRejection,v=_||n.noDeleteOnFetchRejection,R=p;if(this.#s[r]===p&&(!v||R.__staleWhileFetching===void 0?this.#A(e,"fetch"):S||(this.#s[r]=R.__staleWhileFetching)),_)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw h},f=(h,T)=>{let S=this.#o?.(e,s,c);S&&S instanceof Promise&&S.then(_=>h(_===void 0?void 0:_),T),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(h(void 0),n.allowStaleOnFetchAbort&&(h=_=>l(_,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),g=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,g,{...c.options,status:void 0}),r=this.#c.get(e)):this.#s[r]=g,g}#u(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ep}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=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:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:h,forceRefresh:T=!1,status:S,signal:_}=r;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let v={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:_},R=this.#c.get(e);if(R===void 0){S&&(S.fetch="miss");let C=this.#$(e,R,v,h);return C.__returned=C}else{let C=this.#s[R];if(this.#u(C)){let Je=n&&C.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",Je&&(S.returnedStale=!0)),Je?C.__staleWhileFetching:C.__returned=C}let B=this.#v(R);if(!T&&!B)return S&&(S.fetch="hit"),this.#F(R),i&&this.#P(R),S&&this.#i(S,R),C;let M=this.#$(e,R,v,h),ge=M.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=B?"stale":"refresh",ge&&B&&(S.returnedStale=!0)),ge?M.__staleWhileFetching:M.__returned=M}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#c.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#i(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#P(a),c))}else o&&(o.get="miss")}#B(e,r){this.#T[r]=e,this.#y[e]=r}#F(e){e!==this.#p&&(e===this.#h?this.#h=this.#y[e]:this.#B(this.#T[e],this.#y[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#a!==0){let i=this.#c.get(e);if(i!==void 0)if(n=!0,this.#a===1)this.#j(r);else{this.#O(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#n?.(s,e,r),this.#m&&this.#g?.push([s,e,r])),this.#c.delete(e),this.#l[i]=void 0,this.#s[i]=void 0,i===this.#p)this.#p=this.#T[i];else if(i===this.#h)this.#h=this.#y[i];else{let o=this.#T[i];this.#y[o]=this.#y[i];let a=this.#y[i];this.#T[a]=this.#T[i]}this.#a--,this.#N.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return n}clear(){return this.#j("delete")}#j(e){for(let r of this.#E({allowStale:!0})){let n=this.#s[r];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[r];this.#_&&this.#n?.(n,i,e),this.#m&&this.#g?.push([n,i,e])}}if(this.#c.clear(),this.#s.fill(void 0),this.#l.fill(void 0),this.#b&&this.#R&&(this.#b.fill(0),this.#R.fill(0)),this.#k&&this.#k.fill(0),this.#h=0,this.#p=0,this.#N.length=0,this.#d=0,this.#a=0,this.#m&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#r?.(...n)}}};var ma=require("node:path"),CO=require("node:url"),ai=require("fs"),rV=$(require("node:fs"),1),ds=require("node:fs/promises");var xp=require("node:events"),kT=$(require("node:stream"),1),kO=require("node:string_decoder"),bO=typeof process=="object"&&process?process:{stdout:null,stderr:null},GH=t=>!!t&&typeof t=="object"&&(t instanceof us||t instanceof kT.default||KH(t)||YH(t)),KH=t=>!!t&&typeof t=="object"&&t instanceof xp.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==kT.default.Writable.prototype.pipe,YH=t=>!!t&&typeof t=="object"&&t instanceof xp.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Ci=Symbol("EOF"),Di=Symbol("maybeEmitEnd"),ls=Symbol("emittedEnd"),Cp=Symbol("emittingEnd"),Yc=Symbol("emittedError"),Dp=Symbol("closed"),_O=Symbol("read"),Ap=Symbol("flush"),SO=Symbol("flushChunk"),xn=Symbol("encoding"),pa=Symbol("decoder"),Gt=Symbol("flowing"),Xc=Symbol("paused"),ha=Symbol("resume"),Kt=Symbol("buffer"),_r=Symbol("pipes"),Yt=Symbol("bufferLength"),TT=Symbol("bufferPush"),Ip=Symbol("bufferShift"),dr=Symbol("objectMode"),It=Symbol("destroyed"),vT=Symbol("error"),bT=Symbol("emitData"),NO=Symbol("emitEnd"),_T=Symbol("emitEnd2"),si=Symbol("async"),ST=Symbol("abort"),Op=Symbol("aborted"),Jc=Symbol("signal"),Ws=Symbol("dataListeners"),Kr=Symbol("discarded"),Qc=t=>Promise.resolve().then(t),XH=t=>t(),JH=t=>t==="end"||t==="finish"||t==="prefinish",QH=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,ZH=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Mp=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[ha](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},NT=class extends Mp{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},eV=t=>!!t.objectMode,tV=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",us=class extends xp.EventEmitter{[Gt]=!1;[Xc]=!1;[_r]=[];[Kt]=[];[dr];[xn];[si];[pa];[Ci]=!1;[ls]=!1;[Cp]=!1;[Dp]=!1;[Yc]=null;[Yt]=0;[It]=!1;[Jc];[Op]=!1;[Ws]=0;[Kr]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");eV(r)?(this[dr]=!0,this[xn]=null):tV(r)?(this[xn]=r.encoding,this[dr]=!1):(this[dr]=!1,this[xn]=null),this[si]=!!r.async,this[pa]=this[xn]?new kO.StringDecoder(this[xn]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Kt]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_r]});let{signal:n}=r;n&&(this[Jc]=n,n.aborted?this[ST]():n.addEventListener("abort",()=>this[ST]()))}get bufferLength(){return this[Yt]}get encoding(){return this[xn]}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[dr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[si]}set async(e){this[si]=this[si]||!!e}[ST](){this[Op]=!0,this.emit("abort",this[Jc]?.reason),this.destroy(this[Jc]?.reason)}get aborted(){return this[Op]}set aborted(e){}write(e,r,n){if(this[Op])return!1;if(this[Ci])throw new Error("write after end");if(this[It])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[si]?Qc:XH;if(!this[dr]&&!Buffer.isBuffer(e)){if(ZH(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(QH(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[dr]?(this[Gt]&&this[Yt]!==0&&this[Ap](!0),this[Gt]?this.emit("data",e):this[TT](e),this[Yt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):e.length?(typeof e=="string"&&!(r===this[xn]&&!this[pa]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[xn]&&(e=this[pa].write(e)),this[Gt]&&this[Yt]!==0&&this[Ap](!0),this[Gt]?this.emit("data",e):this[TT](e),this[Yt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):(this[Yt]!==0&&this.emit("readable"),n&&i(n),this[Gt])}read(e){if(this[It])return null;if(this[Kr]=!1,this[Yt]===0||e===0||e&&e>this[Yt])return this[Di](),null;this[dr]&&(e=null),this[Kt].length>1&&!this[dr]&&(this[Kt]=[this[xn]?this[Kt].join(""):Buffer.concat(this[Kt],this[Yt])]);let r=this[_O](e||null,this[Kt][0]);return this[Di](),r}[_O](e,r){if(this[dr])this[Ip]();else{let n=r;e===n.length||e===null?this[Ip]():typeof n=="string"?(this[Kt][0]=n.slice(e),r=n.slice(0,e),this[Yt]-=e):(this[Kt][0]=n.subarray(e),r=n.subarray(0,e),this[Yt]-=e)}return this.emit("data",r),!this[Kt].length&&!this[Ci]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[Ci]=!0,this.writable=!1,(this[Gt]||!this[Xc])&&this[Di](),this}[ha](){this[It]||(!this[Ws]&&!this[_r].length&&(this[Kr]=!0),this[Xc]=!1,this[Gt]=!0,this.emit("resume"),this[Kt].length?this[Ap]():this[Ci]?this[Di]():this.emit("drain"))}resume(){return this[ha]()}pause(){this[Gt]=!1,this[Xc]=!0,this[Kr]=!1}get destroyed(){return this[It]}get flowing(){return this[Gt]}get paused(){return this[Xc]}[TT](e){this[dr]?this[Yt]+=1:this[Yt]+=e.length,this[Kt].push(e)}[Ip](){return this[dr]?this[Yt]-=1:this[Yt]-=this[Kt][0].length,this[Kt].shift()}[Ap](e=!1){do;while(this[SO](this[Ip]())&&this[Kt].length);!e&&!this[Kt].length&&!this[Ci]&&this.emit("drain")}[SO](e){return this.emit("data",e),this[Gt]}pipe(e,r){if(this[It])return e;this[Kr]=!1;let n=this[ls];return r=r||{},e===bO.stdout||e===bO.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[_r].push(r.proxyErrors?new NT(this,e,r):new Mp(this,e,r)),this[si]?Qc(()=>this[ha]()):this[ha]()),e}unpipe(e){let r=this[_r].find(n=>n.dest===e);r&&(this[_r].length===1?(this[Gt]&&this[Ws]===0&&(this[Gt]=!1),this[_r]=[]):this[_r].splice(this[_r].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Kr]=!1,this[Ws]++,!this[_r].length&&!this[Gt]&&this[ha]();else if(e==="readable"&&this[Yt]!==0)super.emit("readable");else if(JH(e)&&this[ls])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Yc]){let i=r;this[si]?Qc(()=>i.call(this,this[Yc])):i.call(this,this[Yc])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Ws]=this.listeners("data").length,this[Ws]===0&&!this[Kr]&&!this[_r].length&&(this[Gt]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ws]=0,!this[Kr]&&!this[_r].length&&(this[Gt]=!1)),r}get emittedEnd(){return this[ls]}[Di](){!this[Cp]&&!this[ls]&&!this[It]&&this[Kt].length===0&&this[Ci]&&(this[Cp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Dp]&&this.emit("close"),this[Cp]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==It&&this[It])return!1;if(e==="data")return!this[dr]&&!n?!1:this[si]?(Qc(()=>this[bT](n)),!0):this[bT](n);if(e==="end")return this[NO]();if(e==="close"){if(this[Dp]=!0,!this[ls]&&!this[It])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Yc]=n,super.emit(vT,n);let s=!this[Jc]||this.listeners("error").length?super.emit("error",n):!1;return this[Di](),s}else if(e==="resume"){let s=super.emit("resume");return this[Di](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Di](),i}[bT](e){for(let n of this[_r])n.dest.write(e)===!1&&this.pause();let r=this[Kr]?!1:super.emit("data",e);return this[Di](),r}[NO](){return this[ls]?!1:(this[ls]=!0,this.readable=!1,this[si]?(Qc(()=>this[_T]()),!0):this[_T]())}[_T](){if(this[pa]){let r=this[pa].end();if(r){for(let n of this[_r])n.dest.write(r);this[Kr]||super.emit("data",r)}}for(let r of this[_r])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[dr]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[dr]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[dr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[xn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(It,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Kr]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Ci])return r();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(It,u),r(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(It,u),this.pause(),s({value:d,done:!!this[Ci]})},l=()=>{this.off("error",a),this.off("data",c),this.off(It,u),r(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(It,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Kr]=!1;let e=!1,r=()=>(this.pause(),this.off(vT,r),this.off(It,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(vT,r),this.once(It,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[It])return e?this.emit("error",e):this.emit(It),this;this[It]=!0,this[Kr]=!0,this[Kt].length=0,this[Yt]=0;let r=this;return typeof r.close=="function"&&!this[Dp]&&r.close(),e?this.emit("error",e):this.emit(It),this}static get isStream(){return GH}};var nV=ai.realpathSync.native,el={lstatSync:ai.lstatSync,readdir:ai.readdir,readdirSync:ai.readdirSync,readlinkSync:ai.readlinkSync,realpathSync:nV,promises:{lstat:ds.lstat,readdir:ds.readdir,readlink:ds.readlink,realpath:ds.realpath}},DO=t=>!t||t===el||t===rV?el:{...el,...t,promises:{...el.promises,...t.promises||{}}},AO=/^\\\\\?\\([a-z]:)\\?$/i,iV=t=>t.replace(/\//g,"\\").replace(AO,"$1\\"),sV=/[\\\/]/,hn=0,IO=1,OO=2,oi=4,MO=6,xO=8,Gs=10,LO=12,pn=15,Zc=~pn,RT=16,RO=32,tl=64,Ln=128,Lp=256,$p=512,PO=tl|Ln|$p,oV=1023,PT=t=>t.isFile()?xO:t.isDirectory()?oi:t.isSymbolicLink()?Gs:t.isCharacterDevice()?OO:t.isBlockDevice()?MO:t.isSocket()?LO:t.isFIFO()?IO:hn,wO=new Map,rl=t=>{let e=wO.get(t);if(e)return e;let r=t.normalize("NFKD");return wO.set(t,r),r},EO=new Map,qp=t=>{let e=EO.get(t);if(e)return e;let r=rl(t.toLowerCase());return EO.set(t,r),r},Bp=class extends Kc{constructor(){super({max:256})}},wT=class extends Kc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},qO=Symbol("PathScurry setAsCwd"),fr=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#a;get rdev(){return this.#a}#d;get blksize(){return this.#d}#c;get ino(){return this.#c}#l;get size(){return this.#l}#s;get blocks(){return this.#s}#y;get atimeMs(){return this.#y}#T;get mtimeMs(){return this.#T}#h;get ctimeMs(){return this.#h}#p;get birthtimeMs(){return this.#p}#N;get atime(){return this.#N}#g;get mtime(){return this.#g}#k;get ctime(){return this.#k}#R;get birthtime(){return this.#R}#b;#_;#S;#m;#C;#P;#i;#I;#v;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=hn,n,i,s,o,a){this.name=e,this.#b=s?qp(e):rl(e),this.#i=r&oV,this.nocase=s,this.roots=i,this.root=n||this,this.#I=o,this.#S=a.fullpath,this.#C=a.relative,this.#P=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=DO(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#I}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#O(i):this.#O(i)}#O(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#I.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#I.set(this,r),this.#i&=~RT,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?qp(e):rl(e);for(let c of n)if(c.#b===i)return c;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,hn,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#i|=Ln),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,r=this.parent;if(!r)return this.#C=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#m=`//?/${i}`:this.#m=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#m=n}isUnknown(){return(this.#i&pn)===hn}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.#i&pn)===xO}isDirectory(){return(this.#i&pn)===oi}isCharacterDevice(){return(this.#i&pn)===OO}isBlockDevice(){return(this.#i&pn)===MO}isFIFO(){return(this.#i&pn)===IO}isSocket(){return(this.#i&pn)===LO}isSymbolicLink(){return(this.#i&Gs)===Gs}lstatCached(){return this.#i&RO?this:void 0}readlinkCached(){return this.#v}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#v)return!0;if(!this.parent)return!1;let e=this.#i&pn;return!(e!==hn&&e!==Gs||this.#i&Lp||this.#i&Ln)}calledReaddir(){return!!(this.#i&RT)}isENOENT(){return!!(this.#i&Ln)}isNamed(e){return this.nocase?this.#b===qp(e):this.#b===rl(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#v=n}catch(r){this.#u(r.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#v=n}catch(r){this.#u(r.code);return}}#M(e){this.#i|=RT;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#x()}}#x(){this.#i&Ln||(this.#i=(this.#i|Ln)&Zc,this.#w())}#w(){let e=this.children();e.provisional=0;for(let r of e)r.#x()}#E(){this.#i|=$p,this.#L()}#L(){if(this.#i&tl)return;let e=this.#i;(e&pn)===oi&&(e&=Zc),this.#i=e|tl,this.#w()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#x():this.children().provisional=0}#$(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#x()}#u(e=""){let r=this.#i;r|=Lp,e==="ENOENT"&&(r|=Ln),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Zc),this.#i=r,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#B(e,r){return this.#A(e,r)||this.#F(e,r)}#F(e,r){let n=PT(e),i=this.newChild(e.name,n,{parent:this}),s=i.#i&pn;return s!==oi&&s!==Gs&&s!==hn&&(i.#i|=tl),r.unshift(i),r.provisional++,i}#A(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?qp(e.name):rl(e.name))===i.#b)return this.#j(e,i,n,r)}}#j(e,r,n,i){let s=r.name;return r.#i=r.#i&Zc|PT(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#i&Ln)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#i&Ln)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#z(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:g,mtimeMs:h,nlink:T,rdev:S,size:_,uid:v}=e;this.#N=r,this.#y=n,this.#R=i,this.#p=s,this.#d=o,this.#s=a,this.#k=c,this.#h=l,this.#t=u,this.#f=d,this.#c=f,this.#n=p,this.#g=g,this.#T=h,this.#r=T,this.#a=S,this.#l=_,this.#o=v;let R=PT(e);this.#i=this.#i&Zc|R|RO,R!==hn&&R!==oi&&R!==Gs&&(this.#i|=tl)}#H=[];#V=!1;#W(e){this.#V=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#V)return;this.#V=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),n.provisional=0;else{for(let a of o)this.#B(a,n);this.#M(n)}this.#W(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#B(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#U=void 0,n()}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 r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#B(n,e);this.#M(e)}catch(n){this.#q(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#i&PO)return!1;let e=pn&this.#i;return e===hn||e===oi||e===Gs}shouldWalk(e,r){return(this.#i&oi)===oi&&!(this.#i&PO)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!(($p|Lp|Ln)&this.#i))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#E()}}realpathSync(){if(this.#D)return this.#D;if(!(($p|Lp|Ln)&this.#i))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#E()}}[qO](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#C=n.join(this.sep),i.#P=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#C=void 0,i.#P=void 0,i=i.parent}},Fp=class t extends fr{sep="\\";splitSep=sV;constructor(e,r=hn,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=hn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ma.win32.parse(e).root}getRoot(e){if(e=iV(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new ga(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(AO,"$1\\"),e===r}},jp=class t extends fr{splitSep="/";sep="/";constructor(e,r=hn,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=hn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Up=class{root;rootPath;roots;cwd;#e;#t;#n;nocase;#r;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=el}={}){this.#r=DO(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,CO.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Bp,this.#t=new Bp,this.#n=new wT(s);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,f=this.rootPath,p=!1;for(let g of c){let h=u--;l=l.child(g,{relative:new Array(h).fill("..").join(d),relativePosix:new Array(h).fill("..").join("/"),fullpath:f+=(p?"":d)+g}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#t.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,i),i}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,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.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:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,g)=>{if(p)return f(p);let h=g.length;if(!h)return f();let T=()=>{--h===0&&f()};for(let S of g)(!s||s(S))&&a.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,o)?l(_,T):T()):S.shouldWalk(c,o)?l(S,T):T()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?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(n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(i&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?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 n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(i&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new us({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=(T,S,_=!1)=>{if(T)return a.emit("error",T);if(i&&!_){let v=[];for(let R of S)R.isSymbolicLink()&&v.push(R.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(v.length){Promise.all(v).then(()=>g(null,S,!0));return}}for(let v of S)v&&(!s||s(v))&&(a.write(n?v:v.fullpath())||(f=!0));u--;for(let v of S){let R=v.realpathCached()||v;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):h||d()},h=!0;p.readdirCB(g,!0),h=!1}};return d(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new us({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=p.readdirSync();for(let h of g)(!s||s(h))&&(a.write(n?h:h.fullpath())||(f=!0));u--;for(let h of g){let T=h;if(h.isSymbolicLink()){if(!(i&&(T=h.realpathSync())))continue;T.isUnknown()&&T.lstatSync()}T.shouldWalk(c,o)&&l.push(T)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[qO](r)}},ga=class extends Up{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,ma.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ma.win32.parse(e).root.toUpperCase()}newRoot(e){return new Fp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ya=class extends Up{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,ma.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new jp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},nl=class extends ya{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},cNe=process.platform==="win32"?Fp:jp,$O=process.platform==="win32"?ga:process.platform==="darwin"?nl:ya;var aV=t=>t.length>=1,cV=t=>t.length>=1,Ta=class t{#e;#t;#n;length;#r;#o;#f;#a;#d;#c;#l=!0;constructor(e,r,n,i){if(!aV(e))throw new TypeError("empty pattern list");if(!cV(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#n=n,this.#r=i,this.#n===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,p,...g]=this.#t;l[0]===""&&(l.shift(),g.shift());let h=[s,o,a,c,""].join("/"),T=[u,d,f,p,""].join("/");this.#e=[h,...l],this.#t=[T,...g],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.#n]}isString(){return typeof this.#e[this.#n]=="string"}isGlobstar(){return this.#e[this.#n]===er}isRegExp(){return this.#e[this.#n]instanceof RegExp}globString(){return this.#f=this.#f||(this.#n===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#n+1,this.#r),this.#o.#c=this.#c,this.#o.#d=this.#d,this.#o.#a=this.#a,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#r==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var lV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",va=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=lV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new Gr(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Ta(i,s,0,this.platform),a=new Gr(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 r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var ET=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},CT=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},DT=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},il=class t{hasWalkedCache;matches=new CT;subwalks=new DT;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new ET}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,d);continue}else if(c===er){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(i,a,d===""||d===".");else if(d===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===er?i.testGlobstar(s,o,l,a):c instanceof RegExp?i.testRegExp(s,c,l,a):i.testString(s,c,l,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var uV=(t,e)=>typeof t=="string"?new va([t],e):Array.isArray(t)?new va(t,e):t,Hp=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#n;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=uV(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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,r)}matchFinish(e,r){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new il(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())s++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new il(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())s++,this.walkCB2Sync(a,c,n.child(),o);o()}},sl=class extends Hp{matches=new Set;constructor(e,r,n){super(e,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},ol=class extends Hp{results;constructor(e,r,n){super(e,r,n),this.results=new us({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 dV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qn=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,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,BO.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||dV,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?ga:r.platform==="darwin"?nl:r.platform?ya:$O;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Gr(c,i)),[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 Ta(c,u,0,this.platform)})}async walk(){return[...await new sl(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 sl(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 ol(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 ol(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 AT=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Gr(r,e).hasMagic())return!0;return!1};function Vp(t,e={}){return new qn(t,e).streamSync()}function jO(t,e={}){return new qn(t,e).stream()}function UO(t,e={}){return new qn(t,e).walkSync()}async function FO(t,e={}){return new qn(t,e).walk()}function zp(t,e={}){return new qn(t,e).iterateSync()}function HO(t,e={}){return new qn(t,e).iterate()}var fV=Vp,pV=Object.assign(jO,{sync:Vp}),hV=zp,mV=Object.assign(HO,{sync:zp}),gV=Object.assign(UO,{stream:Vp,iterate:zp}),Ks=Object.assign(FO,{glob:FO,globSync:UO,sync:gV,globStream:jO,stream:pV,globStreamSync:Vp,streamSync:fV,globIterate:HO,iterate:mV,globIterateSync:zp,iterateSync:hV,Glob:qn,hasMagic:AT,escape:ua,unescape:Mn});Ks.glob=Ks;var hS=$(fb()),M$=$(A$());var dS={};RB(dS,{$id:()=>lJ,$schema:()=>cJ,default:()=>hJ,definitions:()=>dJ,properties:()=>pJ,title:()=>uJ,type:()=>fJ});var cJ="http://json-schema.org/draft-07/schema#",lJ="http://json-schema.org/draft-07/schema#",uJ="Core schema meta-schema",dJ={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},fJ=["object","boolean"],pJ={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},hJ={$schema:cJ,$id:lJ,title:uJ,definitions:dJ,type:fJ,properties:pJ,default:!0};var Yr=$(H());var Nm=class extends Ec{constructor(r,n){super();this.ajv=r;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(r,n){let i=[];if(n.disabled){let o=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(a=>i.push(j(21,a.firstToken,a.lastToken,a,{severity:Yr.DiagnosticSeverity.Hint,linkedTo:[...o?.ast?[o?.ast]:[]],tags:[Yr.DiagnosticTag.Unnecessary]}))),i}let s=X.toJson(n);try{this.validate?(this.validate(s),this.validate.errors&&(this.validate.errors.forEach(o=>i.push(...mJ(r,o,n,this.schemaKey))),console.log(this.schemaKey,`${n.pathString}`,this.validate.errors,s))):console.log("no validate")}catch(o){console.log(this.schemaKey,`${n.pathString}`,this.schemaKey,o)}return i}getOnPropertyHover(r){let n=(this.validate?.schema).properties?.[r];if(n&&typeof n=="object"&&"description"in n)return{kind:Yr.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
296
296
 
297
297
  `):n.description]:[]].join(`
298
- `)}}getSignatureHelp(){}getPropertyListCompletionItems(r){let n=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return n.map(s=>{let o=r&&i.some(l=>l===s),a=!!r.properties.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:Kr.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},mJ=(t,e,r,n)=>{let i=gJ(r,e.instancePath),s=i.node;if(e.keyword==="additionalProperties"){let a=s.getProperty(e.params.additionalProperty);return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`Node "${s.name}" ${e.message}: ${a.name}`],edit:Kr.TextEdit.del(zr(a.ast.firstToken.prevToken,a.ast.lastToken,!1)),codeActionTitle:"Remove property"})]:[]}else if(e.keyword==="type"){let a=s.getProperty(e.instancePath.split("/")[1]);return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`"${a.name}" ${e.message??"NO MESSAGE"}`]})]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let a=e.params.missingProperty,c=t.getOrderedNodeAst(s),l=zo(c);return c.map((u,d)=>{let f=l[d],p=u.openScope??f.lastToken;return j(0,f.firstToken,f.lastToken,f,{templateStrings:[a],edit:Kr.TextEdit.insert(Kr.Position.create(p.pos.line,p.pos.col+1),`
298
+ `)}}getSignatureHelp(){}getPropertyListCompletionItems(r){let n=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return n.map(s=>{let o=r&&i.some(l=>l===s),a=!!r.properties.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:Yr.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},mJ=(t,e,r,n)=>{let i=gJ(r,e.instancePath),s=i.node;if(e.keyword==="additionalProperties"){let a=s.getProperty(e.params.additionalProperty);return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`Node "${s.name}" ${e.message}: ${a.name}`],edit:Yr.TextEdit.del(zr(a.ast.firstToken.prevToken,a.ast.lastToken,!1)),codeActionTitle:"Remove property"})]:[]}else if(e.keyword==="type"){let a=s.getProperty(e.instancePath.split("/")[1]);return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`"${a.name}" ${e.message??"NO MESSAGE"}`]})]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let a=e.params.missingProperty,c=t.getOrderedNodeAst(s),l=zo(c);return c.map((u,d)=>{let f=l[d],p=u.openScope??f.lastToken;return j(0,f.firstToken,f.lastToken,f,{templateStrings:[a],edit:Yr.TextEdit.insert(Yr.Position.create(p.pos.line,p.pos.col+1),`
299
299
  ${"".padEnd(Jo(f.uri,u),t.context.formattingOptions.insertSpaces?" ".repeat(t.context.formattingOptions.tabSize):" ")}${a};`)})})}else if(e.keyword==="const"){let a=i.property;return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`Property "${a.name}" ${e.message}: ${e.params.allowedValue}`]})]:[]}else if(e.keyword==="enum"){let a=i.property;return a?[j(25,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:[`Property "${a.name}" ${e.message}:
300
300
  ${e.params.allowedValues.join(`
301
301
  `)}
@@ -303,4 +303,4 @@ ${n}`]})]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let a=s.get
303
303
  ${JSON.stringify(e)}
304
304
  ${n}`]})];let o=i.node.definitions[0]instanceof St?i.node.definitions[0]:i.node.definitions[0].name??i.node.definitions[0];return[j(25,o.firstToken,o.lastToken,o,{templateStrings:[`${e.message??"NO MESSAGE"}:
305
305
  ${JSON.stringify(e)}
306
- ${n}`]})]},gJ=(t,e)=>O$(t,e.split("/").filter(r=>r)),O$=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let r=e[0].split("@"),n=r[0],i=r.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(n,i);return s?O$(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var mS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(i=>!(i?.value instanceof ne)))return n?.values.map(i=>(i?.value).value)}parseMetaSchema(e,r){Ys.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,fS.resolve)(e,i);try{let s=hS.default.parse((0,pS.readFileSync)(i,"utf-8"));r.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,r){Ys.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,fS.resolve)(e,i);try{let s=hS.default.parse((0,pS.readFileSync)(i,"utf-8"));r.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,r,n){let i=`${e.join(";")}::${r.join(";")}`,s=this.ajvMap.get(i);return s||(s=new M$.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(dS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),r.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Nm(s,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=s.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}getBindings(){return Array.from(this.schemaIdValidators.keys())}},I$,gS=()=>(I$??=new mS,I$);var hu=require("path"),j$=require("fs"),U$=$(require("path")),H$=$(fb());var _n=$(H());var x$=()=>{let t=new K("nonposted-mmio",z("EMPTY"),"optional");return t.description=["Specifies that direct children of this bus should use non-posted memory accesses (i.e. a non-posted mapping mode) for MMIO ranges."],t};function L$(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="compatible");e.required=()=>"required";let r=t.properties.find(n=>n.name==="ranges");return r.required=()=>"required",t.addProperty(x$()),t}var q$=t=>{switch(t){case"string":return z("STRING");case"int":return z("U32");case"boolean":return z("EMPTY");case"array":return z("PROP_ENCODED_ARRAY");case"uint8-array":return z("BYTESTRING");case"string-array":return z("STRINGLIST");case"phandle":return z("U32");case"phandles":return z("PROP_ENCODED_ARRAY");case"phandle-array":return z("PROP_ENCODED_ARRAY");case"path":return z(["STRING","U32"]);case"compound":return z("ANY");default:return z("ANY")}},$$=(t,e)=>{switch(t){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(r=>typeof r=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(r=>typeof r=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(r=>typeof r=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},km=(t,e)=>{if(e.extends??=[],e=e.include.reduce((r,n)=>{let i=t.find(s=>(0,hu.basename)(s.filePath)===n.name);if(i){let s=n["property-blocklist"],o=n["property-allowlist"];return e.extends?.push(...r.include.map(a=>(0,hu.basename)(a.name,".yaml"))),r.include=r.include.filter(a=>a!==n),yJ(t,i,r,s,o)??r}return console.warn(`Unable to find ${n.name}`),r},e),e["child-binding"]&&(e["child-binding"].include=V$(e["child-binding"].include),e["child-binding"]=km(t,e["child-binding"])),!e.include.length)return e},yJ=(t,e,r,n=[],i)=>{let s=km(t,e),o=km(t,r);if(!s||!o)return;let a=new Set;Object.keys(s?.properties??{}).forEach(f=>a.add(f)),Object.keys(o?.properties??{}).forEach(f=>a.add(f));let c={};Array.from(a).forEach(f=>{let p=n?.some(h=>h===f)||i&&!i.some(h=>h===f)?void 0:s.properties?.[f]??void 0,g=o.properties?.[f]??void 0;(p||g)&&(c={...c,[f]:{...p??g}})}),o.properties=c,o.extends??=[],o.extends.push(...s.extends??[]);let l=new Set;return Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Array.from(l).forEach(f=>{let p=s[f]??[],g=o[f]??[];o[f]=Array.from([...p,...g])}),o["on-bus"]??=s["on-bus"],o.bus?o.bus.push(...s.bus??[]):o.bus=s.bus,o},V$=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],yS=class t{constructor(){this.typeCache=new Map;this.processedFolders=new Set;this.zephyrBindingCache=new Map}static getCompatibleKeys(e,r){return!r||!r.nodeType?.bus?.length?[e]:[...r.nodeType.bus.map(n=>`${e}::${n}`),e]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values?.values.filter(s=>s&&s.value instanceof ne);if(i?.length)return i.map(s=>s?.value?{name:s.value.value,ast:s.value}:void 0)}getNodeTypes(e,r){let n=t.getNodeCompatible(e)?.filter(a=>a);if(!n?.length){if(e.name==="zephyr,user"){let a=r.split(":"),l=Array.from(this.zephyrBindingCache.keys()).filter(d=>a.some(f=>d.startsWith(f))).flatMap(d=>this.zephyrBindingCache.get(d)).find(d=>d.filePath.endsWith("/base.yaml")),u=l?TS(l,e):void 0;if(u){u.warnMismatchProperties=!1;let d=u.properties.find(f=>f.name==="compatible");d&&(d.required=()=>"optional")}return{type:[u??ns(e)],issues:[]}}return{type:[ns(e)],issues:[]}}let i=n.flatMap(a=>t.getCompatibleKeys(a.name,e.parent).map(c=>this.typeCache.get(r)?.get(c)?.(e)).filter(c=>!!c)),s=this.getBusTypes(),o=n.flatMap(a=>{let c=t.getCompatibleKeys(a.name,e.parent).some(l=>this.typeCache.get(r)?.has(l));if(!c){let l=s.filter(u=>this.typeCache.get(r)?.has(`${a.name}::${u}`));if(l.length)return j(37,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:l})}return c?[]:[j(32,a.ast.firstToken,a.ast.lastToken,a.ast,{severity:_n.DiagnosticSeverity.Hint,tags:[_n.DiagnosticTag.Unnecessary],templateStrings:[a.name]})]});return{type:i.length?i:[ns(e)],issues:o}}loadTypeAndCache(e,r){e=Array.isArray(e)?e:[e];let n=e.filter(o=>this.processedFolders.has(o)).flatMap(o=>Array.from(this.zephyrBindingCache.entries()).flatMap(([a,c])=>a.startsWith(o)?[c]:[]));n.push(...e.filter(o=>!this.processedFolders.has(o)).flatMap(o=>(this.processedFolders.add(o),Ys.sync("**/*.yaml",{cwd:o,ignore:"test/*"}).map(c=>{if(c=(0,hu.resolve)(o,c),this.zephyrBindingCache.has(c))return this.zephyrBindingCache.get(c);try{let l=H$.default.parse((0,j$.readFileSync)(c,"utf-8")),u=V$(l?.include),d={...l,bus:l.bus?Array.isArray(l.bus)?l.bus:[l.bus]:void 0,include:u,rawInclude:[...u],filePath:c};return this.zephyrBindingCache.set(c,d),d}catch(l){console.warn(l)}}).filter(c=>!!c))));let i=n.map(o=>km(n,o)).filter(o=>!!o&&!o.include.length),s=this.typeCache.get(r);s||(s=new Map,s.set("simple-bus",()=>L$()),this.typeCache.set(r,s)),TJ(i,s)}getBindings(e){return Array.from(this.typeCache.get(e)?.keys()??[]).map(r=>r.split("::",1)[0])}getBusTypes(){let e=Array.from(this.zephyrBindingCache.values()).flatMap(r=>r.bus?.filter(n=>!!n)??[]).filter(r=>!!r);return Array.from(new Set(e))}getDocumentLinks(e,r){let n=this.zephyrBindingCache.get(Re(e.uri));if(!n)return[];let i=e.getText();return n.rawInclude.map(o=>{let c=new RegExp(o.name).exec(i);if(c){let l=e.positionAt(c.index),u=e.positionAt(c.index+c[0].length),d=Array.from(this.zephyrBindingCache.keys()).find(f=>f.endsWith(`${U$.default.sep}${o.name}`)&&r.some(p=>f.startsWith(p)));return d?{range:_n.Range.create(l,u),target:he(d)}:void 0}}).filter(o=>!!o)}},B$,Va=()=>(B$??=new yS,B$),TJ=(t,e)=>t.forEach(r=>{r.compatible&&e.set(r["on-bus"]?`${r.compatible}::${r["on-bus"]}`:r.compatible,n=>TS(r,n))}),TS=(t,e)=>{let r=ns(e);r.compatible=t.compatible,r.description=t.description,r.bindingsPath=t.filePath,r.bus=typeof t.bus=="string"?[t.bus]:Array.from(new Set(t.bus)),r.onBus=t["on-bus"],t.extends?.forEach(s=>r.extends.add(s)),r.warnMismatchProperties=!0;let i=Object.keys(t).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:t[s]}));if(r.cellsValues=i,Object.keys(t.properties??{}).forEach(s=>{let o=t.properties[s];vJ(r,s,o)}),t["child-binding"]){let s=t["child-binding"];r.childNodeType=o=>TS(s,o)}return r},vJ=(t,e,r)=>{let n=t.properties.find(i=>i.getNameMatch(e));if(n&&typeof n.name=="string"){n.required=()=>r.required?"required":"optional",n.values=()=>r.enum??[],n.constValue=$$(r.type,r.const),n.bindingType=r.type;let i=n.additionalTypeCheck;n.additionalTypeCheck=(s,o)=>[...F$(r,e,n)(s,o),...i?.(s,o)??[]]}else{let i=r.type==="compound"?n?.type:q$(r.type);i??=q$(r.type);let s=new K(e,i,r.required?"required":"optional",void 0,r.enum);s.additionalTypeCheck=(o,a)=>{let c=[...n?.additionalTypeCheck?.(o,a)??[],...F$(r,e,s)(o,a)];return s.signatureArgs??=n?.signatureArgs,s.signatureArgsCyclic??=!!n?.signatureArgsCyclic,c},s.description=r.description?[r.description]:n?.description,s.bindingType=r.type,s.constValue=$$(r.type,r.const),t.addProperty(s)}},F$=(t,e,r)=>{let n=t;return(i,s)=>{let o=i.parent.root,a=[];if(n.const){let l=i.ast.quickValues;if(l?.length==1){let u=Array.isArray(n.const)?n.const:[n.const];if(!(Array.isArray(l[0])&&u.length===l[0].length&&l[0].every((f,p)=>typeof f=="number"&&Number.isNaN(f)||u[p]===f))){let f=i.ast.values??i.ast;a.push(j(24,f.firstToken,f.lastToken,f,{templateStrings:[`Binding expects values to be "${n.type}" with value: ${n.const}`]}))}}}if(n.deprecated&&a.push(j(14,i.ast.firstToken,i.ast.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,tags:[_n.DiagnosticTag.Deprecated],templateStrings:[i.name]})),(n.type==="phandle"||n.type==="phandles"||n.type==="path")&&xe(i.ast.values)?.forEach(u=>{un(u,o)||a.push(j(22,u.firstToken,u.lastToken,u))}),n.type==="path"&&i.ast.values?.values.at(0)?.value instanceof ne){let l=i.ast.values?.values.at(0)?.value,u=[];l.value.split("/").every(d=>{let f=o.getNode(d);return f?u.push(d):a.push(j(23,l.firstToken,l.lastToken,l,{templateStrings:[d,`/${u.join("/")}`]})),!f})}let c=i.name.match(/^(.*)-(\d+)$/);if(n.type==="phandles"&&c){let l="";e.endsWith("-gpios")?l="gpio":l=n["specifier-space"]??c[1];let u=Number.parseInt(c[2],10),d=i.parent.getProperty(`${l}-names`);d&&(d.ast.quickValues?.at(u)||a.push(j(33,i.ast.firstToken,i.ast.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,linkedTo:[d.ast],templateStrings:[i.name,u.toString()]})))}if(n.type==="phandle-array"){let l=xe(i.ast.values),u=0,d=[],f=0;for(;l&&u<l.length;){let p=l.at(u),g=un(p,o);if(!g){let M=p??i.ast;a.push(j(22,M.firstToken,M.lastToken,M));break}let h="";e.endsWith("-gpios")?h="gpio":h=n["specifier-space"]??e.slice(0,-1);let T=g.getProperty(`#${h}-cells`);if(!T){a.push(j(16,i.ast.firstToken,i.ast.lastToken,i.ast,{linkedTo:[...g.nodeNameOrLabelRef],templateStrings:[i.name,`#${h}-cells`,`/${g.path.slice(1).join("/")}`]}));break}let S=T?$e(T,0,0,s)??0:0,_=g.nodeType?.cellsValues?.find(M=>M.specifier===h)?.values;if(d.push([`${f}_phandle`,..._?.map(M=>`${f}_${M}`)??[],...Array.from({length:S-(_?.length??0)},(M,F)=>`${f}_cell${S-(_?.length??0)?F:""}`)]),1+S>l.length-u){let M=p??i.ast;a.push(j(19,M.firstToken,M.lastToken,M,{templateStrings:[i.name,`<${d.at(-1).join(" ")}>`]}));break}u+=1+S;let v=l.slice(u-S,u),R={mappingValuesAst:v,specifierSpace:h,target:g};i.nexusMapsTo.push(R);let D=g.getProperty(`${h}-map`);if(D){let M=g.getNexusMapEntryMatch(h,s,v);M?.match?R.mapItem=M.match:a.push(j(31,M.entry.firstToken,M.entry.lastToken,M.entry,{linkedTo:[D.ast]}))}v.every(M=>M instanceof we)&&g.spesifierNexusMapping.push({expressions:v,node:i.parent,property:i});let B=i.parent.getProperty(`${h}-names`);p&&B&&(B.ast.quickValues?.at(f)||a.push(j(33,p.firstToken,l[u-1]?.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,linkedTo:[B.ast],templateStrings:[i.name,f.toString()]}))),f++}d.push([`${f}_phandle`,`${f}_cell...`]),r.signatureArgs=d.map(p=>p.map(g=>_n.ParameterInformation.create(g)))}return a}};var z$=(t,e)=>{let r=t.zephyrBindings.join(":");return e==="Zephyr"&&Va().loadTypeAndCache(t.zephyrBindings,r),{files:t,type:e,getNodeTypes:n=>{switch(e){case"Zephyr":return Va().getNodeTypes(n,r);case"DevicetreeOrg":return{type:gS().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n),issues:[]}}},getBindings:()=>{switch(e){case"Zephyr":return Va().getBindings(r);case"DevicetreeOrg":return gS().getBindings()}},getBusTypes:()=>{switch(e){case"Zephyr":return Va().getBusTypes();case"DevicetreeOrg":return[]}},getDocumentLinks(n){if(!n)return[];switch(e){case"Zephyr":return Va().getDocumentLinks(n,t.zephyrBindings);case"DevicetreeOrg":return[]}}}};var Rm=$(H());var bJ=t=>!t.lastToken.prevToken||!t.lastToken.prevToken.prevToken?[]:[{startLine:t.firstToken.pos.line,startCharacter:t.firstToken.pos.col,endLine:t.lastToken.prevToken.prevToken.pos.line,endCharacter:t.lastToken.prevToken.prevToken.pos.col,kind:Rm.FoldingRangeKind.Comment}],vS=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(vS):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Rm.FoldingRangeKind.Region},...t.nodes.flatMap(vS)],W$=t=>{let e=[];return[...t instanceof ts?t.ifBlocks.map(r=>({start:(r.expression??r.keyword).lastToken,end:r.content?.lastToken??(r.expression??r.keyword).lastToken})):[{start:(t.ifDef.identifier??t.ifDef.keyword).lastToken,end:t.ifDef.content?.lastToken}],t.elseOption?{start:t.elseOption.keyword.lastToken,end:t.elseOption.content?.lastToken}:null].forEach(r=>{!r||!r.end||e.push({startLine:r.start.pos.line,startCharacter:r.start.pos.col,endLine:r.end.pos.line,endCharacter:r.end.pos.colEnd,kind:Rm.FoldingRangeKind.Region})}),e},_J=t=>t instanceof lt?vS(t):t instanceof es||t instanceof ts?W$(t):t instanceof cn?bJ(t):[];function G$(t,e){return e.allAstItems.flatMap(r=>[r,...r.allDescendants]).filter(r=>le(r.uri,t)).flatMap(_J)}var mo=$(H());function SJ(t){if(!t||!(t.ast instanceof Me)&&!(t.ast instanceof Zt))return[];let e=r=>r.nodeType?.bindingsPath?[mo.Location.create(he(r.nodeType.bindingsPath),mo.Range.create(mo.Position.create(0,0),mo.Position.create(0,0)))]:[];return t.item instanceof X&&!Ut(t.ast)?e(t.item):t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof Me&&t.ast.linksTo?e(t.ast.linksTo):[]}async function Y$(t,e){return _t(t,e,r=>[...SJ(r)])}var Em=require("fs");var NJ=(t,e)=>{Or().reset(t),Or().requestTokens(t,!0),e(t)},Pm=class{constructor(e,r,n){this.file=e;this.cb=r;this.hasDocumentOpen=n}#e=0;watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,r=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),NJ(e,r)},(0,Em.watchFile)(e,this.onChange)}}unwatch(){this.count===1&&(console.log("dispose watch for",this.file),(0,Em.unwatchFile)(this.file,this.onChange),this.onChange=void 0),this.count--}get count(){return this.#e}set count(e){this.#e=e,e<0&&(this.#e=0,console.warn("unwatching an un watched file",this.file))}};var Xt=$(require("path")),bS=require("fs");var Vn=t=>{if(t)return Array.isArray(t)?t:[t]},kJ=t=>({...t,deviceOrgBindingsMetaSchema:Vn(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Vn(t.deviceOrgTreeBindings),includePaths:Vn(t.includePaths),lockRenameEdits:Vn(t.lockRenameEdits),zephyrBindings:Vn(t.zephyrBindings),overlays:Vn(t.overlays)}),K$=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Vn(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Vn(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Vn(t.defaultIncludePaths),defaultLockRenameEdits:Vn(t.defaultLockRenameEdits),defaultZephyrBindings:Vn(t.defaultZephyrBindings),contexts:t.contexts?.map(kJ)}),Sn=async(t,e=[])=>([...e.at(0)?[{replace:"${workspaceFolder}",uri:Re(e[0].uri)}]:[],...e.map(n=>({replace:`\${workspaceFolder:${n.name}}`,uri:Re(n.uri)}))].forEach(n=>t=t.replaceAll(n.replace,n.uri)),t),Ds={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0,defaultShowFormattingErrorAsDiagnostics:!0},_S=async(t,e,r)=>{let n=(t.cwd?await Sn(t.cwd,r):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(p=>Sn(p,r))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(p=>Sn(p,r))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(p=>Sn(p,r))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(p=>Sn(p,r))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(p=>Sn(p,r)));n&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[],f=t.compileCommands;return n&&(s=s.map(p=>(0,Xt.resolve)(n,p)).filter(p=>(0,bS.existsSync)(p)),a=a?.map(p=>(0,Xt.resolve)(n,p)),c=c.map(p=>(0,Xt.resolve)(n,p)),i=i.map(p=>(0,Xt.resolve)(n,p)),u=(0,Xt.resolve)(n,u),d=d.map(p=>(0,Xt.resolve)(n,p)),l=l.map(p=>(0,Xt.resolve)(n,p)),f=f?(0,Xt.resolve)(n,f):void 0),{ctxName:t.ctxName??(0,Xt.basename)(u),cwd:n?nt(n):void 0,includePaths:i.map(nt),zephyrBindings:s.map(nt),bindingType:o,deviceOrgTreeBindings:a.map(nt),deviceOrgBindingsMetaSchema:c.map(nt),dtsFile:nt(u),overlays:d.map(nt),lockRenameEdits:l.map(nt),compileCommands:f?nt(f):void 0,showFormattingErrorAsDiagnostics:t.showFormattingErrorAsDiagnostics??e.defaultShowFormattingErrorAsDiagnostics}},mu=async(t,e)=>{let r=t.cwd?await Sn(t.cwd,e):void 0,n=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>Sn(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>Sn(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>Sn(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>Sn(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>Sn(d,e)));r&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Xt.resolve)(r,d)),n==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Xt.resolve)(r,d)),i=i.map(d=>(0,Xt.resolve)(r,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Xt.resolve)(r,d)),c=c.map(d=>(0,Xt.resolve)(r,d)));let l={cwd:r,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:n,autoChangeContext:t.autoChangeContext??Ds.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Ds.allowAdhocContexts,defaultShowFormattingErrorAsDiagnostics:t.defaultShowFormattingErrorAsDiagnostics??Ds.defaultShowFormattingErrorAsDiagnostics},u=(await Promise.all(t.contexts?.map(d=>_S(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,bS.existsSync)(f)&&Xt.default.isAbsolute(f)));return{...l,contexts:u}};var X$=t=>`DT_PROP(${SS(t.parent)}, ${t.name.replaceAll("-","_")}))`,J$=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var SS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Q$=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Z$=t=>{let e=[];return ti.getNodeFromPath(["aliases"],t.root)?.properties.filter(i=>{if(i.ast.quickValues?.at(0)===t.pathString)return!0;let s=i.ast.values?.values.at(0)?.value;if(s instanceof ie&&s.linksTo===t||s instanceof it&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function RJ(t,e){if(!t||!(t.item instanceof Xe)||!(t.ast instanceof et))return[];let r=[];return e.settings.bindingType==="Zephyr"&&(r.push({type:"dt_zephyr_macro_prop_node_path",data:X$(t.item)}),J$(t.item).forEach(n=>{r.push({type:"dt_zephyr_macro_prop_node_label",data:n})})),r}function PJ(t,e){if(!t||t.item===null)return[];let r;if(t.item instanceof X?r=t.item:t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo?r=t.ast.parentNode.linksTo:t.ast instanceof Me&&t.ast.linksTo&&(r=t.ast.linksTo),!r)return[];let n=[{type:"path",data:r.pathString}];return e.settings.bindingType==="Zephyr"&&(Q$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_node_label",data:i})}),n.push({type:"dt_zephyr_macro_node_path",data:SS(r)}),Z$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),n}async function eB(t,e){return e?_t(t,e,r=>[...PJ(r,e),...RJ(r,e)]):[]}var tB=$(H());function EJ(t){return!t||!(t.item instanceof Xe)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function wJ(t){let e=yc(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let n=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!n||!(n instanceof ei))return;let i=n.params.map(o=>({label:o instanceof Dt?o.name:"..."})),s=e.params.find(o=>o&&(t.ast===o||o.isAncestorOf(t.ast)));return s??=t.afterAst?e.params.find(o=>o&&(t.afterAst===o||o.isAncestorOf(t.afterAst))):void 0,s??=t.beforeAst?e.params.find(o=>o&&(t.beforeAst===o||o.isAncestorOf(t.beforeAst))):void 0,{signatures:[tB.SignatureInformation.create(`${e.functionName.name}(${i.map(o=>o.label).join(", ")})`,void 0,...i.flat())],activeSignature:0,activeParameter:s?e.params.indexOf(s):void 0}}async function rB(t,e){if(e)return(await _t(t,e,async r=>[await wJ(r)||EJ(r)])).at(0)}var nB=require("timers"),iB=require("events");var NS=class extends iB.EventEmitter{constructor(e=3e3,r=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,nB.setInterval)(()=>{let n=process.memoryUsage().heapUsed;n>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(n/1024/1024).toFixed(2),thresholdMb:e})},r)}stop(){clearInterval(this.interval)}},DJ=new NS(3e3),sB=()=>{DJ.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),BE(),$E()})};var Ve=[],ce,Wa,wm=new WeakMap,gu=new Map;sB();var aB=t=>{t.getContextFiles().forEach(e=>{gu.has(e)||gu.set(e,new Pm(e,DS,r=>!!Cm(r))),gu.get(e)?.watch()})},ES=async t=>{let e=Ve.indexOf(t);if(e===-1)return;Tu(t,void 0,!0),wm.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let r=await As(t);if(te.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:r.type}),Ve.splice(e,1),await OS(),t===ce&&(ce=void 0,Ve.length)){let n=Wa?an(Ve,{uri:Wa}):void 0;n??=Ve[0],console.log("Active context was deleted. Forcing active to",n.id),await Jt({id:n.id},!0)}t.getContextFiles().map(n=>gu.get(n)?.unwatch())},CJ=t=>{let e=wm.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},Fe=async()=>{await Promise.all(Ve.map(CJ))},wS=async t=>(await cB()).indexOf(t)!==-1,cB=async()=>{let t=await lB();return Ve.filter(e=>!t.some(r=>r===e))},lB=async()=>{let t=await PS();return Ve.filter(e=>t.contexts.find(r=>Ni(r)===e.id))},AJ=async()=>{let t=await qJ();return Ve.filter(e=>t.contexts.find(r=>Ni(r)===e.id))},OJ=async t=>(await AJ()).indexOf(t)!==-1,IJ=async(t,e)=>{if(t===e)return!0;let r=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),n=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return n.some(i=>le(i.resolvedPath,t.parser.uri))&&r.length?r.every(i=>n.some(s=>s.resolvedPath===i.resolvedPath&&s.firstToken.pos.col===i.firstToken.pos.col&&s.firstToken.pos.len===i.firstToken.pos.len&&s.firstToken.pos.line===i.firstToken.pos.line&&s.lastToken.pos.col===i.lastToken.pos.col&&s.lastToken.pos.len===i.lastToken.pos.len&&s.lastToken.pos.line===i.lastToken.pos.line)):e.getContextFiles().some(i=>le(i,t.parser.uri))},MJ=async t=>{if(!await wS(t))return;let e=await cB(),r=await lB(),n=await cf(e);if(Ve.indexOf(t)===-1)return;let i=await Promise.all(n.flatMap(a=>[...r,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await IJ(a.context,c)})))),s=t.getContextFiles(),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&le(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&await Promise.all(o.map(ES))},te=(0,We.createConnection)(We.ProposedFeatures.all),gr=new We.TextDocuments(Kn),uB=!1,Dm=!1,dB=!1,fB=!1,pB=!1,kS;te.onInitialize(async t=>{kS=t.workspaceFolders??[],te.console.log(`[Server(${process.pid}) ${kS?.at(0)?.uri} Version 0.6.2 ] Started and initialize received`);let e=t.capabilities;uB=!!(e.workspace&&e.workspace.configuration),Dm=!!(e.workspace&&e.workspace.workspaceFolders),dB=!!e.workspace?.diagnostics?.refreshSupport,fB=!!e.workspace?.semanticTokens?.refreshSupport,pB=!!e.workspace?.foldingRange?.refreshSupport;let r={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:We.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," ",'"',"(",","]},codeActionProvider:{codeActionKinds:[We.CodeActionKind.QuickFix,We.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:rf,tokenModifiers:nf},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return Dm&&(r.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),await yB(t.initializationOptions),r});var RS,xJ={tabSize:8,insertSpaces:!1,trimTrailingWhitespace:!0,insertFinalNewline:!0};te.onInitialized(async()=>{if(uB&&(te.client.register(We.DidChangeConfigurationNotification.type,{}),!RS)){let t=await te.workspace.getConfiguration("editor").catch(()=>{}),e=await te.workspace.getConfiguration("[devicetree]").catch(()=>{}),r={tabSize:e?.["editor.tabSize"],insertSpaces:e?.["editor.insertSpaces"],trimFinalNewlines:e?.["editor.trimFinalNewlines"],trimTrailingWhitespace:e?.["editor.trimTrailingWhitespace"],insertFinalNewline:e?.["editor.insertFinalNewline"]};(t||r)&&(RS={...t,...r})}Dm&&te.workspace.onDidChangeWorkspaceFolders(async t=>{te.console.log("Workspace folder change event received"),await _u()})});te.onRequest("workspace/workspaceFolders",async()=>kS??null);var LJ=async()=>{let t=hB();return t={...Ds,...t},mu(t,await bu())},PS=async()=>{let t=BJ();return t={...Ds,...t},mu(t,await bu())},qJ=async()=>{let t=FJ();return t={...Ds,...t},mu(t,await bu())},vu=async()=>{let t=$J();return t={...Ds,...t},mu(t,await bu())},bu=async()=>Dm?await te.workspace.getWorkspaceFolders()??[]:[],oB=async t=>{let e=an(Ve,{id:Ni(t)});if(e)return e.ctxNames.includes(t.ctxName)||console.log(`(ID: ${e.id}) Adding name ${t.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(t.ctxName),e;let r=Ni(t);console.log(`(ID: ${r}) New context [${t.ctxName}]`),console.log(`(ID: ${r}) Settings: ${JSON.stringify(t,void 0," ")}`);let n=(0,Ga.join)((0,Ga.dirname)(t.dtsFile),"dts","bindings"),i=new qf(t,RS??xJ,t.bindingType?z$({zephyrBindings:t.zephyrBindings?[n,...t.zephyrBindings]:[n],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Ve.push(i),await i.stable(),aB(i);let s=await As(i);return te.sendNotification("devicetree/contextCreated",{ctxNames:i.ctxNames.map(o=>o.toString()),id:i.id,...await i.getFileTree(),settings:i.settings,active:i===ce,type:s.type}),await MJ(i),await OS(),i},_u=async()=>{let t=await PS(),e=await vu();e.allowAdhocContexts||(e=await PS());let r=e.contexts.map(Ni),n=Ve.filter(i=>!r.includes(i.id));await Promise.all(n.map(ES)),await t.contexts?.reduce((i,s)=>i.then(async()=>{await oB(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await LJ()).contexts?.reduce((s,o)=>s.then(async()=>{an(Ve,{uri:o.dtsFile})||await oB(o)}),Promise.resolve()),Wa?await Jt({uri:Wa}):!ce&&Ve.length&&(console.log(`No active context using first context (ID: ${Ve[0].id}) [${Ve[0].ctxNames.join(",")}]`),await Jt({id:Ve[0].id}))},Nn,Cs,yu=new Map,za=new Map,$J=()=>!Cs&&!Nn?void 0:{...Cs,...Nn,contexts:[...Nn?.contexts??[],...Array.from(za.values()),...Array.from(yu.values())]},hB=()=>!Cs&&!Nn?void 0:{...Cs,...Nn,contexts:[...Array.from(yu.values())]},BJ=()=>!Cs&&!Nn?void 0:{...Cs,...Nn,contexts:[...Nn?.contexts??[],...Array.from(za.values())]},FJ=()=>!Cs&&!Nn?void 0:{...Nn,contexts:[...Nn?.contexts??[]]};function jJ(t){let e={...t};for(let r in e)e[r]===null&&delete e[r];return e}var mB=async()=>{let t=await vu();console.log("Resolved settings",JSON.stringify(t,void 0," ")),te.sendNotification("devicetree/settingsChanged",t),await _u(),Fe().then(()=>{dB&&te.languages.diagnostics.refresh()})},UJ=async()=>{let t=ce?.getContextFiles();await Promise.all(Array.from(gr.keys()).filter(Bt).map(async e=>{t?.some(r=>le(r,Re(e)))||await te.sendDiagnostics({uri:e,version:gr.get(e)?.version,diagnostics:[{severity:We.DiagnosticSeverity.Information,range:We.Range.create(We.Position.create(0,0),We.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})}))},DS=async t=>{let e=xy(Ve,t);if(e.length)e.sort((r,n)=>r===ce?-1:n===ce?1:0).forEach(r=>{wm.get(r)?.abort.abort();let n=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(n.signal.aborted){s();return}let o=performance.now(),a=ce===r,c=a?gB(r):[],l=r.getContextFiles();await r.reevaluate(t),aB(r),l.forEach(p=>gu.get(p)?.unwatch()),a&&IS(r)?.length&&CS(r).then(p=>{let g=p.items.map(h=>({uri:h.uri,version:h.version??void 0,diagnostics:h.items}));Tu(r,c.filter(h=>g.every(T=>T.uri!==h.uri))),g.forEach(h=>{te.sendDiagnostics(h)}),Su.set(r,!0)});let[u,d]=await Promise.all([As(r),r.getFileTree()]),f={ctxNames:r.ctxNames.map(p=>p.toString()),id:r.id,...d,settings:r.settings,active:a,type:u.type};ce===r&&te.sendNotification("devicetree/activeContextStableNotification",f),te.sendNotification("devicetree/contextStableNotification",f),s(),console.log("reevaluate",performance.now()-o)},50)});wm.set(r,{abort:n,promise:i})});else{if((await vu()).allowAdhocContexts===!1)return;await _u(),await Jt({uri:t})}},HJ=t=>gr.keys().find(e=>le(Re(e),t)),Cm=t=>{let e=HJ(t);if(e)return gr.get(e)},gB=t=>t.getContextFiles().map(e=>({uri:he(e),version:Cm(e)?.version,diagnostics:[]})),Su=new WeakMap,Tu=async(t,e=gB(t),r=!1)=>{if(!r&&t!==ce)return;let n=performance.now();await Promise.all(e.filter(i=>t===ce||!ce?.getContextFiles().some(s=>le(Re(i.uri),s))).map(i=>te.sendDiagnostics({uri:i.uri,version:gr.get(i.uri)?.version,diagnostics:[]}))),Su.delete(t),console.log(`(ID: ${t.id})`,"clear workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-n)},CS=async t=>{await t.stable();let e=performance.now(),r=await t.getDiagnostics(),n=await Promise.all(t.getContextFiles().map(async i=>{let s=Cm(i),o=[];return s&&t.settings.showFormattingErrorAsDiagnostics&&o.push(...(await Rf({textDocument:s,options:t.formattingOptions},t,s?.getText(),"File Diagnostics")).map(a=>a.diagnostic())),{uri:he(i),kind:We.DocumentDiagnosticReportKind.Full,items:[...r.get(i)??[],...o],version:s?.version??null}}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...n]}},AS=async t=>{let{items:e}=await CS(t);e.map(r=>({uri:r.uri,version:r.version??void 0,diagnostics:r.items})).forEach(async r=>{te.sendDiagnostics(r)}),Su.set(t,!0)},OS=async()=>{let t=await Promise.all(Ve.map(As));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,ce===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},As=async t=>{let e=await wS(t),r=!e&&await OJ(t);return{ctx:t,type:e?"Ad Hoc":r?"User":"3rd Party"}},Jt=async(t,e=!1)=>{if("uri"in t){if(!Bt(t.uri))return!1;Wa=t.uri,console.log("Active File Uri",Wa)}let r=await vu();if(ce&&!e&&!r.autoChangeContext||(await Fe(),!e&&ce?.getContextFiles().find(o=>"uri"in t&&le(o,t.uri))))return!1;let n=ce,i=an(Ve,t),s=n!==i;return s&&(n&&Tu(n),ce=i,i?(As(i).then(async o=>{let a=await i.getFileTree();!i||i!==ce&&!Ve.includes(i)||te.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(c=>c.toString()),id:i.id,...a,settings:i.settings,active:ce===i,type:o.type})}),IS(i)?.length&&AS(i),await OS()):te.sendNotification("devicetree/newActiveContext",void 0)),pB&&te.languages.foldingRange.refresh(),fB&&te.languages.semanticTokens.refresh(),s},Bt=t=>[".dts",".dtsi",".dtso",".overlay"].some(e=>t.endsWith(e));gr.listen(te);var IS=t=>t?.getContextFiles()?.filter(e=>Cm(e));gr.onDidClose(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;let r=xy(Ve,e);if(r.length===0){yu.delete(e),te.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(r.map(async n=>{!!IS(n)?.filter(s=>s!==e).length?ce?.getContextFiles().some(s=>le(s,e))?ce?.getContextFiles().some(s=>le(s,e))&&(await Tu(ce),await AS(ce)):te.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]}):await wS(n)?(await ES(n),yu.delete(n.settings.dtsFile)):Tu(n)}))});gr.onDidOpen(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;await Fe(),UJ();let r=an(Ve,{uri:e});if(console.log("onDidOpen",r?.id,e),r)r!==ce?await Jt({id:r.id}):r===ce&&(!Su.get(r)||r.getContextFiles().some(n=>!le(n,e)))&&await AS(r);else{let n={ctxName:(0,Ga.basename)(e),dtsFile:e};yu.set(e,n),await DS(e)}});gr.onDidChangeContent(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;let r=t.document.getText(),n=Or();n.needsRenew(e,r)&&(console.log("Content changed"),n.renewLexer(e,r),await DS(e))});var yB=async t=>{t?.settings?.devicetree&&(Nn=K$(jJ(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await mB())};te.onDidChangeConfiguration(async t=>{await yB(t)});te.listen();te.languages.diagnostics.onWorkspace(async()=>{await Fe();let t=ce;return t?CS(t).finally(()=>{Su.set(t,!0)}):{items:[]}});te.onDidChangeWatchedFiles(t=>{te.console.log("We received a file change event")});te.onCompletion(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return nA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return[];await Fe(),Jt({uri:e});let r=yr(e);return r?[...await jD(t,r),...await bA(t,r)]:[]});te.onCompletionResolve(t=>t);var yr=t=>{let e=hB();return an(Ve,{uri:t},ce,e?.preferredContext)};te.onDocumentSymbol(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return[];await Fe();let r=yr(e);return r?r.getUriParser(e)?.getDocumentSymbols(e):[]});te.onWorkspaceSymbol(async()=>{await Fe();let t=ce;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});te.languages.semanticTokens.on(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return{data:[]};try{await Fe();let r=yr(e),n=new We.SemanticTokensBuilder,i=r?.isInContext(e);return!r||!i?{data:[]}:((await r.getAllParsers()).forEach(s=>s.buildSemanticTokens(n,e)),n.build())}catch(r){throw console.log(r),r}});te.onDocumentLinks(async t=>{await Fe();let e=Re(t.textDocument.uri);return Bt(e)?yr(e)?.getDocumentLinks(e):e.endsWith(".yaml")&&ce?ce.bindingLoader?.getDocumentLinks?.(gr.get(t.textDocument.uri))??[]:[]});te.onPrepareRename(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return lA(t,r)});te.onRenameRequest(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return cA(t,r)});te.onReferences(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return iA(t,r)});te.onDefinition(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return hA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e),n=(await r?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>We.Location.create(i.target,i.range))??[];return n.length?n:fA(t,r)});te.onDeclaration(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return gA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return pA(t,r)});te.onCodeAction(async t=>{let e=Re(t.textDocument.uri);if(Bt(e))return TA(t)});var TB=async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);if(!r)return[];if((await r.getSyntaxIssues(void 0,l=>Vo(l,e,!1))).get(e)?.length)return[];let i=Or().getDocument(e),s=i.getText(),o=await Rf(t,r,s,"New Text");if(o===s)return[];let a=i.lineCount-1,c=i.getText({start:{line:a,character:0},end:{line:a+1,character:0}}).length;return[We.TextEdit.replace(We.Range.create(We.Position.create(0,0),We.Position.create(i.lineCount,c)),o)]};te.onDocumentRangeFormatting(TB);te.onDocumentFormatting(TB);te.onHover(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return HO(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe();let r=yr(e);return(await _A(t,r)).at(0)});te.onFoldingRanges(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe();let r=yr(e),n=r?.isInContext(e);if(!r||!n)return[];let i=(await r.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?G$(e,i):[]});te.onTypeDefinition(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return Y$(t,r)});te.onSignatureHelp(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return rB(t,r)});te.onRequest("devicetree/getContexts",async()=>(await Fe(),Promise.all(Ve.map(async t=>{let e=await As(t);return{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:e.type}}))));te.onRequest("devicetree/setActive",async t=>(await Fe(),console.log("devicetree/setActive",t),await Jt(t,!0)));te.onRequest("devicetree/getActiveContext",async()=>{if(await Fe(),console.log("devicetree/getActiveContext"),!ce)return;let t=await As(ce);return ce?{ctxNames:ce.ctxNames.map(e=>e.toString()),id:ce.id,...await ce.getFileTree(),settings:ce.settings,active:!0,type:t.type}:void 0});te.onRequest("devicetree/setDefaultSettings",async t=>{await Fe(),Cs=t,console.log("Integration Settings",t),await mB()});te.onRequest("devicetree/requestContext",async t=>{await Fe();let e=await vu(),r=await _S(t,e,await bu());console.log("devicetree/requestContext",r);let n=Ni(r),i=Array.from(za).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];an(Ve,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),za.delete(i[0])}za.set(`${n}:${t.ctxName}`,t),await _u();let s=Ve.find(a=>a.id===n);if(!s)throw new Error("Failed to create context");let o=await As(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:n,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});te.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await Fe(),za.delete(`${t}:${e}`);let r=an(Ve,{id:t});if(r){if(r.removeCtxName(e),r.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await _u()}});te.onRequest("devicetree/compiledDtsOutput",async t=>{if(await Fe(),!t)return;let e=an(Ve,{id:t});if(!e)return;let r=await e.toFullString();return Hy({textDocument:{uri:he(e.settings.dtsFile)},options:e.formattingOptions},r,"New Text")});te.onRequest("devicetree/serializedContext",async t=>(await Fe(),t?an(Ve,{id:t})?.serialize():void 0));te.onRequest("devicetree/activePath",async t=>{if(await Fe(),!ce)return;let e=r=>{if(r?.item)return r.item instanceof X?{nodePath:r.item.pathString}:{nodePath:r.item.parent.pathString,propertyName:r.item.name}};return(await _t(t,ce,r=>[e(r)])).at(0)});te.onRequest("devicetree/customActions",async t=>(await Fe(),eB(t,ce)));te.onRequest("devicetree/activeFileUri",async t=>{await Fe(),Jt({uri:t})});var VJ=async(t,e,r)=>{if((await e.getSyntaxIssues(void 0,o=>Vo(o,r,!1))).get(r)?.length)throw new Error("Unable to format. Files has syntax issues.");let i=Or().getDocument(r);return await Rf(t,e,i.getText(),"New Text")};te.onRequest("devicetree/formattingText",async t=>{await Fe();let e=Re(t.textDocument.uri),r=yr(e);if(r)return Jt({uri:e}),VJ(t,r,e);let n=Or().getDocument(e,t.text),i=await Hy(t,n.getText(),"Both");return{text:i.text,diagnostics:i.diagnostic.map(s=>s.diagnostic())}});te.onRequest("devicetree/diagnosticIssues",async({uri:t,full:e})=>{await Fe();let r=Re(t);Jt({uri:r});let n=yr(r);if(!n)return[];let i=e?(await n.getDiagnostics()).get(r):(await n.getSyntaxIssues(void 0,s=>Vo(s,r,!!e))).get(r);if(i?.length)return i});te.onRequest("devicetree/evalMacros",async({macros:t,ctxId:e})=>{await Fe();let r=an(Ve,{id:e});return r?t.map(n=>{let i=sf(n,r.macros),s=De(i);return{macro:n,evaluated:typeof s=="number"?s:i}}):[]});
306
+ ${n}`]})]},gJ=(t,e)=>I$(t,e.split("/").filter(r=>r)),I$=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let r=e[0].split("@"),n=r[0],i=r.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(n,i);return s?I$(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var mS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(i=>!(i?.value instanceof ne)))return n?.values.map(i=>(i?.value).value)}parseMetaSchema(e,r){Ks.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,fS.resolve)(e,i);try{let s=hS.default.parse((0,pS.readFileSync)(i,"utf-8"));r.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,r){Ks.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,fS.resolve)(e,i);try{let s=hS.default.parse((0,pS.readFileSync)(i,"utf-8"));r.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,r,n){let i=`${e.join(";")}::${r.join(";")}`,s=this.ajvMap.get(i);return s||(s=new M$.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(dS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),r.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Nm(s,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=s.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}getBindings(){return Array.from(this.schemaIdValidators.keys())}},O$,gS=()=>(O$??=new mS,O$);var hu=require("path"),j$=require("fs"),U$=$(require("path")),H$=$(fb());var _n=$(H());var x$=()=>{let t=new Y("nonposted-mmio",z("EMPTY"),"optional");return t.description=["Specifies that direct children of this bus should use non-posted memory accesses (i.e. a non-posted mapping mode) for MMIO ranges."],t};function L$(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="compatible");e.required=()=>"required";let r=t.properties.find(n=>n.name==="ranges");return r.required=()=>"required",t.addProperty(x$()),t}var q$=t=>{switch(t){case"string":return z("STRING");case"int":return z("U32");case"boolean":return z("EMPTY");case"array":return z("PROP_ENCODED_ARRAY");case"uint8-array":return z("BYTESTRING");case"string-array":return z("STRINGLIST");case"phandle":return z("U32");case"phandles":return z("PROP_ENCODED_ARRAY");case"phandle-array":return z("PROP_ENCODED_ARRAY");case"path":return z(["STRING","U32"]);case"compound":return z("ANY");default:return z("ANY")}},$$=(t,e)=>{switch(t){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(r=>typeof r=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(r=>typeof r=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(r=>typeof r=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},km=(t,e)=>{if(e.extends??=[],e=e.include.reduce((r,n)=>{let i=t.find(s=>(0,hu.basename)(s.filePath)===n.name);if(i){let s=n["property-blocklist"],o=n["property-allowlist"];return e.extends?.push(...r.include.map(a=>(0,hu.basename)(a.name,".yaml"))),r.include=r.include.filter(a=>a!==n),yJ(t,i,r,s,o)??r}return console.warn(`Unable to find ${n.name}`),r},e),e["child-binding"]&&(e["child-binding"].include=V$(e["child-binding"].include),e["child-binding"]=km(t,e["child-binding"])),!e.include.length)return e},yJ=(t,e,r,n=[],i)=>{let s=km(t,e),o=km(t,r);if(!s||!o)return;let a=new Set;Object.keys(s?.properties??{}).forEach(f=>a.add(f)),Object.keys(o?.properties??{}).forEach(f=>a.add(f));let c={};Array.from(a).forEach(f=>{let p=n?.some(h=>h===f)||i&&!i.some(h=>h===f)?void 0:s.properties?.[f]??void 0,g=o.properties?.[f]??void 0;(p||g)&&(c={...c,[f]:{...p??g}})}),o.properties=c,o.extends??=[],o.extends.push(...s.extends??[]);let l=new Set;return Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Array.from(l).forEach(f=>{let p=s[f]??[],g=o[f]??[];o[f]=Array.from([...p,...g])}),o["on-bus"]??=s["on-bus"],o.bus?o.bus.push(...s.bus??[]):o.bus=s.bus,o},V$=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],yS=class t{constructor(){this.typeCache=new Map;this.processedFolders=new Set;this.zephyrBindingCache=new Map}static getCompatibleKeys(e,r){return!r||!r.nodeType?.bus?.length?[e]:[...r.nodeType.bus.map(n=>`${e}::${n}`),e]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values?.values.filter(s=>s&&s.value instanceof ne);if(i?.length)return i.map(s=>s?.value?{name:s.value.value,ast:s.value}:void 0)}getNodeTypes(e,r){let n=t.getNodeCompatible(e)?.filter(a=>a);if(!n?.length){if(e.name==="zephyr,user"){let a=r.split(":"),l=Array.from(this.zephyrBindingCache.keys()).filter(d=>a.some(f=>d.startsWith(f))).flatMap(d=>this.zephyrBindingCache.get(d)).find(d=>d.filePath.endsWith("/base.yaml")),u=l?TS(l,e):void 0;if(u){u.warnMismatchProperties=!1;let d=u.properties.find(f=>f.name==="compatible");d&&(d.required=()=>"optional")}return{type:[u??ns(e)],issues:[]}}return{type:[ns(e)],issues:[]}}let i=n.flatMap(a=>t.getCompatibleKeys(a.name,e.parent).map(c=>this.typeCache.get(r)?.get(c)?.(e)).filter(c=>!!c)),s=this.getBusTypes(),o=n.flatMap(a=>{let c=t.getCompatibleKeys(a.name,e.parent).some(l=>this.typeCache.get(r)?.has(l));if(!c){let l=s.filter(u=>this.typeCache.get(r)?.has(`${a.name}::${u}`));if(l.length)return j(37,a.ast.firstToken,a.ast.lastToken,a.ast,{templateStrings:l})}return c?[]:[j(32,a.ast.firstToken,a.ast.lastToken,a.ast,{severity:_n.DiagnosticSeverity.Hint,tags:[_n.DiagnosticTag.Unnecessary],templateStrings:[a.name]})]});return{type:i.length?i:[ns(e)],issues:o}}loadTypeAndCache(e,r){e=Array.isArray(e)?e:[e];let n=e.filter(o=>this.processedFolders.has(o)).flatMap(o=>Array.from(this.zephyrBindingCache.entries()).flatMap(([a,c])=>a.startsWith(o)?[c]:[]));n.push(...e.filter(o=>!this.processedFolders.has(o)).flatMap(o=>(this.processedFolders.add(o),Ks.sync("**/*.yaml",{cwd:o,ignore:"test/*"}).map(c=>{if(c=(0,hu.resolve)(o,c),this.zephyrBindingCache.has(c))return this.zephyrBindingCache.get(c);try{let l=H$.default.parse((0,j$.readFileSync)(c,"utf-8")),u=V$(l?.include),d={...l,bus:l.bus?Array.isArray(l.bus)?l.bus:[l.bus]:void 0,include:u,rawInclude:[...u],filePath:c};return this.zephyrBindingCache.set(c,d),d}catch(l){console.warn(l)}}).filter(c=>!!c))));let i=n.map(o=>km(n,o)).filter(o=>!!o&&!o.include.length),s=this.typeCache.get(r);s||(s=new Map,s.set("simple-bus",()=>L$()),this.typeCache.set(r,s)),TJ(i,s)}getBindings(e){return Array.from(this.typeCache.get(e)?.keys()??[]).map(r=>r.split("::",1)[0])}getBusTypes(){let e=Array.from(this.zephyrBindingCache.values()).flatMap(r=>r.bus?.filter(n=>!!n)??[]).filter(r=>!!r);return Array.from(new Set(e))}getDocumentLinks(e,r){let n=this.zephyrBindingCache.get(Re(e.uri));if(!n)return[];let i=e.getText();return n.rawInclude.map(o=>{let c=new RegExp(o.name).exec(i);if(c){let l=e.positionAt(c.index),u=e.positionAt(c.index+c[0].length),d=Array.from(this.zephyrBindingCache.keys()).find(f=>f.endsWith(`${U$.default.sep}${o.name}`)&&r.some(p=>f.startsWith(p)));return d?{range:_n.Range.create(l,u),target:he(d)}:void 0}}).filter(o=>!!o)}},B$,Va=()=>(B$??=new yS,B$),TJ=(t,e)=>t.forEach(r=>{r.compatible&&e.set(r["on-bus"]?`${r.compatible}::${r["on-bus"]}`:r.compatible,n=>TS(r,n))}),TS=(t,e)=>{let r=ns(e);r.compatible=t.compatible,r.description=t.description,r.bindingsPath=t.filePath,r.bus=typeof t.bus=="string"?[t.bus]:Array.from(new Set(t.bus)),r.onBus=t["on-bus"],t.extends?.forEach(s=>r.extends.add(s)),r.warnMismatchProperties=!0;let i=Object.keys(t).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:t[s]}));if(r.cellsValues=i,Object.keys(t.properties??{}).forEach(s=>{let o=t.properties[s];vJ(r,s,o)}),t["child-binding"]){let s=t["child-binding"];r.childNodeType=o=>TS(s,o)}return r},vJ=(t,e,r)=>{let n=t.properties.find(i=>i.getNameMatch(e));if(n&&typeof n.name=="string"){n.required=()=>r.required?"required":"optional",n.values=()=>r.enum??[],n.constValue=$$(r.type,r.const),n.bindingType=r.type;let i=n.additionalTypeCheck;n.additionalTypeCheck=(s,o)=>[...F$(r,e,n)(s,o),...i?.(s,o)??[]]}else{let i=r.type==="compound"?n?.type:q$(r.type);i??=q$(r.type);let s=new Y(e,i,r.required?"required":"optional",void 0,r.enum);s.additionalTypeCheck=(o,a)=>{let c=[...n?.additionalTypeCheck?.(o,a)??[],...F$(r,e,s)(o,a)];return s.signatureArgs??=n?.signatureArgs,s.signatureArgsCyclic??=!!n?.signatureArgsCyclic,c},s.description=r.description?[r.description]:n?.description,s.bindingType=r.type,s.constValue=$$(r.type,r.const),t.addProperty(s)}},F$=(t,e,r)=>{let n=t;return(i,s)=>{let o=i.parent.root,a=[];if(n.const){let l=i.ast.quickValues;if(l?.length==1){let u=Array.isArray(n.const)?n.const:[n.const];if(!(Array.isArray(l[0])&&u.length===l[0].length&&l[0].every((f,p)=>typeof f=="number"&&Number.isNaN(f)||u[p]===f))){let f=i.ast.values??i.ast;a.push(j(24,f.firstToken,f.lastToken,f,{templateStrings:[`Binding expects values to be "${n.type}" with value: ${n.const}`]}))}}}if(n.deprecated&&a.push(j(14,i.ast.firstToken,i.ast.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,tags:[_n.DiagnosticTag.Deprecated],templateStrings:[i.name]})),(n.type==="phandle"||n.type==="phandles"||n.type==="path")&&xe(i.ast.values)?.forEach(u=>{un(u,o)||a.push(j(22,u.firstToken,u.lastToken,u))}),n.type==="path"&&i.ast.values?.values.at(0)?.value instanceof ne){let l=i.ast.values?.values.at(0)?.value,u=[];l.value.split("/").every(d=>{let f=o.getNode(d);return f?u.push(d):a.push(j(23,l.firstToken,l.lastToken,l,{templateStrings:[d,`/${u.join("/")}`]})),!f})}let c=i.name.match(/^(.*)-(\d+)$/);if(n.type==="phandles"&&c){let l="";e.endsWith("-gpios")?l="gpio":l=n["specifier-space"]??c[1];let u=Number.parseInt(c[2],10),d=i.parent.getProperty(`${l}-names`);d&&(d.ast.quickValues?.at(u)||a.push(j(33,i.ast.firstToken,i.ast.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,linkedTo:[d.ast],templateStrings:[i.name,u.toString()]})))}if(n.type==="phandle-array"){let l=xe(i.ast.values),u=0,d=[],f=0;for(;l&&u<l.length;){let p=l.at(u),g=un(p,o);if(!g){let M=p??i.ast;a.push(j(22,M.firstToken,M.lastToken,M));break}let h="";e.endsWith("-gpios")?h="gpio":h=n["specifier-space"]??e.slice(0,-1);let T=g.getProperty(`#${h}-cells`);if(!T){a.push(j(16,i.ast.firstToken,i.ast.lastToken,i.ast,{linkedTo:[...g.nodeNameOrLabelRef],templateStrings:[i.name,`#${h}-cells`,`/${g.path.slice(1).join("/")}`]}));break}let S=T?$e(T,0,0,s)??0:0,_=g.nodeType?.cellsValues?.find(M=>M.specifier===h)?.values;if(d.push([`${f}_phandle`,..._?.map(M=>`${f}_${M}`)??[],...Array.from({length:S-(_?.length??0)},(M,F)=>`${f}_cell${S-(_?.length??0)?F:""}`)]),1+S>l.length-u){let M=p??i.ast;a.push(j(19,M.firstToken,M.lastToken,M,{templateStrings:[i.name,`<${d.at(-1).join(" ")}>`]}));break}u+=1+S;let v=l.slice(u-S,u),R={mappingValuesAst:v,specifierSpace:h,target:g};i.nexusMapsTo.push(R);let C=g.getProperty(`${h}-map`);if(C){let M=g.getNexusMapEntryMatch(h,s,v);M?.match?R.mapItem=M.match:a.push(j(31,M.entry.firstToken,M.entry.lastToken,M.entry,{linkedTo:[C.ast]}))}v.every(M=>M instanceof Ee)&&g.spesifierNexusMapping.push({expressions:v,node:i.parent,property:i});let B=i.parent.getProperty(`${h}-names`);p&&B&&(B.ast.quickValues?.at(f)||a.push(j(33,p.firstToken,l[u-1]?.lastToken,i.ast,{severity:_n.DiagnosticSeverity.Warning,linkedTo:[B.ast],templateStrings:[i.name,f.toString()]}))),f++}d.push([`${f}_phandle`,`${f}_cell...`]),r.signatureArgs=d.map(p=>p.map(g=>_n.ParameterInformation.create(g)))}return a}};var z$=(t,e)=>{let r=t.zephyrBindings.join(":");return e==="Zephyr"&&Va().loadTypeAndCache(t.zephyrBindings,r),{files:t,type:e,getNodeTypes:n=>{switch(e){case"Zephyr":return Va().getNodeTypes(n,r);case"DevicetreeOrg":return{type:gS().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n),issues:[]}}},getBindings:()=>{switch(e){case"Zephyr":return Va().getBindings(r);case"DevicetreeOrg":return gS().getBindings()}},getBusTypes:()=>{switch(e){case"Zephyr":return Va().getBusTypes();case"DevicetreeOrg":return[]}},getDocumentLinks(n){if(!n)return[];switch(e){case"Zephyr":return Va().getDocumentLinks(n,t.zephyrBindings);case"DevicetreeOrg":return[]}}}};var Rm=$(H());var bJ=t=>!t.lastToken.prevToken||!t.lastToken.prevToken.prevToken?[]:[{startLine:t.firstToken.pos.line,startCharacter:t.firstToken.pos.col,endLine:t.lastToken.prevToken.prevToken.pos.line,endCharacter:t.lastToken.prevToken.prevToken.pos.col,kind:Rm.FoldingRangeKind.Comment}],vS=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(vS):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Rm.FoldingRangeKind.Region},...t.nodes.flatMap(vS)],W$=t=>{let e=[];return[...t instanceof ts?t.ifBlocks.map(r=>({start:(r.expression??r.keyword).lastToken,end:r.content?.lastToken??(r.expression??r.keyword).lastToken})):[{start:(t.ifDef.identifier??t.ifDef.keyword).lastToken,end:t.ifDef.content?.lastToken}],t.elseOption?{start:t.elseOption.keyword.lastToken,end:t.elseOption.content?.lastToken}:null].forEach(r=>{!r||!r.end||e.push({startLine:r.start.pos.line,startCharacter:r.start.pos.col,endLine:r.end.pos.line,endCharacter:r.end.pos.colEnd,kind:Rm.FoldingRangeKind.Region})}),e},_J=t=>t instanceof lt?vS(t):t instanceof es||t instanceof ts?W$(t):t instanceof cn?bJ(t):[];function G$(t,e){return e.allAstItems.flatMap(r=>[r,...r.allDescendants]).filter(r=>le(r.uri,t)).flatMap(_J)}var mo=$(H());function SJ(t){if(!t||!(t.ast instanceof Me)&&!(t.ast instanceof Zt))return[];let e=r=>r.nodeType?.bindingsPath?[mo.Location.create(he(r.nodeType.bindingsPath),mo.Range.create(mo.Position.create(0,0),mo.Position.create(0,0)))]:[];return t.item instanceof X&&!Ut(t.ast)?e(t.item):t.ast instanceof Zt&&t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof Me&&t.ast.linksTo?e(t.ast.linksTo):[]}async function K$(t,e){return _t(t,e,r=>[...SJ(r)])}var wm=require("fs");var NJ=(t,e)=>{Ir().reset(t),Ir().requestTokens(t,!0),e(t)},Pm=class{constructor(e,r,n){this.file=e;this.cb=r;this.hasDocumentOpen=n}#e=0;watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,r=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),NJ(e,r)},(0,wm.watchFile)(e,this.onChange)}}unwatch(){this.count===1&&(console.log("dispose watch for",this.file),(0,wm.unwatchFile)(this.file,this.onChange),this.onChange=void 0),this.count--}get count(){return this.#e}set count(e){this.#e=e,e<0&&(this.#e=0,console.warn("unwatching an un watched file",this.file))}};var Xt=$(require("path")),bS=require("fs");var Vn=t=>{if(t)return Array.isArray(t)?t:[t]},kJ=t=>({...t,deviceOrgBindingsMetaSchema:Vn(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Vn(t.deviceOrgTreeBindings),includePaths:Vn(t.includePaths),lockRenameEdits:Vn(t.lockRenameEdits),zephyrBindings:Vn(t.zephyrBindings),overlays:Vn(t.overlays)}),Y$=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Vn(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Vn(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Vn(t.defaultIncludePaths),defaultLockRenameEdits:Vn(t.defaultLockRenameEdits),defaultZephyrBindings:Vn(t.defaultZephyrBindings),contexts:t.contexts?.map(kJ)}),Sn=async(t,e=[])=>([...e.at(0)?[{replace:"${workspaceFolder}",uri:Re(e[0].uri)}]:[],...e.map(n=>({replace:`\${workspaceFolder:${n.name}}`,uri:Re(n.uri)}))].forEach(n=>t=t.replaceAll(n.replace,n.uri)),t),Cs={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0,defaultShowFormattingErrorAsDiagnostics:!0},_S=async(t,e,r)=>{let n=(t.cwd?await Sn(t.cwd,r):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(p=>Sn(p,r))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(p=>Sn(p,r))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(p=>Sn(p,r))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(p=>Sn(p,r))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(p=>Sn(p,r)));n&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[],f=t.compileCommands;return n&&(s=s.map(p=>(0,Xt.resolve)(n,p)).filter(p=>(0,bS.existsSync)(p)),a=a?.map(p=>(0,Xt.resolve)(n,p)),c=c.map(p=>(0,Xt.resolve)(n,p)),i=i.map(p=>(0,Xt.resolve)(n,p)),u=(0,Xt.resolve)(n,u),d=d.map(p=>(0,Xt.resolve)(n,p)),l=l.map(p=>(0,Xt.resolve)(n,p)),f=f?(0,Xt.resolve)(n,f):void 0),{ctxName:t.ctxName??(0,Xt.basename)(u),cwd:n?nt(n):void 0,includePaths:i.map(nt),zephyrBindings:s.map(nt),bindingType:o,deviceOrgTreeBindings:a.map(nt),deviceOrgBindingsMetaSchema:c.map(nt),dtsFile:nt(u),overlays:d.map(nt),lockRenameEdits:l.map(nt),compileCommands:f?nt(f):void 0,showFormattingErrorAsDiagnostics:t.showFormattingErrorAsDiagnostics??e.defaultShowFormattingErrorAsDiagnostics}},mu=async(t,e)=>{let r=t.cwd?await Sn(t.cwd,e):void 0,n=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>Sn(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>Sn(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>Sn(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>Sn(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>Sn(d,e)));r&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Xt.resolve)(r,d)),n==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Xt.resolve)(r,d)),i=i.map(d=>(0,Xt.resolve)(r,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Xt.resolve)(r,d)),c=c.map(d=>(0,Xt.resolve)(r,d)));let l={cwd:r,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:n,autoChangeContext:t.autoChangeContext??Cs.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Cs.allowAdhocContexts,defaultShowFormattingErrorAsDiagnostics:t.defaultShowFormattingErrorAsDiagnostics??Cs.defaultShowFormattingErrorAsDiagnostics},u=(await Promise.all(t.contexts?.map(d=>_S(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,bS.existsSync)(f)&&Xt.default.isAbsolute(f)));return{...l,contexts:u}};var X$=t=>`DT_PROP(${SS(t.parent)}, ${t.name.replaceAll("-","_")}))`,J$=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var SS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Q$=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Z$=t=>{let e=[];return ti.getNodeFromPath(["aliases"],t.root)?.properties.filter(i=>{if(i.ast.quickValues?.at(0)===t.pathString)return!0;let s=i.ast.values?.values.at(0)?.value;if(s instanceof ie&&s.linksTo===t||s instanceof it&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function RJ(t,e){if(!t||!(t.item instanceof Xe)||!(t.ast instanceof et))return[];let r=[];return e.settings.bindingType==="Zephyr"&&(r.push({type:"dt_zephyr_macro_prop_node_path",data:X$(t.item)}),J$(t.item).forEach(n=>{r.push({type:"dt_zephyr_macro_prop_node_label",data:n})})),r}function PJ(t,e){if(!t||t.item===null)return[];let r;if(t.item instanceof X?r=t.item:t.ast.parentNode instanceof ie&&t.ast.parentNode.linksTo?r=t.ast.parentNode.linksTo:t.ast instanceof Me&&t.ast.linksTo&&(r=t.ast.linksTo),!r)return[];let n=[{type:"path",data:r.pathString}];return e.settings.bindingType==="Zephyr"&&(Q$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_node_label",data:i})}),n.push({type:"dt_zephyr_macro_node_path",data:SS(r)}),Z$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),n}async function eB(t,e){return e?_t(t,e,r=>[...PJ(r,e),...RJ(r,e)]):[]}var tB=$(H());function wJ(t){return!t||!(t.item instanceof Xe)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function EJ(t){let e=yc(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let n=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!n||!(n instanceof ei))return;let i=n.params.map(o=>({label:o instanceof Ct?o.name:"..."})),s=e.params.find(o=>o&&(t.ast===o||o.isAncestorOf(t.ast)));return s??=t.afterAst?e.params.find(o=>o&&(t.afterAst===o||o.isAncestorOf(t.afterAst))):void 0,s??=t.beforeAst?e.params.find(o=>o&&(t.beforeAst===o||o.isAncestorOf(t.beforeAst))):void 0,{signatures:[tB.SignatureInformation.create(`${e.functionName.name}(${i.map(o=>o.label).join(", ")})`,void 0,...i.flat())],activeSignature:0,activeParameter:s?e.params.indexOf(s):void 0}}async function rB(t,e){if(e)return(await _t(t,e,async r=>[await EJ(r)||wJ(r)])).at(0)}var nB=require("timers"),iB=require("events");var NS=class extends iB.EventEmitter{constructor(e=3e3,r=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,nB.setInterval)(()=>{let n=process.memoryUsage().heapUsed;n>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(n/1024/1024).toFixed(2),thresholdMb:e})},r)}stop(){clearInterval(this.interval)}},CJ=new NS(3e3),sB=()=>{CJ.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),Bw(),$w()})};var Ve=[],ce,Wa,Em=new WeakMap,gu=new Map;sB();var aB=t=>{t.getContextFiles().forEach(e=>{gu.has(e)||gu.set(e,new Pm(e,CS,r=>!!Dm(r))),gu.get(e)?.watch()})},wS=async t=>{let e=Ve.indexOf(t);if(e===-1)return;Tu(t,void 0,!0),Em.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let r=await As(t);if(te.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:r.type}),Ve.splice(e,1),await IS(),t===ce&&(ce=void 0,Ve.length)){let n=Wa?an(Ve,{uri:Wa}):void 0;n??=Ve[0],console.log("Active context was deleted. Forcing active to",n.id),await Jt({id:n.id},!0)}t.getContextFiles().map(n=>gu.get(n)?.unwatch())},DJ=t=>{let e=Em.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},Fe=async()=>{await Promise.all(Ve.map(DJ))},ES=async t=>(await cB()).indexOf(t)!==-1,cB=async()=>{let t=await lB();return Ve.filter(e=>!t.some(r=>r===e))},lB=async()=>{let t=await PS();return Ve.filter(e=>t.contexts.find(r=>Ni(r)===e.id))},AJ=async()=>{let t=await qJ();return Ve.filter(e=>t.contexts.find(r=>Ni(r)===e.id))},IJ=async t=>(await AJ()).indexOf(t)!==-1,OJ=async(t,e)=>{if(t===e)return!0;let r=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),n=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return n.some(i=>le(i.resolvedPath,t.parser.uri))&&r.length?r.every(i=>n.some(s=>s.resolvedPath===i.resolvedPath&&s.firstToken.pos.col===i.firstToken.pos.col&&s.firstToken.pos.len===i.firstToken.pos.len&&s.firstToken.pos.line===i.firstToken.pos.line&&s.lastToken.pos.col===i.lastToken.pos.col&&s.lastToken.pos.len===i.lastToken.pos.len&&s.lastToken.pos.line===i.lastToken.pos.line)):e.getContextFiles().some(i=>le(i,t.parser.uri))},MJ=async t=>{if(!await ES(t))return;let e=await cB(),r=await lB(),n=await cf(e);if(Ve.indexOf(t)===-1)return;let i=await Promise.all(n.flatMap(a=>[...r,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await OJ(a.context,c)})))),s=t.getContextFiles(),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&le(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&await Promise.all(o.map(wS))},te=(0,We.createConnection)(We.ProposedFeatures.all),gr=new We.TextDocuments(Yn),uB=!1,Cm=!1,dB=!1,fB=!1,pB=!1,kS;te.onInitialize(async t=>{kS=t.workspaceFolders??[],te.console.log(`[Server(${process.pid}) ${kS?.at(0)?.uri} Version 0.6.3 ] Started and initialize received`);let e=t.capabilities;uB=!!(e.workspace&&e.workspace.configuration),Cm=!!(e.workspace&&e.workspace.workspaceFolders),dB=!!e.workspace?.diagnostics?.refreshSupport,fB=!!e.workspace?.semanticTokens?.refreshSupport,pB=!!e.workspace?.foldingRange?.refreshSupport;let r={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:We.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," ",'"',"(",","]},codeActionProvider:{codeActionKinds:[We.CodeActionKind.QuickFix,We.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:rf,tokenModifiers:nf},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return Cm&&(r.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),await yB(t.initializationOptions),r});var RS,xJ={tabSize:8,insertSpaces:!1,trimTrailingWhitespace:!0,insertFinalNewline:!0};te.onInitialized(async()=>{if(uB&&(te.client.register(We.DidChangeConfigurationNotification.type,{}),!RS)){let t=await te.workspace.getConfiguration("editor").catch(()=>{}),e=await te.workspace.getConfiguration("[devicetree]").catch(()=>{}),r={tabSize:e?.["editor.tabSize"],insertSpaces:e?.["editor.insertSpaces"],trimFinalNewlines:e?.["editor.trimFinalNewlines"],trimTrailingWhitespace:e?.["editor.trimTrailingWhitespace"],insertFinalNewline:e?.["editor.insertFinalNewline"]};(t||r)&&(RS={...t,...r})}Cm&&te.workspace.onDidChangeWorkspaceFolders(async t=>{te.console.log("Workspace folder change event received"),await _u()})});te.onRequest("workspace/workspaceFolders",async()=>kS??null);var LJ=async()=>{let t=hB();return t={...Cs,...t},mu(t,await bu())},PS=async()=>{let t=BJ();return t={...Cs,...t},mu(t,await bu())},qJ=async()=>{let t=FJ();return t={...Cs,...t},mu(t,await bu())},vu=async()=>{let t=$J();return t={...Cs,...t},mu(t,await bu())},bu=async()=>Cm?await te.workspace.getWorkspaceFolders()??[]:[],oB=async t=>{let e=an(Ve,{id:Ni(t)});if(e)return e.ctxNames.includes(t.ctxName)||console.log(`(ID: ${e.id}) Adding name ${t.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(t.ctxName),e;let r=Ni(t);console.log(`(ID: ${r}) New context [${t.ctxName}]`),console.log(`(ID: ${r}) Settings: ${JSON.stringify(t,void 0," ")}`);let n=(0,Ga.join)((0,Ga.dirname)(t.dtsFile),"dts","bindings"),i=new qf(t,RS??xJ,t.bindingType?z$({zephyrBindings:t.zephyrBindings?[n,...t.zephyrBindings]:[n],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Ve.push(i),await i.stable(),aB(i);let s=await As(i);return te.sendNotification("devicetree/contextCreated",{ctxNames:i.ctxNames.map(o=>o.toString()),id:i.id,...await i.getFileTree(),settings:i.settings,active:i===ce,type:s.type}),await MJ(i),await IS(),i},_u=async()=>{let t=await PS(),e=await vu();e.allowAdhocContexts||(e=await PS());let r=e.contexts.map(Ni),n=Ve.filter(i=>!r.includes(i.id));await Promise.all(n.map(wS)),await t.contexts?.reduce((i,s)=>i.then(async()=>{await oB(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await LJ()).contexts?.reduce((s,o)=>s.then(async()=>{an(Ve,{uri:o.dtsFile})||await oB(o)}),Promise.resolve()),Wa?await Jt({uri:Wa}):!ce&&Ve.length&&(console.log(`No active context using first context (ID: ${Ve[0].id}) [${Ve[0].ctxNames.join(",")}]`),await Jt({id:Ve[0].id}))},Nn,Ds,yu=new Map,za=new Map,$J=()=>!Ds&&!Nn?void 0:{...Ds,...Nn,contexts:[...Nn?.contexts??[],...Array.from(za.values()),...Array.from(yu.values())]},hB=()=>!Ds&&!Nn?void 0:{...Ds,...Nn,contexts:[...Array.from(yu.values())]},BJ=()=>!Ds&&!Nn?void 0:{...Ds,...Nn,contexts:[...Nn?.contexts??[],...Array.from(za.values())]},FJ=()=>!Ds&&!Nn?void 0:{...Nn,contexts:[...Nn?.contexts??[]]};function jJ(t){let e={...t};for(let r in e)e[r]===null&&delete e[r];return e}var mB=async()=>{let t=await vu();console.log("Resolved settings",JSON.stringify(t,void 0," ")),te.sendNotification("devicetree/settingsChanged",t),await _u(),Fe().then(()=>{dB&&te.languages.diagnostics.refresh()})},UJ=async()=>{let t=ce?.getContextFiles();await Promise.all(Array.from(gr.keys()).filter(Bt).map(async e=>{t?.some(r=>le(r,Re(e)))||await te.sendDiagnostics({uri:e,version:gr.get(e)?.version,diagnostics:[{severity:We.DiagnosticSeverity.Information,range:We.Range.create(We.Position.create(0,0),We.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})}))},CS=async t=>{let e=xy(Ve,t);if(e.length)e.sort((r,n)=>r===ce?-1:n===ce?1:0).forEach(r=>{Em.get(r)?.abort.abort();let n=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(n.signal.aborted){s();return}let o=performance.now(),a=ce===r,c=a?gB(r):[],l=r.getContextFiles();await r.reevaluate(t),aB(r),l.forEach(p=>gu.get(p)?.unwatch()),a&&OS(r)?.length&&DS(r).then(p=>{let g=p.items.map(h=>({uri:h.uri,version:h.version??void 0,diagnostics:h.items}));Tu(r,c.filter(h=>g.every(T=>T.uri!==h.uri))),g.forEach(h=>{te.sendDiagnostics(h)}),Su.set(r,!0)});let[u,d]=await Promise.all([As(r),r.getFileTree()]),f={ctxNames:r.ctxNames.map(p=>p.toString()),id:r.id,...d,settings:r.settings,active:a,type:u.type};ce===r&&te.sendNotification("devicetree/activeContextStableNotification",f),te.sendNotification("devicetree/contextStableNotification",f),s(),console.log("reevaluate",performance.now()-o)},50)});Em.set(r,{abort:n,promise:i})});else{if((await vu()).allowAdhocContexts===!1)return;await _u(),await Jt({uri:t})}},HJ=t=>gr.keys().find(e=>le(Re(e),t)),Dm=t=>{let e=HJ(t);if(e)return gr.get(e)},gB=t=>t.getContextFiles().map(e=>({uri:he(e),version:Dm(e)?.version,diagnostics:[]})),Su=new WeakMap,Tu=async(t,e=gB(t),r=!1)=>{if(!r&&t!==ce)return;let n=performance.now();await Promise.all(e.filter(i=>t===ce||!ce?.getContextFiles().some(s=>le(Re(i.uri),s))).map(i=>te.sendDiagnostics({uri:i.uri,version:gr.get(i.uri)?.version,diagnostics:[]}))),Su.delete(t),console.log(`(ID: ${t.id})`,"clear workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-n)},DS=async t=>{await t.stable();let e=performance.now(),r=await t.getDiagnostics(),n=await Promise.all(t.getContextFiles().map(async i=>{let s=Dm(i),o=[];return s&&t.settings.showFormattingErrorAsDiagnostics&&o.push(...(await Rf({textDocument:s,options:t.formattingOptions},t,s?.getText(),"File Diagnostics")).map(a=>a.diagnostic())),{uri:he(i),kind:We.DocumentDiagnosticReportKind.Full,items:[...r.get(i)??[],...o],version:s?.version??null}}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...n]}},AS=async t=>{let{items:e}=await DS(t);e.map(r=>({uri:r.uri,version:r.version??void 0,diagnostics:r.items})).forEach(async r=>{te.sendDiagnostics(r)}),Su.set(t,!0)},IS=async()=>{let t=await Promise.all(Ve.map(As));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,ce===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},As=async t=>{let e=await ES(t),r=!e&&await IJ(t);return{ctx:t,type:e?"Ad Hoc":r?"User":"3rd Party"}},Jt=async(t,e=!1)=>{if("uri"in t){if(!Bt(t.uri))return!1;Wa=t.uri,console.log("Active File Uri",Wa)}let r=await vu();if(ce&&!e&&!r.autoChangeContext||(await Fe(),!e&&ce?.getContextFiles().find(o=>"uri"in t&&le(o,t.uri))))return!1;let n=ce,i=an(Ve,t),s=n!==i;return s&&(n&&Tu(n),ce=i,i?(As(i).then(async o=>{let a=await i.getFileTree();!i||i!==ce&&!Ve.includes(i)||te.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(c=>c.toString()),id:i.id,...a,settings:i.settings,active:ce===i,type:o.type})}),OS(i)?.length&&AS(i),await IS()):te.sendNotification("devicetree/newActiveContext",void 0)),pB&&te.languages.foldingRange.refresh(),fB&&te.languages.semanticTokens.refresh(),s},Bt=t=>[".dts",".dtsi",".dtso",".overlay"].some(e=>t.endsWith(e));gr.listen(te);var OS=t=>t?.getContextFiles()?.filter(e=>Dm(e));gr.onDidClose(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;let r=xy(Ve,e);if(r.length===0){yu.delete(e),te.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(r.map(async n=>{!!OS(n)?.filter(s=>s!==e).length?ce?.getContextFiles().some(s=>le(s,e))?ce?.getContextFiles().some(s=>le(s,e))&&(await Tu(ce),await AS(ce)):te.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]}):await ES(n)?(await wS(n),yu.delete(n.settings.dtsFile)):Tu(n)}))});gr.onDidOpen(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;await Fe(),UJ();let r=an(Ve,{uri:e});if(console.log("onDidOpen",r?.id,e),r)r!==ce?await Jt({id:r.id}):r===ce&&(!Su.get(r)||r.getContextFiles().some(n=>!le(n,e)))&&await AS(r);else{let n={ctxName:(0,Ga.basename)(e),dtsFile:e};yu.set(e,n),await CS(e)}});gr.onDidChangeContent(async t=>{let e=Re(t.document.uri);if(!Bt(e))return;let r=t.document.getText(),n=Ir();n.needsRenew(e,r)&&(console.log("Content changed"),n.renewLexer(e,r),await CS(e))});var yB=async t=>{t?.settings?.devicetree&&(Nn=Y$(jJ(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await mB())};te.onDidChangeConfiguration(async t=>{await yB(t)});te.listen();te.languages.diagnostics.onWorkspace(async()=>{await Fe();let t=ce;return t?DS(t).finally(()=>{Su.set(t,!0)}):{items:[]}});te.onDidChangeWatchedFiles(t=>{te.console.log("We received a file change event")});te.onCompletion(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return nA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return[];await Fe(),Jt({uri:e});let r=yr(e);return r?[...await jC(t,r),...await bA(t,r)]:[]});te.onCompletionResolve(t=>t);var yr=t=>{let e=hB();return an(Ve,{uri:t},ce,e?.preferredContext)};te.onDocumentSymbol(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return[];await Fe();let r=yr(e);return r?r.getUriParser(e)?.getDocumentSymbols(e):[]});te.onWorkspaceSymbol(async()=>{await Fe();let t=ce;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});te.languages.semanticTokens.on(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return{data:[]};try{await Fe();let r=yr(e),n=new We.SemanticTokensBuilder,i=r?.isInContext(e);return!r||!i?{data:[]}:((await r.getAllParsers()).forEach(s=>s.buildSemanticTokens(n,e)),n.build())}catch(r){throw console.log(r),r}});te.onDocumentLinks(async t=>{await Fe();let e=Re(t.textDocument.uri);return Bt(e)?yr(e)?.getDocumentLinks(e):e.endsWith(".yaml")&&ce?ce.bindingLoader?.getDocumentLinks?.(gr.get(t.textDocument.uri))??[]:[]});te.onPrepareRename(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return lA(t,r)});te.onRenameRequest(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return cA(t,r)});te.onReferences(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return iA(t,r)});te.onDefinition(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return hA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e),n=(await r?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>We.Location.create(i.target,i.range))??[];return n.length?n:fA(t,r)});te.onDeclaration(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return gA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return pA(t,r)});te.onCodeAction(async t=>{let e=Re(t.textDocument.uri);if(Bt(e))return TA(t)});var TB=async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);if(!r)return[];if((await r.getSyntaxIssues(void 0,l=>Vo(l,e,!1))).get(e)?.length)return[];let i=Ir().getDocument(e),s=i.getText(),o=await Rf(t,r,s,"New Text");if(o===s)return[];let a=i.lineCount-1,c=i.getText({start:{line:a,character:0},end:{line:a+1,character:0}}).length;return[We.TextEdit.replace(We.Range.create(We.Position.create(0,0),We.Position.create(i.lineCount,c)),o)]};te.onDocumentRangeFormatting(TB);te.onDocumentFormatting(TB);te.onHover(async t=>{let e=Re(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return HI(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await Fe();let r=yr(e);return(await _A(t,r)).at(0)});te.onFoldingRanges(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe();let r=yr(e),n=r?.isInContext(e);if(!r||!n)return[];let i=(await r.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?G$(e,i):[]});te.onTypeDefinition(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return K$(t,r)});te.onSignatureHelp(async t=>{let e=Re(t.textDocument.uri);if(!Bt(e))return;await Fe(),Jt({uri:e});let r=yr(e);return rB(t,r)});te.onRequest("devicetree/getContexts",async()=>(await Fe(),Promise.all(Ve.map(async t=>{let e=await As(t);return{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:e.type}}))));te.onRequest("devicetree/setActive",async t=>(await Fe(),console.log("devicetree/setActive",t),await Jt(t,!0)));te.onRequest("devicetree/getActiveContext",async()=>{if(await Fe(),console.log("devicetree/getActiveContext"),!ce)return;let t=await As(ce);return ce?{ctxNames:ce.ctxNames.map(e=>e.toString()),id:ce.id,...await ce.getFileTree(),settings:ce.settings,active:!0,type:t.type}:void 0});te.onRequest("devicetree/setDefaultSettings",async t=>{await Fe(),Ds=t,console.log("Integration Settings",t),await mB()});te.onRequest("devicetree/requestContext",async t=>{await Fe();let e=await vu(),r=await _S(t,e,await bu());console.log("devicetree/requestContext",r);let n=Ni(r),i=Array.from(za).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];an(Ve,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),za.delete(i[0])}za.set(`${n}:${t.ctxName}`,t),await _u();let s=Ve.find(a=>a.id===n);if(!s)throw new Error("Failed to create context");let o=await As(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:n,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});te.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await Fe(),za.delete(`${t}:${e}`);let r=an(Ve,{id:t});if(r){if(r.removeCtxName(e),r.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await _u()}});te.onRequest("devicetree/compiledDtsOutput",async t=>{if(await Fe(),!t)return;let e=an(Ve,{id:t});if(!e)return;let r=await e.toFullString();return Hy({textDocument:{uri:he(e.settings.dtsFile)},options:e.formattingOptions},r,"New Text")});te.onRequest("devicetree/serializedContext",async t=>(await Fe(),t?an(Ve,{id:t})?.serialize():void 0));te.onRequest("devicetree/activePath",async t=>{if(await Fe(),!ce)return;let e=r=>{if(r?.item)return r.item instanceof X?{nodePath:r.item.pathString}:{nodePath:r.item.parent.pathString,propertyName:r.item.name}};return(await _t(t,ce,r=>[e(r)])).at(0)});te.onRequest("devicetree/customActions",async t=>(await Fe(),eB(t,ce)));te.onRequest("devicetree/activeFileUri",async t=>{await Fe(),Jt({uri:t})});var VJ=async(t,e,r)=>{if((await e.getSyntaxIssues(void 0,o=>Vo(o,r,!1))).get(r)?.length)throw new Error("Unable to format. Files has syntax issues.");let i=Ir().getDocument(r);return await Rf(t,e,i.getText(),"New Text")};te.onRequest("devicetree/formattingText",async t=>{await Fe();let e=Re(t.textDocument.uri),r=yr(e);if(r)return Jt({uri:e}),VJ(t,r,e);let n=Ir().getDocument(e,t.text),i=await Hy(t,n.getText(),"Both");return{text:i.text,diagnostics:i.diagnostic.map(s=>s.diagnostic())}});te.onRequest("devicetree/diagnosticIssues",async({uri:t,full:e})=>{await Fe();let r=Re(t);Jt({uri:r});let n=yr(r);if(!n)return[];let i=e?(await n.getDiagnostics()).get(r):(await n.getSyntaxIssues(void 0,s=>Vo(s,r,!!e))).get(r);if(i?.length)return i});te.onRequest("devicetree/evalMacros",async({macros:t,ctxId:e})=>{await Fe();let r=an(Ve,{id:e});return r?t.map(n=>{let i=sf(n,r.macros),s=Ce(i);return{macro:n,evaluated:typeof s=="number"?s:i}}):[]});